Deno Deploy Sunset Countdown: 127 days until April 1, 2027 (Runtime maintenance ends October 2027) Read Cutover Checklist
Technical Guide 5 min read Updated 2026-11-25

Converting Deno.cron Schedules and Handlers to Worker scheduled() Exports

How to extract Deno.cron schedules into wrangler.jsonc triggers.crons, generate typed scheduled() dispatchers, and access env bindings cleanly.

Automate this migration for your repository
Run the free AST risk scanner or launch the paid TypeScript codemod workbench.
Run Free Risk Scan

1. Extracting Declarative Schedules to wrangler.jsonc

In Deno Deploy, Deno.cron(name, schedule, handler) registers background schedules inline inside application code at startup. In Cloudflare Workers, cron schedules live declaratively in wrangler.jsonc under triggers.crons so Cloudflare's edge scheduler invokes your Worker's scheduled() export reliably.

wrangler.jsonc triggers configuration
{
  "compatibility_date": "2026-11-01",
  "compatibility_flags": ["nodejs_compat"],
  "triggers": {
    "crons": ["*/15 * * * *"]
  }
}

2. Dispatching Multiple Schedules and Threading Env

Our AST codemod extracts each Deno.cron callback into an isolated async function, maps Deno.env.get() calls to the Worker Env binding (or AsyncLocalStorage getEnv() context for deep helper calls), and emits a switch (controller.cron) dispatcher inside export default { async scheduled(controller, env, ctx) }.


More Deno to Cloudflare Migration Guides