[core] Fix turbo-mode step-body writes racing run_started - #2629

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready
Jun 26, 2026
Merged

[core] Fix turbo-mode step-body writes racing run_started#2629
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

In turbo mode the first step's body runs optimistically — before the backgrounded run_started event is durable. Direct step-body world writes had no ordering gate, so they could reach the server before the run existed. Two such paths:

  1. experimental_setAttributes (host-side) wrote its attr_set event directly.
  2. getWritable() stream writes flushed chunks directly. The first chunk of a brand-new stream requires the run to exist (the World does a run lookup on stream creation), so an early write could be rejected as run-not-found — failing the step, or silently dropping the chunk if the rejection lands after the step's op-flush timeout.

The workflow-side experimental_setAttributes path (a "use workflow" body) was already gated on the run-ready barrier in the suspension handler. Only the step-body paths were unguarded. (Step-initiated aborts write directly too, but they require a pre-existing hook, which disables turbo's forced optimistic start — so they can't race.)

Fix

Thread the run-ready barrier through the step execution context and await it before the first direct step-body write:

  • step/context-storage.ts — add runReadyBarrier?: Promise<unknown> to StepContext.
  • runtime/step-executor.ts — populate it only on the optimistic-start path; undefined on the await path (run already durable).
  • set-attributes.tsawait the barrier before the attr_set create.
  • serialization.ts (WorkflowServerWritableStream) — accept the barrier; await it once before the first flush write and before close (a close with an empty buffer can itself be the first write to a new stream).
  • step/writable-stream.ts — pass ctx.runReadyBarrier into the stream.

In every case the rejection is swallowed for ordering only — a genuinely failed run_started then surfaces the real error from the write itself, mirroring the workflow-side ensureRunReady behavior. All gates are no-ops outside turbo and on the await path.

Tests

  • set-attributes.test.ts — the attr_set write fires strictly after the barrier resolves; a rejecting barrier still writes.
  • writable-stream.test.ts — the first server write/close waits for the barrier; later flushes aren't re-gated; a rejecting barrier still writes.

Typecheck + step-handler / set-attributes / serialization / writable-stream / flushable-stream suites pass. (world-local has no run-existence check on stream writes, so the stream race is Vercel-only; the unit tests gate against a fake World that models the server contract.)

🤖 Generated with Claude Code

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. The host-side
`experimental_setAttributes` path wrote its `attr_set` event directly,
so an attribute set early in that step could reach the World before the
run existed and be rejected as run-not-found. The workflow-side path was
already gated on the run-ready barrier; this extends the same gate to the
step-body path by threading the barrier through the step context.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested review from a team and ijjk as code ownersJune 25, 2026 17:31
@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 341cec2

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
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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 Jun 25, 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🥇 Nitro0.035s (-25.1% 🟢)1.005s (~)0.970s101.00x
💻 LocalExpress0.046s (-2.1%)1.006s (~)0.959s101.32x
💻 LocalNext.js (Turbopack)0.049s (-6.3% 🟢)1.005s (~)0.956s101.40x
🐘 PostgresNitro0.063s (-3.8%)1.013s (~)0.951s101.79x
🐘 PostgresExpress0.071s (+2.2%)1.012s (~)0.941s102.01x
🐘 PostgresNext.js (Turbopack)0.122s (+120.4% 🔺)1.053s (+4.0%)0.931s103.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.315s (+24.9% 🔺)2.022s (-6.8% 🟢)1.707s101.00x
▲ VercelExpress0.322s (+39.3% 🔺)2.058s (-2.2%)1.736s101.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.062s (-2.2%)2.005s (~)0.944s101.00x
🐘 PostgresNext.js (Turbopack)1.081s (~)2.014s (~)0.933s101.02x
💻 LocalExpress1.082s (~)2.007s (~)0.925s101.02x
🐘 PostgresExpress1.087s (~)2.010s (~)0.922s101.02x
💻 LocalNext.js (Turbopack)1.090s (+0.6%)2.006s (~)0.917s101.03x
🐘 PostgresNitro1.095s (-0.6%)2.010s (~)0.914s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.486s (+7.4% 🔺)3.401s (+20.2% 🔺)1.915s101.00x
▲ VercelNitro1.538s (+9.0% 🔺)3.272s (+2.7%)1.734s101.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.348s (-1.1%)11.021s (~)0.673s31.00x
🐘 PostgresNext.js (Turbopack)10.387s (-0.6%)11.011s (~)0.624s31.00x
🐘 PostgresExpress10.431s (~)11.020s (~)0.589s31.01x
💻 LocalNext.js (Turbopack)10.455s (~)11.022s (~)0.567s31.01x
💻 LocalExpress10.466s (~)11.022s (~)0.556s31.01x
🐘 PostgresNitro10.470s (~)11.019s (~)0.549s31.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.988s (-2.6%)13.964s (+0.7%)1.976s31.00x
▲ VercelNitro12.862s (+9.7% 🔺)15.204s (+13.8% 🔺)2.342s31.07x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.361s (-2.0%)14.025s (~)0.664s51.00x
🐘 PostgresNext.js (Turbopack)13.475s (-1.4%)14.014s (~)0.539s51.01x
🐘 PostgresExpress13.556s (~)14.020s (~)0.464s51.01x
🐘 PostgresNitro13.630s (-0.6%)14.018s (~)0.388s51.02x
💻 LocalExpress13.647s (~)14.028s (~)0.381s51.02x
💻 LocalNext.js (Turbopack)13.668s (+0.6%)14.026s (~)0.358s51.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.493s (+6.4% 🔺)19.519s (+8.4% 🔺)2.026s41.00x
▲ VercelNitro17.642s (+7.8% 🔺)19.618s (+10.7% 🔺)1.976s41.01x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro11.644s (-4.4%)12.022s (-7.7% 🟢)0.378s81.00x
🐘 PostgresNext.js (Turbopack)12.045s (~)12.527s (-3.8%)0.482s81.03x
💻 LocalExpress12.164s (-1.4%)13.023s (~)0.860s71.04x
🐘 PostgresNitro12.222s (~)13.019s (~)0.797s71.05x
💻 LocalNext.js (Turbopack)12.273s (~)13.025s (~)0.752s71.05x
🐘 PostgresExpress12.324s (+1.8%)13.019s (~)0.695s71.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express25.483s (+38.7% 🔺)27.630s (+37.1% 🔺)2.147s41.00x
▲ VercelNitro26.383s (+39.0% 🔺)28.653s (+38.9% 🔺)2.271s41.04x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.172s (~)2.008s (~)0.836s151.00x
🐘 PostgresNitro1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.190s (+1.2%)2.010s (~)0.820s151.02x
💻 LocalNitro1.328s (-7.6% 🟢)2.006s (~)0.678s151.13x
💻 LocalNext.js (Turbopack)1.416s (-5.5% 🟢)2.006s (~)0.591s151.21x
💻 LocalExpress1.461s (+5.1% 🔺)2.007s (~)0.546s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.277s (+12.2% 🔺)3.761s (+7.4% 🔺)1.484s91.00x
▲ VercelNitro2.286s (+7.4% 🔺)3.612s (+4.9%)1.326s91.00x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.285s (-7.7% 🟢)2.316s (-13.4% 🟢)1.031s131.00x
🐘 PostgresNitro1.298s (-3.1%)2.317s (-7.6% 🟢)1.020s131.01x
🐘 PostgresNext.js (Turbopack)1.318s (~)2.736s (-6.2% 🟢)1.418s111.03x
💻 LocalNitro2.249s (-6.6% 🟢)2.917s (~)0.668s111.75x
💻 LocalExpress2.265s (-3.9%)2.918s (~)0.652s111.76x
💻 LocalNext.js (Turbopack)2.814s (+2.9%)3.109s (~)0.295s102.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.557s (-29.6% 🟢)4.126s (-20.1% 🟢)1.569s81.00x
▲ VercelNitro3.102s (+0.7%)4.900s (-5.5% 🟢)1.798s71.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.591s (-3.0%)4.010s (-5.9% 🟢)2.419s81.00x
🐘 PostgresExpress1.662s (+4.8%)4.586s (+6.6% 🔺)2.925s71.04x
🐘 PostgresNext.js (Turbopack)2.859s (+1.6%)5.178s (-6.1% 🟢)2.319s61.80x
💻 LocalNitro4.540s (-29.5% 🟢)5.179s (-28.2% 🟢)0.638s62.85x
💻 LocalExpress6.180s (-2.3%)6.615s (-5.7% 🟢)0.435s53.88x
💻 LocalNext.js (Turbopack)6.944s (+26.9% 🔺)8.517s (+41.6% 🔺)1.573s44.36x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.963s (+29.3% 🔺)6.147s (+21.8% 🔺)2.184s51.00x
▲ VercelNitro4.029s (+20.1% 🔺)5.976s (+16.7% 🔺)1.948s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.166s (-3.3%)2.008s (~)0.841s151.00x
🐘 PostgresExpress1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.180s (+0.9%)2.008s (~)0.827s151.01x
💻 LocalNitro1.300s (-8.6% 🟢)2.006s (~)0.706s151.11x
💻 LocalExpress1.416s (-1.5%)2.007s (~)0.591s151.21x
💻 LocalNext.js (Turbopack)1.455s (+3.8%)2.007s (~)0.552s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.271s (+10.1% 🔺)3.713s (+6.1% 🔺)1.442s91.00x
▲ VercelNitro2.497s (+16.5% 🔺)4.047s (+8.9% 🔺)1.550s81.10x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.296s (-5.6% 🟢)2.316s (-6.3% 🟢)1.021s131.00x
🐘 PostgresExpress1.300s (-3.1%)2.392s (-3.2%)1.093s131.00x
🐘 PostgresNext.js (Turbopack)1.350s (+4.7%)2.674s (-8.4% 🟢)1.324s121.04x
💻 LocalNitro2.245s (-13.0% 🟢)2.826s (-9.1% 🟢)0.581s111.73x
💻 LocalExpress2.369s (-2.2%)3.110s (~)0.741s101.83x
💻 LocalNext.js (Turbopack)2.686s (+1.8%)3.008s (~)0.322s102.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.898s (+6.7% 🔺)4.652s (+7.7% 🔺)1.754s71.00x
▲ VercelExpress3.472s (-27.5% 🟢)5.420s (-18.4% 🟢)1.948s61.20x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.575s (-0.7%)4.010s (-3.0%)2.436s81.00x
🐘 PostgresNitro1.577s (-5.0%)4.136s (+3.1%)2.560s81.00x
🐘 PostgresNext.js (Turbopack)2.368s (-17.2% 🟢)4.726s (-19.2% 🟢)2.358s71.50x
💻 LocalNitro5.073s (-25.2% 🟢)6.012s (-16.7% 🟢)0.939s53.22x
💻 LocalNext.js (Turbopack)5.360s (-6.3% 🟢)6.014s (~)0.654s63.40x
💻 LocalExpress6.858s (+2.4%)7.516s (+4.1%)0.658s44.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.296s (+24.3% 🔺)6.750s (+34.1% 🔺)2.454s51.00x
▲ VercelExpress4.398s (-6.2% 🟢)6.339s (+0.7%)1.942s51.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.458s (-21.9% 🟢)1.004s (~)0.546s601.00x
🐘 PostgresNitro0.514s (-13.6% 🟢)1.023s (-1.8%)0.509s591.12x
🐘 PostgresExpress0.544s (+2.1%)1.040s (+1.7%)0.496s591.19x
💻 LocalExpress0.580s (+1.3%)1.005s (~)0.425s601.27x
💻 LocalNext.js (Turbopack)0.601s (~)1.005s (-1.7%)0.404s601.31x
🐘 PostgresNext.js (Turbopack)0.671s (+31.3% 🔺)1.086s (+8.0% 🔺)0.415s561.47x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.771s (+42.5% 🔺)5.372s (+25.0% 🔺)1.601s121.00x
▲ VercelExpress3.851s (+37.6% 🔺)5.665s (+26.3% 🔺)1.814s111.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.167s (-21.3% 🟢)2.005s (~)0.838s451.00x
🐘 PostgresExpress1.217s (-2.7%)2.007s (~)0.790s451.04x
🐘 PostgresNitro1.228s (-13.2% 🟢)2.008s (-2.3%)0.780s451.05x
🐘 PostgresNext.js (Turbopack)1.286s (+3.3%)2.035s (~)0.749s451.10x
💻 LocalExpress1.491s (+2.5%)2.028s (+1.1%)0.537s451.28x
💻 LocalNext.js (Turbopack)1.534s (+4.5%)2.007s (~)0.473s451.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.557s (+32.3% 🔺)10.541s (+31.1% 🔺)1.984s91.00x
▲ VercelNitro8.815s (+37.7% 🔺)10.553s (+35.9% 🔺)1.738s91.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)2.372s (-4.2%)3.033s (-0.8%)0.661s401.00x
🐘 PostgresExpress2.492s (-4.0%)3.058s (-0.9%)0.567s401.05x
🐘 PostgresNitro2.533s (-6.7% 🟢)3.034s (-0.8%)0.501s401.07x
💻 LocalNitro2.757s (-14.3% 🟢)3.218s (-19.7% 🟢)0.461s381.16x
💻 LocalExpress3.156s (-2.8%)4.010s (+0.8%)0.854s301.33x
💻 LocalNext.js (Turbopack)3.412s (+4.6%)4.043s (~)0.631s301.44x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express18.000s (+30.6% 🔺)20.264s (+31.1% 🔺)2.265s61.00x
▲ VercelNitro18.441s (+31.2% 🔺)20.585s (+31.7% 🔺)2.144s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.203s (-3.8%)1.006s (~)0.804s601.00x
🐘 PostgresNitro0.222s (-2.1%)1.006s (~)0.784s601.10x
🐘 PostgresNext.js (Turbopack)0.229s (+36.4% 🔺)1.016s (+1.0%)0.787s601.13x
💻 LocalNitro0.376s (-19.7% 🟢)1.004s (~)0.628s601.86x
💻 LocalExpress0.471s (+9.1% 🔺)1.005s (~)0.534s602.32x
💻 LocalNext.js (Turbopack)0.641s (+9.7% 🔺)1.022s (+1.7%)0.381s593.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.530s (-26.2% 🟢)3.038s (-20.9% 🟢)1.508s201.00x
▲ VercelNitro1.563s (-28.0% 🟢)2.980s (-23.1% 🟢)1.417s211.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.322s (+20.2% 🔺)1.024s (+1.8%)0.702s881.00x
🐘 PostgresExpress0.324s (~)1.006s (-1.1%)0.682s901.00x
🐘 PostgresNitro0.331s (-1.8%)1.017s (+1.1%)0.687s891.03x
💻 LocalNitro1.809s (-15.2% 🟢)2.402s (-10.6% 🟢)0.593s385.62x
💻 LocalExpress2.057s (-4.8%)2.655s (-3.0%)0.598s346.39x
💻 LocalNext.js (Turbopack)2.870s (+2.9%)3.510s (+7.7% 🔺)0.639s268.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.891s (-23.2% 🟢)3.600s (-11.2% 🟢)1.708s261.00x
▲ VercelNitro2.284s (+19.9% 🔺)3.993s (+14.5% 🔺)1.709s231.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.515s (~)1.059s (-0.9%)0.544s1141.00x
🐘 PostgresNitro0.541s (+2.4%)1.097s (+6.3% 🔺)0.556s1101.05x
🐘 PostgresNext.js (Turbopack)0.603s (+27.8% 🔺)2.515s (-16.4% 🟢)1.912s481.17x
💻 LocalNitro7.983s (-19.5% 🟢)8.809s (-20.1% 🟢)0.827s1415.50x
💻 LocalExpress9.967s (-1.2%)10.941s (-1.6%)0.973s1119.36x
💻 LocalNext.js (Turbopack)10.239s (+4.7%)11.303s (+4.9%)1.065s1119.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.253s (+27.9% 🔺)5.265s (+27.6% 🔺)2.012s231.00x
▲ VercelExpress3.871s (+62.0% 🔺)5.800s (+43.1% 🔺)1.928s211.19x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.121s (-3.2%)2.003s (~)0.008s (-34.7% 🟢)2.014s (~)0.893s101.00x
🐘 PostgresNext.js (Turbopack)1.143s (~)1.999s (~)0.001s (-36.4% 🟢)2.009s (~)0.866s101.02x
💻 LocalNext.js (Turbopack)1.145s (-2.0%)1.967s (~)0.012s (-0.8%)2.020s (~)0.875s101.02x
🐘 PostgresExpress1.166s (+1.4%)1.995s (~)0.001s (-10.0% 🟢)2.011s (~)0.845s101.04x
🐘 PostgresNitro1.166s (~)1.997s (~)0.001s (~)2.011s (~)0.844s101.04x
💻 LocalExpress1.201s (+4.2%)2.005s (~)0.013s (+4.2%)2.020s (~)0.819s101.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.479s (+11.7% 🔺)3.740s (+14.2% 🔺)2.670s (+43.3% 🔺)6.937s (+21.9% 🔺)4.458s101.00x
▲ VercelExpress2.728s (+33.3% 🔺)3.943s (+28.5% 🔺)3.169s (+80.9% 🔺)7.700s (+42.5% 🔺)4.972s101.10x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.434s (-7.7% 🟢)2.007s (~)0.011s (-10.5% 🟢)2.020s (~)0.587s301.00x
🐘 PostgresExpress1.525s (-1.4%)2.002s (~)0.005s (-6.6% 🟢)2.025s (~)0.500s301.06x
💻 LocalExpress1.555s (~)2.011s (~)0.012s (-3.9%)2.026s (~)0.471s301.08x
🐘 PostgresNitro1.569s (-2.2%)1.996s (~)0.006s (+11.3% 🔺)2.026s (~)0.458s301.09x
💻 LocalNext.js (Turbopack)1.583s (~)1.971s (~)0.012s (-10.5% 🟢)2.025s (~)0.442s301.10x
🐘 PostgresNext.js (Turbopack)2.048s (+33.0% 🔺)2.448s (+21.7% 🔺)0.004s (-23.1% 🟢)2.492s (+23.0% 🔺)0.444s251.43x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.953s (+18.1% 🔺)8.380s (+16.3% 🔺)0.487s (+125.5% 🔺)9.335s (+18.4% 🔺)2.382s71.00x
▲ VercelNitro7.427s (+22.3% 🔺)8.788s (+24.2% 🔺)0.382s (+68.6% 🔺)9.677s (+23.6% 🔺)2.250s71.07x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.763s (-1.4%)1.044s (~)0.000s (+Infinity% 🔺)1.075s (+1.0%)0.312s561.00x
🐘 PostgresNitro0.791s (-3.8%)1.058s (-3.7%)0.000s (-100.0% 🟢)1.077s (-3.7%)0.286s571.04x
💻 LocalNitro1.042s (-21.0% 🟢)1.616s (-18.4% 🟢)0.000s (-59.2% 🟢)1.619s (-18.4% 🟢)0.576s381.37x
💻 LocalExpress1.247s (-1.6%)1.981s (-1.6%)0.000s (+45.2% 🔺)1.984s (-1.6%)0.737s311.63x
💻 LocalNext.js (Turbopack)1.375s (+3.0%)1.979s (~)0.000s (+100.0% 🔺)2.016s (~)0.641s301.80x
🐘 PostgresNext.js (Turbopack)1.589s (+73.3% 🔺)2.107s (+65.1% 🔺)0.000s (-100.0% 🟢)2.154s (+67.8% 🔺)0.565s282.08x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.274s (+37.0% 🔺)5.404s (+22.5% 🔺)0.000s (NaN%)5.921s (+21.4% 🔺)1.647s111.00x
▲ VercelExpress4.755s (+21.7% 🔺)6.088s (+21.1% 🔺)0.000s (-45.0% 🟢)6.553s (+18.3% 🔺)1.799s101.11x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.819s (+7.3% 🔺)2.431s (+7.8% 🔺)0.000s (-100.0% 🟢)2.450s (+8.0% 🔺)0.631s251.00x
🐘 PostgresNitro1.853s (-3.4%)2.390s (-4.3%)0.000s (+92.0% 🔺)2.420s (-4.0%)0.566s251.02x
🐘 PostgresNext.js (Turbopack)2.602s (+28.1% 🔺)3.208s (+22.8% 🔺)0.000s (-100.0% 🟢)3.221s (+21.9% 🔺)0.619s191.43x
💻 LocalNitro2.682s (-24.8% 🟢)3.070s (-23.7% 🟢)0.001s (+10.3% 🔺)3.078s (-23.7% 🟢)0.396s201.47x
💻 LocalExpress3.313s (-8.8% 🟢)3.901s (-7.7% 🟢)0.001s (+5.5% 🔺)3.904s (-7.7% 🟢)0.592s161.82x
💻 LocalNext.js (Turbopack)3.446s (-5.9% 🟢)3.992s (-4.8%)0.001s (-12.5% 🟢)4.032s (-4.8%)0.587s151.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.429s (+14.7% 🔺)6.836s (+19.0% 🔺)0.000s (-100.0% 🟢)7.312s (+16.9% 🔺)1.883s91.00x
▲ VercelNitro5.774s (+18.0% 🔺)7.060s (+23.5% 🔺)0.000s (+Infinity% 🔺)7.648s (+23.6% 🔺)1.874s81.06x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro21/21
🐘 PostgresExpress9/21
▲ VercelExpress14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro🐘 Postgres12/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)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. `getWritable()` stream
writes flushed directly to the server; the first chunk of a brand-new
stream requires the run to exist (the World does a run lookup), so an
early write could be rejected as run-not-found, failing the step or
silently dropping the chunk.
Thread the run-ready barrier (already on the step context) into
`WorkflowServerWritableStream` and await it once before the first
flush/close. No-op outside turbo and on the await path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@vercelvercelBot 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.

Additional Suggestion:

In turbo optimistic start, a nested ReadableStream written into a step's getWritable() stream is piped to its own server stream via getExternalReducers without the run-ready barrier, so its first chunk can reach world.streams.write() before the backgrounded run_started is durable (run-not-found race).

Fix on Vercel

…o a step's `getWritable()` stream is piped to its own server stream via `getExternalReducers` without the run-ready barrier, so its first chunk can reach `world.streams.write()` before the backgrounded `run_started` is durable (run-not-found race).
This commit fixes the issue reported at packages/core/src/step/writable-stream.ts:81
## The bug
The PR closes a turbo-mode race where step-body world writes can reach the World before the backgrounded `run_started` is durable. It threaded a `runReadyBarrier` into:
1. `experimental_setAttributes` (`set-attributes.ts`),
2. the outer `WorkflowServerWritableStream` built by `getWritable()` (`step/writable-stream.ts` ~line 92), and
3. step return-value serialization via `getStepReducers` (`serialization.ts` ~line 1448), including its recursive call.
**Gap:** `getWritable()` builds its serialize transform with `getExternalReducers(globalThis, ctx.ops, runId, ctx.encryptionKey, true)` — *not* `getStepReducers`. Inside `getExternalReducers`, the `ReadableStream` reducer (`serialization.ts` ~line 1236) constructed:
```ts
const writable = new WorkflowServerWritableStream(runId, name); // no barrier
...
ops.push(value.pipeTo(writable)); // or framed / recursive-serialize variants
```
This pipe runs **independently** of the gated outer `serverWritable`. The barrier on the outer writable only orders writes to `(runId, name)` — the nested stream writes to a *different* `(runId, strm_<id>)` via an ungated sink.
## Reachability / trigger
- A turbo optimistic first-step body calls `getWritable()` (body runs before `run_started` is durable).
- The user writes a value that contains a nested `ReadableStream` into that writable.
- `getSerializeStream` invokes `getExternalReducers`' `ReadableStream` reducer synchronously on that chunk, which creates an ungated `WorkflowServerWritableStream(runId, name)` and pushes `value.pipeTo(writable)` to `ctx.ops`.
- That background pipe flushes the nested stream's first chunk to `world.streams.write(runId, strm_id, chunk)` with no barrier → it can land before `run_started` is durable → run-not-found, exactly the race the PR is closing, one level deeper.
This is the same code shape that *was* fixed in `getStepReducers` (commit dd61604); `getExternalReducers` was simply missed.
## The fix
Mirror the `getStepReducers` change:
- Added an optional trailing `runReadyBarrier?: Promise<unknown>` param to `getExternalReducers`.
- Passed it into `new WorkflowServerWritableStream(runId, name, runReadyBarrier)`.
- Threaded it through the recursive `getExternalReducers(...)` call used for non-byte streams.
- Passed `ctx.runReadyBarrier` from `step/writable-stream.ts`'s `getWritable()`.
The param is an optional trailing argument, so all other `getExternalReducers` callers (which pass `undefined`/nothing) are unaffected and the barrier is a no-op outside turbo and on the await path, consistent with the existing `WorkflowServerWritableStream` barrier semantics.
Note: type-checking could not be executed in this environment because dependencies (`tsc`) are not installed, but the change is type-safe — the new optional param is `Promise<unknown> | undefined`, the constructor already accepts that signature, and `ctx.runReadyBarrier` is typed `Promise<unknown> | undefined`.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

@karthikscale3karthikscale3 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.

Re-reviewed current head 341cec2. I checked the runReadyBarrier propagation through setAttributes, getWritable, returned ReadableStream serialization, and nested ReadableStream serialization, plus the focused stream/attribute tests. No confirmed P0/P1 code blockers remain from my review.

@VaguelySerious
VaguelySerious merged commit 1ea2b4e into mainJun 26, 2026
180 of 184 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 1ea2b4e (AI decision).

This fix targets a race in turbo-mode optimistic start, a main-only feature. I verified that set-attributes.ts, runtime/step-executor.ts, and any reference to optimisticStart/runReadyBarrier/experimental_setAttributes/attr_set are entirely absent from packages/core/src on origin/stable, so the changed code paths and the behavior being fixed do not exist there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

1ea2b4ef77dea8ce2845867e53cf1c51a8544e6e

@github-actionsgithub-actionsBot mentioned this pull request Jun 26, 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@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n 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;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} 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] Fix turbo-mode step-body writes racing run_started - #2629

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready
Jun 26, 2026
Merged

