[core] Don't fail to queue on 409 responses - #1418

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409
Mar 18, 2026
Merged

[core] Don't fail to queue on 409 responses#1418
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 17, 2026

Copy link
Copy Markdown
Member

Noticed error logs from 409s falling through the queue, which are confusing for users. Log example:

Queue callback error: Error [WorkflowAPIError]: Cannot update workflow run wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV with status 'completed'. Operation requires status 'running' or 'pending'.
at cP (.next/server/chunks/[root-of-the-server]__fd848f42._.js:63:41)
at async gA (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:3954)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:86:8)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:148157)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:146659)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:83:2206)
at async default (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:7813)
at async u7.processMessage (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:13992)
at async u7.consume (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:15197) {
cause: undefined,
status: 409,
code: undefined,
url: 'https://vercel-workflow.com/api/v1/runs/wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV'
}

so I ensures we catch and gracefully return for these cases. I had Claude run an eval on whether this blocks any real use cases. Eval below:


Concurrent scenarios and why skipping is safe

Scenario 1: Two handlers race on run_started

Two queue messages for the same run arrive while it's still pending. Both handlers call world.runs.get(), see pending, and try to create a run_started event.

Handler A: runs.get() → pending → events.create(run_started) → ✅ succeeds → continues replay loop
Handler B: runs.get() → pending → events.create(run_started) → ❌ 409 → returns early

Why it's safe: Handler A transitions the run to running and enters the replay loop. The replay loop either completes the workflow or suspends it with queued continuations. Handler B's early exit is a no-op — Handler A guarantees progress.

Location:runtime.ts catch block after run_started event creation.

Scenario 2: Two handlers race on run_completed

Two concurrent replay loops both reach the end of the workflow and try to create run_completed.

Handler A: events.create(run_completed) → ✅ succeeds → returns
Handler B: events.create(run_completed) → ❌ 409 → logs info → returns

Why it's safe: The run is completed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_completed event creation.

Scenario 3: Two handlers race on run_failed

Same as Scenario 2 but for failure. Both handlers detect an error in user code and try to fail the run.

Handler A: events.create(run_failed) → ✅ succeeds → returns
Handler B: events.create(run_failed) → ❌ 409 → logs info → returns

Why it's safe: The run is failed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_failed event creation.

Scenario 4: Run completes while another handler creates hooks

Handler A completes the workflow. Handler B (from an earlier queue message) is still in the suspension handler creating hook events.

Handler A: events.create(run_completed) → ✅ run is now terminal
Handler B: events.create(hook_created) → ❌ 409 (run terminal) → logs info, continues
→ returns from handleSuspension with pendingSteps
→ tries to execute inline step
→ events.create(step_started) → ❌ 410 (run gone) → returns { type: 'gone' }
→ caller returns

Why it's safe: Handler A already completed the workflow. Handler B's hook creation fails, and if any steps were queued, the step executor receives 410 on step_started and exits gracefully. The 410 on step_started is the safety net — even if the suspension handler returns pending steps after a 409, the step executor won't make progress on a finished run.

Location:suspension-handler.ts catch blocks for hook_created and hook_disposed; step-executor.ts 410 handling on step_started.

Scenario 5: Two handlers race on wait_completed

During the replay loop, both handlers see an elapsed wait and try to complete it.

Handler A: events.create(wait_completed) → ✅ succeeds → adds event to cache → continues replay
Handler B: events.create(wait_completed) → ❌ 409 → continue (skip this wait) → continues replay

Why it's safe: Both handlers continue their replay loops. The event log is the same for both (the winning handler's wait_completed is visible to future reads). Subsequent replay from either handler converges to the same state because replay is deterministic and event-sourced.

Location:runtime.ts wait completion loop with continue on 409.

Scenario 6: Two handlers race on step_completed

Two handlers execute the same step concurrently (e.g., both received the step's queue message). Both finish execution and try to create step_completed.

Handler A: events.create(step_completed) → ✅ succeeds → queues workflow continuation → returns
Handler B: events.create(step_completed) → ❌ 409 → returns WITHOUT queuing continuation

Why it's safe: Handler A queues the workflow continuation. Handler B does not — this is correct because only one continuation should be queued per step completion. If both queued, there would be redundant replay (which is safe but wasteful).

Location:step-executor.ts catch on step_completed event creation.

Scenario 7: Two handlers race on step_started

Two handlers try to start the same step. Handler A wins; Handler B gets 409 because the step transitioned to a terminal state.

Handler A: events.create(step_started) → ✅ succeeds → executes step → queues continuation
Handler B: events.create(step_started) → ❌ 409 (step terminal) → returns { type: 'skipped' }
→ caller queues workflow continuation (runtime.ts replay loop)

Why it's safe: Both handlers ensure workflow continuation — Handler A via step completion, Handler B via the replay loop re-queuing the workflow. The redundant replay is safe because event-sourced replay is convergent.

Location:step-executor.ts 409 handling on step_started.

Scenario 8: step_created/wait_created duplicate

During suspension handling, two concurrent replays both try to create the same step or wait event.

Handler A: events.create(step_created) → ✅ succeeds
Handler B: events.create(step_created) → ❌ 409 → logs info → continues

Why it's safe: The step/wait entity already exists. The suspension handler continues processing other items. The step will be executed by whichever handler picks it up from the queue.

Location:suspension-handler.ts catch blocks for step_created and wait_created.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@vercel

vercelBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9668d09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

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-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.038s (-15.7% 🟢)1.005s (~)0.968s101.00x
💻 LocalNitro0.046s (+6.7% 🔺)1.006s (~)0.959s101.23x
💻 LocalNext.js (Turbopack)0.051s1.006s0.955s101.36x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.951s101.44x
🐘 PostgresNitro0.059s (-4.7%)1.011s (~)0.952s101.56x
🐘 PostgresExpress0.059s (-14.8% 🟢)1.011s (~)0.952s101.57x
🌐 MongoDBNext.js (Turbopack)0.079s1.008s0.929s102.11x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.465s (-33.5% 🟢)2.036s (-22.7% 🟢)1.571s101.00x
▲ VercelExpress0.504s (-20.0% 🟢)2.286s (-14.4% 🟢)1.781s101.08x
▲ VercelNext.js (Turbopack)0.511s (-17.6% 🟢)2.559s (+13.2% 🔺)2.049s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.093s (-3.3%)2.006s (~)0.912s101.00x
🌐 RedisNext.js (Turbopack)1.122s2.006s0.885s101.03x
💻 LocalNitro1.130s (~)2.006s (~)0.877s101.03x
💻 LocalNext.js (Turbopack)1.130s2.006s0.876s101.03x
🐘 PostgresExpress1.153s (+0.7%)2.014s (~)0.860s101.05x
🐘 PostgresNitro1.158s (+1.1%)2.012s (~)0.855s101.06x
🌐 MongoDBNext.js (Turbopack)1.307s2.008s0.700s101.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.040s (-3.0%)3.224s (-4.4%)1.184s101.00x
▲ VercelExpress2.053s (+0.9%)3.735s (+12.4% 🔺)1.682s101.01x
▲ VercelNext.js (Turbopack)2.168s (-2.0%)3.924s (+13.8% 🔺)1.756s101.06x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.615s (-2.8%)11.023s (~)0.408s31.00x
🌐 RedisNext.js (Turbopack)10.784s11.023s0.239s31.02x
💻 LocalNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNitro10.927s (~)11.042s (~)0.115s31.03x
🐘 PostgresExpress10.970s (~)11.375s (~)0.405s31.03x
💻 LocalNitro10.976s (+0.8%)11.024s (~)0.048s31.03x
🌐 MongoDBNext.js (Turbopack)12.203s13.015s0.812s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.779s (-7.4% 🟢)18.655s (-5.6% 🟢)1.876s21.00x
▲ VercelNitro16.868s (+1.3%)18.197s (-1.3%)1.329s21.01x
▲ VercelNext.js (Turbopack)17.826s (+0.9%)19.468s (+1.2%)1.641s21.06x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.743s (-3.1%)27.051s (-3.6%)0.308s31.00x
🌐 RedisNext.js (Turbopack)26.760s27.049s0.289s31.00x
💻 LocalNext.js (Turbopack)27.128s28.053s0.925s31.01x
🐘 PostgresExpress27.240s (~)28.066s (~)0.826s31.02x
🐘 PostgresNitro27.277s (~)28.065s (~)0.788s31.02x
💻 LocalNitro27.583s (~)28.053s (~)0.470s31.03x
🌐 MongoDBNext.js (Turbopack)30.482s31.045s0.564s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro46.028s (+2.9%)47.737s (+4.3%)1.709s21.00x
▲ VercelNext.js (Turbopack)50.377s (+6.6% 🔺)52.253s (+8.0% 🔺)1.877s21.09x
▲ VercelExpress53.606s (+21.0% 🔺)55.319s (+22.1% 🔺)1.713s21.16x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.541s54.093s0.552s21.00x
🐘 PostgresExpress54.300s (~)55.094s (~)0.793s21.01x
🐘 PostgresNitro54.476s (~)55.105s (~)0.629s21.02x
💻 LocalExpress54.851s (-3.3%)55.101s (-3.5%)0.250s21.02x
💻 LocalNext.js (Turbopack)55.951s56.100s0.149s21.05x
💻 LocalNitro56.657s (~)57.106s (~)0.450s21.06x
🌐 MongoDBNext.js (Turbopack)60.675s61.065s0.390s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express94.771s (-4.4%)96.975s (-4.2%)2.204s11.00x
▲ VercelNitro96.605s (~)98.384s (~)1.779s11.02x
▲ VercelNext.js (Turbopack)98.753s (-3.9%)100.796s (-2.8%)2.043s11.04x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.345s2.006s0.662s151.00x
🐘 PostgresExpress1.366s (-4.0%)2.011s (~)0.645s151.02x
💻 LocalExpress1.467s (-5.2% 🟢)2.006s (~)0.538s151.09x
💻 LocalNitro1.498s (-1.1%)2.005s (~)0.507s151.11x
💻 LocalNext.js (Turbopack)1.547s2.006s0.459s151.15x
🌐 MongoDBNext.js (Turbopack)2.146s3.009s0.863s101.60x
🐘 PostgresNext.js (Turbopack)⚠️missing----
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.312s (-4.2%)3.407s (-4.8%)1.095s91.00x
▲ VercelNext.js (Turbopack)2.641s (-1.3%)4.038s (+7.5% 🔺)1.397s81.14x
▲ VercelExpress2.648s (+5.0%)4.138s (+13.0% 🔺)1.490s81.15x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.567s3.008s0.440s101.00x
🐘 PostgresNitro2.595s (~)3.014s (~)0.419s101.01x
💻 LocalExpress2.600s (-14.1% 🟢)3.007s (-15.6% 🟢)0.407s101.01x
🐘 PostgresExpress2.615s (~)3.015s (~)0.399s101.02x
💻 LocalNext.js (Turbopack)3.041s3.760s0.718s81.18x
💻 LocalNitro3.121s (+7.5% 🔺)3.565s (+11.1% 🔺)0.444s91.22x
🌐 MongoDBNext.js (Turbopack)4.747s5.179s0.432s61.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.799s (+7.7% 🔺)4.348s (+21.1% 🔺)1.550s81.00x
▲ VercelNitro3.520s (+30.2% 🔺)4.708s (+23.4% 🔺)1.188s71.26x
▲ VercelExpress3.663s (+47.9% 🔺)5.183s (+40.8% 🔺)1.520s81.31x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express4.027s (+1.4%)4.588s (+3.2%)0.561s71.00x
🐘 PostgresNitro4.032s (+0.7%)4.590s (+3.1%)0.558s71.00x
🌐 RedisNext.js (Turbopack)4.081s5.012s0.931s61.01x
💻 LocalExpress6.787s (-15.7% 🟢)7.014s (-20.1% 🟢)0.227s51.69x
💻 LocalNext.js (Turbopack)7.888s8.517s0.629s41.96x
💻 LocalNitro8.207s (-1.6%)8.521s (-5.5% 🟢)0.314s42.04x
🌐 MongoDBNext.js (Turbopack)10.067s10.684s0.617s32.50x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.520s (+44.3% 🔺)7.146s (+37.1% 🔺)1.626s51.00x
▲ VercelNitro7.009s (+153.3% 🔺)8.352s (+119.6% 🔺)1.343s41.27x
▲ VercelExpress10.371s (+264.0% 🔺)12.346s (+209.2% 🔺)1.975s31.88x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.303s2.006s0.703s151.00x
🐘 PostgresNitro1.422s (-1.3%)2.011s (~)0.589s151.09x
🐘 PostgresExpress1.442s (-1.5%)2.011s (-3.2%)0.570s151.11x
💻 LocalExpress1.477s (-2.9%)2.005s (~)0.528s151.13x
💻 LocalNitro1.523s (-1.1%)2.006s (~)0.483s151.17x
💻 LocalNext.js (Turbopack)1.564s2.073s0.509s151.20x
🌐 MongoDBNext.js (Turbopack)2.174s3.009s0.835s101.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.131s (-0.9%)3.290s (-1.5%)1.159s101.00x
▲ VercelNext.js (Turbopack)2.268s (-27.5% 🟢)3.823s (-24.1% 🟢)1.555s81.06x
▲ VercelExpress2.591s (+17.2% 🔺)4.029s (+17.2% 🔺)1.438s81.22x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.526s (-3.2%)3.012s (~)0.486s101.00x
🌐 RedisNext.js (Turbopack)2.532s3.008s0.477s101.00x
🐘 PostgresNitro2.730s (+7.4% 🔺)3.015s (~)0.285s101.08x
💻 LocalExpress2.797s (-9.8% 🟢)3.108s (-17.3% 🟢)0.311s101.11x
💻 LocalNext.js (Turbopack)3.030s3.760s0.729s81.20x
💻 LocalNitro3.124s (-1.8%)3.886s (~)0.762s81.24x
🌐 MongoDBNext.js (Turbopack)4.728s5.177s0.449s61.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.270s (-29.0% 🟢)3.269s (-37.5% 🟢)0.998s101.00x
▲ VercelExpress2.378s (-32.1% 🟢)3.827s (-17.2% 🟢)1.449s81.05x
▲ VercelNext.js (Turbopack)3.093s (-5.5% 🟢)4.610s (~)1.517s71.36x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.975s (-3.5%)4.590s (~)0.615s71.00x
🐘 PostgresExpress4.039s (+2.3%)4.590s (+3.2%)0.551s71.02x
🌐 RedisNext.js (Turbopack)4.198s4.725s0.527s71.06x
💻 LocalExpress7.733s (-14.1% 🟢)8.267s (-10.8% 🟢)0.533s41.95x
💻 LocalNext.js (Turbopack)8.255s8.766s0.512s42.08x
💻 LocalNitro8.519s (+0.8%)9.275s (+2.8%)0.756s42.14x
🌐 MongoDBNext.js (Turbopack)10.032s10.680s0.648s32.52x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (-27.3% 🟢)3.647s (-28.7% 🟢)0.923s91.00x
▲ VercelNext.js (Turbopack)3.571s (-3.3%)5.369s (+9.7% 🔺)1.798s61.31x
▲ VercelExpress3.789s (+1.4%)5.100s (-0.7%)1.311s61.39x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.138s (-32.2% 🟢)1.003s (~)0.009s (-21.6% 🟢)1.015s (~)0.877s101.00x
💻 LocalNext.js (Turbopack)0.170s1.002s0.011s1.017s0.847s101.24x
🌐 RedisNext.js (Turbopack)0.182s1.000s0.002s1.007s0.825s101.33x
💻 LocalNitro0.212s (+7.3% 🔺)1.003s (~)0.011s (-2.7%)1.017s (~)0.804s101.54x
🐘 PostgresExpress0.215s (+2.8%)0.996s (~)0.002s (+15.4% 🔺)1.013s (~)0.797s101.57x
🐘 PostgresNitro0.246s (+9.4% 🔺)0.993s (~)0.002s (+41.7% 🔺)1.014s (~)0.767s101.79x
🌐 MongoDBNext.js (Turbopack)0.474s0.979s0.002s1.009s0.534s103.45x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.606s (+1.9%)2.405s (-8.7% 🟢)0.006s (-26.2% 🟢)3.035s (-2.2%)1.429s101.00x
▲ VercelNitro1.658s (+1.2%)2.506s (-14.3% 🟢)0.504s (+8896.4% 🔺)3.490s (+1.5%)1.833s101.03x
▲ VercelNext.js (Turbopack)1.785s (-4.5%)3.025s (+6.5% 🔺)0.011s (+160.5% 🔺)3.640s (+6.9% 🔺)1.855s101.11x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresExpress7/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local6/12
Next.js (Turbopack)🌐 Redis9/12
Nitro🐘 Postgres6/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

(err.status === 409 || err.status === 410)
) {
runtimeLogger.info(
'Run already finished during setup, skipping',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Run already finished during setup, skipping',
'Run already finished during setup, skipping replay',

maybe this would be clearer to the user? (assuming the codepath is only for run replays)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or "skipping redundant workflow execution"

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

human: LGTM! great detailed state check and ty for posting that on github PR review comment

@VaguelySerious
VaguelySerious merged commit 2cc42cb into mainMar 18, 2026
166 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/uncaught-409 branch March 18, 2026 00:50
@ghostghost mentioned this pull request Mar 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

[core] Don't fail to queue on 409 responses - #1418

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409
Mar 18, 2026
Merged

[core] Don't fail to queue on 409 responses#1418
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 17, 2026

Copy link
Copy Markdown
Member

Noticed error logs from 409s falling through the queue, which are confusing for users. Log example:

Queue callback error: Error [WorkflowAPIError]: Cannot update workflow run wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV with status 'completed'. Operation requires status 'running' or 'pending'.
at cP (.next/server/chunks/[root-of-the-server]__fd848f42._.js:63:41)
at async gA (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:3954)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:86:8)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:148157)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:146659)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:83:2206)
at async default (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:7813)
at async u7.processMessage (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:13992)
at async u7.consume (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:15197) {
cause: undefined,
status: 409,
code: undefined,
url: 'https://vercel-workflow.com/api/v1/runs/wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV'
}

