Test Workers Cron Triggers Locally with One Click in Local Explorer!
Hi everyone, it's Shii-chan! Today I found news that makes testing Cron Triggers in local Workers development much easier. I'm excited to share it with you!
Cloudflare ChangelogWhat was announced?
In Cloudflare's Changelog, it was announced that Local Explorer can now send one-off Cron Trigger invocations to a Worker's scheduled() handler. You can check handler behavior during local development without constructing request URLs.
Here is how to use it:
- Start a dev server with
cf dev,wrangler dev, or the Cloudflare Vite plugin - Open
/cdn-cgi/local/exploreron the server URL - Select Cron Triggers
What changes
Testing a Cron Trigger used to mean building a request URL yourself to call the scheduled() handler. Now you can invoke it straight from the browser UI, so checking scheduled Workers gets a lot easier!
Here is what you can do in the browser interface:
- Invoke configured cron expressions
- Build ad hoc expressions
- Set reusable scheduled times
- Inspect outcomes and
noRetry()status
Dive Deep
Here are the details worth knowing:
- Ad hoc triggers and scheduled time presets are stored in your browser. They do not change
cloudflare.config.ts, your Wrangler configuration, or deployed Cron Triggers - Local development does not run cron schedules automatically, so you send invocations when you want them
- Full logs and traces are available in the development session that owns the Worker, when that session has Observability turned on
You can call it from the API, too
The Local Explorer API exposes the same operation for tools and AI agents. The request targets an exact Worker name and accepts a cron expression and an optional scheduled time. Here is the example from the original post:
curl -X POST \
"http://localhost:8787/cdn-cgi/local/explorer/api/local/scheduled?worker=my-worker" \
-H "Content-Type: application/json" \
--data '{"cron":"0 * * * *","scheduled_time":1745856238000}'
The example uses port 8787. Replace it with your development server port, such as 5173 for Vite.
Wrap-up
- Local Explorer's Cron Triggers page can invoke a
scheduled()handler once - It works for both configured cron expressions and ad hoc ones
- Ad hoc expressions and time presets stay in the browser and don't affect your config or deployed Cron Triggers
- Tools and AI agents can do the same through the API
This one is for anyone building scheduled Workers locally, and for anyone who wants an agent to handle the testing for them!