[core] Fix turbo-mode step-body writes racing run_started#2629
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

In turbo mode the first step's body runs optimistically — before the backgrounded run_started event is durable. Direct step-body world writes had no ordering gate, so they could reach the server before the run existed. Two such paths:

  1. experimental_setAttributes (host-side) wrote its attr_set event directly.
  2. getWritable() stream writes flushed chunks directly. The first chunk of a brand-new stream requires the run to exist (the World does a run lookup on stream creation), so an early write could be rejected as run-not-found — failing the step, or silently dropping the chunk if the rejection lands after the step's op-flush timeout.

The workflow-side experimental_setAttributes path (a "use workflow" body) was already gated on the run-ready barrier in the suspension handler. Only the step-body paths were unguarded. (Step-initiated aborts write directly too, but they require a pre-existing hook, which disables turbo's forced optimistic start — so they can't race.)

Fix

Thread the run-ready barrier through the step execution context and await it before the first direct step-body write:

  • step/context-storage.ts — add runReadyBarrier?: Promise<unknown> to StepContext.
  • runtime/step-executor.ts — populate it only on the optimistic-start path; undefined on the await path (run already durable).
  • set-attributes.tsawait the barrier before the attr_set create.
  • serialization.ts (WorkflowServerWritableStream) — accept the barrier; await it once before the first flush write and before close (a close with an empty buffer can itself be the first write to a new stream).
  • step/writable-stream.ts — pass ctx.runReadyBarrier into the stream.

In every case the rejection is swallowed for ordering only — a genuinely failed run_started then surfaces the real error from the write itself, mirroring the workflow-side ensureRunReady behavior. All gates are no-ops outside turbo and on the await path.

Tests

  • set-attributes.test.ts — the attr_set write fires strictly after the barrier resolves; a rejecting barrier still writes.
  • writable-stream.test.ts — the first server write/close waits for the barrier; later flushes aren't re-gated; a rejecting barrier still writes.

Typecheck + step-handler / set-attributes / serialization / writable-stream / flushable-stream suites pass. (world-local has no run-existence check on stream writes, so the stream race is Vercel-only; the unit tests gate against a fake World that models the server contract.)

🤖 Generated with Claude Code

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. The host-side
`experimental_setAttributes` path wrote its `attr_set` event directly,
so an attribute set early in that step could reach the World before the
run existed and be rejected as run-not-found. The workflow-side path was
already gated on the run-ready barrier; this extends the same gate to the
step-body path by threading the barrier through the step context.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested review from a team and ijjk as code ownersJune 25, 2026 17:31
@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 341cec2

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
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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 Jun 25, 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🥇 Nitro0.035s (-25.1% 🟢)1.005s (~)0.970s101.00x
💻 LocalExpress0.046s (-2.1%)1.006s (~)0.959s101.32x
💻 LocalNext.js (Turbopack)0.049s (-6.3% 🟢)1.005s (~)0.956s101.40x
🐘 PostgresNitro0.063s (-3.8%)1.013s (~)0.951s101.79x
🐘 PostgresExpress0.071s (+2.2%)1.012s (~)0.941s102.01x
🐘 PostgresNext.js (Turbopack)0.122s (+120.4% 🔺)1.053s (+4.0%)0.931s103.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.315s (+24.9% 🔺)2.022s (-6.8% 🟢)1.707s101.00x
▲ VercelExpress0.322s (+39.3% 🔺)2.058s (-2.2%)1.736s101.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.062s (-2.2%)2.005s (~)0.944s101.00x
🐘 PostgresNext.js (Turbopack)1.081s (~)2.014s (~)0.933s101.02x
💻 LocalExpress1.082s (~)2.007s (~)0.925s101.02x
🐘 PostgresExpress1.087s (~)2.010s (~)0.922s101.02x
💻 LocalNext.js (Turbopack)1.090s (+0.6%)2.006s (~)0.917s101.03x
🐘 PostgresNitro1.095s (-0.6%)2.010s (~)0.914s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.486s (+7.4% 🔺)3.401s (+20.2% 🔺)1.915s101.00x
▲ VercelNitro1.538s (+9.0% 🔺)3.272s (+2.7%)1.734s101.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.348s (-1.1%)11.021s (~)0.673s31.00x
🐘 PostgresNext.js (Turbopack)10.387s (-0.6%)11.011s (~)0.624s31.00x
🐘 PostgresExpress10.431s (~)11.020s (~)0.589s31.01x
💻 LocalNext.js (Turbopack)10.455s (~)11.022s (~)0.567s31.01x
💻 LocalExpress10.466s (~)11.022s (~)0.556s31.01x
🐘 PostgresNitro10.470s (~)11.019s (~)0.549s31.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.988s (-2.6%)13.964s (+0.7%)1.976s31.00x
▲ VercelNitro12.862s (+9.7% 🔺)15.204s (+13.8% 🔺)2.342s31.07x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.361s (-2.0%)14.025s (~)0.664s51.00x
🐘 PostgresNext.js (Turbopack)13.475s (-1.4%)14.014s (~)0.539s51.01x
🐘 PostgresExpress13.556s (~)14.020s (~)0.464s51.01x
🐘 PostgresNitro13.630s (-0.6%)14.018s (~)0.388s51.02x
💻 LocalExpress13.647s (~)14.028s (~)0.381s51.02x
💻 LocalNext.js (Turbopack)13.668s (+0.6%)14.026s (~)0.358s51.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.493s (+6.4% 🔺)19.519s (+8.4% 🔺)2.026s41.00x
▲ VercelNitro17.642s (+7.8% 🔺)19.618s (+10.7% 🔺)1.976s41.01x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro11.644s (-4.4%)12.022s (-7.7% 🟢)0.378s81.00x
🐘 PostgresNext.js (Turbopack)12.045s (~)12.527s (-3.8%)0.482s81.03x
💻 LocalExpress12.164s (-1.4%)13.023s (~)0.860s71.04x
🐘 PostgresNitro12.222s (~)13.019s (~)0.797s71.05x
💻 LocalNext.js (Turbopack)12.273s (~)13.025s (~)0.752s71.05x
🐘 PostgresExpress12.324s (+1.8%)13.019s (~)0.695s71.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express25.483s (+38.7% 🔺)27.630s (+37.1% 🔺)2.147s41.00x
▲ VercelNitro26.383s (+39.0% 🔺)28.653s (+38.9% 🔺)2.271s41.04x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.172s (~)2.008s (~)0.836s151.00x
🐘 PostgresNitro1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.190s (+1.2%)2.010s (~)0.820s151.02x
💻 LocalNitro1.328s (-7.6% 🟢)2.006s (~)0.678s151.13x
💻 LocalNext.js (Turbopack)1.416s (-5.5% 🟢)2.006s (~)0.591s151.21x
💻 LocalExpress1.461s (+5.1% 🔺)2.007s (~)0.546s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.277s (+12.2% 🔺)3.761s (+7.4% 🔺)1.484s91.00x
▲ VercelNitro2.286s (+7.4% 🔺)3.612s (+4.9%)1.326s91.00x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.285s (-7.7% 🟢)2.316s (-13.4% 🟢)1.031s131.00x
🐘 PostgresNitro1.298s (-3.1%)2.317s (-7.6% 🟢)1.020s131.01x
🐘 PostgresNext.js (Turbopack)1.318s (~)2.736s (-6.2% 🟢)1.418s111.03x
💻 LocalNitro2.249s (-6.6% 🟢)2.917s (~)0.668s111.75x
💻 LocalExpress2.265s (-3.9%)2.918s (~)0.652s111.76x
💻 LocalNext.js (Turbopack)2.814s (+2.9%)3.109s (~)0.295s102.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.557s (-29.6% 🟢)4.126s (-20.1% 🟢)1.569s81.00x
▲ VercelNitro3.102s (+0.7%)4.900s (-5.5% 🟢)1.798s71.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.591s (-3.0%)4.010s (-5.9% 🟢)2.419s81.00x
🐘 PostgresExpress1.662s (+4.8%)4.586s (+6.6% 🔺)2.925s71.04x
🐘 PostgresNext.js (Turbopack)2.859s (+1.6%)5.178s (-6.1% 🟢)2.319s61.80x
💻 LocalNitro4.540s (-29.5% 🟢)5.179s (-28.2% 🟢)0.638s62.85x
💻 LocalExpress6.180s (-2.3%)6.615s (-5.7% 🟢)0.435s53.88x
💻 LocalNext.js (Turbopack)6.944s (+26.9% 🔺)8.517s (+41.6% 🔺)1.573s44.36x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.963s (+29.3% 🔺)6.147s (+21.8% 🔺)2.184s51.00x
▲ VercelNitro4.029s (+20.1% 🔺)5.976s (+16.7% 🔺)1.948s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.166s (-3.3%)2.008s (~)0.841s151.00x
🐘 PostgresExpress1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.180s (+0.9%)2.008s (~)0.827s151.01x
💻 LocalNitro1.300s (-8.6% 🟢)2.006s (~)0.706s151.11x
💻 LocalExpress1.416s (-1.5%)2.007s (~)0.591s151.21x
💻 LocalNext.js (Turbopack)1.455s (+3.8%)2.007s (~)0.552s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.271s (+10.1% 🔺)3.713s (+6.1% 🔺)1.442s91.00x
▲ VercelNitro2.497s (+16.5% 🔺)4.047s (+8.9% 🔺)1.550s81.10x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.296s (-5.6% 🟢)2.316s (-6.3% 🟢)1.021s131.00x
🐘 PostgresExpress1.300s (-3.1%)2.392s (-3.2%)1.093s131.00x
🐘 PostgresNext.js (Turbopack)1.350s (+4.7%)2.674s (-8.4% 🟢)1.324s121.04x
💻 LocalNitro2.245s (-13.0% 🟢)2.826s (-9.1% 🟢)0.581s111.73x
💻 LocalExpress2.369s (-2.2%)3.110s (~)0.741s101.83x
💻 LocalNext.js (Turbopack)2.686s (+1.8%)3.008s (~)0.322s102.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.898s (+6.7% 🔺)4.652s (+7.7% 🔺)1.754s71.00x
▲ VercelExpress3.472s (-27.5% 🟢)5.420s (-18.4% 🟢)1.948s61.20x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.575s (-0.7%)4.010s (-3.0%)2.436s81.00x
🐘 PostgresNitro1.577s (-5.0%)4.136s (+3.1%)2.560s81.00x
🐘 PostgresNext.js (Turbopack)2.368s (-17.2% 🟢)4.726s (-19.2% 🟢)2.358s71.50x
💻 LocalNitro5.073s (-25.2% 🟢)6.012s (-16.7% 🟢)0.939s53.22x
💻 LocalNext.js (Turbopack)5.360s (-6.3% 🟢)6.014s (~)0.654s63.40x
💻 LocalExpress6.858s (+2.4%)7.516s (+4.1%)0.658s44.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.296s (+24.3% 🔺)6.750s (+34.1% 🔺)2.454s51.00x
▲ VercelExpress4.398s (-6.2% 🟢)6.339s (+0.7%)1.942s51.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.458s (-21.9% 🟢)1.004s (~)0.546s601.00x
🐘 PostgresNitro0.514s (-13.6% 🟢)1.023s (-1.8%)0.509s591.12x
🐘 PostgresExpress0.544s (+2.1%)1.040s (+1.7%)0.496s591.19x
💻 LocalExpress0.580s (+1.3%)1.005s (~)0.425s601.27x
💻 LocalNext.js (Turbopack)0.601s (~)1.005s (-1.7%)0.404s601.31x
🐘 PostgresNext.js (Turbopack)0.671s (+31.3% 🔺)1.086s (+8.0% 🔺)0.415s561.47x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.771s (+42.5% 🔺)5.372s (+25.0% 🔺)1.601s121.00x
▲ VercelExpress3.851s (+37.6% 🔺)5.665s (+26.3% 🔺)1.814s111.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.167s (-21.3% 🟢)2.005s (~)0.838s451.00x
🐘 PostgresExpress1.217s (-2.7%)2.007s (~)0.790s451.04x
🐘 PostgresNitro1.228s (-13.2% 🟢)2.008s (-2.3%)0.780s451.05x
🐘 PostgresNext.js (Turbopack)1.286s (+3.3%)2.035s (~)0.749s451.10x
💻 LocalExpress1.491s (+2.5%)2.028s (+1.1%)0.537s451.28x
💻 LocalNext.js (Turbopack)1.534s (+4.5%)2.007s (~)0.473s451.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.557s (+32.3% 🔺)10.541s (+31.1% 🔺)1.984s91.00x
▲ VercelNitro8.815s (+37.7% 🔺)10.553s (+35.9% 🔺)1.738s91.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)2.372s (-4.2%)3.033s (-0.8%)0.661s401.00x
🐘 PostgresExpress2.492s (-4.0%)3.058s (-0.9%)0.567s401.05x
🐘 PostgresNitro2.533s (-6.7% 🟢)3.034s (-0.8%)0.501s401.07x
💻 LocalNitro2.757s (-14.3% 🟢)3.218s (-19.7% 🟢)0.461s381.16x
💻 LocalExpress3.156s (-2.8%)4.010s (+0.8%)0.854s301.33x
💻 LocalNext.js (Turbopack)3.412s (+4.6%)4.043s (~)0.631s301.44x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express18.000s (+30.6% 🔺)20.264s (+31.1% 🔺)2.265s61.00x
▲ VercelNitro18.441s (+31.2% 🔺)20.585s (+31.7% 🔺)2.144s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.203s (-3.8%)1.006s (~)0.804s601.00x
🐘 PostgresNitro0.222s (-2.1%)1.006s (~)0.784s601.10x
🐘 PostgresNext.js (Turbopack)0.229s (+36.4% 🔺)1.016s (+1.0%)0.787s601.13x
💻 LocalNitro0.376s (-19.7% 🟢)1.004s (~)0.628s601.86x
💻 LocalExpress0.471s (+9.1% 🔺)1.005s (~)0.534s602.32x
💻 LocalNext.js (Turbopack)0.641s (+9.7% 🔺)1.022s (+1.7%)0.381s593.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.530s (-26.2% 🟢)3.038s (-20.9% 🟢)1.508s201.00x
▲ VercelNitro1.563s (-28.0% 🟢)2.980s (-23.1% 🟢)1.417s211.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.322s (+20.2% 🔺)1.024s (+1.8%)0.702s881.00x
🐘 PostgresExpress0.324s (~)1.006s (-1.1%)0.682s901.00x
🐘 PostgresNitro0.331s (-1.8%)1.017s (+1.1%)0.687s891.03x
💻 LocalNitro1.809s (-15.2% 🟢)2.402s (-10.6% 🟢)0.593s385.62x
💻 LocalExpress2.057s (-4.8%)2.655s (-3.0%)0.598s346.39x
💻 LocalNext.js (Turbopack)2.870s (+2.9%)3.510s (+7.7% 🔺)0.639s268.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.891s (-23.2% 🟢)3.600s (-11.2% 🟢)1.708s261.00x
▲ VercelNitro2.284s (+19.9% 🔺)3.993s (+14.5% 🔺)1.709s231.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.515s (~)1.059s (-0.9%)0.544s1141.00x
🐘 PostgresNitro0.541s (+2.4%)1.097s (+6.3% 🔺)0.556s1101.05x
🐘 PostgresNext.js (Turbopack)0.603s (+27.8% 🔺)2.515s (-16.4% 🟢)1.912s481.17x
💻 LocalNitro7.983s (-19.5% 🟢)8.809s (-20.1% 🟢)0.827s1415.50x
💻 LocalExpress9.967s (-1.2%)10.941s (-1.6%)0.973s1119.36x
💻 LocalNext.js (Turbopack)10.239s (+4.7%)11.303s (+4.9%)1.065s1119.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.253s (+27.9% 🔺)5.265s (+27.6% 🔺)2.012s231.00x
▲ VercelExpress3.871s (+62.0% 🔺)5.800s (+43.1% 🔺)1.928s211.19x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.121s (-3.2%)2.003s (~)0.008s (-34.7% 🟢)2.014s (~)0.893s101.00x
🐘 PostgresNext.js (Turbopack)1.143s (~)1.999s (~)0.001s (-36.4% 🟢)2.009s (~)0.866s101.02x
💻 LocalNext.js (Turbopack)1.145s (-2.0%)1.967s (~)0.012s (-0.8%)2.020s (~)0.875s101.02x
🐘 PostgresExpress1.166s (+1.4%)1.995s (~)0.001s (-10.0% 🟢)2.011s (~)0.845s101.04x
🐘 PostgresNitro1.166s (~)1.997s (~)0.001s (~)2.011s (~)0.844s101.04x
💻 LocalExpress1.201s (+4.2%)2.005s (~)0.013s (+4.2%)2.020s (~)0.819s101.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.479s (+11.7% 🔺)3.740s (+14.2% 🔺)2.670s (+43.3% 🔺)6.937s (+21.9% 🔺)4.458s101.00x
▲ VercelExpress2.728s (+33.3% 🔺)3.943s (+28.5% 🔺)3.169s (+80.9% 🔺)7.700s (+42.5% 🔺)4.972s101.10x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.434s (-7.7% 🟢)2.007s (~)0.011s (-10.5% 🟢)2.020s (~)0.587s301.00x
🐘 PostgresExpress1.525s (-1.4%)2.002s (~)0.005s (-6.6% 🟢)2.025s (~)0.500s301.06x
💻 LocalExpress1.555s (~)2.011s (~)0.012s (-3.9%)2.026s (~)0.471s301.08x
🐘 PostgresNitro1.569s (-2.2%)1.996s (~)0.006s (+11.3% 🔺)2.026s (~)0.458s301.09x
💻 LocalNext.js (Turbopack)1.583s (~)1.971s (~)0.012s (-10.5% 🟢)2.025s (~)0.442s301.10x
🐘 PostgresNext.js (Turbopack)2.048s (+33.0% 🔺)2.448s (+21.7% 🔺)0.004s (-23.1% 🟢)2.492s (+23.0% 🔺)0.444s251.43x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.953s (+18.1% 🔺)8.380s (+16.3% 🔺)0.487s (+125.5% 🔺)9.335s (+18.4% 🔺)2.382s71.00x
▲ VercelNitro7.427s (+22.3% 🔺)8.788s (+24.2% 🔺)0.382s (+68.6% 🔺)9.677s (+23.6% 🔺)2.250s71.07x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.763s (-1.4%)1.044s (~)0.000s (+Infinity% 🔺)1.075s (+1.0%)0.312s561.00x
🐘 PostgresNitro0.791s (-3.8%)1.058s (-3.7%)0.000s (-100.0% 🟢)1.077s (-3.7%)0.286s571.04x
💻 LocalNitro1.042s (-21.0% 🟢)1.616s (-18.4% 🟢)0.000s (-59.2% 🟢)1.619s (-18.4% 🟢)0.576s381.37x
💻 LocalExpress1.247s (-1.6%)1.981s (-1.6%)0.000s (+45.2% 🔺)1.984s (-1.6%)0.737s311.63x
💻 LocalNext.js (Turbopack)1.375s (+3.0%)1.979s (~)0.000s (+100.0% 🔺)2.016s (~)0.641s301.80x
🐘 PostgresNext.js (Turbopack)1.589s (+73.3% 🔺)2.107s (+65.1% 🔺)0.000s (-100.0% 🟢)2.154s (+67.8% 🔺)0.565s282.08x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.274s (+37.0% 🔺)5.404s (+22.5% 🔺)0.000s (NaN%)5.921s (+21.4% 🔺)1.647s111.00x
▲ VercelExpress4.755s (+21.7% 🔺)6.088s (+21.1% 🔺)0.000s (-45.0% 🟢)6.553s (+18.3% 🔺)1.799s101.11x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.819s (+7.3% 🔺)2.431s (+7.8% 🔺)0.000s (-100.0% 🟢)2.450s (+8.0% 🔺)0.631s251.00x
🐘 PostgresNitro1.853s (-3.4%)2.390s (-4.3%)0.000s (+92.0% 🔺)2.420s (-4.0%)0.566s251.02x
🐘 PostgresNext.js (Turbopack)2.602s (+28.1% 🔺)3.208s (+22.8% 🔺)0.000s (-100.0% 🟢)3.221s (+21.9% 🔺)0.619s191.43x
💻 LocalNitro2.682s (-24.8% 🟢)3.070s (-23.7% 🟢)0.001s (+10.3% 🔺)3.078s (-23.7% 🟢)0.396s201.47x
💻 LocalExpress3.313s (-8.8% 🟢)3.901s (-7.7% 🟢)0.001s (+5.5% 🔺)3.904s (-7.7% 🟢)0.592s161.82x
💻 LocalNext.js (Turbopack)3.446s (-5.9% 🟢)3.992s (-4.8%)0.001s (-12.5% 🟢)4.032s (-4.8%)0.587s151.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.429s (+14.7% 🔺)6.836s (+19.0% 🔺)0.000s (-100.0% 🟢)7.312s (+16.9% 🔺)1.883s91.00x
▲ VercelNitro5.774s (+18.0% 🔺)7.060s (+23.5% 🔺)0.000s (+Infinity% 🔺)7.648s (+23.6% 🔺)1.874s81.06x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro21/21
🐘 PostgresExpress9/21
▲ VercelExpress14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro🐘 Postgres12/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)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. `getWritable()` stream
writes flushed directly to the server; the first chunk of a brand-new
stream requires the run to exist (the World does a run lookup), so an
early write could be rejected as run-not-found, failing the step or
silently dropping the chunk.
Thread the run-ready barrier (already on the step context) into
`WorkflowServerWritableStream` and await it once before the first
flush/close. No-op outside turbo and on the await path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@vercelvercelBot 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.

Additional Suggestion:

In turbo optimistic start, a nested ReadableStream written into a step's getWritable() stream is piped to its own server stream via getExternalReducers without the run-ready barrier, so its first chunk can reach world.streams.write() before the backgrounded run_started is durable (run-not-found race).

Fix on Vercel

…o a step's `getWritable()` stream is piped to its own server stream via `getExternalReducers` without the run-ready barrier, so its first chunk can reach `world.streams.write()` before the backgrounded `run_started` is durable (run-not-found race).
This commit fixes the issue reported at packages/core/src/step/writable-stream.ts:81
## The bug
The PR closes a turbo-mode race where step-body world writes can reach the World before the backgrounded `run_started` is durable. It threaded a `runReadyBarrier` into:
1. `experimental_setAttributes` (`set-attributes.ts`),
2. the outer `WorkflowServerWritableStream` built by `getWritable()` (`step/writable-stream.ts` ~line 92), and
3. step return-value serialization via `getStepReducers` (`serialization.ts` ~line 1448), including its recursive call.
**Gap:** `getWritable()` builds its serialize transform with `getExternalReducers(globalThis, ctx.ops, runId, ctx.encryptionKey, true)` — *not* `getStepReducers`. Inside `getExternalReducers`, the `ReadableStream` reducer (`serialization.ts` ~line 1236) constructed:
```ts
const writable = new WorkflowServerWritableStream(runId, name); // no barrier
...
ops.push(value.pipeTo(writable)); // or framed / recursive-serialize variants
```
This pipe runs **independently** of the gated outer `serverWritable`. The barrier on the outer writable only orders writes to `(runId, name)` — the nested stream writes to a *different* `(runId, strm_<id>)` via an ungated sink.
## Reachability / trigger
- A turbo optimistic first-step body calls `getWritable()` (body runs before `run_started` is durable).
- The user writes a value that contains a nested `ReadableStream` into that writable.
- `getSerializeStream` invokes `getExternalReducers`' `ReadableStream` reducer synchronously on that chunk, which creates an ungated `WorkflowServerWritableStream(runId, name)` and pushes `value.pipeTo(writable)` to `ctx.ops`.
- That background pipe flushes the nested stream's first chunk to `world.streams.write(runId, strm_id, chunk)` with no barrier → it can land before `run_started` is durable → run-not-found, exactly the race the PR is closing, one level deeper.
This is the same code shape that *was* fixed in `getStepReducers` (commit dd61604); `getExternalReducers` was simply missed.
## The fix
Mirror the `getStepReducers` change:
- Added an optional trailing `runReadyBarrier?: Promise<unknown>` param to `getExternalReducers`.
- Passed it into `new WorkflowServerWritableStream(runId, name, runReadyBarrier)`.
- Threaded it through the recursive `getExternalReducers(...)` call used for non-byte streams.
- Passed `ctx.runReadyBarrier` from `step/writable-stream.ts`'s `getWritable()`.
The param is an optional trailing argument, so all other `getExternalReducers` callers (which pass `undefined`/nothing) are unaffected and the barrier is a no-op outside turbo and on the await path, consistent with the existing `WorkflowServerWritableStream` barrier semantics.
Note: type-checking could not be executed in this environment because dependencies (`tsc`) are not installed, but the change is type-safe — the new optional param is `Promise<unknown> | undefined`, the constructor already accepts that signature, and `ctx.runReadyBarrier` is typed `Promise<unknown> | undefined`.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

@karthikscale3karthikscale3 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.

Re-reviewed current head 341cec2. I checked the runReadyBarrier propagation through setAttributes, getWritable, returned ReadableStream serialization, and nested ReadableStream serialization, plus the focused stream/attribute tests. No confirmed P0/P1 code blockers remain from my review.

@VaguelySerious
VaguelySerious merged commit 1ea2b4e into mainJun 26, 2026
180 of 184 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 1ea2b4e (AI decision).

This fix targets a race in turbo-mode optimistic start, a main-only feature. I verified that set-attributes.ts, runtime/step-executor.ts, and any reference to optimisticStart/runReadyBarrier/experimental_setAttributes/attr_set are entirely absent from packages/core/src on origin/stable, so the changed code paths and the behavior being fixed do not exist there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

1ea2b4ef77dea8ce2845867e53cf1c51a8544e6e

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

[core] Fix turbo-mode step-body writes racing run_started - #2629

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready
Jun 26, 2026
Merged

[core] Fix turbo-mode step-body writes racing run_started#2629
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