so I ensures we catch and gracefully return for these cases. I had Claude run an eval on whether this blocks any real use cases. Eval below:


Concurrent scenarios and why skipping is safe

Scenario 1: Two handlers race on run_started

Two queue messages for the same run arrive while it's still pending. Both handlers call world.runs.get(), see pending, and try to create a run_started event.

Handler A: runs.get() → pending → events.create(run_started) → ✅ succeeds → continues replay loop
Handler B: runs.get() → pending → events.create(run_started) → ❌ 409 → returns early

Why it's safe: Handler A transitions the run to running and enters the replay loop. The replay loop either completes the workflow or suspends it with queued continuations. Handler B's early exit is a no-op — Handler A guarantees progress.

Location:runtime.ts catch block after run_started event creation.

Scenario 2: Two handlers race on run_completed

Two concurrent replay loops both reach the end of the workflow and try to create run_completed.

Handler A: events.create(run_completed) → ✅ succeeds → returns
Handler B: events.create(run_completed) → ❌ 409 → logs info → returns

Why it's safe: The run is completed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_completed event creation.

Scenario 3: Two handlers race on run_failed

Same as Scenario 2 but for failure. Both handlers detect an error in user code and try to fail the run.

Handler A: events.create(run_failed) → ✅ succeeds → returns
Handler B: events.create(run_failed) → ❌ 409 → logs info → returns

Why it's safe: The run is failed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_failed event creation.

Scenario 4: Run completes while another handler creates hooks

Handler A completes the workflow. Handler B (from an earlier queue message) is still in the suspension handler creating hook events.

Handler A: events.create(run_completed) → ✅ run is now terminal
Handler B: events.create(hook_created) → ❌ 409 (run terminal) → logs info, continues
→ returns from handleSuspension with pendingSteps
→ tries to execute inline step
→ events.create(step_started) → ❌ 410 (run gone) → returns { type: 'gone' }
→ caller returns

Why it's safe: Handler A already completed the workflow. Handler B's hook creation fails, and if any steps were queued, the step executor receives 410 on step_started and exits gracefully. The 410 on step_started is the safety net — even if the suspension handler returns pending steps after a 409, the step executor won't make progress on a finished run.

Location:suspension-handler.ts catch blocks for hook_created and hook_disposed; step-executor.ts 410 handling on step_started.

Scenario 5: Two handlers race on wait_completed

During the replay loop, both handlers see an elapsed wait and try to complete it.

Handler A: events.create(wait_completed) → ✅ succeeds → adds event to cache → continues replay
Handler B: events.create(wait_completed) → ❌ 409 → continue (skip this wait) → continues replay

Why it's safe: Both handlers continue their replay loops. The event log is the same for both (the winning handler's wait_completed is visible to future reads). Subsequent replay from either handler converges to the same state because replay is deterministic and event-sourced.

Location:runtime.ts wait completion loop with continue on 409.

Scenario 6: Two handlers race on step_completed

Two handlers execute the same step concurrently (e.g., both received the step's queue message). Both finish execution and try to create step_completed.

Handler A: events.create(step_completed) → ✅ succeeds → queues workflow continuation → returns
Handler B: events.create(step_completed) → ❌ 409 → returns WITHOUT queuing continuation

Why it's safe: Handler A queues the workflow continuation. Handler B does not — this is correct because only one continuation should be queued per step completion. If both queued, there would be redundant replay (which is safe but wasteful).

Location:step-executor.ts catch on step_completed event creation.

Scenario 7: Two handlers race on step_started

Two handlers try to start the same step. Handler A wins; Handler B gets 409 because the step transitioned to a terminal state.

Handler A: events.create(step_started) → ✅ succeeds → executes step → queues continuation
Handler B: events.create(step_started) → ❌ 409 (step terminal) → returns { type: 'skipped' }
→ caller queues workflow continuation (runtime.ts replay loop)

Why it's safe: Both handlers ensure workflow continuation — Handler A via step completion, Handler B via the replay loop re-queuing the workflow. The redundant replay is safe because event-sourced replay is convergent.

Location:step-executor.ts 409 handling on step_started.

Scenario 8: step_created/wait_created duplicate

During suspension handling, two concurrent replays both try to create the same step or wait event.

Handler A: events.create(step_created) → ✅ succeeds
Handler B: events.create(step_created) → ❌ 409 → logs info → continues

Why it's safe: The step/wait entity already exists. The suspension handler continues processing other items. The step will be executed by whichever handler picks it up from the queue.

Location:suspension-handler.ts catch blocks for step_created and wait_created.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@vercel

vercelBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9668d09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

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-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.038s (-15.7% 🟢)1.005s (~)0.968s101.00x
💻 LocalNitro0.046s (+6.7% 🔺)1.006s (~)0.959s101.23x
💻 LocalNext.js (Turbopack)0.051s1.006s0.955s101.36x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.951s101.44x
🐘 PostgresNitro0.059s (-4.7%)1.011s (~)0.952s101.56x
🐘 PostgresExpress0.059s (-14.8% 🟢)1.011s (~)0.952s101.57x
🌐 MongoDBNext.js (Turbopack)0.079s1.008s0.929s102.11x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.465s (-33.5% 🟢)2.036s (-22.7% 🟢)1.571s101.00x
▲ VercelExpress0.504s (-20.0% 🟢)2.286s (-14.4% 🟢)1.781s101.08x
▲ VercelNext.js (Turbopack)0.511s (-17.6% 🟢)2.559s (+13.2% 🔺)2.049s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.093s (-3.3%)2.006s (~)0.912s101.00x
🌐 RedisNext.js (Turbopack)1.122s2.006s0.885s101.03x
💻 LocalNitro1.130s (~)2.006s (~)0.877s101.03x
💻 LocalNext.js (Turbopack)1.130s2.006s0.876s101.03x
🐘 PostgresExpress1.153s (+0.7%)2.014s (~)0.860s101.05x
🐘 PostgresNitro1.158s (+1.1%)2.012s (~)0.855s101.06x
🌐 MongoDBNext.js (Turbopack)1.307s2.008s0.700s101.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.040s (-3.0%)3.224s (-4.4%)1.184s101.00x
▲ VercelExpress2.053s (+0.9%)3.735s (+12.4% 🔺)1.682s101.01x
▲ VercelNext.js (Turbopack)2.168s (-2.0%)3.924s (+13.8% 🔺)1.756s101.06x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.615s (-2.8%)11.023s (~)0.408s31.00x
🌐 RedisNext.js (Turbopack)10.784s11.023s0.239s31.02x
💻 LocalNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNitro10.927s (~)11.042s (~)0.115s31.03x
🐘 PostgresExpress10.970s (~)11.375s (~)0.405s31.03x
💻 LocalNitro10.976s (+0.8%)11.024s (~)0.048s31.03x
🌐 MongoDBNext.js (Turbopack)12.203s13.015s0.812s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.779s (-7.4% 🟢)18.655s (-5.6% 🟢)1.876s21.00x
▲ VercelNitro16.868s (+1.3%)18.197s (-1.3%)1.329s21.01x
▲ VercelNext.js (Turbopack)17.826s (+0.9%)19.468s (+1.2%)1.641s21.06x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.743s (-3.1%)27.051s (-3.6%)0.308s31.00x
🌐 RedisNext.js (Turbopack)26.760s27.049s0.289s31.00x
💻 LocalNext.js (Turbopack)27.128s28.053s0.925s31.01x
🐘 PostgresExpress27.240s (~)28.066s (~)0.826s31.02x
🐘 PostgresNitro27.277s (~)28.065s (~)0.788s31.02x
💻 LocalNitro27.583s (~)28.053s (~)0.470s31.03x
🌐 MongoDBNext.js (Turbopack)30.482s31.045s0.564s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro46.028s (+2.9%)47.737s (+4.3%)1.709s21.00x
▲ VercelNext.js (Turbopack)50.377s (+6.6% 🔺)52.253s (+8.0% 🔺)1.877s21.09x
▲ VercelExpress53.606s (+21.0% 🔺)55.319s (+22.1% 🔺)1.713s21.16x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.541s54.093s0.552s21.00x
🐘 PostgresExpress54.300s (~)55.094s (~)0.793s21.01x
🐘 PostgresNitro54.476s (~)55.105s (~)0.629s21.02x
💻 LocalExpress54.851s (-3.3%)55.101s (-3.5%)0.250s21.02x
💻 LocalNext.js (Turbopack)55.951s56.100s0.149s21.05x
💻 LocalNitro56.657s (~)57.106s (~)0.450s21.06x
🌐 MongoDBNext.js (Turbopack)60.675s61.065s0.390s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express94.771s (-4.4%)96.975s (-4.2%)2.204s11.00x
▲ VercelNitro96.605s (~)98.384s (~)1.779s11.02x
▲ VercelNext.js (Turbopack)98.753s (-3.9%)100.796s (-2.8%)2.043s11.04x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.345s2.006s0.662s151.00x
🐘 PostgresExpress1.366s (-4.0%)2.011s (~)0.645s151.02x
💻 LocalExpress1.467s (-5.2% 🟢)2.006s (~)0.538s151.09x
💻 LocalNitro1.498s (-1.1%)2.005s (~)0.507s151.11x
💻 LocalNext.js (Turbopack)1.547s2.006s0.459s151.15x
🌐 MongoDBNext.js (Turbopack)2.146s3.009s0.863s101.60x
🐘 PostgresNext.js (Turbopack)⚠️missing----
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.312s (-4.2%)3.407s (-4.8%)1.095s91.00x
▲ VercelNext.js (Turbopack)2.641s (-1.3%)4.038s (+7.5% 🔺)1.397s81.14x
▲ VercelExpress2.648s (+5.0%)4.138s (+13.0% 🔺)1.490s81.15x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.567s3.008s0.440s101.00x
🐘 PostgresNitro2.595s (~)3.014s (~)0.419s101.01x
💻 LocalExpress2.600s (-14.1% 🟢)3.007s (-15.6% 🟢)0.407s101.01x
🐘 PostgresExpress2.615s (~)3.015s (~)0.399s101.02x
💻 LocalNext.js (Turbopack)3.041s3.760s0.718s81.18x
💻 LocalNitro3.121s (+7.5% 🔺)3.565s (+11.1% 🔺)0.444s91.22x
🌐 MongoDBNext.js (Turbopack)4.747s5.179s0.432s61.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.799s (+7.7% 🔺)4.348s (+21.1% 🔺)1.550s81.00x
▲ VercelNitro3.520s (+30.2% 🔺)4.708s (+23.4% 🔺)1.188s71.26x
▲ VercelExpress3.663s (+47.9% 🔺)5.183s (+40.8% 🔺)1.520s81.31x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express4.027s (+1.4%)4.588s (+3.2%)0.561s71.00x
🐘 PostgresNitro4.032s (+0.7%)4.590s (+3.1%)0.558s71.00x
🌐 RedisNext.js (Turbopack)4.081s5.012s0.931s61.01x
💻 LocalExpress6.787s (-15.7% 🟢)7.014s (-20.1% 🟢)0.227s51.69x
💻 LocalNext.js (Turbopack)7.888s8.517s0.629s41.96x
💻 LocalNitro8.207s (-1.6%)8.521s (-5.5% 🟢)0.314s42.04x
🌐 MongoDBNext.js (Turbopack)10.067s10.684s0.617s32.50x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.520s (+44.3% 🔺)7.146s (+37.1% 🔺)1.626s51.00x
▲ VercelNitro7.009s (+153.3% 🔺)8.352s (+119.6% 🔺)1.343s41.27x
▲ VercelExpress10.371s (+264.0% 🔺)12.346s (+209.2% 🔺)1.975s31.88x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.303s2.006s0.703s151.00x
🐘 PostgresNitro1.422s (-1.3%)2.011s (~)0.589s151.09x
🐘 PostgresExpress1.442s (-1.5%)2.011s (-3.2%)0.570s151.11x
💻 LocalExpress1.477s (-2.9%)2.005s (~)0.528s151.13x
💻 LocalNitro1.523s (-1.1%)2.006s (~)0.483s151.17x
💻 LocalNext.js (Turbopack)1.564s2.073s0.509s151.20x
🌐 MongoDBNext.js (Turbopack)2.174s3.009s0.835s101.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.131s (-0.9%)3.290s (-1.5%)1.159s101.00x
▲ VercelNext.js (Turbopack)2.268s (-27.5% 🟢)3.823s (-24.1% 🟢)1.555s81.06x
▲ VercelExpress2.591s (+17.2% 🔺)4.029s (+17.2% 🔺)1.438s81.22x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.526s (-3.2%)3.012s (~)0.486s101.00x
🌐 RedisNext.js (Turbopack)2.532s3.008s0.477s101.00x
🐘 PostgresNitro2.730s (+7.4% 🔺)3.015s (~)0.285s101.08x
💻 LocalExpress2.797s (-9.8% 🟢)3.108s (-17.3% 🟢)0.311s101.11x
💻 LocalNext.js (Turbopack)3.030s3.760s0.729s81.20x
💻 LocalNitro3.124s (-1.8%)3.886s (~)0.762s81.24x
🌐 MongoDBNext.js (Turbopack)4.728s5.177s0.449s61.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.270s (-29.0% 🟢)3.269s (-37.5% 🟢)0.998s101.00x
▲ VercelExpress2.378s (-32.1% 🟢)3.827s (-17.2% 🟢)1.449s81.05x
▲ VercelNext.js (Turbopack)3.093s (-5.5% 🟢)4.610s (~)1.517s71.36x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.975s (-3.5%)4.590s (~)0.615s71.00x
🐘 PostgresExpress4.039s (+2.3%)4.590s (+3.2%)0.551s71.02x
🌐 RedisNext.js (Turbopack)4.198s4.725s0.527s71.06x
💻 LocalExpress7.733s (-14.1% 🟢)8.267s (-10.8% 🟢)0.533s41.95x
💻 LocalNext.js (Turbopack)8.255s8.766s0.512s42.08x
💻 LocalNitro8.519s (+0.8%)9.275s (+2.8%)0.756s42.14x
🌐 MongoDBNext.js (Turbopack)10.032s10.680s0.648s32.52x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (-27.3% 🟢)3.647s (-28.7% 🟢)0.923s91.00x
▲ VercelNext.js (Turbopack)3.571s (-3.3%)5.369s (+9.7% 🔺)1.798s61.31x
▲ VercelExpress3.789s (+1.4%)5.100s (-0.7%)1.311s61.39x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.138s (-32.2% 🟢)1.003s (~)0.009s (-21.6% 🟢)1.015s (~)0.877s101.00x
💻 LocalNext.js (Turbopack)0.170s1.002s0.011s1.017s0.847s101.24x
🌐 RedisNext.js (Turbopack)0.182s1.000s0.002s1.007s0.825s101.33x
💻 LocalNitro0.212s (+7.3% 🔺)1.003s (~)0.011s (-2.7%)1.017s (~)0.804s101.54x
🐘 PostgresExpress0.215s (+2.8%)0.996s (~)0.002s (+15.4% 🔺)1.013s (~)0.797s101.57x
🐘 PostgresNitro0.246s (+9.4% 🔺)0.993s (~)0.002s (+41.7% 🔺)1.014s (~)0.767s101.79x
🌐 MongoDBNext.js (Turbopack)0.474s0.979s0.002s1.009s0.534s103.45x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.606s (+1.9%)2.405s (-8.7% 🟢)0.006s (-26.2% 🟢)3.035s (-2.2%)1.429s101.00x
▲ VercelNitro1.658s (+1.2%)2.506s (-14.3% 🟢)0.504s (+8896.4% 🔺)3.490s (+1.5%)1.833s101.03x
▲ VercelNext.js (Turbopack)1.785s (-4.5%)3.025s (+6.5% 🔺)0.011s (+160.5% 🔺)3.640s (+6.9% 🔺)1.855s101.11x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresExpress7/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local6/12
Next.js (Turbopack)🌐 Redis9/12
Nitro🐘 Postgres6/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

(err.status === 409 || err.status === 410)
) {
runtimeLogger.info(
'Run already finished during setup, skipping',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Run already finished during setup, skipping',
'Run already finished during setup, skipping replay',

maybe this would be clearer to the user? (assuming the codepath is only for run replays)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or "skipping redundant workflow execution"

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

human: LGTM! great detailed state check and ty for posting that on github PR review comment

@VaguelySerious
VaguelySerious merged commit 2cc42cb into mainMar 18, 2026
166 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/uncaught-409 branch March 18, 2026 00:50
@ghostghost mentioned this pull request Mar 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[core] Don't fail to queue on 409 responses - #1418

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409
Mar 18, 2026
Merged

[core] Don't fail to queue on 409 responses#1418
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 17, 2026

Copy link
Copy Markdown
Member

Noticed error logs from 409s falling through the queue, which are confusing for users. Log example:

Queue callback error: Error [WorkflowAPIError]: Cannot update workflow run wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV with status 'completed'. Operation requires status 'running' or 'pending'.
at cP (.next/server/chunks/[root-of-the-server]__fd848f42._.js:63:41)
at async gA (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:3954)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:86:8)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:148157)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:146659)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:83:2206)
at async default (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:7813)
at async u7.processMessage (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:13992)
at async u7.consume (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:15197) {
cause: undefined,
status: 409,
code: undefined,
url: 'https://vercel-workflow.com/api/v1/runs/wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV'
}

