---
title: "Create Automation"
method: POST
path: "/api/automations/"
tags: ["Automations"]
---

# Create Automation

`POST /api/automations/`

## Headers

- `x-prefect-api-version` string

## Request body

- AutomationCreate — Defines an action a user wants to take when a certain number of events do or don't happen to the matching resources
  - `name` string, required — The name of this automation
  - `description` string — A longer description of this automation
  - `enabled` boolean — Whether this automation will be evaluated
  - `trigger` union, required — The criteria for which events this Automation covers and how it will respond to the presence or absence of those events
    - EventTrigger — A trigger that fires based on the presence or absence of events within a given period of time.
      - `type` 'event'
      - `id` string, uuid — The unique ID of this trigger
      - `match` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
      - `match_related` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
      - `after` string[] — The event(s) which must first been seen to fire this trigger. If empty, then fire this trigger immediately. Events may include trailing wildcards, like `prefect.flow-run.*`
      - `expect` string[] — The event(s) this trigger is expecting to see. If empty, this trigger will match any event. Events may include trailing wildcards, like `prefect.flow-run.*`
      - `for_each` string[] — Evaluate the trigger separately for each distinct value of these labels on the resource. By default, labels refer to the primary resource of the triggering event. You may also refer to labels from related resources by specifying `related:<role>:<label>`. This will use the value of that label for the first related resource in that role. For example, `"for_each": ["related:flow:prefect.resource.id"]` would evaluate the trigger for each flow.
      - `posture` 'Reactive' | 'Proactive', required — The posture of this trigger, either Reactive or Proactive. Reactive triggers respond to the _presence_ of the expected events, while Proactive triggers respond to the _absence_ of those expected events.
      - `threshold` integer — The number of events required for this trigger to fire (for Reactive triggers), or the number of events expected (for Proactive triggers)
      - `within` number — The time period over which the events must occur. For Reactive triggers, this may be as low as 0 seconds, but must be at least 10 seconds for Proactive triggers
    - CompoundTrigger — A composite trigger that requires some number of triggers to have fired within the given time period
      - `type` 'compound'
      - `id` string, uuid — The unique ID of this trigger
      - `triggers` union[], required
        - union
          - EventTrigger — A trigger that fires based on the presence or absence of events within a given period of time.
            - `type` 'event'
            - `id` string, uuid — The unique ID of this trigger
            - `match` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
            - `match_related` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
            - `after` string[] — The event(s) which must first been seen to fire this trigger. If empty, then fire this trigger immediately. Events may include trailing wildcards, like `prefect.flow-run.*`
            - `expect` string[] — The event(s) this trigger is expecting to see. If empty, this trigger will match any event. Events may include trailing wildcards, like `prefect.flow-run.*`
            - `for_each` string[] — Evaluate the trigger separately for each distinct value of these labels on the resource. By default, labels refer to the primary resource of the triggering event. You may also refer to labels from related resources by specifying `related:<role>:<label>`. This will use the value of that label for the first related resource in that role. For example, `"for_each": ["related:flow:prefect.resource.id"]` would evaluate the trigger for each flow.
            - `posture` 'Reactive' | 'Proactive', required — The posture of this trigger, either Reactive or Proactive. Reactive triggers respond to the _presence_ of the expected events, while Proactive triggers respond to the _absence_ of those expected events.
            - `threshold` integer — The number of events required for this trigger to fire (for Reactive triggers), or the number of events expected (for Proactive triggers)
            - `within` number — The time period over which the events must occur. For Reactive triggers, this may be as low as 0 seconds, but must be at least 10 seconds for Proactive triggers
          - CompoundTrigger — recursive
          - SequenceTrigger — A composite trigger that requires some number of triggers to have fired within the given time period in a specific order
            - `type` 'sequence'
            - `id` string, uuid — The unique ID of this trigger
            - `triggers` union[], required
              - …
            - `within` number
      - `within` number
      - `require` union, required
        - integer
        - 'any' | 'all'
    - SequenceTrigger — A composite trigger that requires some number of triggers to have fired within the given time period in a specific order
      - `type` 'sequence'
      - `id` string, uuid — The unique ID of this trigger
      - `triggers` union[], required
        - union
          - EventTrigger — A trigger that fires based on the presence or absence of events within a given period of time.
            - `type` 'event'
            - `id` string, uuid — The unique ID of this trigger
            - `match` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
            - `match_related` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
            - `after` string[] — The event(s) which must first been seen to fire this trigger. If empty, then fire this trigger immediately. Events may include trailing wildcards, like `prefect.flow-run.*`
            - `expect` string[] — The event(s) this trigger is expecting to see. If empty, this trigger will match any event. Events may include trailing wildcards, like `prefect.flow-run.*`
            - `for_each` string[] — Evaluate the trigger separately for each distinct value of these labels on the resource. By default, labels refer to the primary resource of the triggering event. You may also refer to labels from related resources by specifying `related:<role>:<label>`. This will use the value of that label for the first related resource in that role. For example, `"for_each": ["related:flow:prefect.resource.id"]` would evaluate the trigger for each flow.
            - `posture` 'Reactive' | 'Proactive', required — The posture of this trigger, either Reactive or Proactive. Reactive triggers respond to the _presence_ of the expected events, while Proactive triggers respond to the _absence_ of those expected events.
            - `threshold` integer — The number of events required for this trigger to fire (for Reactive triggers), or the number of events expected (for Proactive triggers)
            - `within` number — The time period over which the events must occur. For Reactive triggers, this may be as low as 0 seconds, but must be at least 10 seconds for Proactive triggers
          - CompoundTrigger — A composite trigger that requires some number of triggers to have fired within the given time period
            - `type` 'compound'
            - `id` string, uuid — The unique ID of this trigger
            - `triggers` union[], required
              - …
            - `within` number
            - `require` union, required
              - …
          - SequenceTrigger — recursive
      - `within` number
  - `actions` union[], required — The actions to perform when this Automation triggers
    - union
      - DoNothing — Do nothing when an Automation is triggered
        - `type` 'do-nothing'
      - RunDeployment — Runs the given deployment with the given parameters
        - `type` 'run-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
        - `parameters` object — The parameters to pass to the deployment, or None to use the deployment's default parameters
        - `job_variables` object — The job variables to pass to the created flow run, or None to use the deployment's default job variables
      - PauseDeployment — Pauses the given Deployment
        - `type` 'pause-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - ResumeDeployment — Resumes the given Deployment
        - `type` 'resume-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - CancelFlowRun — Cancels a flow run associated with the trigger
        - `type` 'cancel-flow-run'
      - ChangeFlowRunState — Changes the state of a flow run associated with the trigger
        - `type` 'change-flow-run-state'
        - `name` string — The name of the state to change the flow run to
        - `state` 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING', required — Enumeration of state types.
        - `message` string — An optional message to associate with the state change
      - PauseWorkQueue — Pauses a Work Queue
        - `type` 'pause-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - ResumeWorkQueue — Resumes a Work Queue
        - `type` 'resume-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - SendNotification — Send a notification when an Automation is triggered
        - `type` 'send-notification'
        - `block_document_id` string, uuid, required — The identifier of the notification block to use
        - `subject` string
        - `body` string, required — The text of the notification to send
      - CallWebhook — Call a webhook when an Automation is triggered.
        - `type` 'call-webhook'
        - `block_document_id` string, uuid, required — The identifier of the webhook block to use
        - `payload` string — An optional templatable payload to send when calling the webhook.
      - PauseAutomation — Pauses a Work Queue
        - `type` 'pause-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - ResumeAutomation — Resumes a Work Queue
        - `type` 'resume-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - SuspendFlowRun — Suspends a flow run associated with the trigger
        - `type` 'suspend-flow-run'
      - PauseWorkPool — Pauses a Work Pool
        - `type` 'pause-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
      - ResumeWorkPool — Resumes a Work Pool
        - `type` 'resume-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
  - `actions_on_trigger` union[] — The actions to perform when an Automation goes into a triggered state
    - union
      - DoNothing — Do nothing when an Automation is triggered
        - `type` 'do-nothing'
      - RunDeployment — Runs the given deployment with the given parameters
        - `type` 'run-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
        - `parameters` object — The parameters to pass to the deployment, or None to use the deployment's default parameters
        - `job_variables` object — The job variables to pass to the created flow run, or None to use the deployment's default job variables
      - PauseDeployment — Pauses the given Deployment
        - `type` 'pause-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - ResumeDeployment — Resumes the given Deployment
        - `type` 'resume-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - CancelFlowRun — Cancels a flow run associated with the trigger
        - `type` 'cancel-flow-run'
      - ChangeFlowRunState — Changes the state of a flow run associated with the trigger
        - `type` 'change-flow-run-state'
        - `name` string — The name of the state to change the flow run to
        - `state` 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING', required — Enumeration of state types.
        - `message` string — An optional message to associate with the state change
      - PauseWorkQueue — Pauses a Work Queue
        - `type` 'pause-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - ResumeWorkQueue — Resumes a Work Queue
        - `type` 'resume-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - SendNotification — Send a notification when an Automation is triggered
        - `type` 'send-notification'
        - `block_document_id` string, uuid, required — The identifier of the notification block to use
        - `subject` string
        - `body` string, required — The text of the notification to send
      - CallWebhook — Call a webhook when an Automation is triggered.
        - `type` 'call-webhook'
        - `block_document_id` string, uuid, required — The identifier of the webhook block to use
        - `payload` string — An optional templatable payload to send when calling the webhook.
      - PauseAutomation — Pauses a Work Queue
        - `type` 'pause-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - ResumeAutomation — Resumes a Work Queue
        - `type` 'resume-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - SuspendFlowRun — Suspends a flow run associated with the trigger
        - `type` 'suspend-flow-run'
      - PauseWorkPool — Pauses a Work Pool
        - `type` 'pause-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
      - ResumeWorkPool — Resumes a Work Pool
        - `type` 'resume-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
  - `actions_on_resolve` union[] — The actions to perform when an Automation goes into a resolving state
    - union
      - DoNothing — Do nothing when an Automation is triggered
        - `type` 'do-nothing'
      - RunDeployment — Runs the given deployment with the given parameters
        - `type` 'run-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
        - `parameters` object — The parameters to pass to the deployment, or None to use the deployment's default parameters
        - `job_variables` object — The job variables to pass to the created flow run, or None to use the deployment's default job variables
      - PauseDeployment — Pauses the given Deployment
        - `type` 'pause-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - ResumeDeployment — Resumes the given Deployment
        - `type` 'resume-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - CancelFlowRun — Cancels a flow run associated with the trigger
        - `type` 'cancel-flow-run'
      - ChangeFlowRunState — Changes the state of a flow run associated with the trigger
        - `type` 'change-flow-run-state'
        - `name` string — The name of the state to change the flow run to
        - `state` 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING', required — Enumeration of state types.
        - `message` string — An optional message to associate with the state change
      - PauseWorkQueue — Pauses a Work Queue
        - `type` 'pause-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - ResumeWorkQueue — Resumes a Work Queue
        - `type` 'resume-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - SendNotification — Send a notification when an Automation is triggered
        - `type` 'send-notification'
        - `block_document_id` string, uuid, required — The identifier of the notification block to use
        - `subject` string
        - `body` string, required — The text of the notification to send
      - CallWebhook — Call a webhook when an Automation is triggered.
        - `type` 'call-webhook'
        - `block_document_id` string, uuid, required — The identifier of the webhook block to use
        - `payload` string — An optional templatable payload to send when calling the webhook.
      - PauseAutomation — Pauses a Work Queue
        - `type` 'pause-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - ResumeAutomation — Resumes a Work Queue
        - `type` 'resume-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - SuspendFlowRun — Suspends a flow run associated with the trigger
        - `type` 'suspend-flow-run'
      - PauseWorkPool — Pauses a Work Pool
        - `type` 'pause-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
      - ResumeWorkPool — Resumes a Work Pool
        - `type` 'resume-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
  - `owner_resource` string — The resource to which this automation belongs