In turbo mode the first step's body runs optimistically — before the backgrounded run_started event is durable. Direct step-body world writes had no ordering gate, so they could reach the server before the run existed. Two such paths:

  1. experimental_setAttributes (host-side) wrote its attr_set event directly.
  2. getWritable() stream writes flushed chunks directly. The first chunk of a brand-new stream requires the run to exist (the World does a run lookup on stream creation), so an early write could be rejected as run-not-found — failing the step, or silently dropping the chunk if the rejection lands after the step's op-flush timeout.

The workflow-side experimental_setAttributes path (a "use workflow" body) was already gated on the run-ready barrier in the suspension handler. Only the step-body paths were unguarded. (Step-initiated aborts write directly too, but they require a pre-existing hook, which disables turbo's forced optimistic start — so they can't race.)

Fix

Thread the run-ready barrier through the step execution context and await it before the first direct step-body write:

  • step/context-storage.ts — add runReadyBarrier?: Promise<unknown> to StepContext.
  • runtime/step-executor.ts — populate it only on the optimistic-start path; undefined on the await path (run already durable).
  • set-attributes.tsawait the barrier before the attr_set create.
  • serialization.ts (WorkflowServerWritableStream) — accept the barrier; await it once before the first flush write and before close (a close with an empty buffer can itself be the first write to a new stream).
  • step/writable-stream.ts — pass ctx.runReadyBarrier into the stream.

In every case the rejection is swallowed for ordering only — a genuinely failed run_started then surfaces the real error from the write itself, mirroring the workflow-side ensureRunReady behavior. All gates are no-ops outside turbo and on the await path.

Tests

  • set-attributes.test.ts — the attr_set write fires strictly after the barrier resolves; a rejecting barrier still writes.
  • writable-stream.test.ts — the first server write/close waits for the barrier; later flushes aren't re-gated; a rejecting barrier still writes.

Typecheck + step-handler / set-attributes / serialization / writable-stream / flushable-stream suites pass. (world-local has no run-existence check on stream writes, so the stream race is Vercel-only; the unit tests gate against a fake World that models the server contract.)

🤖 Generated with Claude Code

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. The host-side
`experimental_setAttributes` path wrote its `attr_set` event directly,
so an attribute set early in that step could reach the World before the
run existed and be rejected as run-not-found. The workflow-side path was
already gated on the run-ready barrier; this extends the same gate to the
step-body path by threading the barrier through the step context.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested review from a team and ijjk as code ownersJune 25, 2026 17:31
@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 341cec2

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
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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 Jun 25, 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🥇 Nitro0.035s (-25.1% 🟢)1.005s (~)0.970s101.00x
💻 LocalExpress0.046s (-2.1%)1.006s (~)0.959s101.32x
💻 LocalNext.js (Turbopack)0.049s (-6.3% 🟢)1.005s (~)0.956s101.40x
🐘 PostgresNitro0.063s (-3.8%)1.013s (~)0.951s101.79x
🐘 PostgresExpress0.071s (+2.2%)1.012s (~)0.941s102.01x
🐘 PostgresNext.js (Turbopack)0.122s (+120.4% 🔺)1.053s (+4.0%)0.931s103.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.315s (+24.9% 🔺)2.022s (-6.8% 🟢)1.707s101.00x
▲ VercelExpress0.322s (+39.3% 🔺)2.058s (-2.2%)1.736s101.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.062s (-2.2%)2.005s (~)0.944s101.00x
🐘 PostgresNext.js (Turbopack)1.081s (~)2.014s (~)0.933s101.02x
💻 LocalExpress1.082s (~)2.007s (~)0.925s101.02x
🐘 PostgresExpress1.087s (~)2.010s (~)0.922s101.02x
💻 LocalNext.js (Turbopack)1.090s (+0.6%)2.006s (~)0.917s101.03x
🐘 PostgresNitro1.095s (-0.6%)2.010s (~)0.914s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.486s (+7.4% 🔺)3.401s (+20.2% 🔺)1.915s101.00x
▲ VercelNitro1.538s (+9.0% 🔺)3.272s (+2.7%)1.734s101.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.348s (-1.1%)11.021s (~)0.673s31.00x
🐘 PostgresNext.js (Turbopack)10.387s (-0.6%)11.011s (~)0.624s31.00x
🐘 PostgresExpress10.431s (~)11.020s (~)0.589s31.01x
💻 LocalNext.js (Turbopack)10.455s (~)11.022s (~)0.567s31.01x
💻 LocalExpress10.466s (~)11.022s (~)0.556s31.01x
🐘 PostgresNitro10.470s (~)11.019s (~)0.549s31.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.988s (-2.6%)13.964s (+0.7%)1.976s31.00x
▲ VercelNitro12.862s (+9.7% 🔺)15.204s (+13.8% 🔺)2.342s31.07x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.361s (-2.0%)14.025s (~)0.664s51.00x
🐘 PostgresNext.js (Turbopack)13.475s (-1.4%)14.014s (~)0.539s51.01x
🐘 PostgresExpress13.556s (~)14.020s (~)0.464s51.01x
🐘 PostgresNitro13.630s (-0.6%)14.018s (~)0.388s51.02x
💻 LocalExpress13.647s (~)14.028s (~)0.381s51.02x
💻 LocalNext.js (Turbopack)13.668s (+0.6%)14.026s (~)0.358s51.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.493s (+6.4% 🔺)19.519s (+8.4% 🔺)2.026s41.00x
▲ VercelNitro17.642s (+7.8% 🔺)19.618s (+10.7% 🔺)1.976s41.01x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro11.644s (-4.4%)12.022s (-7.7% 🟢)0.378s81.00x
🐘 PostgresNext.js (Turbopack)12.045s (~)12.527s (-3.8%)0.482s81.03x
💻 LocalExpress12.164s (-1.4%)13.023s (~)0.860s71.04x
🐘 PostgresNitro12.222s (~)13.019s (~)0.797s71.05x
💻 LocalNext.js (Turbopack)12.273s (~)13.025s (~)0.752s71.05x
🐘 PostgresExpress12.324s (+1.8%)13.019s (~)0.695s71.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express25.483s (+38.7% 🔺)27.630s (+37.1% 🔺)2.147s41.00x
▲ VercelNitro26.383s (+39.0% 🔺)28.653s (+38.9% 🔺)2.271s41.04x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.172s (~)2.008s (~)0.836s151.00x
🐘 PostgresNitro1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.190s (+1.2%)2.010s (~)0.820s151.02x
💻 LocalNitro1.328s (-7.6% 🟢)2.006s (~)0.678s151.13x
💻 LocalNext.js (Turbopack)1.416s (-5.5% 🟢)2.006s (~)0.591s151.21x
💻 LocalExpress1.461s (+5.1% 🔺)2.007s (~)0.546s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.277s (+12.2% 🔺)3.761s (+7.4% 🔺)1.484s91.00x
▲ VercelNitro2.286s (+7.4% 🔺)3.612s (+4.9%)1.326s91.00x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.285s (-7.7% 🟢)2.316s (-13.4% 🟢)1.031s131.00x
🐘 PostgresNitro1.298s (-3.1%)2.317s (-7.6% 🟢)1.020s131.01x
🐘 PostgresNext.js (Turbopack)1.318s (~)2.736s (-6.2% 🟢)1.418s111.03x
💻 LocalNitro2.249s (-6.6% 🟢)2.917s (~)0.668s111.75x
💻 LocalExpress2.265s (-3.9%)2.918s (~)0.652s111.76x
💻 LocalNext.js (Turbopack)2.814s (+2.9%)3.109s (~)0.295s102.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.557s (-29.6% 🟢)4.126s (-20.1% 🟢)1.569s81.00x
▲ VercelNitro3.102s (+0.7%)4.900s (-5.5% 🟢)1.798s71.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.591s (-3.0%)4.010s (-5.9% 🟢)2.419s81.00x
🐘 PostgresExpress1.662s (+4.8%)4.586s (+6.6% 🔺)2.925s71.04x
🐘 PostgresNext.js (Turbopack)2.859s (+1.6%)5.178s (-6.1% 🟢)2.319s61.80x
💻 LocalNitro4.540s (-29.5% 🟢)5.179s (-28.2% 🟢)0.638s62.85x
💻 LocalExpress6.180s (-2.3%)6.615s (-5.7% 🟢)0.435s53.88x
💻 LocalNext.js (Turbopack)6.944s (+26.9% 🔺)8.517s (+41.6% 🔺)1.573s44.36x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.963s (+29.3% 🔺)6.147s (+21.8% 🔺)2.184s51.00x
▲ VercelNitro4.029s (+20.1% 🔺)5.976s (+16.7% 🔺)1.948s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.166s (-3.3%)2.008s (~)0.841s151.00x
🐘 PostgresExpress1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.180s (+0.9%)2.008s (~)0.827s151.01x
💻 LocalNitro1.300s (-8.6% 🟢)2.006s (~)0.706s151.11x
💻 LocalExpress1.416s (-1.5%)2.007s (~)0.591s151.21x
💻 LocalNext.js (Turbopack)1.455s (+3.8%)2.007s (~)0.552s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.271s (+10.1% 🔺)3.713s (+6.1% 🔺)1.442s91.00x
▲ VercelNitro2.497s (+16.5% 🔺)4.047s (+8.9% 🔺)1.550s81.10x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.296s (-5.6% 🟢)2.316s (-6.3% 🟢)1.021s131.00x
🐘 PostgresExpress1.300s (-3.1%)2.392s (-3.2%)1.093s131.00x
🐘 PostgresNext.js (Turbopack)1.350s (+4.7%)2.674s (-8.4% 🟢)1.324s121.04x
💻 LocalNitro2.245s (-13.0% 🟢)2.826s (-9.1% 🟢)0.581s111.73x
💻 LocalExpress2.369s (-2.2%)3.110s (~)0.741s101.83x
💻 LocalNext.js (Turbopack)2.686s (+1.8%)3.008s (~)0.322s102.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.898s (+6.7% 🔺)4.652s (+7.7% 🔺)1.754s71.00x
▲ VercelExpress3.472s (-27.5% 🟢)5.420s (-18.4% 🟢)1.948s61.20x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.575s (-0.7%)4.010s (-3.0%)2.436s81.00x
🐘 PostgresNitro1.577s (-5.0%)4.136s (+3.1%)2.560s81.00x
🐘 PostgresNext.js (Turbopack)2.368s (-17.2% 🟢)4.726s (-19.2% 🟢)2.358s71.50x
💻 LocalNitro5.073s (-25.2% 🟢)6.012s (-16.7% 🟢)0.939s53.22x
💻 LocalNext.js (Turbopack)5.360s (-6.3% 🟢)6.014s (~)0.654s63.40x
💻 LocalExpress6.858s (+2.4%)7.516s (+4.1%)0.658s44.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.296s (+24.3% 🔺)6.750s (+34.1% 🔺)2.454s51.00x
▲ VercelExpress4.398s (-6.2% 🟢)6.339s (+0.7%)1.942s51.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.458s (-21.9% 🟢)1.004s (~)0.546s601.00x
🐘 PostgresNitro0.514s (-13.6% 🟢)1.023s (-1.8%)0.509s591.12x
🐘 PostgresExpress0.544s (+2.1%)1.040s (+1.7%)0.496s591.19x
💻 LocalExpress0.580s (+1.3%)1.005s (~)0.425s601.27x
💻 LocalNext.js (Turbopack)0.601s (~)1.005s (-1.7%)0.404s601.31x
🐘 PostgresNext.js (Turbopack)0.671s (+31.3% 🔺)1.086s (+8.0% 🔺)0.415s561.47x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.771s (+42.5% 🔺)5.372s (+25.0% 🔺)1.601s121.00x
▲ VercelExpress3.851s (+37.6% 🔺)5.665s (+26.3% 🔺)1.814s111.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.167s (-21.3% 🟢)2.005s (~)0.838s451.00x
🐘 PostgresExpress1.217s (-2.7%)2.007s (~)0.790s451.04x
🐘 PostgresNitro1.228s (-13.2% 🟢)2.008s (-2.3%)0.780s451.05x
🐘 PostgresNext.js (Turbopack)1.286s (+3.3%)2.035s (~)0.749s451.10x
💻 LocalExpress1.491s (+2.5%)2.028s (+1.1%)0.537s451.28x
💻 LocalNext.js (Turbopack)1.534s (+4.5%)2.007s (~)0.473s451.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.557s (+32.3% 🔺)10.541s (+31.1% 🔺)1.984s91.00x
▲ VercelNitro8.815s (+37.7% 🔺)10.553s (+35.9% 🔺)1.738s91.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)2.372s (-4.2%)3.033s (-0.8%)0.661s401.00x
🐘 PostgresExpress2.492s (-4.0%)3.058s (-0.9%)0.567s401.05x
🐘 PostgresNitro2.533s (-6.7% 🟢)3.034s (-0.8%)0.501s401.07x
💻 LocalNitro2.757s (-14.3% 🟢)3.218s (-19.7% 🟢)0.461s381.16x
💻 LocalExpress3.156s (-2.8%)4.010s (+0.8%)0.854s301.33x
💻 LocalNext.js (Turbopack)3.412s (+4.6%)4.043s (~)0.631s301.44x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express18.000s (+30.6% 🔺)20.264s (+31.1% 🔺)2.265s61.00x
▲ VercelNitro18.441s (+31.2% 🔺)20.585s (+31.7% 🔺)2.144s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.203s (-3.8%)1.006s (~)0.804s601.00x
🐘 PostgresNitro0.222s (-2.1%)1.006s (~)0.784s601.10x
🐘 PostgresNext.js (Turbopack)0.229s (+36.4% 🔺)1.016s (+1.0%)0.787s601.13x
💻 LocalNitro0.376s (-19.7% 🟢)1.004s (~)0.628s601.86x
💻 LocalExpress0.471s (+9.1% 🔺)1.005s (~)0.534s602.32x
💻 LocalNext.js (Turbopack)0.641s (+9.7% 🔺)1.022s (+1.7%)0.381s593.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.530s (-26.2% 🟢)3.038s (-20.9% 🟢)1.508s201.00x
▲ VercelNitro1.563s (-28.0% 🟢)2.980s (-23.1% 🟢)1.417s211.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.322s (+20.2% 🔺)1.024s (+1.8%)0.702s881.00x
🐘 PostgresExpress0.324s (~)1.006s (-1.1%)0.682s901.00x
🐘 PostgresNitro0.331s (-1.8%)1.017s (+1.1%)0.687s891.03x
💻 LocalNitro1.809s (-15.2% 🟢)2.402s (-10.6% 🟢)0.593s385.62x
💻 LocalExpress2.057s (-4.8%)2.655s (-3.0%)0.598s346.39x
💻 LocalNext.js (Turbopack)2.870s (+2.9%)3.510s (+7.7% 🔺)0.639s268.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.891s (-23.2% 🟢)3.600s (-11.2% 🟢)1.708s261.00x
▲ VercelNitro2.284s (+19.9% 🔺)3.993s (+14.5% 🔺)1.709s231.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.515s (~)1.059s (-0.9%)0.544s1141.00x
🐘 PostgresNitro0.541s (+2.4%)1.097s (+6.3% 🔺)0.556s1101.05x
🐘 PostgresNext.js (Turbopack)0.603s (+27.8% 🔺)2.515s (-16.4% 🟢)1.912s481.17x
💻 LocalNitro7.983s (-19.5% 🟢)8.809s (-20.1% 🟢)0.827s1415.50x
💻 LocalExpress9.967s (-1.2%)10.941s (-1.6%)0.973s1119.36x
💻 LocalNext.js (Turbopack)10.239s (+4.7%)11.303s (+4.9%)1.065s1119.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.253s (+27.9% 🔺)5.265s (+27.6% 🔺)2.012s231.00x
▲ VercelExpress3.871s (+62.0% 🔺)5.800s (+43.1% 🔺)1.928s211.19x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.121s (-3.2%)2.003s (~)0.008s (-34.7% 🟢)2.014s (~)0.893s101.00x
🐘 PostgresNext.js (Turbopack)1.143s (~)1.999s (~)0.001s (-36.4% 🟢)2.009s (~)0.866s101.02x
💻 LocalNext.js (Turbopack)1.145s (-2.0%)1.967s (~)0.012s (-0.8%)2.020s (~)0.875s101.02x
🐘 PostgresExpress1.166s (+1.4%)1.995s (~)0.001s (-10.0% 🟢)2.011s (~)0.845s101.04x
🐘 PostgresNitro1.166s (~)1.997s (~)0.001s (~)2.011s (~)0.844s101.04x
💻 LocalExpress1.201s (+4.2%)2.005s (~)0.013s (+4.2%)2.020s (~)0.819s101.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.479s (+11.7% 🔺)3.740s (+14.2% 🔺)2.670s (+43.3% 🔺)6.937s (+21.9% 🔺)4.458s101.00x
▲ VercelExpress2.728s (+33.3% 🔺)3.943s (+28.5% 🔺)3.169s (+80.9% 🔺)7.700s (+42.5% 🔺)4.972s101.10x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.434s (-7.7% 🟢)2.007s (~)0.011s (-10.5% 🟢)2.020s (~)0.587s301.00x
🐘 PostgresExpress1.525s (-1.4%)2.002s (~)0.005s (-6.6% 🟢)2.025s (~)0.500s301.06x
💻 LocalExpress1.555s (~)2.011s (~)0.012s (-3.9%)2.026s (~)0.471s301.08x
🐘 PostgresNitro1.569s (-2.2%)1.996s (~)0.006s (+11.3% 🔺)2.026s (~)0.458s301.09x
💻 LocalNext.js (Turbopack)1.583s (~)1.971s (~)0.012s (-10.5% 🟢)2.025s (~)0.442s301.10x
🐘 PostgresNext.js (Turbopack)2.048s (+33.0% 🔺)2.448s (+21.7% 🔺)0.004s (-23.1% 🟢)2.492s (+23.0% 🔺)0.444s251.43x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.953s (+18.1% 🔺)8.380s (+16.3% 🔺)0.487s (+125.5% 🔺)9.335s (+18.4% 🔺)2.382s71.00x
▲ VercelNitro7.427s (+22.3% 🔺)8.788s (+24.2% 🔺)0.382s (+68.6% 🔺)9.677s (+23.6% 🔺)2.250s71.07x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.763s (-1.4%)1.044s (~)0.000s (+Infinity% 🔺)1.075s (+1.0%)0.312s561.00x
🐘 PostgresNitro0.791s (-3.8%)1.058s (-3.7%)0.000s (-100.0% 🟢)1.077s (-3.7%)0.286s571.04x
💻 LocalNitro1.042s (-21.0% 🟢)1.616s (-18.4% 🟢)0.000s (-59.2% 🟢)1.619s (-18.4% 🟢)0.576s381.37x
💻 LocalExpress1.247s (-1.6%)1.981s (-1.6%)0.000s (+45.2% 🔺)1.984s (-1.6%)0.737s311.63x
💻 LocalNext.js (Turbopack)1.375s (+3.0%)1.979s (~)0.000s (+100.0% 🔺)2.016s (~)0.641s301.80x
🐘 PostgresNext.js (Turbopack)1.589s (+73.3% 🔺)2.107s (+65.1% 🔺)0.000s (-100.0% 🟢)2.154s (+67.8% 🔺)0.565s282.08x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.274s (+37.0% 🔺)5.404s (+22.5% 🔺)0.000s (NaN%)5.921s (+21.4% 🔺)1.647s111.00x
▲ VercelExpress4.755s (+21.7% 🔺)6.088s (+21.1% 🔺)0.000s (-45.0% 🟢)6.553s (+18.3% 🔺)1.799s101.11x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.819s (+7.3% 🔺)2.431s (+7.8% 🔺)0.000s (-100.0% 🟢)2.450s (+8.0% 🔺)0.631s251.00x
🐘 PostgresNitro1.853s (-3.4%)2.390s (-4.3%)0.000s (+92.0% 🔺)2.420s (-4.0%)0.566s251.02x
🐘 PostgresNext.js (Turbopack)2.602s (+28.1% 🔺)3.208s (+22.8% 🔺)0.000s (-100.0% 🟢)3.221s (+21.9% 🔺)0.619s191.43x
💻 LocalNitro2.682s (-24.8% 🟢)3.070s (-23.7% 🟢)0.001s (+10.3% 🔺)3.078s (-23.7% 🟢)0.396s201.47x
💻 LocalExpress3.313s (-8.8% 🟢)3.901s (-7.7% 🟢)0.001s (+5.5% 🔺)3.904s (-7.7% 🟢)0.592s161.82x
💻 LocalNext.js (Turbopack)3.446s (-5.9% 🟢)3.992s (-4.8%)0.001s (-12.5% 🟢)4.032s (-4.8%)0.587s151.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.429s (+14.7% 🔺)6.836s (+19.0% 🔺)0.000s (-100.0% 🟢)7.312s (+16.9% 🔺)1.883s91.00x
▲ VercelNitro5.774s (+18.0% 🔺)7.060s (+23.5% 🔺)0.000s (+Infinity% 🔺)7.648s (+23.6% 🔺)1.874s81.06x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro21/21
🐘 PostgresExpress9/21
▲ VercelExpress14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro🐘 Postgres12/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)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. `getWritable()` stream
writes flushed directly to the server; the first chunk of a brand-new
stream requires the run to exist (the World does a run lookup), so an
early write could be rejected as run-not-found, failing the step or
silently dropping the chunk.
Thread the run-ready barrier (already on the step context) into
`WorkflowServerWritableStream` and await it once before the first
flush/close. No-op outside turbo and on the await path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@vercelvercelBot 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.

Additional Suggestion:

In turbo optimistic start, a nested ReadableStream written into a step's getWritable() stream is piped to its own server stream via getExternalReducers without the run-ready barrier, so its first chunk can reach world.streams.write() before the backgrounded run_started is durable (run-not-found race).

Fix on Vercel

…o a step's `getWritable()` stream is piped to its own server stream via `getExternalReducers` without the run-ready barrier, so its first chunk can reach `world.streams.write()` before the backgrounded `run_started` is durable (run-not-found race).
This commit fixes the issue reported at packages/core/src/step/writable-stream.ts:81
## The bug
The PR closes a turbo-mode race where step-body world writes can reach the World before the backgrounded `run_started` is durable. It threaded a `runReadyBarrier` into:
1. `experimental_setAttributes` (`set-attributes.ts`),
2. the outer `WorkflowServerWritableStream` built by `getWritable()` (`step/writable-stream.ts` ~line 92), and
3. step return-value serialization via `getStepReducers` (`serialization.ts` ~line 1448), including its recursive call.
**Gap:** `getWritable()` builds its serialize transform with `getExternalReducers(globalThis, ctx.ops, runId, ctx.encryptionKey, true)` — *not* `getStepReducers`. Inside `getExternalReducers`, the `ReadableStream` reducer (`serialization.ts` ~line 1236) constructed:
```ts
const writable = new WorkflowServerWritableStream(runId, name); // no barrier
...
ops.push(value.pipeTo(writable)); // or framed / recursive-serialize variants
```
This pipe runs **independently** of the gated outer `serverWritable`. The barrier on the outer writable only orders writes to `(runId, name)` — the nested stream writes to a *different* `(runId, strm_<id>)` via an ungated sink.
## Reachability / trigger
- A turbo optimistic first-step body calls `getWritable()` (body runs before `run_started` is durable).
- The user writes a value that contains a nested `ReadableStream` into that writable.
- `getSerializeStream` invokes `getExternalReducers`' `ReadableStream` reducer synchronously on that chunk, which creates an ungated `WorkflowServerWritableStream(runId, name)` and pushes `value.pipeTo(writable)` to `ctx.ops`.
- That background pipe flushes the nested stream's first chunk to `world.streams.write(runId, strm_id, chunk)` with no barrier → it can land before `run_started` is durable → run-not-found, exactly the race the PR is closing, one level deeper.
This is the same code shape that *was* fixed in `getStepReducers` (commit dd61604); `getExternalReducers` was simply missed.
## The fix
Mirror the `getStepReducers` change:
- Added an optional trailing `runReadyBarrier?: Promise<unknown>` param to `getExternalReducers`.
- Passed it into `new WorkflowServerWritableStream(runId, name, runReadyBarrier)`.
- Threaded it through the recursive `getExternalReducers(...)` call used for non-byte streams.
- Passed `ctx.runReadyBarrier` from `step/writable-stream.ts`'s `getWritable()`.
The param is an optional trailing argument, so all other `getExternalReducers` callers (which pass `undefined`/nothing) are unaffected and the barrier is a no-op outside turbo and on the await path, consistent with the existing `WorkflowServerWritableStream` barrier semantics.
Note: type-checking could not be executed in this environment because dependencies (`tsc`) are not installed, but the change is type-safe — the new optional param is `Promise<unknown> | undefined`, the constructor already accepts that signature, and `ctx.runReadyBarrier` is typed `Promise<unknown> | undefined`.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

@karthikscale3karthikscale3 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.

Re-reviewed current head 341cec2. I checked the runReadyBarrier propagation through setAttributes, getWritable, returned ReadableStream serialization, and nested ReadableStream serialization, plus the focused stream/attribute tests. No confirmed P0/P1 code blockers remain from my review.

@VaguelySerious
VaguelySerious merged commit 1ea2b4e into mainJun 26, 2026
180 of 184 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 1ea2b4e (AI decision).

This fix targets a race in turbo-mode optimistic start, a main-only feature. I verified that set-attributes.ts, runtime/step-executor.ts, and any reference to optimisticStart/runReadyBarrier/experimental_setAttributes/attr_set are entirely absent from packages/core/src on origin/stable, so the changed code paths and the behavior being fixed do not exist there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

1ea2b4ef77dea8ce2845867e53cf1c51a8544e6e

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

[core] Fix turbo-mode step-body writes racing run_started - #2629

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready
Jun 26, 2026
Merged

[core] Fix turbo-mode step-body writes racing run_started#2629
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