so I ensures we catch and gracefully return for these cases. I had Claude run an eval on whether this blocks any real use cases. Eval below:


Concurrent scenarios and why skipping is safe

Scenario 1: Two handlers race on run_started

Two queue messages for the same run arrive while it's still pending. Both handlers call world.runs.get(), see pending, and try to create a run_started event.

Handler A: runs.get() → pending → events.create(run_started) → ✅ succeeds → continues replay loop
Handler B: runs.get() → pending → events.create(run_started) → ❌ 409 → returns early

Why it's safe: Handler A transitions the run to running and enters the replay loop. The replay loop either completes the workflow or suspends it with queued continuations. Handler B's early exit is a no-op — Handler A guarantees progress.

Location:runtime.ts catch block after run_started event creation.

Scenario 2: Two handlers race on run_completed

Two concurrent replay loops both reach the end of the workflow and try to create run_completed.

Handler A: events.create(run_completed) → ✅ succeeds → returns
Handler B: events.create(run_completed) → ❌ 409 → logs info → returns

Why it's safe: The run is completed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_completed event creation.

Scenario 3: Two handlers race on run_failed

Same as Scenario 2 but for failure. Both handlers detect an error in user code and try to fail the run.

Handler A: events.create(run_failed) → ✅ succeeds → returns
Handler B: events.create(run_failed) → ❌ 409 → logs info → returns

Why it's safe: The run is failed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_failed event creation.

Scenario 4: Run completes while another handler creates hooks

Handler A completes the workflow. Handler B (from an earlier queue message) is still in the suspension handler creating hook events.

Handler A: events.create(run_completed) → ✅ run is now terminal
Handler B: events.create(hook_created) → ❌ 409 (run terminal) → logs info, continues
→ returns from handleSuspension with pendingSteps
→ tries to execute inline step
→ events.create(step_started) → ❌ 410 (run gone) → returns { type: 'gone' }
→ caller returns

Why it's safe: Handler A already completed the workflow. Handler B's hook creation fails, and if any steps were queued, the step executor receives 410 on step_started and exits gracefully. The 410 on step_started is the safety net — even if the suspension handler returns pending steps after a 409, the step executor won't make progress on a finished run.

Location:suspension-handler.ts catch blocks for hook_created and hook_disposed; step-executor.ts 410 handling on step_started.

Scenario 5: Two handlers race on wait_completed

During the replay loop, both handlers see an elapsed wait and try to complete it.

Handler A: events.create(wait_completed) → ✅ succeeds → adds event to cache → continues replay
Handler B: events.create(wait_completed) → ❌ 409 → continue (skip this wait) → continues replay

Why it's safe: Both handlers continue their replay loops. The event log is the same for both (the winning handler's wait_completed is visible to future reads). Subsequent replay from either handler converges to the same state because replay is deterministic and event-sourced.

Location:runtime.ts wait completion loop with continue on 409.

Scenario 6: Two handlers race on step_completed

Two handlers execute the same step concurrently (e.g., both received the step's queue message). Both finish execution and try to create step_completed.

Handler A: events.create(step_completed) → ✅ succeeds → queues workflow continuation → returns
Handler B: events.create(step_completed) → ❌ 409 → returns WITHOUT queuing continuation

Why it's safe: Handler A queues the workflow continuation. Handler B does not — this is correct because only one continuation should be queued per step completion. If both queued, there would be redundant replay (which is safe but wasteful).

Location:step-executor.ts catch on step_completed event creation.

Scenario 7: Two handlers race on step_started

Two handlers try to start the same step. Handler A wins; Handler B gets 409 because the step transitioned to a terminal state.

Handler A: events.create(step_started) → ✅ succeeds → executes step → queues continuation
Handler B: events.create(step_started) → ❌ 409 (step terminal) → returns { type: 'skipped' }
→ caller queues workflow continuation (runtime.ts replay loop)

Why it's safe: Both handlers ensure workflow continuation — Handler A via step completion, Handler B via the replay loop re-queuing the workflow. The redundant replay is safe because event-sourced replay is convergent.

Location:step-executor.ts 409 handling on step_started.

Scenario 8: step_created/wait_created duplicate

During suspension handling, two concurrent replays both try to create the same step or wait event.

Handler A: events.create(step_created) → ✅ succeeds
Handler B: events.create(step_created) → ❌ 409 → logs info → continues

Why it's safe: The step/wait entity already exists. The suspension handler continues processing other items. The step will be executed by whichever handler picks it up from the queue.

Location:suspension-handler.ts catch blocks for step_created and wait_created.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@vercel

vercelBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9668d09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

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-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.038s (-15.7% 🟢)1.005s (~)0.968s101.00x
💻 LocalNitro0.046s (+6.7% 🔺)1.006s (~)0.959s101.23x
💻 LocalNext.js (Turbopack)0.051s1.006s0.955s101.36x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.951s101.44x
🐘 PostgresNitro0.059s (-4.7%)1.011s (~)0.952s101.56x
🐘 PostgresExpress0.059s (-14.8% 🟢)1.011s (~)0.952s101.57x
🌐 MongoDBNext.js (Turbopack)0.079s1.008s0.929s102.11x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.465s (-33.5% 🟢)2.036s (-22.7% 🟢)1.571s101.00x
▲ VercelExpress0.504s (-20.0% 🟢)2.286s (-14.4% 🟢)1.781s101.08x
▲ VercelNext.js (Turbopack)0.511s (-17.6% 🟢)2.559s (+13.2% 🔺)2.049s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.093s (-3.3%)2.006s (~)0.912s101.00x
🌐 RedisNext.js (Turbopack)1.122s2.006s0.885s101.03x
💻 LocalNitro1.130s (~)2.006s (~)0.877s101.03x
💻 LocalNext.js (Turbopack)1.130s2.006s0.876s101.03x
🐘 PostgresExpress1.153s (+0.7%)2.014s (~)0.860s101.05x
🐘 PostgresNitro1.158s (+1.1%)2.012s (~)0.855s101.06x
🌐 MongoDBNext.js (Turbopack)1.307s2.008s0.700s101.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.040s (-3.0%)3.224s (-4.4%)1.184s101.00x
▲ VercelExpress2.053s (+0.9%)3.735s (+12.4% 🔺)1.682s101.01x
▲ VercelNext.js (Turbopack)2.168s (-2.0%)3.924s (+13.8% 🔺)1.756s101.06x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.615s (-2.8%)11.023s (~)0.408s31.00x
🌐 RedisNext.js (Turbopack)10.784s11.023s0.239s31.02x
💻 LocalNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNitro10.927s (~)11.042s (~)0.115s31.03x
🐘 PostgresExpress10.970s (~)11.375s (~)0.405s31.03x
💻 LocalNitro10.976s (+0.8%)11.024s (~)0.048s31.03x
🌐 MongoDBNext.js (Turbopack)12.203s13.015s0.812s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.779s (-7.4% 🟢)18.655s (-5.6% 🟢)1.876s21.00x
▲ VercelNitro16.868s (+1.3%)18.197s (-1.3%)1.329s21.01x
▲ VercelNext.js (Turbopack)17.826s (+0.9%)19.468s (+1.2%)1.641s21.06x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.743s (-3.1%)27.051s (-3.6%)0.308s31.00x
🌐 RedisNext.js (Turbopack)26.760s27.049s0.289s31.00x
💻 LocalNext.js (Turbopack)27.128s28.053s0.925s31.01x
🐘 PostgresExpress27.240s (~)28.066s (~)0.826s31.02x
🐘 PostgresNitro27.277s (~)28.065s (~)0.788s31.02x
💻 LocalNitro27.583s (~)28.053s (~)0.470s31.03x
🌐 MongoDBNext.js (Turbopack)30.482s31.045s0.564s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro46.028s (+2.9%)47.737s (+4.3%)1.709s21.00x
▲ VercelNext.js (Turbopack)50.377s (+6.6% 🔺)52.253s (+8.0% 🔺)1.877s21.09x
▲ VercelExpress53.606s (+21.0% 🔺)55.319s (+22.1% 🔺)1.713s21.16x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.541s54.093s0.552s21.00x
🐘 PostgresExpress54.300s (~)55.094s (~)0.793s21.01x
🐘 PostgresNitro54.476s (~)55.105s (~)0.629s21.02x
💻 LocalExpress54.851s (-3.3%)55.101s (-3.5%)0.250s21.02x
💻 LocalNext.js (Turbopack)55.951s56.100s0.149s21.05x
💻 LocalNitro56.657s (~)57.106s (~)0.450s21.06x
🌐 MongoDBNext.js (Turbopack)60.675s61.065s0.390s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express94.771s (-4.4%)96.975s (-4.2%)2.204s11.00x
▲ VercelNitro96.605s (~)98.384s (~)1.779s11.02x
▲ VercelNext.js (Turbopack)98.753s (-3.9%)100.796s (-2.8%)2.043s11.04x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.345s2.006s0.662s151.00x
🐘 PostgresExpress1.366s (-4.0%)2.011s (~)0.645s151.02x
💻 LocalExpress1.467s (-5.2% 🟢)2.006s (~)0.538s151.09x
💻 LocalNitro1.498s (-1.1%)2.005s (~)0.507s151.11x
💻 LocalNext.js (Turbopack)1.547s2.006s0.459s151.15x
🌐 MongoDBNext.js (Turbopack)2.146s3.009s0.863s101.60x
🐘 PostgresNext.js (Turbopack)⚠️missing----
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.312s (-4.2%)3.407s (-4.8%)1.095s91.00x
▲ VercelNext.js (Turbopack)2.641s (-1.3%)4.038s (+7.5% 🔺)1.397s81.14x
▲ VercelExpress2.648s (+5.0%)4.138s (+13.0% 🔺)1.490s81.15x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.567s3.008s0.440s101.00x
🐘 PostgresNitro2.595s (~)3.014s (~)0.419s101.01x
💻 LocalExpress2.600s (-14.1% 🟢)3.007s (-15.6% 🟢)0.407s101.01x
🐘 PostgresExpress2.615s (~)3.015s (~)0.399s101.02x
💻 LocalNext.js (Turbopack)3.041s3.760s0.718s81.18x
💻 LocalNitro3.121s (+7.5% 🔺)3.565s (+11.1% 🔺)0.444s91.22x
🌐 MongoDBNext.js (Turbopack)4.747s5.179s0.432s61.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.799s (+7.7% 🔺)4.348s (+21.1% 🔺)1.550s81.00x
▲ VercelNitro3.520s (+30.2% 🔺)4.708s (+23.4% 🔺)1.188s71.26x
▲ VercelExpress3.663s (+47.9% 🔺)5.183s (+40.8% 🔺)1.520s81.31x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express4.027s (+1.4%)4.588s (+3.2%)0.561s71.00x
🐘 PostgresNitro4.032s (+0.7%)4.590s (+3.1%)0.558s71.00x
🌐 RedisNext.js (Turbopack)4.081s5.012s0.931s61.01x
💻 LocalExpress6.787s (-15.7% 🟢)7.014s (-20.1% 🟢)0.227s51.69x
💻 LocalNext.js (Turbopack)7.888s8.517s0.629s41.96x
💻 LocalNitro8.207s (-1.6%)8.521s (-5.5% 🟢)0.314s42.04x
🌐 MongoDBNext.js (Turbopack)10.067s10.684s0.617s32.50x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.520s (+44.3% 🔺)7.146s (+37.1% 🔺)1.626s51.00x
▲ VercelNitro7.009s (+153.3% 🔺)8.352s (+119.6% 🔺)1.343s41.27x
▲ VercelExpress10.371s (+264.0% 🔺)12.346s (+209.2% 🔺)1.975s31.88x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.303s2.006s0.703s151.00x
🐘 PostgresNitro1.422s (-1.3%)2.011s (~)0.589s151.09x
🐘 PostgresExpress1.442s (-1.5%)2.011s (-3.2%)0.570s151.11x
💻 LocalExpress1.477s (-2.9%)2.005s (~)0.528s151.13x
💻 LocalNitro1.523s (-1.1%)2.006s (~)0.483s151.17x
💻 LocalNext.js (Turbopack)1.564s2.073s0.509s151.20x
🌐 MongoDBNext.js (Turbopack)2.174s3.009s0.835s101.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.131s (-0.9%)3.290s (-1.5%)1.159s101.00x
▲ VercelNext.js (Turbopack)2.268s (-27.5% 🟢)3.823s (-24.1% 🟢)1.555s81.06x
▲ VercelExpress2.591s (+17.2% 🔺)4.029s (+17.2% 🔺)1.438s81.22x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.526s (-3.2%)3.012s (~)0.486s101.00x
🌐 RedisNext.js (Turbopack)2.532s3.008s0.477s101.00x
🐘 PostgresNitro2.730s (+7.4% 🔺)3.015s (~)0.285s101.08x
💻 LocalExpress2.797s (-9.8% 🟢)3.108s (-17.3% 🟢)0.311s101.11x
💻 LocalNext.js (Turbopack)3.030s3.760s0.729s81.20x
💻 LocalNitro3.124s (-1.8%)3.886s (~)0.762s81.24x
🌐 MongoDBNext.js (Turbopack)4.728s5.177s0.449s61.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.270s (-29.0% 🟢)3.269s (-37.5% 🟢)0.998s101.00x
▲ VercelExpress2.378s (-32.1% 🟢)3.827s (-17.2% 🟢)1.449s81.05x
▲ VercelNext.js (Turbopack)3.093s (-5.5% 🟢)4.610s (~)1.517s71.36x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.975s (-3.5%)4.590s (~)0.615s71.00x
🐘 PostgresExpress4.039s (+2.3%)4.590s (+3.2%)0.551s71.02x
🌐 RedisNext.js (Turbopack)4.198s4.725s0.527s71.06x
💻 LocalExpress7.733s (-14.1% 🟢)8.267s (-10.8% 🟢)0.533s41.95x
💻 LocalNext.js (Turbopack)8.255s8.766s0.512s42.08x
💻 LocalNitro8.519s (+0.8%)9.275s (+2.8%)0.756s42.14x
🌐 MongoDBNext.js (Turbopack)10.032s10.680s0.648s32.52x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (-27.3% 🟢)3.647s (-28.7% 🟢)0.923s91.00x
▲ VercelNext.js (Turbopack)3.571s (-3.3%)5.369s (+9.7% 🔺)1.798s61.31x
▲ VercelExpress3.789s (+1.4%)5.100s (-0.7%)1.311s61.39x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.138s (-32.2% 🟢)1.003s (~)0.009s (-21.6% 🟢)1.015s (~)0.877s101.00x
💻 LocalNext.js (Turbopack)0.170s1.002s0.011s1.017s0.847s101.24x
🌐 RedisNext.js (Turbopack)0.182s1.000s0.002s1.007s0.825s101.33x
💻 LocalNitro0.212s (+7.3% 🔺)1.003s (~)0.011s (-2.7%)1.017s (~)0.804s101.54x
🐘 PostgresExpress0.215s (+2.8%)0.996s (~)0.002s (+15.4% 🔺)1.013s (~)0.797s101.57x
🐘 PostgresNitro0.246s (+9.4% 🔺)0.993s (~)0.002s (+41.7% 🔺)1.014s (~)0.767s101.79x
🌐 MongoDBNext.js (Turbopack)0.474s0.979s0.002s1.009s0.534s103.45x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.606s (+1.9%)2.405s (-8.7% 🟢)0.006s (-26.2% 🟢)3.035s (-2.2%)1.429s101.00x
▲ VercelNitro1.658s (+1.2%)2.506s (-14.3% 🟢)0.504s (+8896.4% 🔺)3.490s (+1.5%)1.833s101.03x
▲ VercelNext.js (Turbopack)1.785s (-4.5%)3.025s (+6.5% 🔺)0.011s (+160.5% 🔺)3.640s (+6.9% 🔺)1.855s101.11x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresExpress7/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local6/12
Next.js (Turbopack)🌐 Redis9/12
Nitro🐘 Postgres6/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

(err.status === 409 || err.status === 410)
) {
runtimeLogger.info(
'Run already finished during setup, skipping',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Run already finished during setup, skipping',
'Run already finished during setup, skipping replay',

maybe this would be clearer to the user? (assuming the codepath is only for run replays)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or "skipping redundant workflow execution"

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

human: LGTM! great detailed state check and ty for posting that on github PR review comment

@VaguelySerious
VaguelySerious merged commit 2cc42cb into mainMar 18, 2026
166 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/uncaught-409 branch March 18, 2026 00:50
@ghostghost mentioned this pull request Mar 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[core] Don't fail to queue on 409 responses - #1418

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409
Mar 18, 2026
Merged

[core] Don't fail to queue on 409 responses#1418
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 17, 2026

Copy link
Copy Markdown
Member

Noticed error logs from 409s falling through the queue, which are confusing for users. Log example:

Queue callback error: Error [WorkflowAPIError]: Cannot update workflow run wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV with status 'completed'. Operation requires status 'running' or 'pending'.
at cP (.next/server/chunks/[root-of-the-server]__fd848f42._.js:63:41)
at async gA (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:3954)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:86:8)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:148157)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:146659)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:83:2206)
at async default (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:7813)
at async u7.processMessage (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:13992)
at async u7.consume (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:15197) {
cause: undefined,
status: 409,
code: undefined,
url: 'https://vercel-workflow.com/api/v1/runs/wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV'
}

