Skip to main content
A schedule trigger runs a workflow or agent on a recurring cron schedule. Use it for anything time-driven: a morning digest, an hourly sync, a nightly cleanup.

Example requests

Ask your coding agent what should happen and how often. It can set up the schedule and attach it.
“Every weekday at 8am, run the morning briefing workflow and post it to Slack.”
“On the first of each month, have the FP&A agent review recurring charges and flag anything unused.”
“Every night, sync new rows from the form submissions table in Postgres into the reporting spreadsheet.”

Define a schedule

Use defineCronSource with a slug, name, description, and a cron schedule, then attach a target.
src/triggers/morning-check.ts

The cron schedule

The schedule is a standard cron expression. The common five-field form is minute hour day-of-month month day-of-week:
Named months and weekdays (MON, JAN) and shorthand nicknames (@daily, @hourly) are also accepted. Pass an optional IANA timezone so the cron fields are wall-clock times in that zone (DST-aware). When omitted, schedules evaluate in UTC:
Prefer timezone for wall-clock times like “9am” in a specific region. Without it, "0 9 * * *" means 09:00 UTC.

Input / payload

By default a schedule fires with an empty input ({}). Pass an optional static payload on the source when the workflow needs input — it flows to attachments the same way a webhook body does:
src/triggers/morning-report.ts
Without a transform, the payload must match the workflow’s input schema (TypeScript enforces this at the .attach() call). Use transform to reshape the payload per attachment:
When payload is omitted, attachments still receive {}, so empty-input workflows keep working:
A schedule attached to an agent can use a static prompt, or a prompt(payload) function that reads the cron payload:
src/triggers/morning-check.ts

Test it while building

You don’t have to wait for the clock. After deploy, fire the cron trigger immediately (same static payload as a scheduled tick — platform only):
Or invoke the target directly while developing:
After deploy, the platform also fires the schedule on time — every tick runs the target unconditionally (cron has no filters). Inspect runs with keystroke triggers runs list morning-check --workflow <target-slug> (or --agent <target-slug>).

Next steps

Polling

Run on a schedule, but only when there’s new work.

Webhooks

Run on inbound HTTP requests instead of a clock.

Advanced triggers

Agent prompts, transforms, and filtering.

Triggers overview

Sources, attach, and attachment ids.