In turbo mode the first step's body runs optimistically — before the backgrounded run_started event is durable. Direct step-body world writes had no ordering gate, so they could reach the server before the run existed. Two such paths:

  1. experimental_setAttributes (host-side) wrote its attr_set event directly.
  2. getWritable() stream writes flushed chunks directly. The first chunk of a brand-new stream requires the run to exist (the World does a run lookup on stream creation), so an early write could be rejected as run-not-found — failing the step, or silently dropping the chunk if the rejection lands after the step's op-flush timeout.

The workflow-side experimental_setAttributes path (a "use workflow" body) was already gated on the run-ready barrier in the suspension handler. Only the step-body paths were unguarded. (Step-initiated aborts write directly too, but they require a pre-existing hook, which disables turbo's forced optimistic start — so they can't race.)

Fix

Thread the run-ready barrier through the step execution context and await it before the first direct step-body write:

  • step/context-storage.ts — add runReadyBarrier?: Promise<unknown> to StepContext.
  • runtime/step-executor.ts — populate it only on the optimistic-start path; undefined on the await path (run already durable).
  • set-attributes.tsawait the barrier before the attr_set create.
  • serialization.ts (WorkflowServerWritableStream) — accept the barrier; await it once before the first flush write and before close (a close with an empty buffer can itself be the first write to a new stream).
  • step/writable-stream.ts — pass ctx.runReadyBarrier into the stream.

In every case the rejection is swallowed for ordering only — a genuinely failed run_started then surfaces the real error from the write itself, mirroring the workflow-side ensureRunReady behavior. All gates are no-ops outside turbo and on the await path.

Tests

  • set-attributes.test.ts — the attr_set write fires strictly after the barrier resolves; a rejecting barrier still writes.
  • writable-stream.test.ts — the first server write/close waits for the barrier; later flushes aren't re-gated; a rejecting barrier still writes.

Typecheck + step-handler / set-attributes / serialization / writable-stream / flushable-stream suites pass. (world-local has no run-existence check on stream writes, so the stream race is Vercel-only; the unit tests gate against a fake World that models the server contract.)

🤖 Generated with Claude Code

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. The host-side
`experimental_setAttributes` path wrote its `attr_set` event directly,
so an attribute set early in that step could reach the World before the
run existed and be rejected as run-not-found. The workflow-side path was
already gated on the run-ready barrier; this extends the same gate to the
step-body path by threading the barrier through the step context.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested review from a team and ijjk as code ownersJune 25, 2026 17:31
@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 341cec2

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
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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 Jun 25, 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🥇 Nitro0.035s (-25.1% 🟢)1.005s (~)0.970s101.00x
💻 LocalExpress0.046s (-2.1%)1.006s (~)0.959s101.32x
💻 LocalNext.js (Turbopack)0.049s (-6.3% 🟢)1.005s (~)0.956s101.40x
🐘 PostgresNitro0.063s (-3.8%)1.013s (~)0.951s101.79x
🐘 PostgresExpress0.071s (+2.2%)1.012s (~)0.941s102.01x
🐘 PostgresNext.js (Turbopack)0.122s (+120.4% 🔺)1.053s (+4.0%)0.931s103.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.315s (+24.9% 🔺)2.022s (-6.8% 🟢)1.707s101.00x
▲ VercelExpress0.322s (+39.3% 🔺)2.058s (-2.2%)1.736s101.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.062s (-2.2%)2.005s (~)0.944s101.00x
🐘 PostgresNext.js (Turbopack)1.081s (~)2.014s (~)0.933s101.02x
💻 LocalExpress1.082s (~)2.007s (~)0.925s101.02x
🐘 PostgresExpress1.087s (~)2.010s (~)0.922s101.02x
💻 LocalNext.js (Turbopack)1.090s (+0.6%)2.006s (~)0.917s101.03x
🐘 PostgresNitro1.095s (-0.6%)2.010s (~)0.914s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.486s (+7.4% 🔺)3.401s (+20.2% 🔺)1.915s101.00x
▲ VercelNitro1.538s (+9.0% 🔺)3.272s (+2.7%)1.734s101.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.348s (-1.1%)11.021s (~)0.673s31.00x
🐘 PostgresNext.js (Turbopack)10.387s (-0.6%)11.011s (~)0.624s31.00x
🐘 PostgresExpress10.431s (~)11.020s (~)0.589s31.01x
💻 LocalNext.js (Turbopack)10.455s (~)11.022s (~)0.567s31.01x
💻 LocalExpress10.466s (~)11.022s (~)0.556s31.01x
🐘 PostgresNitro10.470s (~)11.019s (~)0.549s31.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.988s (-2.6%)13.964s (+0.7%)1.976s31.00x
▲ VercelNitro12.862s (+9.7% 🔺)15.204s (+13.8% 🔺)2.342s31.07x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.361s (-2.0%)14.025s (~)0.664s51.00x
🐘 PostgresNext.js (Turbopack)13.475s (-1.4%)14.014s (~)0.539s51.01x
🐘 PostgresExpress13.556s (~)14.020s (~)0.464s51.01x
🐘 PostgresNitro13.630s (-0.6%)14.018s (~)0.388s51.02x
💻 LocalExpress13.647s (~)14.028s (~)0.381s51.02x
💻 LocalNext.js (Turbopack)13.668s (+0.6%)14.026s (~)0.358s51.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.493s (+6.4% 🔺)19.519s (+8.4% 🔺)2.026s41.00x
▲ VercelNitro17.642s (+7.8% 🔺)19.618s (+10.7% 🔺)1.976s41.01x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro11.644s (-4.4%)12.022s (-7.7% 🟢)0.378s81.00x
🐘 PostgresNext.js (Turbopack)12.045s (~)12.527s (-3.8%)0.482s81.03x
💻 LocalExpress12.164s (-1.4%)13.023s (~)0.860s71.04x
🐘 PostgresNitro12.222s (~)13.019s (~)0.797s71.05x
💻 LocalNext.js (Turbopack)12.273s (~)13.025s (~)0.752s71.05x
🐘 PostgresExpress12.324s (+1.8%)13.019s (~)0.695s71.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express25.483s (+38.7% 🔺)27.630s (+37.1% 🔺)2.147s41.00x
▲ VercelNitro26.383s (+39.0% 🔺)28.653s (+38.9% 🔺)2.271s41.04x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.172s (~)2.008s (~)0.836s151.00x
🐘 PostgresNitro1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.190s (+1.2%)2.010s (~)0.820s151.02x
💻 LocalNitro1.328s (-7.6% 🟢)2.006s (~)0.678s151.13x
💻 LocalNext.js (Turbopack)1.416s (-5.5% 🟢)2.006s (~)0.591s151.21x
💻 LocalExpress1.461s (+5.1% 🔺)2.007s (~)0.546s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.277s (+12.2% 🔺)3.761s (+7.4% 🔺)1.484s91.00x
▲ VercelNitro2.286s (+7.4% 🔺)3.612s (+4.9%)1.326s91.00x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.285s (-7.7% 🟢)2.316s (-13.4% 🟢)1.031s131.00x
🐘 PostgresNitro1.298s (-3.1%)2.317s (-7.6% 🟢)1.020s131.01x
🐘 PostgresNext.js (Turbopack)1.318s (~)2.736s (-6.2% 🟢)1.418s111.03x
💻 LocalNitro2.249s (-6.6% 🟢)2.917s (~)0.668s111.75x
💻 LocalExpress2.265s (-3.9%)2.918s (~)0.652s111.76x
💻 LocalNext.js (Turbopack)2.814s (+2.9%)3.109s (~)0.295s102.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.557s (-29.6% 🟢)4.126s (-20.1% 🟢)1.569s81.00x
▲ VercelNitro3.102s (+0.7%)4.900s (-5.5% 🟢)1.798s71.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.591s (-3.0%)4.010s (-5.9% 🟢)2.419s81.00x
🐘 PostgresExpress1.662s (+4.8%)4.586s (+6.6% 🔺)2.925s71.04x
🐘 PostgresNext.js (Turbopack)2.859s (+1.6%)5.178s (-6.1% 🟢)2.319s61.80x
💻 LocalNitro4.540s (-29.5% 🟢)5.179s (-28.2% 🟢)0.638s62.85x
💻 LocalExpress6.180s (-2.3%)6.615s (-5.7% 🟢)0.435s53.88x
💻 LocalNext.js (Turbopack)6.944s (+26.9% 🔺)8.517s (+41.6% 🔺)1.573s44.36x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.963s (+29.3% 🔺)6.147s (+21.8% 🔺)2.184s51.00x
▲ VercelNitro4.029s (+20.1% 🔺)5.976s (+16.7% 🔺)1.948s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.166s (-3.3%)2.008s (~)0.841s151.00x
🐘 PostgresExpress1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.180s (+0.9%)2.008s (~)0.827s151.01x
💻 LocalNitro1.300s (-8.6% 🟢)2.006s (~)0.706s151.11x
💻 LocalExpress1.416s (-1.5%)2.007s (~)0.591s151.21x
💻 LocalNext.js (Turbopack)1.455s (+3.8%)2.007s (~)0.552s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.271s (+10.1% 🔺)3.713s (+6.1% 🔺)1.442s91.00x
▲ VercelNitro2.497s (+16.5% 🔺)4.047s (+8.9% 🔺)1.550s81.10x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.296s (-5.6% 🟢)2.316s (-6.3% 🟢)1.021s131.00x
🐘 PostgresExpress1.300s (-3.1%)2.392s (-3.2%)1.093s131.00x
🐘 PostgresNext.js (Turbopack)1.350s (+4.7%)2.674s (-8.4% 🟢)1.324s121.04x
💻 LocalNitro2.245s (-13.0% 🟢)2.826s (-9.1% 🟢)0.581s111.73x
💻 LocalExpress2.369s (-2.2%)3.110s (~)0.741s101.83x
💻 LocalNext.js (Turbopack)2.686s (+1.8%)3.008s (~)0.322s102.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.898s (+6.7% 🔺)4.652s (+7.7% 🔺)1.754s71.00x
▲ VercelExpress3.472s (-27.5% 🟢)5.420s (-18.4% 🟢)1.948s61.20x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.575s (-0.7%)4.010s (-3.0%)2.436s81.00x
🐘 PostgresNitro1.577s (-5.0%)4.136s (+3.1%)2.560s81.00x
🐘 PostgresNext.js (Turbopack)2.368s (-17.2% 🟢)4.726s (-19.2% 🟢)2.358s71.50x
💻 LocalNitro5.073s (-25.2% 🟢)6.012s (-16.7% 🟢)0.939s53.22x
💻 LocalNext.js (Turbopack)5.360s (-6.3% 🟢)6.014s (~)0.654s63.40x
💻 LocalExpress6.858s (+2.4%)7.516s (+4.1%)0.658s44.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.296s (+24.3% 🔺)6.750s (+34.1% 🔺)2.454s51.00x
▲ VercelExpress4.398s (-6.2% 🟢)6.339s (+0.7%)1.942s51.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.458s (-21.9% 🟢)1.004s (~)0.546s601.00x
🐘 PostgresNitro0.514s (-13.6% 🟢)1.023s (-1.8%)0.509s591.12x
🐘 PostgresExpress0.544s (+2.1%)1.040s (+1.7%)0.496s591.19x
💻 LocalExpress0.580s (+1.3%)1.005s (~)0.425s601.27x
💻 LocalNext.js (Turbopack)0.601s (~)1.005s (-1.7%)0.404s601.31x
🐘 PostgresNext.js (Turbopack)0.671s (+31.3% 🔺)1.086s (+8.0% 🔺)0.415s561.47x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.771s (+42.5% 🔺)5.372s (+25.0% 🔺)1.601s121.00x
▲ VercelExpress3.851s (+37.6% 🔺)5.665s (+26.3% 🔺)1.814s111.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.167s (-21.3% 🟢)2.005s (~)0.838s451.00x
🐘 PostgresExpress1.217s (-2.7%)2.007s (~)0.790s451.04x
🐘 PostgresNitro1.228s (-13.2% 🟢)2.008s (-2.3%)0.780s451.05x
🐘 PostgresNext.js (Turbopack)1.286s (+3.3%)2.035s (~)0.749s451.10x
💻 LocalExpress1.491s (+2.5%)2.028s (+1.1%)0.537s451.28x
💻 LocalNext.js (Turbopack)1.534s (+4.5%)2.007s (~)0.473s451.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.557s (+32.3% 🔺)10.541s (+31.1% 🔺)1.984s91.00x
▲ VercelNitro8.815s (+37.7% 🔺)10.553s (+35.9% 🔺)1.738s91.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)2.372s (-4.2%)3.033s (-0.8%)0.661s401.00x
🐘 PostgresExpress2.492s (-4.0%)3.058s (-0.9%)0.567s401.05x
🐘 PostgresNitro2.533s (-6.7% 🟢)3.034s (-0.8%)0.501s401.07x
💻 LocalNitro2.757s (-14.3% 🟢)3.218s (-19.7% 🟢)0.461s381.16x
💻 LocalExpress3.156s (-2.8%)4.010s (+0.8%)0.854s301.33x
💻 LocalNext.js (Turbopack)3.412s (+4.6%)4.043s (~)0.631s301.44x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express18.000s (+30.6% 🔺)20.264s (+31.1% 🔺)2.265s61.00x
▲ VercelNitro18.441s (+31.2% 🔺)20.585s (+31.7% 🔺)2.144s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.203s (-3.8%)1.006s (~)0.804s601.00x
🐘 PostgresNitro0.222s (-2.1%)1.006s (~)0.784s601.10x
🐘 PostgresNext.js (Turbopack)0.229s (+36.4% 🔺)1.016s (+1.0%)0.787s601.13x
💻 LocalNitro0.376s (-19.7% 🟢)1.004s (~)0.628s601.86x
💻 LocalExpress0.471s (+9.1% 🔺)1.005s (~)0.534s602.32x
💻 LocalNext.js (Turbopack)0.641s (+9.7% 🔺)1.022s (+1.7%)0.381s593.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.530s (-26.2% 🟢)3.038s (-20.9% 🟢)1.508s201.00x
▲ VercelNitro1.563s (-28.0% 🟢)2.980s (-23.1% 🟢)1.417s211.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.322s (+20.2% 🔺)1.024s (+1.8%)0.702s881.00x
🐘 PostgresExpress0.324s (~)1.006s (-1.1%)0.682s901.00x
🐘 PostgresNitro0.331s (-1.8%)1.017s (+1.1%)0.687s891.03x
💻 LocalNitro1.809s (-15.2% 🟢)2.402s (-10.6% 🟢)0.593s385.62x
💻 LocalExpress2.057s (-4.8%)2.655s (-3.0%)0.598s346.39x
💻 LocalNext.js (Turbopack)2.870s (+2.9%)3.510s (+7.7% 🔺)0.639s268.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.891s (-23.2% 🟢)3.600s (-11.2% 🟢)1.708s261.00x
▲ VercelNitro2.284s (+19.9% 🔺)3.993s (+14.5% 🔺)1.709s231.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.515s (~)1.059s (-0.9%)0.544s1141.00x
🐘 PostgresNitro0.541s (+2.4%)1.097s (+6.3% 🔺)0.556s1101.05x
🐘 PostgresNext.js (Turbopack)0.603s (+27.8% 🔺)2.515s (-16.4% 🟢)1.912s481.17x
💻 LocalNitro7.983s (-19.5% 🟢)8.809s (-20.1% 🟢)0.827s1415.50x
💻 LocalExpress9.967s (-1.2%)10.941s (-1.6%)0.973s1119.36x
💻 LocalNext.js (Turbopack)10.239s (+4.7%)11.303s (+4.9%)1.065s1119.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.253s (+27.9% 🔺)5.265s (+27.6% 🔺)2.012s231.00x
▲ VercelExpress3.871s (+62.0% 🔺)5.800s (+43.1% 🔺)1.928s211.19x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.121s (-3.2%)2.003s (~)0.008s (-34.7% 🟢)2.014s (~)0.893s101.00x
🐘 PostgresNext.js (Turbopack)1.143s (~)1.999s (~)0.001s (-36.4% 🟢)2.009s (~)0.866s101.02x
💻 LocalNext.js (Turbopack)1.145s (-2.0%)1.967s (~)0.012s (-0.8%)2.020s (~)0.875s101.02x
🐘 PostgresExpress1.166s (+1.4%)1.995s (~)0.001s (-10.0% 🟢)2.011s (~)0.845s101.04x
🐘 PostgresNitro1.166s (~)1.997s (~)0.001s (~)2.011s (~)0.844s101.04x
💻 LocalExpress1.201s (+4.2%)2.005s (~)0.013s (+4.2%)2.020s (~)0.819s101.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.479s (+11.7% 🔺)3.740s (+14.2% 🔺)2.670s (+43.3% 🔺)6.937s (+21.9% 🔺)4.458s101.00x
▲ VercelExpress2.728s (+33.3% 🔺)3.943s (+28.5% 🔺)3.169s (+80.9% 🔺)7.700s (+42.5% 🔺)4.972s101.10x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.434s (-7.7% 🟢)2.007s (~)0.011s (-10.5% 🟢)2.020s (~)0.587s301.00x
🐘 PostgresExpress1.525s (-1.4%)2.002s (~)0.005s (-6.6% 🟢)2.025s (~)0.500s301.06x
💻 LocalExpress1.555s (~)2.011s (~)0.012s (-3.9%)2.026s (~)0.471s301.08x
🐘 PostgresNitro1.569s (-2.2%)1.996s (~)0.006s (+11.3% 🔺)2.026s (~)0.458s301.09x
💻 LocalNext.js (Turbopack)1.583s (~)1.971s (~)0.012s (-10.5% 🟢)2.025s (~)0.442s301.10x
🐘 PostgresNext.js (Turbopack)2.048s (+33.0% 🔺)2.448s (+21.7% 🔺)0.004s (-23.1% 🟢)2.492s (+23.0% 🔺)0.444s251.43x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.953s (+18.1% 🔺)8.380s (+16.3% 🔺)0.487s (+125.5% 🔺)9.335s (+18.4% 🔺)2.382s71.00x
▲ VercelNitro7.427s (+22.3% 🔺)8.788s (+24.2% 🔺)0.382s (+68.6% 🔺)9.677s (+23.6% 🔺)2.250s71.07x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.763s (-1.4%)1.044s (~)0.000s (+Infinity% 🔺)1.075s (+1.0%)0.312s561.00x
🐘 PostgresNitro0.791s (-3.8%)1.058s (-3.7%)0.000s (-100.0% 🟢)1.077s (-3.7%)0.286s571.04x
💻 LocalNitro1.042s (-21.0% 🟢)1.616s (-18.4% 🟢)0.000s (-59.2% 🟢)1.619s (-18.4% 🟢)0.576s381.37x
💻 LocalExpress1.247s (-1.6%)1.981s (-1.6%)0.000s (+45.2% 🔺)1.984s (-1.6%)0.737s311.63x
💻 LocalNext.js (Turbopack)1.375s (+3.0%)1.979s (~)0.000s (+100.0% 🔺)2.016s (~)0.641s301.80x
🐘 PostgresNext.js (Turbopack)1.589s (+73.3% 🔺)2.107s (+65.1% 🔺)0.000s (-100.0% 🟢)2.154s (+67.8% 🔺)0.565s282.08x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.274s (+37.0% 🔺)5.404s (+22.5% 🔺)0.000s (NaN%)5.921s (+21.4% 🔺)1.647s111.00x
▲ VercelExpress4.755s (+21.7% 🔺)6.088s (+21.1% 🔺)0.000s (-45.0% 🟢)6.553s (+18.3% 🔺)1.799s101.11x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.819s (+7.3% 🔺)2.431s (+7.8% 🔺)0.000s (-100.0% 🟢)2.450s (+8.0% 🔺)0.631s251.00x
🐘 PostgresNitro1.853s (-3.4%)2.390s (-4.3%)0.000s (+92.0% 🔺)2.420s (-4.0%)0.566s251.02x
🐘 PostgresNext.js (Turbopack)2.602s (+28.1% 🔺)3.208s (+22.8% 🔺)0.000s (-100.0% 🟢)3.221s (+21.9% 🔺)0.619s191.43x
💻 LocalNitro2.682s (-24.8% 🟢)3.070s (-23.7% 🟢)0.001s (+10.3% 🔺)3.078s (-23.7% 🟢)0.396s201.47x
💻 LocalExpress3.313s (-8.8% 🟢)3.901s (-7.7% 🟢)0.001s (+5.5% 🔺)3.904s (-7.7% 🟢)0.592s161.82x
💻 LocalNext.js (Turbopack)3.446s (-5.9% 🟢)3.992s (-4.8%)0.001s (-12.5% 🟢)4.032s (-4.8%)0.587s151.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.429s (+14.7% 🔺)6.836s (+19.0% 🔺)0.000s (-100.0% 🟢)7.312s (+16.9% 🔺)1.883s91.00x
▲ VercelNitro5.774s (+18.0% 🔺)7.060s (+23.5% 🔺)0.000s (+Infinity% 🔺)7.648s (+23.6% 🔺)1.874s81.06x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro21/21
🐘 PostgresExpress9/21
▲ VercelExpress14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro🐘 Postgres12/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)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. `getWritable()` stream
writes flushed directly to the server; the first chunk of a brand-new
stream requires the run to exist (the World does a run lookup), so an
early write could be rejected as run-not-found, failing the step or
silently dropping the chunk.
Thread the run-ready barrier (already on the step context) into
`WorkflowServerWritableStream` and await it once before the first
flush/close. No-op outside turbo and on the await path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@vercelvercelBot 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.

Additional Suggestion:

In turbo optimistic start, a nested ReadableStream written into a step's getWritable() stream is piped to its own server stream via getExternalReducers without the run-ready barrier, so its first chunk can reach world.streams.write() before the backgrounded run_started is durable (run-not-found race).

Fix on Vercel

…o a step's `getWritable()` stream is piped to its own server stream via `getExternalReducers` without the run-ready barrier, so its first chunk can reach `world.streams.write()` before the backgrounded `run_started` is durable (run-not-found race).
This commit fixes the issue reported at packages/core/src/step/writable-stream.ts:81
## The bug
The PR closes a turbo-mode race where step-body world writes can reach the World before the backgrounded `run_started` is durable. It threaded a `runReadyBarrier` into:
1. `experimental_setAttributes` (`set-attributes.ts`),
2. the outer `WorkflowServerWritableStream` built by `getWritable()` (`step/writable-stream.ts` ~line 92), and
3. step return-value serialization via `getStepReducers` (`serialization.ts` ~line 1448), including its recursive call.
**Gap:** `getWritable()` builds its serialize transform with `getExternalReducers(globalThis, ctx.ops, runId, ctx.encryptionKey, true)` — *not* `getStepReducers`. Inside `getExternalReducers`, the `ReadableStream` reducer (`serialization.ts` ~line 1236) constructed:
```ts
const writable = new WorkflowServerWritableStream(runId, name); // no barrier
...
ops.push(value.pipeTo(writable)); // or framed / recursive-serialize variants
```
This pipe runs **independently** of the gated outer `serverWritable`. The barrier on the outer writable only orders writes to `(runId, name)` — the nested stream writes to a *different* `(runId, strm_<id>)` via an ungated sink.
## Reachability / trigger
- A turbo optimistic first-step body calls `getWritable()` (body runs before `run_started` is durable).
- The user writes a value that contains a nested `ReadableStream` into that writable.
- `getSerializeStream` invokes `getExternalReducers`' `ReadableStream` reducer synchronously on that chunk, which creates an ungated `WorkflowServerWritableStream(runId, name)` and pushes `value.pipeTo(writable)` to `ctx.ops`.
- That background pipe flushes the nested stream's first chunk to `world.streams.write(runId, strm_id, chunk)` with no barrier → it can land before `run_started` is durable → run-not-found, exactly the race the PR is closing, one level deeper.
This is the same code shape that *was* fixed in `getStepReducers` (commit dd61604); `getExternalReducers` was simply missed.
## The fix
Mirror the `getStepReducers` change:
- Added an optional trailing `runReadyBarrier?: Promise<unknown>` param to `getExternalReducers`.
- Passed it into `new WorkflowServerWritableStream(runId, name, runReadyBarrier)`.
- Threaded it through the recursive `getExternalReducers(...)` call used for non-byte streams.
- Passed `ctx.runReadyBarrier` from `step/writable-stream.ts`'s `getWritable()`.
The param is an optional trailing argument, so all other `getExternalReducers` callers (which pass `undefined`/nothing) are unaffected and the barrier is a no-op outside turbo and on the await path, consistent with the existing `WorkflowServerWritableStream` barrier semantics.
Note: type-checking could not be executed in this environment because dependencies (`tsc`) are not installed, but the change is type-safe — the new optional param is `Promise<unknown> | undefined`, the constructor already accepts that signature, and `ctx.runReadyBarrier` is typed `Promise<unknown> | undefined`.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

@karthikscale3karthikscale3 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.

Re-reviewed current head 341cec2. I checked the runReadyBarrier propagation through setAttributes, getWritable, returned ReadableStream serialization, and nested ReadableStream serialization, plus the focused stream/attribute tests. No confirmed P0/P1 code blockers remain from my review.

@VaguelySerious
VaguelySerious merged commit 1ea2b4e into mainJun 26, 2026
180 of 184 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 1ea2b4e (AI decision).

This fix targets a race in turbo-mode optimistic start, a main-only feature. I verified that set-attributes.ts, runtime/step-executor.ts, and any reference to optimisticStart/runReadyBarrier/experimental_setAttributes/attr_set are entirely absent from packages/core/src on origin/stable, so the changed code paths and the behavior being fixed do not exist there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

1ea2b4ef77dea8ce2845867e53cf1c51a8544e6e

@github-actionsgithub-actionsBot mentioned this pull request Jun 26, 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@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } 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] Fix turbo-mode step-body writes racing run_started - #2629

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready
Jun 26, 2026
Merged

[core] Fix turbo-mode step-body writes racing run_started#2629
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

In turbo mode the first step's body runs optimistically — before the backgrounded run_started event is durable. Direct step-body world writes had no ordering gate, so they could reach the server before the run existed. Two such paths:

  1. experimental_setAttributes (host-side) wrote its attr_set event directly.
  2. getWritable() stream writes flushed chunks directly. The first chunk of a brand-new stream requires the run to exist (the World does a run lookup on stream creation), so an early write could be rejected as run-not-found — failing the step, or silently dropping the chunk if the rejection lands after the step's op-flush timeout.

