cronkit.org
Cron expressions, explained and converted — in your browser

Cron tools › Platforms

Cloudflare Workers Cron Triggers

five fields · weekday 1 = Sunday · L, W and # · always UTC

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

  1. Type each schedule on its own line, in UTC. Prefer day names (MON-FRI, SUN): in numbers, Cloudflare counts 1 = Sunday to 7 = Saturday.
  2. Check each line's meaning, and the message when Linux cron would read the same text differently.
  3. Copy the triggers block into wrangler.toml or wrangler.jsonc. Fill in Environment to write it under [env.<name>.triggers] instead.
  4. Add the scheduled() handler. With several triggers, controller.cron holds the one that fired.
  5. Run wrangler dev and 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

FieldCloudflare valuesCloudflare charactersLinux cron
Minute0-59* , - /the same
Hours0-23* , - /the same
Days of month1-31* , - / L Wno L or W
Months1-12 or JAN-DEC (any case)* , - /the same
Weekdays1-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 FreeWorkers Paid
Cron Triggers per account51,000
CPU time per Cron Trigger10 ms5 min (default 30 s) for intervals under 1 hour; 15 min for intervals of 1 hour or more
Wall time per invocation15 minutes

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.