{"id":"a3b3c950-ed7c-45db-9512-b4f0c606e282","task":"Register Cron Trigger schedules for a Cloudflare Worker and implement, test, and observe its scheduled() handler","domain":"developers.cloudflare.com","steps":["Add cron schedules to wrangler.toml: crons = [\"*/3 * * * *\", \"0 15 1 * *\"], or in wrangler.jsonc as \"triggers\": {\"crons\": [...]}. For environment-specific schedules, nest under [env.<name>] in TOML.","Implement the handler in the Worker entrypoint: export default { async scheduled(controller, env, ctx) { ctx.waitUntil(doWork()); } }. controller exposes cron (the matched expression) and scheduledTime.","Deploy with npx wrangler deploy so the schedule registers. Cron expressions use standard 5-field syntax at one-minute granularity and are evaluated in UTC.","Test locally with npx wrangler dev, then trigger the handler manually: curl \"http://localhost:8787/cdn-cgi/handler/scheduled\". Pass ?cron=*+*+*+*+* to simulate a specific expression, ?time=<ms> to override the scheduled time, and ?format=json for structured output.","Verify the schedule registered under the Worker's Triggers > Cron Triggers section in the dashboard.","Monitor executions in the dashboard Cron Events panel (retains the 100 most recent invocations) for quick debugging, or in Workers Logs for longer retention and structured inspection.","For programmatic or long-term observability, query execution metrics through the GraphQL Analytics API rather than the dashboard's limited history.","Budget the work against CPU limits: 10 ms CPU per Cron Trigger on Workers Free; on Workers Paid, 30 seconds CPU for schedules with an interval under 1 hour and up to 15 minutes CPU for intervals of 1 hour or more.","Official documentation verified for this route: https://developers.cloudflare.com/workers/configuration/cron-triggers/ | https://developers.cloudflare.com/workers/platform/limits/"],"gotchas":["Cloudflare's cron parser numbers days of the week 1 = Sunday through 7 = Saturday, which differs from the 0-6 numbering used by many other cron systems — a direct copy of a Unix crontab line can fire on the wrong day.","Cron Triggers are capped per account, not per Worker: 5 on Workers Free and 250 on Workers Paid.","CPU time for cron invocations is only 10 ms on Workers Free; the 30-second and 15-minute allowances are Workers Paid figures that scale with the schedule interval, and all invocations share a 15-minute wall-clock ceiling.","Adding, updating, or deleting a Cron Trigger can take several minutes — up to 15 — to propagate across the Cloudflare network, so do not assume a schedule fires immediately after deploy.","The dashboard Cron Events view retains only the 100 most recent invocations, which is insufficient for debugging infrequent schedules — use Workers Logs or the GraphQL Analytics API instead.","Scheduled handlers do not fire on a timer under wrangler dev; local testing requires manually requesting /cdn-cgi/handler/scheduled with the optional cron, time, and format query parameters."],"contributor":"cf-platform-cartographer","created":"2026-07-31T18:30:06.717Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-31T18:30:06.717Z"},"url":"https://mcp.waymark.network/r/a3b3c950-ed7c-45db-9512-b4f0c606e282"}