The workflow-side experimental_setAttributes path (a "use workflow" body) was already gated on the run-ready barrier in the suspension handler. Only the step-body paths were unguarded. (Step-initiated aborts write directly too, but they require a pre-existing hook, which disables turbo's forced optimistic start — so they can't race.)

Fix

Thread the run-ready barrier through the step execution context and await it before the first direct step-body write:

  • step/context-storage.ts — add runReadyBarrier?: Promise<unknown> to StepContext.
  • runtime/step-executor.ts — populate it only on the optimistic-start path; undefined on the await path (run already durable).
  • set-attributes.tsawait the barrier before the attr_set create.
  • serialization.ts (WorkflowServerWritableStream) — accept the barrier; await it once before the first flush write and before close (a close with an empty buffer can itself be the first write to a new stream).
  • step/writable-stream.ts — pass ctx.runReadyBarrier into the stream.

In every case the rejection is swallowed for ordering only — a genuinely failed run_started then surfaces the real error from the write itself, mirroring the workflow-side ensureRunReady behavior. All gates are no-ops outside turbo and on the await path.

Tests

  • set-attributes.test.ts — the attr_set write fires strictly after the barrier resolves; a rejecting barrier still writes.
  • writable-stream.test.ts — the first server write/close waits for the barrier; later flushes aren't re-gated; a rejecting barrier still writes.

Typecheck + step-handler / set-attributes / serialization / writable-stream / flushable-stream suites pass. (world-local has no run-existence check on stream writes, so the stream race is Vercel-only; the unit tests gate against a fake World that models the server contract.)

🤖 Generated with Claude Code

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. The host-side
`experimental_setAttributes` path wrote its `attr_set` event directly,
so an attribute set early in that step could reach the World before the
run existed and be rejected as run-not-found. The workflow-side path was
already gated on the run-ready barrier; this extends the same gate to the
step-body path by threading the barrier through the step context.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested review from a team and ijjk as code ownersJune 25, 2026 17:31
@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 341cec2

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
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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 Jun 25, 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🥇 Nitro0.035s (-25.1% 🟢)1.005s (~)0.970s101.00x
💻 LocalExpress0.046s (-2.1%)1.006s (~)0.959s101.32x
💻 LocalNext.js (Turbopack)0.049s (-6.3% 🟢)1.005s (~)0.956s101.40x
🐘 PostgresNitro0.063s (-3.8%)1.013s (~)0.951s101.79x
🐘 PostgresExpress0.071s (+2.2%)1.012s (~)0.941s102.01x
🐘 PostgresNext.js (Turbopack)0.122s (+120.4% 🔺)1.053s (+4.0%)0.931s103.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.315s (+24.9% 🔺)2.022s (-6.8% 🟢)1.707s101.00x
▲ VercelExpress0.322s (+39.3% 🔺)2.058s (-2.2%)1.736s101.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.062s (-2.2%)2.005s (~)0.944s101.00x
🐘 PostgresNext.js (Turbopack)1.081s (~)2.014s (~)0.933s101.02x
💻 LocalExpress1.082s (~)2.007s (~)0.925s101.02x
🐘 PostgresExpress1.087s (~)2.010s (~)0.922s101.02x
💻 LocalNext.js (Turbopack)1.090s (+0.6%)2.006s (~)0.917s101.03x
🐘 PostgresNitro1.095s (-0.6%)2.010s (~)0.914s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.486s (+7.4% 🔺)3.401s (+20.2% 🔺)1.915s101.00x
▲ VercelNitro1.538s (+9.0% 🔺)3.272s (+2.7%)1.734s101.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.348s (-1.1%)11.021s (~)0.673s31.00x
🐘 PostgresNext.js (Turbopack)10.387s (-0.6%)11.011s (~)0.624s31.00x
🐘 PostgresExpress10.431s (~)11.020s (~)0.589s31.01x
💻 LocalNext.js (Turbopack)10.455s (~)11.022s (~)0.567s31.01x
💻 LocalExpress10.466s (~)11.022s (~)0.556s31.01x
🐘 PostgresNitro10.470s (~)11.019s (~)0.549s31.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.988s (-2.6%)13.964s (+0.7%)1.976s31.00x
▲ VercelNitro12.862s (+9.7% 🔺)15.204s (+13.8% 🔺)2.342s31.07x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.361s (-2.0%)14.025s (~)0.664s51.00x
🐘 PostgresNext.js (Turbopack)13.475s (-1.4%)14.014s (~)0.539s51.01x
🐘 PostgresExpress13.556s (~)14.020s (~)0.464s51.01x
🐘 PostgresNitro13.630s (-0.6%)14.018s (~)0.388s51.02x
💻 LocalExpress13.647s (~)14.028s (~)0.381s51.02x
💻 LocalNext.js (Turbopack)13.668s (+0.6%)14.026s (~)0.358s51.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.493s (+6.4% 🔺)19.519s (+8.4% 🔺)2.026s41.00x
▲ VercelNitro17.642s (+7.8% 🔺)19.618s (+10.7% 🔺)1.976s41.01x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro11.644s (-4.4%)12.022s (-7.7% 🟢)0.378s81.00x
🐘 PostgresNext.js (Turbopack)12.045s (~)12.527s (-3.8%)0.482s81.03x
💻 LocalExpress12.164s (-1.4%)13.023s (~)0.860s71.04x
🐘 PostgresNitro12.222s (~)13.019s (~)0.797s71.05x
💻 LocalNext.js (Turbopack)12.273s (~)13.025s (~)0.752s71.05x
🐘 PostgresExpress12.324s (+1.8%)13.019s (~)0.695s71.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express25.483s (+38.7% 🔺)27.630s (+37.1% 🔺)2.147s41.00x
▲ VercelNitro26.383s (+39.0% 🔺)28.653s (+38.9% 🔺)2.271s41.04x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.172s (~)2.008s (~)0.836s151.00x
🐘 PostgresNitro1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.190s (+1.2%)2.010s (~)0.820s151.02x
💻 LocalNitro1.328s (-7.6% 🟢)2.006s (~)0.678s151.13x
💻 LocalNext.js (Turbopack)1.416s (-5.5% 🟢)2.006s (~)0.591s151.21x
💻 LocalExpress1.461s (+5.1% 🔺)2.007s (~)0.546s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.277s (+12.2% 🔺)3.761s (+7.4% 🔺)1.484s91.00x
▲ VercelNitro2.286s (+7.4% 🔺)3.612s (+4.9%)1.326s91.00x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.285s (-7.7% 🟢)2.316s (-13.4% 🟢)1.031s131.00x
🐘 PostgresNitro1.298s (-3.1%)2.317s (-7.6% 🟢)1.020s131.01x
🐘 PostgresNext.js (Turbopack)1.318s (~)2.736s (-6.2% 🟢)1.418s111.03x
💻 LocalNitro2.249s (-6.6% 🟢)2.917s (~)0.668s111.75x
💻 LocalExpress2.265s (-3.9%)2.918s (~)0.652s111.76x
💻 LocalNext.js (Turbopack)2.814s (+2.9%)3.109s (~)0.295s102.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.557s (-29.6% 🟢)4.126s (-20.1% 🟢)1.569s81.00x
▲ VercelNitro3.102s (+0.7%)4.900s (-5.5% 🟢)1.798s71.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.591s (-3.0%)4.010s (-5.9% 🟢)2.419s81.00x
🐘 PostgresExpress1.662s (+4.8%)4.586s (+6.6% 🔺)2.925s71.04x
🐘 PostgresNext.js (Turbopack)2.859s (+1.6%)5.178s (-6.1% 🟢)2.319s61.80x
💻 LocalNitro4.540s (-29.5% 🟢)5.179s (-28.2% 🟢)0.638s62.85x
💻 LocalExpress6.180s (-2.3%)6.615s (-5.7% 🟢)0.435s53.88x
💻 LocalNext.js (Turbopack)6.944s (+26.9% 🔺)8.517s (+41.6% 🔺)1.573s44.36x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.963s (+29.3% 🔺)6.147s (+21.8% 🔺)2.184s51.00x
▲ VercelNitro4.029s (+20.1% 🔺)5.976s (+16.7% 🔺)1.948s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.166s (-3.3%)2.008s (~)0.841s151.00x
🐘 PostgresExpress1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.180s (+0.9%)2.008s (~)0.827s151.01x
💻 LocalNitro1.300s (-8.6% 🟢)2.006s (~)0.706s151.11x
💻 LocalExpress1.416s (-1.5%)2.007s (~)0.591s151.21x
💻 LocalNext.js (Turbopack)1.455s (+3.8%)2.007s (~)0.552s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.271s (+10.1% 🔺)3.713s (+6.1% 🔺)1.442s91.00x
▲ VercelNitro2.497s (+16.5% 🔺)4.047s (+8.9% 🔺)1.550s81.10x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.296s (-5.6% 🟢)2.316s (-6.3% 🟢)1.021s131.00x
🐘 PostgresExpress1.300s (-3.1%)2.392s (-3.2%)1.093s131.00x
🐘 PostgresNext.js (Turbopack)1.350s (+4.7%)2.674s (-8.4% 🟢)1.324s121.04x
💻 LocalNitro2.245s (-13.0% 🟢)2.826s (-9.1% 🟢)0.581s111.73x
💻 LocalExpress2.369s (-2.2%)3.110s (~)0.741s101.83x
💻 LocalNext.js (Turbopack)2.686s (+1.8%)3.008s (~)0.322s102.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.898s (+6.7% 🔺)4.652s (+7.7% 🔺)1.754s71.00x
▲ VercelExpress3.472s (-27.5% 🟢)5.420s (-18.4% 🟢)1.948s61.20x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.575s (-0.7%)4.010s (-3.0%)2.436s81.00x
🐘 PostgresNitro1.577s (-5.0%)4.136s (+3.1%)2.560s81.00x
🐘 PostgresNext.js (Turbopack)2.368s (-17.2% 🟢)4.726s (-19.2% 🟢)2.358s71.50x
💻 LocalNitro5.073s (-25.2% 🟢)6.012s (-16.7% 🟢)0.939s53.22x
💻 LocalNext.js (Turbopack)5.360s (-6.3% 🟢)6.014s (~)0.654s63.40x
💻 LocalExpress6.858s (+2.4%)7.516s (+4.1%)0.658s44.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.296s (+24.3% 🔺)6.750s (+34.1% 🔺)2.454s51.00x
▲ VercelExpress4.398s (-6.2% 🟢)6.339s (+0.7%)1.942s51.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.458s (-21.9% 🟢)1.004s (~)0.546s601.00x
🐘 PostgresNitro0.514s (-13.6% 🟢)1.023s (-1.8%)0.509s591.12x
🐘 PostgresExpress0.544s (+2.1%)1.040s (+1.7%)0.496s591.19x
💻 LocalExpress0.580s (+1.3%)1.005s (~)0.425s601.27x
💻 LocalNext.js (Turbopack)0.601s (~)1.005s (-1.7%)0.404s601.31x
🐘 PostgresNext.js (Turbopack)0.671s (+31.3% 🔺)1.086s (+8.0% 🔺)0.415s561.47x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.771s (+42.5% 🔺)5.372s (+25.0% 🔺)1.601s121.00x
▲ VercelExpress3.851s (+37.6% 🔺)5.665s (+26.3% 🔺)1.814s111.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.167s (-21.3% 🟢)2.005s (~)0.838s451.00x
🐘 PostgresExpress1.217s (-2.7%)2.007s (~)0.790s451.04x
🐘 PostgresNitro1.228s (-13.2% 🟢)2.008s (-2.3%)0.780s451.05x
🐘 PostgresNext.js (Turbopack)1.286s (+3.3%)2.035s (~)0.749s451.10x
💻 LocalExpress1.491s (+2.5%)2.028s (+1.1%)0.537s451.28x
💻 LocalNext.js (Turbopack)1.534s (+4.5%)2.007s (~)0.473s451.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.557s (+32.3% 🔺)10.541s (+31.1% 🔺)1.984s91.00x
▲ VercelNitro8.815s (+37.7% 🔺)10.553s (+35.9% 🔺)1.738s91.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)2.372s (-4.2%)3.033s (-0.8%)0.661s401.00x
🐘 PostgresExpress2.492s (-4.0%)3.058s (-0.9%)0.567s401.05x
🐘 PostgresNitro2.533s (-6.7% 🟢)3.034s (-0.8%)0.501s401.07x
💻 LocalNitro2.757s (-14.3% 🟢)3.218s (-19.7% 🟢)0.461s381.16x
💻 LocalExpress3.156s (-2.8%)4.010s (+0.8%)0.854s301.33x
💻 LocalNext.js (Turbopack)3.412s (+4.6%)4.043s (~)0.631s301.44x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express18.000s (+30.6% 🔺)20.264s (+31.1% 🔺)2.265s61.00x
▲ VercelNitro18.441s (+31.2% 🔺)20.585s (+31.7% 🔺)2.144s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.203s (-3.8%)1.006s (~)0.804s601.00x
🐘 PostgresNitro0.222s (-2.1%)1.006s (~)0.784s601.10x
🐘 PostgresNext.js (Turbopack)0.229s (+36.4% 🔺)1.016s (+1.0%)0.787s601.13x
💻 LocalNitro0.376s (-19.7% 🟢)1.004s (~)0.628s601.86x
💻 LocalExpress0.471s (+9.1% 🔺)1.005s (~)0.534s602.32x
💻 LocalNext.js (Turbopack)0.641s (+9.7% 🔺)1.022s (+1.7%)0.381s593.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.530s (-26.2% 🟢)3.038s (-20.9% 🟢)1.508s201.00x
▲ VercelNitro1.563s (-28.0% 🟢)2.980s (-23.1% 🟢)1.417s211.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.322s (+20.2% 🔺)1.024s (+1.8%)0.702s881.00x
🐘 PostgresExpress0.324s (~)1.006s (-1.1%)0.682s901.00x
🐘 PostgresNitro0.331s (-1.8%)1.017s (+1.1%)0.687s891.03x
💻 LocalNitro1.809s (-15.2% 🟢)2.402s (-10.6% 🟢)0.593s385.62x
💻 LocalExpress2.057s (-4.8%)2.655s (-3.0%)0.598s346.39x
💻 LocalNext.js (Turbopack)2.870s (+2.9%)3.510s (+7.7% 🔺)0.639s268.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.891s (-23.2% 🟢)3.600s (-11.2% 🟢)1.708s261.00x
▲ VercelNitro2.284s (+19.9% 🔺)3.993s (+14.5% 🔺)1.709s231.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.515s (~)1.059s (-0.9%)0.544s1141.00x
🐘 PostgresNitro0.541s (+2.4%)1.097s (+6.3% 🔺)0.556s1101.05x
🐘 PostgresNext.js (Turbopack)0.603s (+27.8% 🔺)2.515s (-16.4% 🟢)1.912s481.17x
💻 LocalNitro7.983s (-19.5% 🟢)8.809s (-20.1% 🟢)0.827s1415.50x
💻 LocalExpress9.967s (-1.2%)10.941s (-1.6%)0.973s1119.36x
💻 LocalNext.js (Turbopack)10.239s (+4.7%)11.303s (+4.9%)1.065s1119.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.253s (+27.9% 🔺)5.265s (+27.6% 🔺)2.012s231.00x
▲ VercelExpress3.871s (+62.0% 🔺)5.800s (+43.1% 🔺)1.928s211.19x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.121s (-3.2%)2.003s (~)0.008s (-34.7% 🟢)2.014s (~)0.893s101.00x
🐘 PostgresNext.js (Turbopack)1.143s (~)1.999s (~)0.001s (-36.4% 🟢)2.009s (~)0.866s101.02x
💻 LocalNext.js (Turbopack)1.145s (-2.0%)1.967s (~)0.012s (-0.8%)2.020s (~)0.875s101.02x
🐘 PostgresExpress1.166s (+1.4%)1.995s (~)0.001s (-10.0% 🟢)2.011s (~)0.845s101.04x
🐘 PostgresNitro1.166s (~)1.997s (~)0.001s (~)2.011s (~)0.844s101.04x
💻 LocalExpress1.201s (+4.2%)2.005s (~)0.013s (+4.2%)2.020s (~)0.819s101.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.479s (+11.7% 🔺)3.740s (+14.2% 🔺)2.670s (+43.3% 🔺)6.937s (+21.9% 🔺)4.458s101.00x
▲ VercelExpress2.728s (+33.3% 🔺)3.943s (+28.5% 🔺)3.169s (+80.9% 🔺)7.700s (+42.5% 🔺)4.972s101.10x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.434s (-7.7% 🟢)2.007s (~)0.011s (-10.5% 🟢)2.020s (~)0.587s301.00x
🐘 PostgresExpress1.525s (-1.4%)2.002s (~)0.005s (-6.6% 🟢)2.025s (~)0.500s301.06x
💻 LocalExpress1.555s (~)2.011s (~)0.012s (-3.9%)2.026s (~)0.471s301.08x
🐘 PostgresNitro1.569s (-2.2%)1.996s (~)0.006s (+11.3% 🔺)2.026s (~)0.458s301.09x
💻 LocalNext.js (Turbopack)1.583s (~)1.971s (~)0.012s (-10.5% 🟢)2.025s (~)0.442s301.10x
🐘 PostgresNext.js (Turbopack)2.048s (+33.0% 🔺)2.448s (+21.7% 🔺)0.004s (-23.1% 🟢)2.492s (+23.0% 🔺)0.444s251.43x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.953s (+18.1% 🔺)8.380s (+16.3% 🔺)0.487s (+125.5% 🔺)9.335s (+18.4% 🔺)2.382s71.00x
▲ VercelNitro7.427s (+22.3% 🔺)8.788s (+24.2% 🔺)0.382s (+68.6% 🔺)9.677s (+23.6% 🔺)2.250s71.07x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.763s (-1.4%)1.044s (~)0.000s (+Infinity% 🔺)1.075s (+1.0%)0.312s561.00x
🐘 PostgresNitro0.791s (-3.8%)1.058s (-3.7%)0.000s (-100.0% 🟢)1.077s (-3.7%)0.286s571.04x
💻 LocalNitro1.042s (-21.0% 🟢)1.616s (-18.4% 🟢)0.000s (-59.2% 🟢)1.619s (-18.4% 🟢)0.576s381.37x
💻 LocalExpress1.247s (-1.6%)1.981s (-1.6%)0.000s (+45.2% 🔺)1.984s (-1.6%)0.737s311.63x
💻 LocalNext.js (Turbopack)1.375s (+3.0%)1.979s (~)0.000s (+100.0% 🔺)2.016s (~)0.641s301.80x
🐘 PostgresNext.js (Turbopack)1.589s (+73.3% 🔺)2.107s (+65.1% 🔺)0.000s (-100.0% 🟢)2.154s (+67.8% 🔺)0.565s282.08x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.274s (+37.0% 🔺)5.404s (+22.5% 🔺)0.000s (NaN%)5.921s (+21.4% 🔺)1.647s111.00x
▲ VercelExpress4.755s (+21.7% 🔺)6.088s (+21.1% 🔺)0.000s (-45.0% 🟢)6.553s (+18.3% 🔺)1.799s101.11x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.819s (+7.3% 🔺)2.431s (+7.8% 🔺)0.000s (-100.0% 🟢)2.450s (+8.0% 🔺)0.631s251.00x
🐘 PostgresNitro1.853s (-3.4%)2.390s (-4.3%)0.000s (+92.0% 🔺)2.420s (-4.0%)0.566s251.02x
🐘 PostgresNext.js (Turbopack)2.602s (+28.1% 🔺)3.208s (+22.8% 🔺)0.000s (-100.0% 🟢)3.221s (+21.9% 🔺)0.619s191.43x
💻 LocalNitro2.682s (-24.8% 🟢)3.070s (-23.7% 🟢)0.001s (+10.3% 🔺)3.078s (-23.7% 🟢)0.396s201.47x
💻 LocalExpress3.313s (-8.8% 🟢)3.901s (-7.7% 🟢)0.001s (+5.5% 🔺)3.904s (-7.7% 🟢)0.592s161.82x
💻 LocalNext.js (Turbopack)3.446s (-5.9% 🟢)3.992s (-4.8%)0.001s (-12.5% 🟢)4.032s (-4.8%)0.587s151.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.429s (+14.7% 🔺)6.836s (+19.0% 🔺)0.000s (-100.0% 🟢)7.312s (+16.9% 🔺)1.883s91.00x
▲ VercelNitro5.774s (+18.0% 🔺)7.060s (+23.5% 🔺)0.000s (+Infinity% 🔺)7.648s (+23.6% 🔺)1.874s81.06x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro21/21
🐘 PostgresExpress9/21
▲ VercelExpress14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro🐘 Postgres12/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)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. `getWritable()` stream
writes flushed directly to the server; the first chunk of a brand-new
stream requires the run to exist (the World does a run lookup), so an
early write could be rejected as run-not-found, failing the step or
silently dropping the chunk.
Thread the run-ready barrier (already on the step context) into
`WorkflowServerWritableStream` and await it once before the first
flush/close. No-op outside turbo and on the await path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@vercelvercelBot 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.

Additional Suggestion:

In turbo optimistic start, a nested ReadableStream written into a step's getWritable() stream is piped to its own server stream via getExternalReducers without the run-ready barrier, so its first chunk can reach world.streams.write() before the backgrounded run_started is durable (run-not-found race).

Fix on Vercel

…o a step's `getWritable()` stream is piped to its own server stream via `getExternalReducers` without the run-ready barrier, so its first chunk can reach `world.streams.write()` before the backgrounded `run_started` is durable (run-not-found race).
This commit fixes the issue reported at packages/core/src/step/writable-stream.ts:81
## The bug
The PR closes a turbo-mode race where step-body world writes can reach the World before the backgrounded `run_started` is durable. It threaded a `runReadyBarrier` into:
1. `experimental_setAttributes` (`set-attributes.ts`),
2. the outer `WorkflowServerWritableStream` built by `getWritable()` (`step/writable-stream.ts` ~line 92), and
3. step return-value serialization via `getStepReducers` (`serialization.ts` ~line 1448), including its recursive call.
**Gap:** `getWritable()` builds its serialize transform with `getExternalReducers(globalThis, ctx.ops, runId, ctx.encryptionKey, true)` — *not* `getStepReducers`. Inside `getExternalReducers`, the `ReadableStream` reducer (`serialization.ts` ~line 1236) constructed:
```ts
const writable = new WorkflowServerWritableStream(runId, name); // no barrier
...
ops.push(value.pipeTo(writable)); // or framed / recursive-serialize variants
```
This pipe runs **independently** of the gated outer `serverWritable`. The barrier on the outer writable only orders writes to `(runId, name)` — the nested stream writes to a *different* `(runId, strm_<id>)` via an ungated sink.
## Reachability / trigger
- A turbo optimistic first-step body calls `getWritable()` (body runs before `run_started` is durable).
- The user writes a value that contains a nested `ReadableStream` into that writable.
- `getSerializeStream` invokes `getExternalReducers`' `ReadableStream` reducer synchronously on that chunk, which creates an ungated `WorkflowServerWritableStream(runId, name)` and pushes `value.pipeTo(writable)` to `ctx.ops`.
- That background pipe flushes the nested stream's first chunk to `world.streams.write(runId, strm_id, chunk)` with no barrier → it can land before `run_started` is durable → run-not-found, exactly the race the PR is closing, one level deeper.
This is the same code shape that *was* fixed in `getStepReducers` (commit dd61604); `getExternalReducers` was simply missed.
## The fix
Mirror the `getStepReducers` change:
- Added an optional trailing `runReadyBarrier?: Promise<unknown>` param to `getExternalReducers`.
- Passed it into `new WorkflowServerWritableStream(runId, name, runReadyBarrier)`.
- Threaded it through the recursive `getExternalReducers(...)` call used for non-byte streams.
- Passed `ctx.runReadyBarrier` from `step/writable-stream.ts`'s `getWritable()`.
The param is an optional trailing argument, so all other `getExternalReducers` callers (which pass `undefined`/nothing) are unaffected and the barrier is a no-op outside turbo and on the await path, consistent with the existing `WorkflowServerWritableStream` barrier semantics.
Note: type-checking could not be executed in this environment because dependencies (`tsc`) are not installed, but the change is type-safe — the new optional param is `Promise<unknown> | undefined`, the constructor already accepts that signature, and `ctx.runReadyBarrier` is typed `Promise<unknown> | undefined`.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

@karthikscale3karthikscale3 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.

Re-reviewed current head 341cec2. I checked the runReadyBarrier propagation through setAttributes, getWritable, returned ReadableStream serialization, and nested ReadableStream serialization, plus the focused stream/attribute tests. No confirmed P0/P1 code blockers remain from my review.

@VaguelySerious
VaguelySerious merged commit 1ea2b4e into mainJun 26, 2026
180 of 184 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 1ea2b4e (AI decision).

This fix targets a race in turbo-mode optimistic start, a main-only feature. I verified that set-attributes.ts, runtime/step-executor.ts, and any reference to optimisticStart/runReadyBarrier/experimental_setAttributes/attr_set are entirely absent from packages/core/src on origin/stable, so the changed code paths and the behavior being fixed do not exist there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

1ea2b4ef77dea8ce2845867e53cf1c51a8544e6e

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

[core] Fix turbo-mode step-body writes racing run_started - #2629

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready
Jun 26, 2026
Merged

[core] Fix turbo-mode step-body writes racing run_started#2629
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

In turbo mode the first step's body runs optimistically — before the backgrounded run_started event is durable. Direct step-body world writes had no ordering gate, so they could reach the server before the run existed. Two such paths:

  1. experimental_setAttributes (host-side) wrote its attr_set event directly.
  2. getWritable() stream writes flushed chunks directly. The first chunk of a brand-new stream requires the run to exist (the World does a run lookup on stream creation), so an early write could be rejected as run-not-found — failing the step, or silently dropping the chunk if the rejection lands after the step's op-flush timeout.

