Cron tools › Platforms
Cloudflare Workers Cron Triggers
Paste the Cron Triggers of a Worker, one per line. Each is checked the way Cloudflare reads it — where Sunday is 1, not 0 —
compared with what the same line means in Linux cron, and turned into the triggers block for wrangler.toml or
wrangler.jsonc plus a scheduled() handler that tells the triggers apart.
Triggers
Next runs (UTC)
Configuration
Add one
How to add a Cron Trigger to a Worker
- Type each schedule on its own line, in UTC. Prefer day names (
MON-FRI,SUN): in numbers, Cloudflare counts 1 = Sunday to 7 = Saturday. - Check each line's meaning, and the message when Linux cron would read the same text differently.
- Copy the
triggersblock intowrangler.tomlorwrangler.jsonc. Fill in Environment to write it under[env.<name>.triggers]instead. - Add the
scheduled()handler. With several triggers,controller.cronholds the one that fired. - Run
wrangler devand call the test URL to invoke the handler, then deploy. New or changed triggers can take up to 15 minutes to propagate.
Cloudflare cron syntax compared with Linux cron
| Field | Cloudflare values | Cloudflare characters | Linux cron |
|---|---|---|---|
| Minute | 0-59 | * , - / | the same |
| Hours | 0-23 | * , - / | the same |
| Days of month | 1-31 | * , - / L W | no L or W |
| Months | 1-12 or JAN-DEC (any case) | * , - / | the same |
| Weekdays | 1-7, 1 = Sunday, or SUN-SAT (any case) | * , - / L # | 0-7, 0 and 7 = Sunday; no L or # |
The weekday numbering is the trap: 0 9 * * 1 is Sunday on Cloudflare and Monday on Linux, and Cloudflare's own example of
weekdays is 10 7 * * 2-6. The extensions come from Quartz: 59 23 LW * * is 23:59 on the last weekday of the
month and 0 18 * * 6L (or friL) 18:00 on the last Friday. Cloudflare does not document how the two day fields
combine when both are set, so keep one of them *.
Steps restart every hour, as in any cron: Cloudflare spells out that */45 * * * * runs "at minutes 0 and 45 of every hour
(not every 45 minutes)". For an even spacing that does not divide 60, list the times instead. The cron to
Quartz converter writes the same weekday renumbering for Quartz itself.
Limits and timing
| Workers Free | Workers Paid | |
|---|---|---|
| Cron Triggers per account | 5 | 1,000 |
| CPU time per Cron Trigger | 10 ms | 5 min (default 30 s) for intervals under 1 hour; 15 min for intervals of 1 hour or more |
| Wall time per invocation | 15 minutes | |
- Cron Triggers run on UTC time. There is no time zone setting, so a local 09:00 needs a different UTC hour in summer and winter — the time zone converter writes both.
- Adding, changing or deleting a trigger can take up to 15 minutes to reach Cloudflare's network, and runs due in that time can be missed.
- Deploying with Wrangler replaces the Worker's triggers with the ones in the file;
crons = [ ]removes them all. Manage them in the file rather than the dashboard.
FAQ
Why does my Cron Trigger run on Sunday instead of Monday?
Cloudflare numbers weekdays 1 = Sunday to 7 = Saturday, like Quartz. 1 is Sunday and 2 is Monday. Write
MON instead and the question goes away.
How do I run different code for different Cron Triggers?
All triggers call the same scheduled() handler. Switch on controller.cron, which holds the expression that
fired — the generated handler does exactly that.
How do I test a Cron Trigger locally?
Start wrangler dev and request /cdn-cgi/local/scheduled on its port, adding ?cron= with the
expression (spaces as +) to simulate a particular trigger. Local development does not run triggers on its own.
Can a Cron Trigger use my local time zone?
No, Cron Triggers execute on UTC. Convert the time to UTC, and check the DST checker to see how the local time of a UTC run moves when your clocks change.