CronNudge

Published October 21, 2026

How to Monitor Cloudflare Workers Cron Triggers

A Cron Trigger invokes your Worker's scheduled handler. If that handler is missing, throws, or gets killed at the wall-time limit, the run is a row in the dashboard, not a message to you. The dashboard keeps the last 100 of those rows.

This is the wrangler config, a scheduled handler that pings only after the work finishes, and the ways a trigger fails without an exception in your code. Behavior is from Cloudflare's Cron Triggers and scheduled handler docs as updated October 17, 2026.

What the trigger actually does

You map one or more five-field cron expressions to one Worker. Every expression calls the same scheduled(controller, env, ctx) function. controller.cron is the expression that fired. controller.scheduledTime is the scheduled time in milliseconds since the epoch, not the time your code started.

Triggers run on UTC. There is no timezone field.

Cloudflare's weekday numbers are not the ones most cron tools use. Sunday is 1 and Saturday is 7. 0 17 * * 1 is 17:00 UTC on Sunday. Names such as SUN avoid the number. The docs also accept Quartz-style extensions: L, W, and # in the day and weekday fields, including LW for the last weekday of the month.

CronNudge's schedule parser is ordinary cron. There, Sunday is 0 or 7 and Monday is 1, so 0 17 * * 1 is Monday. LW does not parse. A form such as 6L can parse and still mean a different day than it does on Cloudflare, because the weekday numbers disagree. If the Worker expression uses L, W, or #, do not paste it into the check unchanged. Use a plain five-field expression for the check, in UTC, or an interval that matches the real gap. The cron expression examples and the cron tool use the same parser as the product.

The runtime waits for the promise returned by scheduled, up to a 15 minute wall-time limit. You do not need ctx.waitUntil for that single promise. waitUntil is for work that continues after you return, and for marking status: Cloudflare records the first waitUntil rejection as the invocation status in Cron Events.

Wrangler config

Cron Triggers for a Worker managed with Wrangler belong in the Wrangler config, not only in the dashboard. A deploy replaces the deployed triggers with the crons array you ship.

{
  "triggers": {
    "crons": ["17 3 * * *"]
  }
}
[triggers]
crons = [ "17 3 * * *" ]

If the project uses cloudflare.config.ts instead, the same schedule is triggers.scheduled({ schedule: "17 3 * * *" }) on the worker. Deploy with the CLI you actually use (wrangler deploy or cf deploy). Editing the file does not change production until that deploy finishes, and Cloudflare says a new, changed, or deleted trigger can take up to 15 minutes to propagate.

Two config traps:

  • crons: [] removes every Cron Trigger. Omitting triggers (leaving it undefined) leaves whatever is already deployed. A deploy that you thought "did not touch cron" may have deleted them, or may have left a trigger you removed from the file.
  • A crons list under env.dev applies to that environment, not to production. The production deploy does not pick it up.

Store the ping URL as a secret, not in the config file:

npx wrangler secret put CRONNUDGE_URL

The value is https://cronnudge.com/ping/<check-id>. One check per expression if a Worker has several triggers. The id is the ping id. It is not the badge id.

Ping from scheduled(), only after the work

fetch with no method is GET. CronNudge counts GET, POST, and HEAD. The body is text/plain ok. Call the ping after the work, and pass that promise to ctx.waitUntil so the isolate does not end the request early.

export default {
  async scheduled(controller, env, ctx) {
    await doTheWork(env, controller.scheduledTime);
    ctx.waitUntil(fetch(env.CRONNUDGE_URL));
  },
};

Order matters. waitUntil before doTheWork reports success even when the work throws. fetch without await and without waitUntil can be cancelled when the handler returns, so the ping never lands and the check goes late.

If doTheWork throws, the waitUntil line never runs. The handler rejects, Cron Events shows a failed invocation, and CronNudge sees silence. That is the outcome you want.

A failed ping is the same silence, and it is also a rejected waitUntil, so Cron Events records the invocation as failed even though your work succeeded. Egress that cannot reach cronnudge.com looks like that. The late check is the alert. The Cron Events row is how you tell a ping failure from a job that never started.

Several expressions, several checks:

export default {
  async scheduled(controller, env, ctx) {
    await doTheWork(env, controller.cron);
    const url = {
      "17 3 * * *": env.CRONNUDGE_NIGHTLY,
      "*/15 * * * *": env.CRONNUDGE_QUARTER_HOUR,
    }[controller.cron];
    if (url) ctx.waitUntil(fetch(url));
  },
};

*/15 * * * * fits Free, whose shortest interval is 5 minutes. * * * * * is every minute and needs Pro, whose minimum is 1 minute.

Optional /fail

/fail and /start are real paths on the same ping id. /fail alerts immediately instead of waiting out grace. A trigger that never invokes the handler, or a handler killed at 15 minutes before it reaches the ping, never calls /fail. The missing success ping is the backstop. One alert when the check is down, and one when it recovers. Stuck-run tracking is in assertions, runs, and agents.

