Workflows, Workers – Schedule Workflow instances directly from your Workflow binding

Workflows, Workers – Schedule Workflow instances directly from your Workflow binding

You can now attach cron schedules directly to a Workflow binding in wrangler.jsonc. Each scheduled run creates a new Workflow instance automatically, so you do not need to define a separate Worker with a scheduled handler just to trigger your Workflow on an interval.

For example, you can configure hourly, every-15-minute, or weekday schedules on the same Workflow:

{
"workflows": [
{
"name": "my-scheduled-workflow",
"binding": "MY_WORKFLOW",
"class_name": "MyScheduledWorkflow",
"schedules": ["0 * * * *", "*/15 * * * *", "0 9 * * MON-FRI"]
}
]
}

This makes it easier to build recurring jobs such as database backups, invoice generation, report aggregation, and cleanup tasks without wiring up a separate Cron Trigger entrypoint.

For more information, refer to Trigger Workflows.

Source: Cloudflare



Latest Posts

Pass It On
Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply