Skip to content

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

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

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

Conversation

@VaguelySerious
Copy link
Member

@VaguelySerious VaguelySerious commented Mar 17, 2026

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
Copy link
Contributor

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Mar 17, 2026 5:00pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Mar 17, 2026 5:00pm
example-workflow Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workbench-astro-workflow Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workbench-express-workflow Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workbench-fastify-workflow Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workbench-hono-workflow Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workbench-nitro-workflow Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workbench-nuxt-workflow Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workbench-vite-workflow Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Mar 17, 2026 5:00pm
workflow-nest Ready Ready Preview, Comment Mar 17, 2026 5:00pm
workflow-swc-playground Ready Ready Preview, Comment Mar 17, 2026 5:00pm

@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2026

🦋 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
Name Type
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
workflow Patch
@workflow/world-testing Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt Patch
@workflow/ai Patch

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
Copy link
Contributor

github-actions bot commented Mar 17, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 747 0 67 814
✅ 💻 Local Development 770 0 118 888
✅ 📦 Local Production 770 0 118 888
✅ 🐘 Local Postgres 770 0 118 888
✅ 🪟 Windows 71 0 3 74
❌ 🌍 Community Worlds 116 55 15 186
✅ 📋 Other 195 0 27 222
Total 3439 55 466 3960

❌ 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
App Passed Failed Skipped
✅ astro 67 0 7
✅ example 67 0 7
✅ express 67 0 7
✅ fastify 67 0 7
✅ hono 67 0 7
✅ nextjs-turbopack 72 0 2
✅ nextjs-webpack 72 0 2
✅ nitro 67 0 7
✅ nuxt 67 0 7
✅ sveltekit 67 0 7
✅ vite 67 0 7
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 65 0 9
✅ express-stable 65 0 9
✅ fastify-stable 65 0 9
✅ hono-stable 65 0 9
✅ nextjs-turbopack-canary 54 0 20
✅ nextjs-turbopack-stable 71 0 3
✅ nextjs-webpack-canary 54 0 20
✅ nextjs-webpack-stable 71 0 3
✅ nitro-stable 65 0 9
✅ nuxt-stable 65 0 9
✅ sveltekit-stable 65 0 9
✅ vite-stable 65 0 9
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 65 0 9
✅ express-stable 65 0 9
✅ fastify-stable 65 0 9
✅ hono-stable 65 0 9
✅ nextjs-turbopack-canary 54 0 20
✅ nextjs-turbopack-stable 71 0 3
✅ nextjs-webpack-canary 54 0 20
✅ nextjs-webpack-stable 71 0 3
✅ nitro-stable 65 0 9
✅ nuxt-stable 65 0 9
✅ sveltekit-stable 65 0 9
✅ vite-stable 65 0 9
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 65 0 9
✅ express-stable 65 0 9
✅ fastify-stable 65 0 9
✅ hono-stable 65 0 9
✅ nextjs-turbopack-canary 54 0 20
✅ nextjs-turbopack-stable 71 0 3
✅ nextjs-webpack-canary 54 0 20
✅ nextjs-webpack-stable 71 0 3
✅ nitro-stable 65 0 9
✅ nuxt-stable 65 0 9
✅ sveltekit-stable 65 0 9
✅ vite-stable 65 0 9
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 71 0 3
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 2
❌ mongodb 51 3 3
✅ redis-dev 3 0 2
❌ redis 52 2 3
✅ turso-dev 3 0 2
❌ turso 4 50 3
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 65 0 9
✅ e2e-local-postgres-nest-stable 65 0 9
✅ e2e-local-prod-nest-stable 65 0 9