export default {
  async scheduled(controller, env, ctx) {
    try {
      await doTheWork(env, controller.scheduledTime);
      ctx.waitUntil(fetch(env.CRONNUDGE_URL));
    } catch (error) {
      ctx.waitUntil(fetch(env.CRONNUDGE_URL + "/fail"));
      throw error;
    }
  },
};

Rethrow. Swallowing the error marks the invocation successful from the handler's return value, and the /fail ping is the only signal left.

Ways the trigger fails without a stack trace

  • There is no scheduled handler. A Worker that only exports fetch has nothing for the trigger to run. Module workers need scheduled on the default export.
  • The cron you edited is not the one that deployed. Wrong Wrangler environment, an empty crons array, or a deploy that has not propagated. Allow 15 minutes, then read the triggers on the deployed Worker, not the file on your laptop.
  • The clock is UTC. 0 9 * * * is 09:00 UTC. It ran, at a time you were not watching.
  • The weekday number means Sunday on Cloudflare and Monday on most other cron. The check then expects the ping on the wrong day and alerts, or you "fix" a Worker that was fine.
  • Local dev does not fire triggers on a timer. wrangler dev and cf dev wait for you to send a test invocation. A Worker that "works in dev" has not proven the schedule.
  • The handler hits the 15 minute wall-time limit. The isolate is killed. A ping that is only at the end never runs. Split the work, or ping only the slice that finished and let the next run continue. Do not assume the platform retries. Production retry behavior for a thrown handler is not spelled out in the cron trigger docs. controller.noRetry() exists, and the local test result includes whether you called it. Write the job so a second run is safe.
  • Cron Events are a short log. The dashboard keeps the 100 most recent invocations (Worker, Settings, Trigger Events, View events). A new Worker, or a rename, can take up to 30 minutes to show events. Workers Logs keep invocations longer. Neither of those sends an alert.

Test the handler without waiting for 03:17

Local development does not run Cron Triggers automatically. With wrangler dev or cf dev on port 8787:

curl "http://localhost:8787/cdn-cgi/local/scheduled?cron=17+3+*+*+*&format=json"

The JSON includes outcome and noRetry. Read outcome to see whether the handler succeeded. The curl itself only proves the dev server answered. time is epoch milliseconds and overrides controller.scheduledTime.

curl "http://localhost:8787/cdn-cgi/local/scheduled?cron=17+3+*+*+*&time=1745856238000"

Use the port your dev server printed. Vite's default is 5173. This hits your machine. It does not prove the production trigger is registered.

Match the check to the expression

Set the CronNudge check to the same UTC time you intended, with weekday numbers translated as above. Default grace is 5 minutes. The form offers none, 1 minute, 5 minutes, 15 minutes, and 1 hour. The API accepts any whole number of seconds from 0 through 7 days. A daily job can use the 1 hour option. A */15 job fits the 15 minute option and fits Free.

Free is 10 checks, with email and one Slack or Discord channel. Pro is $12 a month for 100 checks, a 1 minute minimum, signed webhooks, and the API. There is no yearly price.

A Worker cron is the same shape of problem as a Vercel Cron route: the platform invokes you, and a missed invocation is invisible unless the handler pings something that expected the call. The Node fetch details are the same as the Node docs.

FAQ

Does Cloudflare email me when a Cron Trigger fails? Not as part of Cron Triggers. The invocation shows up in Cron Events, which keeps 100 rows, and in Workers Logs. An alert has to be something you send.

Do Cron Triggers run in local dev on schedule? No. Local development does not run them on a timer. Send a request to /cdn-cgi/local/scheduled, or use the Cron Triggers panel in Local Explorer (Wrangler 4.139.0 or later).

What time zone is the expression? UTC. There is no timezone field on the trigger. controller.scheduledTime is the scheduled instant in epoch milliseconds.

Why did my Sunday cron run on Monday in CronNudge? Cloudflare numbers Sunday as 1. CronNudge's parser numbers Monday as 1 and Sunday as 0 or 7. Copy the names (SUN) or translate the number. Do not paste L or W expressions straight into the check.

What if the Worker is killed at 15 minutes? The wall-time limit for a Cron Trigger is 15 minutes. Code after that point does not run, including a ping at the bottom of the handler. CronNudge then sees a missing ping and alerts after grace.

Can one Worker report several schedules? Yes. Every expression calls the same scheduled function. Read controller.cron and ping a different check URL per expression if you want separate alerts.


The trigger fires on Cloudflare's clock, into whatever handler the last production deploy actually shipped. The ping is how you hear about the runs that never get that far. Create the check, or read how to monitor cron jobs for the same pattern on a shell, in Python, and in Node.