Cloudflare Workers .NET / scheduled task
worker check deferred

The trigger

Registered in wrangler.toml, delivered by Cloudflare, handled by WorkerEvents.OnSchedule.

Cron trigger
0 * * * * — every hour
→
[Scheduled] handler
OnSchedule(scheduled, env, ctx)
→
KV write
context.WaitUntil(kv.put(…))
→
This page
GET /api/scheduled

0 * * * * is a standard cron expression: at minute 0 of every hour. The KV write is handed to context.WaitUntil because the handler returns immediately.

Fire the real cron trigger

“Run the task now” calls the same code the cron calls and records the run as manual. The last button asks wrangler dev --test-scheduled to fire the cron as Cloudflare would, and it is opened in a new tab because that endpoint belongs to wrangler rather than to the worker.

Latest result in KV

Nothing in scheduled_result yet. Wait for the next full hour, or run the task now.

Run history

Newest first. Stored next to the latest result so the sample can be read without waiting for two hours.

No runs yet.

Calls made from this page

No calls yet.

An unhandled error has occurred. Reload 🗙