Skip to main content

Create an automation

On the Automations page, select the + icon to create a new automation. You’ll be prompted to configure:
  • A trigger condition that causes the automation to execute.
  • One or more actions carried out by the automation.
  • Details about the automation, such as a name and description.
You can manage automations with the Prefect CLI, Terraform provider, or Prefect API.

Create automations with the CLI

You can create automations from YAML or JSON files using the Prefect CLI:

Single automation example

Here’s an example YAML file that creates an automation to cancel long-running flows:

Multiple automations example

You can also create multiple automations at once by using the automations: key. If any automation fails to create, the command will continue with the remaining automations and report both successes and failures:
Or as a JSON array:

Create automations with the Python SDK

You can create and access any automation with the Python SDK’s Automation class and its methods.