Skip to content

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.

TriggerusesStarts whenRuns on
Task enters stagetask_enters_stageA task arrives in the automation’s stage.The task
Task leaves stagetask_leaves_stageA task leaves the automation’s stage.The task
Pull request updatedpull_request_updatedThe task’s pull request changes. Only in Verify.The task
ManualmanualA person starts the automation.A task or the workspace
SchedulescheduleA cron schedule fires. See Schedules.The workspace
WebhookwebhookAnother tool sends a request to a workspace webhook. See Webhooks.The workspace

List triggers under triggers in the automation file. Each trigger starts its own automation run.

apiVersion: v2
kind: Automation
name: Prepare release
run_context: task
triggers:
- uses: task_enters_stage
- uses: manual
steps:
- 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, and pull_request_updated. It can have several schedules and several webhooks, each webhook once.
  • Task triggers need run_context: task. Schedule and webhook triggers need run_context: workspace.
  • Task triggers and schedules can’t share an automation.
  • In Verify, use pull_request_updated instead of task_enters_stage. pull_request_updated works only in Verify.
  • In a stage you added, automations use Task enters stage, Manual, or Webhook.
  • Give each trigger a unique id if you set one.