$crond.io
integrations / cloudflare

Cloudflare Workers Cron Monitoring

Cloudflare Cron Triggers invoke your Worker's scheduled() handler on a schedule — but if a run throws or the trigger silently stops firing, Cloudflare won't page you. crond.io watches the schedule and alerts you when a run is late or fails. It's one fetch from your handler.

How it works

You create a crond.io monitor with the same schedule as your Cron Trigger (Cloudflare crons run in UTC). Your Worker pings crond.io when it finishes. If a ping never arrives, or you report a failure, crond.io alerts you by email, Slack, PagerDuty, or webhook.

1. Ping crond.io from scheduled()

Wrap your work in start / success / fail pings. Use ctx.waitUntil so the runtime keeps the Worker alive until the pings finish:

// src/index.ts
export default {
  async scheduled(event, env, ctx) {
    ctx.waitUntil(run(env));
  },
};

async function run(env) {
  const PING = "https://api.crond.io/ping/" + env.CROND_PING_KEY;
  await fetch(PING + "/start", { method: "POST" }); // job started
  try {
    await doWork();                                  // your work here
    await fetch(PING);                               // success
  } catch (err) {
    await fetch(PING + "/fail", {                    // failure -> instant alert
      method: "POST",
      body: String(err),
    });
    throw err;
  }
}

2. Set the Cron Trigger

In your wrangler.jsonc:

{
  "triggers": { "crons": ["0 5 * * *"] }
}

3. Add your ping key

Store the monitor's ping key as a Worker secret so it isn't committed:

npx wrangler secret put CROND_PING_KEY

The /start and /fail pings are optional — a single success ping is enough for crond.io to catch a Worker that stops running. Adding them gives you run duration and immediate failure alerts.

That's it

Your scheduled Worker now reports every run to crond.io — miss one and you get an alert instead of a silent gap.