so I ensures we catch and gracefully return for these cases. I had Claude run an eval on whether this blocks any real use cases. Eval below:


Concurrent scenarios and why skipping is safe

Scenario 1: Two handlers race on run_started

Two queue messages for the same run arrive while it's still pending. Both handlers call world.runs.get(), see pending, and try to create a run_started event.

Handler A: runs.get() → pending → events.create(run_started) → ✅ succeeds → continues replay loop
Handler B: runs.get() → pending → events.create(run_started) → ❌ 409 → returns early

Why it's safe: Handler A transitions the run to running and enters the replay loop. The replay loop either completes the workflow or suspends it with queued continuations. Handler B's early exit is a no-op — Handler A guarantees progress.

Location:runtime.ts catch block after run_started event creation.

Scenario 2: Two handlers race on run_completed

Two concurrent replay loops both reach the end of the workflow and try to create run_completed.

Handler A: events.create(run_completed) → ✅ succeeds → returns
Handler B: events.create(run_completed) → ❌ 409 → logs info → returns

Why it's safe: The run is completed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_completed event creation.

Scenario 3: Two handlers race on run_failed

Same as Scenario 2 but for failure. Both handlers detect an error in user code and try to fail the run.

Handler A: events.create(run_failed) → ✅ succeeds → returns
Handler B: events.create(run_failed) → ❌ 409 → logs info → returns

Why it's safe: The run is failed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_failed event creation.

Scenario 4: Run completes while another handler creates hooks

Handler A completes the workflow. Handler B (from an earlier queue message) is still in the suspension handler creating hook events.

Handler A: events.create(run_completed) → ✅ run is now terminal
Handler B: events.create(hook_created) → ❌ 409 (run terminal) → logs info, continues
→ returns from handleSuspension with pendingSteps
→ tries to execute inline step
→ events.create(step_started) → ❌ 410 (run gone) → returns { type: 'gone' }
→ caller returns

Why it's safe: Handler A already completed the workflow. Handler B's hook creation fails, and if any steps were queued, the step executor receives 410 on step_started and exits gracefully. The 410 on step_started is the safety net — even if the suspension handler returns pending steps after a 409, the step executor won't make progress on a finished run.

Location:suspension-handler.ts catch blocks for hook_created and hook_disposed; step-executor.ts 410 handling on step_started.

Scenario 5: Two handlers race on wait_completed

During the replay loop, both handlers see an elapsed wait and try to complete it.

Handler A: events.create(wait_completed) → ✅ succeeds → adds event to cache → continues replay
Handler B: events.create(wait_completed) → ❌ 409 → continue (skip this wait) → continues replay

Why it's safe: Both handlers continue their replay loops. The event log is the same for both (the winning handler's wait_completed is visible to future reads). Subsequent replay from either handler converges to the same state because replay is deterministic and event-sourced.

Location:runtime.ts wait completion loop with continue on 409.

Scenario 6: Two handlers race on step_completed

Two handlers execute the same step concurrently (e.g., both received the step's queue message). Both finish execution and try to create step_completed.

Handler A: events.create(step_completed) → ✅ succeeds → queues workflow continuation → returns
Handler B: events.create(step_completed) → ❌ 409 → returns WITHOUT queuing continuation

Why it's safe: Handler A queues the workflow continuation. Handler B does not — this is correct because only one continuation should be queued per step completion. If both queued, there would be redundant replay (which is safe but wasteful).

Location:step-executor.ts catch on step_completed event creation.

Scenario 7: Two handlers race on step_started

Two handlers try to start the same step. Handler A wins; Handler B gets 409 because the step transitioned to a terminal state.

Handler A: events.create(step_started) → ✅ succeeds → executes step → queues continuation
Handler B: events.create(step_started) → ❌ 409 (step terminal) → returns { type: 'skipped' }
→ caller queues workflow continuation (runtime.ts replay loop)

Why it's safe: Both handlers ensure workflow continuation — Handler A via step completion, Handler B via the replay loop re-queuing the workflow. The redundant replay is safe because event-sourced replay is convergent.

Location:step-executor.ts 409 handling on step_started.

Scenario 8: step_created/wait_created duplicate

During suspension handling, two concurrent replays both try to create the same step or wait event.

Handler A: events.create(step_created) → ✅ succeeds
Handler B: events.create(step_created) → ❌ 409 → logs info → continues

Why it's safe: The step/wait entity already exists. The suspension handler continues processing other items. The step will be executed by whichever handler picks it up from the queue.

Location:suspension-handler.ts catch blocks for step_created and wait_created.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@vercel

vercelBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9668d09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

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-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.038s (-15.7% 🟢)1.005s (~)0.968s101.00x
💻 LocalNitro0.046s (+6.7% 🔺)1.006s (~)0.959s101.23x
💻 LocalNext.js (Turbopack)0.051s1.006s0.955s101.36x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.951s101.44x
🐘 PostgresNitro0.059s (-4.7%)1.011s (~)0.952s101.56x
🐘 PostgresExpress0.059s (-14.8% 🟢)1.011s (~)0.952s101.57x
🌐 MongoDBNext.js (Turbopack)0.079s1.008s0.929s102.11x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.465s (-33.5% 🟢)2.036s (-22.7% 🟢)1.571s101.00x
▲ VercelExpress0.504s (-20.0% 🟢)2.286s (-14.4% 🟢)1.781s101.08x
▲ VercelNext.js (Turbopack)0.511s (-17.6% 🟢)2.559s (+13.2% 🔺)2.049s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.093s (-3.3%)2.006s (~)0.912s101.00x
🌐 RedisNext.js (Turbopack)1.122s2.006s0.885s101.03x
💻 LocalNitro1.130s (~)2.006s (~)0.877s101.03x
💻 LocalNext.js (Turbopack)1.130s2.006s0.876s101.03x
🐘 PostgresExpress1.153s (+0.7%)2.014s (~)0.860s101.05x
🐘 PostgresNitro1.158s (+1.1%)2.012s (~)0.855s101.06x
🌐 MongoDBNext.js (Turbopack)1.307s2.008s0.700s101.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.040s (-3.0%)3.224s (-4.4%)1.184s101.00x
▲ VercelExpress2.053s (+0.9%)3.735s (+12.4% 🔺)1.682s101.01x
▲ VercelNext.js (Turbopack)2.168s (-2.0%)3.924s (+13.8% 🔺)1.756s101.06x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.615s (-2.8%)11.023s (~)0.408s31.00x
🌐 RedisNext.js (Turbopack)10.784s11.023s0.239s31.02x
💻 LocalNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNitro10.927s (~)11.042s (~)0.115s31.03x
🐘 PostgresExpress10.970s (~)11.375s (~)0.405s31.03x
💻 LocalNitro10.976s (+0.8%)11.024s (~)0.048s31.03x
🌐 MongoDBNext.js (Turbopack)12.203s13.015s0.812s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.779s (-7.4% 🟢)18.655s (-5.6% 🟢)1.876s21.00x
▲ VercelNitro16.868s (+1.3%)18.197s (-1.3%)1.329s21.01x
▲ VercelNext.js (Turbopack)17.826s (+0.9%)19.468s (+1.2%)1.641s21.06x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.743s (-3.1%)27.051s (-3.6%)0.308s31.00x
🌐 RedisNext.js (Turbopack)26.760s27.049s0.289s31.00x
💻 LocalNext.js (Turbopack)27.128s28.053s0.925s31.01x
🐘 PostgresExpress27.240s (~)28.066s (~)0.826s31.02x
🐘 PostgresNitro27.277s (~)28.065s (~)0.788s31.02x
💻 LocalNitro27.583s (~)28.053s (~)0.470s31.03x
🌐 MongoDBNext.js (Turbopack)30.482s31.045s0.564s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro46.028s (+2.9%)47.737s (+4.3%)1.709s21.00x
▲ VercelNext.js (Turbopack)50.377s (+6.6% 🔺)52.253s (+8.0% 🔺)1.877s21.09x
▲ VercelExpress53.606s (+21.0% 🔺)55.319s (+22.1% 🔺)1.713s21.16x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.541s54.093s0.552s21.00x
🐘 PostgresExpress54.300s (~)55.094s (~)0.793s21.01x
🐘 PostgresNitro54.476s (~)55.105s (~)0.629s21.02x
💻 LocalExpress54.851s (-3.3%)55.101s (-3.5%)0.250s21.02x
💻 LocalNext.js (Turbopack)55.951s56.100s0.149s21.05x
💻 LocalNitro56.657s (~)57.106s (~)0.450s21.06x
🌐 MongoDBNext.js (Turbopack)60.675s61.065s0.390s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express94.771s (-4.4%)96.975s (-4.2%)2.204s11.00x
▲ VercelNitro96.605s (~)98.384s (~)1.779s11.02x
▲ VercelNext.js (Turbopack)98.753s (-3.9%)100.796s (-2.8%)2.043s11.04x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.345s2.006s0.662s151.00x
🐘 PostgresExpress1.366s (-4.0%)2.011s (~)0.645s151.02x
💻 LocalExpress1.467s (-5.2% 🟢)2.006s (~)0.538s151.09x
💻 LocalNitro1.498s (-1.1%)2.005s (~)0.507s151.11x
💻 LocalNext.js (Turbopack)1.547s2.006s0.459s151.15x
🌐 MongoDBNext.js (Turbopack)2.146s3.009s0.863s101.60x
🐘 PostgresNext.js (Turbopack)⚠️missing----
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.312s (-4.2%)3.407s (-4.8%)1.095s91.00x
▲ VercelNext.js (Turbopack)2.641s (-1.3%)4.038s (+7.5% 🔺)1.397s81.14x
▲ VercelExpress2.648s (+5.0%)4.138s (+13.0% 🔺)1.490s81.15x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.567s3.008s0.440s101.00x
🐘 PostgresNitro2.595s (~)3.014s (~)0.419s101.01x
💻 LocalExpress2.600s (-14.1% 🟢)3.007s (-15.6% 🟢)0.407s101.01x
🐘 PostgresExpress2.615s (~)3.015s (~)0.399s101.02x
💻 LocalNext.js (Turbopack)3.041s3.760s0.718s81.18x
💻 LocalNitro3.121s (+7.5% 🔺)3.565s (+11.1% 🔺)0.444s91.22x
🌐 MongoDBNext.js (Turbopack)4.747s5.179s0.432s61.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.799s (+7.7% 🔺)4.348s (+21.1% 🔺)1.550s81.00x
▲ VercelNitro3.520s (+30.2% 🔺)4.708s (+23.4% 🔺)1.188s71.26x
▲ VercelExpress3.663s (+47.9% 🔺)5.183s (+40.8% 🔺)1.520s81.31x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express4.027s (+1.4%)4.588s (+3.2%)0.561s71.00x
🐘 PostgresNitro4.032s (+0.7%)4.590s (+3.1%)0.558s71.00x
🌐 RedisNext.js (Turbopack)4.081s5.012s0.931s61.01x
💻 LocalExpress6.787s (-15.7% 🟢)7.014s (-20.1% 🟢)0.227s51.69x
💻 LocalNext.js (Turbopack)7.888s8.517s0.629s41.96x
💻 LocalNitro8.207s (-1.6%)8.521s (-5.5% 🟢)0.314s42.04x
🌐 MongoDBNext.js (Turbopack)10.067s10.684s0.617s32.50x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.520s (+44.3% 🔺)7.146s (+37.1% 🔺)1.626s51.00x
▲ VercelNitro7.009s (+153.3% 🔺)8.352s (+119.6% 🔺)1.343s41.27x
▲ VercelExpress10.371s (+264.0% 🔺)12.346s (+209.2% 🔺)1.975s31.88x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.303s2.006s0.703s151.00x
🐘 PostgresNitro1.422s (-1.3%)2.011s (~)0.589s151.09x
🐘 PostgresExpress1.442s (-1.5%)2.011s (-3.2%)0.570s151.11x
💻 LocalExpress1.477s (-2.9%)2.005s (~)0.528s151.13x
💻 LocalNitro1.523s (-1.1%)2.006s (~)0.483s151.17x
💻 LocalNext.js (Turbopack)1.564s2.073s0.509s151.20x
🌐 MongoDBNext.js (Turbopack)2.174s3.009s0.835s101.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.131s (-0.9%)3.290s (-1.5%)1.159s101.00x
▲ VercelNext.js (Turbopack)2.268s (-27.5% 🟢)3.823s (-24.1% 🟢)1.555s81.06x
▲ VercelExpress2.591s (+17.2% 🔺)4.029s (+17.2% 🔺)1.438s81.22x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.526s (-3.2%)3.012s (~)0.486s101.00x
🌐 RedisNext.js (Turbopack)2.532s3.008s0.477s101.00x
🐘 PostgresNitro2.730s (+7.4% 🔺)3.015s (~)0.285s101.08x
💻 LocalExpress2.797s (-9.8% 🟢)3.108s (-17.3% 🟢)0.311s101.11x
💻 LocalNext.js (Turbopack)3.030s3.760s0.729s81.20x
💻 LocalNitro3.124s (-1.8%)3.886s (~)0.762s81.24x
🌐 MongoDBNext.js (Turbopack)4.728s5.177s0.449s61.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.270s (-29.0% 🟢)3.269s (-37.5% 🟢)0.998s101.00x
▲ VercelExpress2.378s (-32.1% 🟢)3.827s (-17.2% 🟢)1.449s81.05x
▲ VercelNext.js (Turbopack)3.093s (-5.5% 🟢)4.610s (~)1.517s71.36x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.975s (-3.5%)4.590s (~)0.615s71.00x
🐘 PostgresExpress4.039s (+2.3%)4.590s (+3.2%)0.551s71.02x
🌐 RedisNext.js (Turbopack)4.198s4.725s0.527s71.06x
💻 LocalExpress7.733s (-14.1% 🟢)8.267s (-10.8% 🟢)0.533s41.95x
💻 LocalNext.js (Turbopack)8.255s8.766s0.512s42.08x
💻 LocalNitro8.519s (+0.8%)9.275s (+2.8%)0.756s42.14x
🌐 MongoDBNext.js (Turbopack)10.032s10.680s0.648s32.52x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (-27.3% 🟢)3.647s (-28.7% 🟢)0.923s91.00x
▲ VercelNext.js (Turbopack)3.571s (-3.3%)5.369s (+9.7% 🔺)1.798s61.31x
▲ VercelExpress3.789s (+1.4%)5.100s (-0.7%)1.311s61.39x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.138s (-32.2% 🟢)1.003s (~)0.009s (-21.6% 🟢)1.015s (~)0.877s101.00x
💻 LocalNext.js (Turbopack)0.170s1.002s0.011s1.017s0.847s101.24x
🌐 RedisNext.js (Turbopack)0.182s1.000s0.002s1.007s0.825s101.33x
💻 LocalNitro0.212s (+7.3% 🔺)1.003s (~)0.011s (-2.7%)1.017s (~)0.804s101.54x
🐘 PostgresExpress0.215s (+2.8%)0.996s (~)0.002s (+15.4% 🔺)1.013s (~)0.797s101.57x
🐘 PostgresNitro0.246s (+9.4% 🔺)0.993s (~)0.002s (+41.7% 🔺)1.014s (~)0.767s101.79x
🌐 MongoDBNext.js (Turbopack)0.474s0.979s0.002s1.009s0.534s103.45x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.606s (+1.9%)2.405s (-8.7% 🟢)0.006s (-26.2% 🟢)3.035s (-2.2%)1.429s101.00x
▲ VercelNitro1.658s (+1.2%)2.506s (-14.3% 🟢)0.504s (+8896.4% 🔺)3.490s (+1.5%)1.833s101.03x
▲ VercelNext.js (Turbopack)1.785s (-4.5%)3.025s (+6.5% 🔺)0.011s (+160.5% 🔺)3.640s (+6.9% 🔺)1.855s101.11x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresExpress7/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local6/12
Next.js (Turbopack)🌐 Redis9/12
Nitro🐘 Postgres6/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

(err.status === 409 || err.status === 410)
) {
runtimeLogger.info(
'Run already finished during setup, skipping',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Run already finished during setup, skipping',
'Run already finished during setup, skipping replay',

maybe this would be clearer to the user? (assuming the codepath is only for run replays)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or "skipping redundant workflow execution"

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

human: LGTM! great detailed state check and ty for posting that on github PR review comment

@VaguelySerious
VaguelySerious merged commit 2cc42cb into mainMar 18, 2026
166 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/uncaught-409 branch March 18, 2026 00:50
@ghostghost mentioned this pull request Mar 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

[core] Don't fail to queue on 409 responses - #1418

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409
Mar 18, 2026
Merged

[core] Don't fail to queue on 409 responses#1418
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 17, 2026

Copy link
Copy Markdown
Member

Noticed error logs from 409s falling through the queue, which are confusing for users. Log example:

Queue callback error: Error [WorkflowAPIError]: Cannot update workflow run wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV with status 'completed'. Operation requires status 'running' or 'pending'.
at cP (.next/server/chunks/[root-of-the-server]__fd848f42._.js:63:41)
at async gA (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:3954)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:86:8)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:148157)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:146659)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:83:2206)
at async default (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:7813)
at async u7.processMessage (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:13992)
at async u7.consume (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:15197) {
cause: undefined,
status: 409,
code: undefined,
url: 'https://vercel-workflow.com/api/v1/runs/wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV'
}

