Docs › Cloudflare Workers Cron Trigger monitoring with RunVouch
Cloudflare Workers Cron Trigger monitoring with RunVouch
Cloudflare Workers Cron Trigger monitoring where there is no exit code: a Worker's scheduled() handler has no output you can look at later and, on the free plan, a CPU time limit that ends a run mid-way without an error you will see.
How it runs on Cloudflare Workers Cron Triggers
Inside scheduled(event, env, ctx), with two fetch() calls to the API. Workers cannot run a binary.
Store the key
wrangler secret put RUNVOUCH_KEY; read it as env.RUNVOUCH_KEY.
Report the run (two HTTP calls)
export default {
async scheduled(event, env, ctx) {
const h = {"X-API-Key": env.RUNVOUCH_KEY, "content-type": "application/json"};
const {run_id} = await (await fetch("https://api.runvouch.com/v1/runs/start", {method: "POST", headers: h,
body: JSON.stringify({agent: "nightly-report", source: "cloudflare"})})).json();
let status = "ok", evidence = {};
try { evidence = {rows: await doTheWork(env)}; } catch (e) { status = "fail"; }
ctx.waitUntil(fetch("https://api.runvouch.com/v1/runs/end", {method: "POST", headers: h,
body: JSON.stringify({run_id, status, evidence})}));
}
}
// wrangler.toml: [triggers] crons = ["0 2 * * *"]The start call returns run_id; the end call takes status (ok or fail), optional cost and tokens, and evidence as a JSON object of booleans. Full reference on the API page.
Register the cadence and caps
rv agent nightly-report --cadence 24h --grace 30m --max-runtime 1h --evidence --cap-run-cost 2
Register the agent once, from anywhere with the key. Cadence is what turns a schedule that stopped into an alert; --evidence makes a run without evidence a failure; the caps pause the agent when it overspends.
What goes silent on Cloudflare Workers Cron Triggers
- A cron trigger removed from
wrangler.tomlon the next deploy stops silently; MISSED is the only signal. - Exceeding CPU time kills the invocation; the start call already happened, so RunVouch marks the run STALLED when it never ends.
- An
awaitthat is not wrapped inctx.waitUntilcan be cut off; put the end call inwaitUntilas above.
What Cloudflare Workers Cron Triggers does not tell you
The Cloudflare dashboard lists past cron invocations per Worker with a status and duration; there is no notification when an invocation fails, is cut off by the CPU limit, or stops being scheduled because the [triggers] block was dropped from wrangler.toml in a deploy. Console output is only kept if you enable Workers Logs or tail the Worker live.
What RunVouch detects
| Alert | What it means here |
|---|---|
| MISSED | cadence plus grace passed and no run started |
| FAILED | non-zero exit or a reported failure, with the stderr excerpt |
| NO_EVIDENCE | the run said ok but the file, URL or assertion you required is missing |
| STALLED | a run started and never ended within max runtime |
| RETRY_STORM | the same tool called with identical input many times in one run |
| BUDGET_RUN / BUDGET_DAY | cost cap crossed; the agent is paused until you resume it |
| DRIFT | duration or output size far off its 7-run baseline |
Set up in two minutes
- Get a free key (3 agents, no card) and store it where this page says.
- report the run (two http calls): copy the snippet above into the scheduled job.
- Register the cadence once:
rv agent nightly-report --cadence 24h --grace 30m --evidence, or let the first run create the agent and set the cadence on the dashboard. - Send one test alert:
curl -X POST https://api.runvouch.com/v1/settings/test-alert -H "X-API-Key: $RUNVOUCH_KEY". The next missed, failed or empty run reaches the same channels.
Also running cloud functions?
Vercel Cron Jobs. Supabase (pg_cron + Edge Functions). AWS Lambda + EventBridge Scheduler. Google Cloud Scheduler. The full list of runtimes is on integrations, and the same agent can report from several of them: one job, one cadence, wherever it happens to run.
Need a key? Get a free key · Stuck? contact