Triggers
The events that start an automation run, and which ones run on a task.
A trigger is the event that starts an automation run. It also decides whether the automation run works on a task or runs in the workspace without one.
Available triggers
Section titled “Available triggers”| Trigger | uses | Starts when | Runs on |
|---|---|---|---|
| Task enters stage | task_enters_stage | A task arrives in the automation’s stage. | The task |
| Task leaves stage | task_leaves_stage | A task leaves the automation’s stage. | The task |
| Pull request updated | pull_request_updated | The task’s pull request changes. Only in Verify. | The task |
| Manual | manual | A person starts the automation. | A task or the workspace |
| Schedule | schedule | A cron schedule fires. See Schedules. | The workspace |
| Webhook | webhook | Another tool sends a request to a workspace webhook. See Webhooks. | The workspace |
Add a trigger
Section titled “Add a trigger”List triggers under triggers in the automation file. Each trigger starts its own automation run.
apiVersion: v2kind: Automationname: Prepare releaserun_context: tasktriggers: - uses: task_enters_stage - uses: manualsteps: - name: Prepare the release checklist prompt: | Read the task description and its pull requests. Attach a Markdown note titled "Release checklist" to the task.run_context sets where the automation runs: task or workspace. If you leave it out, an automation with a schedule, or with only webhook triggers, runs in the workspace. Apply the file with Workspace as code, or pick the trigger when you create the automation on the board.
An automation run in the workspace has no task, but it can create tasks. An automation that creates tasks is an intake.
- An automation can have one each of
manual,task_enters_stage,task_leaves_stage, andpull_request_updated. It can have several schedules and several webhooks, each webhook once. - Task triggers need
run_context: task. Schedule and webhook triggers needrun_context: workspace. - Task triggers and schedules can’t share an automation.
- In Verify, use
pull_request_updatedinstead oftask_enters_stage.pull_request_updatedworks only in Verify. - In a stage you added, automations use Task enters stage, Manual, or Webhook.
- Give each trigger a unique
idif you set one.