Example requests
Ask your coding agent when an automation should start. It can wire up the source, target, filters, and payload shape.“Build an agent that sends me a morning brief every weekday at 9am in Slack.”
“When a Stripe payment succeeds, update the customer record in our CRM and start the Zendesk onboarding workflow.”
“Check our vendor API every hour, and run the pending invoice workflow when a new invoice is marked as ‘ready to process’.”
Source plus attach
Triggers live in your project code undersrc/triggers/. Each file defines a source, then chains .attach() to bind it to a workflow or agent, and default-exports the result.
src/triggers/signup.ts
.attach(), a chain of .attach() calls, or an array of attachments (see fan out to multiple targets).
The three sources
There are exactly three trigger source types. Each takes aslug (the stable trigger slug), a name, and a description, plus options specific to how it fires.
To react to events from third-party apps (Stripe, GitHub, Linear, and so on), you point one of these sources at the app, usually a webhook and sometimes a poll. See app events.
Attach to a workflow or an agent
.attach() binds the source to one of two targets:
transform to shape the payload into the workflow’s input. An agent target takes a prompt (a string, or a function of the payload) instead. See advanced triggers for both in depth.
Attachment id
Each attachment has an id of the form{sourceSlug}:{targetSlug}, the source slug joined to the workflow or agent slug:
Match on the source, transform on the attachment
Keep the two concerns separate:- Match decides whether to run, and is part of the source: a webhook’s
payloadZod schema, or a poll’sfilterpredicates. transformdecides what input the run receives, and is part of the attachment (workflow targets only).
Disable individual attachments
Each attachment can be paused without removing it from your project code. Disabled attachments stay visible in the dashboard and API, but they do not match webhook ingress, receive cron ticks, or receive poll results.- Disable one workflow or agent binding while leaving sibling attachments on the same source active.
- Re-enable the attachment later without redeploying.
- The disabled state survives redeploys — a later deploy does not re-enable a paused attachment.
- When every attachment on a scheduled source is disabled, its schedule stops firing until at least one attachment is enabled again.
PATCH /api/triggers/:triggerId/attachments/:attachmentId), or the CLI:
--workflow/--agent — you never need the attachment id.
Inspect trigger runs
Triggers are typically operated against a deployed (cloud) project. List them, print a webhook URL, invoke on demand, and audit runs from the CLI:triggers invoke works for webhook, cron, and poll triggers (platform only). Webhooks take --input JSON matched against the attachment schema; cron and poll take no input (cron always uses its static payload). Narrow with --workflow / --agent when a trigger has multiple attachments.
See the CLI reference for every trigger command and run history in the web app.
Next steps
Schedules
Run a workflow or agent on a cron schedule.
Webhooks
Run on inbound HTTP requests with a validated payload.
Polling
Periodically check a source, keep cursor state, and run when there’s work.
App events
React to events from connected third-party apps.