Skip to main content
Scheduled workflows run automatically at specified times using cron expressions. Perfect for recurring tasks like daily reports, data syncs, or cleanup jobs.

Defining scheduled workflows

There are two ways to schedule workflows:

1. Inline cron string

Use a cron expression directly in the decorator:
You can also specify timezone in the cron schedule:

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.
Create schedule via API:

Schedule payload

Scheduled workflows receive a special SchedulePayload with timing information:

Cron expressions

Cron format: minute hour day month day_of_week Common patterns:
Cron syntax:
  • * - Any value
  • */n - Every n units
  • n-m - Range from n to m
  • n,m - List of values
Field ranges:
  • 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 the key parameter to create separate schedules for each user or entity:
In the workflow:
Key behavior:
  • 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_id for per-user schedules

Timezones

Always specify timezones for scheduled workflows to avoid confusion:
Common timezones:
  • "UTC" - Coordinated Universal Time
  • "America/New_York" - US Eastern
  • "America/Los_Angeles" - US Pacific
  • "Europe/London" - UK
  • "Asia/Tokyo" - Japan
  • "Australia/Sydney" - Australia

Managing schedules via API

Create or update a schedule

Update existing schedule: