- creating flow runs from existing deployments
- pausing and resuming schedules or work pools
- sending custom notifications
Triggers
Triggers specify the conditions under which your action should be performed. The Prefect UI includes templates for many common conditions, such as:- Flow run state change (Flow Run Tags are only evaluated with
OR
criteria) - Work pool status
- Work queue status
- Deployment status
- Metric thresholds, such as average duration, lateness, or completion percentage
- Custom event triggers

Actions
Actions specify what your automation does when its trigger criteria are met. Current action types include:- Cancel a flow run
- Pause or resume a schedule
- Run a deployment
- Pause or resume a deployment schedule
- Pause or resume a work pool
- Pause or resume a work queue
- Pause or resume an automation
- Send a notification
- Call a webhook
- Suspend a flow run
- Change the state of a flow run

Selected and inferred action targets
Some actions require you to either select the target of the action, or specify that the target of the action should be inferred. Selected targets are simple and useful for when you know exactly what object your action should act on. For example, the case of a cleanup flow you want to run or a specific notification you want to send. Inferred targets are deduced from the trigger itself. For example, if a trigger fires on a flow run that is stuck in a running state, and the action is to cancel an inferred flow run—the flow run that caused the trigger to fire. Similarly, if a trigger fires on a work queue event and the corresponding action is to pause an inferred work queue, the inferred work queue is the one that emitted the event. Prefect infers the relevant event whenever possible, but sometimes one does not exist. Specify a name and, optionally, a description for the automation.Sending notifications with automations
Automations support sending notifications through any predefined block that is capable of and configured to send a message, including:- Slack message to a channel
- Microsoft Teams message to a channel
- Email to an email address

Templating with Jinja
You can access templated variables with automation actions through Jinja syntax. Templated variables enable you to dynamically include details from an automation trigger, such as a flow or pool name. Jinja templated variable syntax wraps the variable name in double curly brackets, like this:{{ variable }}
.
You can access properties of the underlying flow run objects including:
In addition to its native properties, each object includes an id
along with created
and updated
timestamps.
The flow_run|ui_url
token returns the URL to view the flow run in the UI.
Here’s an example relevant to a flow run state-based notification:

flow
and deployment
properties:
work_pool
properties:
Further reading
- To learn more about Prefect events, which can trigger automations, see the events docs.
- See the webhooks guide to learn how to create webhooks and receive external events.