[wrangler] Add schedule property to Workflow bindings for cron-based triggering - #13467
Conversation
🦋 Changeset detectedLatest commit: 7d189a6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
|
✅ All changesets look good |
|
I'm Bonk, and I've done a quick review of your PR. This PR adds an optional I found one actionable issue and posted it as a review:
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
Hi @deloreyj — we're doing some cleanup of stale draft PRs. This PR has been quiet since 2026-04-16. Could you let us know within 14 days whether you're still planning to continue?
Thanks! |
a9eb8ce to
7d189a6
Compare
|
Codeowners approval required for this PR:
Show detailed file reviewers |
petebacondarwin
left a comment
There was a problem hiding this comment.
I assume that workerd already implements this and that it gets picked up and works for local development in Miniflare automatically?
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
…triggering Add optional schedule field to WorkflowBinding and CfWorkflow types, accepting a cron expression string or array of cron expressions. The schedule is validated on config load and sent to the Workflows control plane API on deploy. Configuring schedule on a workflow that references an external script_name is an error. WOR-1221
7d189a6 to
3f5388a
Compare
…triggering (#13467) Co-authored-by: Olga Silva <osilva@cloudflare.com>
Fixes WOR-1221.
Add an optional
schedulefield to Workflow bindings that accepts a cron expression string or array of cron expressions. Onwrangler deploy, the schedule is sent to the Workflows control plane API, enabling automatic triggering of workflow instances on a cron schedule.NOTE: This is a configuration-only change. Scheduled triggering of Workflow instances is not yet available - adding
scheduleto a Workflow binding will not result in scheduled invocations at this time. This change lays the groundwork for an upcoming feature.Changes
schedule?: string | string[]toWorkflowBindingtype andCfWorkflowinterfacevalidateWorkflowBinding— accepts a non-empty string or non-empty array of non-empty strings; errors on wrong type, empty string, empty array, or mixed arrayscheduleto the API payload intriggers/deploy.ts, with an error ifscheduleis configured on a workflow that references an externalscript_name(consistent with howlimitsis handled)Usage
Multiple schedules:
{ "workflows": [ { "binding": "MY_WORKFLOW", "name": "my-workflow", "class_name": "MyWorkflow", "schedule": ["0 9 * * 1", "0 17 * * 5"] } ] }A picture of a cute animal (not mandatory, but encouraged)