so I ensures we catch and gracefully return for these cases. I had Claude run an eval on whether this blocks any real use cases. Eval below:


Concurrent scenarios and why skipping is safe

Scenario 1: Two handlers race on run_started

Two queue messages for the same run arrive while it's still pending. Both handlers call world.runs.get(), see pending, and try to create a run_started event.

Handler A: runs.get() → pending → events.create(run_started) → ✅ succeeds → continues replay loop
Handler B: runs.get() → pending → events.create(run_started) → ❌ 409 → returns early

Why it's safe: Handler A transitions the run to running and enters the replay loop. The replay loop either completes the workflow or suspends it with queued continuations. Handler B's early exit is a no-op — Handler A guarantees progress.

Location:runtime.ts catch block after run_started event creation.

Scenario 2: Two handlers race on run_completed

Two concurrent replay loops both reach the end of the workflow and try to create run_completed.

Handler A: events.create(run_completed) → ✅ succeeds → returns
Handler B: events.create(run_completed) → ❌ 409 → logs info → returns

Why it's safe: The run is completed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_completed event creation.

Scenario 3: Two handlers race on run_failed

Same as Scenario 2 but for failure. Both handlers detect an error in user code and try to fail the run.

Handler A: events.create(run_failed) → ✅ succeeds → returns
Handler B: events.create(run_failed) → ❌ 409 → logs info → returns

Why it's safe: The run is failed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_failed event creation.

Scenario 4: Run completes while another handler creates hooks

Handler A completes the workflow. Handler B (from an earlier queue message) is still in the suspension handler creating hook events.

Handler A: events.create(run_completed) → ✅ run is now terminal
Handler B: events.create(hook_created) → ❌ 409 (run terminal) → logs info, continues
→ returns from handleSuspension with pendingSteps
→ tries to execute inline step
→ events.create(step_started) → ❌ 410 (run gone) → returns { type: 'gone' }
→ caller returns

Why it's safe: Handler A already completed the workflow. Handler B's hook creation fails, and if any steps were queued, the step executor receives 410 on step_started and exits gracefully. The 410 on step_started is the safety net — even if the suspension handler returns pending steps after a 409, the step executor won't make progress on a finished run.

Location:suspension-handler.ts catch blocks for hook_created and hook_disposed; step-executor.ts 410 handling on step_started.

Scenario 5: Two handlers race on wait_completed

During the replay loop, both handlers see an elapsed wait and try to complete it.

Handler A: events.create(wait_completed) → ✅ succeeds → adds event to cache → continues replay
Handler B: events.create(wait_completed) → ❌ 409 → continue (skip this wait) → continues replay

Why it's safe: Both handlers continue their replay loops. The event log is the same for both (the winning handler's wait_completed is visible to future reads). Subsequent replay from either handler converges to the same state because replay is deterministic and event-sourced.

Location:runtime.ts wait completion loop with continue on 409.

Scenario 6: Two handlers race on step_completed

Two handlers execute the same step concurrently (e.g., both received the step's queue message). Both finish execution and try to create step_completed.

Handler A: events.create(step_completed) → ✅ succeeds → queues workflow continuation → returns
Handler B: events.create(step_completed) → ❌ 409 → returns WITHOUT queuing continuation

Why it's safe: Handler A queues the workflow continuation. Handler B does not — this is correct because only one continuation should be queued per step completion. If both queued, there would be redundant replay (which is safe but wasteful).

Location:step-executor.ts catch on step_completed event creation.

Scenario 7: Two handlers race on step_started

Two handlers try to start the same step. Handler A wins; Handler B gets 409 because the step transitioned to a terminal state.

Handler A: events.create(step_started) → ✅ succeeds → executes step → queues continuation
Handler B: events.create(step_started) → ❌ 409 (step terminal) → returns { type: 'skipped' }
→ caller queues workflow continuation (runtime.ts replay loop)

Why it's safe: Both handlers ensure workflow continuation — Handler A via step completion, Handler B via the replay loop re-queuing the workflow. The redundant replay is safe because event-sourced replay is convergent.

Location:step-executor.ts 409 handling on step_started.

Scenario 8: step_created/wait_created duplicate

During suspension handling, two concurrent replays both try to create the same step or wait event.

Handler A: events.create(step_created) → ✅ succeeds
Handler B: events.create(step_created) → ❌ 409 → logs info → continues

Why it's safe: The step/wait entity already exists. The suspension handler continues processing other items. The step will be executed by whichever handler picks it up from the queue.

Location:suspension-handler.ts catch blocks for step_created and wait_created.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@vercel

vercelBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9668d09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

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-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.038s (-15.7% 🟢)1.005s (~)0.968s101.00x
💻 LocalNitro0.046s (+6.7% 🔺)1.006s (~)0.959s101.23x
💻 LocalNext.js (Turbopack)0.051s1.006s0.955s101.36x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.951s101.44x
🐘 PostgresNitro0.059s (-4.7%)1.011s (~)0.952s101.56x
🐘 PostgresExpress0.059s (-14.8% 🟢)1.011s (~)0.952s101.57x
🌐 MongoDBNext.js (Turbopack)0.079s1.008s0.929s102.11x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.465s (-33.5% 🟢)2.036s (-22.7% 🟢)1.571s101.00x
▲ VercelExpress0.504s (-20.0% 🟢)2.286s (-14.4% 🟢)1.781s101.08x
▲ VercelNext.js (Turbopack)0.511s (-17.6% 🟢)2.559s (+13.2% 🔺)2.049s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.093s (-3.3%)2.006s (~)0.912s101.00x
🌐 RedisNext.js (Turbopack)1.122s2.006s0.885s101.03x
💻 LocalNitro1.130s (~)2.006s (~)0.877s101.03x
💻 LocalNext.js (Turbopack)1.130s2.006s0.876s101.03x
🐘 PostgresExpress1.153s (+0.7%)2.014s (~)0.860s101.05x
🐘 PostgresNitro1.158s (+1.1%)2.012s (~)0.855s101.06x
🌐 MongoDBNext.js (Turbopack)1.307s2.008s0.700s101.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.040s (-3.0%)3.224s (-4.4%)1.184s101.00x
▲ VercelExpress2.053s (+0.9%)3.735s (+12.4% 🔺)1.682s101.01x
▲ VercelNext.js (Turbopack)2.168s (-2.0%)3.924s (+13.8% 🔺)1.756s101.06x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.615s (-2.8%)11.023s (~)0.408s31.00x
🌐 RedisNext.js (Turbopack)10.784s11.023s0.239s31.02x
💻 LocalNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNitro10.927s (~)11.042s (~)0.115s31.03x
🐘 PostgresExpress10.970s (~)11.375s (~)0.405s31.03x
💻 LocalNitro10.976s (+0.8%)11.024s (~)0.048s31.03x
🌐 MongoDBNext.js (Turbopack)12.203s13.015s0.812s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.779s (-7.4% 🟢)18.655s (-5.6% 🟢)1.876s21.00x
▲ VercelNitro16.868s (+1.3%)18.197s (-1.3%)1.329s21.01x
▲ VercelNext.js (Turbopack)17.826s (+0.9%)19.468s (+1.2%)1.641s21.06x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.743s (-3.1%)27.051s (-3.6%)0.308s31.00x
🌐 RedisNext.js (Turbopack)26.760s27.049s0.289s31.00x
💻 LocalNext.js (Turbopack)27.128s28.053s0.925s31.01x
🐘 PostgresExpress27.240s (~)28.066s (~)0.826s31.02x
🐘 PostgresNitro27.277s (~)28.065s (~)0.788s31.02x
💻 LocalNitro27.583s (~)28.053s (~)0.470s31.03x
🌐 MongoDBNext.js (Turbopack)30.482s31.045s0.564s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro46.028s (+2.9%)47.737s (+4.3%)1.709s21.00x
▲ VercelNext.js (Turbopack)50.377s (+6.6% 🔺)52.253s (+8.0% 🔺)1.877s21.09x
▲ VercelExpress53.606s (+21.0% 🔺)55.319s (+22.1% 🔺)1.713s21.16x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.541s54.093s0.552s21.00x
🐘 PostgresExpress54.300s (~)55.094s (~)0.793s21.01x
🐘 PostgresNitro54.476s (~)55.105s (~)0.629s21.02x
💻 LocalExpress54.851s (-3.3%)55.101s (-3.5%)0.250s21.02x
💻 LocalNext.js (Turbopack)55.951s56.100s0.149s21.05x
💻 LocalNitro56.657s (~)57.106s (~)0.450s21.06x
🌐 MongoDBNext.js (Turbopack)60.675s61.065s0.390s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express94.771s (-4.4%)96.975s (-4.2%)2.204s11.00x
▲ VercelNitro96.605s (~)98.384s (~)1.779s11.02x
▲ VercelNext.js (Turbopack)98.753s (-3.9%)100.796s (-2.8%)2.043s11.04x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.345s2.006s0.662s151.00x
🐘 PostgresExpress1.366s (-4.0%)2.011s (~)0.645s151.02x
💻 LocalExpress1.467s (-5.2% 🟢)2.006s (~)0.538s151.09x
💻 LocalNitro1.498s (-1.1%)2.005s (~)0.507s151.11x
💻 LocalNext.js (Turbopack)1.547s2.006s0.459s151.15x
🌐 MongoDBNext.js (Turbopack)2.146s3.009s0.863s101.60x
🐘 PostgresNext.js (Turbopack)⚠️missing----
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.312s (-4.2%)3.407s (-4.8%)1.095s91.00x
▲ VercelNext.js (Turbopack)2.641s (-1.3%)4.038s (+7.5% 🔺)1.397s81.14x
▲ VercelExpress2.648s (+5.0%)4.138s (+13.0% 🔺)1.490s81.15x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.567s3.008s0.440s101.00x
🐘 PostgresNitro2.595s (~)3.014s (~)0.419s101.01x
💻 LocalExpress2.600s (-14.1% 🟢)3.007s (-15.6% 🟢)0.407s101.01x
🐘 PostgresExpress2.615s (~)3.015s (~)0.399s101.02x
💻 LocalNext.js (Turbopack)3.041s3.760s0.718s81.18x
💻 LocalNitro3.121s (+7.5% 🔺)3.565s (+11.1% 🔺)0.444s91.22x
🌐 MongoDBNext.js (Turbopack)4.747s5.179s0.432s61.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.799s (+7.7% 🔺)4.348s (+21.1% 🔺)1.550s81.00x
▲ VercelNitro3.520s (+30.2% 🔺)4.708s (+23.4% 🔺)1.188s71.26x
▲ VercelExpress3.663s (+47.9% 🔺)5.183s (+40.8% 🔺)1.520s81.31x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express4.027s (+1.4%)4.588s (+3.2%)0.561s71.00x
🐘 PostgresNitro4.032s (+0.7%)4.590s (+3.1%)0.558s71.00x
🌐 RedisNext.js (Turbopack)4.081s5.012s0.931s61.01x
💻 LocalExpress6.787s (-15.7% 🟢)7.014s (-20.1% 🟢)0.227s51.69x
💻 LocalNext.js (Turbopack)7.888s8.517s0.629s41.96x
💻 LocalNitro8.207s (-1.6%)8.521s (-5.5% 🟢)0.314s42.04x
🌐 MongoDBNext.js (Turbopack)10.067s10.684s0.617s32.50x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.520s (+44.3% 🔺)7.146s (+37.1% 🔺)1.626s51.00x
▲ VercelNitro7.009s (+153.3% 🔺)8.352s (+119.6% 🔺)1.343s41.27x
▲ VercelExpress10.371s (+264.0% 🔺)12.346s (+209.2% 🔺)1.975s31.88x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.303s2.006s0.703s151.00x
🐘 PostgresNitro1.422s (-1.3%)2.011s (~)0.589s151.09x
🐘 PostgresExpress1.442s (-1.5%)2.011s (-3.2%)0.570s151.11x
💻 LocalExpress1.477s (-2.9%)2.005s (~)0.528s151.13x
💻 LocalNitro1.523s (-1.1%)2.006s (~)0.483s151.17x
💻 LocalNext.js (Turbopack)1.564s2.073s0.509s151.20x
🌐 MongoDBNext.js (Turbopack)2.174s3.009s0.835s101.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.131s (-0.9%)3.290s (-1.5%)1.159s101.00x
▲ VercelNext.js (Turbopack)2.268s (-27.5% 🟢)3.823s (-24.1% 🟢)1.555s81.06x
▲ VercelExpress2.591s (+17.2% 🔺)4.029s (+17.2% 🔺)1.438s81.22x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.526s (-3.2%)3.012s (~)0.486s101.00x
🌐 RedisNext.js (Turbopack)2.532s3.008s0.477s101.00x
🐘 PostgresNitro2.730s (+7.4% 🔺)3.015s (~)0.285s101.08x
💻 LocalExpress2.797s (-9.8% 🟢)3.108s (-17.3% 🟢)0.311s101.11x
💻 LocalNext.js (Turbopack)3.030s3.760s0.729s81.20x
💻 LocalNitro3.124s (-1.8%)3.886s (~)0.762s81.24x
🌐 MongoDBNext.js (Turbopack)4.728s5.177s0.449s61.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.270s (-29.0% 🟢)3.269s (-37.5% 🟢)0.998s101.00x
▲ VercelExpress2.378s (-32.1% 🟢)3.827s (-17.2% 🟢)1.449s81.05x
▲ VercelNext.js (Turbopack)3.093s (-5.5% 🟢)4.610s (~)1.517s71.36x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.975s (-3.5%)4.590s (~)0.615s71.00x
🐘 PostgresExpress4.039s (+2.3%)4.590s (+3.2%)0.551s71.02x
🌐 RedisNext.js (Turbopack)4.198s4.725s0.527s71.06x
💻 LocalExpress7.733s (-14.1% 🟢)8.267s (-10.8% 🟢)0.533s41.95x
💻 LocalNext.js (Turbopack)8.255s8.766s0.512s42.08x
💻 LocalNitro8.519s (+0.8%)9.275s (+2.8%)0.756s42.14x
🌐 MongoDBNext.js (Turbopack)10.032s10.680s0.648s32.52x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (-27.3% 🟢)3.647s (-28.7% 🟢)0.923s91.00x
▲ VercelNext.js (Turbopack)3.571s (-3.3%)5.369s (+9.7% 🔺)1.798s61.31x
▲ VercelExpress3.789s (+1.4%)5.100s (-0.7%)1.311s61.39x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.138s (-32.2% 🟢)1.003s (~)0.009s (-21.6% 🟢)1.015s (~)0.877s101.00x
💻 LocalNext.js (Turbopack)0.170s1.002s0.011s1.017s0.847s101.24x
🌐 RedisNext.js (Turbopack)0.182s1.000s0.002s1.007s0.825s101.33x
💻 LocalNitro0.212s (+7.3% 🔺)1.003s (~)0.011s (-2.7%)1.017s (~)0.804s101.54x
🐘 PostgresExpress0.215s (+2.8%)0.996s (~)0.002s (+15.4% 🔺)1.013s (~)0.797s101.57x
🐘 PostgresNitro0.246s (+9.4% 🔺)0.993s (~)0.002s (+41.7% 🔺)1.014s (~)0.767s101.79x
🌐 MongoDBNext.js (Turbopack)0.474s0.979s0.002s1.009s0.534s103.45x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.606s (+1.9%)2.405s (-8.7% 🟢)0.006s (-26.2% 🟢)3.035s (-2.2%)1.429s101.00x
▲ VercelNitro1.658s (+1.2%)2.506s (-14.3% 🟢)0.504s (+8896.4% 🔺)3.490s (+1.5%)1.833s101.03x
▲ VercelNext.js (Turbopack)1.785s (-4.5%)3.025s (+6.5% 🔺)0.011s (+160.5% 🔺)3.640s (+6.9% 🔺)1.855s101.11x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresExpress7/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local6/12
Next.js (Turbopack)🌐 Redis9/12
Nitro🐘 Postgres6/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

(err.status === 409 || err.status === 410)
) {
runtimeLogger.info(
'Run already finished during setup, skipping',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Run already finished during setup, skipping',
'Run already finished during setup, skipping replay',

maybe this would be clearer to the user? (assuming the codepath is only for run replays)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or "skipping redundant workflow execution"

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

human: LGTM! great detailed state check and ty for posting that on github PR review comment

@VaguelySerious
VaguelySerious merged commit 2cc42cb into mainMar 18, 2026
166 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/uncaught-409 branch March 18, 2026 00:50
@ghostghost mentioned this pull request Mar 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[core] Don't fail to queue on 409 responses - #1418

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409
Mar 18, 2026
Merged

[core] Don't fail to queue on 409 responses#1418
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 17, 2026

Copy link
Copy Markdown
Member

Noticed error logs from 409s falling through the queue, which are confusing for users. Log example:

Queue callback error: Error [WorkflowAPIError]: Cannot update workflow run wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV with status 'completed'. Operation requires status 'running' or 'pending'.
at cP (.next/server/chunks/[root-of-the-server]__fd848f42._.js:63:41)
at async gA (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:3954)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:86:8)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:148157)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:146659)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:83:2206)
at async default (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:7813)
at async u7.processMessage (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:13992)
at async u7.consume (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:15197) {
cause: undefined,
status: 409,
code: undefined,
url: 'https://vercel-workflow.com/api/v1/runs/wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV'
}

