feat: add configurable step limits for Workflows#12622
Merged
LuisDuarte1 merged 9 commits intomainfrom Mar 3, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 9aff8f5 The changes in this PR will be included in the next version bump. 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 |
Contributor
|
Claude encountered an error —— View job Changeset 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
wrangler
commit: |
pombosilva
reviewed
Mar 2, 2026
pombosilva
reviewed
Mar 2, 2026
pombosilva
reviewed
Mar 2, 2026
925dc47 to
cc531fd
Compare
Contributor
|
✅ All changesets look good |
cc531fd to
fadc1d2
Compare
fadc1d2 to
e2dc68f
Compare
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers |
073ebab to
a580c0d
Compare
pombosilva
reviewed
Mar 2, 2026
a580c0d to
af59142
Compare
Add support for `limits.steps` in workflow configuration, allowing users to set a maximum number of steps per workflow instance (1–100,000). The step limit is sent to the Workflows API during `wrangler deploy` and is also enforced locally in `wrangler dev` via the workflows-shared engine. When a workflow instance exceeds the configured limit, it fails with an error indicating the limit was reached. Example wrangler.toml: [[workflows]] binding = "MY_WORKFLOW" name = "my-workflow" class_name = "MyWorkflow" [workflows.limits] steps = 5000 If not specified, the default limit of 10,000 steps is used.
…paths Move the limits + script_name semantic validation out of the config validator (which lacks the resolved worker name) and into the deploy and dev consumption points where the resolved name is available. When a workflow references an external script via script_name and has limits configured, a warning is emitted in both wrangler deploy and wrangler dev, and the limits are stripped for external workflows in local dev since they belong to the other worker's configuration.
A hard error is more appropriate than a warning since configuring limits on a workflow that references a different script via script_name is always a misconfiguration — the limits would be silently ignored.
The maximum step limit is account-dependent and enforced server-side by the Workflows API, so client-side validation should only check that the value is a positive integer.
af59142 to
45a0a57
Compare
…aximum Emit a warning during local dev when a workflow's configured step limit exceeds 25,000 (the production maximum), so users know their config may not work when deployed.
Contributor
|
Approved from the Workflows team! 🚀 |
pombosilva
approved these changes
Mar 3, 2026
emily-shen
requested changes
Mar 3, 2026
Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com>
…env tests Move the >25k step limit warning from miniflare runtime to workers-utils config validation for consistency with other config diagnostics. Add tests for workflow script_name + limits validation under named environments (--env), covering the env-suffixed name resolution.
3c30a7a to
8aca581
Compare
emily-shen
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add support for
limits.stepsin workflow configuration, allowing users to set a maximum number of steps per workflow instance (1–user entitlement).The step limit is sent to the Workflows API during
wrangler deployand is also enforced locally inwrangler devvia the workflows-shared engine. When a workflow instance exceeds the configured limit, it fails with an error indicating the limit was reached.Example wrangler.toml:
[[workflows]]
binding = "MY_WORKFLOW"
name = "my-workflow"
class_name = "MyWorkflow"
[workflows.limits]
steps = 5000
If not specified, the default limit of 10,000 steps is used.
Fixes WOR-1010
Describe your change...
A picture of a cute animal (not mandatory, but encouraged)