[world-vercel] [builders] Add ENFORCE_STRICT_CONCURRENCY option to limit flow route concurrency to one#2193
Draft
VaguelySerious wants to merge 9 commits into
Draft
[world-vercel] [builders] Add ENFORCE_STRICT_CONCURRENCY option to limit flow route concurrency to one#2193VaguelySerious wants to merge 9 commits into
VaguelySerious wants to merge 9 commits into
Conversation
Contributor
Contributor
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (92 failed)mongodb (14 failed):
redis (9 failed):
turso-dev (1 failed):
turso (68 failed):
Details by Category✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
❌ Some E2E test jobs failed:
Check the workflow run for details.
Check the workflow run for details. |
Signed-off-by: Peter Wielander <peter.wielander@vercel.com>
Forces ENFORCE_STRICT_CONCURRENCY behaviour on regardless of the env var so all CI e2e jobs exercise per-run flow topics + maxConcurrency:1. Skips the three off-by-default unit assertions. Drop this commit before merge.
b4bceac to
68a058d
Compare
🦋 Changeset detectedLatest commit: 4baa79d The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 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 |
…issing field
A failed WorkflowRun exposes its reason as `error: { code, message }` and has no
top-level `errorCode`, so the poller's `classifyFailure(runData.errorCode)` was
always passing `undefined` — collapsing every polled failure to an
uncategorised, detail-less `other`. Read `runData.error.code`/`.message` so
USER_ERROR/RUNTIME_ERROR/CORRUPTED_EVENT_LOG are classified correctly and the
regression row shows why the run failed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit d2a59d4)
…t-concurrency # Conflicts: # packages/core/e2e/event-log-race-repro.test.ts
VaguelySerious
commented
Jun 1, 2026
| "@workflow/sveltekit": patch | ||
| --- | ||
|
|
||
| Add opt-in `ENFORCE_STRICT_CONCURRENCY` env var. When set to `1`, flow (orchestrator) routes are limited to one invocation per run at a time via a per-run queue topic and `maxConcurrency: 1` on the flow trigger. Step routes are unaffected. |
Member
Author
There was a problem hiding this comment.
Suggested change
| Add opt-in `ENFORCE_STRICT_CONCURRENCY` env var. When set to `1`, flow (orchestrator) routes are limited to one invocation per run at a time via a per-run queue topic and `maxConcurrency: 1` on the flow trigger. Step routes are unaffected. | |
| Add opt-in `ENFORCE_STRICT_CONCURRENCY` env var, which limits flow route concurrency to one in Vercel environments, at a small queue latency cost. |
Contributor
|
Deployment failed with the following error: |
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.
Adds an opt-in
WORKFLOW_ENFORCE_STRICT_CONCURRENCY=1environment variable, which limits flow route concurrency to one at the queue level. Step routes are unaffected. The behavior is off by default.This is done in two halves:
experimentalTriggersconfig getsmaxConcurrency: 1. Centralized via a newgetWorkflowQueueTrigger()getter in@workflow/builders, consumed by the Build Output API builder.@workflow/world-vercelonly): when enabled, flow messages are sent to a per-run physical VQS topic (__wkf_workflow_<name>_<runId>) while the logicalqueueNamein the message wrapper stays unchanged, so the handler and sleep/delay re-enqueue path resolve the same per-run topic.Potential edge-cases
queueNameper run, so the Vercel Queues observability UI/metrics (which group byqueueName) get unbounded cardinality for projects that enable this. Gated behind the opt-in flag, but worth flagging to Queues o11y owners before broad rollout. Per-run drill-down still exists via thex-vercel-workflow-run-idheader.maxConcurrency: 1on the shared__wkf_workflow_<name>topic and serialize all runs of a workflow through one slot. On Vercel a project env var covers build + runtime, which avoids this; documented in the Vercel World docs.__wkf_workflow_<workflowName>_<runId>with a long namespaced/scoped workflow name plus the run id could approach VQS topic-name length limits. Should confirm the cap and add a hash-suffix fallback if needed before recommending broadly.Testing
The feature is off by default. Anyone running a reproduction against strict concurrency must explicitly set
WORKFLOW_ENFORCE_STRICT_CONCURRENCY=1as a project-level environment variable before building and deploying, so both the generated flow trigger and the runtime queue routing opt in to the behavior.