cloudflare-workers-cron-emaillisted
Install: claude install-skill jackson2w/claude-code-skills
# Cloudflare Workers: Cron Triggers + Email Bindings
Diagnose scheduled Cloudflare Workers that silently fail to run, size a Worker's
R2/KV workload against subrequest limits before it's built, and wire up the
`send_email` binding correctly the first time. This knowledge comes from a real
debugging session where a correctly-configured cron trigger and a correctly-coded
Worker both looked broken for reasons that took real investigation to isolate.
## Core principle: distrust `wrangler tail` for "did it run?"
`wrangler tail` can attach to a stale or reused session and replay old log
lines instead of showing genuinely new activity — it produced byte-identical
output (down to the same historical timestamp) across two separate invocations
during testing, several minutes apart, while a cron trigger was firing on a
2-minute schedule. Treat `wrangler tail` as useful for *watching* a Worker
interactively, never as the ground truth for "has this invocation happened."
For ground truth, use two Cloudflare APIs instead:
1. **Is the schedule registered?**
`GET /accounts/{account_id}/workers/scripts/{script_name}/schedules`
Returns the cron pattern and `created_on`/`modified_on` timestamps. See
`scripts/check-schedule-registered.sh`.
2. **Has it actually invoked?**
The GraphQL Analytics API's `workersInvocationsAdaptive` dataset, filtered
by `scriptName` and a datetime range, returns real invocation counts
(`sum.requests`, `sum.errors`) per time bucket — independent