so I ensures we catch and gracefully return for these cases. I had Claude run an eval on whether this blocks any real use cases. Eval below:


Concurrent scenarios and why skipping is safe

Scenario 1: Two handlers race on run_started

Two queue messages for the same run arrive while it's still pending. Both handlers call world.runs.get(), see pending, and try to create a run_started event.

Handler A: runs.get() → pending → events.create(run_started) → ✅ succeeds → continues replay loop
Handler B: runs.get() → pending → events.create(run_started) → ❌ 409 → returns early

Why it's safe: Handler A transitions the run to running and enters the replay loop. The replay loop either completes the workflow or suspends it with queued continuations. Handler B's early exit is a no-op — Handler A guarantees progress.

Location:runtime.ts catch block after run_started event creation.

Scenario 2: Two handlers race on run_completed

Two concurrent replay loops both reach the end of the workflow and try to create run_completed.

Handler A: events.create(run_completed) → ✅ succeeds → returns
Handler B: events.create(run_completed) → ❌ 409 → logs info → returns

Why it's safe: The run is completed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_completed event creation.

Scenario 3: Two handlers race on run_failed

Same as Scenario 2 but for failure. Both handlers detect an error in user code and try to fail the run.

Handler A: events.create(run_failed) → ✅ succeeds → returns
Handler B: events.create(run_failed) → ❌ 409 → logs info → returns

Why it's safe: The run is failed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_failed event creation.

Scenario 4: Run completes while another handler creates hooks

Handler A completes the workflow. Handler B (from an earlier queue message) is still in the suspension handler creating hook events.

Handler A: events.create(run_completed) → ✅ run is now terminal
Handler B: events.create(hook_created) → ❌ 409 (run terminal) → logs info, continues
→ returns from handleSuspension with pendingSteps
→ tries to execute inline step
→ events.create(step_started) → ❌ 410 (run gone) → returns { type: 'gone' }
→ caller returns

Why it's safe: Handler A already completed the workflow. Handler B's hook creation fails, and if any steps were queued, the step executor receives 410 on step_started and exits gracefully. The 410 on step_started is the safety net — even if the suspension handler returns pending steps after a 409, the step executor won't make progress on a finished run.

Location:suspension-handler.ts catch blocks for hook_created and hook_disposed; step-executor.ts 410 handling on step_started.

Scenario 5: Two handlers race on wait_completed

During the replay loop, both handlers see an elapsed wait and try to complete it.

Handler A: events.create(wait_completed) → ✅ succeeds → adds event to cache → continues replay
Handler B: events.create(wait_completed) → ❌ 409 → continue (skip this wait) → continues replay

Why it's safe: Both handlers continue their replay loops. The event log is the same for both (the winning handler's wait_completed is visible to future reads). Subsequent replay from either handler converges to the same state because replay is deterministic and event-sourced.

Location:runtime.ts wait completion loop with continue on 409.

Scenario 6: Two handlers race on step_completed

Two handlers execute the same step concurrently (e.g., both received the step's queue message). Both finish execution and try to create step_completed.

Handler A: events.create(step_completed) → ✅ succeeds → queues workflow continuation → returns
Handler B: events.create(step_completed) → ❌ 409 → returns WITHOUT queuing continuation

Why it's safe: Handler A queues the workflow continuation. Handler B does not — this is correct because only one continuation should be queued per step completion. If both queued, there would be redundant replay (which is safe but wasteful).

Location:step-executor.ts catch on step_completed event creation.

Scenario 7: Two handlers race on step_started

Two handlers try to start the same step. Handler A wins; Handler B gets 409 because the step transitioned to a terminal state.

Handler A: events.create(step_started) → ✅ succeeds → executes step → queues continuation
Handler B: events.create(step_started) → ❌ 409 (step terminal) → returns { type: 'skipped' }
→ caller queues workflow continuation (runtime.ts replay loop)

Why it's safe: Both handlers ensure workflow continuation — Handler A via step completion, Handler B via the replay loop re-queuing the workflow. The redundant replay is safe because event-sourced replay is convergent.

Location:step-executor.ts 409 handling on step_started.

Scenario 8: step_created/wait_created duplicate

During suspension handling, two concurrent replays both try to create the same step or wait event.

Handler A: events.create(step_created) → ✅ succeeds
Handler B: events.create(step_created) → ❌ 409 → logs info → continues

Why it's safe: The step/wait entity already exists. The suspension handler continues processing other items. The step will be executed by whichever handler picks it up from the queue.

Location:suspension-handler.ts catch blocks for step_created and wait_created.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@vercel

vercelBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9668d09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

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-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.038s (-15.7% 🟢)1.005s (~)0.968s101.00x
💻 LocalNitro0.046s (+6.7% 🔺)1.006s (~)0.959s101.23x
💻 LocalNext.js (Turbopack)0.051s1.006s0.955s101.36x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.951s101.44x
🐘 PostgresNitro0.059s (-4.7%)1.011s (~)0.952s101.56x
🐘 PostgresExpress0.059s (-14.8% 🟢)1.011s (~)0.952s101.57x
🌐 MongoDBNext.js (Turbopack)0.079s1.008s0.929s102.11x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.465s (-33.5% 🟢)2.036s (-22.7% 🟢)1.571s101.00x
▲ VercelExpress0.504s (-20.0% 🟢)2.286s (-14.4% 🟢)1.781s101.08x
▲ VercelNext.js (Turbopack)0.511s (-17.6% 🟢)2.559s (+13.2% 🔺)2.049s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.093s (-3.3%)2.006s (~)0.912s101.00x
🌐 RedisNext.js (Turbopack)1.122s2.006s0.885s101.03x
💻 LocalNitro1.130s (~)2.006s (~)0.877s101.03x
💻 LocalNext.js (Turbopack)1.130s2.006s0.876s101.03x
🐘 PostgresExpress1.153s (+0.7%)2.014s (~)0.860s101.05x
🐘 PostgresNitro1.158s (+1.1%)2.012s (~)0.855s101.06x
🌐 MongoDBNext.js (Turbopack)1.307s2.008s0.700s101.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.040s (-3.0%)3.224s (-4.4%)1.184s101.00x
▲ VercelExpress2.053s (+0.9%)3.735s (+12.4% 🔺)1.682s101.01x
▲ VercelNext.js (Turbopack)2.168s (-2.0%)3.924s (+13.8% 🔺)1.756s101.06x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.615s (-2.8%)11.023s (~)0.408s31.00x
🌐 RedisNext.js (Turbopack)10.784s11.023s0.239s31.02x
💻 LocalNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNitro10.927s (~)11.042s (~)0.115s31.03x
🐘 PostgresExpress10.970s (~)11.375s (~)0.405s31.03x
💻 LocalNitro10.976s (+0.8%)11.024s (~)0.048s31.03x
🌐 MongoDBNext.js (Turbopack)12.203s13.015s0.812s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.779s (-7.4% 🟢)18.655s (-5.6% 🟢)1.876s21.00x
▲ VercelNitro16.868s (+1.3%)18.197s (-1.3%)1.329s21.01x
▲ VercelNext.js (Turbopack)17.826s (+0.9%)19.468s (+1.2%)1.641s21.06x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.743s (-3.1%)27.051s (-3.6%)0.308s31.00x
🌐 RedisNext.js (Turbopack)26.760s27.049s0.289s31.00x
💻 LocalNext.js (Turbopack)27.128s28.053s0.925s31.01x
🐘 PostgresExpress27.240s (~)28.066s (~)0.826s31.02x
🐘 PostgresNitro27.277s (~)28.065s (~)0.788s31.02x
💻 LocalNitro27.583s (~)28.053s (~)0.470s31.03x
🌐 MongoDBNext.js (Turbopack)30.482s31.045s0.564s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro46.028s (+2.9%)47.737s (+4.3%)1.709s21.00x
▲ VercelNext.js (Turbopack)50.377s (+6.6% 🔺)52.253s (+8.0% 🔺)1.877s21.09x
▲ VercelExpress53.606s (+21.0% 🔺)55.319s (+22.1% 🔺)1.713s21.16x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.541s54.093s0.552s21.00x
🐘 PostgresExpress54.300s (~)55.094s (~)0.793s21.01x
🐘 PostgresNitro54.476s (~)55.105s (~)0.629s21.02x
💻 LocalExpress54.851s (-3.3%)55.101s (-3.5%)0.250s21.02x
💻 LocalNext.js (Turbopack)55.951s56.100s0.149s21.05x
💻 LocalNitro56.657s (~)57.106s (~)0.450s21.06x
🌐 MongoDBNext.js (Turbopack)60.675s61.065s0.390s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express94.771s (-4.4%)96.975s (-4.2%)2.204s11.00x
▲ VercelNitro96.605s (~)98.384s (~)1.779s11.02x
▲ VercelNext.js (Turbopack)98.753s (-3.9%)100.796s (-2.8%)2.043s11.04x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.345s2.006s0.662s151.00x
🐘 PostgresExpress1.366s (-4.0%)2.011s (~)0.645s151.02x
💻 LocalExpress1.467s (-5.2% 🟢)2.006s (~)0.538s151.09x
💻 LocalNitro1.498s (-1.1%)2.005s (~)0.507s151.11x
💻 LocalNext.js (Turbopack)1.547s2.006s0.459s151.15x
🌐 MongoDBNext.js (Turbopack)2.146s3.009s0.863s101.60x
🐘 PostgresNext.js (Turbopack)⚠️missing----
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.312s (-4.2%)3.407s (-4.8%)1.095s91.00x
▲ VercelNext.js (Turbopack)2.641s (-1.3%)4.038s (+7.5% 🔺)1.397s81.14x
▲ VercelExpress2.648s (+5.0%)4.138s (+13.0% 🔺)1.490s81.15x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.567s3.008s0.440s101.00x
🐘 PostgresNitro2.595s (~)3.014s (~)0.419s101.01x
💻 LocalExpress2.600s (-14.1% 🟢)3.007s (-15.6% 🟢)0.407s101.01x
🐘 PostgresExpress2.615s (~)3.015s (~)0.399s101.02x
💻 LocalNext.js (Turbopack)3.041s3.760s0.718s81.18x
💻 LocalNitro3.121s (+7.5% 🔺)3.565s (+11.1% 🔺)0.444s91.22x
🌐 MongoDBNext.js (Turbopack)4.747s5.179s0.432s61.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.799s (+7.7% 🔺)4.348s (+21.1% 🔺)1.550s81.00x
▲ VercelNitro3.520s (+30.2% 🔺)4.708s (+23.4% 🔺)1.188s71.26x
▲ VercelExpress3.663s (+47.9% 🔺)5.183s (+40.8% 🔺)1.520s81.31x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express4.027s (+1.4%)4.588s (+3.2%)0.561s71.00x
🐘 PostgresNitro4.032s (+0.7%)4.590s (+3.1%)0.558s71.00x
🌐 RedisNext.js (Turbopack)4.081s5.012s0.931s61.01x
💻 LocalExpress6.787s (-15.7% 🟢)7.014s (-20.1% 🟢)0.227s51.69x
💻 LocalNext.js (Turbopack)7.888s8.517s0.629s41.96x
💻 LocalNitro8.207s (-1.6%)8.521s (-5.5% 🟢)0.314s42.04x
🌐 MongoDBNext.js (Turbopack)10.067s10.684s0.617s32.50x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.520s (+44.3% 🔺)7.146s (+37.1% 🔺)1.626s51.00x
▲ VercelNitro7.009s (+153.3% 🔺)8.352s (+119.6% 🔺)1.343s41.27x
▲ VercelExpress10.371s (+264.0% 🔺)12.346s (+209.2% 🔺)1.975s31.88x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.303s2.006s0.703s151.00x
🐘 PostgresNitro1.422s (-1.3%)2.011s (~)0.589s151.09x
🐘 PostgresExpress1.442s (-1.5%)2.011s (-3.2%)0.570s151.11x
💻 LocalExpress1.477s (-2.9%)2.005s (~)0.528s151.13x
💻 LocalNitro1.523s (-1.1%)2.006s (~)0.483s151.17x
💻 LocalNext.js (Turbopack)1.564s2.073s0.509s151.20x
🌐 MongoDBNext.js (Turbopack)2.174s3.009s0.835s101.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.131s (-0.9%)3.290s (-1.5%)1.159s101.00x
▲ VercelNext.js (Turbopack)2.268s (-27.5% 🟢)3.823s (-24.1% 🟢)1.555s81.06x
▲ VercelExpress2.591s (+17.2% 🔺)4.029s (+17.2% 🔺)1.438s81.22x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.526s (-3.2%)3.012s (~)0.486s101.00x
🌐 RedisNext.js (Turbopack)2.532s3.008s0.477s101.00x
🐘 PostgresNitro2.730s (+7.4% 🔺)3.015s (~)0.285s101.08x
💻 LocalExpress2.797s (-9.8% 🟢)3.108s (-17.3% 🟢)0.311s101.11x
💻 LocalNext.js (Turbopack)3.030s3.760s0.729s81.20x
💻 LocalNitro3.124s (-1.8%)3.886s (~)0.762s81.24x
🌐 MongoDBNext.js (Turbopack)4.728s5.177s0.449s61.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.270s (-29.0% 🟢)3.269s (-37.5% 🟢)0.998s101.00x
▲ VercelExpress2.378s (-32.1% 🟢)3.827s (-17.2% 🟢)1.449s81.05x
▲ VercelNext.js (Turbopack)3.093s (-5.5% 🟢)4.610s (~)1.517s71.36x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.975s (-3.5%)4.590s (~)0.615s71.00x
🐘 PostgresExpress4.039s (+2.3%)4.590s (+3.2%)0.551s71.02x
🌐 RedisNext.js (Turbopack)4.198s4.725s0.527s71.06x
💻 LocalExpress7.733s (-14.1% 🟢)8.267s (-10.8% 🟢)0.533s41.95x
💻 LocalNext.js (Turbopack)8.255s8.766s0.512s42.08x
💻 LocalNitro8.519s (+0.8%)9.275s (+2.8%)0.756s42.14x
🌐 MongoDBNext.js (Turbopack)10.032s10.680s0.648s32.52x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (-27.3% 🟢)3.647s (-28.7% 🟢)0.923s91.00x
▲ VercelNext.js (Turbopack)3.571s (-3.3%)5.369s (+9.7% 🔺)1.798s61.31x
▲ VercelExpress3.789s (+1.4%)5.100s (-0.7%)1.311s61.39x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.138s (-32.2% 🟢)1.003s (~)0.009s (-21.6% 🟢)1.015s (~)0.877s101.00x
💻 LocalNext.js (Turbopack)0.170s1.002s0.011s1.017s0.847s101.24x
🌐 RedisNext.js (Turbopack)0.182s1.000s0.002s1.007s0.825s101.33x
💻 LocalNitro0.212s (+7.3% 🔺)1.003s (~)0.011s (-2.7%)1.017s (~)0.804s101.54x
🐘 PostgresExpress0.215s (+2.8%)0.996s (~)0.002s (+15.4% 🔺)1.013s (~)0.797s101.57x
🐘 PostgresNitro0.246s (+9.4% 🔺)0.993s (~)0.002s (+41.7% 🔺)1.014s (~)0.767s101.79x
🌐 MongoDBNext.js (Turbopack)0.474s0.979s0.002s1.009s0.534s103.45x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.606s (+1.9%)2.405s (-8.7% 🟢)0.006s (-26.2% 🟢)3.035s (-2.2%)1.429s101.00x
▲ VercelNitro1.658s (+1.2%)2.506s (-14.3% 🟢)0.504s (+8896.4% 🔺)3.490s (+1.5%)1.833s101.03x
▲ VercelNext.js (Turbopack)1.785s (-4.5%)3.025s (+6.5% 🔺)0.011s (+160.5% 🔺)3.640s (+6.9% 🔺)1.855s101.11x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresExpress7/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local6/12
Next.js (Turbopack)🌐 Redis9/12
Nitro🐘 Postgres6/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

(err.status === 409 || err.status === 410)
) {
runtimeLogger.info(
'Run already finished during setup, skipping',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Run already finished during setup, skipping',
'Run already finished during setup, skipping replay',

maybe this would be clearer to the user? (assuming the codepath is only for run replays)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or "skipping redundant workflow execution"

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

human: LGTM! great detailed state check and ty for posting that on github PR review comment

@VaguelySerious
VaguelySerious merged commit 2cc42cb into mainMar 18, 2026
166 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/uncaught-409 branch March 18, 2026 00:50
@ghostghost mentioned this pull request Mar 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[core] Don't fail to queue on 409 responses - #1418

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409
Mar 18, 2026
Merged

[core] Don't fail to queue on 409 responses#1418
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 17, 2026

Copy link
Copy Markdown
Member

Noticed error logs from 409s falling through the queue, which are confusing for users. Log example:

Queue callback error: Error [WorkflowAPIError]: Cannot update workflow run wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV with status 'completed'. Operation requires status 'running' or 'pending'.
at cP (.next/server/chunks/[root-of-the-server]__fd848f42._.js:63:41)
at async gA (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:3954)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:86:8)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:148157)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:146659)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:83:2206)
at async default (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:7813)
at async u7.processMessage (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:13992)
at async u7.consume (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:15197) {
cause: undefined,
status: 409,
code: undefined,
url: 'https://vercel-workflow.com/api/v1/runs/wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV'
}