📋 View full workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.038s (-15.7% 🟢) 1.005s (~) 0.968s 10 1.00x
💻 Local Nitro 0.046s (+6.7% 🔺) 1.006s (~) 0.959s 10 1.23x
💻 Local Next.js (Turbopack) 0.051s 1.006s 0.955s 10 1.36x
🌐 Redis Next.js (Turbopack) 0.054s 1.005s 0.951s 10 1.44x
🐘 Postgres Nitro 0.059s (-4.7%) 1.011s (~) 0.952s 10 1.56x
🐘 Postgres Express 0.059s (-14.8% 🟢) 1.011s (~) 0.952s 10 1.57x
🌐 MongoDB Next.js (Turbopack) 0.079s 1.008s 0.929s 10 2.11x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.465s (-33.5% 🟢) 2.036s (-22.7% 🟢) 1.571s 10 1.00x
▲ Vercel Express 0.504s (-20.0% 🟢) 2.286s (-14.4% 🟢) 1.781s 10 1.08x
▲ Vercel Next.js (Turbopack) 0.511s (-17.6% 🟢) 2.559s (+13.2% 🔺) 2.049s 10 1.10x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.093s (-3.3%) 2.006s (~) 0.912s 10 1.00x
🌐 Redis Next.js (Turbopack) 1.122s 2.006s 0.885s 10 1.03x
💻 Local Nitro 1.130s (~) 2.006s (~) 0.877s 10 1.03x
💻 Local Next.js (Turbopack) 1.130s 2.006s 0.876s 10 1.03x
🐘 Postgres Express 1.153s (+0.7%) 2.014s (~) 0.860s 10 1.05x
🐘 Postgres Nitro 1.158s (+1.1%) 2.012s (~) 0.855s 10 1.06x
🌐 MongoDB Next.js (Turbopack) 1.307s 2.008s 0.700s 10 1.20x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.040s (-3.0%) 3.224s (-4.4%) 1.184s 10 1.00x
▲ Vercel Express 2.053s (+0.9%) 3.735s (+12.4% 🔺) 1.682s 10 1.01x
▲ Vercel Next.js (Turbopack) 2.168s (-2.0%) 3.924s (+13.8% 🔺) 1.756s 10 1.06x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 10.615s (-2.8%) 11.023s (~) 0.408s 3 1.00x
🌐 Redis Next.js (Turbopack) 10.784s 11.023s 0.239s 3 1.02x
💻 Local Next.js (Turbopack) 10.812s 11.023s 0.211s 3 1.02x
🐘 Postgres Nitro 10.927s (~) 11.042s (~) 0.115s 3 1.03x
🐘 Postgres Express 10.970s (~) 11.375s (~) 0.405s 3 1.03x
💻 Local Nitro 10.976s (+0.8%) 11.024s (~) 0.048s 3 1.03x
🌐 MongoDB Next.js (Turbopack) 12.203s 13.015s 0.812s 3 1.15x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 16.779s (-7.4% 🟢) 18.655s (-5.6% 🟢) 1.876s 2 1.00x
▲ Vercel Nitro 16.868s (+1.3%) 18.197s (-1.3%) 1.329s 2 1.01x
▲ Vercel Next.js (Turbopack) 17.826s (+0.9%) 19.468s (+1.2%) 1.641s 2 1.06x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 26.743s (-3.1%) 27.051s (-3.6%) 0.308s 3 1.00x
🌐 Redis Next.js (Turbopack) 26.760s 27.049s 0.289s 3 1.00x
💻 Local Next.js (Turbopack) 27.128s 28.053s 0.925s 3 1.01x
🐘 Postgres Express 27.240s (~) 28.066s (~) 0.826s 3 1.02x
🐘 Postgres Nitro 27.277s (~) 28.065s (~) 0.788s 3 1.02x
💻 Local Nitro 27.583s (~) 28.053s (~) 0.470s 3 1.03x
🌐 MongoDB Next.js (Turbopack) 30.482s 31.045s 0.564s 2 1.14x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 46.028s (+2.9%) 47.737s (+4.3%) 1.709s 2 1.00x
▲ Vercel Next.js (Turbopack) 50.377s (+6.6% 🔺) 52.253s (+8.0% 🔺) 1.877s 2 1.09x
▲ Vercel Express 53.606s (+21.0% 🔺) 55.319s (+22.1% 🔺) 1.713s 2 1.16x

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

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 53.541s 54.093s 0.552s 2 1.00x
🐘 Postgres Express 54.300s (~) 55.094s (~) 0.793s 2 1.01x
🐘 Postgres Nitro 54.476s (~) 55.105s (~) 0.629s 2 1.02x
💻 Local Express 54.851s (-3.3%) 55.101s (-3.5%) 0.250s 2 1.02x
💻 Local Next.js (Turbopack) 55.951s 56.100s 0.149s 2 1.05x
💻 Local Nitro 56.657s (~) 57.106s (~) 0.450s 2 1.06x
🌐 MongoDB Next.js (Turbopack) 60.675s 61.065s 0.390s 2 1.13x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 94.771s (-4.4%) 96.975s (-4.2%) 2.204s 1 1.00x
▲ Vercel Nitro 96.605s (~) 98.384s (~) 1.779s 1 1.02x
▲ Vercel Next.js (Turbopack) 98.753s (-3.9%) 100.796s (-2.8%) 2.043s 1 1.04x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.345s 2.006s 0.662s 15 1.00x
🐘 Postgres Express 1.366s (-4.0%) 2.011s (~) 0.645s 15 1.02x
💻 Local Express 1.467s (-5.2% 🟢) 2.006s (~) 0.538s 15 1.09x
💻 Local Nitro 1.498s (-1.1%) 2.005s (~) 0.507s 15 1.11x
💻 Local Next.js (Turbopack) 1.547s 2.006s 0.459s 15 1.15x
🌐 MongoDB Next.js (Turbopack) 2.146s 3.009s 0.863s 10 1.60x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Nitro ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.312s (-4.2%) 3.407s (-4.8%) 1.095s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.641s (-1.3%) 4.038s (+7.5% 🔺) 1.397s 8 1.14x
▲ Vercel Express 2.648s (+5.0%) 4.138s (+13.0% 🔺) 1.490s 8 1.15x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 2.567s 3.008s 0.440s 10 1.00x
🐘 Postgres Nitro 2.595s (~) 3.014s (~) 0.419s 10 1.01x
💻 Local Express 2.600s (-14.1% 🟢) 3.007s (-15.6% 🟢) 0.407s 10 1.01x
🐘 Postgres Express 2.615s (~) 3.015s (~) 0.399s 10 1.02x
💻 Local Next.js (Turbopack) 3.041s 3.760s 0.718s 8 1.18x
💻 Local Nitro 3.121s (+7.5% 🔺) 3.565s (+11.1% 🔺) 0.444s 9 1.22x
🌐 MongoDB Next.js (Turbopack) 4.747s 5.179s 0.432s 6 1.85x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.799s (+7.7% 🔺) 4.348s (+21.1% 🔺) 1.550s 8 1.00x
▲ Vercel Nitro 3.520s (+30.2% 🔺) 4.708s (+23.4% 🔺) 1.188s 7 1.26x
▲ Vercel Express 3.663s (+47.9% 🔺) 5.183s (+40.8% 🔺) 1.520s 8 1.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 4.027s (+1.4%) 4.588s (+3.2%) 0.561s 7 1.00x
🐘 Postgres Nitro 4.032s (+0.7%) 4.590s (+3.1%) 0.558s 7 1.00x
🌐 Redis Next.js (Turbopack) 4.081s 5.012s 0.931s 6 1.01x
💻 Local Express 6.787s (-15.7% 🟢) 7.014s (-20.1% 🟢) 0.227s 5 1.69x
💻 Local Next.js (Turbopack) 7.888s 8.517s 0.629s 4 1.96x
💻 Local Nitro 8.207s (-1.6%) 8.521s (-5.5% 🟢) 0.314s 4 2.04x
🌐 MongoDB Next.js (Turbopack) 10.067s 10.684s 0.617s 3 2.50x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 5.520s (+44.3% 🔺) 7.146s (+37.1% 🔺) 1.626s 5 1.00x
▲ Vercel Nitro 7.009s (+153.3% 🔺) 8.352s (+119.6% 🔺) 1.343s 4 1.27x
▲ Vercel Express 10.371s (+264.0% 🔺) 12.346s (+209.2% 🔺) 1.975s 3 1.88x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.303s 2.006s 0.703s 15 1.00x
🐘 Postgres Nitro 1.422s (-1.3%) 2.011s (~) 0.589s 15 1.09x
🐘 Postgres Express 1.442s (-1.5%) 2.011s (-3.2%) 0.570s 15 1.11x
💻 Local Express 1.477s (-2.9%) 2.005s (~) 0.528s 15 1.13x
💻 Local Nitro 1.523s (-1.1%) 2.006s (~) 0.483s 15 1.17x
💻 Local Next.js (Turbopack) 1.564s 2.073s 0.509s 15 1.20x
🌐 MongoDB Next.js (Turbopack) 2.174s 3.009s 0.835s 10 1.67x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.131s (-0.9%) 3.290s (-1.5%) 1.159s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.268s (-27.5% 🟢) 3.823s (-24.1% 🟢) 1.555s 8 1.06x
▲ Vercel Express 2.591s (+17.2% 🔺) 4.029s (+17.2% 🔺) 1.438s 8 1.22x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.526s (-3.2%) 3.012s (~) 0.486s 10 1.00x
🌐 Redis Next.js (Turbopack) 2.532s 3.008s 0.477s 10 1.00x
🐘 Postgres Nitro 2.730s (+7.4% 🔺) 3.015s (~) 0.285s 10 1.08x
💻 Local Express 2.797s (-9.8% 🟢) 3.108s (-17.3% 🟢) 0.311s 10 1.11x
💻 Local Next.js (Turbopack) 3.030s 3.760s 0.729s 8 1.20x
💻 Local Nitro 3.124s (-1.8%) 3.886s (~) 0.762s 8 1.24x
🌐 MongoDB Next.js (Turbopack) 4.728s 5.177s 0.449s 6 1.87x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.270s (-29.0% 🟢) 3.269s (-37.5% 🟢) 0.998s 10 1.00x
▲ Vercel Express 2.378s (-32.1% 🟢) 3.827s (-17.2% 🟢) 1.449s 8 1.05x
▲ Vercel Next.js (Turbopack) 3.093s (-5.5% 🟢) 4.610s (~) 1.517s 7 1.36x

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

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.975s (-3.5%) 4.590s (~) 0.615s 7 1.00x
🐘 Postgres Express 4.039s (+2.3%) 4.590s (+3.2%) 0.551s 7 1.02x
🌐 Redis Next.js (Turbopack) 4.198s 4.725s 0.527s 7 1.06x
💻 Local Express 7.733s (-14.1% 🟢) 8.267s (-10.8% 🟢) 0.533s 4 1.95x
💻 Local Next.js (Turbopack) 8.255s 8.766s 0.512s 4 2.08x
💻 Local Nitro 8.519s (+0.8%) 9.275s (+2.8%) 0.756s 4 2.14x
🌐 MongoDB Next.js (Turbopack) 10.032s 10.680s 0.648s 3 2.52x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.724s (-27.3% 🟢) 3.647s (-28.7% 🟢) 0.923s 9 1.00x
▲ Vercel Next.js (Turbopack) 3.571s (-3.3%) 5.369s (+9.7% 🔺) 1.798s 6 1.31x
▲ Vercel Express 3.789s (+1.4%) 5.100s (-0.7%) 1.311s 6 1.39x

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

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.138s (-32.2% 🟢) 1.003s (~) 0.009s (-21.6% 🟢) 1.015s (~) 0.877s 10 1.00x
💻 Local Next.js (Turbopack) 0.170s 1.002s 0.011s 1.017s 0.847s 10 1.24x
🌐 Redis Next.js (Turbopack) 0.182s 1.000s 0.002s 1.007s 0.825s 10 1.33x
💻 Local Nitro 0.212s (+7.3% 🔺) 1.003s (~) 0.011s (-2.7%) 1.017s (~) 0.804s 10 1.54x
🐘 Postgres Express 0.215s (+2.8%) 0.996s (~) 0.002s (+15.4% 🔺) 1.013s (~) 0.797s 10 1.57x
🐘 Postgres Nitro 0.246s (+9.4% 🔺) 0.993s (~) 0.002s (+41.7% 🔺) 1.014s (~) 0.767s 10 1.79x
🌐 MongoDB Next.js (Turbopack) 0.474s 0.979s 0.002s 1.009s 0.534s 10 3.45x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 1.606s (+1.9%) 2.405s (-8.7% 🟢) 0.006s (-26.2% 🟢) 3.035s (-2.2%) 1.429s 10 1.00x
▲ Vercel Nitro 1.658s (+1.2%) 2.506s (-14.3% 🟢) 0.504s (+8896.4% 🔺) 3.490s (+1.5%) 1.833s 10 1.03x
▲ Vercel Next.js (Turbopack) 1.785s (-4.5%) 3.025s (+6.5% 🔺) 0.011s (+160.5% 🔺) 3.640s (+6.9% 🔺) 1.855s 10 1.11x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Express 12/12
🐘 Postgres Express 7/12
▲ Vercel Nitro 7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 💻 Local 6/12
Next.js (Turbopack) 🌐 Redis 9/12
Nitro 🐘 Postgres 6/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

@VaguelySerious VaguelySerious marked this pull request as ready for review March 17, 2026 17:09
@VaguelySerious VaguelySerious requested a review from a team as a code owner March 17, 2026 17:09
(err.status === 409 || err.status === 410)
) {
runtimeLogger.info(
'Run already finished during setup, skipping',
Copy link
Collaborator

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
Collaborator

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"

Copy link
Collaborator

@pranaygp pranaygp left a comment

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 main Mar 18, 2026
166 of 169 checks passed
@VaguelySerious VaguelySerious deleted the peter/uncaught-409 branch March 18, 2026 00:50
Sign up for free to 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