> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# deployment_triggers

# `prefect.events.schemas.deployment_triggers`

Schemas for defining triggers within a Prefect deployment YAML.  This is a separate
parallel hierarchy for representing triggers so that they can also include the
information necessary to create an automation.

These triggers should follow the validation rules of the main Trigger class hierarchy as
closely as possible (because otherwise users will get validation errors creating
triggers), but we can be more liberal with the defaults here to make it simpler to
create them from YAML.

## Functions

### `deployment_trigger_discriminator` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment\_triggers.py#L114](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment_triggers.py#L114)</sup>

```python theme={null}
deployment_trigger_discriminator(value: Any) -> str
```

Custom discriminator for deployment triggers that defaults to 'event' if no type is specified.

## Classes

### `BaseDeploymentTrigger` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment\_triggers.py#L39](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment_triggers.py#L39)</sup>

Base class describing a set of criteria that must be satisfied in order to trigger
an automation.

**Methods:**

#### `model_validate_list` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/\_internal/schemas/bases.py#L56](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L56)</sup>

```python theme={null}
model_validate_list(cls, obj: Any) -> list[Self]
```

#### `reset_fields` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/\_internal/schemas/bases.py#L85](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L85)</sup>

```python theme={null}
reset_fields(self: Self) -> Self
```

Reset the fields of the model that are in the `_reset_fields` set.

**Returns:**

* A new instance of the model with the reset fields.

### `DeploymentEventTrigger` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment\_triggers.py#L83](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment_triggers.py#L83)</sup>

A trigger that fires based on the presence or absence of events within a given
period of time.

**Methods:**

#### `describe_for_cli` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L251](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L251)</sup>

```python theme={null}
describe_for_cli(self, indent: int = 0) -> str
```

Return a human-readable description of this trigger for the CLI

#### `enforce_minimum_within_for_proactive_triggers` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L216](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L216)</sup>

```python theme={null}
enforce_minimum_within_for_proactive_triggers(cls, data: Dict[str, Any]) -> Dict[str, Any]
```

### `DeploymentMetricTrigger` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment\_triggers.py#L92](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment_triggers.py#L92)</sup>

A trigger that fires based on the results of a metric query.

**Methods:**

#### `describe_for_cli` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L351](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L351)</sup>

```python theme={null}
describe_for_cli(self, indent: int = 0) -> str
```

Return a human-readable description of this trigger for the CLI

### `DeploymentCompoundTrigger` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment\_triggers.py#L100](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment_triggers.py#L100)</sup>

A composite trigger that requires some number of triggers to have
fired within the given time period

**Methods:**

#### `describe_for_cli` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L400](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L400)</sup>

```python theme={null}
describe_for_cli(self, indent: int = 0) -> str
```

Return a human-readable description of this trigger for the CLI

#### `validate_require` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L389](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L389)</sup>

```python theme={null}
validate_require(self) -> Self
```

### `DeploymentSequenceTrigger` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment\_triggers.py#L107](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/deployment_triggers.py#L107)</sup>

A composite trigger that requires some number of triggers to have fired
within the given time period in a specific order

**Methods:**

#### `describe_for_cli` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L424](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L424)</sup>

```python theme={null}
describe_for_cli(self, indent: int = 0) -> str
```

Return a human-readable description of this trigger for the CLI