The workflow-side experimental_setAttributes path (a "use workflow" body) was already gated on the run-ready barrier in the suspension handler. Only the step-body paths were unguarded. (Step-initiated aborts write directly too, but they require a pre-existing hook, which disables turbo's forced optimistic start — so they can't race.)

Fix

Thread the run-ready barrier through the step execution context and await it before the first direct step-body write:

  • step/context-storage.ts — add runReadyBarrier?: Promise<unknown> to StepContext.
  • runtime/step-executor.ts — populate it only on the optimistic-start path; undefined on the await path (run already durable).
  • set-attributes.tsawait the barrier before the attr_set create.
  • serialization.ts (WorkflowServerWritableStream) — accept the barrier; await it once before the first flush write and before close (a close with an empty buffer can itself be the first write to a new stream).
  • step/writable-stream.ts — pass ctx.runReadyBarrier into the stream.

In every case the rejection is swallowed for ordering only — a genuinely failed run_started then surfaces the real error from the write itself, mirroring the workflow-side ensureRunReady behavior. All gates are no-ops outside turbo and on the await path.

Tests

  • set-attributes.test.ts — the attr_set write fires strictly after the barrier resolves; a rejecting barrier still writes.
  • writable-stream.test.ts — the first server write/close waits for the barrier; later flushes aren't re-gated; a rejecting barrier still writes.

Typecheck + step-handler / set-attributes / serialization / writable-stream / flushable-stream suites pass. (world-local has no run-existence check on stream writes, so the stream race is Vercel-only; the unit tests gate against a fake World that models the server contract.)

🤖 Generated with Claude Code

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. The host-side
`experimental_setAttributes` path wrote its `attr_set` event directly,
so an attribute set early in that step could reach the World before the
run existed and be rejected as run-not-found. The workflow-side path was
already gated on the run-ready barrier; this extends the same gate to the
step-body path by threading the barrier through the step context.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested review from a team and ijjk as code ownersJune 25, 2026 17:31
@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 341cec2

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
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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 Jun 25, 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🥇 Nitro0.035s (-25.1% 🟢)1.005s (~)0.970s101.00x
💻 LocalExpress0.046s (-2.1%)1.006s (~)0.959s101.32x
💻 LocalNext.js (Turbopack)0.049s (-6.3% 🟢)1.005s (~)0.956s101.40x
🐘 PostgresNitro0.063s (-3.8%)1.013s (~)0.951s101.79x
🐘 PostgresExpress0.071s (+2.2%)1.012s (~)0.941s102.01x
🐘 PostgresNext.js (Turbopack)0.122s (+120.4% 🔺)1.053s (+4.0%)0.931s103.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.315s (+24.9% 🔺)2.022s (-6.8% 🟢)1.707s101.00x
▲ VercelExpress0.322s (+39.3% 🔺)2.058s (-2.2%)1.736s101.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.062s (-2.2%)2.005s (~)0.944s101.00x
🐘 PostgresNext.js (Turbopack)1.081s (~)2.014s (~)0.933s101.02x
💻 LocalExpress1.082s (~)2.007s (~)0.925s101.02x
🐘 PostgresExpress1.087s (~)2.010s (~)0.922s101.02x
💻 LocalNext.js (Turbopack)1.090s (+0.6%)2.006s (~)0.917s101.03x
🐘 PostgresNitro1.095s (-0.6%)2.010s (~)0.914s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.486s (+7.4% 🔺)3.401s (+20.2% 🔺)1.915s101.00x
▲ VercelNitro1.538s (+9.0% 🔺)3.272s (+2.7%)1.734s101.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.348s (-1.1%)11.021s (~)0.673s31.00x
🐘 PostgresNext.js (Turbopack)10.387s (-0.6%)11.011s (~)0.624s31.00x
🐘 PostgresExpress10.431s (~)11.020s (~)0.589s31.01x
💻 LocalNext.js (Turbopack)10.455s (~)11.022s (~)0.567s31.01x
💻 LocalExpress10.466s (~)11.022s (~)0.556s31.01x
🐘 PostgresNitro10.470s (~)11.019s (~)0.549s31.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.988s (-2.6%)13.964s (+0.7%)1.976s31.00x
▲ VercelNitro12.862s (+9.7% 🔺)15.204s (+13.8% 🔺)2.342s31.07x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.361s (-2.0%)14.025s (~)0.664s51.00x
🐘 PostgresNext.js (Turbopack)13.475s (-1.4%)14.014s (~)0.539s51.01x
🐘 PostgresExpress13.556s (~)14.020s (~)0.464s51.01x
🐘 PostgresNitro13.630s (-0.6%)14.018s (~)0.388s51.02x
💻 LocalExpress13.647s (~)14.028s (~)0.381s51.02x
💻 LocalNext.js (Turbopack)13.668s (+0.6%)14.026s (~)0.358s51.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.493s (+6.4% 🔺)19.519s (+8.4% 🔺)2.026s41.00x
▲ VercelNitro17.642s (+7.8% 🔺)19.618s (+10.7% 🔺)1.976s41.01x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro11.644s (-4.4%)12.022s (-7.7% 🟢)0.378s81.00x
🐘 PostgresNext.js (Turbopack)12.045s (~)12.527s (-3.8%)0.482s81.03x
💻 LocalExpress12.164s (-1.4%)13.023s (~)0.860s71.04x
🐘 PostgresNitro12.222s (~)13.019s (~)0.797s71.05x
💻 LocalNext.js (Turbopack)12.273s (~)13.025s (~)0.752s71.05x
🐘 PostgresExpress12.324s (+1.8%)13.019s (~)0.695s71.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express25.483s (+38.7% 🔺)27.630s (+37.1% 🔺)2.147s41.00x
▲ VercelNitro26.383s (+39.0% 🔺)28.653s (+38.9% 🔺)2.271s41.04x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.172s (~)2.008s (~)0.836s151.00x
🐘 PostgresNitro1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.190s (+1.2%)2.010s (~)0.820s151.02x
💻 LocalNitro1.328s (-7.6% 🟢)2.006s (~)0.678s151.13x
💻 LocalNext.js (Turbopack)1.416s (-5.5% 🟢)2.006s (~)0.591s151.21x
💻 LocalExpress1.461s (+5.1% 🔺)2.007s (~)0.546s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.277s (+12.2% 🔺)3.761s (+7.4% 🔺)1.484s91.00x
▲ VercelNitro2.286s (+7.4% 🔺)3.612s (+4.9%)1.326s91.00x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.285s (-7.7% 🟢)2.316s (-13.4% 🟢)1.031s131.00x
🐘 PostgresNitro1.298s (-3.1%)2.317s (-7.6% 🟢)1.020s131.01x
🐘 PostgresNext.js (Turbopack)1.318s (~)2.736s (-6.2% 🟢)1.418s111.03x
💻 LocalNitro2.249s (-6.6% 🟢)2.917s (~)0.668s111.75x
💻 LocalExpress2.265s (-3.9%)2.918s (~)0.652s111.76x
💻 LocalNext.js (Turbopack)2.814s (+2.9%)3.109s (~)0.295s102.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.557s (-29.6% 🟢)4.126s (-20.1% 🟢)1.569s81.00x
▲ VercelNitro3.102s (+0.7%)4.900s (-5.5% 🟢)1.798s71.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.591s (-3.0%)4.010s (-5.9% 🟢)2.419s81.00x
🐘 PostgresExpress1.662s (+4.8%)4.586s (+6.6% 🔺)2.925s71.04x
🐘 PostgresNext.js (Turbopack)2.859s (+1.6%)5.178s (-6.1% 🟢)2.319s61.80x
💻 LocalNitro4.540s (-29.5% 🟢)5.179s (-28.2% 🟢)0.638s62.85x
💻 LocalExpress6.180s (-2.3%)6.615s (-5.7% 🟢)0.435s53.88x
💻 LocalNext.js (Turbopack)6.944s (+26.9% 🔺)8.517s (+41.6% 🔺)1.573s44.36x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.963s (+29.3% 🔺)6.147s (+21.8% 🔺)2.184s51.00x
▲ VercelNitro4.029s (+20.1% 🔺)5.976s (+16.7% 🔺)1.948s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.166s (-3.3%)2.008s (~)0.841s151.00x
🐘 PostgresExpress1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.180s (+0.9%)2.008s (~)0.827s151.01x
💻 LocalNitro1.300s (-8.6% 🟢)2.006s (~)0.706s151.11x
💻 LocalExpress1.416s (-1.5%)2.007s (~)0.591s151.21x
💻 LocalNext.js (Turbopack)1.455s (+3.8%)2.007s (~)0.552s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.271s (+10.1% 🔺)3.713s (+6.1% 🔺)1.442s91.00x
▲ VercelNitro2.497s (+16.5% 🔺)4.047s (+8.9% 🔺)1.550s81.10x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.296s (-5.6% 🟢)2.316s (-6.3% 🟢)1.021s131.00x
🐘 PostgresExpress1.300s (-3.1%)2.392s (-3.2%)1.093s131.00x
🐘 PostgresNext.js (Turbopack)1.350s (+4.7%)2.674s (-8.4% 🟢)1.324s121.04x
💻 LocalNitro2.245s (-13.0% 🟢)2.826s (-9.1% 🟢)0.581s111.73x
💻 LocalExpress2.369s (-2.2%)3.110s (~)0.741s101.83x
💻 LocalNext.js (Turbopack)2.686s (+1.8%)3.008s (~)0.322s102.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.898s (+6.7% 🔺)4.652s (+7.7% 🔺)1.754s71.00x
▲ VercelExpress3.472s (-27.5% 🟢)5.420s (-18.4% 🟢)1.948s61.20x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.575s (-0.7%)4.010s (-3.0%)2.436s81.00x
🐘 PostgresNitro1.577s (-5.0%)4.136s (+3.1%)2.560s81.00x
🐘 PostgresNext.js (Turbopack)2.368s (-17.2% 🟢)4.726s (-19.2% 🟢)2.358s71.50x
💻 LocalNitro5.073s (-25.2% 🟢)6.012s (-16.7% 🟢)0.939s53.22x
💻 LocalNext.js (Turbopack)5.360s (-6.3% 🟢)6.014s (~)0.654s63.40x
💻 LocalExpress6.858s (+2.4%)7.516s (+4.1%)0.658s44.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.296s (+24.3% 🔺)6.750s (+34.1% 🔺)2.454s51.00x
▲ VercelExpress4.398s (-6.2% 🟢)6.339s (+0.7%)1.942s51.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.458s (-21.9% 🟢)1.004s (~)0.546s601.00x
🐘 PostgresNitro0.514s (-13.6% 🟢)1.023s (-1.8%)0.509s591.12x
🐘 PostgresExpress0.544s (+2.1%)1.040s (+1.7%)0.496s591.19x
💻 LocalExpress0.580s (+1.3%)1.005s (~)0.425s601.27x
💻 LocalNext.js (Turbopack)0.601s (~)1.005s (-1.7%)0.404s601.31x
🐘 PostgresNext.js (Turbopack)0.671s (+31.3% 🔺)1.086s (+8.0% 🔺)0.415s561.47x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.771s (+42.5% 🔺)5.372s (+25.0% 🔺)1.601s121.00x
▲ VercelExpress3.851s (+37.6% 🔺)5.665s (+26.3% 🔺)1.814s111.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.167s (-21.3% 🟢)2.005s (~)0.838s451.00x
🐘 PostgresExpress1.217s (-2.7%)2.007s (~)0.790s451.04x
🐘 PostgresNitro1.228s (-13.2% 🟢)2.008s (-2.3%)0.780s451.05x
🐘 PostgresNext.js (Turbopack)1.286s (+3.3%)2.035s (~)0.749s451.10x
💻 LocalExpress1.491s (+2.5%)2.028s (+1.1%)0.537s451.28x
💻 LocalNext.js (Turbopack)1.534s (+4.5%)2.007s (~)0.473s451.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.557s (+32.3% 🔺)10.541s (+31.1% 🔺)1.984s91.00x
▲ VercelNitro8.815s (+37.7% 🔺)10.553s (+35.9% 🔺)1.738s91.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)2.372s (-4.2%)3.033s (-0.8%)0.661s401.00x
🐘 PostgresExpress2.492s (-4.0%)3.058s (-0.9%)0.567s401.05x
🐘 PostgresNitro2.533s (-6.7% 🟢)3.034s (-0.8%)0.501s401.07x
💻 LocalNitro2.757s (-14.3% 🟢)3.218s (-19.7% 🟢)0.461s381.16x
💻 LocalExpress3.156s (-2.8%)4.010s (+0.8%)0.854s301.33x
💻 LocalNext.js (Turbopack)3.412s (+4.6%)4.043s (~)0.631s301.44x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express18.000s (+30.6% 🔺)20.264s (+31.1% 🔺)2.265s61.00x
▲ VercelNitro18.441s (+31.2% 🔺)20.585s (+31.7% 🔺)2.144s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.203s (-3.8%)1.006s (~)0.804s601.00x
🐘 PostgresNitro0.222s (-2.1%)1.006s (~)0.784s601.10x
🐘 PostgresNext.js (Turbopack)0.229s (+36.4% 🔺)1.016s (+1.0%)0.787s601.13x
💻 LocalNitro0.376s (-19.7% 🟢)1.004s (~)0.628s601.86x
💻 LocalExpress0.471s (+9.1% 🔺)1.005s (~)0.534s602.32x
💻 LocalNext.js (Turbopack)0.641s (+9.7% 🔺)1.022s (+1.7%)0.381s593.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.530s (-26.2% 🟢)3.038s (-20.9% 🟢)1.508s201.00x
▲ VercelNitro1.563s (-28.0% 🟢)2.980s (-23.1% 🟢)1.417s211.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.322s (+20.2% 🔺)1.024s (+1.8%)0.702s881.00x
🐘 PostgresExpress0.324s (~)1.006s (-1.1%)0.682s901.00x
🐘 PostgresNitro0.331s (-1.8%)1.017s (+1.1%)0.687s891.03x
💻 LocalNitro1.809s (-15.2% 🟢)2.402s (-10.6% 🟢)0.593s385.62x
💻 LocalExpress2.057s (-4.8%)2.655s (-3.0%)0.598s346.39x
💻 LocalNext.js (Turbopack)2.870s (+2.9%)3.510s (+7.7% 🔺)0.639s268.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.891s (-23.2% 🟢)3.600s (-11.2% 🟢)1.708s261.00x
▲ VercelNitro2.284s (+19.9% 🔺)3.993s (+14.5% 🔺)1.709s231.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.515s (~)1.059s (-0.9%)0.544s1141.00x
🐘 PostgresNitro0.541s (+2.4%)1.097s (+6.3% 🔺)0.556s1101.05x
🐘 PostgresNext.js (Turbopack)0.603s (+27.8% 🔺)2.515s (-16.4% 🟢)1.912s481.17x
💻 LocalNitro7.983s (-19.5% 🟢)8.809s (-20.1% 🟢)0.827s1415.50x
💻 LocalExpress9.967s (-1.2%)10.941s (-1.6%)0.973s1119.36x
💻 LocalNext.js (Turbopack)10.239s (+4.7%)11.303s (+4.9%)1.065s1119.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.253s (+27.9% 🔺)5.265s (+27.6% 🔺)2.012s231.00x
▲ VercelExpress3.871s (+62.0% 🔺)5.800s (+43.1% 🔺)1.928s211.19x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.121s (-3.2%)2.003s (~)0.008s (-34.7% 🟢)2.014s (~)0.893s101.00x
🐘 PostgresNext.js (Turbopack)1.143s (~)1.999s (~)0.001s (-36.4% 🟢)2.009s (~)0.866s101.02x
💻 LocalNext.js (Turbopack)1.145s (-2.0%)1.967s (~)0.012s (-0.8%)2.020s (~)0.875s101.02x
🐘 PostgresExpress1.166s (+1.4%)1.995s (~)0.001s (-10.0% 🟢)2.011s (~)0.845s101.04x
🐘 PostgresNitro1.166s (~)1.997s (~)0.001s (~)2.011s (~)0.844s101.04x
💻 LocalExpress1.201s (+4.2%)2.005s (~)0.013s (+4.2%)2.020s (~)0.819s101.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.479s (+11.7% 🔺)3.740s (+14.2% 🔺)2.670s (+43.3% 🔺)6.937s (+21.9% 🔺)4.458s101.00x
▲ VercelExpress2.728s (+33.3% 🔺)3.943s (+28.5% 🔺)3.169s (+80.9% 🔺)7.700s (+42.5% 🔺)4.972s101.10x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.434s (-7.7% 🟢)2.007s (~)0.011s (-10.5% 🟢)2.020s (~)0.587s301.00x
🐘 PostgresExpress1.525s (-1.4%)2.002s (~)0.005s (-6.6% 🟢)2.025s (~)0.500s301.06x
💻 LocalExpress1.555s (~)2.011s (~)0.012s (-3.9%)2.026s (~)0.471s301.08x
🐘 PostgresNitro1.569s (-2.2%)1.996s (~)0.006s (+11.3% 🔺)2.026s (~)0.458s301.09x
💻 LocalNext.js (Turbopack)1.583s (~)1.971s (~)0.012s (-10.5% 🟢)2.025s (~)0.442s301.10x
🐘 PostgresNext.js (Turbopack)2.048s (+33.0% 🔺)2.448s (+21.7% 🔺)0.004s (-23.1% 🟢)2.492s (+23.0% 🔺)0.444s251.43x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.953s (+18.1% 🔺)8.380s (+16.3% 🔺)0.487s (+125.5% 🔺)9.335s (+18.4% 🔺)2.382s71.00x
▲ VercelNitro7.427s (+22.3% 🔺)8.788s (+24.2% 🔺)0.382s (+68.6% 🔺)9.677s (+23.6% 🔺)2.250s71.07x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.763s (-1.4%)1.044s (~)0.000s (+Infinity% 🔺)1.075s (+1.0%)0.312s561.00x
🐘 PostgresNitro0.791s (-3.8%)1.058s (-3.7%)0.000s (-100.0% 🟢)1.077s (-3.7%)0.286s571.04x
💻 LocalNitro1.042s (-21.0% 🟢)1.616s (-18.4% 🟢)0.000s (-59.2% 🟢)1.619s (-18.4% 🟢)0.576s381.37x
💻 LocalExpress1.247s (-1.6%)1.981s (-1.6%)0.000s (+45.2% 🔺)1.984s (-1.6%)0.737s311.63x
💻 LocalNext.js (Turbopack)1.375s (+3.0%)1.979s (~)0.000s (+100.0% 🔺)2.016s (~)0.641s301.80x
🐘 PostgresNext.js (Turbopack)1.589s (+73.3% 🔺)2.107s (+65.1% 🔺)0.000s (-100.0% 🟢)2.154s (+67.8% 🔺)0.565s282.08x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.274s (+37.0% 🔺)5.404s (+22.5% 🔺)0.000s (NaN%)5.921s (+21.4% 🔺)1.647s111.00x
▲ VercelExpress4.755s (+21.7% 🔺)6.088s (+21.1% 🔺)0.000s (-45.0% 🟢)6.553s (+18.3% 🔺)1.799s101.11x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.819s (+7.3% 🔺)2.431s (+7.8% 🔺)0.000s (-100.0% 🟢)2.450s (+8.0% 🔺)0.631s251.00x
🐘 PostgresNitro1.853s (-3.4%)2.390s (-4.3%)0.000s (+92.0% 🔺)2.420s (-4.0%)0.566s251.02x
🐘 PostgresNext.js (Turbopack)2.602s (+28.1% 🔺)3.208s (+22.8% 🔺)0.000s (-100.0% 🟢)3.221s (+21.9% 🔺)0.619s191.43x
💻 LocalNitro2.682s (-24.8% 🟢)3.070s (-23.7% 🟢)0.001s (+10.3% 🔺)3.078s (-23.7% 🟢)0.396s201.47x
💻 LocalExpress3.313s (-8.8% 🟢)3.901s (-7.7% 🟢)0.001s (+5.5% 🔺)3.904s (-7.7% 🟢)0.592s161.82x
💻 LocalNext.js (Turbopack)3.446s (-5.9% 🟢)3.992s (-4.8%)0.001s (-12.5% 🟢)4.032s (-4.8%)0.587s151.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.429s (+14.7% 🔺)6.836s (+19.0% 🔺)0.000s (-100.0% 🟢)7.312s (+16.9% 🔺)1.883s91.00x
▲ VercelNitro5.774s (+18.0% 🔺)7.060s (+23.5% 🔺)0.000s (+Infinity% 🔺)7.648s (+23.6% 🔺)1.874s81.06x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro21/21
🐘 PostgresExpress9/21
▲ VercelExpress14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro🐘 Postgres12/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)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. `getWritable()` stream
writes flushed directly to the server; the first chunk of a brand-new
stream requires the run to exist (the World does a run lookup), so an
early write could be rejected as run-not-found, failing the step or
silently dropping the chunk.
Thread the run-ready barrier (already on the step context) into
`WorkflowServerWritableStream` and await it once before the first
flush/close. No-op outside turbo and on the await path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@vercelvercelBot 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.

Additional Suggestion:

In turbo optimistic start, a nested ReadableStream written into a step's getWritable() stream is piped to its own server stream via getExternalReducers without the run-ready barrier, so its first chunk can reach world.streams.write() before the backgrounded run_started is durable (run-not-found race).

Fix on Vercel

…o a step's `getWritable()` stream is piped to its own server stream via `getExternalReducers` without the run-ready barrier, so its first chunk can reach `world.streams.write()` before the backgrounded `run_started` is durable (run-not-found race).
This commit fixes the issue reported at packages/core/src/step/writable-stream.ts:81
## The bug
The PR closes a turbo-mode race where step-body world writes can reach the World before the backgrounded `run_started` is durable. It threaded a `runReadyBarrier` into:
1. `experimental_setAttributes` (`set-attributes.ts`),
2. the outer `WorkflowServerWritableStream` built by `getWritable()` (`step/writable-stream.ts` ~line 92), and
3. step return-value serialization via `getStepReducers` (`serialization.ts` ~line 1448), including its recursive call.
**Gap:** `getWritable()` builds its serialize transform with `getExternalReducers(globalThis, ctx.ops, runId, ctx.encryptionKey, true)` — *not* `getStepReducers`. Inside `getExternalReducers`, the `ReadableStream` reducer (`serialization.ts` ~line 1236) constructed:
```ts
const writable = new WorkflowServerWritableStream(runId, name); // no barrier
...
ops.push(value.pipeTo(writable)); // or framed / recursive-serialize variants
```
This pipe runs **independently** of the gated outer `serverWritable`. The barrier on the outer writable only orders writes to `(runId, name)` — the nested stream writes to a *different* `(runId, strm_<id>)` via an ungated sink.
## Reachability / trigger
- A turbo optimistic first-step body calls `getWritable()` (body runs before `run_started` is durable).
- The user writes a value that contains a nested `ReadableStream` into that writable.
- `getSerializeStream` invokes `getExternalReducers`' `ReadableStream` reducer synchronously on that chunk, which creates an ungated `WorkflowServerWritableStream(runId, name)` and pushes `value.pipeTo(writable)` to `ctx.ops`.
- That background pipe flushes the nested stream's first chunk to `world.streams.write(runId, strm_id, chunk)` with no barrier → it can land before `run_started` is durable → run-not-found, exactly the race the PR is closing, one level deeper.
This is the same code shape that *was* fixed in `getStepReducers` (commit dd61604); `getExternalReducers` was simply missed.
## The fix
Mirror the `getStepReducers` change:
- Added an optional trailing `runReadyBarrier?: Promise<unknown>` param to `getExternalReducers`.
- Passed it into `new WorkflowServerWritableStream(runId, name, runReadyBarrier)`.
- Threaded it through the recursive `getExternalReducers(...)` call used for non-byte streams.
- Passed `ctx.runReadyBarrier` from `step/writable-stream.ts`'s `getWritable()`.
The param is an optional trailing argument, so all other `getExternalReducers` callers (which pass `undefined`/nothing) are unaffected and the barrier is a no-op outside turbo and on the await path, consistent with the existing `WorkflowServerWritableStream` barrier semantics.
Note: type-checking could not be executed in this environment because dependencies (`tsc`) are not installed, but the change is type-safe — the new optional param is `Promise<unknown> | undefined`, the constructor already accepts that signature, and `ctx.runReadyBarrier` is typed `Promise<unknown> | undefined`.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

@karthikscale3karthikscale3 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.

Re-reviewed current head 341cec2. I checked the runReadyBarrier propagation through setAttributes, getWritable, returned ReadableStream serialization, and nested ReadableStream serialization, plus the focused stream/attribute tests. No confirmed P0/P1 code blockers remain from my review.

@VaguelySerious
VaguelySerious merged commit 1ea2b4e into mainJun 26, 2026
180 of 184 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 1ea2b4e (AI decision).

This fix targets a race in turbo-mode optimistic start, a main-only feature. I verified that set-attributes.ts, runtime/step-executor.ts, and any reference to optimisticStart/runReadyBarrier/experimental_setAttributes/attr_set are entirely absent from packages/core/src on origin/stable, so the changed code paths and the behavior being fixed do not exist there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

1ea2b4ef77dea8ce2845867e53cf1c51a8544e6e

@github-actionsgithub-actionsBot mentioned this pull request Jun 26, 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@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[core] Fix turbo-mode step-body writes racing run_started - #2629

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready
Jun 26, 2026
Merged

[core] Fix turbo-mode step-body writes racing run_started#2629
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

In turbo mode the first step's body runs optimistically — before the backgrounded run_started event is durable. Direct step-body world writes had no ordering gate, so they could reach the server before the run existed. Two such paths:

  1. experimental_setAttributes (host-side) wrote its attr_set event directly.
  2. getWritable() stream writes flushed chunks directly. The first chunk of a brand-new stream requires the run to exist (the World does a run lookup on stream creation), so an early write could be rejected as run-not-found — failing the step, or silently dropping the chunk if the rejection lands after the step's op-flush timeout.

