Skip to content

[codex] Fix partial world-local exclusive writes - #2296

Merged
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write
Jun 8, 2026
Merged

[codex] Fix partial world-local exclusive writes#2296
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Summary

  • write exclusive local files to a unique temporary path before publishing them
  • use an atomic hard link to preserve first-writer-wins behavior without exposing partial contents
  • add deterministic coverage for publication visibility and concurrent writers
  • add a patch changeset for @workflow/world-local

Root cause

writeExclusive() previously called fs.writeFile() directly on the final path with the wx flag. The exclusive create prevented another writer from winning, but the final path became visible before the JSON body was fully written. A concurrent runs.get() could therefore read an empty or truncated run file and fail with SyntaxError: Unexpected end of JSON input.

The new implementation writes and closes a temporary file first, then hard-links it into the final path. Link creation is atomic and returns EEXIST when another writer has already published the destination.

Verification

  • pnpm --filter @workflow/world-local test (368 tests)
  • pnpm --filter @workflow/world-local typecheck
  • pnpm turbo run build --filter=@workflow/world-local...
  • targeted Biome check (existing complexity warnings only)

@changeset-bot

changeset-botBot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89971e0

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

This PR includes changesets to release 18 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/vitestPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/webPatch
@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

@vercel

vercelBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 8, 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.044s (+2.1%)1.006s (~)0.962s101.00x
💻 LocalNext.js (Turbopack)0.046s (-16.0% 🟢)1.004s (~)0.958s101.06x
💻 LocalExpress0.047s (+9.7% 🔺)1.006s (~)0.959s101.08x
🐘 PostgresNitro0.058s (-8.9% 🟢)1.011s (~)0.953s101.32x
🐘 PostgresExpress0.065s (-1.5%)1.013s (~)0.948s101.49x
🐘 PostgresNext.js (Turbopack)0.068s (-3.1%)1.011s (~)0.944s101.55x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.095s (~)2.006s (~)0.910s101.00x
💻 LocalExpress1.099s (~)2.007s (~)0.908s101.00x
🐘 PostgresNitro1.105s (-0.8%)2.009s (~)0.904s101.01x
💻 LocalNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🐘 PostgresExpress1.114s (+2.1%)2.010s (~)0.896s101.02x
🐘 PostgresNext.js (Turbopack)1.143s (~)2.011s (~)0.867s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.541s (~)11.021s (~)0.480s31.00x
💻 LocalExpress10.552s (~)11.023s (~)0.471s31.00x
🐘 PostgresNitro10.573s (~)11.016s (~)0.443s31.00x
💻 LocalNext.js (Turbopack)10.618s (~)11.020s (~)0.402s31.01x
🐘 PostgresExpress10.627s (-0.8%)11.021s (-2.9%)0.394s31.01x
🐘 PostgresNext.js (Turbopack)11.021s (+1.9%)11.683s (+6.0% 🔺)0.661s31.05x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.848s (~)14.017s (-1.5%)0.169s51.00x
💻 LocalNitro13.854s (+1.0%)14.225s (+1.4%)0.371s51.00x
🐘 PostgresNitro13.888s (~)14.017s (~)0.129s51.00x
💻 LocalExpress13.891s (~)14.228s (~)0.337s51.00x
💻 LocalNext.js (Turbopack)13.947s (-0.6%)14.024s (-4.1%)0.077s51.01x
🐘 PostgresNext.js (Turbopack)14.443s (-1.0%)15.017s (~)0.574s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.482s (+0.6%)13.025s (~)0.543s71.00x
🐘 PostgresNitro12.547s (-1.5%)13.017s (~)0.470s71.01x
💻 LocalExpress12.612s (~)13.025s (~)0.414s71.01x
🐘 PostgresExpress12.615s (-0.9%)13.021s (-2.2%)0.406s71.01x
💻 LocalNext.js (Turbopack)12.796s (-1.2%)13.023s (-2.1%)0.226s71.03x
🐘 PostgresNext.js (Turbopack)13.827s (~)14.018s (~)0.191s71.11x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.189s (-0.8%)2.007s (~)0.818s151.00x
🐘 PostgresExpress1.190s (-0.8%)2.007s (-0.7%)0.818s151.00x
💻 LocalExpress1.211s (-4.1%)2.007s (~)0.795s151.02x
💻 LocalNitro1.236s (+1.9%)2.006s (~)0.770s151.04x
🐘 PostgresNext.js (Turbopack)1.259s (+0.6%)2.008s (~)0.749s151.06x
💻 LocalNext.js (Turbopack)1.308s (+7.0% 🔺)2.005s (~)0.697s151.10x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.241s (-1.4%)2.007s (~)0.766s151.00x
🐘 PostgresExpress1.250s (-5.7% 🟢)2.008s (~)0.757s151.01x
🐘 PostgresNext.js (Turbopack)1.394s (-1.1%)2.006s (~)0.613s151.12x
💻 LocalNitro1.817s (+6.6% 🔺)2.073s (~)0.256s151.46x
💻 LocalNext.js (Turbopack)1.881s (+9.0% 🔺)2.314s (+15.4% 🔺)0.434s131.52x
💻 LocalExpress1.928s (+2.4%)2.222s (~)0.294s141.55x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-5.7% 🟢)2.006s (~)0.680s151.00x
🐘 PostgresExpress1.395s (~)2.007s (~)0.612s151.05x
🐘 PostgresNext.js (Turbopack)1.760s (~)2.392s (+4.3%)0.633s131.33x
💻 LocalNext.js (Turbopack)3.768s (-14.3% 🟢)4.133s (-17.5% 🟢)0.365s82.84x
💻 LocalExpress5.430s (+2.5%)6.015s (~)0.585s64.09x
💻 LocalNitro5.698s (+20.8% 🔺)6.213s (+24.0% 🔺)0.515s54.29x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.183s (-1.4%)2.008s (~)0.825s151.00x
🐘 PostgresExpress1.212s (+0.8%)2.008s (~)0.795s151.03x
🐘 PostgresNext.js (Turbopack)1.248s (-1.4%)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.257s (-3.7%)2.005s (~)0.748s151.06x
💻 LocalNitro1.551s (~)2.006s (~)0.455s151.31x
💻 LocalExpress1.576s (-4.9%)2.007s (-3.2%)0.431s151.33x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.226s (-3.8%)2.007s (~)0.780s151.00x
🐘 PostgresExpress1.265s (+1.8%)2.008s (~)0.743s151.03x
🐘 PostgresNext.js (Turbopack)1.397s (~)2.008s (~)0.611s151.14x
💻 LocalNext.js (Turbopack)2.041s (+1.0%)2.469s (-1.5%)0.428s131.66x
💻 LocalNitro2.170s (+23.5% 🔺)2.592s (+25.1% 🔺)0.421s121.77x
💻 LocalExpress2.220s (+4.5%)2.736s (+5.6% 🔺)0.516s111.81x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.333s (-8.8% 🟢)2.007s (~)0.674s151.00x
🐘 PostgresExpress1.394s (-7.1% 🟢)2.008s (-16.2% 🟢)0.614s151.05x
🐘 PostgresNext.js (Turbopack)1.608s (-2.9%)2.007s (-3.2%)0.399s151.21x
💻 LocalNext.js (Turbopack)4.589s (-11.1% 🟢)5.012s (-16.7% 🟢)0.423s73.44x
💻 LocalNitro5.816s (+22.6% 🔺)6.219s (+16.4% 🔺)0.403s54.36x
💻 LocalExpress6.294s (+7.4% 🔺)6.816s (+9.7% 🔺)0.521s54.72x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.575s (-13.8% 🟢)1.007s (-3.9%)0.432s601.00x
🐘 PostgresNitro0.590s (-3.1%)1.023s (+1.6%)0.433s591.03x
💻 LocalNitro0.614s (-23.6% 🟢)1.021s (-15.2% 🟢)0.407s591.07x
💻 LocalExpress0.638s (-2.8%)1.005s (-3.3%)0.368s601.11x
💻 LocalNext.js (Turbopack)0.690s (-0.9%)1.021s (+1.6%)0.330s601.20x
🐘 PostgresNext.js (Turbopack)0.800s (-1.4%)1.006s (~)0.206s601.39x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.400s (-1.2%)2.053s (+2.3%)0.654s441.00x
🐘 PostgresExpress1.431s (-6.8% 🟢)2.008s (-6.7% 🟢)0.577s451.02x
💻 LocalNitro1.490s (+1.8%)2.006s (~)0.516s451.06x
💻 LocalExpress1.598s (~)2.007s (-1.1%)0.409s451.14x
💻 LocalNext.js (Turbopack)1.860s (+7.6% 🔺)2.172s (+7.1% 🔺)0.312s421.33x
🐘 PostgresNext.js (Turbopack)1.935s (~)2.150s (-1.1%)0.215s421.38x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.794s (-4.1%)3.166s (-3.5%)0.372s381.00x
🐘 PostgresExpress2.892s (-0.7%)3.221s (-9.0% 🟢)0.329s381.03x
💻 LocalNitro3.235s (+0.9%)4.009s (~)0.774s301.16x
💻 LocalExpress3.425s (~)4.043s (+0.8%)0.618s301.23x
💻 LocalNext.js (Turbopack)3.698s (-0.8%)4.148s (+1.0%)0.450s291.32x
🐘 PostgresNext.js (Turbopack)3.778s (-2.1%)4.009s (-1.7%)0.232s301.35x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.206s (-12.4% 🟢)1.006s (~)0.800s601.00x
🐘 PostgresExpress0.232s (-8.0% 🟢)1.007s (~)0.775s601.12x
🐘 PostgresNext.js (Turbopack)0.256s (-9.4% 🟢)1.006s (~)0.750s601.24x
💻 LocalNitro0.391s (-7.9% 🟢)1.004s (~)0.613s601.90x
💻 LocalExpress0.446s (-4.0%)1.005s (~)0.559s602.16x
💻 LocalNext.js (Turbopack)0.473s (-22.6% 🟢)1.005s (-3.3%)0.532s602.29x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.327s (-11.8% 🟢)1.007s (~)0.680s901.00x
🐘 PostgresExpress0.362s (+6.8% 🔺)1.007s (~)0.644s901.11x
🐘 PostgresNext.js (Turbopack)0.460s (-4.8%)1.006s (~)0.546s901.41x
💻 LocalNext.js (Turbopack)1.974s (-19.4% 🟢)2.584s (-16.9% 🟢)0.611s356.04x
💻 LocalNitro2.153s (+4.3%)2.736s (+3.7%)0.583s336.58x
💻 LocalExpress2.177s (-0.6%)2.913s (+3.2%)0.736s316.66x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.608s (-14.1% 🟢)1.005s (~)0.398s1201.00x
🐘 PostgresExpress0.707s (+13.0% 🔺)1.015s (-3.8%)0.308s1191.16x
🐘 PostgresNext.js (Turbopack)0.933s (-4.7%)1.366s (-15.0% 🟢)0.433s891.54x
💻 LocalNext.js (Turbopack)8.496s (-17.6% 🟢)9.329s (-17.4% 🟢)0.833s1313.98x
💻 LocalNitro9.623s (+10.5% 🔺)10.192s (+9.2% 🔺)0.569s1215.83x
💻 LocalExpress10.339s (~)10.863s (~)0.524s1217.01x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.160s (-1.8%)2.003s (~)0.001s (-7.1% 🟢)2.011s (~)0.852s101.00x
💻 LocalNitro1.169s (+1.6%)2.005s (~)0.011s (+14.0% 🔺)2.018s (~)0.849s101.01x
💻 LocalNext.js (Turbopack)1.170s (~)2.003s (~)0.009s (-15.8% 🟢)2.014s (~)0.845s101.01x
🐘 PostgresExpress1.172s (-1.8%)2.001s (~)0.001s (-96.5% 🟢)2.012s (-1.5%)0.840s101.01x
💻 LocalExpress1.178s (+0.8%)2.006s (~)0.014s (+9.4% 🔺)2.022s (~)0.844s101.02x
🐘 PostgresNext.js (Turbopack)1.227s (-0.6%)2.001s (~)0.001s (-20.0% 🟢)2.010s (~)0.783s101.06x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.567s (-5.8% 🟢)2.009s (~)0.004s (-8.5% 🟢)2.024s (~)0.457s301.00x
💻 LocalNext.js (Turbopack)1.580s (-3.7%)2.008s (~)0.008s (-17.5% 🟢)2.019s (~)0.438s301.01x
💻 LocalNitro1.594s (-8.5% 🟢)2.010s (~)0.010s (+8.7% 🔺)2.021s (-8.1% 🟢)0.427s301.02x
💻 LocalExpress1.604s (-2.0%)2.009s (~)0.012s (+8.2% 🔺)2.023s (~)0.419s301.02x
🐘 PostgresExpress1.632s (-6.0% 🟢)2.003s (-6.5% 🟢)0.004s (+27.8% 🔺)2.028s (-6.1% 🟢)0.395s301.04x
🐘 PostgresNext.js (Turbopack)1.735s (-1.7%)2.010s (~)0.004s (-5.8% 🟢)2.025s (~)0.290s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.698s (-3.5%)1.034s (~)0.000s (-66.7% 🟢)1.041s (-0.6%)0.343s581.00x
🐘 PostgresExpress0.737s (-24.6% 🟢)1.049s (-26.5% 🟢)0.000s (-50.9% 🟢)1.060s (-26.8% 🟢)0.323s571.06x
🐘 PostgresNext.js (Turbopack)0.845s (+1.5%)1.092s (+1.9%)0.000s (-100.0% 🟢)1.123s (+4.1%)0.278s551.21x
💻 LocalNext.js (Turbopack)1.227s (-15.2% 🟢)1.979s (-1.6%)0.000s (-3.2%)1.981s (-1.6%)0.754s311.76x
💻 LocalNitro1.370s (+1.2%)2.014s (~)0.000s (-13.3% 🟢)2.016s (~)0.646s301.96x
💻 LocalExpress1.448s (-2.3%)2.014s (~)0.000s (-46.7% 🟢)2.016s (~)0.568s302.07x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.419s (-12.1% 🟢)2.098s (-6.9% 🟢)0.000s (NaN%)2.135s (-6.4% 🟢)0.716s291.00x
🐘 PostgresNitro1.523s (+8.0% 🔺)2.180s (+9.2% 🔺)0.000s (+Infinity% 🔺)2.189s (+8.8% 🔺)0.666s281.07x
🐘 PostgresNext.js (Turbopack)1.802s (+4.3%)2.309s (+2.1%)0.000s (NaN%)2.318s (+2.1%)0.516s261.27x
💻 LocalNext.js (Turbopack)2.374s (-26.1% 🟢)3.019s (-22.5% 🟢)0.000s (-20.0% 🟢)3.022s (-22.5% 🟢)0.648s201.67x
💻 LocalNitro3.014s (-3.2%)3.614s (-7.2% 🟢)0.001s (+252.9% 🔺)3.617s (-7.3% 🟢)0.603s172.12x
💻 LocalExpress3.223s (-3.3%)3.904s (+1.7%)0.002s (+383.3% 🔺)3.908s (+1.7%)0.686s162.27x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresNitro18/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production1256102191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total71731010528235

❌ Failed Tests

▲ Vercel Production (10 failed)

