Skip to content

feat: add configurable step limits for Workflows#12622

Merged
LuisDuarte1 merged 9 commits intomainfrom
lduarte/workflows-raised-step-limit
Mar 3, 2026
Merged

feat: add configurable step limits for Workflows#12622
LuisDuarte1 merged 9 commits intomainfrom
lduarte/workflows-raised-step-limit

Conversation

@LuisDuarte1
Copy link
Contributor

@LuisDuarte1 LuisDuarte1 commented Feb 20, 2026

Add support for limits.steps in 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 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.

Fixes WOR-1010

Describe your change...


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: gated, this only to satisfy the dependency; our changes to enable this will come later

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@LuisDuarte1 LuisDuarte1 requested review from a team as code owners February 20, 2026 15:07
@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2026

🦋 Changeset detected

Latest 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

@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Feb 20, 2026
@LuisDuarte1 LuisDuarte1 marked this pull request as draft February 20, 2026 15:08
@claude
Copy link
Contributor

claude bot commented Feb 20, 2026

Claude encountered an error —— View job


Changeset Review Image

Reviewing changeset files...

  • Read changeset guidelines
  • Review changeset file
  • Validate against criteria
  • Check for cute animals

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 20, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12622

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12622

miniflare

npm i https://pkg.pr.new/miniflare@12622

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12622

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12622

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12622

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12622

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12622

wrangler

npm i https://pkg.pr.new/wrangler@12622

commit: e2ef86e

@LuisDuarte1 LuisDuarte1 force-pushed the lduarte/workflows-raised-step-limit branch from 925dc47 to cc531fd Compare March 2, 2026 17:21
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

✅ All changesets look good

@LuisDuarte1 LuisDuarte1 force-pushed the lduarte/workflows-raised-step-limit branch from cc531fd to fadc1d2 Compare March 2, 2026 18:00
@LuisDuarte1 LuisDuarte1 requested a review from pombosilva March 2, 2026 18:00
@LuisDuarte1 LuisDuarte1 force-pushed the lduarte/workflows-raised-step-limit branch from fadc1d2 to e2dc68f Compare March 2, 2026 18:01
@LuisDuarte1 LuisDuarte1 self-assigned this Mar 2, 2026
@LuisDuarte1 LuisDuarte1 marked this pull request as ready for review March 2, 2026 18:11
@workers-devprod
Copy link
Contributor

workers-devprod commented Mar 2, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/workflows
  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@LuisDuarte1 LuisDuarte1 force-pushed the lduarte/workflows-raised-step-limit branch 2 times, most recently from 073ebab to a580c0d Compare March 2, 2026 18:57
@LuisDuarte1 LuisDuarte1 force-pushed the lduarte/workflows-raised-step-limit branch from a580c0d to af59142 Compare March 3, 2026 11:30
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.
@LuisDuarte1 LuisDuarte1 force-pushed the lduarte/workflows-raised-step-limit branch from af59142 to 45a0a57 Compare March 3, 2026 11:38
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

…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.
@pombosilva
Copy link
Contributor

Approved from the Workflows team! 🚀

@pombosilva pombosilva self-requested a review March 3, 2026 11:58
@github-project-automation github-project-automation bot moved this from Untriaged to In Review in workers-sdk Mar 3, 2026
LuisDuarte1 and others added 2 commits March 3, 2026 15:13
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.
@LuisDuarte1 LuisDuarte1 force-pushed the lduarte/workflows-raised-step-limit branch from 3c30a7a to 8aca581 Compare March 3, 2026 17:01
@LuisDuarte1 LuisDuarte1 requested a review from emily-shen March 3, 2026 17:08
@github-project-automation github-project-automation bot moved this from In Review to Approved in workers-sdk Mar 3, 2026
@LuisDuarte1 LuisDuarte1 merged commit bf9cb3d into main Mar 3, 2026
74 of 86 checks passed
@LuisDuarte1 LuisDuarte1 deleted the lduarte/workflows-raised-step-limit branch March 3, 2026 20:47
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants