# Cloudflare Cron Trigger Review: Twice, Late, Never

Cloudflare Cron Trigger Review: Twice, Late, Never is a SKILL.md that reviews the scheduled() handler of a Cloudflare Worker that dispatches jobs every minute, and its watchdog, for runs that happen twice, at the wrong minute, late or not at all; an agent buys it once for $0.05 over x402.

- Page: https://aiskills402.com/skills/cloudflare-cron-trigger-review
- Category: Code & Engineering (https://aiskills402.com/categories/code)
- Price: $0.05 once, USD-priced, paid in USDC on Base over x402. Price as loaded on this page. The 402 response your agent receives is authoritative.
- Version: 1.0.1
- Card (JSON): https://api.aiskills402.com/v1/skills/cloudflare-cron-trigger-review

## Use it when

Reviews the scheduled() handler of a Cloudflare Worker that dispatches jobs every minute, and its watchdog, for runs that happen twice, at the wrong minute, late or not at all. Finds a Cron Trigger event that arrives twice with the same scheduledTime and no claim before the outward action, a claim keyed from Date.now() instead of scheduledTime, Math.floor on a scheduledTime that arrives about 2 seconds early so everything runs a minute late, a daily job that needs one exact minute to fire, a catch-up that is unbounded or has no claim, a watchdog threshold shorter than the real gaps, and a Durable Object alarm that re-arms after its work or holds it outside waitUntil. Gives the fix in code for each finding and ends a review with VERDICT: OK or VERDICT: CHANGE; a symptom question gets the cause first. Use when asked to review a Cloudflare cron scheduler, or why scheduled jobs ran twice, a minute late or were skipped.

## Not for

Failing job calls, retries, D1 errors or crashes, and the day-of-week numbering of cron expressions: other reviews cover those. It cannot read a live account or a log, so real gaps between wake-ups must come from the person. Cloudflare gives no delivery guarantee, and the figures in it were measured on one scheduler Worker in October 2026.

## Tested, honestly

Tested 2026-11-22.

- Strong model (claude-sonnet-5-5 (Claude Code alias "sonnet")): Right on all 12 setups on the 1.0.1 bytes, read by hand. It put a claim on each minute and job ahead of the call in the hub that had none, replaced Math.floor on scheduledTime with rounding and explained that a 02:00 job matched only on the next event, and traced jobs that started at :58 past their minute to that same floor. It keyed the claim of the two-clock hub from the minute the event stands for instead of Date.now(), moved the 07:00 digest onto a trigger that fires each minute inside a send window that ends, and raised a 2-minute watchdog threshold above the gaps between wake-ups, with consecutive checks. For catch-up lines in the log it said the hub works and the catch-up must stay. It answered VERDICT: OK on all five sound setups: the hub with claim and catch-up, a floor taken after adding 30 seconds, two clocks with one claim and one catch-up, the digest window and a 15-minute threshold.
- Weak model (claude-haiku-5-5 (Claude Code alias "haiku")): Right on 9 of 12 on the 1.0.1 bytes, read by hand. It named the missing claim, the floor on an early scheduledTime in the review and in the symptom, the claim key taken from Date.now(), the daily job that a skipped minute loses, the tight watchdog, and it told the person to keep the catch-up. It answered OK on two sound setups (the digest window and the 15-minute threshold) but missed three: on the hub with a claim and catch-up and on the two clocks with one claim it raised failure handling (a D1 error, a pulse that moves past a failed claim) that the request had put out of scope, and on the floor taken after adding 30 seconds it raised a job enabled inside the catch-up window.

Note: Twelve setups written by us around one scheduler Worker: five code reviews with a planted scheduling fault (no claim, a plain floor on scheduledTime, a claim key from Date.now() beside a second clock, a daily 0 7 * * * trigger, a 2-minute watchdog), five sound twins of them, and two questions about a symptom (jobs a minute late, catch-up lines in the log). Each answer is scored by code on the concept in any words: the verdict line, the cause and the fix (a claim, rounding or an offset before the floor, a key from the event's minute, an every-minute trigger or a catch-up, a threshold above the real gaps); a sound twin passes only with VERDICT: OK or nothing must change, and the catch-up question only when the catch-up is kept. Owner-measured on our scheduler Worker on 12 and 23 October 2026 and not re-checked here: two events per minute with one scheduledTime, the second one to two minutes later; up to 13 skipped minutes an hour, gaps up to 8 minutes, some wake-ups 20 to 47 minutes late; scheduledTime about 2 seconds before the minute; an alarm one second past each minute ringing 1.4 seconds late. Re-checked in the vendor documentation on 22 November 2026: in a Durable Object a promise given to waitUntil prevents eviction until it settles, for up to 15 minutes. Checks widened after reading the answers, for both sides: the two key values that differ, both claims that succeed, and a backtick before the variable name (a later `slot`) all count as the claim-key cause. Inputs fixed: before the skill was written, the sound twins claimed every job before calling any, the request scope now leaves failing calls and crashes out, and the digest window ends at 07:59; after the first run with the skill, the sound two-clock hub got a bounded catch-up from the shared pulse and both sides ran it again. The side with the skill was run in full on the final wording; after that run its three code examples were turned from fenced into indented blocks for the catalog's safety gate, words and code unchanged. One run per model and setup. The side with the skill was then run once more in full on the final bytes (both models): Sonnet 12 of 12 again, Haiku 9 of 12 (10 of 12 on the run before the formatting change; one run per model and setup, so Haiku moves by a case between runs). Version 1.0.1, 22 November 2026: the opening line had said that Cloudflare's documentation promises best effort; the page says no such thing (re-read that day: triggers run on underutilized machines, and runs can be missed while a change propagates), so the line now says the documentation gives no delivery guarantee. Two more sentences were reworded so that no published post on our blog shares a run of five words with the file. One check was widened for both sides: "those differ" and "a different `Date.now()` key" name the same claim-key cause. The side with the skill was run again in full on those bytes: Sonnet 12 of 12, Haiku 9 of 12. The side without the skill, re-scored with the same checks: unchanged, 7 and 4 of 12.

### With and without the skill

Tested 2026-11-22.

- Setups answered right (12 setups): Sonnet 12/12 with, 7/12 without; Haiku 9/12 with, 4/12 without.

Same request and checks on both sides. Sonnet without the skill knew that a minute can come twice and needs a claim, caught the key from Date.now(), kept the catch-up and answered OK on four of five sound twins. It missed three measured facts: scheduledTime comes about 2 seconds early (it approved a plain Math.floor, and for jobs at :58 blamed delivery); minutes get skipped (it said 0 7 * * * runs at 07:00 and passed a 2-minute watchdog); and waitUntil holds a Durable Object (it said waitUntil does nothing there and asked to await the work in alarm()). Haiku without the skill missed the first two too, set the watchdog to 4 minutes, and called four sound twins a change over D1 errors or a crash the request had put out of scope. With the skill Haiku still flagged two sound twins.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

Full summary: https://aiskills402.com/skills/cloudflare-cron-trigger-review/tests

## Example

### English (claude-sonnet-5-5)

Before:

> Before I deploy our job hub: one Cron Trigger ("* * * * *" in wrangler.jsonc) calls the code below every minute; the jobs (about 20) and their cron expressions live in D1. fire() posts to the job URL and logs the status; failed calls show up in our log and we rerun those by hand. // src/index.ts // D1: jobs(id, name, cron, url, enabled) · meta(key TEXT PRIMARY KEY, value INTEGER)…

After:

> **[NO-CLAIM]** in `runJob()` / `fire()`: nothing claims a (minute, job) pair before `fire()` posts to the job URL. Cloudflare can deliver the same minute twice, and the second copy carries the same `scheduledTime` 1 to 2 minutes later. The pulse is written only at the end of `tick()`, after up to 30 s of calls.…

## What is in the file

- What was measured (on our scheduler Worker)
- What to check, in this order
- 1. Claim before the outward action
- 2. The claim key comes from `scheduledTime`
- 3. Rounding the minute
- 4. A job must not need one exact minute to fire
- 5. Catch-up: bounded, and under the same claim
- 6. The watchdog threshold
- 7. A Durable Object alarm as the second clock
- Answer format
- Not a finding
- What not to do

## Languages

Any language

## How to buy

Agent (HTTP):

1. GET https://api.aiskills402.com/v1/skills/cloudflare-cron-trigger-review/file without a payment header. The answer is 402 with a PAYMENT-REQUIRED header (x402 v2): exact amount, asset, network, recipient.
2. Sign `accepts[0]` with an x402 client (for example @x402/core + @x402/evm).
3. Repeat the GET with the signature in the PAYMENT-SIGNATURE header. The answer is 200 with the file, its sha256 and a re-download token.

Agent (MCP): https://mcp.aiskills402.com/mcp — free tools search_skills, get_skill, redownload_skill. Buying itself is over HTTP.

Full flow: https://aiskills402.com/docs

## The file

- Version: 1.0.1
- Size: 13.3 KB (13637 bytes)
- SHA-256: 8b71a563696f1670c3020e76083592cc17e094a4b89aa2d852c280ef23353533
- Updated: 2026-11-22
- New versions are free through your re-download token.

## Versions

### 1.0.1 (2026-11-22)

Fact fixed: the file had said that Cloudflare's documentation promises best effort. Re-read on 22 November 2026, the page has no such words; it says that triggers run on underutilized machines and that runs can be missed while a change propagates. The opening line, a rule at the end and the listing now say that the documentation gives no delivery guarantee. Two other sentences reworded with the same meaning, so that no published post on our blog shares a run of five words with the file. One check widened for both sides. The side with the skill was run again in full, one run per model and setup: Sonnet 12 of 12, Haiku 9 of 12. Without the skill, re-scored: 7 and 4 of 12, unchanged.

### 1.0.0 (2026-11-22)

- First version. - Before publishing, after the first run with the skill: the watchdog section now ties the threshold to the silence between wake-ups only. Events that arrive tens of minutes after their minute no longer argue for a longer threshold, and a pulse stored after calls with a short timeout is no longer a finding. With the old wording Sonnet flagged a sound 15-minute threshold that it had passed without the skill. - Before publishing: the section on a second clock now says that an alarm next to the cron does not make the catch-up unnecessary, since each clock only handles the minute it woke in. - Test: the sound two-clock case had no catch-up, so a minute lost by both clocks was really lost; both models with the skill said so. It now has a bounded catch-up from a shared pulse and is run again on both sides. - Test: the check for the claim-key cause also accepts "both claims succeed" for the two copies of one minute (a bare Haiku answer named the right cause in those words). Widened for both sides. - Test: the same check also accepts a backtick before the variable name ("gets a later `slot`"). Haiku with the skill named the right cause that way. Widened for both sides; test/control.mjs now checks that wording too. - Measured on 22 November 2026 on this text, one run per model and setup, 12 setups (5 reviews with a planted fault, 5 sound twins, 2 symptom questions): Claude Sonnet 12 of 12 with the skill, 7 of 12 without; Claude Haiku 10 of 12 with, 4 of 12 without. Sonnet's gain is five setups on three distinct facts: the early scheduledTime and the floor (a review and a symptom), skipped minutes (a daily trigger and a 2-minute watchdog), and waitUntil inside a Durable Object (a sound two-clock hub it wanted changed). - Price $0.05 (50000 micro): Sonnet gained five setups, on three distinct facts it did not know. - After the run, for the catalog's safety gate: the three code examples are indented blocks instead of fenced ones. The words and the code are otherwise unchanged. - Skill side re-run in full on the final bytes, 22 November 2026: Sonnet 12 of 12, Haiku 9 of 12.

## License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Terms: https://aiskills402.com/docs#license

## FAQ

### Scheduler review: what comes back?

Only what must change in a scheduled handler, each item tagged with a short code, its location, its cause and its fix. Nine codes cover a missing claim, a claim key taken from the clock, a minute computed with a plain floor, a job that needs one exact minute, a missing or unbounded catch-up, a watchdog threshold below the real gaps, and a Durable Object alarm that re-arms late or awaits its work. Safe look-alikes are listed apart. The last line is a verdict, OK or CHANGE.

### Can one cron minute really run a job twice?

On our scheduler Worker, yes. On 12 October 2026 each minute brought two events, the second one to two minutes after the first, both stamped with the same minute. Two articles and a duplicate social post went out. The cure is a claim on the minute and the task, written with ON CONFLICT DO NOTHING before the action, keyed from the event's own time and never from the current clock.

### Why did every job start about a minute late?

The event time arrived about two seconds before the minute, and flooring it gave the minute before. The job was then matched to the wrong minute and started late by a minute. Rounding to the nearest minute removed it. The same measurements showed skipped minutes, gaps up to eight minutes and some wake-ups twenty to forty-seven minutes late, so the skill also asks for a bounded catch-up.

### Does it help Claude Sonnet?

Clearly, through three facts from our own measurements. The test: twelve job hubs on an every-minute trigger, five with a planted timing fault, five sound twins, two symptom questions. On its own Sonnet answered 7 correctly; given the skill, all 12. It already caught a missing claim and a claim keyed from Date.now(). It did not know that the event time comes two seconds early, so it approved Math.floor; that minutes get skipped, so a 07:00-only digest and a 2-minute watchdog looked fine; or that waitUntil keeps a Durable Object running. Haiku rose from 4 correct to 9.

## Related skills

- [Agent Loop Review: Repeats, Caps, Self-Grading](https://aiskills402.com/skills/agent-loop-review.md): $0.01 once
- [Cron Schedule for Cloudflare Workers](https://aiskills402.com/skills/cron-schedule.md): $0.06 once
- [Cloudflare Workers Review: D1, OpenNext, Fetch](https://aiskills402.com/skills/workers-pitfalls-review.md): $0.05 once

## Measurement limits

- Models other than the two named above were not run.
- Each verdict comes from the test run on the date shown; the skill may have changed since (check the version).
- Full test inputs are not published here, only short excerpts of our own text.
- Results on your own texts, languages and domains can differ.

Offer note: Paid in USDC (USD-pegged) over x402 by an AI agent; one-time.
