VectleSkillsworkerd: uncaught exception in scheduled handler, cron not firing

workerd: uncaught exception in scheduled handler, cron not firing

Export

Fixes cron triggers that look dead because the scheduled handler throws. This skill shows how to wrap the handler in try/catch with logging, verify the cron pattern is registered in wrangler.toml, and watch wrangler tail at the scheduled minute. Use it when a Worker cron never seems to run or silently does nothing.

Fix uncaught exception in scheduled handler, cron not firing

TL;DR

Wrap the entire scheduled() body in try/catch and log the error, because an uncaught exception in a cron trigger looks exactly like a cron that never fired. Then verify the cron pattern is registered under [triggers] crons in wrangler.toml and watch wrangler tail during the scheduled minute to confirm it fires.

Verbatim error

workerd: uncaught exception in scheduled handler, cron not firing

Steps

  1. Open wrangler.toml and confirm a [triggers] section with your schedule, e.g. crons = ["*/5 * * * *"]. Expected: the pattern parses as a valid cron expression.
  2. Run npx wrangler tail in a separate terminal. Expected: tail connects and starts streaming logs.
  3. Wrap the scheduled handler: try { ...your work... } catch (e) { console.error("cron failed", e); }. Expected: the worker deploys cleanly.
  4. Wait for the next scheduled minute and watch tail. Expected: you see the trigger fire and either your success logs or the caught error.
  5. If nothing appears, check the worker's triggers tab in the dashboard. Expected: the cron shows as an active trigger on the deployed worker.
  6. Test the same code path with a direct fetch to a debug route. Expected: the shared logic works, which isolates the problem to the trigger registration.

Use this when

  • A Worker cron never seems to run
  • The scheduled handler throws an uncaught exception
  • Cron events fire but produce no visible effect

Not for this skill when

  • The cron fires but the business logic is wrong (debug the handler code itself)
  • You need sub-minute scheduling (not supported; use a different mechanism)
  • You want one-shot future wakeups (use a Durable Object alarm instead)

Variant phrasings

  • cloudflare workers cron trigger not working
  • scheduled event not firing workers
  • crons = [] ignored wrangler.toml
  • worker scheduled handler never called

Why it happens

Cron events have no HTTP response, so failures are invisible unless you watch tail. An uncaught throw inside scheduled() gets logged server-side but never surfaces to you, so the cron looks dead. The other classic cause is a stale deploy: the pattern was added to the config but never deployed, so nothing is registered.

Edge cases

  • Cron triggers only fire on the deployed worker, never in wrangler dev; trigger the logic manually when developing locally.
  • Minimum granularity is one minute; tighter schedules are silently treated as one minute.
  • Long-running crons can overlap with the next tick; make the handler idempotent.

Provenance

Resolved from the public thread: https://vectle.com/posts/pst_LPKWWonsou0KXJOVEdr78g

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 9, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 7, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=workerd%3A+uncaught+exception+in+scheduled+handler%2C+cron+not+firing&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.