so I ensures we catch and gracefully return for these cases. I had Claude run an eval on whether this blocks any real use cases. Eval below:


Concurrent scenarios and why skipping is safe

Scenario 1: Two handlers race on run_started

Two queue messages for the same run arrive while it's still pending. Both handlers call world.runs.get(), see pending, and try to create a run_started event.

Handler A: runs.get() → pending → events.create(run_started) → ✅ succeeds → continues replay loop
Handler B: runs.get() → pending → events.create(run_started) → ❌ 409 → returns early

Why it's safe: Handler A transitions the run to running and enters the replay loop. The replay loop either completes the workflow or suspends it with queued continuations. Handler B's early exit is a no-op — Handler A guarantees progress.

Location:runtime.ts catch block after run_started event creation.

Scenario 2: Two handlers race on run_completed

Two concurrent replay loops both reach the end of the workflow and try to create run_completed.

Handler A: events.create(run_completed) → ✅ succeeds → returns
Handler B: events.create(run_completed) → ❌ 409 → logs info → returns

Why it's safe: The run is completed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_completed event creation.

Scenario 3: Two handlers race on run_failed

Same as Scenario 2 but for failure. Both handlers detect an error in user code and try to fail the run.

Handler A: events.create(run_failed) → ✅ succeeds → returns
Handler B: events.create(run_failed) → ❌ 409 → logs info → returns

Why it's safe: The run is failed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_failed event creation.

Scenario 4: Run completes while another handler creates hooks

Handler A completes the workflow. Handler B (from an earlier queue message) is still in the suspension handler creating hook events.

Handler A: events.create(run_completed) → ✅ run is now terminal
Handler B: events.create(hook_created) → ❌ 409 (run terminal) → logs info, continues
→ returns from handleSuspension with pendingSteps
→ tries to execute inline step
→ events.create(step_started) → ❌ 410 (run gone) → returns { type: 'gone' }
→ caller returns

Why it's safe: Handler A already completed the workflow. Handler B's hook creation fails, and if any steps were queued, the step executor receives 410 on step_started and exits gracefully. The 410 on step_started is the safety net — even if the suspension handler returns pending steps after a 409, the step executor won't make progress on a finished run.

Location:suspension-handler.ts catch blocks for hook_created and hook_disposed; step-executor.ts 410 handling on step_started.

Scenario 5: Two handlers race on wait_completed

During the replay loop, both handlers see an elapsed wait and try to complete it.

Handler A: events.create(wait_completed) → ✅ succeeds → adds event to cache → continues replay
Handler B: events.create(wait_completed) → ❌ 409 → continue (skip this wait) → continues replay

Why it's safe: Both handlers continue their replay loops. The event log is the same for both (the winning handler's wait_completed is visible to future reads). Subsequent replay from either handler converges to the same state because replay is deterministic and event-sourced.

Location:runtime.ts wait completion loop with continue on 409.

Scenario 6: Two handlers race on step_completed

Two handlers execute the same step concurrently (e.g., both received the step's queue message). Both finish execution and try to create step_completed.

Handler A: events.create(step_completed) → ✅ succeeds → queues workflow continuation → returns
Handler B: events.create(step_completed) → ❌ 409 → returns WITHOUT queuing continuation

Why it's safe: Handler A queues the workflow continuation. Handler B does not — this is correct because only one continuation should be queued per step completion. If both queued, there would be redundant replay (which is safe but wasteful).

Location:step-executor.ts catch on step_completed event creation.

Scenario 7: Two handlers race on step_started

Two handlers try to start the same step. Handler A wins; Handler B gets 409 because the step transitioned to a terminal state.

Handler A: events.create(step_started) → ✅ succeeds → executes step → queues continuation
Handler B: events.create(step_started) → ❌ 409 (step terminal) → returns { type: 'skipped' }
→ caller queues workflow continuation (runtime.ts replay loop)

Why it's safe: Both handlers ensure workflow continuation — Handler A via step completion, Handler B via the replay loop re-queuing the workflow. The redundant replay is safe because event-sourced replay is convergent.

Location:step-executor.ts 409 handling on step_started.

Scenario 8: step_created/wait_created duplicate

During suspension handling, two concurrent replays both try to create the same step or wait event.

Handler A: events.create(step_created) → ✅ succeeds
Handler B: events.create(step_created) → ❌ 409 → logs info → continues

Why it's safe: The step/wait entity already exists. The suspension handler continues processing other items. The step will be executed by whichever handler picks it up from the queue.

Location:suspension-handler.ts catch blocks for step_created and wait_created.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@vercel

vercelBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9668d09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

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-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.038s (-15.7% 🟢)1.005s (~)0.968s101.00x
💻 LocalNitro0.046s (+6.7% 🔺)1.006s (~)0.959s101.23x
💻 LocalNext.js (Turbopack)0.051s1.006s0.955s101.36x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.951s101.44x
🐘 PostgresNitro0.059s (-4.7%)1.011s (~)0.952s101.56x
🐘 PostgresExpress0.059s (-14.8% 🟢)1.011s (~)0.952s101.57x
🌐 MongoDBNext.js (Turbopack)0.079s1.008s0.929s102.11x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.465s (-33.5% 🟢)2.036s (-22.7% 🟢)1.571s101.00x
▲ VercelExpress0.504s (-20.0% 🟢)2.286s (-14.4% 🟢)1.781s101.08x
▲ VercelNext.js (Turbopack)0.511s (-17.6% 🟢)2.559s (+13.2% 🔺)2.049s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.093s (-3.3%)2.006s (~)0.912s101.00x
🌐 RedisNext.js (Turbopack)1.122s2.006s0.885s101.03x
💻 LocalNitro1.130s (~)2.006s (~)0.877s101.03x
💻 LocalNext.js (Turbopack)1.130s2.006s0.876s101.03x
🐘 PostgresExpress1.153s (+0.7%)2.014s (~)0.860s101.05x
🐘 PostgresNitro1.158s (+1.1%)2.012s (~)0.855s101.06x
🌐 MongoDBNext.js (Turbopack)1.307s2.008s0.700s101.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.040s (-3.0%)3.224s (-4.4%)1.184s101.00x
▲ VercelExpress2.053s (+0.9%)3.735s (+12.4% 🔺)1.682s101.01x
▲ VercelNext.js (Turbopack)2.168s (-2.0%)3.924s (+13.8% 🔺)1.756s101.06x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.615s (-2.8%)11.023s (~)0.408s31.00x
🌐 RedisNext.js (Turbopack)10.784s11.023s0.239s31.02x
💻 LocalNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNitro10.927s (~)11.042s (~)0.115s31.03x
🐘 PostgresExpress10.970s (~)11.375s (~)0.405s31.03x
💻 LocalNitro10.976s (+0.8%)11.024s (~)0.048s31.03x
🌐 MongoDBNext.js (Turbopack)12.203s13.015s0.812s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.779s (-7.4% 🟢)18.655s (-5.6% 🟢)1.876s21.00x
▲ VercelNitro16.868s (+1.3%)18.197s (-1.3%)1.329s21.01x
▲ VercelNext.js (Turbopack)17.826s (+0.9%)19.468s (+1.2%)1.641s21.06x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.743s (-3.1%)27.051s (-3.6%)0.308s31.00x
🌐 RedisNext.js (Turbopack)26.760s27.049s0.289s31.00x
💻 LocalNext.js (Turbopack)27.128s28.053s0.925s31.01x
🐘 PostgresExpress27.240s (~)28.066s (~)0.826s31.02x
🐘 PostgresNitro27.277s (~)28.065s (~)0.788s31.02x
💻 LocalNitro27.583s (~)28.053s (~)0.470s31.03x
🌐 MongoDBNext.js (Turbopack)30.482s31.045s0.564s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro46.028s (+2.9%)47.737s (+4.3%)1.709s21.00x
▲ VercelNext.js (Turbopack)50.377s (+6.6% 🔺)52.253s (+8.0% 🔺)1.877s21.09x
▲ VercelExpress53.606s (+21.0% 🔺)55.319s (+22.1% 🔺)1.713s21.16x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.541s54.093s0.552s21.00x
🐘 PostgresExpress54.300s (~)55.094s (~)0.793s21.01x
🐘 PostgresNitro54.476s (~)55.105s (~)0.629s21.02x
💻 LocalExpress54.851s (-3.3%)55.101s (-3.5%)0.250s21.02x
💻 LocalNext.js (Turbopack)55.951s56.100s0.149s21.05x
💻 LocalNitro56.657s (~)57.106s (~)0.450s21.06x
🌐 MongoDBNext.js (Turbopack)60.675s61.065s0.390s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express94.771s (-4.4%)96.975s (-4.2%)2.204s11.00x
▲ VercelNitro96.605s (~)98.384s (~)1.779s11.02x
▲ VercelNext.js (Turbopack)98.753s (-3.9%)100.796s (-2.8%)2.043s11.04x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.345s2.006s0.662s151.00x
🐘 PostgresExpress1.366s (-4.0%)2.011s (~)0.645s151.02x
💻 LocalExpress1.467s (-5.2% 🟢)2.006s (~)0.538s151.09x
💻 LocalNitro1.498s (-1.1%)2.005s (~)0.507s151.11x
💻 LocalNext.js (Turbopack)1.547s2.006s0.459s151.15x
🌐 MongoDBNext.js (Turbopack)2.146s3.009s0.863s101.60x
🐘 PostgresNext.js (Turbopack)⚠️missing----
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.312s (-4.2%)3.407s (-4.8%)1.095s91.00x
▲ VercelNext.js (Turbopack)2.641s (-1.3%)4.038s (+7.5% 🔺)1.397s81.14x
▲ VercelExpress2.648s (+5.0%)4.138s (+13.0% 🔺)1.490s81.15x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.567s3.008s0.440s101.00x
🐘 PostgresNitro2.595s (~)3.014s (~)0.419s101.01x
💻 LocalExpress2.600s (-14.1% 🟢)3.007s (-15.6% 🟢)0.407s101.01x
🐘 PostgresExpress2.615s (~)3.015s (~)0.399s101.02x
💻 LocalNext.js (Turbopack)3.041s3.760s0.718s81.18x
💻 LocalNitro3.121s (+7.5% 🔺)3.565s (+11.1% 🔺)0.444s91.22x
🌐 MongoDBNext.js (Turbopack)4.747s5.179s0.432s61.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.799s (+7.7% 🔺)4.348s (+21.1% 🔺)1.550s81.00x
▲ VercelNitro3.520s (+30.2% 🔺)4.708s (+23.4% 🔺)1.188s71.26x
▲ VercelExpress3.663s (+47.9% 🔺)5.183s (+40.8% 🔺)1.520s81.31x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express4.027s (+1.4%)4.588s (+3.2%)0.561s71.00x
🐘 PostgresNitro4.032s (+0.7%)4.590s (+3.1%)0.558s71.00x
🌐 RedisNext.js (Turbopack)4.081s5.012s0.931s61.01x
💻 LocalExpress6.787s (-15.7% 🟢)7.014s (-20.1% 🟢)0.227s51.69x
💻 LocalNext.js (Turbopack)7.888s8.517s0.629s41.96x
💻 LocalNitro8.207s (-1.6%)8.521s (-5.5% 🟢)0.314s42.04x
🌐 MongoDBNext.js (Turbopack)10.067s10.684s0.617s32.50x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.520s (+44.3% 🔺)7.146s (+37.1% 🔺)1.626s51.00x
▲ VercelNitro7.009s (+153.3% 🔺)8.352s (+119.6% 🔺)1.343s41.27x
▲ VercelExpress10.371s (+264.0% 🔺)12.346s (+209.2% 🔺)1.975s31.88x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.303s2.006s0.703s151.00x
🐘 PostgresNitro1.422s (-1.3%)2.011s (~)0.589s151.09x
🐘 PostgresExpress1.442s (-1.5%)2.011s (-3.2%)0.570s151.11x
💻 LocalExpress1.477s (-2.9%)2.005s (~)0.528s151.13x
💻 LocalNitro1.523s (-1.1%)2.006s (~)0.483s151.17x
💻 LocalNext.js (Turbopack)1.564s2.073s0.509s151.20x
🌐 MongoDBNext.js (Turbopack)2.174s3.009s0.835s101.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.131s (-0.9%)3.290s (-1.5%)1.159s101.00x
▲ VercelNext.js (Turbopack)2.268s (-27.5% 🟢)3.823s (-24.1% 🟢)1.555s81.06x
▲ VercelExpress2.591s (+17.2% 🔺)4.029s (+17.2% 🔺)1.438s81.22x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.526s (-3.2%)3.012s (~)0.486s101.00x
🌐 RedisNext.js (Turbopack)2.532s3.008s0.477s101.00x
🐘 PostgresNitro2.730s (+7.4% 🔺)3.015s (~)0.285s101.08x
💻 LocalExpress2.797s (-9.8% 🟢)3.108s (-17.3% 🟢)0.311s101.11x
💻 LocalNext.js (Turbopack)3.030s3.760s0.729s81.20x
💻 LocalNitro3.124s (-1.8%)3.886s (~)0.762s81.24x
🌐 MongoDBNext.js (Turbopack)4.728s5.177s0.449s61.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.270s (-29.0% 🟢)3.269s (-37.5% 🟢)0.998s101.00x
▲ VercelExpress2.378s (-32.1% 🟢)3.827s (-17.2% 🟢)1.449s81.05x
▲ VercelNext.js (Turbopack)3.093s (-5.5% 🟢)4.610s (~)1.517s71.36x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.975s (-3.5%)4.590s (~)0.615s71.00x
🐘 PostgresExpress4.039s (+2.3%)4.590s (+3.2%)0.551s71.02x
🌐 RedisNext.js (Turbopack)4.198s4.725s0.527s71.06x
💻 LocalExpress7.733s (-14.1% 🟢)8.267s (-10.8% 🟢)0.533s41.95x
💻 LocalNext.js (Turbopack)8.255s8.766s0.512s42.08x
💻 LocalNitro8.519s (+0.8%)9.275s (+2.8%)0.756s42.14x
🌐 MongoDBNext.js (Turbopack)10.032s10.680s0.648s32.52x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (-27.3% 🟢)3.647s (-28.7% 🟢)0.923s91.00x
▲ VercelNext.js (Turbopack)3.571s (-3.3%)5.369s (+9.7% 🔺)1.798s61.31x
▲ VercelExpress3.789s (+1.4%)5.100s (-0.7%)1.311s61.39x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.138s (-32.2% 🟢)1.003s (~)0.009s (-21.6% 🟢)1.015s (~)0.877s101.00x
💻 LocalNext.js (Turbopack)0.170s1.002s0.011s1.017s0.847s101.24x
🌐 RedisNext.js (Turbopack)0.182s1.000s0.002s1.007s0.825s101.33x
💻 LocalNitro0.212s (+7.3% 🔺)1.003s (~)0.011s (-2.7%)1.017s (~)0.804s101.54x
🐘 PostgresExpress0.215s (+2.8%)0.996s (~)0.002s (+15.4% 🔺)1.013s (~)0.797s101.57x
🐘 PostgresNitro0.246s (+9.4% 🔺)0.993s (~)0.002s (+41.7% 🔺)1.014s (~)0.767s101.79x
🌐 MongoDBNext.js (Turbopack)0.474s0.979s0.002s1.009s0.534s103.45x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.606s (+1.9%)2.405s (-8.7% 🟢)0.006s (-26.2% 🟢)3.035s (-2.2%)1.429s101.00x
▲ VercelNitro1.658s (+1.2%)2.506s (-14.3% 🟢)0.504s (+8896.4% 🔺)3.490s (+1.5%)1.833s101.03x
▲ VercelNext.js (Turbopack)1.785s (-4.5%)3.025s (+6.5% 🔺)0.011s (+160.5% 🔺)3.640s (+6.9% 🔺)1.855s101.11x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresExpress7/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local6/12
Next.js (Turbopack)🌐 Redis9/12
Nitro🐘 Postgres6/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

(err.status === 409 || err.status === 410)
) {
runtimeLogger.info(
'Run already finished during setup, skipping',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Run already finished during setup, skipping',
'Run already finished during setup, skipping replay',

maybe this would be clearer to the user? (assuming the codepath is only for run replays)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or "skipping redundant workflow execution"

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

human: LGTM! great detailed state check and ty for posting that on github PR review comment

@VaguelySerious
VaguelySerious merged commit 2cc42cb into mainMar 18, 2026
166 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/uncaught-409 branch March 18, 2026 00:50
@ghostghost mentioned this pull request Mar 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

[core] Don't fail to queue on 409 responses - #1418

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409
Mar 18, 2026
Merged

[core] Don't fail to queue on 409 responses#1418
VaguelySerious merged 1 commit into
mainfrom
peter/uncaught-409

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 17, 2026

Copy link
Copy Markdown
Member

Noticed error logs from 409s falling through the queue, which are confusing for users. Log example:

Queue callback error: Error [WorkflowAPIError]: Cannot update workflow run wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV with status 'completed'. Operation requires status 'running' or 'pending'.
at cP (.next/server/chunks/[root-of-the-server]__fd848f42._.js:63:41)
at async gA (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:3954)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:86:8)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:148157)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:60:146659)
at async (.next/server/chunks/[root-of-the-server]__fd848f42._.js:83:2206)
at async default (.next/server/chunks/[root-of-the-server]__fd848f42._.js:67:7813)
at async u7.processMessage (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:13992)
at async u7.consume (.next/server/chunks/[root-of-the-server]__fd848f42._.js:62:15197) {
cause: undefined,
status: 409,
code: undefined,
url: 'https://vercel-workflow.com/api/v1/runs/wrun_01KKVYQ2TNA4PCEH9MA0SHN7DV'
}