The workflow-side experimental_setAttributes path (a "use workflow" body) was already gated on the run-ready barrier in the suspension handler. Only the step-body paths were unguarded. (Step-initiated aborts write directly too, but they require a pre-existing hook, which disables turbo's forced optimistic start — so they can't race.)

Fix

Thread the run-ready barrier through the step execution context and await it before the first direct step-body write:

  • step/context-storage.ts — add runReadyBarrier?: Promise<unknown> to StepContext.
  • runtime/step-executor.ts — populate it only on the optimistic-start path; undefined on the await path (run already durable).
  • set-attributes.tsawait the barrier before the attr_set create.
  • serialization.ts (WorkflowServerWritableStream) — accept the barrier; await it once before the first flush write and before close (a close with an empty buffer can itself be the first write to a new stream).
  • step/writable-stream.ts — pass ctx.runReadyBarrier into the stream.

In every case the rejection is swallowed for ordering only — a genuinely failed run_started then surfaces the real error from the write itself, mirroring the workflow-side ensureRunReady behavior. All gates are no-ops outside turbo and on the await path.

Tests

  • set-attributes.test.ts — the attr_set write fires strictly after the barrier resolves; a rejecting barrier still writes.
  • writable-stream.test.ts — the first server write/close waits for the barrier; later flushes aren't re-gated; a rejecting barrier still writes.

Typecheck + step-handler / set-attributes / serialization / writable-stream / flushable-stream suites pass. (world-local has no run-existence check on stream writes, so the stream race is Vercel-only; the unit tests gate against a fake World that models the server contract.)

🤖 Generated with Claude Code

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. The host-side
`experimental_setAttributes` path wrote its `attr_set` event directly,
so an attribute set early in that step could reach the World before the
run existed and be rejected as run-not-found. The workflow-side path was
already gated on the run-ready barrier; this extends the same gate to the
step-body path by threading the barrier through the step context.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested review from a team and ijjk as code ownersJune 25, 2026 17:31
@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 341cec2

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
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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 Jun 25, 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🥇 Nitro0.035s (-25.1% 🟢)1.005s (~)0.970s101.00x
💻 LocalExpress0.046s (-2.1%)1.006s (~)0.959s101.32x
💻 LocalNext.js (Turbopack)0.049s (-6.3% 🟢)1.005s (~)0.956s101.40x
🐘 PostgresNitro0.063s (-3.8%)1.013s (~)0.951s101.79x
🐘 PostgresExpress0.071s (+2.2%)1.012s (~)0.941s102.01x
🐘 PostgresNext.js (Turbopack)0.122s (+120.4% 🔺)1.053s (+4.0%)0.931s103.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.315s (+24.9% 🔺)2.022s (-6.8% 🟢)1.707s101.00x
▲ VercelExpress0.322s (+39.3% 🔺)2.058s (-2.2%)1.736s101.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.062s (-2.2%)2.005s (~)0.944s101.00x
🐘 PostgresNext.js (Turbopack)1.081s (~)2.014s (~)0.933s101.02x
💻 LocalExpress1.082s (~)2.007s (~)0.925s101.02x
🐘 PostgresExpress1.087s (~)2.010s (~)0.922s101.02x
💻 LocalNext.js (Turbopack)1.090s (+0.6%)2.006s (~)0.917s101.03x
🐘 PostgresNitro1.095s (-0.6%)2.010s (~)0.914s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.486s (+7.4% 🔺)3.401s (+20.2% 🔺)1.915s101.00x
▲ VercelNitro1.538s (+9.0% 🔺)3.272s (+2.7%)1.734s101.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.348s (-1.1%)11.021s (~)0.673s31.00x
🐘 PostgresNext.js (Turbopack)10.387s (-0.6%)11.011s (~)0.624s31.00x
🐘 PostgresExpress10.431s (~)11.020s (~)0.589s31.01x
💻 LocalNext.js (Turbopack)10.455s (~)11.022s (~)0.567s31.01x
💻 LocalExpress10.466s (~)11.022s (~)0.556s31.01x
🐘 PostgresNitro10.470s (~)11.019s (~)0.549s31.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.988s (-2.6%)13.964s (+0.7%)1.976s31.00x
▲ VercelNitro12.862s (+9.7% 🔺)15.204s (+13.8% 🔺)2.342s31.07x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.361s (-2.0%)14.025s (~)0.664s51.00x
🐘 PostgresNext.js (Turbopack)13.475s (-1.4%)14.014s (~)0.539s51.01x
🐘 PostgresExpress13.556s (~)14.020s (~)0.464s51.01x
🐘 PostgresNitro13.630s (-0.6%)14.018s (~)0.388s51.02x
💻 LocalExpress13.647s (~)14.028s (~)0.381s51.02x
💻 LocalNext.js (Turbopack)13.668s (+0.6%)14.026s (~)0.358s51.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.493s (+6.4% 🔺)19.519s (+8.4% 🔺)2.026s41.00x
▲ VercelNitro17.642s (+7.8% 🔺)19.618s (+10.7% 🔺)1.976s41.01x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro11.644s (-4.4%)12.022s (-7.7% 🟢)0.378s81.00x
🐘 PostgresNext.js (Turbopack)12.045s (~)12.527s (-3.8%)0.482s81.03x
💻 LocalExpress12.164s (-1.4%)13.023s (~)0.860s71.04x
🐘 PostgresNitro12.222s (~)13.019s (~)0.797s71.05x
💻 LocalNext.js (Turbopack)12.273s (~)13.025s (~)0.752s71.05x
🐘 PostgresExpress12.324s (+1.8%)13.019s (~)0.695s71.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express25.483s (+38.7% 🔺)27.630s (+37.1% 🔺)2.147s41.00x
▲ VercelNitro26.383s (+39.0% 🔺)28.653s (+38.9% 🔺)2.271s41.04x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.172s (~)2.008s (~)0.836s151.00x
🐘 PostgresNitro1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.190s (+1.2%)2.010s (~)0.820s151.02x
💻 LocalNitro1.328s (-7.6% 🟢)2.006s (~)0.678s151.13x
💻 LocalNext.js (Turbopack)1.416s (-5.5% 🟢)2.006s (~)0.591s151.21x
💻 LocalExpress1.461s (+5.1% 🔺)2.007s (~)0.546s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.277s (+12.2% 🔺)3.761s (+7.4% 🔺)1.484s91.00x
▲ VercelNitro2.286s (+7.4% 🔺)3.612s (+4.9%)1.326s91.00x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.285s (-7.7% 🟢)2.316s (-13.4% 🟢)1.031s131.00x
🐘 PostgresNitro1.298s (-3.1%)2.317s (-7.6% 🟢)1.020s131.01x
🐘 PostgresNext.js (Turbopack)1.318s (~)2.736s (-6.2% 🟢)1.418s111.03x
💻 LocalNitro2.249s (-6.6% 🟢)2.917s (~)0.668s111.75x
💻 LocalExpress2.265s (-3.9%)2.918s (~)0.652s111.76x
💻 LocalNext.js (Turbopack)2.814s (+2.9%)3.109s (~)0.295s102.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.557s (-29.6% 🟢)4.126s (-20.1% 🟢)1.569s81.00x
▲ VercelNitro3.102s (+0.7%)4.900s (-5.5% 🟢)1.798s71.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.591s (-3.0%)4.010s (-5.9% 🟢)2.419s81.00x
🐘 PostgresExpress1.662s (+4.8%)4.586s (+6.6% 🔺)2.925s71.04x
🐘 PostgresNext.js (Turbopack)2.859s (+1.6%)5.178s (-6.1% 🟢)2.319s61.80x
💻 LocalNitro4.540s (-29.5% 🟢)5.179s (-28.2% 🟢)0.638s62.85x
💻 LocalExpress6.180s (-2.3%)6.615s (-5.7% 🟢)0.435s53.88x
💻 LocalNext.js (Turbopack)6.944s (+26.9% 🔺)8.517s (+41.6% 🔺)1.573s44.36x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.963s (+29.3% 🔺)6.147s (+21.8% 🔺)2.184s51.00x
▲ VercelNitro4.029s (+20.1% 🔺)5.976s (+16.7% 🔺)1.948s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.166s (-3.3%)2.008s (~)0.841s151.00x
🐘 PostgresExpress1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.180s (+0.9%)2.008s (~)0.827s151.01x
💻 LocalNitro1.300s (-8.6% 🟢)2.006s (~)0.706s151.11x
💻 LocalExpress1.416s (-1.5%)2.007s (~)0.591s151.21x
💻 LocalNext.js (Turbopack)1.455s (+3.8%)2.007s (~)0.552s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.271s (+10.1% 🔺)3.713s (+6.1% 🔺)1.442s91.00x
▲ VercelNitro2.497s (+16.5% 🔺)4.047s (+8.9% 🔺)1.550s81.10x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.296s (-5.6% 🟢)2.316s (-6.3% 🟢)1.021s131.00x
🐘 PostgresExpress1.300s (-3.1%)2.392s (-3.2%)1.093s131.00x
🐘 PostgresNext.js (Turbopack)1.350s (+4.7%)2.674s (-8.4% 🟢)1.324s121.04x
💻 LocalNitro2.245s (-13.0% 🟢)2.826s (-9.1% 🟢)0.581s111.73x
💻 LocalExpress2.369s (-2.2%)3.110s (~)0.741s101.83x
💻 LocalNext.js (Turbopack)2.686s (+1.8%)3.008s (~)0.322s102.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.898s (+6.7% 🔺)4.652s (+7.7% 🔺)1.754s71.00x
▲ VercelExpress3.472s (-27.5% 🟢)5.420s (-18.4% 🟢)1.948s61.20x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.575s (-0.7%)4.010s (-3.0%)2.436s81.00x
🐘 PostgresNitro1.577s (-5.0%)4.136s (+3.1%)2.560s81.00x
🐘 PostgresNext.js (Turbopack)2.368s (-17.2% 🟢)4.726s (-19.2% 🟢)2.358s71.50x
💻 LocalNitro5.073s (-25.2% 🟢)6.012s (-16.7% 🟢)0.939s53.22x
💻 LocalNext.js (Turbopack)5.360s (-6.3% 🟢)6.014s (~)0.654s63.40x
💻 LocalExpress6.858s (+2.4%)7.516s (+4.1%)0.658s44.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.296s (+24.3% 🔺)6.750s (+34.1% 🔺)2.454s51.00x
▲ VercelExpress4.398s (-6.2% 🟢)6.339s (+0.7%)1.942s51.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.458s (-21.9% 🟢)1.004s (~)0.546s601.00x
🐘 PostgresNitro0.514s (-13.6% 🟢)1.023s (-1.8%)0.509s591.12x
🐘 PostgresExpress0.544s (+2.1%)1.040s (+1.7%)0.496s591.19x
💻 LocalExpress0.580s (+1.3%)1.005s (~)0.425s601.27x
💻 LocalNext.js (Turbopack)0.601s (~)1.005s (-1.7%)0.404s601.31x
🐘 PostgresNext.js (Turbopack)0.671s (+31.3% 🔺)1.086s (+8.0% 🔺)0.415s561.47x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.771s (+42.5% 🔺)5.372s (+25.0% 🔺)1.601s121.00x
▲ VercelExpress3.851s (+37.6% 🔺)5.665s (+26.3% 🔺)1.814s111.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.167s (-21.3% 🟢)2.005s (~)0.838s451.00x
🐘 PostgresExpress1.217s (-2.7%)2.007s (~)0.790s451.04x
🐘 PostgresNitro1.228s (-13.2% 🟢)2.008s (-2.3%)0.780s451.05x
🐘 PostgresNext.js (Turbopack)1.286s (+3.3%)2.035s (~)0.749s451.10x
💻 LocalExpress1.491s (+2.5%)2.028s (+1.1%)0.537s451.28x
💻 LocalNext.js (Turbopack)1.534s (+4.5%)2.007s (~)0.473s451.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.557s (+32.3% 🔺)10.541s (+31.1% 🔺)1.984s91.00x
▲ VercelNitro8.815s (+37.7% 🔺)10.553s (+35.9% 🔺)1.738s91.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)2.372s (-4.2%)3.033s (-0.8%)0.661s401.00x
🐘 PostgresExpress2.492s (-4.0%)3.058s (-0.9%)0.567s401.05x
🐘 PostgresNitro2.533s (-6.7% 🟢)3.034s (-0.8%)0.501s401.07x
💻 LocalNitro2.757s (-14.3% 🟢)3.218s (-19.7% 🟢)0.461s381.16x
💻 LocalExpress3.156s (-2.8%)4.010s (+0.8%)0.854s301.33x
💻 LocalNext.js (Turbopack)3.412s (+4.6%)4.043s (~)0.631s301.44x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express18.000s (+30.6% 🔺)20.264s (+31.1% 🔺)2.265s61.00x
▲ VercelNitro18.441s (+31.2% 🔺)20.585s (+31.7% 🔺)2.144s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.203s (-3.8%)1.006s (~)0.804s601.00x
🐘 PostgresNitro0.222s (-2.1%)1.006s (~)0.784s601.10x
🐘 PostgresNext.js (Turbopack)0.229s (+36.4% 🔺)1.016s (+1.0%)0.787s601.13x
💻 LocalNitro0.376s (-19.7% 🟢)1.004s (~)0.628s601.86x
💻 LocalExpress0.471s (+9.1% 🔺)1.005s (~)0.534s602.32x
💻 LocalNext.js (Turbopack)0.641s (+9.7% 🔺)1.022s (+1.7%)0.381s593.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.530s (-26.2% 🟢)3.038s (-20.9% 🟢)1.508s201.00x
▲ VercelNitro1.563s (-28.0% 🟢)2.980s (-23.1% 🟢)1.417s211.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.322s (+20.2% 🔺)1.024s (+1.8%)0.702s881.00x
🐘 PostgresExpress0.324s (~)1.006s (-1.1%)0.682s901.00x
🐘 PostgresNitro0.331s (-1.8%)1.017s (+1.1%)0.687s891.03x
💻 LocalNitro1.809s (-15.2% 🟢)2.402s (-10.6% 🟢)0.593s385.62x
💻 LocalExpress2.057s (-4.8%)2.655s (-3.0%)0.598s346.39x
💻 LocalNext.js (Turbopack)2.870s (+2.9%)3.510s (+7.7% 🔺)0.639s268.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.891s (-23.2% 🟢)3.600s (-11.2% 🟢)1.708s261.00x
▲ VercelNitro2.284s (+19.9% 🔺)3.993s (+14.5% 🔺)1.709s231.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.515s (~)1.059s (-0.9%)0.544s1141.00x
🐘 PostgresNitro0.541s (+2.4%)1.097s (+6.3% 🔺)0.556s1101.05x
🐘 PostgresNext.js (Turbopack)0.603s (+27.8% 🔺)2.515s (-16.4% 🟢)1.912s481.17x
💻 LocalNitro7.983s (-19.5% 🟢)8.809s (-20.1% 🟢)0.827s1415.50x
💻 LocalExpress9.967s (-1.2%)10.941s (-1.6%)0.973s1119.36x
💻 LocalNext.js (Turbopack)10.239s (+4.7%)11.303s (+4.9%)1.065s1119.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.253s (+27.9% 🔺)5.265s (+27.6% 🔺)2.012s231.00x
▲ VercelExpress3.871s (+62.0% 🔺)5.800s (+43.1% 🔺)1.928s211.19x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.121s (-3.2%)2.003s (~)0.008s (-34.7% 🟢)2.014s (~)0.893s101.00x
🐘 PostgresNext.js (Turbopack)1.143s (~)1.999s (~)0.001s (-36.4% 🟢)2.009s (~)0.866s101.02x
💻 LocalNext.js (Turbopack)1.145s (-2.0%)1.967s (~)0.012s (-0.8%)2.020s (~)0.875s101.02x
🐘 PostgresExpress1.166s (+1.4%)1.995s (~)0.001s (-10.0% 🟢)2.011s (~)0.845s101.04x
🐘 PostgresNitro1.166s (~)1.997s (~)0.001s (~)2.011s (~)0.844s101.04x
💻 LocalExpress1.201s (+4.2%)2.005s (~)0.013s (+4.2%)2.020s (~)0.819s101.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.479s (+11.7% 🔺)3.740s (+14.2% 🔺)2.670s (+43.3% 🔺)6.937s (+21.9% 🔺)4.458s101.00x
▲ VercelExpress2.728s (+33.3% 🔺)3.943s (+28.5% 🔺)3.169s (+80.9% 🔺)7.700s (+42.5% 🔺)4.972s101.10x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.434s (-7.7% 🟢)2.007s (~)0.011s (-10.5% 🟢)2.020s (~)0.587s301.00x
🐘 PostgresExpress1.525s (-1.4%)2.002s (~)0.005s (-6.6% 🟢)2.025s (~)0.500s301.06x
💻 LocalExpress1.555s (~)2.011s (~)0.012s (-3.9%)2.026s (~)0.471s301.08x
🐘 PostgresNitro1.569s (-2.2%)1.996s (~)0.006s (+11.3% 🔺)2.026s (~)0.458s301.09x
💻 LocalNext.js (Turbopack)1.583s (~)1.971s (~)0.012s (-10.5% 🟢)2.025s (~)0.442s301.10x
🐘 PostgresNext.js (Turbopack)2.048s (+33.0% 🔺)2.448s (+21.7% 🔺)0.004s (-23.1% 🟢)2.492s (+23.0% 🔺)0.444s251.43x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.953s (+18.1% 🔺)8.380s (+16.3% 🔺)0.487s (+125.5% 🔺)9.335s (+18.4% 🔺)2.382s71.00x
▲ VercelNitro7.427s (+22.3% 🔺)8.788s (+24.2% 🔺)0.382s (+68.6% 🔺)9.677s (+23.6% 🔺)2.250s71.07x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.763s (-1.4%)1.044s (~)0.000s (+Infinity% 🔺)1.075s (+1.0%)0.312s561.00x
🐘 PostgresNitro0.791s (-3.8%)1.058s (-3.7%)0.000s (-100.0% 🟢)1.077s (-3.7%)0.286s571.04x
💻 LocalNitro1.042s (-21.0% 🟢)1.616s (-18.4% 🟢)0.000s (-59.2% 🟢)1.619s (-18.4% 🟢)0.576s381.37x
💻 LocalExpress1.247s (-1.6%)1.981s (-1.6%)0.000s (+45.2% 🔺)1.984s (-1.6%)0.737s311.63x
💻 LocalNext.js (Turbopack)1.375s (+3.0%)1.979s (~)0.000s (+100.0% 🔺)2.016s (~)0.641s301.80x
🐘 PostgresNext.js (Turbopack)1.589s (+73.3% 🔺)2.107s (+65.1% 🔺)0.000s (-100.0% 🟢)2.154s (+67.8% 🔺)0.565s282.08x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.274s (+37.0% 🔺)5.404s (+22.5% 🔺)0.000s (NaN%)5.921s (+21.4% 🔺)1.647s111.00x
▲ VercelExpress4.755s (+21.7% 🔺)6.088s (+21.1% 🔺)0.000s (-45.0% 🟢)6.553s (+18.3% 🔺)1.799s101.11x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.819s (+7.3% 🔺)2.431s (+7.8% 🔺)0.000s (-100.0% 🟢)2.450s (+8.0% 🔺)0.631s251.00x
🐘 PostgresNitro1.853s (-3.4%)2.390s (-4.3%)0.000s (+92.0% 🔺)2.420s (-4.0%)0.566s251.02x
🐘 PostgresNext.js (Turbopack)2.602s (+28.1% 🔺)3.208s (+22.8% 🔺)0.000s (-100.0% 🟢)3.221s (+21.9% 🔺)0.619s191.43x
💻 LocalNitro2.682s (-24.8% 🟢)3.070s (-23.7% 🟢)0.001s (+10.3% 🔺)3.078s (-23.7% 🟢)0.396s201.47x
💻 LocalExpress3.313s (-8.8% 🟢)3.901s (-7.7% 🟢)0.001s (+5.5% 🔺)3.904s (-7.7% 🟢)0.592s161.82x
💻 LocalNext.js (Turbopack)3.446s (-5.9% 🟢)3.992s (-4.8%)0.001s (-12.5% 🟢)4.032s (-4.8%)0.587s151.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.429s (+14.7% 🔺)6.836s (+19.0% 🔺)0.000s (-100.0% 🟢)7.312s (+16.9% 🔺)1.883s91.00x
▲ VercelNitro5.774s (+18.0% 🔺)7.060s (+23.5% 🔺)0.000s (+Infinity% 🔺)7.648s (+23.6% 🔺)1.874s81.06x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro21/21
🐘 PostgresExpress9/21
▲ VercelExpress14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro🐘 Postgres12/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)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. `getWritable()` stream
writes flushed directly to the server; the first chunk of a brand-new
stream requires the run to exist (the World does a run lookup), so an
early write could be rejected as run-not-found, failing the step or
silently dropping the chunk.
Thread the run-ready barrier (already on the step context) into
`WorkflowServerWritableStream` and await it once before the first
flush/close. No-op outside turbo and on the await path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@vercelvercelBot 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.

Additional Suggestion:

In turbo optimistic start, a nested ReadableStream written into a step's getWritable() stream is piped to its own server stream via getExternalReducers without the run-ready barrier, so its first chunk can reach world.streams.write() before the backgrounded run_started is durable (run-not-found race).

Fix on Vercel

…o a step's `getWritable()` stream is piped to its own server stream via `getExternalReducers` without the run-ready barrier, so its first chunk can reach `world.streams.write()` before the backgrounded `run_started` is durable (run-not-found race).
This commit fixes the issue reported at packages/core/src/step/writable-stream.ts:81
## The bug
The PR closes a turbo-mode race where step-body world writes can reach the World before the backgrounded `run_started` is durable. It threaded a `runReadyBarrier` into:
1. `experimental_setAttributes` (`set-attributes.ts`),
2. the outer `WorkflowServerWritableStream` built by `getWritable()` (`step/writable-stream.ts` ~line 92), and
3. step return-value serialization via `getStepReducers` (`serialization.ts` ~line 1448), including its recursive call.
**Gap:** `getWritable()` builds its serialize transform with `getExternalReducers(globalThis, ctx.ops, runId, ctx.encryptionKey, true)` — *not* `getStepReducers`. Inside `getExternalReducers`, the `ReadableStream` reducer (`serialization.ts` ~line 1236) constructed:
```ts
const writable = new WorkflowServerWritableStream(runId, name); // no barrier
...
ops.push(value.pipeTo(writable)); // or framed / recursive-serialize variants
```
This pipe runs **independently** of the gated outer `serverWritable`. The barrier on the outer writable only orders writes to `(runId, name)` — the nested stream writes to a *different* `(runId, strm_<id>)` via an ungated sink.
## Reachability / trigger
- A turbo optimistic first-step body calls `getWritable()` (body runs before `run_started` is durable).
- The user writes a value that contains a nested `ReadableStream` into that writable.
- `getSerializeStream` invokes `getExternalReducers`' `ReadableStream` reducer synchronously on that chunk, which creates an ungated `WorkflowServerWritableStream(runId, name)` and pushes `value.pipeTo(writable)` to `ctx.ops`.
- That background pipe flushes the nested stream's first chunk to `world.streams.write(runId, strm_id, chunk)` with no barrier → it can land before `run_started` is durable → run-not-found, exactly the race the PR is closing, one level deeper.
This is the same code shape that *was* fixed in `getStepReducers` (commit dd61604); `getExternalReducers` was simply missed.
## The fix
Mirror the `getStepReducers` change:
- Added an optional trailing `runReadyBarrier?: Promise<unknown>` param to `getExternalReducers`.
- Passed it into `new WorkflowServerWritableStream(runId, name, runReadyBarrier)`.
- Threaded it through the recursive `getExternalReducers(...)` call used for non-byte streams.
- Passed `ctx.runReadyBarrier` from `step/writable-stream.ts`'s `getWritable()`.
The param is an optional trailing argument, so all other `getExternalReducers` callers (which pass `undefined`/nothing) are unaffected and the barrier is a no-op outside turbo and on the await path, consistent with the existing `WorkflowServerWritableStream` barrier semantics.
Note: type-checking could not be executed in this environment because dependencies (`tsc`) are not installed, but the change is type-safe — the new optional param is `Promise<unknown> | undefined`, the constructor already accepts that signature, and `ctx.runReadyBarrier` is typed `Promise<unknown> | undefined`.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

@karthikscale3karthikscale3 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.

Re-reviewed current head 341cec2. I checked the runReadyBarrier propagation through setAttributes, getWritable, returned ReadableStream serialization, and nested ReadableStream serialization, plus the focused stream/attribute tests. No confirmed P0/P1 code blockers remain from my review.

@VaguelySerious
VaguelySerious merged commit 1ea2b4e into mainJun 26, 2026
180 of 184 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 1ea2b4e (AI decision).

This fix targets a race in turbo-mode optimistic start, a main-only feature. I verified that set-attributes.ts, runtime/step-executor.ts, and any reference to optimisticStart/runReadyBarrier/experimental_setAttributes/attr_set are entirely absent from packages/core/src on origin/stable, so the changed code paths and the behavior being fixed do not exist there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

1ea2b4ef77dea8ce2845867e53cf1c51a8544e6e

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

[core] Fix turbo-mode step-body writes racing run_started - #2629

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready
Jun 26, 2026
Merged

[core] Fix turbo-mode step-body writes racing run_started#2629
VaguelySerious merged 4 commits into
mainfrom
peter/turbo-setattr-run-ready

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Jun 25, 2026

Copy link
Copy Markdown
Member

Problem

In turbo mode the first step's body runs optimistically — before the backgrounded run_started event is durable. Direct step-body world writes had no ordering gate, so they could reach the server before the run existed. Two such paths:

  1. experimental_setAttributes (host-side) wrote its attr_set event directly.
  2. getWritable() stream writes flushed chunks directly. The first chunk of a brand-new stream requires the run to exist (the World does a run lookup on stream creation), so an early write could be rejected as run-not-found — failing the step, or silently dropping the chunk if the rejection lands after the step's op-flush timeout.

