Defining scheduled workflows
There are two ways to schedule workflows:1. Inline cron string
Use a cron expression directly in the decorator:2. Create schedule via API
Mark a workflow as schedulable, then create one or more schedules for it via API: This is useful for creating separate schedules per user or entity.Schedule payload
Scheduled workflows receive a specialSchedulePayload with timing information:
Cron expressions
Cron format:minute hour day month day_of_week
Common patterns:
*- Any value*/n- Every n unitsn-m- Range from n to mn,m- List of values
- Minute: 0-59
- Hour: 0-23
- Day of month: 1-31
- Month: 1-12
- Day of week: 0-6 (Sunday = 0)
Use appropriate cron intervals
Per-user schedules
Use thekey parameter to create separate schedules for each user or entity:
- If a schedule with the same workflow and key exists, it’s updated (not duplicated)
- Use
key="global"(default) for system-wide schedules - Use
key=user_idfor per-user schedules
Timezones
Always specify timezones for scheduled workflows to avoid confusion:"UTC"- Coordinated Universal Time"America/New_York"- US Eastern"America/Los_Angeles"- US Pacific"Europe/London"- UK"Asia/Tokyo"- Japan"Australia/Sydney"- Australia