astro (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

example (1 failed):

  • AbortController abortThrowIfAbortedWorkflow: throwIfAborted causes FatalError, no retries

fastify (1 failed):

  • outputStreamWorkflow negative startIndex (reads from end)

hono (1 failed):

  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KTME1GEXT2GC7YHM27G8KEY3 | 🔍 observability

nextjs-turbopack (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

nitro (2 failed):

  • utf8StreamWorkflow | wrun_01KTMDNBBSH43FEV2N2A7S5KDQ | 🔍 observability
  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

nuxt (2 failed):

  • webhookWorkflow | wrun_01KTMDHSXM87EH9KP6159TWSAV | 🔍 observability
  • outputStreamWorkflow no startIndex (reads all chunks)

vite (1 failed):

  • AbortController abortParallelWorkflow: abort cancels all parallel steps

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro108126
❌ example108126
✅ express109026
❌ fastify108126
❌ hono108126
❌ nextjs-turbopack13212
✅ nextjs-webpack13302
❌ nitro107226
❌ nuxt107226
✅ sveltekit12807
❌ vite108126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygp
pranaygp marked this pull request as ready for review June 8, 2026 19:48
@pranaygp
pranaygp requested a review from a team as a code ownerJune 8, 2026 19:48
CopilotAI review requested due to automatic review settings June 8, 2026 19:48

CopilotAI 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.

Pull request overview

This PR fixes a race in @workflow/world-local where writeExclusive() could expose a partially written destination file to concurrent readers by switching to a “write temp file → hard-link publish” flow, and adds tests to validate publication visibility and first-writer-wins behavior.

Changes:

  • Update writeExclusive() to publish via a fully-written temp file and an atomic hard-link into the final path.
  • Add deterministic tests ensuring destinations aren’t visible mid-write and that only one concurrent writer wins.
  • Add a patch changeset and refresh related inline comments in the storage layer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
packages/world-local/src/storage/events-storage.tsUpdates commentary to reflect the publish semantics used by writeExclusive().
packages/world-local/src/fs.tsImplements atomic publish for exclusive writes using temp file + hard-link.
packages/world-local/src/fs.test.tsAdds deterministic coverage for publication visibility and concurrent writer winner selection.
.changeset/atomic-runs-publish.mdPatch changeset documenting the fix for partial visibility during exclusive writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpackages/world-local/src/fs.ts

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve — clean fix for a real partial-read race, with one defensive nit

The bug is real and the fix is the right shape:

  • Before: fs.writeFile(filePath, data, { flag: 'wx' }) writes directly to the destination. The exclusive create guarantees only one writer wins, but the destination path becomes visible during the write — a concurrent runs.get() can read partial JSON and fail with SyntaxError: Unexpected end of JSON input.
  • After: write to ${filePath}.tmp.${ulid()} first, then fs.link() to the destination. Link creation is atomic at the OS level and fails with EEXIST if another writer already published.

This matches the established pattern in the sibling write() function (which uses fs.rename() for the overwriting variant); the only difference here is link vs rename to preserve first-writer-wins semantics.

Test design is excellent

The first test simulates a slow write by mocking fs.writeFile to pause mid-write, then attempts to read the destination. With the OLD code, the read returns partial content '{"value":'; with the NEW code, the read returns ENOENT (destination doesn't exist until link succeeds). The post-PR file content is exactly the full payload. Verified regression: I temporarily reverted just the fs.ts change and reran the test — got expected ENOENT, received '{"value":' exactly as the test asserts.

The second test (16 concurrent writers) confirms:

  1. Exactly one returns true (the winner)
  2. The final file content matches one specific writer's value
  3. The directory has only exclusive.json (no orphaned temp files)

That last assertion is the cleanup check, which catches the finally block actually running.

What I verified locally

  • pnpm turbo run build --filter @workflow/world-local
  • pnpm --filter @workflow/world-local test ✓ (368 tests pass)
  • Reverted the fix and confirmed the new partial-visibility test fails as expected → restored the fix, all green

CI

5 failures, all pre-existing on main's baseline:

  • Vercel Prod E2E (nextjs-turbopack, hono, fastify) — same flakes seen on main's recent runs
  • Local Postgres canary (nextjs-turbopack) — Next.js canary tracks; the latest main canary baseline shows similar instability
  • E2E Required Check — cascading

Nothing PR-specific.

One defensive nit (non-blocker, inline)

Copilot caught a small defensive-coding miss: the finally block unconditionally unlinks tempPath, but if the fs.writeFile(tempPath, ..., { flag: 'wx' }) itself fails with EEXIST (vanishingly rare ULID collision or a stale temp from a crashed process), the unlink would delete someone else's temp file. The existing write() function already handles this with a tempFileCreated flag — same pattern would close the gap here. Inline comment with the snippet.

Practical risk is essentially zero (2^-40 collision probability), but matching the surrounding pattern is essentially free.

Bottom line

Solid fix for a real race that surfaces as SyntaxError: Unexpected end of JSON input in production. The hard-link-after-write pattern is the canonical atomic-publish primitive for "first writer wins" semantics on POSIX filesystems.

Approving.

Comment threadpackages/world-local/src/fs.ts Outdated
@pranaygp
pranaygp merged commit 867e339 into mainJun 8, 2026
34 of 58 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Jun 8, 2026
github-actionsBot added a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2299. Merge conflicts were resolved by AI — please review carefully. (backport job run)

pranaygp pushed a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pranaygp added a commit that referenced this pull request Jun 11, 2026
…-attributes-client
* origin/main: (32 commits)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
[world-vercel] Validate ref resolve responses before use (#2035)
fix: bump devalue to 5.8.1 (#2292)
Handle lazy stream key request failures (#2257)
fix(docs): declare Nitro auto-import globals for code samples (#2290)
[core] Preserve event-log order in hook-vs-sleep replay races (#2171) (#2185)
docs: add nitro changelog (#2232)
fix(next): always apply turbopack content condition regardless of builder mode (#2253)
Update @vercel/queue from 0.2.1 to 0.3.0 (#2255)
[nest] Use AST-based CommonJS import rewriting (#2080)
...
# Conflicts:
#	packages/world-local/src/storage/events-storage.ts
pranaygp added a commit that referenced this pull request Jun 11, 2026
…hook-ready
* origin-https/main: (119 commits)
fix: settle aborted parallel steps before completing abortParallelWorkflow (#2244)
Add native v4 workflow attribute events (#2226)
Version Packages (beta) (#2326)
[ci] Fix flaky windows unit tests (#2359)
Capture Vercel runtime logs when e2e Vercel Prod lanes fail (#2356)
Fix e2e failure reporting under vitest 4 and preserve fetch error causes (#2355)
[core] Fix process crash from rejected waitUntil promises (#2336)
[core] Remove duplicate `waitUntil` for suspension handler async operations (#2345)
Prevent local tests from hanging (#2338)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
...
# Conflicts:
#	packages/core/src/runtime.ts
#	packages/core/src/runtime/suspension-handler.ts
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.

3 participants

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

[codex] Fix partial world-local exclusive writes - #2296

Merged
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write
Jun 8, 2026
Merged

[codex] Fix partial world-local exclusive writes#2296
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Summary

  • write exclusive local files to a unique temporary path before publishing them
  • use an atomic hard link to preserve first-writer-wins behavior without exposing partial contents
  • add deterministic coverage for publication visibility and concurrent writers
  • add a patch changeset for @workflow/world-local

Root cause

writeExclusive() previously called fs.writeFile() directly on the final path with the wx flag. The exclusive create prevented another writer from winning, but the final path became visible before the JSON body was fully written. A concurrent runs.get() could therefore read an empty or truncated run file and fail with SyntaxError: Unexpected end of JSON input.

The new implementation writes and closes a temporary file first, then hard-links it into the final path. Link creation is atomic and returns EEXIST when another writer has already published the destination.

Verification

  • pnpm --filter @workflow/world-local test (368 tests)
  • pnpm --filter @workflow/world-local typecheck
  • pnpm turbo run build --filter=@workflow/world-local...
  • targeted Biome check (existing complexity warnings only)

@changeset-bot

changeset-botBot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89971e0

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

This PR includes changesets to release 18 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/vitestPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/webPatch
@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

@vercel

vercelBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 8, 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.044s (+2.1%)1.006s (~)0.962s101.00x
💻 LocalNext.js (Turbopack)0.046s (-16.0% 🟢)1.004s (~)0.958s101.06x
💻 LocalExpress0.047s (+9.7% 🔺)1.006s (~)0.959s101.08x
🐘 PostgresNitro0.058s (-8.9% 🟢)1.011s (~)0.953s101.32x
🐘 PostgresExpress0.065s (-1.5%)1.013s (~)0.948s101.49x
🐘 PostgresNext.js (Turbopack)0.068s (-3.1%)1.011s (~)0.944s101.55x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.095s (~)2.006s (~)0.910s101.00x
💻 LocalExpress1.099s (~)2.007s (~)0.908s101.00x
🐘 PostgresNitro1.105s (-0.8%)2.009s (~)0.904s101.01x
💻 LocalNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🐘 PostgresExpress1.114s (+2.1%)2.010s (~)0.896s101.02x
🐘 PostgresNext.js (Turbopack)1.143s (~)2.011s (~)0.867s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.541s (~)11.021s (~)0.480s31.00x
💻 LocalExpress10.552s (~)11.023s (~)0.471s31.00x
🐘 PostgresNitro10.573s (~)11.016s (~)0.443s31.00x
💻 LocalNext.js (Turbopack)10.618s (~)11.020s (~)0.402s31.01x
🐘 PostgresExpress10.627s (-0.8%)11.021s (-2.9%)0.394s31.01x
🐘 PostgresNext.js (Turbopack)11.021s (+1.9%)11.683s (+6.0% 🔺)0.661s31.05x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.848s (~)14.017s (-1.5%)0.169s51.00x
💻 LocalNitro13.854s (+1.0%)14.225s (+1.4%)0.371s51.00x
🐘 PostgresNitro13.888s (~)14.017s (~)0.129s51.00x
💻 LocalExpress13.891s (~)14.228s (~)0.337s51.00x
💻 LocalNext.js (Turbopack)13.947s (-0.6%)14.024s (-4.1%)0.077s51.01x
🐘 PostgresNext.js (Turbopack)14.443s (-1.0%)15.017s (~)0.574s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.482s (+0.6%)13.025s (~)0.543s71.00x
🐘 PostgresNitro12.547s (-1.5%)13.017s (~)0.470s71.01x
💻 LocalExpress12.612s (~)13.025s (~)0.414s71.01x
🐘 PostgresExpress12.615s (-0.9%)13.021s (-2.2%)0.406s71.01x
💻 LocalNext.js (Turbopack)12.796s (-1.2%)13.023s (-2.1%)0.226s71.03x
🐘 PostgresNext.js (Turbopack)13.827s (~)14.018s (~)0.191s71.11x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.189s (-0.8%)2.007s (~)0.818s151.00x
🐘 PostgresExpress1.190s (-0.8%)2.007s (-0.7%)0.818s151.00x
💻 LocalExpress1.211s (-4.1%)2.007s (~)0.795s151.02x
💻 LocalNitro1.236s (+1.9%)2.006s (~)0.770s151.04x
🐘 PostgresNext.js (Turbopack)1.259s (+0.6%)2.008s (~)0.749s151.06x
💻 LocalNext.js (Turbopack)1.308s (+7.0% 🔺)2.005s (~)0.697s151.10x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.241s (-1.4%)2.007s (~)0.766s151.00x
🐘 PostgresExpress1.250s (-5.7% 🟢)2.008s (~)0.757s151.01x
🐘 PostgresNext.js (Turbopack)1.394s (-1.1%)2.006s (~)0.613s151.12x
💻 LocalNitro1.817s (+6.6% 🔺)2.073s (~)0.256s151.46x
💻 LocalNext.js (Turbopack)1.881s (+9.0% 🔺)2.314s (+15.4% 🔺)0.434s131.52x
💻 LocalExpress1.928s (+2.4%)2.222s (~)0.294s141.55x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-5.7% 🟢)2.006s (~)0.680s151.00x
🐘 PostgresExpress1.395s (~)2.007s (~)0.612s151.05x
🐘 PostgresNext.js (Turbopack)1.760s (~)2.392s (+4.3%)0.633s131.33x
💻 LocalNext.js (Turbopack)3.768s (-14.3% 🟢)4.133s (-17.5% 🟢)0.365s82.84x
💻 LocalExpress5.430s (+2.5%)6.015s (~)0.585s64.09x
💻 LocalNitro5.698s (+20.8% 🔺)6.213s (+24.0% 🔺)0.515s54.29x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.183s (-1.4%)2.008s (~)0.825s151.00x
🐘 PostgresExpress1.212s (+0.8%)2.008s (~)0.795s151.03x
🐘 PostgresNext.js (Turbopack)1.248s (-1.4%)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.257s (-3.7%)2.005s (~)0.748s151.06x
💻 LocalNitro1.551s (~)2.006s (~)0.455s151.31x
💻 LocalExpress1.576s (-4.9%)2.007s (-3.2%)0.431s151.33x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.226s (-3.8%)2.007s (~)0.780s151.00x
🐘 PostgresExpress1.265s (+1.8%)2.008s (~)0.743s151.03x
🐘 PostgresNext.js (Turbopack)1.397s (~)2.008s (~)0.611s151.14x
💻 LocalNext.js (Turbopack)2.041s (+1.0%)2.469s (-1.5%)0.428s131.66x
💻 LocalNitro2.170s (+23.5% 🔺)2.592s (+25.1% 🔺)0.421s121.77x
💻 LocalExpress2.220s (+4.5%)2.736s (+5.6% 🔺)0.516s111.81x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.333s (-8.8% 🟢)2.007s (~)0.674s151.00x
🐘 PostgresExpress1.394s (-7.1% 🟢)2.008s (-16.2% 🟢)0.614s151.05x
🐘 PostgresNext.js (Turbopack)1.608s (-2.9%)2.007s (-3.2%)0.399s151.21x
💻 LocalNext.js (Turbopack)4.589s (-11.1% 🟢)5.012s (-16.7% 🟢)0.423s73.44x
💻 LocalNitro5.816s (+22.6% 🔺)6.219s (+16.4% 🔺)0.403s54.36x
💻 LocalExpress6.294s (+7.4% 🔺)6.816s (+9.7% 🔺)0.521s54.72x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.575s (-13.8% 🟢)1.007s (-3.9%)0.432s601.00x
🐘 PostgresNitro0.590s (-3.1%)1.023s (+1.6%)0.433s591.03x
💻 LocalNitro0.614s (-23.6% 🟢)1.021s (-15.2% 🟢)0.407s591.07x
💻 LocalExpress0.638s (-2.8%)1.005s (-3.3%)0.368s601.11x
💻 LocalNext.js (Turbopack)0.690s (-0.9%)1.021s (+1.6%)0.330s601.20x
🐘 PostgresNext.js (Turbopack)0.800s (-1.4%)1.006s (~)0.206s601.39x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.400s (-1.2%)2.053s (+2.3%)0.654s441.00x
🐘 PostgresExpress1.431s (-6.8% 🟢)2.008s (-6.7% 🟢)0.577s451.02x
💻 LocalNitro1.490s (+1.8%)2.006s (~)0.516s451.06x
💻 LocalExpress1.598s (~)2.007s (-1.1%)0.409s451.14x
💻 LocalNext.js (Turbopack)1.860s (+7.6% 🔺)2.172s (+7.1% 🔺)0.312s421.33x
🐘 PostgresNext.js (Turbopack)1.935s (~)2.150s (-1.1%)0.215s421.38x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.794s (-4.1%)3.166s (-3.5%)0.372s381.00x
🐘 PostgresExpress2.892s (-0.7%)3.221s (-9.0% 🟢)0.329s381.03x
💻 LocalNitro3.235s (+0.9%)4.009s (~)0.774s301.16x
💻 LocalExpress3.425s (~)4.043s (+0.8%)0.618s301.23x
💻 LocalNext.js (Turbopack)3.698s (-0.8%)4.148s (+1.0%)0.450s291.32x
🐘 PostgresNext.js (Turbopack)3.778s (-2.1%)4.009s (-1.7%)0.232s301.35x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.206s (-12.4% 🟢)1.006s (~)0.800s601.00x
🐘 PostgresExpress0.232s (-8.0% 🟢)1.007s (~)0.775s601.12x
🐘 PostgresNext.js (Turbopack)0.256s (-9.4% 🟢)1.006s (~)0.750s601.24x
💻 LocalNitro0.391s (-7.9% 🟢)1.004s (~)0.613s601.90x
💻 LocalExpress0.446s (-4.0%)1.005s (~)0.559s602.16x
💻 LocalNext.js (Turbopack)0.473s (-22.6% 🟢)1.005s (-3.3%)0.532s602.29x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.327s (-11.8% 🟢)1.007s (~)0.680s901.00x
🐘 PostgresExpress0.362s (+6.8% 🔺)1.007s (~)0.644s901.11x
🐘 PostgresNext.js (Turbopack)0.460s (-4.8%)1.006s (~)0.546s901.41x
💻 LocalNext.js (Turbopack)1.974s (-19.4% 🟢)2.584s (-16.9% 🟢)0.611s356.04x
💻 LocalNitro2.153s (+4.3%)2.736s (+3.7%)0.583s336.58x
💻 LocalExpress2.177s (-0.6%)2.913s (+3.2%)0.736s316.66x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.608s (-14.1% 🟢)1.005s (~)0.398s1201.00x
🐘 PostgresExpress0.707s (+13.0% 🔺)1.015s (-3.8%)0.308s1191.16x
🐘 PostgresNext.js (Turbopack)0.933s (-4.7%)1.366s (-15.0% 🟢)0.433s891.54x
💻 LocalNext.js (Turbopack)8.496s (-17.6% 🟢)9.329s (-17.4% 🟢)0.833s1313.98x
💻 LocalNitro9.623s (+10.5% 🔺)10.192s (+9.2% 🔺)0.569s1215.83x
💻 LocalExpress10.339s (~)10.863s (~)0.524s1217.01x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.160s (-1.8%)2.003s (~)0.001s (-7.1% 🟢)2.011s (~)0.852s101.00x
💻 LocalNitro1.169s (+1.6%)2.005s (~)0.011s (+14.0% 🔺)2.018s (~)0.849s101.01x
💻 LocalNext.js (Turbopack)1.170s (~)2.003s (~)0.009s (-15.8% 🟢)2.014s (~)0.845s101.01x
🐘 PostgresExpress1.172s (-1.8%)2.001s (~)0.001s (-96.5% 🟢)2.012s (-1.5%)0.840s101.01x
💻 LocalExpress1.178s (+0.8%)2.006s (~)0.014s (+9.4% 🔺)2.022s (~)0.844s101.02x
🐘 PostgresNext.js (Turbopack)1.227s (-0.6%)2.001s (~)0.001s (-20.0% 🟢)2.010s (~)0.783s101.06x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.567s (-5.8% 🟢)2.009s (~)0.004s (-8.5% 🟢)2.024s (~)0.457s301.00x
💻 LocalNext.js (Turbopack)1.580s (-3.7%)2.008s (~)0.008s (-17.5% 🟢)2.019s (~)0.438s301.01x
💻 LocalNitro1.594s (-8.5% 🟢)2.010s (~)0.010s (+8.7% 🔺)2.021s (-8.1% 🟢)0.427s301.02x
💻 LocalExpress1.604s (-2.0%)2.009s (~)0.012s (+8.2% 🔺)2.023s (~)0.419s301.02x
🐘 PostgresExpress1.632s (-6.0% 🟢)2.003s (-6.5% 🟢)0.004s (+27.8% 🔺)2.028s (-6.1% 🟢)0.395s301.04x
🐘 PostgresNext.js (Turbopack)1.735s (-1.7%)2.010s (~)0.004s (-5.8% 🟢)2.025s (~)0.290s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.698s (-3.5%)1.034s (~)0.000s (-66.7% 🟢)1.041s (-0.6%)0.343s581.00x
🐘 PostgresExpress0.737s (-24.6% 🟢)1.049s (-26.5% 🟢)0.000s (-50.9% 🟢)1.060s (-26.8% 🟢)0.323s571.06x
🐘 PostgresNext.js (Turbopack)0.845s (+1.5%)1.092s (+1.9%)0.000s (-100.0% 🟢)1.123s (+4.1%)0.278s551.21x
💻 LocalNext.js (Turbopack)1.227s (-15.2% 🟢)1.979s (-1.6%)0.000s (-3.2%)1.981s (-1.6%)0.754s311.76x
💻 LocalNitro1.370s (+1.2%)2.014s (~)0.000s (-13.3% 🟢)2.016s (~)0.646s301.96x
💻 LocalExpress1.448s (-2.3%)2.014s (~)0.000s (-46.7% 🟢)2.016s (~)0.568s302.07x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.419s (-12.1% 🟢)2.098s (-6.9% 🟢)0.000s (NaN%)2.135s (-6.4% 🟢)0.716s291.00x
🐘 PostgresNitro1.523s (+8.0% 🔺)2.180s (+9.2% 🔺)0.000s (+Infinity% 🔺)2.189s (+8.8% 🔺)0.666s281.07x
🐘 PostgresNext.js (Turbopack)1.802s (+4.3%)2.309s (+2.1%)0.000s (NaN%)2.318s (+2.1%)0.516s261.27x
💻 LocalNext.js (Turbopack)2.374s (-26.1% 🟢)3.019s (-22.5% 🟢)0.000s (-20.0% 🟢)3.022s (-22.5% 🟢)0.648s201.67x
💻 LocalNitro3.014s (-3.2%)3.614s (-7.2% 🟢)0.001s (+252.9% 🔺)3.617s (-7.3% 🟢)0.603s172.12x
💻 LocalExpress3.223s (-3.3%)3.904s (+1.7%)0.002s (+383.3% 🔺)3.908s (+1.7%)0.686s162.27x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresNitro18/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production1256102191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total71731010528235

❌ Failed Tests

▲ Vercel Production (10 failed)

astro (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

example (1 failed):

  • AbortController abortThrowIfAbortedWorkflow: throwIfAborted causes FatalError, no retries

fastify (1 failed):

  • outputStreamWorkflow negative startIndex (reads from end)

hono (1 failed):

  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KTME1GEXT2GC7YHM27G8KEY3 | 🔍 observability

nextjs-turbopack (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

nitro (2 failed):

  • utf8StreamWorkflow | wrun_01KTMDNBBSH43FEV2N2A7S5KDQ | 🔍 observability
  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

nuxt (2 failed):

  • webhookWorkflow | wrun_01KTMDHSXM87EH9KP6159TWSAV | 🔍 observability
  • outputStreamWorkflow no startIndex (reads all chunks)

vite (1 failed):

  • AbortController abortParallelWorkflow: abort cancels all parallel steps

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro108126
❌ example108126
✅ express109026
❌ fastify108126
❌ hono108126
❌ nextjs-turbopack13212
✅ nextjs-webpack13302
❌ nitro107226
❌ nuxt107226
✅ sveltekit12807
❌ vite108126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygp
pranaygp marked this pull request as ready for review June 8, 2026 19:48
@pranaygp
pranaygp requested a review from a team as a code ownerJune 8, 2026 19:48
CopilotAI review requested due to automatic review settings June 8, 2026 19:48

CopilotAI 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.

Pull request overview

This PR fixes a race in @workflow/world-local where writeExclusive() could expose a partially written destination file to concurrent readers by switching to a “write temp file → hard-link publish” flow, and adds tests to validate publication visibility and first-writer-wins behavior.

Changes:

  • Update writeExclusive() to publish via a fully-written temp file and an atomic hard-link into the final path.
  • Add deterministic tests ensuring destinations aren’t visible mid-write and that only one concurrent writer wins.
  • Add a patch changeset and refresh related inline comments in the storage layer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
packages/world-local/src/storage/events-storage.tsUpdates commentary to reflect the publish semantics used by writeExclusive().
packages/world-local/src/fs.tsImplements atomic publish for exclusive writes using temp file + hard-link.
packages/world-local/src/fs.test.tsAdds deterministic coverage for publication visibility and concurrent writer winner selection.
.changeset/atomic-runs-publish.mdPatch changeset documenting the fix for partial visibility during exclusive writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpackages/world-local/src/fs.ts

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve — clean fix for a real partial-read race, with one defensive nit

The bug is real and the fix is the right shape:

  • Before: fs.writeFile(filePath, data, { flag: 'wx' }) writes directly to the destination. The exclusive create guarantees only one writer wins, but the destination path becomes visible during the write — a concurrent runs.get() can read partial JSON and fail with SyntaxError: Unexpected end of JSON input.
  • After: write to ${filePath}.tmp.${ulid()} first, then fs.link() to the destination. Link creation is atomic at the OS level and fails with EEXIST if another writer already published.

This matches the established pattern in the sibling write() function (which uses fs.rename() for the overwriting variant); the only difference here is link vs rename to preserve first-writer-wins semantics.

Test design is excellent

The first test simulates a slow write by mocking fs.writeFile to pause mid-write, then attempts to read the destination. With the OLD code, the read returns partial content '{"value":'; with the NEW code, the read returns ENOENT (destination doesn't exist until link succeeds). The post-PR file content is exactly the full payload. Verified regression: I temporarily reverted just the fs.ts change and reran the test — got expected ENOENT, received '{"value":' exactly as the test asserts.

The second test (16 concurrent writers) confirms:

  1. Exactly one returns true (the winner)
  2. The final file content matches one specific writer's value
  3. The directory has only exclusive.json (no orphaned temp files)

That last assertion is the cleanup check, which catches the finally block actually running.

What I verified locally

  • pnpm turbo run build --filter @workflow/world-local
  • pnpm --filter @workflow/world-local test ✓ (368 tests pass)
  • Reverted the fix and confirmed the new partial-visibility test fails as expected → restored the fix, all green

CI

5 failures, all pre-existing on main's baseline:

  • Vercel Prod E2E (nextjs-turbopack, hono, fastify) — same flakes seen on main's recent runs
  • Local Postgres canary (nextjs-turbopack) — Next.js canary tracks; the latest main canary baseline shows similar instability
  • E2E Required Check — cascading

Nothing PR-specific.

One defensive nit (non-blocker, inline)

Copilot caught a small defensive-coding miss: the finally block unconditionally unlinks tempPath, but if the fs.writeFile(tempPath, ..., { flag: 'wx' }) itself fails with EEXIST (vanishingly rare ULID collision or a stale temp from a crashed process), the unlink would delete someone else's temp file. The existing write() function already handles this with a tempFileCreated flag — same pattern would close the gap here. Inline comment with the snippet.

Practical risk is essentially zero (2^-40 collision probability), but matching the surrounding pattern is essentially free.

Bottom line

Solid fix for a real race that surfaces as SyntaxError: Unexpected end of JSON input in production. The hard-link-after-write pattern is the canonical atomic-publish primitive for "first writer wins" semantics on POSIX filesystems.

Approving.

Comment threadpackages/world-local/src/fs.ts Outdated
@pranaygp
pranaygp merged commit 867e339 into mainJun 8, 2026
34 of 58 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Jun 8, 2026
github-actionsBot added a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2299. Merge conflicts were resolved by AI — please review carefully. (backport job run)

pranaygp pushed a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pranaygp added a commit that referenced this pull request Jun 11, 2026
…-attributes-client
* origin/main: (32 commits)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
[world-vercel] Validate ref resolve responses before use (#2035)
fix: bump devalue to 5.8.1 (#2292)
Handle lazy stream key request failures (#2257)
fix(docs): declare Nitro auto-import globals for code samples (#2290)
[core] Preserve event-log order in hook-vs-sleep replay races (#2171) (#2185)
docs: add nitro changelog (#2232)
fix(next): always apply turbopack content condition regardless of builder mode (#2253)
Update @vercel/queue from 0.2.1 to 0.3.0 (#2255)
[nest] Use AST-based CommonJS import rewriting (#2080)
...
# Conflicts:
#	packages/world-local/src/storage/events-storage.ts
pranaygp added a commit that referenced this pull request Jun 11, 2026
…hook-ready
* origin-https/main: (119 commits)
fix: settle aborted parallel steps before completing abortParallelWorkflow (#2244)
Add native v4 workflow attribute events (#2226)
Version Packages (beta) (#2326)
[ci] Fix flaky windows unit tests (#2359)
Capture Vercel runtime logs when e2e Vercel Prod lanes fail (#2356)
Fix e2e failure reporting under vitest 4 and preserve fetch error causes (#2355)
[core] Fix process crash from rejected waitUntil promises (#2336)
[core] Remove duplicate `waitUntil` for suspension handler async operations (#2345)
Prevent local tests from hanging (#2338)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
...
# Conflicts:
#	packages/core/src/runtime.ts
#	packages/core/src/runtime/suspension-handler.ts
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.

3 participants

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

[codex] Fix partial world-local exclusive writes - #2296

Merged
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write
Jun 8, 2026
Merged

[codex] Fix partial world-local exclusive writes#2296
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Summary

  • write exclusive local files to a unique temporary path before publishing them
  • use an atomic hard link to preserve first-writer-wins behavior without exposing partial contents
  • add deterministic coverage for publication visibility and concurrent writers
  • add a patch changeset for @workflow/world-local

Root cause

writeExclusive() previously called fs.writeFile() directly on the final path with the wx flag. The exclusive create prevented another writer from winning, but the final path became visible before the JSON body was fully written. A concurrent runs.get() could therefore read an empty or truncated run file and fail with SyntaxError: Unexpected end of JSON input.

The new implementation writes and closes a temporary file first, then hard-links it into the final path. Link creation is atomic and returns EEXIST when another writer has already published the destination.

Verification

  • pnpm --filter @workflow/world-local test (368 tests)
  • pnpm --filter @workflow/world-local typecheck
  • pnpm turbo run build --filter=@workflow/world-local...
  • targeted Biome check (existing complexity warnings only)

@changeset-bot

changeset-botBot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89971e0

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

This PR includes changesets to release 18 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/vitestPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/webPatch
@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

@vercel

vercelBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 8, 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.044s (+2.1%)1.006s (~)0.962s101.00x
💻 LocalNext.js (Turbopack)0.046s (-16.0% 🟢)1.004s (~)0.958s101.06x
💻 LocalExpress0.047s (+9.7% 🔺)1.006s (~)0.959s101.08x
🐘 PostgresNitro0.058s (-8.9% 🟢)1.011s (~)0.953s101.32x
🐘 PostgresExpress0.065s (-1.5%)1.013s (~)0.948s101.49x
🐘 PostgresNext.js (Turbopack)0.068s (-3.1%)1.011s (~)0.944s101.55x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.095s (~)2.006s (~)0.910s101.00x
💻 LocalExpress1.099s (~)2.007s (~)0.908s101.00x
🐘 PostgresNitro1.105s (-0.8%)2.009s (~)0.904s101.01x
💻 LocalNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🐘 PostgresExpress1.114s (+2.1%)2.010s (~)0.896s101.02x
🐘 PostgresNext.js (Turbopack)1.143s (~)2.011s (~)0.867s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.541s (~)11.021s (~)0.480s31.00x
💻 LocalExpress10.552s (~)11.023s (~)0.471s31.00x
🐘 PostgresNitro10.573s (~)11.016s (~)0.443s31.00x
💻 LocalNext.js (Turbopack)10.618s (~)11.020s (~)0.402s31.01x
🐘 PostgresExpress10.627s (-0.8%)11.021s (-2.9%)0.394s31.01x
🐘 PostgresNext.js (Turbopack)11.021s (+1.9%)11.683s (+6.0% 🔺)0.661s31.05x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.848s (~)14.017s (-1.5%)0.169s51.00x
💻 LocalNitro13.854s (+1.0%)14.225s (+1.4%)0.371s51.00x
🐘 PostgresNitro13.888s (~)14.017s (~)0.129s51.00x
💻 LocalExpress13.891s (~)14.228s (~)0.337s51.00x
💻 LocalNext.js (Turbopack)13.947s (-0.6%)14.024s (-4.1%)0.077s51.01x
🐘 PostgresNext.js (Turbopack)14.443s (-1.0%)15.017s (~)0.574s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.482s (+0.6%)13.025s (~)0.543s71.00x
🐘 PostgresNitro12.547s (-1.5%)13.017s (~)0.470s71.01x
💻 LocalExpress12.612s (~)13.025s (~)0.414s71.01x
🐘 PostgresExpress12.615s (-0.9%)13.021s (-2.2%)0.406s71.01x
💻 LocalNext.js (Turbopack)12.796s (-1.2%)13.023s (-2.1%)0.226s71.03x
🐘 PostgresNext.js (Turbopack)13.827s (~)14.018s (~)0.191s71.11x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.189s (-0.8%)2.007s (~)0.818s151.00x
🐘 PostgresExpress1.190s (-0.8%)2.007s (-0.7%)0.818s151.00x
💻 LocalExpress1.211s (-4.1%)2.007s (~)0.795s151.02x
💻 LocalNitro1.236s (+1.9%)2.006s (~)0.770s151.04x
🐘 PostgresNext.js (Turbopack)1.259s (+0.6%)2.008s (~)0.749s151.06x
💻 LocalNext.js (Turbopack)1.308s (+7.0% 🔺)2.005s (~)0.697s151.10x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.241s (-1.4%)2.007s (~)0.766s151.00x
🐘 PostgresExpress1.250s (-5.7% 🟢)2.008s (~)0.757s151.01x
🐘 PostgresNext.js (Turbopack)1.394s (-1.1%)2.006s (~)0.613s151.12x
💻 LocalNitro1.817s (+6.6% 🔺)2.073s (~)0.256s151.46x
💻 LocalNext.js (Turbopack)1.881s (+9.0% 🔺)2.314s (+15.4% 🔺)0.434s131.52x
💻 LocalExpress1.928s (+2.4%)2.222s (~)0.294s141.55x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-5.7% 🟢)2.006s (~)0.680s151.00x
🐘 PostgresExpress1.395s (~)2.007s (~)0.612s151.05x
🐘 PostgresNext.js (Turbopack)1.760s (~)2.392s (+4.3%)0.633s131.33x
💻 LocalNext.js (Turbopack)3.768s (-14.3% 🟢)4.133s (-17.5% 🟢)0.365s82.84x
💻 LocalExpress5.430s (+2.5%)6.015s (~)0.585s64.09x
💻 LocalNitro5.698s (+20.8% 🔺)6.213s (+24.0% 🔺)0.515s54.29x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.183s (-1.4%)2.008s (~)0.825s151.00x
🐘 PostgresExpress1.212s (+0.8%)2.008s (~)0.795s151.03x
🐘 PostgresNext.js (Turbopack)1.248s (-1.4%)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.257s (-3.7%)2.005s (~)0.748s151.06x
💻 LocalNitro1.551s (~)2.006s (~)0.455s151.31x
💻 LocalExpress1.576s (-4.9%)2.007s (-3.2%)0.431s151.33x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.226s (-3.8%)2.007s (~)0.780s151.00x
🐘 PostgresExpress1.265s (+1.8%)2.008s (~)0.743s151.03x
🐘 PostgresNext.js (Turbopack)1.397s (~)2.008s (~)0.611s151.14x
💻 LocalNext.js (Turbopack)2.041s (+1.0%)2.469s (-1.5%)0.428s131.66x
💻 LocalNitro2.170s (+23.5% 🔺)2.592s (+25.1% 🔺)0.421s121.77x
💻 LocalExpress2.220s (+4.5%)2.736s (+5.6% 🔺)0.516s111.81x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.333s (-8.8% 🟢)2.007s (~)0.674s151.00x
🐘 PostgresExpress1.394s (-7.1% 🟢)2.008s (-16.2% 🟢)0.614s151.05x
🐘 PostgresNext.js (Turbopack)1.608s (-2.9%)2.007s (-3.2%)0.399s151.21x
💻 LocalNext.js (Turbopack)4.589s (-11.1% 🟢)5.012s (-16.7% 🟢)0.423s73.44x
💻 LocalNitro5.816s (+22.6% 🔺)6.219s (+16.4% 🔺)0.403s54.36x
💻 LocalExpress6.294s (+7.4% 🔺)6.816s (+9.7% 🔺)0.521s54.72x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.575s (-13.8% 🟢)1.007s (-3.9%)0.432s601.00x
🐘 PostgresNitro0.590s (-3.1%)1.023s (+1.6%)0.433s591.03x
💻 LocalNitro0.614s (-23.6% 🟢)1.021s (-15.2% 🟢)0.407s591.07x
💻 LocalExpress0.638s (-2.8%)1.005s (-3.3%)0.368s601.11x
💻 LocalNext.js (Turbopack)0.690s (-0.9%)1.021s (+1.6%)0.330s601.20x
🐘 PostgresNext.js (Turbopack)0.800s (-1.4%)1.006s (~)0.206s601.39x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.400s (-1.2%)2.053s (+2.3%)0.654s441.00x
🐘 PostgresExpress1.431s (-6.8% 🟢)2.008s (-6.7% 🟢)0.577s451.02x
💻 LocalNitro1.490s (+1.8%)2.006s (~)0.516s451.06x
💻 LocalExpress1.598s (~)2.007s (-1.1%)0.409s451.14x
💻 LocalNext.js (Turbopack)1.860s (+7.6% 🔺)2.172s (+7.1% 🔺)0.312s421.33x
🐘 PostgresNext.js (Turbopack)1.935s (~)2.150s (-1.1%)0.215s421.38x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.794s (-4.1%)3.166s (-3.5%)0.372s381.00x
🐘 PostgresExpress2.892s (-0.7%)3.221s (-9.0% 🟢)0.329s381.03x
💻 LocalNitro3.235s (+0.9%)4.009s (~)0.774s301.16x
💻 LocalExpress3.425s (~)4.043s (+0.8%)0.618s301.23x
💻 LocalNext.js (Turbopack)3.698s (-0.8%)4.148s (+1.0%)0.450s291.32x
🐘 PostgresNext.js (Turbopack)3.778s (-2.1%)4.009s (-1.7%)0.232s301.35x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.206s (-12.4% 🟢)1.006s (~)0.800s601.00x
🐘 PostgresExpress0.232s (-8.0% 🟢)1.007s (~)0.775s601.12x
🐘 PostgresNext.js (Turbopack)0.256s (-9.4% 🟢)1.006s (~)0.750s601.24x
💻 LocalNitro0.391s (-7.9% 🟢)1.004s (~)0.613s601.90x
💻 LocalExpress0.446s (-4.0%)1.005s (~)0.559s602.16x
💻 LocalNext.js (Turbopack)0.473s (-22.6% 🟢)1.005s (-3.3%)0.532s602.29x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.327s (-11.8% 🟢)1.007s (~)0.680s901.00x
🐘 PostgresExpress0.362s (+6.8% 🔺)1.007s (~)0.644s901.11x
🐘 PostgresNext.js (Turbopack)0.460s (-4.8%)1.006s (~)0.546s901.41x
💻 LocalNext.js (Turbopack)1.974s (-19.4% 🟢)2.584s (-16.9% 🟢)0.611s356.04x
💻 LocalNitro2.153s (+4.3%)2.736s (+3.7%)0.583s336.58x
💻 LocalExpress2.177s (-0.6%)2.913s (+3.2%)0.736s316.66x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.608s (-14.1% 🟢)1.005s (~)0.398s1201.00x
🐘 PostgresExpress0.707s (+13.0% 🔺)1.015s (-3.8%)0.308s1191.16x
🐘 PostgresNext.js (Turbopack)0.933s (-4.7%)1.366s (-15.0% 🟢)0.433s891.54x
💻 LocalNext.js (Turbopack)8.496s (-17.6% 🟢)9.329s (-17.4% 🟢)0.833s1313.98x
💻 LocalNitro9.623s (+10.5% 🔺)10.192s (+9.2% 🔺)0.569s1215.83x
💻 LocalExpress10.339s (~)10.863s (~)0.524s1217.01x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.160s (-1.8%)2.003s (~)0.001s (-7.1% 🟢)2.011s (~)0.852s101.00x
💻 LocalNitro1.169s (+1.6%)2.005s (~)0.011s (+14.0% 🔺)2.018s (~)0.849s101.01x
💻 LocalNext.js (Turbopack)1.170s (~)2.003s (~)0.009s (-15.8% 🟢)2.014s (~)0.845s101.01x
🐘 PostgresExpress1.172s (-1.8%)2.001s (~)0.001s (-96.5% 🟢)2.012s (-1.5%)0.840s101.01x
💻 LocalExpress1.178s (+0.8%)2.006s (~)0.014s (+9.4% 🔺)2.022s (~)0.844s101.02x
🐘 PostgresNext.js (Turbopack)1.227s (-0.6%)2.001s (~)0.001s (-20.0% 🟢)2.010s (~)0.783s101.06x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.567s (-5.8% 🟢)2.009s (~)0.004s (-8.5% 🟢)2.024s (~)0.457s301.00x
💻 LocalNext.js (Turbopack)1.580s (-3.7%)2.008s (~)0.008s (-17.5% 🟢)2.019s (~)0.438s301.01x
💻 LocalNitro1.594s (-8.5% 🟢)2.010s (~)0.010s (+8.7% 🔺)2.021s (-8.1% 🟢)0.427s301.02x
💻 LocalExpress1.604s (-2.0%)2.009s (~)0.012s (+8.2% 🔺)2.023s (~)0.419s301.02x
🐘 PostgresExpress1.632s (-6.0% 🟢)2.003s (-6.5% 🟢)0.004s (+27.8% 🔺)2.028s (-6.1% 🟢)0.395s301.04x
🐘 PostgresNext.js (Turbopack)1.735s (-1.7%)2.010s (~)0.004s (-5.8% 🟢)2.025s (~)0.290s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.698s (-3.5%)1.034s (~)0.000s (-66.7% 🟢)1.041s (-0.6%)0.343s581.00x
🐘 PostgresExpress0.737s (-24.6% 🟢)1.049s (-26.5% 🟢)0.000s (-50.9% 🟢)1.060s (-26.8% 🟢)0.323s571.06x
🐘 PostgresNext.js (Turbopack)0.845s (+1.5%)1.092s (+1.9%)0.000s (-100.0% 🟢)1.123s (+4.1%)0.278s551.21x
💻 LocalNext.js (Turbopack)1.227s (-15.2% 🟢)1.979s (-1.6%)0.000s (-3.2%)1.981s (-1.6%)0.754s311.76x
💻 LocalNitro1.370s (+1.2%)2.014s (~)0.000s (-13.3% 🟢)2.016s (~)0.646s301.96x
💻 LocalExpress1.448s (-2.3%)2.014s (~)0.000s (-46.7% 🟢)2.016s (~)0.568s302.07x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.419s (-12.1% 🟢)2.098s (-6.9% 🟢)0.000s (NaN%)2.135s (-6.4% 🟢)0.716s291.00x
🐘 PostgresNitro1.523s (+8.0% 🔺)2.180s (+9.2% 🔺)0.000s (+Infinity% 🔺)2.189s (+8.8% 🔺)0.666s281.07x
🐘 PostgresNext.js (Turbopack)1.802s (+4.3%)2.309s (+2.1%)0.000s (NaN%)2.318s (+2.1%)0.516s261.27x
💻 LocalNext.js (Turbopack)2.374s (-26.1% 🟢)3.019s (-22.5% 🟢)0.000s (-20.0% 🟢)3.022s (-22.5% 🟢)0.648s201.67x
💻 LocalNitro3.014s (-3.2%)3.614s (-7.2% 🟢)0.001s (+252.9% 🔺)3.617s (-7.3% 🟢)0.603s172.12x
💻 LocalExpress3.223s (-3.3%)3.904s (+1.7%)0.002s (+383.3% 🔺)3.908s (+1.7%)0.686s162.27x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresNitro18/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production1256102191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total71731010528235

❌ Failed Tests

▲ Vercel Production (10 failed)

astro (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

example (1 failed):

  • AbortController abortThrowIfAbortedWorkflow: throwIfAborted causes FatalError, no retries

fastify (1 failed):

  • outputStreamWorkflow negative startIndex (reads from end)

hono (1 failed):

  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KTME1GEXT2GC7YHM27G8KEY3 | 🔍 observability

nextjs-turbopack (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

nitro (2 failed):

  • utf8StreamWorkflow | wrun_01KTMDNBBSH43FEV2N2A7S5KDQ | 🔍 observability
  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

nuxt (2 failed):

  • webhookWorkflow | wrun_01KTMDHSXM87EH9KP6159TWSAV | 🔍 observability
  • outputStreamWorkflow no startIndex (reads all chunks)

vite (1 failed):

  • AbortController abortParallelWorkflow: abort cancels all parallel steps

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro108126
❌ example108126
✅ express109026
❌ fastify108126
❌ hono108126
❌ nextjs-turbopack13212
✅ nextjs-webpack13302
❌ nitro107226
❌ nuxt107226
✅ sveltekit12807
❌ vite108126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygp
pranaygp marked this pull request as ready for review June 8, 2026 19:48
@pranaygp
pranaygp requested a review from a team as a code ownerJune 8, 2026 19:48
CopilotAI review requested due to automatic review settings June 8, 2026 19:48

CopilotAI 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.

Pull request overview

This PR fixes a race in @workflow/world-local where writeExclusive() could expose a partially written destination file to concurrent readers by switching to a “write temp file → hard-link publish” flow, and adds tests to validate publication visibility and first-writer-wins behavior.

Changes:

  • Update writeExclusive() to publish via a fully-written temp file and an atomic hard-link into the final path.
  • Add deterministic tests ensuring destinations aren’t visible mid-write and that only one concurrent writer wins.
  • Add a patch changeset and refresh related inline comments in the storage layer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
packages/world-local/src/storage/events-storage.tsUpdates commentary to reflect the publish semantics used by writeExclusive().
packages/world-local/src/fs.tsImplements atomic publish for exclusive writes using temp file + hard-link.
packages/world-local/src/fs.test.tsAdds deterministic coverage for publication visibility and concurrent writer winner selection.
.changeset/atomic-runs-publish.mdPatch changeset documenting the fix for partial visibility during exclusive writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpackages/world-local/src/fs.ts

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve — clean fix for a real partial-read race, with one defensive nit

The bug is real and the fix is the right shape:

  • Before: fs.writeFile(filePath, data, { flag: 'wx' }) writes directly to the destination. The exclusive create guarantees only one writer wins, but the destination path becomes visible during the write — a concurrent runs.get() can read partial JSON and fail with SyntaxError: Unexpected end of JSON input.
  • After: write to ${filePath}.tmp.${ulid()} first, then fs.link() to the destination. Link creation is atomic at the OS level and fails with EEXIST if another writer already published.

This matches the established pattern in the sibling write() function (which uses fs.rename() for the overwriting variant); the only difference here is link vs rename to preserve first-writer-wins semantics.

Test design is excellent

The first test simulates a slow write by mocking fs.writeFile to pause mid-write, then attempts to read the destination. With the OLD code, the read returns partial content '{"value":'; with the NEW code, the read returns ENOENT (destination doesn't exist until link succeeds). The post-PR file content is exactly the full payload. Verified regression: I temporarily reverted just the fs.ts change and reran the test — got expected ENOENT, received '{"value":' exactly as the test asserts.

The second test (16 concurrent writers) confirms:

  1. Exactly one returns true (the winner)
  2. The final file content matches one specific writer's value
  3. The directory has only exclusive.json (no orphaned temp files)

That last assertion is the cleanup check, which catches the finally block actually running.

What I verified locally

  • pnpm turbo run build --filter @workflow/world-local
  • pnpm --filter @workflow/world-local test ✓ (368 tests pass)
  • Reverted the fix and confirmed the new partial-visibility test fails as expected → restored the fix, all green

CI

5 failures, all pre-existing on main's baseline:

  • Vercel Prod E2E (nextjs-turbopack, hono, fastify) — same flakes seen on main's recent runs
  • Local Postgres canary (nextjs-turbopack) — Next.js canary tracks; the latest main canary baseline shows similar instability
  • E2E Required Check — cascading

Nothing PR-specific.

One defensive nit (non-blocker, inline)

Copilot caught a small defensive-coding miss: the finally block unconditionally unlinks tempPath, but if the fs.writeFile(tempPath, ..., { flag: 'wx' }) itself fails with EEXIST (vanishingly rare ULID collision or a stale temp from a crashed process), the unlink would delete someone else's temp file. The existing write() function already handles this with a tempFileCreated flag — same pattern would close the gap here. Inline comment with the snippet.

Practical risk is essentially zero (2^-40 collision probability), but matching the surrounding pattern is essentially free.

Bottom line

Solid fix for a real race that surfaces as SyntaxError: Unexpected end of JSON input in production. The hard-link-after-write pattern is the canonical atomic-publish primitive for "first writer wins" semantics on POSIX filesystems.

Approving.

Comment threadpackages/world-local/src/fs.ts Outdated
@pranaygp
pranaygp merged commit 867e339 into mainJun 8, 2026
34 of 58 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Jun 8, 2026
github-actionsBot added a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2299. Merge conflicts were resolved by AI — please review carefully. (backport job run)

pranaygp pushed a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pranaygp added a commit that referenced this pull request Jun 11, 2026
…-attributes-client
* origin/main: (32 commits)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
[world-vercel] Validate ref resolve responses before use (#2035)
fix: bump devalue to 5.8.1 (#2292)
Handle lazy stream key request failures (#2257)
fix(docs): declare Nitro auto-import globals for code samples (#2290)
[core] Preserve event-log order in hook-vs-sleep replay races (#2171) (#2185)
docs: add nitro changelog (#2232)
fix(next): always apply turbopack content condition regardless of builder mode (#2253)
Update @vercel/queue from 0.2.1 to 0.3.0 (#2255)
[nest] Use AST-based CommonJS import rewriting (#2080)
...
# Conflicts:
#	packages/world-local/src/storage/events-storage.ts
pranaygp added a commit that referenced this pull request Jun 11, 2026
…hook-ready
* origin-https/main: (119 commits)
fix: settle aborted parallel steps before completing abortParallelWorkflow (#2244)
Add native v4 workflow attribute events (#2226)
Version Packages (beta) (#2326)
[ci] Fix flaky windows unit tests (#2359)
Capture Vercel runtime logs when e2e Vercel Prod lanes fail (#2356)
Fix e2e failure reporting under vitest 4 and preserve fetch error causes (#2355)
[core] Fix process crash from rejected waitUntil promises (#2336)
[core] Remove duplicate `waitUntil` for suspension handler async operations (#2345)
Prevent local tests from hanging (#2338)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
...
# Conflicts:
#	packages/core/src/runtime.ts
#	packages/core/src/runtime/suspension-handler.ts
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.

3 participants

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

[codex] Fix partial world-local exclusive writes - #2296

Merged
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write
Jun 8, 2026
Merged

[codex] Fix partial world-local exclusive writes#2296
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Summary

  • write exclusive local files to a unique temporary path before publishing them
  • use an atomic hard link to preserve first-writer-wins behavior without exposing partial contents
  • add deterministic coverage for publication visibility and concurrent writers
  • add a patch changeset for @workflow/world-local

Root cause

writeExclusive() previously called fs.writeFile() directly on the final path with the wx flag. The exclusive create prevented another writer from winning, but the final path became visible before the JSON body was fully written. A concurrent runs.get() could therefore read an empty or truncated run file and fail with SyntaxError: Unexpected end of JSON input.

The new implementation writes and closes a temporary file first, then hard-links it into the final path. Link creation is atomic and returns EEXIST when another writer has already published the destination.

Verification

  • pnpm --filter @workflow/world-local test (368 tests)
  • pnpm --filter @workflow/world-local typecheck
  • pnpm turbo run build --filter=@workflow/world-local...
  • targeted Biome check (existing complexity warnings only)

@changeset-bot

changeset-botBot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89971e0

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

This PR includes changesets to release 18 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/vitestPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/webPatch
@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

@vercel

vercelBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 8, 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.044s (+2.1%)1.006s (~)0.962s101.00x
💻 LocalNext.js (Turbopack)0.046s (-16.0% 🟢)1.004s (~)0.958s101.06x
💻 LocalExpress0.047s (+9.7% 🔺)1.006s (~)0.959s101.08x
🐘 PostgresNitro0.058s (-8.9% 🟢)1.011s (~)0.953s101.32x
🐘 PostgresExpress0.065s (-1.5%)1.013s (~)0.948s101.49x
🐘 PostgresNext.js (Turbopack)0.068s (-3.1%)1.011s (~)0.944s101.55x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.095s (~)2.006s (~)0.910s101.00x
💻 LocalExpress1.099s (~)2.007s (~)0.908s101.00x
🐘 PostgresNitro1.105s (-0.8%)2.009s (~)0.904s101.01x
💻 LocalNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🐘 PostgresExpress1.114s (+2.1%)2.010s (~)0.896s101.02x
🐘 PostgresNext.js (Turbopack)1.143s (~)2.011s (~)0.867s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.541s (~)11.021s (~)0.480s31.00x
💻 LocalExpress10.552s (~)11.023s (~)0.471s31.00x
🐘 PostgresNitro10.573s (~)11.016s (~)0.443s31.00x
💻 LocalNext.js (Turbopack)10.618s (~)11.020s (~)0.402s31.01x
🐘 PostgresExpress10.627s (-0.8%)11.021s (-2.9%)0.394s31.01x
🐘 PostgresNext.js (Turbopack)11.021s (+1.9%)11.683s (+6.0% 🔺)0.661s31.05x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.848s (~)14.017s (-1.5%)0.169s51.00x
💻 LocalNitro13.854s (+1.0%)14.225s (+1.4%)0.371s51.00x
🐘 PostgresNitro13.888s (~)14.017s (~)0.129s51.00x
💻 LocalExpress13.891s (~)14.228s (~)0.337s51.00x
💻 LocalNext.js (Turbopack)13.947s (-0.6%)14.024s (-4.1%)0.077s51.01x
🐘 PostgresNext.js (Turbopack)14.443s (-1.0%)15.017s (~)0.574s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.482s (+0.6%)13.025s (~)0.543s71.00x
🐘 PostgresNitro12.547s (-1.5%)13.017s (~)0.470s71.01x
💻 LocalExpress12.612s (~)13.025s (~)0.414s71.01x
🐘 PostgresExpress12.615s (-0.9%)13.021s (-2.2%)0.406s71.01x
💻 LocalNext.js (Turbopack)12.796s (-1.2%)13.023s (-2.1%)0.226s71.03x
🐘 PostgresNext.js (Turbopack)13.827s (~)14.018s (~)0.191s71.11x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.189s (-0.8%)2.007s (~)0.818s151.00x
🐘 PostgresExpress1.190s (-0.8%)2.007s (-0.7%)0.818s151.00x
💻 LocalExpress1.211s (-4.1%)2.007s (~)0.795s151.02x
💻 LocalNitro1.236s (+1.9%)2.006s (~)0.770s151.04x
🐘 PostgresNext.js (Turbopack)1.259s (+0.6%)2.008s (~)0.749s151.06x
💻 LocalNext.js (Turbopack)1.308s (+7.0% 🔺)2.005s (~)0.697s151.10x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.241s (-1.4%)2.007s (~)0.766s151.00x
🐘 PostgresExpress1.250s (-5.7% 🟢)2.008s (~)0.757s151.01x
🐘 PostgresNext.js (Turbopack)1.394s (-1.1%)2.006s (~)0.613s151.12x
💻 LocalNitro1.817s (+6.6% 🔺)2.073s (~)0.256s151.46x
💻 LocalNext.js (Turbopack)1.881s (+9.0% 🔺)2.314s (+15.4% 🔺)0.434s131.52x
💻 LocalExpress1.928s (+2.4%)2.222s (~)0.294s141.55x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-5.7% 🟢)2.006s (~)0.680s151.00x
🐘 PostgresExpress1.395s (~)2.007s (~)0.612s151.05x
🐘 PostgresNext.js (Turbopack)1.760s (~)2.392s (+4.3%)0.633s131.33x
💻 LocalNext.js (Turbopack)3.768s (-14.3% 🟢)4.133s (-17.5% 🟢)0.365s82.84x
💻 LocalExpress5.430s (+2.5%)6.015s (~)0.585s64.09x
💻 LocalNitro5.698s (+20.8% 🔺)6.213s (+24.0% 🔺)0.515s54.29x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.183s (-1.4%)2.008s (~)0.825s151.00x
🐘 PostgresExpress1.212s (+0.8%)2.008s (~)0.795s151.03x
🐘 PostgresNext.js (Turbopack)1.248s (-1.4%)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.257s (-3.7%)2.005s (~)0.748s151.06x
💻 LocalNitro1.551s (~)2.006s (~)0.455s151.31x
💻 LocalExpress1.576s (-4.9%)2.007s (-3.2%)0.431s151.33x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.226s (-3.8%)2.007s (~)0.780s151.00x
🐘 PostgresExpress1.265s (+1.8%)2.008s (~)0.743s151.03x
🐘 PostgresNext.js (Turbopack)1.397s (~)2.008s (~)0.611s151.14x
💻 LocalNext.js (Turbopack)2.041s (+1.0%)2.469s (-1.5%)0.428s131.66x
💻 LocalNitro2.170s (+23.5% 🔺)2.592s (+25.1% 🔺)0.421s121.77x
💻 LocalExpress2.220s (+4.5%)2.736s (+5.6% 🔺)0.516s111.81x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.333s (-8.8% 🟢)2.007s (~)0.674s151.00x
🐘 PostgresExpress1.394s (-7.1% 🟢)2.008s (-16.2% 🟢)0.614s151.05x
🐘 PostgresNext.js (Turbopack)1.608s (-2.9%)2.007s (-3.2%)0.399s151.21x
💻 LocalNext.js (Turbopack)4.589s (-11.1% 🟢)5.012s (-16.7% 🟢)0.423s73.44x
💻 LocalNitro5.816s (+22.6% 🔺)6.219s (+16.4% 🔺)0.403s54.36x
💻 LocalExpress6.294s (+7.4% 🔺)6.816s (+9.7% 🔺)0.521s54.72x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.575s (-13.8% 🟢)1.007s (-3.9%)0.432s601.00x
🐘 PostgresNitro0.590s (-3.1%)1.023s (+1.6%)0.433s591.03x
💻 LocalNitro0.614s (-23.6% 🟢)1.021s (-15.2% 🟢)0.407s591.07x
💻 LocalExpress0.638s (-2.8%)1.005s (-3.3%)0.368s601.11x
💻 LocalNext.js (Turbopack)0.690s (-0.9%)1.021s (+1.6%)0.330s601.20x
🐘 PostgresNext.js (Turbopack)0.800s (-1.4%)1.006s (~)0.206s601.39x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.400s (-1.2%)2.053s (+2.3%)0.654s441.00x
🐘 PostgresExpress1.431s (-6.8% 🟢)2.008s (-6.7% 🟢)0.577s451.02x
💻 LocalNitro1.490s (+1.8%)2.006s (~)0.516s451.06x
💻 LocalExpress1.598s (~)2.007s (-1.1%)0.409s451.14x
💻 LocalNext.js (Turbopack)1.860s (+7.6% 🔺)2.172s (+7.1% 🔺)0.312s421.33x
🐘 PostgresNext.js (Turbopack)1.935s (~)2.150s (-1.1%)0.215s421.38x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.794s (-4.1%)3.166s (-3.5%)0.372s381.00x
🐘 PostgresExpress2.892s (-0.7%)3.221s (-9.0% 🟢)0.329s381.03x
💻 LocalNitro3.235s (+0.9%)4.009s (~)0.774s301.16x
💻 LocalExpress3.425s (~)4.043s (+0.8%)0.618s301.23x
💻 LocalNext.js (Turbopack)3.698s (-0.8%)4.148s (+1.0%)0.450s291.32x
🐘 PostgresNext.js (Turbopack)3.778s (-2.1%)4.009s (-1.7%)0.232s301.35x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.206s (-12.4% 🟢)1.006s (~)0.800s601.00x
🐘 PostgresExpress0.232s (-8.0% 🟢)1.007s (~)0.775s601.12x
🐘 PostgresNext.js (Turbopack)0.256s (-9.4% 🟢)1.006s (~)0.750s601.24x
💻 LocalNitro0.391s (-7.9% 🟢)1.004s (~)0.613s601.90x
💻 LocalExpress0.446s (-4.0%)1.005s (~)0.559s602.16x
💻 LocalNext.js (Turbopack)0.473s (-22.6% 🟢)1.005s (-3.3%)0.532s602.29x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.327s (-11.8% 🟢)1.007s (~)0.680s901.00x
🐘 PostgresExpress0.362s (+6.8% 🔺)1.007s (~)0.644s901.11x
🐘 PostgresNext.js (Turbopack)0.460s (-4.8%)1.006s (~)0.546s901.41x
💻 LocalNext.js (Turbopack)1.974s (-19.4% 🟢)2.584s (-16.9% 🟢)0.611s356.04x
💻 LocalNitro2.153s (+4.3%)2.736s (+3.7%)0.583s336.58x
💻 LocalExpress2.177s (-0.6%)2.913s (+3.2%)0.736s316.66x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.608s (-14.1% 🟢)1.005s (~)0.398s1201.00x
🐘 PostgresExpress0.707s (+13.0% 🔺)1.015s (-3.8%)0.308s1191.16x
🐘 PostgresNext.js (Turbopack)0.933s (-4.7%)1.366s (-15.0% 🟢)0.433s891.54x
💻 LocalNext.js (Turbopack)8.496s (-17.6% 🟢)9.329s (-17.4% 🟢)0.833s1313.98x
💻 LocalNitro9.623s (+10.5% 🔺)10.192s (+9.2% 🔺)0.569s1215.83x
💻 LocalExpress10.339s (~)10.863s (~)0.524s1217.01x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.160s (-1.8%)2.003s (~)0.001s (-7.1% 🟢)2.011s (~)0.852s101.00x
💻 LocalNitro1.169s (+1.6%)2.005s (~)0.011s (+14.0% 🔺)2.018s (~)0.849s101.01x
💻 LocalNext.js (Turbopack)1.170s (~)2.003s (~)0.009s (-15.8% 🟢)2.014s (~)0.845s101.01x
🐘 PostgresExpress1.172s (-1.8%)2.001s (~)0.001s (-96.5% 🟢)2.012s (-1.5%)0.840s101.01x
💻 LocalExpress1.178s (+0.8%)2.006s (~)0.014s (+9.4% 🔺)2.022s (~)0.844s101.02x
🐘 PostgresNext.js (Turbopack)1.227s (-0.6%)2.001s (~)0.001s (-20.0% 🟢)2.010s (~)0.783s101.06x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.567s (-5.8% 🟢)2.009s (~)0.004s (-8.5% 🟢)2.024s (~)0.457s301.00x
💻 LocalNext.js (Turbopack)1.580s (-3.7%)2.008s (~)0.008s (-17.5% 🟢)2.019s (~)0.438s301.01x
💻 LocalNitro1.594s (-8.5% 🟢)2.010s (~)0.010s (+8.7% 🔺)2.021s (-8.1% 🟢)0.427s301.02x
💻 LocalExpress1.604s (-2.0%)2.009s (~)0.012s (+8.2% 🔺)2.023s (~)0.419s301.02x
🐘 PostgresExpress1.632s (-6.0% 🟢)2.003s (-6.5% 🟢)0.004s (+27.8% 🔺)2.028s (-6.1% 🟢)0.395s301.04x
🐘 PostgresNext.js (Turbopack)1.735s (-1.7%)2.010s (~)0.004s (-5.8% 🟢)2.025s (~)0.290s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.698s (-3.5%)1.034s (~)0.000s (-66.7% 🟢)1.041s (-0.6%)0.343s581.00x
🐘 PostgresExpress0.737s (-24.6% 🟢)1.049s (-26.5% 🟢)0.000s (-50.9% 🟢)1.060s (-26.8% 🟢)0.323s571.06x
🐘 PostgresNext.js (Turbopack)0.845s (+1.5%)1.092s (+1.9%)0.000s (-100.0% 🟢)1.123s (+4.1%)0.278s551.21x
💻 LocalNext.js (Turbopack)1.227s (-15.2% 🟢)1.979s (-1.6%)0.000s (-3.2%)1.981s (-1.6%)0.754s311.76x
💻 LocalNitro1.370s (+1.2%)2.014s (~)0.000s (-13.3% 🟢)2.016s (~)0.646s301.96x
💻 LocalExpress1.448s (-2.3%)2.014s (~)0.000s (-46.7% 🟢)2.016s (~)0.568s302.07x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.419s (-12.1% 🟢)2.098s (-6.9% 🟢)0.000s (NaN%)2.135s (-6.4% 🟢)0.716s291.00x
🐘 PostgresNitro1.523s (+8.0% 🔺)2.180s (+9.2% 🔺)0.000s (+Infinity% 🔺)2.189s (+8.8% 🔺)0.666s281.07x
🐘 PostgresNext.js (Turbopack)1.802s (+4.3%)2.309s (+2.1%)0.000s (NaN%)2.318s (+2.1%)0.516s261.27x
💻 LocalNext.js (Turbopack)2.374s (-26.1% 🟢)3.019s (-22.5% 🟢)0.000s (-20.0% 🟢)3.022s (-22.5% 🟢)0.648s201.67x
💻 LocalNitro3.014s (-3.2%)3.614s (-7.2% 🟢)0.001s (+252.9% 🔺)3.617s (-7.3% 🟢)0.603s172.12x
💻 LocalExpress3.223s (-3.3%)3.904s (+1.7%)0.002s (+383.3% 🔺)3.908s (+1.7%)0.686s162.27x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresNitro18/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production1256102191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total71731010528235

❌ Failed Tests

▲ Vercel Production (10 failed)

astro (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

example (1 failed):

  • AbortController abortThrowIfAbortedWorkflow: throwIfAborted causes FatalError, no retries

fastify (1 failed):

  • outputStreamWorkflow negative startIndex (reads from end)

hono (1 failed):

  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KTME1GEXT2GC7YHM27G8KEY3 | 🔍 observability

nextjs-turbopack (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

nitro (2 failed):

  • utf8StreamWorkflow | wrun_01KTMDNBBSH43FEV2N2A7S5KDQ | 🔍 observability
  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

nuxt (2 failed):

  • webhookWorkflow | wrun_01KTMDHSXM87EH9KP6159TWSAV | 🔍 observability
  • outputStreamWorkflow no startIndex (reads all chunks)

vite (1 failed):

  • AbortController abortParallelWorkflow: abort cancels all parallel steps

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro108126
❌ example108126
✅ express109026
❌ fastify108126
❌ hono108126
❌ nextjs-turbopack13212
✅ nextjs-webpack13302
❌ nitro107226
❌ nuxt107226
✅ sveltekit12807
❌ vite108126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygp
pranaygp marked this pull request as ready for review June 8, 2026 19:48
@pranaygp
pranaygp requested a review from a team as a code ownerJune 8, 2026 19:48
CopilotAI review requested due to automatic review settings June 8, 2026 19:48

CopilotAI 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.

Pull request overview

This PR fixes a race in @workflow/world-local where writeExclusive() could expose a partially written destination file to concurrent readers by switching to a “write temp file → hard-link publish” flow, and adds tests to validate publication visibility and first-writer-wins behavior.

Changes:

  • Update writeExclusive() to publish via a fully-written temp file and an atomic hard-link into the final path.
  • Add deterministic tests ensuring destinations aren’t visible mid-write and that only one concurrent writer wins.
  • Add a patch changeset and refresh related inline comments in the storage layer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
packages/world-local/src/storage/events-storage.tsUpdates commentary to reflect the publish semantics used by writeExclusive().
packages/world-local/src/fs.tsImplements atomic publish for exclusive writes using temp file + hard-link.
packages/world-local/src/fs.test.tsAdds deterministic coverage for publication visibility and concurrent writer winner selection.
.changeset/atomic-runs-publish.mdPatch changeset documenting the fix for partial visibility during exclusive writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpackages/world-local/src/fs.ts

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve — clean fix for a real partial-read race, with one defensive nit

The bug is real and the fix is the right shape:

  • Before: fs.writeFile(filePath, data, { flag: 'wx' }) writes directly to the destination. The exclusive create guarantees only one writer wins, but the destination path becomes visible during the write — a concurrent runs.get() can read partial JSON and fail with SyntaxError: Unexpected end of JSON input.
  • After: write to ${filePath}.tmp.${ulid()} first, then fs.link() to the destination. Link creation is atomic at the OS level and fails with EEXIST if another writer already published.

This matches the established pattern in the sibling write() function (which uses fs.rename() for the overwriting variant); the only difference here is link vs rename to preserve first-writer-wins semantics.

Test design is excellent

The first test simulates a slow write by mocking fs.writeFile to pause mid-write, then attempts to read the destination. With the OLD code, the read returns partial content '{"value":'; with the NEW code, the read returns ENOENT (destination doesn't exist until link succeeds). The post-PR file content is exactly the full payload. Verified regression: I temporarily reverted just the fs.ts change and reran the test — got expected ENOENT, received '{"value":' exactly as the test asserts.

The second test (16 concurrent writers) confirms:

  1. Exactly one returns true (the winner)
  2. The final file content matches one specific writer's value
  3. The directory has only exclusive.json (no orphaned temp files)

That last assertion is the cleanup check, which catches the finally block actually running.

What I verified locally

  • pnpm turbo run build --filter @workflow/world-local
  • pnpm --filter @workflow/world-local test ✓ (368 tests pass)
  • Reverted the fix and confirmed the new partial-visibility test fails as expected → restored the fix, all green

CI

5 failures, all pre-existing on main's baseline:

  • Vercel Prod E2E (nextjs-turbopack, hono, fastify) — same flakes seen on main's recent runs
  • Local Postgres canary (nextjs-turbopack) — Next.js canary tracks; the latest main canary baseline shows similar instability
  • E2E Required Check — cascading

Nothing PR-specific.

One defensive nit (non-blocker, inline)

Copilot caught a small defensive-coding miss: the finally block unconditionally unlinks tempPath, but if the fs.writeFile(tempPath, ..., { flag: 'wx' }) itself fails with EEXIST (vanishingly rare ULID collision or a stale temp from a crashed process), the unlink would delete someone else's temp file. The existing write() function already handles this with a tempFileCreated flag — same pattern would close the gap here. Inline comment with the snippet.

Practical risk is essentially zero (2^-40 collision probability), but matching the surrounding pattern is essentially free.

Bottom line

Solid fix for a real race that surfaces as SyntaxError: Unexpected end of JSON input in production. The hard-link-after-write pattern is the canonical atomic-publish primitive for "first writer wins" semantics on POSIX filesystems.

Approving.

Comment threadpackages/world-local/src/fs.ts Outdated
@pranaygp
pranaygp merged commit 867e339 into mainJun 8, 2026
34 of 58 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Jun 8, 2026
github-actionsBot added a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2299. Merge conflicts were resolved by AI — please review carefully. (backport job run)

pranaygp pushed a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pranaygp added a commit that referenced this pull request Jun 11, 2026
…-attributes-client
* origin/main: (32 commits)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
[world-vercel] Validate ref resolve responses before use (#2035)
fix: bump devalue to 5.8.1 (#2292)
Handle lazy stream key request failures (#2257)
fix(docs): declare Nitro auto-import globals for code samples (#2290)
[core] Preserve event-log order in hook-vs-sleep replay races (#2171) (#2185)
docs: add nitro changelog (#2232)
fix(next): always apply turbopack content condition regardless of builder mode (#2253)
Update @vercel/queue from 0.2.1 to 0.3.0 (#2255)
[nest] Use AST-based CommonJS import rewriting (#2080)
...
# Conflicts:
#	packages/world-local/src/storage/events-storage.ts
pranaygp added a commit that referenced this pull request Jun 11, 2026
…hook-ready
* origin-https/main: (119 commits)
fix: settle aborted parallel steps before completing abortParallelWorkflow (#2244)
Add native v4 workflow attribute events (#2226)
Version Packages (beta) (#2326)
[ci] Fix flaky windows unit tests (#2359)
Capture Vercel runtime logs when e2e Vercel Prod lanes fail (#2356)
Fix e2e failure reporting under vitest 4 and preserve fetch error causes (#2355)
[core] Fix process crash from rejected waitUntil promises (#2336)
[core] Remove duplicate `waitUntil` for suspension handler async operations (#2345)
Prevent local tests from hanging (#2338)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
...
# Conflicts:
#	packages/core/src/runtime.ts
#	packages/core/src/runtime/suspension-handler.ts
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.

3 participants

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

[codex] Fix partial world-local exclusive writes - #2296

Merged
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write
Jun 8, 2026
Merged

[codex] Fix partial world-local exclusive writes#2296
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Summary

  • write exclusive local files to a unique temporary path before publishing them
  • use an atomic hard link to preserve first-writer-wins behavior without exposing partial contents
  • add deterministic coverage for publication visibility and concurrent writers
  • add a patch changeset for @workflow/world-local

Root cause

writeExclusive() previously called fs.writeFile() directly on the final path with the wx flag. The exclusive create prevented another writer from winning, but the final path became visible before the JSON body was fully written. A concurrent runs.get() could therefore read an empty or truncated run file and fail with SyntaxError: Unexpected end of JSON input.

The new implementation writes and closes a temporary file first, then hard-links it into the final path. Link creation is atomic and returns EEXIST when another writer has already published the destination.

Verification

  • pnpm --filter @workflow/world-local test (368 tests)
  • pnpm --filter @workflow/world-local typecheck
  • pnpm turbo run build --filter=@workflow/world-local...
  • targeted Biome check (existing complexity warnings only)

@changeset-bot

changeset-botBot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89971e0

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

This PR includes changesets to release 18 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/vitestPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/webPatch
@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

@vercel

vercelBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 8, 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.044s (+2.1%)1.006s (~)0.962s101.00x
💻 LocalNext.js (Turbopack)0.046s (-16.0% 🟢)1.004s (~)0.958s101.06x
💻 LocalExpress0.047s (+9.7% 🔺)1.006s (~)0.959s101.08x
🐘 PostgresNitro0.058s (-8.9% 🟢)1.011s (~)0.953s101.32x
🐘 PostgresExpress0.065s (-1.5%)1.013s (~)0.948s101.49x
🐘 PostgresNext.js (Turbopack)0.068s (-3.1%)1.011s (~)0.944s101.55x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.095s (~)2.006s (~)0.910s101.00x
💻 LocalExpress1.099s (~)2.007s (~)0.908s101.00x
🐘 PostgresNitro1.105s (-0.8%)2.009s (~)0.904s101.01x
💻 LocalNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🐘 PostgresExpress1.114s (+2.1%)2.010s (~)0.896s101.02x
🐘 PostgresNext.js (Turbopack)1.143s (~)2.011s (~)0.867s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.541s (~)11.021s (~)0.480s31.00x
💻 LocalExpress10.552s (~)11.023s (~)0.471s31.00x
🐘 PostgresNitro10.573s (~)11.016s (~)0.443s31.00x
💻 LocalNext.js (Turbopack)10.618s (~)11.020s (~)0.402s31.01x
🐘 PostgresExpress10.627s (-0.8%)11.021s (-2.9%)0.394s31.01x
🐘 PostgresNext.js (Turbopack)11.021s (+1.9%)11.683s (+6.0% 🔺)0.661s31.05x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.848s (~)14.017s (-1.5%)0.169s51.00x
💻 LocalNitro13.854s (+1.0%)14.225s (+1.4%)0.371s51.00x
🐘 PostgresNitro13.888s (~)14.017s (~)0.129s51.00x
💻 LocalExpress13.891s (~)14.228s (~)0.337s51.00x
💻 LocalNext.js (Turbopack)13.947s (-0.6%)14.024s (-4.1%)0.077s51.01x
🐘 PostgresNext.js (Turbopack)14.443s (-1.0%)15.017s (~)0.574s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.482s (+0.6%)13.025s (~)0.543s71.00x
🐘 PostgresNitro12.547s (-1.5%)13.017s (~)0.470s71.01x
💻 LocalExpress12.612s (~)13.025s (~)0.414s71.01x
🐘 PostgresExpress12.615s (-0.9%)13.021s (-2.2%)0.406s71.01x
💻 LocalNext.js (Turbopack)12.796s (-1.2%)13.023s (-2.1%)0.226s71.03x
🐘 PostgresNext.js (Turbopack)13.827s (~)14.018s (~)0.191s71.11x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.189s (-0.8%)2.007s (~)0.818s151.00x
🐘 PostgresExpress1.190s (-0.8%)2.007s (-0.7%)0.818s151.00x
💻 LocalExpress1.211s (-4.1%)2.007s (~)0.795s151.02x
💻 LocalNitro1.236s (+1.9%)2.006s (~)0.770s151.04x
🐘 PostgresNext.js (Turbopack)1.259s (+0.6%)2.008s (~)0.749s151.06x
💻 LocalNext.js (Turbopack)1.308s (+7.0% 🔺)2.005s (~)0.697s151.10x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.241s (-1.4%)2.007s (~)0.766s151.00x
🐘 PostgresExpress1.250s (-5.7% 🟢)2.008s (~)0.757s151.01x
🐘 PostgresNext.js (Turbopack)1.394s (-1.1%)2.006s (~)0.613s151.12x
💻 LocalNitro1.817s (+6.6% 🔺)2.073s (~)0.256s151.46x
💻 LocalNext.js (Turbopack)1.881s (+9.0% 🔺)2.314s (+15.4% 🔺)0.434s131.52x
💻 LocalExpress1.928s (+2.4%)2.222s (~)0.294s141.55x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-5.7% 🟢)2.006s (~)0.680s151.00x
🐘 PostgresExpress1.395s (~)2.007s (~)0.612s151.05x
🐘 PostgresNext.js (Turbopack)1.760s (~)2.392s (+4.3%)0.633s131.33x
💻 LocalNext.js (Turbopack)3.768s (-14.3% 🟢)4.133s (-17.5% 🟢)0.365s82.84x
💻 LocalExpress5.430s (+2.5%)6.015s (~)0.585s64.09x
💻 LocalNitro5.698s (+20.8% 🔺)6.213s (+24.0% 🔺)0.515s54.29x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.183s (-1.4%)2.008s (~)0.825s151.00x
🐘 PostgresExpress1.212s (+0.8%)2.008s (~)0.795s151.03x
🐘 PostgresNext.js (Turbopack)1.248s (-1.4%)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.257s (-3.7%)2.005s (~)0.748s151.06x
💻 LocalNitro1.551s (~)2.006s (~)0.455s151.31x
💻 LocalExpress1.576s (-4.9%)2.007s (-3.2%)0.431s151.33x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.226s (-3.8%)2.007s (~)0.780s151.00x
🐘 PostgresExpress1.265s (+1.8%)2.008s (~)0.743s151.03x
🐘 PostgresNext.js (Turbopack)1.397s (~)2.008s (~)0.611s151.14x
💻 LocalNext.js (Turbopack)2.041s (+1.0%)2.469s (-1.5%)0.428s131.66x
💻 LocalNitro2.170s (+23.5% 🔺)2.592s (+25.1% 🔺)0.421s121.77x
💻 LocalExpress2.220s (+4.5%)2.736s (+5.6% 🔺)0.516s111.81x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.333s (-8.8% 🟢)2.007s (~)0.674s151.00x
🐘 PostgresExpress1.394s (-7.1% 🟢)2.008s (-16.2% 🟢)0.614s151.05x
🐘 PostgresNext.js (Turbopack)1.608s (-2.9%)2.007s (-3.2%)0.399s151.21x
💻 LocalNext.js (Turbopack)4.589s (-11.1% 🟢)5.012s (-16.7% 🟢)0.423s73.44x
💻 LocalNitro5.816s (+22.6% 🔺)6.219s (+16.4% 🔺)0.403s54.36x
💻 LocalExpress6.294s (+7.4% 🔺)6.816s (+9.7% 🔺)0.521s54.72x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.575s (-13.8% 🟢)1.007s (-3.9%)0.432s601.00x
🐘 PostgresNitro0.590s (-3.1%)1.023s (+1.6%)0.433s591.03x
💻 LocalNitro0.614s (-23.6% 🟢)1.021s (-15.2% 🟢)0.407s591.07x
💻 LocalExpress0.638s (-2.8%)1.005s (-3.3%)0.368s601.11x
💻 LocalNext.js (Turbopack)0.690s (-0.9%)1.021s (+1.6%)0.330s601.20x
🐘 PostgresNext.js (Turbopack)0.800s (-1.4%)1.006s (~)0.206s601.39x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.400s (-1.2%)2.053s (+2.3%)0.654s441.00x
🐘 PostgresExpress1.431s (-6.8% 🟢)2.008s (-6.7% 🟢)0.577s451.02x
💻 LocalNitro1.490s (+1.8%)2.006s (~)0.516s451.06x
💻 LocalExpress1.598s (~)2.007s (-1.1%)0.409s451.14x
💻 LocalNext.js (Turbopack)1.860s (+7.6% 🔺)2.172s (+7.1% 🔺)0.312s421.33x
🐘 PostgresNext.js (Turbopack)1.935s (~)2.150s (-1.1%)0.215s421.38x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.794s (-4.1%)3.166s (-3.5%)0.372s381.00x
🐘 PostgresExpress2.892s (-0.7%)3.221s (-9.0% 🟢)0.329s381.03x
💻 LocalNitro3.235s (+0.9%)4.009s (~)0.774s301.16x
💻 LocalExpress3.425s (~)4.043s (+0.8%)0.618s301.23x
💻 LocalNext.js (Turbopack)3.698s (-0.8%)4.148s (+1.0%)0.450s291.32x
🐘 PostgresNext.js (Turbopack)3.778s (-2.1%)4.009s (-1.7%)0.232s301.35x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.206s (-12.4% 🟢)1.006s (~)0.800s601.00x
🐘 PostgresExpress0.232s (-8.0% 🟢)1.007s (~)0.775s601.12x
🐘 PostgresNext.js (Turbopack)0.256s (-9.4% 🟢)1.006s (~)0.750s601.24x
💻 LocalNitro0.391s (-7.9% 🟢)1.004s (~)0.613s601.90x
💻 LocalExpress0.446s (-4.0%)1.005s (~)0.559s602.16x
💻 LocalNext.js (Turbopack)0.473s (-22.6% 🟢)1.005s (-3.3%)0.532s602.29x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.327s (-11.8% 🟢)1.007s (~)0.680s901.00x
🐘 PostgresExpress0.362s (+6.8% 🔺)1.007s (~)0.644s901.11x
🐘 PostgresNext.js (Turbopack)0.460s (-4.8%)1.006s (~)0.546s901.41x
💻 LocalNext.js (Turbopack)1.974s (-19.4% 🟢)2.584s (-16.9% 🟢)0.611s356.04x
💻 LocalNitro2.153s (+4.3%)2.736s (+3.7%)0.583s336.58x
💻 LocalExpress2.177s (-0.6%)2.913s (+3.2%)0.736s316.66x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.608s (-14.1% 🟢)1.005s (~)0.398s1201.00x
🐘 PostgresExpress0.707s (+13.0% 🔺)1.015s (-3.8%)0.308s1191.16x
🐘 PostgresNext.js (Turbopack)0.933s (-4.7%)1.366s (-15.0% 🟢)0.433s891.54x
💻 LocalNext.js (Turbopack)8.496s (-17.6% 🟢)9.329s (-17.4% 🟢)0.833s1313.98x
💻 LocalNitro9.623s (+10.5% 🔺)10.192s (+9.2% 🔺)0.569s1215.83x
💻 LocalExpress10.339s (~)10.863s (~)0.524s1217.01x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.160s (-1.8%)2.003s (~)0.001s (-7.1% 🟢)2.011s (~)0.852s101.00x
💻 LocalNitro1.169s (+1.6%)2.005s (~)0.011s (+14.0% 🔺)2.018s (~)0.849s101.01x
💻 LocalNext.js (Turbopack)1.170s (~)2.003s (~)0.009s (-15.8% 🟢)2.014s (~)0.845s101.01x
🐘 PostgresExpress1.172s (-1.8%)2.001s (~)0.001s (-96.5% 🟢)2.012s (-1.5%)0.840s101.01x
💻 LocalExpress1.178s (+0.8%)2.006s (~)0.014s (+9.4% 🔺)2.022s (~)0.844s101.02x
🐘 PostgresNext.js (Turbopack)1.227s (-0.6%)2.001s (~)0.001s (-20.0% 🟢)2.010s (~)0.783s101.06x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.567s (-5.8% 🟢)2.009s (~)0.004s (-8.5% 🟢)2.024s (~)0.457s301.00x
💻 LocalNext.js (Turbopack)1.580s (-3.7%)2.008s (~)0.008s (-17.5% 🟢)2.019s (~)0.438s301.01x
💻 LocalNitro1.594s (-8.5% 🟢)2.010s (~)0.010s (+8.7% 🔺)2.021s (-8.1% 🟢)0.427s301.02x
💻 LocalExpress1.604s (-2.0%)2.009s (~)0.012s (+8.2% 🔺)2.023s (~)0.419s301.02x
🐘 PostgresExpress1.632s (-6.0% 🟢)2.003s (-6.5% 🟢)0.004s (+27.8% 🔺)2.028s (-6.1% 🟢)0.395s301.04x
🐘 PostgresNext.js (Turbopack)1.735s (-1.7%)2.010s (~)0.004s (-5.8% 🟢)2.025s (~)0.290s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.698s (-3.5%)1.034s (~)0.000s (-66.7% 🟢)1.041s (-0.6%)0.343s581.00x
🐘 PostgresExpress0.737s (-24.6% 🟢)1.049s (-26.5% 🟢)0.000s (-50.9% 🟢)1.060s (-26.8% 🟢)0.323s571.06x
🐘 PostgresNext.js (Turbopack)0.845s (+1.5%)1.092s (+1.9%)0.000s (-100.0% 🟢)1.123s (+4.1%)0.278s551.21x
💻 LocalNext.js (Turbopack)1.227s (-15.2% 🟢)1.979s (-1.6%)0.000s (-3.2%)1.981s (-1.6%)0.754s311.76x
💻 LocalNitro1.370s (+1.2%)2.014s (~)0.000s (-13.3% 🟢)2.016s (~)0.646s301.96x
💻 LocalExpress1.448s (-2.3%)2.014s (~)0.000s (-46.7% 🟢)2.016s (~)0.568s302.07x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.419s (-12.1% 🟢)2.098s (-6.9% 🟢)0.000s (NaN%)2.135s (-6.4% 🟢)0.716s291.00x
🐘 PostgresNitro1.523s (+8.0% 🔺)2.180s (+9.2% 🔺)0.000s (+Infinity% 🔺)2.189s (+8.8% 🔺)0.666s281.07x
🐘 PostgresNext.js (Turbopack)1.802s (+4.3%)2.309s (+2.1%)0.000s (NaN%)2.318s (+2.1%)0.516s261.27x
💻 LocalNext.js (Turbopack)2.374s (-26.1% 🟢)3.019s (-22.5% 🟢)0.000s (-20.0% 🟢)3.022s (-22.5% 🟢)0.648s201.67x
💻 LocalNitro3.014s (-3.2%)3.614s (-7.2% 🟢)0.001s (+252.9% 🔺)3.617s (-7.3% 🟢)0.603s172.12x
💻 LocalExpress3.223s (-3.3%)3.904s (+1.7%)0.002s (+383.3% 🔺)3.908s (+1.7%)0.686s162.27x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresNitro18/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production1256102191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total71731010528235

❌ Failed Tests

▲ Vercel Production (10 failed)

astro (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

example (1 failed):

  • AbortController abortThrowIfAbortedWorkflow: throwIfAborted causes FatalError, no retries

fastify (1 failed):

  • outputStreamWorkflow negative startIndex (reads from end)

hono (1 failed):

  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KTME1GEXT2GC7YHM27G8KEY3 | 🔍 observability

nextjs-turbopack (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

nitro (2 failed):

  • utf8StreamWorkflow | wrun_01KTMDNBBSH43FEV2N2A7S5KDQ | 🔍 observability
  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

nuxt (2 failed):

  • webhookWorkflow | wrun_01KTMDHSXM87EH9KP6159TWSAV | 🔍 observability
  • outputStreamWorkflow no startIndex (reads all chunks)

vite (1 failed):

  • AbortController abortParallelWorkflow: abort cancels all parallel steps

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro108126
❌ example108126
✅ express109026
❌ fastify108126
❌ hono108126
❌ nextjs-turbopack13212
✅ nextjs-webpack13302
❌ nitro107226
❌ nuxt107226
✅ sveltekit12807
❌ vite108126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygp
pranaygp marked this pull request as ready for review June 8, 2026 19:48
@pranaygp
pranaygp requested a review from a team as a code ownerJune 8, 2026 19:48
CopilotAI review requested due to automatic review settings June 8, 2026 19:48

CopilotAI 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.

Pull request overview

This PR fixes a race in @workflow/world-local where writeExclusive() could expose a partially written destination file to concurrent readers by switching to a “write temp file → hard-link publish” flow, and adds tests to validate publication visibility and first-writer-wins behavior.

Changes:

  • Update writeExclusive() to publish via a fully-written temp file and an atomic hard-link into the final path.
  • Add deterministic tests ensuring destinations aren’t visible mid-write and that only one concurrent writer wins.
  • Add a patch changeset and refresh related inline comments in the storage layer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
packages/world-local/src/storage/events-storage.tsUpdates commentary to reflect the publish semantics used by writeExclusive().
packages/world-local/src/fs.tsImplements atomic publish for exclusive writes using temp file + hard-link.
packages/world-local/src/fs.test.tsAdds deterministic coverage for publication visibility and concurrent writer winner selection.
.changeset/atomic-runs-publish.mdPatch changeset documenting the fix for partial visibility during exclusive writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpackages/world-local/src/fs.ts

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve — clean fix for a real partial-read race, with one defensive nit

The bug is real and the fix is the right shape:

  • Before: fs.writeFile(filePath, data, { flag: 'wx' }) writes directly to the destination. The exclusive create guarantees only one writer wins, but the destination path becomes visible during the write — a concurrent runs.get() can read partial JSON and fail with SyntaxError: Unexpected end of JSON input.
  • After: write to ${filePath}.tmp.${ulid()} first, then fs.link() to the destination. Link creation is atomic at the OS level and fails with EEXIST if another writer already published.

This matches the established pattern in the sibling write() function (which uses fs.rename() for the overwriting variant); the only difference here is link vs rename to preserve first-writer-wins semantics.

Test design is excellent

The first test simulates a slow write by mocking fs.writeFile to pause mid-write, then attempts to read the destination. With the OLD code, the read returns partial content '{"value":'; with the NEW code, the read returns ENOENT (destination doesn't exist until link succeeds). The post-PR file content is exactly the full payload. Verified regression: I temporarily reverted just the fs.ts change and reran the test — got expected ENOENT, received '{"value":' exactly as the test asserts.

The second test (16 concurrent writers) confirms:

  1. Exactly one returns true (the winner)
  2. The final file content matches one specific writer's value
  3. The directory has only exclusive.json (no orphaned temp files)

That last assertion is the cleanup check, which catches the finally block actually running.

What I verified locally

  • pnpm turbo run build --filter @workflow/world-local
  • pnpm --filter @workflow/world-local test ✓ (368 tests pass)
  • Reverted the fix and confirmed the new partial-visibility test fails as expected → restored the fix, all green

CI

5 failures, all pre-existing on main's baseline:

  • Vercel Prod E2E (nextjs-turbopack, hono, fastify) — same flakes seen on main's recent runs
  • Local Postgres canary (nextjs-turbopack) — Next.js canary tracks; the latest main canary baseline shows similar instability
  • E2E Required Check — cascading

Nothing PR-specific.

One defensive nit (non-blocker, inline)

Copilot caught a small defensive-coding miss: the finally block unconditionally unlinks tempPath, but if the fs.writeFile(tempPath, ..., { flag: 'wx' }) itself fails with EEXIST (vanishingly rare ULID collision or a stale temp from a crashed process), the unlink would delete someone else's temp file. The existing write() function already handles this with a tempFileCreated flag — same pattern would close the gap here. Inline comment with the snippet.

Practical risk is essentially zero (2^-40 collision probability), but matching the surrounding pattern is essentially free.

Bottom line

Solid fix for a real race that surfaces as SyntaxError: Unexpected end of JSON input in production. The hard-link-after-write pattern is the canonical atomic-publish primitive for "first writer wins" semantics on POSIX filesystems.

Approving.

Comment threadpackages/world-local/src/fs.ts Outdated
@pranaygp
pranaygp merged commit 867e339 into mainJun 8, 2026
34 of 58 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Jun 8, 2026
github-actionsBot added a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2299. Merge conflicts were resolved by AI — please review carefully. (backport job run)

pranaygp pushed a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pranaygp added a commit that referenced this pull request Jun 11, 2026
…-attributes-client
* origin/main: (32 commits)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
[world-vercel] Validate ref resolve responses before use (#2035)
fix: bump devalue to 5.8.1 (#2292)
Handle lazy stream key request failures (#2257)
fix(docs): declare Nitro auto-import globals for code samples (#2290)
[core] Preserve event-log order in hook-vs-sleep replay races (#2171) (#2185)
docs: add nitro changelog (#2232)
fix(next): always apply turbopack content condition regardless of builder mode (#2253)
Update @vercel/queue from 0.2.1 to 0.3.0 (#2255)
[nest] Use AST-based CommonJS import rewriting (#2080)
...
# Conflicts:
#	packages/world-local/src/storage/events-storage.ts
pranaygp added a commit that referenced this pull request Jun 11, 2026
…hook-ready
* origin-https/main: (119 commits)
fix: settle aborted parallel steps before completing abortParallelWorkflow (#2244)
Add native v4 workflow attribute events (#2226)
Version Packages (beta) (#2326)
[ci] Fix flaky windows unit tests (#2359)
Capture Vercel runtime logs when e2e Vercel Prod lanes fail (#2356)
Fix e2e failure reporting under vitest 4 and preserve fetch error causes (#2355)
[core] Fix process crash from rejected waitUntil promises (#2336)
[core] Remove duplicate `waitUntil` for suspension handler async operations (#2345)
Prevent local tests from hanging (#2338)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
...
# Conflicts:
#	packages/core/src/runtime.ts
#	packages/core/src/runtime/suspension-handler.ts
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.

3 participants

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

[codex] Fix partial world-local exclusive writes - #2296

Merged
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write
Jun 8, 2026
Merged

[codex] Fix partial world-local exclusive writes#2296
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Summary

  • write exclusive local files to a unique temporary path before publishing them
  • use an atomic hard link to preserve first-writer-wins behavior without exposing partial contents
  • add deterministic coverage for publication visibility and concurrent writers
  • add a patch changeset for @workflow/world-local

Root cause

writeExclusive() previously called fs.writeFile() directly on the final path with the wx flag. The exclusive create prevented another writer from winning, but the final path became visible before the JSON body was fully written. A concurrent runs.get() could therefore read an empty or truncated run file and fail with SyntaxError: Unexpected end of JSON input.

The new implementation writes and closes a temporary file first, then hard-links it into the final path. Link creation is atomic and returns EEXIST when another writer has already published the destination.

Verification

  • pnpm --filter @workflow/world-local test (368 tests)
  • pnpm --filter @workflow/world-local typecheck
  • pnpm turbo run build --filter=@workflow/world-local...
  • targeted Biome check (existing complexity warnings only)

@changeset-bot

changeset-botBot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89971e0

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

This PR includes changesets to release 18 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/vitestPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/webPatch
@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

@vercel

vercelBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 8, 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.044s (+2.1%)1.006s (~)0.962s101.00x
💻 LocalNext.js (Turbopack)0.046s (-16.0% 🟢)1.004s (~)0.958s101.06x
💻 LocalExpress0.047s (+9.7% 🔺)1.006s (~)0.959s101.08x
🐘 PostgresNitro0.058s (-8.9% 🟢)1.011s (~)0.953s101.32x
🐘 PostgresExpress0.065s (-1.5%)1.013s (~)0.948s101.49x
🐘 PostgresNext.js (Turbopack)0.068s (-3.1%)1.011s (~)0.944s101.55x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.095s (~)2.006s (~)0.910s101.00x
💻 LocalExpress1.099s (~)2.007s (~)0.908s101.00x
🐘 PostgresNitro1.105s (-0.8%)2.009s (~)0.904s101.01x
💻 LocalNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🐘 PostgresExpress1.114s (+2.1%)2.010s (~)0.896s101.02x
🐘 PostgresNext.js (Turbopack)1.143s (~)2.011s (~)0.867s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.541s (~)11.021s (~)0.480s31.00x
💻 LocalExpress10.552s (~)11.023s (~)0.471s31.00x
🐘 PostgresNitro10.573s (~)11.016s (~)0.443s31.00x
💻 LocalNext.js (Turbopack)10.618s (~)11.020s (~)0.402s31.01x
🐘 PostgresExpress10.627s (-0.8%)11.021s (-2.9%)0.394s31.01x
🐘 PostgresNext.js (Turbopack)11.021s (+1.9%)11.683s (+6.0% 🔺)0.661s31.05x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.848s (~)14.017s (-1.5%)0.169s51.00x
💻 LocalNitro13.854s (+1.0%)14.225s (+1.4%)0.371s51.00x
🐘 PostgresNitro13.888s (~)14.017s (~)0.129s51.00x
💻 LocalExpress13.891s (~)14.228s (~)0.337s51.00x
💻 LocalNext.js (Turbopack)13.947s (-0.6%)14.024s (-4.1%)0.077s51.01x
🐘 PostgresNext.js (Turbopack)14.443s (-1.0%)15.017s (~)0.574s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.482s (+0.6%)13.025s (~)0.543s71.00x
🐘 PostgresNitro12.547s (-1.5%)13.017s (~)0.470s71.01x
💻 LocalExpress12.612s (~)13.025s (~)0.414s71.01x
🐘 PostgresExpress12.615s (-0.9%)13.021s (-2.2%)0.406s71.01x
💻 LocalNext.js (Turbopack)12.796s (-1.2%)13.023s (-2.1%)0.226s71.03x
🐘 PostgresNext.js (Turbopack)13.827s (~)14.018s (~)0.191s71.11x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.189s (-0.8%)2.007s (~)0.818s151.00x
🐘 PostgresExpress1.190s (-0.8%)2.007s (-0.7%)0.818s151.00x
💻 LocalExpress1.211s (-4.1%)2.007s (~)0.795s151.02x
💻 LocalNitro1.236s (+1.9%)2.006s (~)0.770s151.04x
🐘 PostgresNext.js (Turbopack)1.259s (+0.6%)2.008s (~)0.749s151.06x
💻 LocalNext.js (Turbopack)1.308s (+7.0% 🔺)2.005s (~)0.697s151.10x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.241s (-1.4%)2.007s (~)0.766s151.00x
🐘 PostgresExpress1.250s (-5.7% 🟢)2.008s (~)0.757s151.01x
🐘 PostgresNext.js (Turbopack)1.394s (-1.1%)2.006s (~)0.613s151.12x
💻 LocalNitro1.817s (+6.6% 🔺)2.073s (~)0.256s151.46x
💻 LocalNext.js (Turbopack)1.881s (+9.0% 🔺)2.314s (+15.4% 🔺)0.434s131.52x
💻 LocalExpress1.928s (+2.4%)2.222s (~)0.294s141.55x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-5.7% 🟢)2.006s (~)0.680s151.00x
🐘 PostgresExpress1.395s (~)2.007s (~)0.612s151.05x
🐘 PostgresNext.js (Turbopack)1.760s (~)2.392s (+4.3%)0.633s131.33x
💻 LocalNext.js (Turbopack)3.768s (-14.3% 🟢)4.133s (-17.5% 🟢)0.365s82.84x
💻 LocalExpress5.430s (+2.5%)6.015s (~)0.585s64.09x
💻 LocalNitro5.698s (+20.8% 🔺)6.213s (+24.0% 🔺)0.515s54.29x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.183s (-1.4%)2.008s (~)0.825s151.00x
🐘 PostgresExpress1.212s (+0.8%)2.008s (~)0.795s151.03x
🐘 PostgresNext.js (Turbopack)1.248s (-1.4%)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.257s (-3.7%)2.005s (~)0.748s151.06x
💻 LocalNitro1.551s (~)2.006s (~)0.455s151.31x
💻 LocalExpress1.576s (-4.9%)2.007s (-3.2%)0.431s151.33x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.226s (-3.8%)2.007s (~)0.780s151.00x
🐘 PostgresExpress1.265s (+1.8%)2.008s (~)0.743s151.03x
🐘 PostgresNext.js (Turbopack)1.397s (~)2.008s (~)0.611s151.14x
💻 LocalNext.js (Turbopack)2.041s (+1.0%)2.469s (-1.5%)0.428s131.66x
💻 LocalNitro2.170s (+23.5% 🔺)2.592s (+25.1% 🔺)0.421s121.77x
💻 LocalExpress2.220s (+4.5%)2.736s (+5.6% 🔺)0.516s111.81x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.333s (-8.8% 🟢)2.007s (~)0.674s151.00x
🐘 PostgresExpress1.394s (-7.1% 🟢)2.008s (-16.2% 🟢)0.614s151.05x
🐘 PostgresNext.js (Turbopack)1.608s (-2.9%)2.007s (-3.2%)0.399s151.21x
💻 LocalNext.js (Turbopack)4.589s (-11.1% 🟢)5.012s (-16.7% 🟢)0.423s73.44x
💻 LocalNitro5.816s (+22.6% 🔺)6.219s (+16.4% 🔺)0.403s54.36x
💻 LocalExpress6.294s (+7.4% 🔺)6.816s (+9.7% 🔺)0.521s54.72x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.575s (-13.8% 🟢)1.007s (-3.9%)0.432s601.00x
🐘 PostgresNitro0.590s (-3.1%)1.023s (+1.6%)0.433s591.03x
💻 LocalNitro0.614s (-23.6% 🟢)1.021s (-15.2% 🟢)0.407s591.07x
💻 LocalExpress0.638s (-2.8%)1.005s (-3.3%)0.368s601.11x
💻 LocalNext.js (Turbopack)0.690s (-0.9%)1.021s (+1.6%)0.330s601.20x
🐘 PostgresNext.js (Turbopack)0.800s (-1.4%)1.006s (~)0.206s601.39x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.400s (-1.2%)2.053s (+2.3%)0.654s441.00x
🐘 PostgresExpress1.431s (-6.8% 🟢)2.008s (-6.7% 🟢)0.577s451.02x
💻 LocalNitro1.490s (+1.8%)2.006s (~)0.516s451.06x
💻 LocalExpress1.598s (~)2.007s (-1.1%)0.409s451.14x
💻 LocalNext.js (Turbopack)1.860s (+7.6% 🔺)2.172s (+7.1% 🔺)0.312s421.33x
🐘 PostgresNext.js (Turbopack)1.935s (~)2.150s (-1.1%)0.215s421.38x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.794s (-4.1%)3.166s (-3.5%)0.372s381.00x
🐘 PostgresExpress2.892s (-0.7%)3.221s (-9.0% 🟢)0.329s381.03x
💻 LocalNitro3.235s (+0.9%)4.009s (~)0.774s301.16x
💻 LocalExpress3.425s (~)4.043s (+0.8%)0.618s301.23x
💻 LocalNext.js (Turbopack)3.698s (-0.8%)4.148s (+1.0%)0.450s291.32x
🐘 PostgresNext.js (Turbopack)3.778s (-2.1%)4.009s (-1.7%)0.232s301.35x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.206s (-12.4% 🟢)1.006s (~)0.800s601.00x
🐘 PostgresExpress0.232s (-8.0% 🟢)1.007s (~)0.775s601.12x
🐘 PostgresNext.js (Turbopack)0.256s (-9.4% 🟢)1.006s (~)0.750s601.24x
💻 LocalNitro0.391s (-7.9% 🟢)1.004s (~)0.613s601.90x
💻 LocalExpress0.446s (-4.0%)1.005s (~)0.559s602.16x
💻 LocalNext.js (Turbopack)0.473s (-22.6% 🟢)1.005s (-3.3%)0.532s602.29x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.327s (-11.8% 🟢)1.007s (~)0.680s901.00x
🐘 PostgresExpress0.362s (+6.8% 🔺)1.007s (~)0.644s901.11x
🐘 PostgresNext.js (Turbopack)0.460s (-4.8%)1.006s (~)0.546s901.41x
💻 LocalNext.js (Turbopack)1.974s (-19.4% 🟢)2.584s (-16.9% 🟢)0.611s356.04x
💻 LocalNitro2.153s (+4.3%)2.736s (+3.7%)0.583s336.58x
💻 LocalExpress2.177s (-0.6%)2.913s (+3.2%)0.736s316.66x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.608s (-14.1% 🟢)1.005s (~)0.398s1201.00x
🐘 PostgresExpress0.707s (+13.0% 🔺)1.015s (-3.8%)0.308s1191.16x
🐘 PostgresNext.js (Turbopack)0.933s (-4.7%)1.366s (-15.0% 🟢)0.433s891.54x
💻 LocalNext.js (Turbopack)8.496s (-17.6% 🟢)9.329s (-17.4% 🟢)0.833s1313.98x
💻 LocalNitro9.623s (+10.5% 🔺)10.192s (+9.2% 🔺)0.569s1215.83x
💻 LocalExpress10.339s (~)10.863s (~)0.524s1217.01x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.160s (-1.8%)2.003s (~)0.001s (-7.1% 🟢)2.011s (~)0.852s101.00x
💻 LocalNitro1.169s (+1.6%)2.005s (~)0.011s (+14.0% 🔺)2.018s (~)0.849s101.01x
💻 LocalNext.js (Turbopack)1.170s (~)2.003s (~)0.009s (-15.8% 🟢)2.014s (~)0.845s101.01x
🐘 PostgresExpress1.172s (-1.8%)2.001s (~)0.001s (-96.5% 🟢)2.012s (-1.5%)0.840s101.01x
💻 LocalExpress1.178s (+0.8%)2.006s (~)0.014s (+9.4% 🔺)2.022s (~)0.844s101.02x
🐘 PostgresNext.js (Turbopack)1.227s (-0.6%)2.001s (~)0.001s (-20.0% 🟢)2.010s (~)0.783s101.06x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.567s (-5.8% 🟢)2.009s (~)0.004s (-8.5% 🟢)2.024s (~)0.457s301.00x
💻 LocalNext.js (Turbopack)1.580s (-3.7%)2.008s (~)0.008s (-17.5% 🟢)2.019s (~)0.438s301.01x
💻 LocalNitro1.594s (-8.5% 🟢)2.010s (~)0.010s (+8.7% 🔺)2.021s (-8.1% 🟢)0.427s301.02x
💻 LocalExpress1.604s (-2.0%)2.009s (~)0.012s (+8.2% 🔺)2.023s (~)0.419s301.02x
🐘 PostgresExpress1.632s (-6.0% 🟢)2.003s (-6.5% 🟢)0.004s (+27.8% 🔺)2.028s (-6.1% 🟢)0.395s301.04x
🐘 PostgresNext.js (Turbopack)1.735s (-1.7%)2.010s (~)0.004s (-5.8% 🟢)2.025s (~)0.290s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.698s (-3.5%)1.034s (~)0.000s (-66.7% 🟢)1.041s (-0.6%)0.343s581.00x
🐘 PostgresExpress0.737s (-24.6% 🟢)1.049s (-26.5% 🟢)0.000s (-50.9% 🟢)1.060s (-26.8% 🟢)0.323s571.06x
🐘 PostgresNext.js (Turbopack)0.845s (+1.5%)1.092s (+1.9%)0.000s (-100.0% 🟢)1.123s (+4.1%)0.278s551.21x
💻 LocalNext.js (Turbopack)1.227s (-15.2% 🟢)1.979s (-1.6%)0.000s (-3.2%)1.981s (-1.6%)0.754s311.76x
💻 LocalNitro1.370s (+1.2%)2.014s (~)0.000s (-13.3% 🟢)2.016s (~)0.646s301.96x
💻 LocalExpress1.448s (-2.3%)2.014s (~)0.000s (-46.7% 🟢)2.016s (~)0.568s302.07x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.419s (-12.1% 🟢)2.098s (-6.9% 🟢)0.000s (NaN%)2.135s (-6.4% 🟢)0.716s291.00x
🐘 PostgresNitro1.523s (+8.0% 🔺)2.180s (+9.2% 🔺)0.000s (+Infinity% 🔺)2.189s (+8.8% 🔺)0.666s281.07x
🐘 PostgresNext.js (Turbopack)1.802s (+4.3%)2.309s (+2.1%)0.000s (NaN%)2.318s (+2.1%)0.516s261.27x
💻 LocalNext.js (Turbopack)2.374s (-26.1% 🟢)3.019s (-22.5% 🟢)0.000s (-20.0% 🟢)3.022s (-22.5% 🟢)0.648s201.67x
💻 LocalNitro3.014s (-3.2%)3.614s (-7.2% 🟢)0.001s (+252.9% 🔺)3.617s (-7.3% 🟢)0.603s172.12x
💻 LocalExpress3.223s (-3.3%)3.904s (+1.7%)0.002s (+383.3% 🔺)3.908s (+1.7%)0.686s162.27x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresNitro18/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production1256102191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total71731010528235

❌ Failed Tests

▲ Vercel Production (10 failed)

astro (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

example (1 failed):

  • AbortController abortThrowIfAbortedWorkflow: throwIfAborted causes FatalError, no retries

fastify (1 failed):

  • outputStreamWorkflow negative startIndex (reads from end)

hono (1 failed):

  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KTME1GEXT2GC7YHM27G8KEY3 | 🔍 observability

nextjs-turbopack (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

nitro (2 failed):

  • utf8StreamWorkflow | wrun_01KTMDNBBSH43FEV2N2A7S5KDQ | 🔍 observability
  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

nuxt (2 failed):

  • webhookWorkflow | wrun_01KTMDHSXM87EH9KP6159TWSAV | 🔍 observability
  • outputStreamWorkflow no startIndex (reads all chunks)

vite (1 failed):

  • AbortController abortParallelWorkflow: abort cancels all parallel steps

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro108126
❌ example108126
✅ express109026
❌ fastify108126
❌ hono108126
❌ nextjs-turbopack13212
✅ nextjs-webpack13302
❌ nitro107226
❌ nuxt107226
✅ sveltekit12807
❌ vite108126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygp
pranaygp marked this pull request as ready for review June 8, 2026 19:48
@pranaygp
pranaygp requested a review from a team as a code ownerJune 8, 2026 19:48
CopilotAI review requested due to automatic review settings June 8, 2026 19:48

CopilotAI 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.

Pull request overview

This PR fixes a race in @workflow/world-local where writeExclusive() could expose a partially written destination file to concurrent readers by switching to a “write temp file → hard-link publish” flow, and adds tests to validate publication visibility and first-writer-wins behavior.

Changes:

  • Update writeExclusive() to publish via a fully-written temp file and an atomic hard-link into the final path.
  • Add deterministic tests ensuring destinations aren’t visible mid-write and that only one concurrent writer wins.
  • Add a patch changeset and refresh related inline comments in the storage layer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
packages/world-local/src/storage/events-storage.tsUpdates commentary to reflect the publish semantics used by writeExclusive().
packages/world-local/src/fs.tsImplements atomic publish for exclusive writes using temp file + hard-link.
packages/world-local/src/fs.test.tsAdds deterministic coverage for publication visibility and concurrent writer winner selection.
.changeset/atomic-runs-publish.mdPatch changeset documenting the fix for partial visibility during exclusive writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpackages/world-local/src/fs.ts

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve — clean fix for a real partial-read race, with one defensive nit

The bug is real and the fix is the right shape:

  • Before: fs.writeFile(filePath, data, { flag: 'wx' }) writes directly to the destination. The exclusive create guarantees only one writer wins, but the destination path becomes visible during the write — a concurrent runs.get() can read partial JSON and fail with SyntaxError: Unexpected end of JSON input.
  • After: write to ${filePath}.tmp.${ulid()} first, then fs.link() to the destination. Link creation is atomic at the OS level and fails with EEXIST if another writer already published.

This matches the established pattern in the sibling write() function (which uses fs.rename() for the overwriting variant); the only difference here is link vs rename to preserve first-writer-wins semantics.

Test design is excellent

The first test simulates a slow write by mocking fs.writeFile to pause mid-write, then attempts to read the destination. With the OLD code, the read returns partial content '{"value":'; with the NEW code, the read returns ENOENT (destination doesn't exist until link succeeds). The post-PR file content is exactly the full payload. Verified regression: I temporarily reverted just the fs.ts change and reran the test — got expected ENOENT, received '{"value":' exactly as the test asserts.

The second test (16 concurrent writers) confirms:

  1. Exactly one returns true (the winner)
  2. The final file content matches one specific writer's value
  3. The directory has only exclusive.json (no orphaned temp files)

That last assertion is the cleanup check, which catches the finally block actually running.

What I verified locally

  • pnpm turbo run build --filter @workflow/world-local
  • pnpm --filter @workflow/world-local test ✓ (368 tests pass)
  • Reverted the fix and confirmed the new partial-visibility test fails as expected → restored the fix, all green

CI

5 failures, all pre-existing on main's baseline:

  • Vercel Prod E2E (nextjs-turbopack, hono, fastify) — same flakes seen on main's recent runs
  • Local Postgres canary (nextjs-turbopack) — Next.js canary tracks; the latest main canary baseline shows similar instability
  • E2E Required Check — cascading

Nothing PR-specific.

One defensive nit (non-blocker, inline)

Copilot caught a small defensive-coding miss: the finally block unconditionally unlinks tempPath, but if the fs.writeFile(tempPath, ..., { flag: 'wx' }) itself fails with EEXIST (vanishingly rare ULID collision or a stale temp from a crashed process), the unlink would delete someone else's temp file. The existing write() function already handles this with a tempFileCreated flag — same pattern would close the gap here. Inline comment with the snippet.

Practical risk is essentially zero (2^-40 collision probability), but matching the surrounding pattern is essentially free.

Bottom line

Solid fix for a real race that surfaces as SyntaxError: Unexpected end of JSON input in production. The hard-link-after-write pattern is the canonical atomic-publish primitive for "first writer wins" semantics on POSIX filesystems.

Approving.

Comment threadpackages/world-local/src/fs.ts Outdated
@pranaygp
pranaygp merged commit 867e339 into mainJun 8, 2026
34 of 58 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Jun 8, 2026
github-actionsBot added a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2299. Merge conflicts were resolved by AI — please review carefully. (backport job run)

pranaygp pushed a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pranaygp added a commit that referenced this pull request Jun 11, 2026
…-attributes-client
* origin/main: (32 commits)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
[world-vercel] Validate ref resolve responses before use (#2035)
fix: bump devalue to 5.8.1 (#2292)
Handle lazy stream key request failures (#2257)
fix(docs): declare Nitro auto-import globals for code samples (#2290)
[core] Preserve event-log order in hook-vs-sleep replay races (#2171) (#2185)
docs: add nitro changelog (#2232)
fix(next): always apply turbopack content condition regardless of builder mode (#2253)
Update @vercel/queue from 0.2.1 to 0.3.0 (#2255)
[nest] Use AST-based CommonJS import rewriting (#2080)
...
# Conflicts:
#	packages/world-local/src/storage/events-storage.ts
pranaygp added a commit that referenced this pull request Jun 11, 2026
…hook-ready
* origin-https/main: (119 commits)
fix: settle aborted parallel steps before completing abortParallelWorkflow (#2244)
Add native v4 workflow attribute events (#2226)
Version Packages (beta) (#2326)
[ci] Fix flaky windows unit tests (#2359)
Capture Vercel runtime logs when e2e Vercel Prod lanes fail (#2356)
Fix e2e failure reporting under vitest 4 and preserve fetch error causes (#2355)
[core] Fix process crash from rejected waitUntil promises (#2336)
[core] Remove duplicate `waitUntil` for suspension handler async operations (#2345)
Prevent local tests from hanging (#2338)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
...
# Conflicts:
#	packages/core/src/runtime.ts
#	packages/core/src/runtime/suspension-handler.ts
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.

3 participants

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

[codex] Fix partial world-local exclusive writes - #2296

Merged
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write
Jun 8, 2026
Merged

[codex] Fix partial world-local exclusive writes#2296
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Summary

  • write exclusive local files to a unique temporary path before publishing them
  • use an atomic hard link to preserve first-writer-wins behavior without exposing partial contents
  • add deterministic coverage for publication visibility and concurrent writers
  • add a patch changeset for @workflow/world-local

Root cause

writeExclusive() previously called fs.writeFile() directly on the final path with the wx flag. The exclusive create prevented another writer from winning, but the final path became visible before the JSON body was fully written. A concurrent runs.get() could therefore read an empty or truncated run file and fail with SyntaxError: Unexpected end of JSON input.

The new implementation writes and closes a temporary file first, then hard-links it into the final path. Link creation is atomic and returns EEXIST when another writer has already published the destination.

Verification

  • pnpm --filter @workflow/world-local test (368 tests)
  • pnpm --filter @workflow/world-local typecheck
  • pnpm turbo run build --filter=@workflow/world-local...
  • targeted Biome check (existing complexity warnings only)

@changeset-bot

changeset-botBot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89971e0

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

This PR includes changesets to release 18 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/vitestPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/webPatch
@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

@vercel

vercelBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 8, 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.044s (+2.1%)1.006s (~)0.962s101.00x
💻 LocalNext.js (Turbopack)0.046s (-16.0% 🟢)1.004s (~)0.958s101.06x
💻 LocalExpress0.047s (+9.7% 🔺)1.006s (~)0.959s101.08x
🐘 PostgresNitro0.058s (-8.9% 🟢)1.011s (~)0.953s101.32x
🐘 PostgresExpress0.065s (-1.5%)1.013s (~)0.948s101.49x
🐘 PostgresNext.js (Turbopack)0.068s (-3.1%)1.011s (~)0.944s101.55x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.095s (~)2.006s (~)0.910s101.00x
💻 LocalExpress1.099s (~)2.007s (~)0.908s101.00x
🐘 PostgresNitro1.105s (-0.8%)2.009s (~)0.904s101.01x
💻 LocalNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🐘 PostgresExpress1.114s (+2.1%)2.010s (~)0.896s101.02x
🐘 PostgresNext.js (Turbopack)1.143s (~)2.011s (~)0.867s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.541s (~)11.021s (~)0.480s31.00x
💻 LocalExpress10.552s (~)11.023s (~)0.471s31.00x
🐘 PostgresNitro10.573s (~)11.016s (~)0.443s31.00x
💻 LocalNext.js (Turbopack)10.618s (~)11.020s (~)0.402s31.01x
🐘 PostgresExpress10.627s (-0.8%)11.021s (-2.9%)0.394s31.01x
🐘 PostgresNext.js (Turbopack)11.021s (+1.9%)11.683s (+6.0% 🔺)0.661s31.05x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.848s (~)14.017s (-1.5%)0.169s51.00x
💻 LocalNitro13.854s (+1.0%)14.225s (+1.4%)0.371s51.00x
🐘 PostgresNitro13.888s (~)14.017s (~)0.129s51.00x
💻 LocalExpress13.891s (~)14.228s (~)0.337s51.00x
💻 LocalNext.js (Turbopack)13.947s (-0.6%)14.024s (-4.1%)0.077s51.01x
🐘 PostgresNext.js (Turbopack)14.443s (-1.0%)15.017s (~)0.574s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.482s (+0.6%)13.025s (~)0.543s71.00x
🐘 PostgresNitro12.547s (-1.5%)13.017s (~)0.470s71.01x
💻 LocalExpress12.612s (~)13.025s (~)0.414s71.01x
🐘 PostgresExpress12.615s (-0.9%)13.021s (-2.2%)0.406s71.01x
💻 LocalNext.js (Turbopack)12.796s (-1.2%)13.023s (-2.1%)0.226s71.03x
🐘 PostgresNext.js (Turbopack)13.827s (~)14.018s (~)0.191s71.11x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.189s (-0.8%)2.007s (~)0.818s151.00x
🐘 PostgresExpress1.190s (-0.8%)2.007s (-0.7%)0.818s151.00x
💻 LocalExpress1.211s (-4.1%)2.007s (~)0.795s151.02x
💻 LocalNitro1.236s (+1.9%)2.006s (~)0.770s151.04x
🐘 PostgresNext.js (Turbopack)1.259s (+0.6%)2.008s (~)0.749s151.06x
💻 LocalNext.js (Turbopack)1.308s (+7.0% 🔺)2.005s (~)0.697s151.10x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.241s (-1.4%)2.007s (~)0.766s151.00x
🐘 PostgresExpress1.250s (-5.7% 🟢)2.008s (~)0.757s151.01x
🐘 PostgresNext.js (Turbopack)1.394s (-1.1%)2.006s (~)0.613s151.12x
💻 LocalNitro1.817s (+6.6% 🔺)2.073s (~)0.256s151.46x
💻 LocalNext.js (Turbopack)1.881s (+9.0% 🔺)2.314s (+15.4% 🔺)0.434s131.52x
💻 LocalExpress1.928s (+2.4%)2.222s (~)0.294s141.55x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-5.7% 🟢)2.006s (~)0.680s151.00x
🐘 PostgresExpress1.395s (~)2.007s (~)0.612s151.05x
🐘 PostgresNext.js (Turbopack)1.760s (~)2.392s (+4.3%)0.633s131.33x
💻 LocalNext.js (Turbopack)3.768s (-14.3% 🟢)4.133s (-17.5% 🟢)0.365s82.84x
💻 LocalExpress5.430s (+2.5%)6.015s (~)0.585s64.09x
💻 LocalNitro5.698s (+20.8% 🔺)6.213s (+24.0% 🔺)0.515s54.29x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.183s (-1.4%)2.008s (~)0.825s151.00x
🐘 PostgresExpress1.212s (+0.8%)2.008s (~)0.795s151.03x
🐘 PostgresNext.js (Turbopack)1.248s (-1.4%)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.257s (-3.7%)2.005s (~)0.748s151.06x
💻 LocalNitro1.551s (~)2.006s (~)0.455s151.31x
💻 LocalExpress1.576s (-4.9%)2.007s (-3.2%)0.431s151.33x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.226s (-3.8%)2.007s (~)0.780s151.00x
🐘 PostgresExpress1.265s (+1.8%)2.008s (~)0.743s151.03x
🐘 PostgresNext.js (Turbopack)1.397s (~)2.008s (~)0.611s151.14x
💻 LocalNext.js (Turbopack)2.041s (+1.0%)2.469s (-1.5%)0.428s131.66x
💻 LocalNitro2.170s (+23.5% 🔺)2.592s (+25.1% 🔺)0.421s121.77x
💻 LocalExpress2.220s (+4.5%)2.736s (+5.6% 🔺)0.516s111.81x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.333s (-8.8% 🟢)2.007s (~)0.674s151.00x
🐘 PostgresExpress1.394s (-7.1% 🟢)2.008s (-16.2% 🟢)0.614s151.05x
🐘 PostgresNext.js (Turbopack)1.608s (-2.9%)2.007s (-3.2%)0.399s151.21x
💻 LocalNext.js (Turbopack)4.589s (-11.1% 🟢)5.012s (-16.7% 🟢)0.423s73.44x
💻 LocalNitro5.816s (+22.6% 🔺)6.219s (+16.4% 🔺)0.403s54.36x
💻 LocalExpress6.294s (+7.4% 🔺)6.816s (+9.7% 🔺)0.521s54.72x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.575s (-13.8% 🟢)1.007s (-3.9%)0.432s601.00x
🐘 PostgresNitro0.590s (-3.1%)1.023s (+1.6%)0.433s591.03x
💻 LocalNitro0.614s (-23.6% 🟢)1.021s (-15.2% 🟢)0.407s591.07x
💻 LocalExpress0.638s (-2.8%)1.005s (-3.3%)0.368s601.11x
💻 LocalNext.js (Turbopack)0.690s (-0.9%)1.021s (+1.6%)0.330s601.20x
🐘 PostgresNext.js (Turbopack)0.800s (-1.4%)1.006s (~)0.206s601.39x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.400s (-1.2%)2.053s (+2.3%)0.654s441.00x
🐘 PostgresExpress1.431s (-6.8% 🟢)2.008s (-6.7% 🟢)0.577s451.02x
💻 LocalNitro1.490s (+1.8%)2.006s (~)0.516s451.06x
💻 LocalExpress1.598s (~)2.007s (-1.1%)0.409s451.14x
💻 LocalNext.js (Turbopack)1.860s (+7.6% 🔺)2.172s (+7.1% 🔺)0.312s421.33x
🐘 PostgresNext.js (Turbopack)1.935s (~)2.150s (-1.1%)0.215s421.38x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.794s (-4.1%)3.166s (-3.5%)0.372s381.00x
🐘 PostgresExpress2.892s (-0.7%)3.221s (-9.0% 🟢)0.329s381.03x
💻 LocalNitro3.235s (+0.9%)4.009s (~)0.774s301.16x
💻 LocalExpress3.425s (~)4.043s (+0.8%)0.618s301.23x
💻 LocalNext.js (Turbopack)3.698s (-0.8%)4.148s (+1.0%)0.450s291.32x
🐘 PostgresNext.js (Turbopack)3.778s (-2.1%)4.009s (-1.7%)0.232s301.35x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.206s (-12.4% 🟢)1.006s (~)0.800s601.00x
🐘 PostgresExpress0.232s (-8.0% 🟢)1.007s (~)0.775s601.12x
🐘 PostgresNext.js (Turbopack)0.256s (-9.4% 🟢)1.006s (~)0.750s601.24x
💻 LocalNitro0.391s (-7.9% 🟢)1.004s (~)0.613s601.90x
💻 LocalExpress0.446s (-4.0%)1.005s (~)0.559s602.16x
💻 LocalNext.js (Turbopack)0.473s (-22.6% 🟢)1.005s (-3.3%)0.532s602.29x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.327s (-11.8% 🟢)1.007s (~)0.680s901.00x
🐘 PostgresExpress0.362s (+6.8% 🔺)1.007s (~)0.644s901.11x
🐘 PostgresNext.js (Turbopack)0.460s (-4.8%)1.006s (~)0.546s901.41x
💻 LocalNext.js (Turbopack)1.974s (-19.4% 🟢)2.584s (-16.9% 🟢)0.611s356.04x
💻 LocalNitro2.153s (+4.3%)2.736s (+3.7%)0.583s336.58x
💻 LocalExpress2.177s (-0.6%)2.913s (+3.2%)0.736s316.66x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.608s (-14.1% 🟢)1.005s (~)0.398s1201.00x
🐘 PostgresExpress0.707s (+13.0% 🔺)1.015s (-3.8%)0.308s1191.16x
🐘 PostgresNext.js (Turbopack)0.933s (-4.7%)1.366s (-15.0% 🟢)0.433s891.54x
💻 LocalNext.js (Turbopack)8.496s (-17.6% 🟢)9.329s (-17.4% 🟢)0.833s1313.98x
💻 LocalNitro9.623s (+10.5% 🔺)10.192s (+9.2% 🔺)0.569s1215.83x
💻 LocalExpress10.339s (~)10.863s (~)0.524s1217.01x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.160s (-1.8%)2.003s (~)0.001s (-7.1% 🟢)2.011s (~)0.852s101.00x
💻 LocalNitro1.169s (+1.6%)2.005s (~)0.011s (+14.0% 🔺)2.018s (~)0.849s101.01x
💻 LocalNext.js (Turbopack)1.170s (~)2.003s (~)0.009s (-15.8% 🟢)2.014s (~)0.845s101.01x
🐘 PostgresExpress1.172s (-1.8%)2.001s (~)0.001s (-96.5% 🟢)2.012s (-1.5%)0.840s101.01x
💻 LocalExpress1.178s (+0.8%)2.006s (~)0.014s (+9.4% 🔺)2.022s (~)0.844s101.02x
🐘 PostgresNext.js (Turbopack)1.227s (-0.6%)2.001s (~)0.001s (-20.0% 🟢)2.010s (~)0.783s101.06x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.567s (-5.8% 🟢)2.009s (~)0.004s (-8.5% 🟢)2.024s (~)0.457s301.00x
💻 LocalNext.js (Turbopack)1.580s (-3.7%)2.008s (~)0.008s (-17.5% 🟢)2.019s (~)0.438s301.01x
💻 LocalNitro1.594s (-8.5% 🟢)2.010s (~)0.010s (+8.7% 🔺)2.021s (-8.1% 🟢)0.427s301.02x
💻 LocalExpress1.604s (-2.0%)2.009s (~)0.012s (+8.2% 🔺)2.023s (~)0.419s301.02x
🐘 PostgresExpress1.632s (-6.0% 🟢)2.003s (-6.5% 🟢)0.004s (+27.8% 🔺)2.028s (-6.1% 🟢)0.395s301.04x
🐘 PostgresNext.js (Turbopack)1.735s (-1.7%)2.010s (~)0.004s (-5.8% 🟢)2.025s (~)0.290s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.698s (-3.5%)1.034s (~)0.000s (-66.7% 🟢)1.041s (-0.6%)0.343s581.00x
🐘 PostgresExpress0.737s (-24.6% 🟢)1.049s (-26.5% 🟢)0.000s (-50.9% 🟢)1.060s (-26.8% 🟢)0.323s571.06x
🐘 PostgresNext.js (Turbopack)0.845s (+1.5%)1.092s (+1.9%)0.000s (-100.0% 🟢)1.123s (+4.1%)0.278s551.21x
💻 LocalNext.js (Turbopack)1.227s (-15.2% 🟢)1.979s (-1.6%)0.000s (-3.2%)1.981s (-1.6%)0.754s311.76x
💻 LocalNitro1.370s (+1.2%)2.014s (~)0.000s (-13.3% 🟢)2.016s (~)0.646s301.96x
💻 LocalExpress1.448s (-2.3%)2.014s (~)0.000s (-46.7% 🟢)2.016s (~)0.568s302.07x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.419s (-12.1% 🟢)2.098s (-6.9% 🟢)0.000s (NaN%)2.135s (-6.4% 🟢)0.716s291.00x
🐘 PostgresNitro1.523s (+8.0% 🔺)2.180s (+9.2% 🔺)0.000s (+Infinity% 🔺)2.189s (+8.8% 🔺)0.666s281.07x
🐘 PostgresNext.js (Turbopack)1.802s (+4.3%)2.309s (+2.1%)0.000s (NaN%)2.318s (+2.1%)0.516s261.27x
💻 LocalNext.js (Turbopack)2.374s (-26.1% 🟢)3.019s (-22.5% 🟢)0.000s (-20.0% 🟢)3.022s (-22.5% 🟢)0.648s201.67x
💻 LocalNitro3.014s (-3.2%)3.614s (-7.2% 🟢)0.001s (+252.9% 🔺)3.617s (-7.3% 🟢)0.603s172.12x
💻 LocalExpress3.223s (-3.3%)3.904s (+1.7%)0.002s (+383.3% 🔺)3.908s (+1.7%)0.686s162.27x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresNitro18/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production1256102191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total71731010528235

❌ Failed Tests

▲ Vercel Production (10 failed)

astro (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

example (1 failed):

  • AbortController abortThrowIfAbortedWorkflow: throwIfAborted causes FatalError, no retries

fastify (1 failed):

  • outputStreamWorkflow negative startIndex (reads from end)

hono (1 failed):

  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KTME1GEXT2GC7YHM27G8KEY3 | 🔍 observability

nextjs-turbopack (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

nitro (2 failed):

  • utf8StreamWorkflow | wrun_01KTMDNBBSH43FEV2N2A7S5KDQ | 🔍 observability
  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

nuxt (2 failed):

  • webhookWorkflow | wrun_01KTMDHSXM87EH9KP6159TWSAV | 🔍 observability
  • outputStreamWorkflow no startIndex (reads all chunks)

vite (1 failed):

  • AbortController abortParallelWorkflow: abort cancels all parallel steps

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro108126
❌ example108126
✅ express109026
❌ fastify108126
❌ hono108126
❌ nextjs-turbopack13212
✅ nextjs-webpack13302
❌ nitro107226
❌ nuxt107226
✅ sveltekit12807
❌ vite108126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygp
pranaygp marked this pull request as ready for review June 8, 2026 19:48
@pranaygp
pranaygp requested a review from a team as a code ownerJune 8, 2026 19:48
CopilotAI review requested due to automatic review settings June 8, 2026 19:48

CopilotAI 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.

Pull request overview

This PR fixes a race in @workflow/world-local where writeExclusive() could expose a partially written destination file to concurrent readers by switching to a “write temp file → hard-link publish” flow, and adds tests to validate publication visibility and first-writer-wins behavior.

Changes:

  • Update writeExclusive() to publish via a fully-written temp file and an atomic hard-link into the final path.
  • Add deterministic tests ensuring destinations aren’t visible mid-write and that only one concurrent writer wins.
  • Add a patch changeset and refresh related inline comments in the storage layer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
packages/world-local/src/storage/events-storage.tsUpdates commentary to reflect the publish semantics used by writeExclusive().
packages/world-local/src/fs.tsImplements atomic publish for exclusive writes using temp file + hard-link.
packages/world-local/src/fs.test.tsAdds deterministic coverage for publication visibility and concurrent writer winner selection.
.changeset/atomic-runs-publish.mdPatch changeset documenting the fix for partial visibility during exclusive writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpackages/world-local/src/fs.ts

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve — clean fix for a real partial-read race, with one defensive nit

The bug is real and the fix is the right shape:

  • Before: fs.writeFile(filePath, data, { flag: 'wx' }) writes directly to the destination. The exclusive create guarantees only one writer wins, but the destination path becomes visible during the write — a concurrent runs.get() can read partial JSON and fail with SyntaxError: Unexpected end of JSON input.
  • After: write to ${filePath}.tmp.${ulid()} first, then fs.link() to the destination. Link creation is atomic at the OS level and fails with EEXIST if another writer already published.

This matches the established pattern in the sibling write() function (which uses fs.rename() for the overwriting variant); the only difference here is link vs rename to preserve first-writer-wins semantics.

Test design is excellent

The first test simulates a slow write by mocking fs.writeFile to pause mid-write, then attempts to read the destination. With the OLD code, the read returns partial content '{"value":'; with the NEW code, the read returns ENOENT (destination doesn't exist until link succeeds). The post-PR file content is exactly the full payload. Verified regression: I temporarily reverted just the fs.ts change and reran the test — got expected ENOENT, received '{"value":' exactly as the test asserts.

The second test (16 concurrent writers) confirms:

  1. Exactly one returns true (the winner)
  2. The final file content matches one specific writer's value
  3. The directory has only exclusive.json (no orphaned temp files)

That last assertion is the cleanup check, which catches the finally block actually running.

What I verified locally

  • pnpm turbo run build --filter @workflow/world-local
  • pnpm --filter @workflow/world-local test ✓ (368 tests pass)
  • Reverted the fix and confirmed the new partial-visibility test fails as expected → restored the fix, all green

CI

5 failures, all pre-existing on main's baseline:

  • Vercel Prod E2E (nextjs-turbopack, hono, fastify) — same flakes seen on main's recent runs
  • Local Postgres canary (nextjs-turbopack) — Next.js canary tracks; the latest main canary baseline shows similar instability
  • E2E Required Check — cascading

Nothing PR-specific.

One defensive nit (non-blocker, inline)

Copilot caught a small defensive-coding miss: the finally block unconditionally unlinks tempPath, but if the fs.writeFile(tempPath, ..., { flag: 'wx' }) itself fails with EEXIST (vanishingly rare ULID collision or a stale temp from a crashed process), the unlink would delete someone else's temp file. The existing write() function already handles this with a tempFileCreated flag — same pattern would close the gap here. Inline comment with the snippet.

Practical risk is essentially zero (2^-40 collision probability), but matching the surrounding pattern is essentially free.

Bottom line

Solid fix for a real race that surfaces as SyntaxError: Unexpected end of JSON input in production. The hard-link-after-write pattern is the canonical atomic-publish primitive for "first writer wins" semantics on POSIX filesystems.

Approving.

Comment threadpackages/world-local/src/fs.ts Outdated
@pranaygp
pranaygp merged commit 867e339 into mainJun 8, 2026
34 of 58 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Jun 8, 2026
github-actionsBot added a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2299. Merge conflicts were resolved by AI — please review carefully. (backport job run)

pranaygp pushed a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pranaygp added a commit that referenced this pull request Jun 11, 2026
…-attributes-client
* origin/main: (32 commits)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
[world-vercel] Validate ref resolve responses before use (#2035)
fix: bump devalue to 5.8.1 (#2292)
Handle lazy stream key request failures (#2257)
fix(docs): declare Nitro auto-import globals for code samples (#2290)
[core] Preserve event-log order in hook-vs-sleep replay races (#2171) (#2185)
docs: add nitro changelog (#2232)
fix(next): always apply turbopack content condition regardless of builder mode (#2253)
Update @vercel/queue from 0.2.1 to 0.3.0 (#2255)
[nest] Use AST-based CommonJS import rewriting (#2080)
...
# Conflicts:
#	packages/world-local/src/storage/events-storage.ts
pranaygp added a commit that referenced this pull request Jun 11, 2026
…hook-ready
* origin-https/main: (119 commits)
fix: settle aborted parallel steps before completing abortParallelWorkflow (#2244)
Add native v4 workflow attribute events (#2226)
Version Packages (beta) (#2326)
[ci] Fix flaky windows unit tests (#2359)
Capture Vercel runtime logs when e2e Vercel Prod lanes fail (#2356)
Fix e2e failure reporting under vitest 4 and preserve fetch error causes (#2355)
[core] Fix process crash from rejected waitUntil promises (#2336)
[core] Remove duplicate `waitUntil` for suspension handler async operations (#2345)
Prevent local tests from hanging (#2338)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
...
# Conflicts:
#	packages/core/src/runtime.ts
#	packages/core/src/runtime/suspension-handler.ts
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.

3 participants

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

[codex] Fix partial world-local exclusive writes - #2296

Merged
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write
Jun 8, 2026
Merged

[codex] Fix partial world-local exclusive writes#2296
pranaygp merged 2 commits into
mainfrom
pranaygp/codex/fix-world-local-exclusive-write

Conversation

@pranaygp

Copy link
Copy Markdown
Contributor

Summary

  • write exclusive local files to a unique temporary path before publishing them
  • use an atomic hard link to preserve first-writer-wins behavior without exposing partial contents
  • add deterministic coverage for publication visibility and concurrent writers
  • add a patch changeset for @workflow/world-local

Root cause

writeExclusive() previously called fs.writeFile() directly on the final path with the wx flag. The exclusive create prevented another writer from winning, but the final path became visible before the JSON body was fully written. A concurrent runs.get() could therefore read an empty or truncated run file and fail with SyntaxError: Unexpected end of JSON input.

The new implementation writes and closes a temporary file first, then hard-links it into the final path. Link creation is atomic and returns EEXIST when another writer has already published the destination.

Verification

  • pnpm --filter @workflow/world-local test (368 tests)
  • pnpm --filter @workflow/world-local typecheck
  • pnpm turbo run build --filter=@workflow/world-local...
  • targeted Biome check (existing complexity warnings only)

@changeset-bot

changeset-botBot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 89971e0

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

This PR includes changesets to release 18 packages
NameType
@workflow/world-localPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/vitestPatch
@workflow/world-postgresPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
@workflow/webPatch
@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

@vercel

vercelBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 8, 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.044s (+2.1%)1.006s (~)0.962s101.00x
💻 LocalNext.js (Turbopack)0.046s (-16.0% 🟢)1.004s (~)0.958s101.06x
💻 LocalExpress0.047s (+9.7% 🔺)1.006s (~)0.959s101.08x
🐘 PostgresNitro0.058s (-8.9% 🟢)1.011s (~)0.953s101.32x
🐘 PostgresExpress0.065s (-1.5%)1.013s (~)0.948s101.49x
🐘 PostgresNext.js (Turbopack)0.068s (-3.1%)1.011s (~)0.944s101.55x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.095s (~)2.006s (~)0.910s101.00x
💻 LocalExpress1.099s (~)2.007s (~)0.908s101.00x
🐘 PostgresNitro1.105s (-0.8%)2.009s (~)0.904s101.01x
💻 LocalNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🐘 PostgresExpress1.114s (+2.1%)2.010s (~)0.896s101.02x
🐘 PostgresNext.js (Turbopack)1.143s (~)2.011s (~)0.867s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.541s (~)11.021s (~)0.480s31.00x
💻 LocalExpress10.552s (~)11.023s (~)0.471s31.00x
🐘 PostgresNitro10.573s (~)11.016s (~)0.443s31.00x
💻 LocalNext.js (Turbopack)10.618s (~)11.020s (~)0.402s31.01x
🐘 PostgresExpress10.627s (-0.8%)11.021s (-2.9%)0.394s31.01x
🐘 PostgresNext.js (Turbopack)11.021s (+1.9%)11.683s (+6.0% 🔺)0.661s31.05x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.848s (~)14.017s (-1.5%)0.169s51.00x
💻 LocalNitro13.854s (+1.0%)14.225s (+1.4%)0.371s51.00x
🐘 PostgresNitro13.888s (~)14.017s (~)0.129s51.00x
💻 LocalExpress13.891s (~)14.228s (~)0.337s51.00x
💻 LocalNext.js (Turbopack)13.947s (-0.6%)14.024s (-4.1%)0.077s51.01x
🐘 PostgresNext.js (Turbopack)14.443s (-1.0%)15.017s (~)0.574s41.04x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.482s (+0.6%)13.025s (~)0.543s71.00x
🐘 PostgresNitro12.547s (-1.5%)13.017s (~)0.470s71.01x
💻 LocalExpress12.612s (~)13.025s (~)0.414s71.01x
🐘 PostgresExpress12.615s (-0.9%)13.021s (-2.2%)0.406s71.01x
💻 LocalNext.js (Turbopack)12.796s (-1.2%)13.023s (-2.1%)0.226s71.03x
🐘 PostgresNext.js (Turbopack)13.827s (~)14.018s (~)0.191s71.11x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.189s (-0.8%)2.007s (~)0.818s151.00x
🐘 PostgresExpress1.190s (-0.8%)2.007s (-0.7%)0.818s151.00x
💻 LocalExpress1.211s (-4.1%)2.007s (~)0.795s151.02x
💻 LocalNitro1.236s (+1.9%)2.006s (~)0.770s151.04x
🐘 PostgresNext.js (Turbopack)1.259s (+0.6%)2.008s (~)0.749s151.06x
💻 LocalNext.js (Turbopack)1.308s (+7.0% 🔺)2.005s (~)0.697s151.10x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.241s (-1.4%)2.007s (~)0.766s151.00x
🐘 PostgresExpress1.250s (-5.7% 🟢)2.008s (~)0.757s151.01x
🐘 PostgresNext.js (Turbopack)1.394s (-1.1%)2.006s (~)0.613s151.12x
💻 LocalNitro1.817s (+6.6% 🔺)2.073s (~)0.256s151.46x
💻 LocalNext.js (Turbopack)1.881s (+9.0% 🔺)2.314s (+15.4% 🔺)0.434s131.52x
💻 LocalExpress1.928s (+2.4%)2.222s (~)0.294s141.55x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-5.7% 🟢)2.006s (~)0.680s151.00x
🐘 PostgresExpress1.395s (~)2.007s (~)0.612s151.05x
🐘 PostgresNext.js (Turbopack)1.760s (~)2.392s (+4.3%)0.633s131.33x
💻 LocalNext.js (Turbopack)3.768s (-14.3% 🟢)4.133s (-17.5% 🟢)0.365s82.84x
💻 LocalExpress5.430s (+2.5%)6.015s (~)0.585s64.09x
💻 LocalNitro5.698s (+20.8% 🔺)6.213s (+24.0% 🔺)0.515s54.29x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.183s (-1.4%)2.008s (~)0.825s151.00x
🐘 PostgresExpress1.212s (+0.8%)2.008s (~)0.795s151.03x
🐘 PostgresNext.js (Turbopack)1.248s (-1.4%)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.257s (-3.7%)2.005s (~)0.748s151.06x
💻 LocalNitro1.551s (~)2.006s (~)0.455s151.31x
💻 LocalExpress1.576s (-4.9%)2.007s (-3.2%)0.431s151.33x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.226s (-3.8%)2.007s (~)0.780s151.00x
🐘 PostgresExpress1.265s (+1.8%)2.008s (~)0.743s151.03x
🐘 PostgresNext.js (Turbopack)1.397s (~)2.008s (~)0.611s151.14x
💻 LocalNext.js (Turbopack)2.041s (+1.0%)2.469s (-1.5%)0.428s131.66x
💻 LocalNitro2.170s (+23.5% 🔺)2.592s (+25.1% 🔺)0.421s121.77x
💻 LocalExpress2.220s (+4.5%)2.736s (+5.6% 🔺)0.516s111.81x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.333s (-8.8% 🟢)2.007s (~)0.674s151.00x
🐘 PostgresExpress1.394s (-7.1% 🟢)2.008s (-16.2% 🟢)0.614s151.05x
🐘 PostgresNext.js (Turbopack)1.608s (-2.9%)2.007s (-3.2%)0.399s151.21x
💻 LocalNext.js (Turbopack)4.589s (-11.1% 🟢)5.012s (-16.7% 🟢)0.423s73.44x
💻 LocalNitro5.816s (+22.6% 🔺)6.219s (+16.4% 🔺)0.403s54.36x
💻 LocalExpress6.294s (+7.4% 🔺)6.816s (+9.7% 🔺)0.521s54.72x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.575s (-13.8% 🟢)1.007s (-3.9%)0.432s601.00x
🐘 PostgresNitro0.590s (-3.1%)1.023s (+1.6%)0.433s591.03x
💻 LocalNitro0.614s (-23.6% 🟢)1.021s (-15.2% 🟢)0.407s591.07x
💻 LocalExpress0.638s (-2.8%)1.005s (-3.3%)0.368s601.11x
💻 LocalNext.js (Turbopack)0.690s (-0.9%)1.021s (+1.6%)0.330s601.20x
🐘 PostgresNext.js (Turbopack)0.800s (-1.4%)1.006s (~)0.206s601.39x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.400s (-1.2%)2.053s (+2.3%)0.654s441.00x
🐘 PostgresExpress1.431s (-6.8% 🟢)2.008s (-6.7% 🟢)0.577s451.02x
💻 LocalNitro1.490s (+1.8%)2.006s (~)0.516s451.06x
💻 LocalExpress1.598s (~)2.007s (-1.1%)0.409s451.14x
💻 LocalNext.js (Turbopack)1.860s (+7.6% 🔺)2.172s (+7.1% 🔺)0.312s421.33x
🐘 PostgresNext.js (Turbopack)1.935s (~)2.150s (-1.1%)0.215s421.38x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.794s (-4.1%)3.166s (-3.5%)0.372s381.00x
🐘 PostgresExpress2.892s (-0.7%)3.221s (-9.0% 🟢)0.329s381.03x
💻 LocalNitro3.235s (+0.9%)4.009s (~)0.774s301.16x
💻 LocalExpress3.425s (~)4.043s (+0.8%)0.618s301.23x
💻 LocalNext.js (Turbopack)3.698s (-0.8%)4.148s (+1.0%)0.450s291.32x
🐘 PostgresNext.js (Turbopack)3.778s (-2.1%)4.009s (-1.7%)0.232s301.35x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.206s (-12.4% 🟢)1.006s (~)0.800s601.00x
🐘 PostgresExpress0.232s (-8.0% 🟢)1.007s (~)0.775s601.12x
🐘 PostgresNext.js (Turbopack)0.256s (-9.4% 🟢)1.006s (~)0.750s601.24x
💻 LocalNitro0.391s (-7.9% 🟢)1.004s (~)0.613s601.90x
💻 LocalExpress0.446s (-4.0%)1.005s (~)0.559s602.16x
💻 LocalNext.js (Turbopack)0.473s (-22.6% 🟢)1.005s (-3.3%)0.532s602.29x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.327s (-11.8% 🟢)1.007s (~)0.680s901.00x
🐘 PostgresExpress0.362s (+6.8% 🔺)1.007s (~)0.644s901.11x
🐘 PostgresNext.js (Turbopack)0.460s (-4.8%)1.006s (~)0.546s901.41x
💻 LocalNext.js (Turbopack)1.974s (-19.4% 🟢)2.584s (-16.9% 🟢)0.611s356.04x
💻 LocalNitro2.153s (+4.3%)2.736s (+3.7%)0.583s336.58x
💻 LocalExpress2.177s (-0.6%)2.913s (+3.2%)0.736s316.66x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.608s (-14.1% 🟢)1.005s (~)0.398s1201.00x
🐘 PostgresExpress0.707s (+13.0% 🔺)1.015s (-3.8%)0.308s1191.16x
🐘 PostgresNext.js (Turbopack)0.933s (-4.7%)1.366s (-15.0% 🟢)0.433s891.54x
💻 LocalNext.js (Turbopack)8.496s (-17.6% 🟢)9.329s (-17.4% 🟢)0.833s1313.98x
💻 LocalNitro9.623s (+10.5% 🔺)10.192s (+9.2% 🔺)0.569s1215.83x
💻 LocalExpress10.339s (~)10.863s (~)0.524s1217.01x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.160s (-1.8%)2.003s (~)0.001s (-7.1% 🟢)2.011s (~)0.852s101.00x
💻 LocalNitro1.169s (+1.6%)2.005s (~)0.011s (+14.0% 🔺)2.018s (~)0.849s101.01x
💻 LocalNext.js (Turbopack)1.170s (~)2.003s (~)0.009s (-15.8% 🟢)2.014s (~)0.845s101.01x
🐘 PostgresExpress1.172s (-1.8%)2.001s (~)0.001s (-96.5% 🟢)2.012s (-1.5%)0.840s101.01x
💻 LocalExpress1.178s (+0.8%)2.006s (~)0.014s (+9.4% 🔺)2.022s (~)0.844s101.02x
🐘 PostgresNext.js (Turbopack)1.227s (-0.6%)2.001s (~)0.001s (-20.0% 🟢)2.010s (~)0.783s101.06x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.567s (-5.8% 🟢)2.009s (~)0.004s (-8.5% 🟢)2.024s (~)0.457s301.00x
💻 LocalNext.js (Turbopack)1.580s (-3.7%)2.008s (~)0.008s (-17.5% 🟢)2.019s (~)0.438s301.01x
💻 LocalNitro1.594s (-8.5% 🟢)2.010s (~)0.010s (+8.7% 🔺)2.021s (-8.1% 🟢)0.427s301.02x
💻 LocalExpress1.604s (-2.0%)2.009s (~)0.012s (+8.2% 🔺)2.023s (~)0.419s301.02x
🐘 PostgresExpress1.632s (-6.0% 🟢)2.003s (-6.5% 🟢)0.004s (+27.8% 🔺)2.028s (-6.1% 🟢)0.395s301.04x
🐘 PostgresNext.js (Turbopack)1.735s (-1.7%)2.010s (~)0.004s (-5.8% 🟢)2.025s (~)0.290s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.698s (-3.5%)1.034s (~)0.000s (-66.7% 🟢)1.041s (-0.6%)0.343s581.00x
🐘 PostgresExpress0.737s (-24.6% 🟢)1.049s (-26.5% 🟢)0.000s (-50.9% 🟢)1.060s (-26.8% 🟢)0.323s571.06x
🐘 PostgresNext.js (Turbopack)0.845s (+1.5%)1.092s (+1.9%)0.000s (-100.0% 🟢)1.123s (+4.1%)0.278s551.21x
💻 LocalNext.js (Turbopack)1.227s (-15.2% 🟢)1.979s (-1.6%)0.000s (-3.2%)1.981s (-1.6%)0.754s311.76x
💻 LocalNitro1.370s (+1.2%)2.014s (~)0.000s (-13.3% 🟢)2.016s (~)0.646s301.96x
💻 LocalExpress1.448s (-2.3%)2.014s (~)0.000s (-46.7% 🟢)2.016s (~)0.568s302.07x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.419s (-12.1% 🟢)2.098s (-6.9% 🟢)0.000s (NaN%)2.135s (-6.4% 🟢)0.716s291.00x
🐘 PostgresNitro1.523s (+8.0% 🔺)2.180s (+9.2% 🔺)0.000s (+Infinity% 🔺)2.189s (+8.8% 🔺)0.666s281.07x
🐘 PostgresNext.js (Turbopack)1.802s (+4.3%)2.309s (+2.1%)0.000s (NaN%)2.318s (+2.1%)0.516s261.27x
💻 LocalNext.js (Turbopack)2.374s (-26.1% 🟢)3.019s (-22.5% 🟢)0.000s (-20.0% 🟢)3.022s (-22.5% 🟢)0.648s201.67x
💻 LocalNitro3.014s (-3.2%)3.614s (-7.2% 🟢)0.001s (+252.9% 🔺)3.617s (-7.3% 🟢)0.603s172.12x
💻 LocalExpress3.223s (-3.3%)3.904s (+1.7%)0.002s (+383.3% 🔺)3.908s (+1.7%)0.686s162.27x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro11/21
🐘 PostgresNitro18/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production1256102191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total71731010528235

❌ Failed Tests

▲ Vercel Production (10 failed)

astro (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

example (1 failed):

  • AbortController abortThrowIfAbortedWorkflow: throwIfAborted causes FatalError, no retries

fastify (1 failed):

  • outputStreamWorkflow negative startIndex (reads from end)

hono (1 failed):

  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KTME1GEXT2GC7YHM27G8KEY3 | 🔍 observability

nextjs-turbopack (1 failed):

  • outputStreamWorkflow no startIndex (reads all chunks)

nitro (2 failed):

  • utf8StreamWorkflow | wrun_01KTMDNBBSH43FEV2N2A7S5KDQ | 🔍 observability
  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

nuxt (2 failed):

  • webhookWorkflow | wrun_01KTMDHSXM87EH9KP6159TWSAV | 🔍 observability
  • outputStreamWorkflow no startIndex (reads all chunks)

vite (1 failed):

  • AbortController abortParallelWorkflow: abort cancels all parallel steps

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro108126
❌ example108126
✅ express109026
❌ fastify108126
❌ hono108126
❌ nextjs-turbopack13212
✅ nextjs-webpack13302
❌ nitro107226
❌ nuxt107226
✅ sveltekit12807
❌ vite108126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@pranaygp
pranaygp marked this pull request as ready for review June 8, 2026 19:48
@pranaygp
pranaygp requested a review from a team as a code ownerJune 8, 2026 19:48
CopilotAI review requested due to automatic review settings June 8, 2026 19:48

CopilotAI 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.

Pull request overview

This PR fixes a race in @workflow/world-local where writeExclusive() could expose a partially written destination file to concurrent readers by switching to a “write temp file → hard-link publish” flow, and adds tests to validate publication visibility and first-writer-wins behavior.

Changes:

  • Update writeExclusive() to publish via a fully-written temp file and an atomic hard-link into the final path.
  • Add deterministic tests ensuring destinations aren’t visible mid-write and that only one concurrent writer wins.
  • Add a patch changeset and refresh related inline comments in the storage layer.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
packages/world-local/src/storage/events-storage.tsUpdates commentary to reflect the publish semantics used by writeExclusive().
packages/world-local/src/fs.tsImplements atomic publish for exclusive writes using temp file + hard-link.
packages/world-local/src/fs.test.tsAdds deterministic coverage for publication visibility and concurrent writer winner selection.
.changeset/atomic-runs-publish.mdPatch changeset documenting the fix for partial visibility during exclusive writes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpackages/world-local/src/fs.ts

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve — clean fix for a real partial-read race, with one defensive nit

The bug is real and the fix is the right shape:

  • Before: fs.writeFile(filePath, data, { flag: 'wx' }) writes directly to the destination. The exclusive create guarantees only one writer wins, but the destination path becomes visible during the write — a concurrent runs.get() can read partial JSON and fail with SyntaxError: Unexpected end of JSON input.
  • After: write to ${filePath}.tmp.${ulid()} first, then fs.link() to the destination. Link creation is atomic at the OS level and fails with EEXIST if another writer already published.

This matches the established pattern in the sibling write() function (which uses fs.rename() for the overwriting variant); the only difference here is link vs rename to preserve first-writer-wins semantics.

Test design is excellent

The first test simulates a slow write by mocking fs.writeFile to pause mid-write, then attempts to read the destination. With the OLD code, the read returns partial content '{"value":'; with the NEW code, the read returns ENOENT (destination doesn't exist until link succeeds). The post-PR file content is exactly the full payload. Verified regression: I temporarily reverted just the fs.ts change and reran the test — got expected ENOENT, received '{"value":' exactly as the test asserts.

The second test (16 concurrent writers) confirms:

  1. Exactly one returns true (the winner)
  2. The final file content matches one specific writer's value
  3. The directory has only exclusive.json (no orphaned temp files)

That last assertion is the cleanup check, which catches the finally block actually running.

What I verified locally

  • pnpm turbo run build --filter @workflow/world-local
  • pnpm --filter @workflow/world-local test ✓ (368 tests pass)
  • Reverted the fix and confirmed the new partial-visibility test fails as expected → restored the fix, all green

CI

5 failures, all pre-existing on main's baseline:

  • Vercel Prod E2E (nextjs-turbopack, hono, fastify) — same flakes seen on main's recent runs
  • Local Postgres canary (nextjs-turbopack) — Next.js canary tracks; the latest main canary baseline shows similar instability
  • E2E Required Check — cascading

Nothing PR-specific.

One defensive nit (non-blocker, inline)

Copilot caught a small defensive-coding miss: the finally block unconditionally unlinks tempPath, but if the fs.writeFile(tempPath, ..., { flag: 'wx' }) itself fails with EEXIST (vanishingly rare ULID collision or a stale temp from a crashed process), the unlink would delete someone else's temp file. The existing write() function already handles this with a tempFileCreated flag — same pattern would close the gap here. Inline comment with the snippet.

Practical risk is essentially zero (2^-40 collision probability), but matching the surrounding pattern is essentially free.

Bottom line

Solid fix for a real race that surfaces as SyntaxError: Unexpected end of JSON input in production. The hard-link-after-write pattern is the canonical atomic-publish primitive for "first writer wins" semantics on POSIX filesystems.

Approving.

Comment threadpackages/world-local/src/fs.ts Outdated
@pranaygp
pranaygp merged commit 867e339 into mainJun 8, 2026
34 of 58 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Jun 8, 2026
github-actionsBot added a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2299. Merge conflicts were resolved by AI — please review carefully. (backport job run)

pranaygp pushed a commit that referenced this pull request Jun 8, 2026
* fix(world-local): publish exclusive files atomically
* fix(world-local): guard temp cleanup
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pranaygp added a commit that referenced this pull request Jun 11, 2026
…-attributes-client
* origin/main: (32 commits)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
[world-vercel] Validate ref resolve responses before use (#2035)
fix: bump devalue to 5.8.1 (#2292)
Handle lazy stream key request failures (#2257)
fix(docs): declare Nitro auto-import globals for code samples (#2290)
[core] Preserve event-log order in hook-vs-sleep replay races (#2171) (#2185)
docs: add nitro changelog (#2232)
fix(next): always apply turbopack content condition regardless of builder mode (#2253)
Update @vercel/queue from 0.2.1 to 0.3.0 (#2255)
[nest] Use AST-based CommonJS import rewriting (#2080)
...
# Conflicts:
#	packages/world-local/src/storage/events-storage.ts
pranaygp added a commit that referenced this pull request Jun 11, 2026
…hook-ready
* origin-https/main: (119 commits)
fix: settle aborted parallel steps before completing abortParallelWorkflow (#2244)
Add native v4 workflow attribute events (#2226)
Version Packages (beta) (#2326)
[ci] Fix flaky windows unit tests (#2359)
Capture Vercel runtime logs when e2e Vercel Prod lanes fail (#2356)
Fix e2e failure reporting under vitest 4 and preserve fetch error causes (#2355)
[core] Fix process crash from rejected waitUntil promises (#2336)
[core] Remove duplicate `waitUntil` for suspension handler async operations (#2345)
Prevent local tests from hanging (#2338)
feat(core): add optional namespace for queue topic prefix (#2305)
[web-shared] Show precise durations in the new trace viewer (#2335)
Validate unique workflow step IDs at build time (#2018)
Move run attributes into their own detail card (#2327)
[core] Forward-port stream reconnect to getReadable level (#2318)
[docs] Add "Step executed multiple times" error page (#2310)
Fix flickering on the detail panel when navigating the trace viewer (#2325)
Version Packages (beta) (#2254)
Patch vulnerable package dependencies (#2301)
Deprecate DurableAgent and update it with WorkflowAgent in v5 docs (#2285)
[codex] Fix partial world-local exclusive writes (#2296)
...
# Conflicts:
#	packages/core/src/runtime.ts
#	packages/core/src/runtime/suspension-handler.ts
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.

3 participants

@pranaygp@TooTallNate