so I ensures we catch and gracefully return for these cases. I had Claude run an eval on whether this blocks any real use cases. Eval below:


Concurrent scenarios and why skipping is safe

Scenario 1: Two handlers race on run_started

Two queue messages for the same run arrive while it's still pending. Both handlers call world.runs.get(), see pending, and try to create a run_started event.

Handler A: runs.get() → pending → events.create(run_started) → ✅ succeeds → continues replay loop
Handler B: runs.get() → pending → events.create(run_started) → ❌ 409 → returns early

Why it's safe: Handler A transitions the run to running and enters the replay loop. The replay loop either completes the workflow or suspends it with queued continuations. Handler B's early exit is a no-op — Handler A guarantees progress.

Location:runtime.ts catch block after run_started event creation.

Scenario 2: Two handlers race on run_completed

Two concurrent replay loops both reach the end of the workflow and try to create run_completed.

Handler A: events.create(run_completed) → ✅ succeeds → returns
Handler B: events.create(run_completed) → ❌ 409 → logs info → returns

Why it's safe: The run is completed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_completed event creation.

Scenario 3: Two handlers race on run_failed

Same as Scenario 2 but for failure. Both handlers detect an error in user code and try to fail the run.

Handler A: events.create(run_failed) → ✅ succeeds → returns
Handler B: events.create(run_failed) → ❌ 409 → logs info → returns

Why it's safe: The run is failed. Both handlers return. No continuation is needed.

Location:runtime.ts catch block after run_failed event creation.

Scenario 4: Run completes while another handler creates hooks

Handler A completes the workflow. Handler B (from an earlier queue message) is still in the suspension handler creating hook events.

Handler A: events.create(run_completed) → ✅ run is now terminal
Handler B: events.create(hook_created) → ❌ 409 (run terminal) → logs info, continues
→ returns from handleSuspension with pendingSteps
→ tries to execute inline step
→ events.create(step_started) → ❌ 410 (run gone) → returns { type: 'gone' }
→ caller returns

Why it's safe: Handler A already completed the workflow. Handler B's hook creation fails, and if any steps were queued, the step executor receives 410 on step_started and exits gracefully. The 410 on step_started is the safety net — even if the suspension handler returns pending steps after a 409, the step executor won't make progress on a finished run.

Location:suspension-handler.ts catch blocks for hook_created and hook_disposed; step-executor.ts 410 handling on step_started.

Scenario 5: Two handlers race on wait_completed

During the replay loop, both handlers see an elapsed wait and try to complete it.

Handler A: events.create(wait_completed) → ✅ succeeds → adds event to cache → continues replay
Handler B: events.create(wait_completed) → ❌ 409 → continue (skip this wait) → continues replay

Why it's safe: Both handlers continue their replay loops. The event log is the same for both (the winning handler's wait_completed is visible to future reads). Subsequent replay from either handler converges to the same state because replay is deterministic and event-sourced.

Location:runtime.ts wait completion loop with continue on 409.

Scenario 6: Two handlers race on step_completed

Two handlers execute the same step concurrently (e.g., both received the step's queue message). Both finish execution and try to create step_completed.

Handler A: events.create(step_completed) → ✅ succeeds → queues workflow continuation → returns
Handler B: events.create(step_completed) → ❌ 409 → returns WITHOUT queuing continuation

Why it's safe: Handler A queues the workflow continuation. Handler B does not — this is correct because only one continuation should be queued per step completion. If both queued, there would be redundant replay (which is safe but wasteful).

Location:step-executor.ts catch on step_completed event creation.

Scenario 7: Two handlers race on step_started

Two handlers try to start the same step. Handler A wins; Handler B gets 409 because the step transitioned to a terminal state.

Handler A: events.create(step_started) → ✅ succeeds → executes step → queues continuation
Handler B: events.create(step_started) → ❌ 409 (step terminal) → returns { type: 'skipped' }
→ caller queues workflow continuation (runtime.ts replay loop)

Why it's safe: Both handlers ensure workflow continuation — Handler A via step completion, Handler B via the replay loop re-queuing the workflow. The redundant replay is safe because event-sourced replay is convergent.

Location:step-executor.ts 409 handling on step_started.

Scenario 8: step_created/wait_created duplicate

During suspension handling, two concurrent replays both try to create the same step or wait event.

Handler A: events.create(step_created) → ✅ succeeds
Handler B: events.create(step_created) → ❌ 409 → logs info → continues

Why it's safe: The step/wait entity already exists. The suspension handler continues processing other items. The step will be executed by whichever handler picks it up from the queue.

Location:suspension-handler.ts catch blocks for step_created and wait_created.

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@vercel

vercelBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9668d09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch
@workflow/aiPatch

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-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.038s (-15.7% 🟢)1.005s (~)0.968s101.00x
💻 LocalNitro0.046s (+6.7% 🔺)1.006s (~)0.959s101.23x
💻 LocalNext.js (Turbopack)0.051s1.006s0.955s101.36x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.951s101.44x
🐘 PostgresNitro0.059s (-4.7%)1.011s (~)0.952s101.56x
🐘 PostgresExpress0.059s (-14.8% 🟢)1.011s (~)0.952s101.57x
🌐 MongoDBNext.js (Turbopack)0.079s1.008s0.929s102.11x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.465s (-33.5% 🟢)2.036s (-22.7% 🟢)1.571s101.00x
▲ VercelExpress0.504s (-20.0% 🟢)2.286s (-14.4% 🟢)1.781s101.08x
▲ VercelNext.js (Turbopack)0.511s (-17.6% 🟢)2.559s (+13.2% 🔺)2.049s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.093s (-3.3%)2.006s (~)0.912s101.00x
🌐 RedisNext.js (Turbopack)1.122s2.006s0.885s101.03x
💻 LocalNitro1.130s (~)2.006s (~)0.877s101.03x
💻 LocalNext.js (Turbopack)1.130s2.006s0.876s101.03x
🐘 PostgresExpress1.153s (+0.7%)2.014s (~)0.860s101.05x
🐘 PostgresNitro1.158s (+1.1%)2.012s (~)0.855s101.06x
🌐 MongoDBNext.js (Turbopack)1.307s2.008s0.700s101.20x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.040s (-3.0%)3.224s (-4.4%)1.184s101.00x
▲ VercelExpress2.053s (+0.9%)3.735s (+12.4% 🔺)1.682s101.01x
▲ VercelNext.js (Turbopack)2.168s (-2.0%)3.924s (+13.8% 🔺)1.756s101.06x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.615s (-2.8%)11.023s (~)0.408s31.00x
🌐 RedisNext.js (Turbopack)10.784s11.023s0.239s31.02x
💻 LocalNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNitro10.927s (~)11.042s (~)0.115s31.03x
🐘 PostgresExpress10.970s (~)11.375s (~)0.405s31.03x
💻 LocalNitro10.976s (+0.8%)11.024s (~)0.048s31.03x
🌐 MongoDBNext.js (Turbopack)12.203s13.015s0.812s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.779s (-7.4% 🟢)18.655s (-5.6% 🟢)1.876s21.00x
▲ VercelNitro16.868s (+1.3%)18.197s (-1.3%)1.329s21.01x
▲ VercelNext.js (Turbopack)17.826s (+0.9%)19.468s (+1.2%)1.641s21.06x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.743s (-3.1%)27.051s (-3.6%)0.308s31.00x
🌐 RedisNext.js (Turbopack)26.760s27.049s0.289s31.00x
💻 LocalNext.js (Turbopack)27.128s28.053s0.925s31.01x
🐘 PostgresExpress27.240s (~)28.066s (~)0.826s31.02x
🐘 PostgresNitro27.277s (~)28.065s (~)0.788s31.02x
💻 LocalNitro27.583s (~)28.053s (~)0.470s31.03x
🌐 MongoDBNext.js (Turbopack)30.482s31.045s0.564s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro46.028s (+2.9%)47.737s (+4.3%)1.709s21.00x
▲ VercelNext.js (Turbopack)50.377s (+6.6% 🔺)52.253s (+8.0% 🔺)1.877s21.09x
▲ VercelExpress53.606s (+21.0% 🔺)55.319s (+22.1% 🔺)1.713s21.16x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.541s54.093s0.552s21.00x
🐘 PostgresExpress54.300s (~)55.094s (~)0.793s21.01x
🐘 PostgresNitro54.476s (~)55.105s (~)0.629s21.02x
💻 LocalExpress54.851s (-3.3%)55.101s (-3.5%)0.250s21.02x
💻 LocalNext.js (Turbopack)55.951s56.100s0.149s21.05x
💻 LocalNitro56.657s (~)57.106s (~)0.450s21.06x
🌐 MongoDBNext.js (Turbopack)60.675s61.065s0.390s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express94.771s (-4.4%)96.975s (-4.2%)2.204s11.00x
▲ VercelNitro96.605s (~)98.384s (~)1.779s11.02x
▲ VercelNext.js (Turbopack)98.753s (-3.9%)100.796s (-2.8%)2.043s11.04x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.345s2.006s0.662s151.00x
🐘 PostgresExpress1.366s (-4.0%)2.011s (~)0.645s151.02x
💻 LocalExpress1.467s (-5.2% 🟢)2.006s (~)0.538s151.09x
💻 LocalNitro1.498s (-1.1%)2.005s (~)0.507s151.11x
💻 LocalNext.js (Turbopack)1.547s2.006s0.459s151.15x
🌐 MongoDBNext.js (Turbopack)2.146s3.009s0.863s101.60x
🐘 PostgresNext.js (Turbopack)⚠️missing----
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.312s (-4.2%)3.407s (-4.8%)1.095s91.00x
▲ VercelNext.js (Turbopack)2.641s (-1.3%)4.038s (+7.5% 🔺)1.397s81.14x
▲ VercelExpress2.648s (+5.0%)4.138s (+13.0% 🔺)1.490s81.15x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.567s3.008s0.440s101.00x
🐘 PostgresNitro2.595s (~)3.014s (~)0.419s101.01x
💻 LocalExpress2.600s (-14.1% 🟢)3.007s (-15.6% 🟢)0.407s101.01x
🐘 PostgresExpress2.615s (~)3.015s (~)0.399s101.02x
💻 LocalNext.js (Turbopack)3.041s3.760s0.718s81.18x
💻 LocalNitro3.121s (+7.5% 🔺)3.565s (+11.1% 🔺)0.444s91.22x
🌐 MongoDBNext.js (Turbopack)4.747s5.179s0.432s61.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.799s (+7.7% 🔺)4.348s (+21.1% 🔺)1.550s81.00x
▲ VercelNitro3.520s (+30.2% 🔺)4.708s (+23.4% 🔺)1.188s71.26x
▲ VercelExpress3.663s (+47.9% 🔺)5.183s (+40.8% 🔺)1.520s81.31x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express4.027s (+1.4%)4.588s (+3.2%)0.561s71.00x
🐘 PostgresNitro4.032s (+0.7%)4.590s (+3.1%)0.558s71.00x
🌐 RedisNext.js (Turbopack)4.081s5.012s0.931s61.01x
💻 LocalExpress6.787s (-15.7% 🟢)7.014s (-20.1% 🟢)0.227s51.69x
💻 LocalNext.js (Turbopack)7.888s8.517s0.629s41.96x
💻 LocalNitro8.207s (-1.6%)8.521s (-5.5% 🟢)0.314s42.04x
🌐 MongoDBNext.js (Turbopack)10.067s10.684s0.617s32.50x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.520s (+44.3% 🔺)7.146s (+37.1% 🔺)1.626s51.00x
▲ VercelNitro7.009s (+153.3% 🔺)8.352s (+119.6% 🔺)1.343s41.27x
▲ VercelExpress10.371s (+264.0% 🔺)12.346s (+209.2% 🔺)1.975s31.88x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.303s2.006s0.703s151.00x
🐘 PostgresNitro1.422s (-1.3%)2.011s (~)0.589s151.09x
🐘 PostgresExpress1.442s (-1.5%)2.011s (-3.2%)0.570s151.11x
💻 LocalExpress1.477s (-2.9%)2.005s (~)0.528s151.13x
💻 LocalNitro1.523s (-1.1%)2.006s (~)0.483s151.17x
💻 LocalNext.js (Turbopack)1.564s2.073s0.509s151.20x
🌐 MongoDBNext.js (Turbopack)2.174s3.009s0.835s101.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.131s (-0.9%)3.290s (-1.5%)1.159s101.00x
▲ VercelNext.js (Turbopack)2.268s (-27.5% 🟢)3.823s (-24.1% 🟢)1.555s81.06x
▲ VercelExpress2.591s (+17.2% 🔺)4.029s (+17.2% 🔺)1.438s81.22x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.526s (-3.2%)3.012s (~)0.486s101.00x
🌐 RedisNext.js (Turbopack)2.532s3.008s0.477s101.00x
🐘 PostgresNitro2.730s (+7.4% 🔺)3.015s (~)0.285s101.08x
💻 LocalExpress2.797s (-9.8% 🟢)3.108s (-17.3% 🟢)0.311s101.11x
💻 LocalNext.js (Turbopack)3.030s3.760s0.729s81.20x
💻 LocalNitro3.124s (-1.8%)3.886s (~)0.762s81.24x
🌐 MongoDBNext.js (Turbopack)4.728s5.177s0.449s61.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.270s (-29.0% 🟢)3.269s (-37.5% 🟢)0.998s101.00x
▲ VercelExpress2.378s (-32.1% 🟢)3.827s (-17.2% 🟢)1.449s81.05x
▲ VercelNext.js (Turbopack)3.093s (-5.5% 🟢)4.610s (~)1.517s71.36x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.975s (-3.5%)4.590s (~)0.615s71.00x
🐘 PostgresExpress4.039s (+2.3%)4.590s (+3.2%)0.551s71.02x
🌐 RedisNext.js (Turbopack)4.198s4.725s0.527s71.06x
💻 LocalExpress7.733s (-14.1% 🟢)8.267s (-10.8% 🟢)0.533s41.95x
💻 LocalNext.js (Turbopack)8.255s8.766s0.512s42.08x
💻 LocalNitro8.519s (+0.8%)9.275s (+2.8%)0.756s42.14x
🌐 MongoDBNext.js (Turbopack)10.032s10.680s0.648s32.52x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (-27.3% 🟢)3.647s (-28.7% 🟢)0.923s91.00x
▲ VercelNext.js (Turbopack)3.571s (-3.3%)5.369s (+9.7% 🔺)1.798s61.31x
▲ VercelExpress3.789s (+1.4%)5.100s (-0.7%)1.311s61.39x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.138s (-32.2% 🟢)1.003s (~)0.009s (-21.6% 🟢)1.015s (~)0.877s101.00x
💻 LocalNext.js (Turbopack)0.170s1.002s0.011s1.017s0.847s101.24x
🌐 RedisNext.js (Turbopack)0.182s1.000s0.002s1.007s0.825s101.33x
💻 LocalNitro0.212s (+7.3% 🔺)1.003s (~)0.011s (-2.7%)1.017s (~)0.804s101.54x
🐘 PostgresExpress0.215s (+2.8%)0.996s (~)0.002s (+15.4% 🔺)1.013s (~)0.797s101.57x
🐘 PostgresNitro0.246s (+9.4% 🔺)0.993s (~)0.002s (+41.7% 🔺)1.014s (~)0.767s101.79x
🌐 MongoDBNext.js (Turbopack)0.474s0.979s0.002s1.009s0.534s103.45x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.606s (+1.9%)2.405s (-8.7% 🟢)0.006s (-26.2% 🟢)3.035s (-2.2%)1.429s101.00x
▲ VercelNitro1.658s (+1.2%)2.506s (-14.3% 🟢)0.504s (+8896.4% 🔺)3.490s (+1.5%)1.833s101.03x
▲ VercelNext.js (Turbopack)1.785s (-4.5%)3.025s (+6.5% 🔺)0.011s (+160.5% 🔺)3.640s (+6.9% 🔺)1.855s101.11x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresExpress7/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local6/12
Next.js (Turbopack)🌐 Redis9/12
Nitro🐘 Postgres6/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

(err.status === 409 || err.status === 410)
) {
runtimeLogger.info(
'Run already finished during setup, skipping',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Run already finished during setup, skipping',
'Run already finished during setup, skipping replay',

maybe this would be clearer to the user? (assuming the codepath is only for run replays)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or "skipping redundant workflow execution"

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

human: LGTM! great detailed state check and ty for posting that on github PR review comment

@VaguelySerious
VaguelySerious merged commit 2cc42cb into mainMar 18, 2026
166 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/uncaught-409 branch March 18, 2026 00:50
@ghostghost mentioned this pull request Mar 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp