awml / platforms / cloudflare-workers
Cloudflare Workers with Cron Triggers
A Cloudflare Worker started by Cron Triggers or by a request, running the workflow's own code on Cloudflare's network. This describes a kind of platform, not anyone's account. Cloudflare, which runs the Worker, sees everything it handles, and the fit has no field for that. Checked against Cloudflare's documentation on 22 October 2026.
Install a workflow on Cloudflare Workers with Cron Triggers
The workflow runs as a Worker's own code on Cloudflare's network, started by Cron Triggers or by a request to the Worker. AI steps call a model company's API with fetch, or Workers AI. A Worker has no file system: state the workflow makes lives in KV, D1 or R2.
Run awml fit with the workflow's security view and this description first. Contexts kept in folders, with at, do not fit here. Cloudflare runs the Worker and sees what it handles, which the fit does not check, so make sure every scope the Worker touches allows Cloudflare.
What to create
- A Worker project, with
npm create cloudflare@latest, written in TypeScript or JavaScript. - A
scheduledhandler that runs the steps in the order the drawing lists them: each code step as a function, each AI step as a call to the model company the fit named for it. An outside action marked Ask ends in a draft or a message asking a person for a yes, never in the action itself. A request handler can take the yes and carry the action out. - Bindings in
wrangler.jsoncfor the KV namespace, D1 database or R2 bucket that holds the workflow's state.
Where secrets go
Add each key with wrangler secret put <NAME>, which prompts for the value, and read it in code as env.<NAME>. For local runs, put values in .dev.vars and keep that file out of git. Never put a key in wrangler.jsonc or the code.
How to schedule the triggers
List cron expressions under triggers.crons in wrangler.jsonc, such as "7 7 * * 1-5", then wrangler deploy. They run in UTC. A change can take up to 15 minutes to reach Cloudflare's network, and each deploy replaces the earlier triggers. A scheduled run may last up to 15 minutes, and its CPU time is capped by plan and how often it runs, though time spent waiting on a model's reply does not count. For a trigger that is an event, have the sender call the Worker's URL.
How to check it is running
Test the handler locally with wrangler dev and curl "http://localhost:8787/cdn-cgi/local/scheduled". Once deployed, the Worker's Past Cron Events in the dashboard lists recent runs, though a new Worker's can take up to 30 minutes to appear, and wrangler tail streams live logs.
Sources
- https://developers.cloudflare.com/workers/configuration/cron-triggers/
- https://developers.cloudflare.com/workers/platform/limits/
- https://developers.cloudflare.com/workers/configuration/secrets/