The workflow-side experimental_setAttributes path (a "use workflow" body) was already gated on the run-ready barrier in the suspension handler. Only the step-body paths were unguarded. (Step-initiated aborts write directly too, but they require a pre-existing hook, which disables turbo's forced optimistic start — so they can't race.)

Fix

Thread the run-ready barrier through the step execution context and await it before the first direct step-body write:

  • step/context-storage.ts — add runReadyBarrier?: Promise<unknown> to StepContext.
  • runtime/step-executor.ts — populate it only on the optimistic-start path; undefined on the await path (run already durable).
  • set-attributes.tsawait the barrier before the attr_set create.
  • serialization.ts (WorkflowServerWritableStream) — accept the barrier; await it once before the first flush write and before close (a close with an empty buffer can itself be the first write to a new stream).
  • step/writable-stream.ts — pass ctx.runReadyBarrier into the stream.

In every case the rejection is swallowed for ordering only — a genuinely failed run_started then surfaces the real error from the write itself, mirroring the workflow-side ensureRunReady behavior. All gates are no-ops outside turbo and on the await path.

Tests

  • set-attributes.test.ts — the attr_set write fires strictly after the barrier resolves; a rejecting barrier still writes.
  • writable-stream.test.ts — the first server write/close waits for the barrier; later flushes aren't re-gated; a rejecting barrier still writes.

Typecheck + step-handler / set-attributes / serialization / writable-stream / flushable-stream suites pass. (world-local has no run-existence check on stream writes, so the stream race is Vercel-only; the unit tests gate against a fake World that models the server contract.)

🤖 Generated with Claude Code

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. The host-side
`experimental_setAttributes` path wrote its `attr_set` event directly,
so an attribute set early in that step could reach the World before the
run existed and be rejected as run-not-found. The workflow-side path was
already gated on the run-ready barrier; this extends the same gate to the
step-body path by threading the barrier through the step context.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested review from a team and ijjk as code ownersJune 25, 2026 17:31
@vercel

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 341cec2

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
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

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 Jun 25, 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🥇 Nitro0.035s (-25.1% 🟢)1.005s (~)0.970s101.00x
💻 LocalExpress0.046s (-2.1%)1.006s (~)0.959s101.32x
💻 LocalNext.js (Turbopack)0.049s (-6.3% 🟢)1.005s (~)0.956s101.40x
🐘 PostgresNitro0.063s (-3.8%)1.013s (~)0.951s101.79x
🐘 PostgresExpress0.071s (+2.2%)1.012s (~)0.941s102.01x
🐘 PostgresNext.js (Turbopack)0.122s (+120.4% 🔺)1.053s (+4.0%)0.931s103.46x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.315s (+24.9% 🔺)2.022s (-6.8% 🟢)1.707s101.00x
▲ VercelExpress0.322s (+39.3% 🔺)2.058s (-2.2%)1.736s101.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.062s (-2.2%)2.005s (~)0.944s101.00x
🐘 PostgresNext.js (Turbopack)1.081s (~)2.014s (~)0.933s101.02x
💻 LocalExpress1.082s (~)2.007s (~)0.925s101.02x
🐘 PostgresExpress1.087s (~)2.010s (~)0.922s101.02x
💻 LocalNext.js (Turbopack)1.090s (+0.6%)2.006s (~)0.917s101.03x
🐘 PostgresNitro1.095s (-0.6%)2.010s (~)0.914s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.486s (+7.4% 🔺)3.401s (+20.2% 🔺)1.915s101.00x
▲ VercelNitro1.538s (+9.0% 🔺)3.272s (+2.7%)1.734s101.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.348s (-1.1%)11.021s (~)0.673s31.00x
🐘 PostgresNext.js (Turbopack)10.387s (-0.6%)11.011s (~)0.624s31.00x
🐘 PostgresExpress10.431s (~)11.020s (~)0.589s31.01x
💻 LocalNext.js (Turbopack)10.455s (~)11.022s (~)0.567s31.01x
💻 LocalExpress10.466s (~)11.022s (~)0.556s31.01x
🐘 PostgresNitro10.470s (~)11.019s (~)0.549s31.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express11.988s (-2.6%)13.964s (+0.7%)1.976s31.00x
▲ VercelNitro12.862s (+9.7% 🔺)15.204s (+13.8% 🔺)2.342s31.07x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.361s (-2.0%)14.025s (~)0.664s51.00x
🐘 PostgresNext.js (Turbopack)13.475s (-1.4%)14.014s (~)0.539s51.01x
🐘 PostgresExpress13.556s (~)14.020s (~)0.464s51.01x
🐘 PostgresNitro13.630s (-0.6%)14.018s (~)0.388s51.02x
💻 LocalExpress13.647s (~)14.028s (~)0.381s51.02x
💻 LocalNext.js (Turbopack)13.668s (+0.6%)14.026s (~)0.358s51.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.493s (+6.4% 🔺)19.519s (+8.4% 🔺)2.026s41.00x
▲ VercelNitro17.642s (+7.8% 🔺)19.618s (+10.7% 🔺)1.976s41.01x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro11.644s (-4.4%)12.022s (-7.7% 🟢)0.378s81.00x
🐘 PostgresNext.js (Turbopack)12.045s (~)12.527s (-3.8%)0.482s81.03x
💻 LocalExpress12.164s (-1.4%)13.023s (~)0.860s71.04x
🐘 PostgresNitro12.222s (~)13.019s (~)0.797s71.05x
💻 LocalNext.js (Turbopack)12.273s (~)13.025s (~)0.752s71.05x
🐘 PostgresExpress12.324s (+1.8%)13.019s (~)0.695s71.06x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express25.483s (+38.7% 🔺)27.630s (+37.1% 🔺)2.147s41.00x
▲ VercelNitro26.383s (+39.0% 🔺)28.653s (+38.9% 🔺)2.271s41.04x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.172s (~)2.008s (~)0.836s151.00x
🐘 PostgresNitro1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.190s (+1.2%)2.010s (~)0.820s151.02x
💻 LocalNitro1.328s (-7.6% 🟢)2.006s (~)0.678s151.13x
💻 LocalNext.js (Turbopack)1.416s (-5.5% 🟢)2.006s (~)0.591s151.21x
💻 LocalExpress1.461s (+5.1% 🔺)2.007s (~)0.546s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.277s (+12.2% 🔺)3.761s (+7.4% 🔺)1.484s91.00x
▲ VercelNitro2.286s (+7.4% 🔺)3.612s (+4.9%)1.326s91.00x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.285s (-7.7% 🟢)2.316s (-13.4% 🟢)1.031s131.00x
🐘 PostgresNitro1.298s (-3.1%)2.317s (-7.6% 🟢)1.020s131.01x
🐘 PostgresNext.js (Turbopack)1.318s (~)2.736s (-6.2% 🟢)1.418s111.03x
💻 LocalNitro2.249s (-6.6% 🟢)2.917s (~)0.668s111.75x
💻 LocalExpress2.265s (-3.9%)2.918s (~)0.652s111.76x
💻 LocalNext.js (Turbopack)2.814s (+2.9%)3.109s (~)0.295s102.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.557s (-29.6% 🟢)4.126s (-20.1% 🟢)1.569s81.00x
▲ VercelNitro3.102s (+0.7%)4.900s (-5.5% 🟢)1.798s71.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.591s (-3.0%)4.010s (-5.9% 🟢)2.419s81.00x
🐘 PostgresExpress1.662s (+4.8%)4.586s (+6.6% 🔺)2.925s71.04x
🐘 PostgresNext.js (Turbopack)2.859s (+1.6%)5.178s (-6.1% 🟢)2.319s61.80x
💻 LocalNitro4.540s (-29.5% 🟢)5.179s (-28.2% 🟢)0.638s62.85x
💻 LocalExpress6.180s (-2.3%)6.615s (-5.7% 🟢)0.435s53.88x
💻 LocalNext.js (Turbopack)6.944s (+26.9% 🔺)8.517s (+41.6% 🔺)1.573s44.36x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.963s (+29.3% 🔺)6.147s (+21.8% 🔺)2.184s51.00x
▲ VercelNitro4.029s (+20.1% 🔺)5.976s (+16.7% 🔺)1.948s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.166s (-3.3%)2.008s (~)0.841s151.00x
🐘 PostgresExpress1.180s (~)2.007s (~)0.827s151.01x
🐘 PostgresNext.js (Turbopack)1.180s (+0.9%)2.008s (~)0.827s151.01x
💻 LocalNitro1.300s (-8.6% 🟢)2.006s (~)0.706s151.11x
💻 LocalExpress1.416s (-1.5%)2.007s (~)0.591s151.21x
💻 LocalNext.js (Turbopack)1.455s (+3.8%)2.007s (~)0.552s151.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.271s (+10.1% 🔺)3.713s (+6.1% 🔺)1.442s91.00x
▲ VercelNitro2.497s (+16.5% 🔺)4.047s (+8.9% 🔺)1.550s81.10x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.296s (-5.6% 🟢)2.316s (-6.3% 🟢)1.021s131.00x
🐘 PostgresExpress1.300s (-3.1%)2.392s (-3.2%)1.093s131.00x
🐘 PostgresNext.js (Turbopack)1.350s (+4.7%)2.674s (-8.4% 🟢)1.324s121.04x
💻 LocalNitro2.245s (-13.0% 🟢)2.826s (-9.1% 🟢)0.581s111.73x
💻 LocalExpress2.369s (-2.2%)3.110s (~)0.741s101.83x
💻 LocalNext.js (Turbopack)2.686s (+1.8%)3.008s (~)0.322s102.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.898s (+6.7% 🔺)4.652s (+7.7% 🔺)1.754s71.00x
▲ VercelExpress3.472s (-27.5% 🟢)5.420s (-18.4% 🟢)1.948s61.20x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.575s (-0.7%)4.010s (-3.0%)2.436s81.00x
🐘 PostgresNitro1.577s (-5.0%)4.136s (+3.1%)2.560s81.00x
🐘 PostgresNext.js (Turbopack)2.368s (-17.2% 🟢)4.726s (-19.2% 🟢)2.358s71.50x
💻 LocalNitro5.073s (-25.2% 🟢)6.012s (-16.7% 🟢)0.939s53.22x
💻 LocalNext.js (Turbopack)5.360s (-6.3% 🟢)6.014s (~)0.654s63.40x
💻 LocalExpress6.858s (+2.4%)7.516s (+4.1%)0.658s44.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.296s (+24.3% 🔺)6.750s (+34.1% 🔺)2.454s51.00x
▲ VercelExpress4.398s (-6.2% 🟢)6.339s (+0.7%)1.942s51.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.458s (-21.9% 🟢)1.004s (~)0.546s601.00x
🐘 PostgresNitro0.514s (-13.6% 🟢)1.023s (-1.8%)0.509s591.12x
🐘 PostgresExpress0.544s (+2.1%)1.040s (+1.7%)0.496s591.19x
💻 LocalExpress0.580s (+1.3%)1.005s (~)0.425s601.27x
💻 LocalNext.js (Turbopack)0.601s (~)1.005s (-1.7%)0.404s601.31x
🐘 PostgresNext.js (Turbopack)0.671s (+31.3% 🔺)1.086s (+8.0% 🔺)0.415s561.47x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.771s (+42.5% 🔺)5.372s (+25.0% 🔺)1.601s121.00x
▲ VercelExpress3.851s (+37.6% 🔺)5.665s (+26.3% 🔺)1.814s111.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.167s (-21.3% 🟢)2.005s (~)0.838s451.00x
🐘 PostgresExpress1.217s (-2.7%)2.007s (~)0.790s451.04x
🐘 PostgresNitro1.228s (-13.2% 🟢)2.008s (-2.3%)0.780s451.05x
🐘 PostgresNext.js (Turbopack)1.286s (+3.3%)2.035s (~)0.749s451.10x
💻 LocalExpress1.491s (+2.5%)2.028s (+1.1%)0.537s451.28x
💻 LocalNext.js (Turbopack)1.534s (+4.5%)2.007s (~)0.473s451.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.557s (+32.3% 🔺)10.541s (+31.1% 🔺)1.984s91.00x
▲ VercelNitro8.815s (+37.7% 🔺)10.553s (+35.9% 🔺)1.738s91.03x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)2.372s (-4.2%)3.033s (-0.8%)0.661s401.00x
🐘 PostgresExpress2.492s (-4.0%)3.058s (-0.9%)0.567s401.05x
🐘 PostgresNitro2.533s (-6.7% 🟢)3.034s (-0.8%)0.501s401.07x
💻 LocalNitro2.757s (-14.3% 🟢)3.218s (-19.7% 🟢)0.461s381.16x
💻 LocalExpress3.156s (-2.8%)4.010s (+0.8%)0.854s301.33x
💻 LocalNext.js (Turbopack)3.412s (+4.6%)4.043s (~)0.631s301.44x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express18.000s (+30.6% 🔺)20.264s (+31.1% 🔺)2.265s61.00x
▲ VercelNitro18.441s (+31.2% 🔺)20.585s (+31.7% 🔺)2.144s61.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.203s (-3.8%)1.006s (~)0.804s601.00x
🐘 PostgresNitro0.222s (-2.1%)1.006s (~)0.784s601.10x
🐘 PostgresNext.js (Turbopack)0.229s (+36.4% 🔺)1.016s (+1.0%)0.787s601.13x
💻 LocalNitro0.376s (-19.7% 🟢)1.004s (~)0.628s601.86x
💻 LocalExpress0.471s (+9.1% 🔺)1.005s (~)0.534s602.32x
💻 LocalNext.js (Turbopack)0.641s (+9.7% 🔺)1.022s (+1.7%)0.381s593.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.530s (-26.2% 🟢)3.038s (-20.9% 🟢)1.508s201.00x
▲ VercelNitro1.563s (-28.0% 🟢)2.980s (-23.1% 🟢)1.417s211.02x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.322s (+20.2% 🔺)1.024s (+1.8%)0.702s881.00x
🐘 PostgresExpress0.324s (~)1.006s (-1.1%)0.682s901.00x
🐘 PostgresNitro0.331s (-1.8%)1.017s (+1.1%)0.687s891.03x
💻 LocalNitro1.809s (-15.2% 🟢)2.402s (-10.6% 🟢)0.593s385.62x
💻 LocalExpress2.057s (-4.8%)2.655s (-3.0%)0.598s346.39x
💻 LocalNext.js (Turbopack)2.870s (+2.9%)3.510s (+7.7% 🔺)0.639s268.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.891s (-23.2% 🟢)3.600s (-11.2% 🟢)1.708s261.00x
▲ VercelNitro2.284s (+19.9% 🔺)3.993s (+14.5% 🔺)1.709s231.21x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Express | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.515s (~)1.059s (-0.9%)0.544s1141.00x
🐘 PostgresNitro0.541s (+2.4%)1.097s (+6.3% 🔺)0.556s1101.05x
🐘 PostgresNext.js (Turbopack)0.603s (+27.8% 🔺)2.515s (-16.4% 🟢)1.912s481.17x
💻 LocalNitro7.983s (-19.5% 🟢)8.809s (-20.1% 🟢)0.827s1415.50x
💻 LocalExpress9.967s (-1.2%)10.941s (-1.6%)0.973s1119.36x
💻 LocalNext.js (Turbopack)10.239s (+4.7%)11.303s (+4.9%)1.065s1119.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.253s (+27.9% 🔺)5.265s (+27.6% 🔺)2.012s231.00x
▲ VercelExpress3.871s (+62.0% 🔺)5.800s (+43.1% 🔺)1.928s211.19x
▲ VercelNext.js (Turbopack)⚠️missing----

🔍 Observability: Nitro | Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.121s (-3.2%)2.003s (~)0.008s (-34.7% 🟢)2.014s (~)0.893s101.00x
🐘 PostgresNext.js (Turbopack)1.143s (~)1.999s (~)0.001s (-36.4% 🟢)2.009s (~)0.866s101.02x
💻 LocalNext.js (Turbopack)1.145s (-2.0%)1.967s (~)0.012s (-0.8%)2.020s (~)0.875s101.02x
🐘 PostgresExpress1.166s (+1.4%)1.995s (~)0.001s (-10.0% 🟢)2.011s (~)0.845s101.04x
🐘 PostgresNitro1.166s (~)1.997s (~)0.001s (~)2.011s (~)0.844s101.04x
💻 LocalExpress1.201s (+4.2%)2.005s (~)0.013s (+4.2%)2.020s (~)0.819s101.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.479s (+11.7% 🔺)3.740s (+14.2% 🔺)2.670s (+43.3% 🔺)6.937s (+21.9% 🔺)4.458s101.00x
▲ VercelExpress2.728s (+33.3% 🔺)3.943s (+28.5% 🔺)3.169s (+80.9% 🔺)7.700s (+42.5% 🔺)4.972s101.10x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.434s (-7.7% 🟢)2.007s (~)0.011s (-10.5% 🟢)2.020s (~)0.587s301.00x
🐘 PostgresExpress1.525s (-1.4%)2.002s (~)0.005s (-6.6% 🟢)2.025s (~)0.500s301.06x
💻 LocalExpress1.555s (~)2.011s (~)0.012s (-3.9%)2.026s (~)0.471s301.08x
🐘 PostgresNitro1.569s (-2.2%)1.996s (~)0.006s (+11.3% 🔺)2.026s (~)0.458s301.09x
💻 LocalNext.js (Turbopack)1.583s (~)1.971s (~)0.012s (-10.5% 🟢)2.025s (~)0.442s301.10x
🐘 PostgresNext.js (Turbopack)2.048s (+33.0% 🔺)2.448s (+21.7% 🔺)0.004s (-23.1% 🟢)2.492s (+23.0% 🔺)0.444s251.43x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.953s (+18.1% 🔺)8.380s (+16.3% 🔺)0.487s (+125.5% 🔺)9.335s (+18.4% 🔺)2.382s71.00x
▲ VercelNitro7.427s (+22.3% 🔺)8.788s (+24.2% 🔺)0.382s (+68.6% 🔺)9.677s (+23.6% 🔺)2.250s71.07x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.763s (-1.4%)1.044s (~)0.000s (+Infinity% 🔺)1.075s (+1.0%)0.312s561.00x
🐘 PostgresNitro0.791s (-3.8%)1.058s (-3.7%)0.000s (-100.0% 🟢)1.077s (-3.7%)0.286s571.04x
💻 LocalNitro1.042s (-21.0% 🟢)1.616s (-18.4% 🟢)0.000s (-59.2% 🟢)1.619s (-18.4% 🟢)0.576s381.37x
💻 LocalExpress1.247s (-1.6%)1.981s (-1.6%)0.000s (+45.2% 🔺)1.984s (-1.6%)0.737s311.63x
💻 LocalNext.js (Turbopack)1.375s (+3.0%)1.979s (~)0.000s (+100.0% 🔺)2.016s (~)0.641s301.80x
🐘 PostgresNext.js (Turbopack)1.589s (+73.3% 🔺)2.107s (+65.1% 🔺)0.000s (-100.0% 🟢)2.154s (+67.8% 🔺)0.565s282.08x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.274s (+37.0% 🔺)5.404s (+22.5% 🔺)0.000s (NaN%)5.921s (+21.4% 🔺)1.647s111.00x
▲ VercelExpress4.755s (+21.7% 🔺)6.088s (+21.1% 🔺)0.000s (-45.0% 🟢)6.553s (+18.3% 🔺)1.799s101.11x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Nitro | Express

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.819s (+7.3% 🔺)2.431s (+7.8% 🔺)0.000s (-100.0% 🟢)2.450s (+8.0% 🔺)0.631s251.00x
🐘 PostgresNitro1.853s (-3.4%)2.390s (-4.3%)0.000s (+92.0% 🔺)2.420s (-4.0%)0.566s251.02x
🐘 PostgresNext.js (Turbopack)2.602s (+28.1% 🔺)3.208s (+22.8% 🔺)0.000s (-100.0% 🟢)3.221s (+21.9% 🔺)0.619s191.43x
💻 LocalNitro2.682s (-24.8% 🟢)3.070s (-23.7% 🟢)0.001s (+10.3% 🔺)3.078s (-23.7% 🟢)0.396s201.47x
💻 LocalExpress3.313s (-8.8% 🟢)3.901s (-7.7% 🟢)0.001s (+5.5% 🔺)3.904s (-7.7% 🟢)0.592s161.82x
💻 LocalNext.js (Turbopack)3.446s (-5.9% 🟢)3.992s (-4.8%)0.001s (-12.5% 🟢)4.032s (-4.8%)0.587s151.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.429s (+14.7% 🔺)6.836s (+19.0% 🔺)0.000s (-100.0% 🟢)7.312s (+16.9% 🔺)1.883s91.00x
▲ VercelNitro5.774s (+18.0% 🔺)7.060s (+23.5% 🔺)0.000s (+Infinity% 🔺)7.648s (+23.6% 🔺)1.874s81.06x
▲ VercelNext.js (Turbopack)⚠️missing-----

🔍 Observability: Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro21/21
🐘 PostgresExpress9/21
▲ VercelExpress14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres18/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro🐘 Postgres12/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)
  • 🌐 Platformatic: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production144202301672
✅ 💻 Local Development160502191824
✅ 📦 Local Production160502191824
✅ 🐘 Local Postgres159302311824
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7282010788360

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nextjs-turbopack14903
✅ nextjs-webpack14903
✅ nitro125027
✅ nuxt125027
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run

In turbo mode the first step body runs optimistically — before the
backgrounded `run_started` event is durable. `getWritable()` stream
writes flushed directly to the server; the first chunk of a brand-new
stream requires the run to exist (the World does a run lookup), so an
early write could be rejected as run-not-found, failing the step or
silently dropping the chunk.
Thread the run-ready barrier (already on the step context) into
`WorkflowServerWritableStream` and await it once before the first
flush/close. No-op outside turbo and on the await path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@vercelvercelBot 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.

Additional Suggestion:

In turbo optimistic start, a nested ReadableStream written into a step's getWritable() stream is piped to its own server stream via getExternalReducers without the run-ready barrier, so its first chunk can reach world.streams.write() before the backgrounded run_started is durable (run-not-found race).

Fix on Vercel

…o a step's `getWritable()` stream is piped to its own server stream via `getExternalReducers` without the run-ready barrier, so its first chunk can reach `world.streams.write()` before the backgrounded `run_started` is durable (run-not-found race).
This commit fixes the issue reported at packages/core/src/step/writable-stream.ts:81
## The bug
The PR closes a turbo-mode race where step-body world writes can reach the World before the backgrounded `run_started` is durable. It threaded a `runReadyBarrier` into:
1. `experimental_setAttributes` (`set-attributes.ts`),
2. the outer `WorkflowServerWritableStream` built by `getWritable()` (`step/writable-stream.ts` ~line 92), and
3. step return-value serialization via `getStepReducers` (`serialization.ts` ~line 1448), including its recursive call.
**Gap:** `getWritable()` builds its serialize transform with `getExternalReducers(globalThis, ctx.ops, runId, ctx.encryptionKey, true)` — *not* `getStepReducers`. Inside `getExternalReducers`, the `ReadableStream` reducer (`serialization.ts` ~line 1236) constructed:
```ts
const writable = new WorkflowServerWritableStream(runId, name); // no barrier
...
ops.push(value.pipeTo(writable)); // or framed / recursive-serialize variants
```
This pipe runs **independently** of the gated outer `serverWritable`. The barrier on the outer writable only orders writes to `(runId, name)` — the nested stream writes to a *different* `(runId, strm_<id>)` via an ungated sink.
## Reachability / trigger
- A turbo optimistic first-step body calls `getWritable()` (body runs before `run_started` is durable).
- The user writes a value that contains a nested `ReadableStream` into that writable.
- `getSerializeStream` invokes `getExternalReducers`' `ReadableStream` reducer synchronously on that chunk, which creates an ungated `WorkflowServerWritableStream(runId, name)` and pushes `value.pipeTo(writable)` to `ctx.ops`.
- That background pipe flushes the nested stream's first chunk to `world.streams.write(runId, strm_id, chunk)` with no barrier → it can land before `run_started` is durable → run-not-found, exactly the race the PR is closing, one level deeper.
This is the same code shape that *was* fixed in `getStepReducers` (commit dd61604); `getExternalReducers` was simply missed.
## The fix
Mirror the `getStepReducers` change:
- Added an optional trailing `runReadyBarrier?: Promise<unknown>` param to `getExternalReducers`.
- Passed it into `new WorkflowServerWritableStream(runId, name, runReadyBarrier)`.
- Threaded it through the recursive `getExternalReducers(...)` call used for non-byte streams.
- Passed `ctx.runReadyBarrier` from `step/writable-stream.ts`'s `getWritable()`.
The param is an optional trailing argument, so all other `getExternalReducers` callers (which pass `undefined`/nothing) are unaffected and the barrier is a no-op outside turbo and on the await path, consistent with the existing `WorkflowServerWritableStream` barrier semantics.
Note: type-checking could not be executed in this environment because dependencies (`tsc`) are not installed, but the change is type-safe — the new optional param is `Promise<unknown> | undefined`, the constructor already accepts that signature, and `ctx.runReadyBarrier` is typed `Promise<unknown> | undefined`.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>

@karthikscale3karthikscale3 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.

Re-reviewed current head 341cec2. I checked the runReadyBarrier propagation through setAttributes, getWritable, returned ReadableStream serialization, and nested ReadableStream serialization, plus the focused stream/attribute tests. No confirmed P0/P1 code blockers remain from my review.

@VaguelySerious
VaguelySerious merged commit 1ea2b4e into mainJun 26, 2026
180 of 184 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 1ea2b4e (AI decision).

This fix targets a race in turbo-mode optimistic start, a main-only feature. I verified that set-attributes.ts, runtime/step-executor.ts, and any reference to optimisticStart/runReadyBarrier/experimental_setAttributes/attr_set are entirely absent from packages/core/src on origin/stable, so the changed code paths and the behavior being fixed do not exist there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

1ea2b4ef77dea8ce2845867e53cf1c51a8544e6e

@github-actionsgithub-actionsBot mentioned this pull request Jun 26, 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@karthikscale3