## Response `201`

Successful Response

- Automation — A PrefectBaseModel with an auto-generated UUID ID value and created / updated timestamps, intended for compatibility with our standard ORM models. The ID, created, and updated fields are reset on copy() and not included in equality comparisons.
  - `name` string, required — The name of this automation
  - `description` string — A longer description of this automation
  - `enabled` boolean — Whether this automation will be evaluated
  - `trigger` union, required — The criteria for which events this Automation covers and how it will respond to the presence or absence of those events
    - EventTrigger — A trigger that fires based on the presence or absence of events within a given period of time.
      - `type` 'event'
      - `id` string, uuid — The unique ID of this trigger
      - `match` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
      - `match_related` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
      - `after` string[] — The event(s) which must first been seen to fire this trigger. If empty, then fire this trigger immediately. Events may include trailing wildcards, like `prefect.flow-run.*`
      - `expect` string[] — The event(s) this trigger is expecting to see. If empty, this trigger will match any event. Events may include trailing wildcards, like `prefect.flow-run.*`
      - `for_each` string[] — Evaluate the trigger separately for each distinct value of these labels on the resource. By default, labels refer to the primary resource of the triggering event. You may also refer to labels from related resources by specifying `related:<role>:<label>`. This will use the value of that label for the first related resource in that role. For example, `"for_each": ["related:flow:prefect.resource.id"]` would evaluate the trigger for each flow.
      - `posture` 'Reactive' | 'Proactive', required — The posture of this trigger, either Reactive or Proactive. Reactive triggers respond to the _presence_ of the expected events, while Proactive triggers respond to the _absence_ of those expected events.
      - `threshold` integer — The number of events required for this trigger to fire (for Reactive triggers), or the number of events expected (for Proactive triggers)
      - `within` number — The time period over which the events must occur. For Reactive triggers, this may be as low as 0 seconds, but must be at least 10 seconds for Proactive triggers
    - CompoundTrigger — A composite trigger that requires some number of triggers to have fired within the given time period
      - `type` 'compound'
      - `id` string, uuid — The unique ID of this trigger
      - `triggers` union[], required
        - union
          - EventTrigger — A trigger that fires based on the presence or absence of events within a given period of time.
            - `type` 'event'
            - `id` string, uuid — The unique ID of this trigger
            - `match` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
            - `match_related` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
            - `after` string[] — The event(s) which must first been seen to fire this trigger. If empty, then fire this trigger immediately. Events may include trailing wildcards, like `prefect.flow-run.*`
            - `expect` string[] — The event(s) this trigger is expecting to see. If empty, this trigger will match any event. Events may include trailing wildcards, like `prefect.flow-run.*`
            - `for_each` string[] — Evaluate the trigger separately for each distinct value of these labels on the resource. By default, labels refer to the primary resource of the triggering event. You may also refer to labels from related resources by specifying `related:<role>:<label>`. This will use the value of that label for the first related resource in that role. For example, `"for_each": ["related:flow:prefect.resource.id"]` would evaluate the trigger for each flow.
            - `posture` 'Reactive' | 'Proactive', required — The posture of this trigger, either Reactive or Proactive. Reactive triggers respond to the _presence_ of the expected events, while Proactive triggers respond to the _absence_ of those expected events.
            - `threshold` integer — The number of events required for this trigger to fire (for Reactive triggers), or the number of events expected (for Proactive triggers)
            - `within` number — The time period over which the events must occur. For Reactive triggers, this may be as low as 0 seconds, but must be at least 10 seconds for Proactive triggers
          - CompoundTrigger — recursive
          - SequenceTrigger — A composite trigger that requires some number of triggers to have fired within the given time period in a specific order
            - `type` 'sequence'
            - `id` string, uuid — The unique ID of this trigger
            - `triggers` union[], required
              - …
            - `within` number
      - `within` number
      - `require` union, required
        - integer
        - 'any' | 'all'
    - SequenceTrigger — A composite trigger that requires some number of triggers to have fired within the given time period in a specific order
      - `type` 'sequence'
      - `id` string, uuid — The unique ID of this trigger
      - `triggers` union[], required
        - union
          - EventTrigger — A trigger that fires based on the presence or absence of events within a given period of time.
            - `type` 'event'
            - `id` string, uuid — The unique ID of this trigger
            - `match` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
            - `match_related` ResourceSpecification — A specification that may match zero, one, or many resources, used to target or select a set of resources in a query or automation. A resource must match at least one value of all of the provided labels
            - `after` string[] — The event(s) which must first been seen to fire this trigger. If empty, then fire this trigger immediately. Events may include trailing wildcards, like `prefect.flow-run.*`
            - `expect` string[] — The event(s) this trigger is expecting to see. If empty, this trigger will match any event. Events may include trailing wildcards, like `prefect.flow-run.*`
            - `for_each` string[] — Evaluate the trigger separately for each distinct value of these labels on the resource. By default, labels refer to the primary resource of the triggering event. You may also refer to labels from related resources by specifying `related:<role>:<label>`. This will use the value of that label for the first related resource in that role. For example, `"for_each": ["related:flow:prefect.resource.id"]` would evaluate the trigger for each flow.
            - `posture` 'Reactive' | 'Proactive', required — The posture of this trigger, either Reactive or Proactive. Reactive triggers respond to the _presence_ of the expected events, while Proactive triggers respond to the _absence_ of those expected events.
            - `threshold` integer — The number of events required for this trigger to fire (for Reactive triggers), or the number of events expected (for Proactive triggers)
            - `within` number — The time period over which the events must occur. For Reactive triggers, this may be as low as 0 seconds, but must be at least 10 seconds for Proactive triggers
          - CompoundTrigger — A composite trigger that requires some number of triggers to have fired within the given time period
            - `type` 'compound'
            - `id` string, uuid — The unique ID of this trigger
            - `triggers` union[], required
              - …
            - `within` number
            - `require` union, required
              - …
          - SequenceTrigger — recursive
      - `within` number
  - `actions` union[], required — The actions to perform when this Automation triggers
    - union
      - DoNothing — Do nothing when an Automation is triggered
        - `type` 'do-nothing'
      - RunDeployment — Runs the given deployment with the given parameters
        - `type` 'run-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
        - `parameters` object — The parameters to pass to the deployment, or None to use the deployment's default parameters
        - `job_variables` object — The job variables to pass to the created flow run, or None to use the deployment's default job variables
      - PauseDeployment — Pauses the given Deployment
        - `type` 'pause-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - ResumeDeployment — Resumes the given Deployment
        - `type` 'resume-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - CancelFlowRun — Cancels a flow run associated with the trigger
        - `type` 'cancel-flow-run'
      - ChangeFlowRunState — Changes the state of a flow run associated with the trigger
        - `type` 'change-flow-run-state'
        - `name` string — The name of the state to change the flow run to
        - `state` 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING', required — Enumeration of state types.
        - `message` string — An optional message to associate with the state change
      - PauseWorkQueue — Pauses a Work Queue
        - `type` 'pause-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - ResumeWorkQueue — Resumes a Work Queue
        - `type` 'resume-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - SendNotification — Send a notification when an Automation is triggered
        - `type` 'send-notification'
        - `block_document_id` string, uuid, required — The identifier of the notification block to use
        - `subject` string
        - `body` string, required — The text of the notification to send
      - CallWebhook — Call a webhook when an Automation is triggered.
        - `type` 'call-webhook'
        - `block_document_id` string, uuid, required — The identifier of the webhook block to use
        - `payload` string — An optional templatable payload to send when calling the webhook.
      - PauseAutomation — Pauses a Work Queue
        - `type` 'pause-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - ResumeAutomation — Resumes a Work Queue
        - `type` 'resume-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - SuspendFlowRun — Suspends a flow run associated with the trigger
        - `type` 'suspend-flow-run'
      - PauseWorkPool — Pauses a Work Pool
        - `type` 'pause-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
      - ResumeWorkPool — Resumes a Work Pool
        - `type` 'resume-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
  - `actions_on_trigger` union[] — The actions to perform when an Automation goes into a triggered state
    - union
      - DoNothing — Do nothing when an Automation is triggered
        - `type` 'do-nothing'
      - RunDeployment — Runs the given deployment with the given parameters
        - `type` 'run-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
        - `parameters` object — The parameters to pass to the deployment, or None to use the deployment's default parameters
        - `job_variables` object — The job variables to pass to the created flow run, or None to use the deployment's default job variables
      - PauseDeployment — Pauses the given Deployment
        - `type` 'pause-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - ResumeDeployment — Resumes the given Deployment
        - `type` 'resume-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - CancelFlowRun — Cancels a flow run associated with the trigger
        - `type` 'cancel-flow-run'
      - ChangeFlowRunState — Changes the state of a flow run associated with the trigger
        - `type` 'change-flow-run-state'
        - `name` string — The name of the state to change the flow run to
        - `state` 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING', required — Enumeration of state types.
        - `message` string — An optional message to associate with the state change
      - PauseWorkQueue — Pauses a Work Queue
        - `type` 'pause-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - ResumeWorkQueue — Resumes a Work Queue
        - `type` 'resume-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - SendNotification — Send a notification when an Automation is triggered
        - `type` 'send-notification'
        - `block_document_id` string, uuid, required — The identifier of the notification block to use
        - `subject` string
        - `body` string, required — The text of the notification to send
      - CallWebhook — Call a webhook when an Automation is triggered.
        - `type` 'call-webhook'
        - `block_document_id` string, uuid, required — The identifier of the webhook block to use
        - `payload` string — An optional templatable payload to send when calling the webhook.
      - PauseAutomation — Pauses a Work Queue
        - `type` 'pause-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - ResumeAutomation — Resumes a Work Queue
        - `type` 'resume-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - SuspendFlowRun — Suspends a flow run associated with the trigger
        - `type` 'suspend-flow-run'
      - PauseWorkPool — Pauses a Work Pool
        - `type` 'pause-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
      - ResumeWorkPool — Resumes a Work Pool
        - `type` 'resume-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
  - `actions_on_resolve` union[] — The actions to perform when an Automation goes into a resolving state
    - union
      - DoNothing — Do nothing when an Automation is triggered
        - `type` 'do-nothing'
      - RunDeployment — Runs the given deployment with the given parameters
        - `type` 'run-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
        - `parameters` object — The parameters to pass to the deployment, or None to use the deployment's default parameters
        - `job_variables` object — The job variables to pass to the created flow run, or None to use the deployment's default job variables
      - PauseDeployment — Pauses the given Deployment
        - `type` 'pause-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - ResumeDeployment — Resumes the given Deployment
        - `type` 'resume-deployment'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected deployment (given by `deployment_id`), or to a deployment that is inferred from the triggering event. If the source is 'inferred', the `deployment_id` may not be set. If the source is 'selected', the `deployment_id` must be set.
        - `deployment_id` string, uuid — The identifier of the deployment
      - CancelFlowRun — Cancels a flow run associated with the trigger
        - `type` 'cancel-flow-run'
      - ChangeFlowRunState — Changes the state of a flow run associated with the trigger
        - `type` 'change-flow-run-state'
        - `name` string — The name of the state to change the flow run to
        - `state` 'SCHEDULED' | 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'CRASHED' | 'PAUSED' | 'CANCELLING', required — Enumeration of state types.
        - `message` string — An optional message to associate with the state change
      - PauseWorkQueue — Pauses a Work Queue
        - `type` 'pause-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - ResumeWorkQueue — Resumes a Work Queue
        - `type` 'resume-work-queue'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work queue (given by `work_queue_id`), or to a work queue that is inferred from the triggering event. If the source is 'inferred', the `work_queue_id` may not be set. If the source is 'selected', the `work_queue_id` must be set.
        - `work_queue_id` string, uuid — The identifier of the work queue to pause
      - SendNotification — Send a notification when an Automation is triggered
        - `type` 'send-notification'
        - `block_document_id` string, uuid, required — The identifier of the notification block to use
        - `subject` string
        - `body` string, required — The text of the notification to send
      - CallWebhook — Call a webhook when an Automation is triggered.
        - `type` 'call-webhook'
        - `block_document_id` string, uuid, required — The identifier of the webhook block to use
        - `payload` string — An optional templatable payload to send when calling the webhook.
      - PauseAutomation — Pauses a Work Queue
        - `type` 'pause-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - ResumeAutomation — Resumes a Work Queue
        - `type` 'resume-automation'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected automation (given by `automation_id`), or to an automation that is inferred from the triggering event. If the source is 'inferred', the `automation_id` may not be set. If the source is 'selected', the `automation_id` must be set.
        - `automation_id` string, uuid — The identifier of the automation to act on
      - SuspendFlowRun — Suspends a flow run associated with the trigger
        - `type` 'suspend-flow-run'
      - PauseWorkPool — Pauses a Work Pool
        - `type` 'pause-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
      - ResumeWorkPool — Resumes a Work Pool
        - `type` 'resume-work-pool'
        - `source` 'selected' | 'inferred' — Whether this Action applies to a specific selected work pool (given by `work_pool_id`), or to a work pool that is inferred from the triggering event. If the source is 'inferred', the `work_pool_id` may not be set. If the source is 'selected', the `work_pool_id` must be set.
        - `work_pool_id` string, uuid — The identifier of the work pool to pause
  - `id` string, uuid
  - `created` string, date-time
  - `updated` string, date-time

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/prefecthq/apis/untitled-api-2.md) · [All operations](https://skmtc.net/prefecthq/apis/untitled-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prefecthq/untitled-api-2/versions/29ba6c4f8837/schema)
