Skip to content

[core] Optimistic concurrency control for event writes against stale logs#2113

Draft
VaguelySerious wants to merge 4 commits into
mainfrom
peter/sdk-event-write-cas
Draft

[core] Optimistic concurrency control for event writes against stale logs#2113
VaguelySerious wants to merge 4 commits into
mainfrom
peter/sdk-event-write-cas

Conversation

@VaguelySerious
Copy link
Copy Markdown
Member

@VaguelySerious VaguelySerious commented May 26, 2026

Summary

Adds optimistic-concurrency fencing to the event writes that go through workflow-server, closing the hook/sleep race that produces CORRUPTED_EVENT_LOG on production runs.

  • The elapsed-wait scan snapshots the loaded events' tail eventId and passes it as lastKnownEventId on each wait_completed write. If a concurrent resumeHook has already advanced the canonical log, the server's CAS rejects the write.
  • On a fence-conflict EntityConflictError, the runtime now retries in-place rather than throwing the whole tick away: it reloads events from the cursor, refreshes the fence, and tries again (up to 5x with backoff). Falling back to queue redelivery turned out to thunder-herd — every redelivery spawns another concurrent tick, which fences-conflicts again, and workflows stall in running. If the wait was completed by a concurrent writer between attempts, we observe it in the reloaded log and skip the write entirely.
  • resumeHook appends hook_received unconditionally. ULID ordering already places this write after anything committed before us, and applying CAS would only ever reject the hook in favor of an unrelated concurrent write (which would lose the user's signal). Stale-snapshot protection lives on the tick writes that consume hooks, not on the write that delivers them.
  • CreateEventParams on @workflow/world grows lastKnownEventId and asOfTimestamp (both optional). Worlds that don't implement OCC can pass them through or ignore them.

Pairs with the workflow-server PR which materializes run.lastKnownEventId and gates event writes on it. The server's CAS is explicit opt-in — unfenced writers (most paths) still atomically advance the materialized value so fenced writers can chain off it, but they don't reject on contention.

Test plan

  • All 1013 core unit tests passing
  • Typecheck clean
  • Changeset included
  • End-to-end repro against the workflow-server preview deployment: 350 hook/sleep race workflows across two cycles, 350/350 completed, zero CORRUPTED_EVENT_LOG, zero run_failed, zero fence conflicts surfaced past the retry loop

🤖 Generated with Claude Code

The elapsed-wait scan now snapshots the loaded events' tail eventId and
passes it as `lastKnownEventId` on each `wait_completed` write, so a
concurrent `resumeHook` that has already advanced the canonical log is
detected — the server's CAS rejects the write, we surface it as the
existing `EntityConflictError`, and the next iteration re-replays
against the fresh event list (mirroring the duplicate-wait fall-through
that was already there).

`resumeHook` sends `asOfTimestamp` (Date.now() at call time) so the
server resolves the fence to the highest eventId strictly before
resume time — no client-side event pre-read needed.

Plumbed through `CreateEventParams` on `@workflow/world` so future
worlds can forward as-is.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 26, 2026

🦋 Changeset detected

Latest commit: 1fca755

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

This PR includes changesets to release 20 packages
Name Type
@workflow/core Patch
@workflow/world Patch
@workflow/world-vercel Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
workflow Patch
@workflow/world-testing Patch
@workflow/world-local Patch
@workflow/world-postgres Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt 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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 26, 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 May 26, 2026 7:30pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment May 26, 2026 7:30pm
example-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workbench-astro-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workbench-express-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workbench-fastify-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workbench-hono-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workbench-nitro-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workbench-nuxt-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workbench-sveltekit-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workbench-vite-workflow Ready Ready Preview, Comment May 26, 2026 7:30pm
workflow-docs Ready Ready Preview, Comment, Open in v0 May 26, 2026 7:30pm
workflow-swc-playground Ready Ready Preview, Comment May 26, 2026 7:30pm
workflow-tarballs Ready Ready Preview, Comment May 26, 2026 7:30pm
workflow-web Ready Ready Preview, Comment May 26, 2026 7:30pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 1213 9 219 1441
✅ 💻 Local Development 1615 0 219 1834
✅ 📦 Local Production 1615 0 219 1834
✅ 🐘 Local Postgres 1615 0 219 1834
✅ 🪟 Windows 131 0 0 131
✅ 📋 Other 741 0 176 917
Total 6930 9 1052 7991

❌ Failed Tests

▲ Vercel Production (9 failed)

hono (6 failed):

  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KSJWHX7PJPPF51BSM0V3DFSF | 🔍 observability
  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KSJWJDK4T47X5595N93PX2R3 | 🔍 observability
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KSJWKJQYQB5WM0Y1QGPXC4ZM | 🔍 observability
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KSJWKQYAY7NR0EGVVNA3AM70 | 🔍 observability
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KSJWKX350D4K4XGK63B356MJ | 🔍 observability
  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

vite (3 failed):

  • outputStreamInsideStepWorkflow - getWritable() called inside step functions | wrun_01KSJW91EN3Z9EB6YZ07D4MRJH | 🔍 observability
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KSJWH6SK8V62HTSXBAF47CS5 | 🔍 observability
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KSJWHX7PJPPF51BSM0V3DFSF | 🔍 observability

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 105 0 26
✅ example 105 0 26
✅ express 105 0 26
✅ fastify 105 0 26
❌ hono 99 6 26
✅ nextjs-turbopack 129 0 2
✅ nextjs-webpack 129 0 2
✅ nitro 105 0 26
✅ nuxt 105 0 26
✅ sveltekit 124 0 7
❌ vite 102 3 26
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 106 0 25
✅ express-stable 106 0 25
✅ fastify-stable 106 0 25
✅ hono-stable 106 0 25
✅ nextjs-turbopack-canary 112 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 131 0 0
✅ nextjs-webpack-canary 112 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 131 0 0
✅ nitro-stable 106 0 25
✅ nuxt-stable 106 0 25
✅ sveltekit-stable 125 0 6
✅ vite-stable 106 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 106 0 25
✅ express-stable 106 0 25
✅ fastify-stable 106 0 25
✅ hono-stable 106 0 25
✅ nextjs-turbopack-canary 112 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 131 0 0
✅ nextjs-webpack-canary 112 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 131 0 0
✅ nitro-stable 106 0 25
✅ nuxt-stable 106 0 25
✅ sveltekit-stable 125 0 6
✅ vite-stable 106 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 106 0 25
✅ express-stable 106 0 25
✅ fastify-stable 106 0 25
✅ hono-stable 106 0 25
✅ nextjs-turbopack-canary 112 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 131 0 0
✅ nextjs-webpack-canary 112 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 131 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 131 0 0
✅ nitro-stable 106 0 25
✅ nuxt-stable 106 0 25
✅ sveltekit-stable 125 0 6
✅ vite-stable 106 0 25
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 131 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 106 0 25
✅ e2e-local-dev-tanstack-start- 106 0 25
✅ e2e-local-postgres-nest-stable 106 0 25
✅ e2e-local-postgres-tanstack-start- 106 0 25
✅ e2e-local-prod-nest-stable 106 0 25
✅ e2e-local-prod-tanstack-start- 106 0 25
✅ e2e-vercel-prod-tanstack-start 105 0 26

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 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.031s (-30.7% 🟢) 1.007s (~) 0.976s 10 1.00x
💻 Local Nitro 0.031s (-27.4% 🟢) 1.007s (~) 0.976s 10 1.02x
🐘 Postgres Express 0.049s (-16.0% 🟢) 1.013s (~) 0.965s 10 1.59x
💻 Local Next.js (Turbopack) 0.049s 1.005s 0.956s 10 1.60x
🐘 Postgres Nitro 0.049s (-48.1% 🟢) 1.012s (-3.0%) 0.963s 10 1.61x
🐘 Postgres Next.js (Turbopack) 0.060s 1.012s 0.952s 10 1.94x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 0.279s (+18.4% 🔺) 2.393s (+12.1% 🔺) 2.115s 10 1.00x
▲ Vercel Nitro 0.294s (-28.3% 🟢) 2.532s (+0.9%) 2.239s 10 1.05x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Express | Nitro

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.072s (-5.3% 🟢) 2.006s (~) 0.935s 10 1.00x
💻 Local Express 1.074s (-4.5%) 2.006s (~) 0.932s 10 1.00x
🐘 Postgres Nitro 1.082s (-5.1% 🟢) 2.010s (~) 0.928s 10 1.01x
🐘 Postgres Express 1.082s (-5.6% 🟢) 2.009s (~) 0.927s 10 1.01x
💻 Local Next.js (Turbopack) 1.112s 2.007s 0.894s 10 1.04x
🐘 Postgres Next.js (Turbopack) 1.127s 2.009s 0.882s 10 1.05x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 1.613s (-58.6% 🟢) 3.634s (-38.5% 🟢) 2.021s 10 1.00x
▲ Vercel Express 2.101s (+12.1% 🔺) 4.238s (+11.3% 🔺) 2.136s 10 1.30x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 10.399s (-4.3%) 11.017s (~) 0.618s 3 1.00x
💻 Local Express 10.413s (-4.7%) 11.022s (~) 0.608s 3 1.00x
🐘 Postgres Express 10.428s (-4.9%) 11.020s (~) 0.592s 3 1.00x
💻 Local Nitro 10.429s (-4.7%) 11.022s (~) 0.594s 3 1.00x
🐘 Postgres Next.js (Turbopack) 10.683s 11.016s 0.333s 3 1.03x
💻 Local Next.js (Turbopack) 10.698s 11.022s 0.324s 3 1.03x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 13.469s (-20.7% 🟢) 15.535s (-22.4% 🟢) 2.067s 2 1.00x
▲ Vercel Nitro 14.582s (-38.6% 🟢) 16.317s (-35.0% 🟢) 1.735s 3 1.08x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Express | Nitro

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 13.445s (-7.9% 🟢) 14.016s (-6.7% 🟢) 0.572s 5 1.00x
💻 Local Express 13.464s (-10.1% 🟢) 14.028s (-6.7% 🟢) 0.563s 5 1.00x
🐘 Postgres Express 13.472s (-7.6% 🟢) 14.015s (-6.7% 🟢) 0.543s 5 1.00x
💻 Local Nitro 13.486s (-10.5% 🟢) 14.027s (-12.5% 🟢) 0.541s 5 1.00x
💻 Local Next.js (Turbopack) 14.133s 14.828s 0.695s 5 1.05x
🐘 Postgres Next.js (Turbopack) 14.159s 15.017s 0.858s 4 1.05x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 20.304s (-68.5% 🟢) 22.626s (-66.0% 🟢) 2.322s 3 1.00x
▲ Vercel Express 21.616s (-57.0% 🟢) 23.646s (-55.0% 🟢) 2.030s 3 1.06x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 11.882s (-14.9% 🟢) 12.143s (-15.1% 🟢) 0.261s 8 1.00x
💻 Local Nitro 11.892s (-29.1% 🟢) 12.022s (-29.4% 🟢) 0.130s 8 1.00x
💻 Local Express 11.928s (-28.2% 🟢) 12.148s (-28.7% 🟢) 0.220s 8 1.00x
🐘 Postgres Express 11.930s (-14.8% 🟢) 12.143s (-16.8% 🟢) 0.213s 8 1.00x
🐘 Postgres Next.js (Turbopack) 13.048s 14.016s 0.968s 7 1.10x
💻 Local Next.js (Turbopack) 13.161s 13.884s 0.722s 7 1.11x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 30.375s (-92.8% 🟢) 32.491s (-92.3% 🟢) 2.115s 3 1.00x
▲ Vercel Express 30.913s (-74.5% 🟢) 33.384s (-73.0% 🟢) 2.471s 3 1.02x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.136s (-9.8% 🟢) 2.007s (~) 0.871s 15 1.00x
🐘 Postgres Nitro 1.139s (-10.7% 🟢) 2.006s (~) 0.868s 15 1.00x
💻 Local Express 1.165s (-21.7% 🟢) 2.006s (~) 0.841s 15 1.03x
💻 Local Nitro 1.169s (-28.4% 🟢) 2.006s (-3.3%) 0.837s 15 1.03x
🐘 Postgres Next.js (Turbopack) 1.202s 2.007s 0.806s 15 1.06x
💻 Local Next.js (Turbopack) 1.344s 2.006s 0.662s 15 1.18x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.410s (-14.5% 🟢) 3.850s (-10.9% 🟢) 1.440s 8 1.00x
▲ Vercel Express 2.683s (-6.2% 🟢) 4.473s (-3.3%) 1.789s 7 1.11x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.199s (-49.2% 🟢) 2.008s (-33.3% 🟢) 0.808s 15 1.00x
🐘 Postgres Nitro 1.210s (-48.5% 🟢) 2.008s (-33.3% 🟢) 0.798s 15 1.01x
🐘 Postgres Next.js (Turbopack) 1.340s 2.007s 0.667s 15 1.12x
💻 Local Express 1.683s (-43.0% 🟢) 2.006s (-41.9% 🟢) 0.323s 15 1.40x
💻 Local Nitro 1.753s (-44.2% 🟢) 2.006s (-48.4% 🟢) 0.253s 15 1.46x
💻 Local Next.js (Turbopack) 1.764s 2.007s 0.242s 15 1.47x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.457s (-14.7% 🟢) 5.447s (-8.0% 🟢) 1.990s 6 1.00x
▲ Vercel Express 4.630s (+27.9% 🔺) 6.398s (+25.2% 🔺) 1.768s 5 1.34x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.322s (-62.0% 🟢) 2.008s (-49.9% 🟢) 0.686s 15 1.00x
🐘 Postgres Express 1.323s (-62.0% 🟢) 2.009s (-49.9% 🟢) 0.685s 15 1.00x
🐘 Postgres Next.js (Turbopack) 1.602s 2.007s 0.405s 15 1.21x
💻 Local Next.js (Turbopack) 4.629s 5.347s 0.718s 6 3.50x
💻 Local Express 4.743s (-43.1% 🟢) 5.344s (-40.8% 🟢) 0.600s 6 3.59x
💻 Local Nitro 5.169s (-38.1% 🟢) 5.512s (-38.9% 🟢) 0.343s 6 3.91x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 6.196s (+46.1% 🔺) 8.051s (+31.4% 🔺) 1.855s 4 1.00x
▲ Vercel Nitro 233.176s (+6514.3% 🔺) 235.105s (+4148.5% 🔺) 1.929s 4 37.64x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.147s (-8.8% 🟢) 2.009s (~) 0.862s 15 1.00x
🐘 Postgres Express 1.150s (-8.5% 🟢) 2.008s (~) 0.858s 15 1.00x
🐘 Postgres Next.js (Turbopack) 1.201s 2.009s 0.808s 15 1.05x
💻 Local Next.js (Turbopack) 1.320s 2.006s 0.686s 15 1.15x
💻 Local Express 1.411s (-25.5% 🟢) 2.006s (-15.1% 🟢) 0.595s 15 1.23x
💻 Local Nitro 1.799s (-3.6%) 2.392s (+2.2%) 0.593s 13 1.57x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.456s (-4.8%) 3.765s (-13.4% 🟢) 1.309s 8 1.00x
▲ Vercel Nitro 2.738s (+11.4% 🔺) 4.119s (-1.2%) 1.380s 8 1.11x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Express | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.204s (-48.5% 🟢) 2.009s (-33.3% 🟢) 0.805s 15 1.00x
🐘 Postgres Express 1.216s (-48.1% 🟢) 2.008s (-33.3% 🟢) 0.792s 15 1.01x
🐘 Postgres Next.js (Turbopack) 1.344s 2.007s 0.663s 15 1.12x
💻 Local Express 1.991s (-36.4% 🟢) 2.470s (-34.4% 🟢) 0.478s 13 1.65x
💻 Local Next.js (Turbopack) 1.995s 2.507s 0.512s 12 1.66x
💻 Local Nitro 2.060s (-32.8% 🟢) 2.508s (-35.5% 🟢) 0.448s 12 1.71x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.427s (+7.3% 🔺) 5.153s (+7.5% 🔺) 1.726s 6 1.00x
▲ Vercel Nitro 3.466s (+7.2% 🔺) 5.299s (+4.4%) 1.832s 6 1.01x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Express | Nitro

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.305s (-62.5% 🟢) 2.007s (-49.9% 🟢) 0.703s 15 1.00x
🐘 Postgres Express 1.397s (-60.1% 🟢) 2.077s (-48.2% 🟢) 0.680s 15 1.07x
🐘 Postgres Next.js (Turbopack) 1.605s 2.008s 0.403s 15 1.23x
💻 Local Next.js (Turbopack) 5.456s 5.848s 0.392s 6 4.18x
💻 Local Express 5.566s (-36.8% 🟢) 6.013s (-35.1% 🟢) 0.447s 5 4.27x
💻 Local Nitro 6.097s (-33.3% 🟢) 6.612s (-34.0% 🟢) 0.516s 5 4.67x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.170s (+1.5%) 6.888s (+1.0%) 1.717s 5 1.00x
▲ Vercel Express 9.371s (+46.0% 🔺) 11.989s (+46.6% 🔺) 2.618s 3 1.81x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.456s (-45.7% 🟢) 1.007s (-1.6%) 0.551s 60 1.00x
🐘 Postgres Nitro 0.457s (-44.3% 🟢) 1.007s (~) 0.550s 60 1.00x
💻 Local Express 0.469s (-52.3% 🟢) 1.004s (-6.7% 🟢) 0.535s 60 1.03x
💻 Local Nitro 0.471s (-51.9% 🟢) 1.004s (-8.2% 🟢) 0.532s 60 1.03x
🐘 Postgres Next.js (Turbopack) 0.685s 1.006s 0.321s 60 1.50x
💻 Local Next.js (Turbopack) 0.753s 1.005s 0.252s 60 1.65x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 4.626s (-79.0% 🟢) 6.254s (-74.0% 🟢) 1.627s 10 1.00x
▲ Vercel Express 5.589s (-70.6% 🟢) 7.324s (-65.7% 🟢) 1.734s 9 1.21x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.023s (-48.2% 🟢) 1.458s (-35.4% 🟢) 0.435s 62 1.00x
🐘 Postgres Nitro 1.061s (-44.9% 🟢) 1.614s (-23.2% 🟢) 0.553s 56 1.04x
💻 Local Nitro 1.196s (-60.6% 🟢) 2.006s (-46.6% 🟢) 0.810s 45 1.17x
💻 Local Express 1.205s (-60.1% 🟢) 2.006s (-44.1% 🟢) 0.801s 45 1.18x
🐘 Postgres Next.js (Turbopack) 1.589s 2.008s 0.418s 45 1.55x
💻 Local Next.js (Turbopack) 1.865s 2.028s 0.163s 45 1.82x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 11.589s (-70.6% 🟢) 13.836s (-66.5% 🟢) 2.247s 7 1.00x
▲ Vercel Express 11.763s (-65.9% 🟢) 13.897s (-62.2% 🟢) 2.134s 7 1.02x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.033s (-49.1% 🟢) 2.447s (-44.0% 🟢) 0.415s 50 1.00x
🐘 Postgres Nitro 2.078s (-49.4% 🟢) 2.616s (-43.2% 🟢) 0.539s 46 1.02x
💻 Local Express 2.733s (-70.3% 🟢) 3.033s (-69.7% 🟢) 0.300s 40 1.34x
💻 Local Nitro 2.742s (-70.5% 🟢) 3.008s (-70.0% 🟢) 0.265s 40 1.35x
🐘 Postgres Next.js (Turbopack) 3.119s 4.009s 0.890s 30 1.53x
💻 Local Next.js (Turbopack) 3.918s 4.180s 0.262s 29 1.93x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 23.686s (-75.6% 🟢) 26.227s (-73.4% 🟢) 2.541s 5 1.00x
▲ Vercel Express 30.068s (-76.9% 🟢) 32.276s (-75.6% 🟢) 2.208s 4 1.27x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.166s (-41.5% 🟢) 1.006s (~) 0.840s 60 1.00x
🐘 Postgres Express 0.199s (-29.6% 🟢) 1.006s (~) 0.807s 60 1.20x
🐘 Postgres Next.js (Turbopack) 0.226s 1.006s 0.779s 60 1.37x
💻 Local Nitro 0.390s (-35.6% 🟢) 1.004s (-1.7%) 0.615s 60 2.35x
💻 Local Express 0.426s (-24.0% 🟢) 1.004s (~) 0.578s 60 2.57x
💻 Local Next.js (Turbopack) 0.556s 1.004s 0.449s 60 3.35x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.103s (+7.6% 🔺) 3.935s (+8.2% 🔺) 1.831s 16 1.00x
▲ Vercel Nitro 2.158s (+29.9% 🔺) 3.926s (+17.2% 🔺) 1.768s 16 1.03x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.294s (-42.3% 🟢) 1.006s (~) 0.712s 90 1.00x
🐘 Postgres Nitro 0.299s (-39.8% 🟢) 1.006s (~) 0.707s 90 1.02x
🐘 Postgres Next.js (Turbopack) 0.433s 1.006s 0.573s 90 1.47x
💻 Local Nitro 2.185s (-13.9% 🟢) 2.912s (-3.2%) 0.727s 31 7.43x
💻 Local Express 2.192s (-12.8% 🟢) 2.912s (-3.2%) 0.721s 31 7.45x
💻 Local Next.js (Turbopack) 2.503s 3.148s 0.645s 29 8.51x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.202s (+61.3% 🔺) 7.174s (+48.8% 🔺) 1.973s 13 1.00x
▲ Vercel Express 5.278s (+73.2% 🔺) 6.959s (+44.8% 🔺) 1.681s 13 1.01x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.611s (-25.4% 🟢) 1.006s (-1.1%) 0.396s 120 1.00x
🐘 Postgres Nitro 0.630s (-20.2% 🟢) 1.006s (~) 0.376s 120 1.03x
🐘 Postgres Next.js (Turbopack) 0.907s 1.098s 0.191s 110 1.48x
💻 Local Nitro 10.154s (-9.3% 🟢) 10.864s (-6.9% 🟢) 0.710s 12 16.63x
💻 Local Express 10.253s (-8.4% 🟢) 10.860s (-9.0% 🟢) 0.608s 12 16.79x
💻 Local Next.js (Turbopack) 11.316s 12.028s 0.712s 10 18.53x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 13.127s (+70.0% 🔺) 15.228s (+62.0% 🔺) 2.101s 8 1.00x
▲ Vercel Express 13.399s (+80.6% 🔺) 15.406s (+66.7% 🔺) 2.007s 8 1.02x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - -

🔍 Observability: Nitro | Express

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.129s (+450.7% 🔺) 2.001s (+100.2% 🔺) 0.001s (-26.7% 🟢) 2.011s (+98.9% 🔺) 0.882s 10 1.00x
💻 Local Express 1.131s (+468.3% 🔺) 2.005s (+99.6% 🔺) 0.010s (-14.9% 🟢) 2.018s (+98.2% 🔺) 0.887s 10 1.00x
💻 Local Nitro 1.132s (+429.6% 🔺) 2.005s (+99.6% 🔺) 0.012s (-2.4%) 2.019s (+98.2% 🔺) 0.887s 10 1.00x
🐘 Postgres Express 1.144s (+457.7% 🔺) 2.000s (+100.3% 🔺) 0.001s (-37.5% 🟢) 2.010s (+98.7% 🔺) 0.866s 10 1.01x
🐘 Postgres Next.js (Turbopack) 1.197s 2.002s 0.001s 2.011s 0.813s 10 1.06x
💻 Local Next.js (Turbopack) 1.198s 2.005s 0.010s 2.019s 0.821s 10 1.06x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.168s (-43.4% 🟢) 3.405s (-35.5% 🟢) 13.915s (+1775.1% 🔺) 17.829s (+175.0% 🔺) 15.661s 10 1.00x
▲ Vercel Express 2.251s (-10.1% 🟢) 3.465s (-15.3% 🟢) 2.151s (+123.8% 🔺) 6.098s (+9.1% 🔺) 3.847s 10 1.04x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - - -

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.518s (+140.9% 🔺) 2.000s (+98.7% 🔺) 0.004s (+7.9% 🔺) 2.026s (+98.1% 🔺) 0.508s 30 1.00x
🐘 Postgres Nitro 1.521s (+143.7% 🔺) 2.003s (+99.0% 🔺) 0.004s (-4.1%) 2.028s (+98.3% 🔺) 0.507s 30 1.00x
💻 Local Express 1.532s (+102.3% 🔺) 2.011s (+95.5% 🔺) 0.011s (+13.3% 🔺) 2.024s (+94.6% 🔺) 0.492s 30 1.01x
🐘 Postgres Next.js (Turbopack) 1.661s 2.010s 0.004s 2.024s 0.363s 30 1.09x
💻 Local Nitro 1.945s (+131.9% 🔺) 2.011s (+98.7% 🔺) 0.010s (+2.5%) 2.424s (+117.2% 🔺) 0.479s 25 1.28x
💻 Local Next.js (Turbopack) 2.083s 2.009s 0.009s 2.423s 0.340s 25 1.37x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.781s (-80.4% 🟢) 7.251s (-76.5% 🟢) 0.257s (+129.1% 🔺) 8.008s (-74.8% 🟢) 2.227s 8 1.00x
▲ Vercel Express 5.939s (-8.7% 🟢) 7.322s (-8.6% 🟢) 0.404s (-1.1%) 8.263s (-6.5% 🟢) 2.325s 8 1.03x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - - -

🔍 Observability: Nitro | Express

10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.625s (-34.9% 🟢) 1.014s (-20.7% 🟢) 0.000s (-22.0% 🟢) 1.033s (-20.9% 🟢) 0.408s 59 1.00x
🐘 Postgres Nitro 0.646s (-33.3% 🟢) 1.013s (-18.8% 🟢) 0.000s (+24.1% 🔺) 1.042s (-17.2% 🟢) 0.396s 58 1.03x
🐘 Postgres Next.js (Turbopack) 0.781s 1.070s 0.000s 1.077s 0.296s 57 1.25x
💻 Local Nitro 1.354s (+10.7% 🔺) 2.014s (~) 0.000s (+200.0% 🔺) 2.016s (~) 0.662s 30 2.17x
💻 Local Express 1.423s (+16.2% 🔺) 2.016s (~) 0.000s (+10.0% 🔺) 2.018s (~) 0.595s 30 2.28x
💻 Local Next.js (Turbopack) 1.473s 2.014s 0.000s 2.018s 0.545s 30 2.36x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.433s (-8.2% 🟢) 4.815s (-5.6% 🟢) 0.000s (-8.3% 🟢) 5.328s (-3.7%) 1.895s 12 1.00x
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - - -
▲ Vercel Nitro ⚠️ missing - - - - -

🔍 Observability: Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.289s (-27.2% 🟢) 1.933s (-11.2% 🟢) 0.000s (+Infinity% 🔺) 1.968s (-10.5% 🟢) 0.678s 31 1.00x
🐘 Postgres Nitro 1.347s (-24.8% 🟢) 2.065s (-3.6%) 0.000s (+93.1% 🔺) 2.107s (-3.1%) 0.760s 29 1.04x
🐘 Postgres Next.js (Turbopack) 1.643s 2.181s 0.000s 2.188s 0.545s 28 1.27x
💻 Local Next.js (Turbopack) 2.838s 3.173s 0.001s 3.191s 0.353s 19 2.20x
💻 Local Nitro 3.027s (-10.6% 🟢) 3.733s (-7.4% 🟢) 0.000s (-44.9% 🟢) 3.735s (-7.5% 🟢) 0.708s 17 2.35x
💻 Local Express 3.231s (-6.8% 🟢) 3.906s (-3.2%) 0.001s (-37.5% 🟢) 3.911s (-3.1%) 0.679s 16 2.51x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.850s (+42.9% 🔺) 7.329s (+36.4% 🔺) 0.000s (-54.2% 🟢) 7.839s (+35.3% 🔺) 1.988s 8 1.00x
▲ Vercel Express ⚠️ missing - - - - -
▲ Vercel Next.js (Turbopack) ⚠️ missing - - - - -

🔍 Observability: Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Express 10/21
🐘 Postgres Express 11/21
▲ Vercel Nitro 14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 15/21
Next.js (Turbopack) 🐘 Postgres 18/21
Nitro 🐘 Postgres 19/21
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)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Copy link
Copy Markdown
Contributor

@vercel vercel Bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

OCC fence parameters (lastKnownEventId, asOfTimestamp) are silently dropped for wait_completed and hook_received events because the lazy branch of createWorkflowRunEventInner doesn't forward them.

Fix on Vercel

The earlier revision filtered duplicate-wait conflicts by a
workflow-server-specific error message ("Workflow wait ..."), which
meant world-local's "Wait \"...\" already completed" (and any other
world's duplicate-wait error shape) fell through and bubbled the
EntityConflictError out of the elapsed-wait scan. abortHookOrdering
e2e suites started failing as a result.

Invert the filter: only the fence-conflict message (a workflow-server-
only error) drives the retry path. Anything else is the pre-OCC
"skip and continue" shape — matches the original behavior across all
world implementations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant