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

# automations

# `prefect.events.schemas.automations`

## Functions

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

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

Discriminator for triggers that defaults to 'event' if no type is specified.

## Classes

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

**Methods:**

#### `auto` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/utilities/collections.py#L70](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/utilities/collections.py#L70)</sup>

```python theme={null}
auto() -> str
```

Exposes `enum.auto()` to avoid requiring a second import to use `AutoEnum`

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

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

**Methods:**

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

```python theme={null}
actions(self) -> List[ActionTypes]
```

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

```python theme={null}
as_automation(self) -> 'AutomationCore'
```

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

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

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

#### `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]
```

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

```python theme={null}
owner_resource(self) -> Optional[str]
```

#### `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.

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

```python theme={null}
set_deployment_id(self, deployment_id: UUID) -> None
```

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

Base class for triggers that may filter by the labels of resources.

**Methods:**

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

```python theme={null}
actions(self) -> List[ActionTypes]
```

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

```python theme={null}
as_automation(self) -> 'AutomationCore'
```

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

```python theme={null}
coerce_match(cls, v: Any) -> Any
```

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

```python theme={null}
coerce_match_related(cls, v: Any) -> Any
```

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

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

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

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

```python theme={null}
owner_resource(self) -> Optional[str]
```

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

```python theme={null}
set_deployment_id(self, deployment_id: UUID) -> None
```

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

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

**Methods:**

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

```python theme={null}
coerce_match(cls, v: Any) -> Any
```

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

```python theme={null}
coerce_match_related(cls, v: Any) -> Any
```

#### `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]
```

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

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

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

Defines a subset of the Trigger subclass, which is specific
to Metric automations, that specify the query configurations
and breaching conditions for the Automation

**Methods:**

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

```python theme={null}
enforce_minimum_range(cls, value: timedelta) -> timedelta
```

#### `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.

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

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

**Methods:**

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

```python theme={null}
coerce_match(cls, v: Any) -> Any
```

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

```python theme={null}
coerce_match_related(cls, v: Any) -> Any
```

#### `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

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

Requires some number of triggers to have fired within the given time period.

**Methods:**

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

```python theme={null}
actions(self) -> List[ActionTypes]
```

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

```python theme={null}
as_automation(self) -> 'AutomationCore'
```

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

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

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

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

```python theme={null}
owner_resource(self) -> Optional[str]
```

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

```python theme={null}
set_deployment_id(self, deployment_id: UUID) -> None
```

### `CompoundTrigger` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L381](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L381)</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
```

### `SequenceTrigger` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L418](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/schemas/automations.py#L418)</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

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

Defines an action a user wants to take when a certain number of events
do or don't happen to the matching resources

**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.

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