Skip to content

[core] Ensure open stream flush is await-able in pendingOps - #1446

Merged
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op
Mar 20, 2026
Merged

[core] Ensure open stream flush is await-able in pendingOps#1446
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 18, 2026

Copy link
Copy Markdown
Member

Stream tests seemed slightly flaky, and I suspect it might be partially because the 10ms buffer on streams wasn't await-able.

VaguelySeriousand others added 3 commits March 18, 2026 13:20
WorkflowServerWritableStream buffers writes and flushes via a 10ms
setTimeout for batching. The write() callback returned immediately
after buffering, causing flushablePipe's pendingOps counter to reach 0
before data actually reached the server via the deferred HTTP flush.
Fix: write() now returns a promise that resolves only after the
scheduled flush completes. Multiple writes within the 10ms window
still share a single batched flush — the batching optimization is
preserved. Each write's promise resolves when the batch's HTTP
round-trip finishes, so pendingOps accurately reflects server state.
This is implemented via a flushWaiters array: each write() pushes
a {resolve, reject} pair. When the setTimeout fires and flush()
completes, all waiters are resolved (or rejected on error).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b5d85b

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production758067825
✅ 💻 Local Development7820118900
✅ 📦 Local Production7820118900
✅ 🐘 Local Postgres7820118900
✅ 🪟 Windows720375
❌ 🌍 Community Worlds1185615189
✅ 📋 Other198027225
Total3492564664014

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6807
✅ example6807
✅ express6807
✅ fastify6807
✅ hono6807
✅ nextjs-turbopack7302
✅ nextjs-webpack7302
✅ nitro6807
✅ nuxt6807
✅ sveltekit6807
✅ vite6807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7203
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5233
✅ redis-dev302
❌ redis5323
✅ turso-dev302
❌ turso4513
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6609
✅ e2e-local-postgres-nest-stable6609
✅ e2e-local-prod-nest-stable6609

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.045s (+12.6% 🔺)1.006s (~)0.961s101.00x
💻 LocalNitro0.046s (+8.1% 🔺)1.006s (~)0.959s101.04x
🐘 PostgresExpress0.048s (-23.1% 🟢)1.011s (~)0.963s101.07x
💻 LocalNext.js (Turbopack)0.048s1.006s0.957s101.08x
🌐 RedisNext.js (Turbopack)0.054s (-4.6%)1.005s (~)0.951s101.22x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.952s101.33x
🐘 PostgresNitro0.060s (-6.1% 🟢)1.011s (~)0.951s101.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.523s (+13.6% 🔺)2.432s (+15.0% 🔺)1.909s101.00x
▲ VercelNext.js (Turbopack)0.531s (-28.0% 🟢)2.621s (-3.9%)2.089s101.02x
▲ VercelExpress0.621s (+13.0% 🔺)2.469s (+6.4% 🔺)1.849s101.19x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.113s2.005s0.892s101.00x
🐘 PostgresExpress1.115s (-2.8%)2.012s (~)0.898s101.00x
🌐 RedisNext.js (Turbopack)1.124s (~)2.007s (~)0.883s101.01x
💻 LocalExpress1.135s (+3.3%)2.006s (~)0.871s101.02x
💻 LocalNitro1.140s (+0.9%)2.007s (~)0.867s101.02x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.03x
🐘 PostgresNitro1.151s (~)2.013s (~)0.863s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.072s (-3.7%)3.619s (-4.4%)1.547s101.00x
▲ VercelNitro2.194s (+6.9% 🔺)3.819s (+18.7% 🔺)1.625s101.06x
▲ VercelExpress2.719s (+28.7% 🔺)4.291s (+16.6% 🔺)1.572s101.31x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.761s (-1.7%)11.042s (~)0.281s31.00x
🌐 RedisNext.js (Turbopack)10.765s (~)11.022s (~)0.257s31.00x
💻 LocalNext.js (Turbopack)10.776s11.023s0.247s31.00x
💻 LocalExpress10.908s (+2.4%)11.023s (~)0.115s31.01x
🐘 PostgresNitro10.947s (~)11.041s (~)0.094s31.02x
🐘 PostgresNext.js (Turbopack)10.947s11.374s0.426s31.02x
💻 LocalNitro10.948s (~)11.024s (~)0.076s31.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.128s (-1.0%)19.146s (+1.9%)2.019s21.00x
▲ VercelNext.js (Turbopack)17.854s (+5.2% 🔺)19.361s (+3.5%)1.507s21.04x
▲ VercelNitro17.919s (+1.5%)20.020s (+8.2% 🔺)2.101s21.05x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.618s (-2.2%)27.053s (-3.6%)0.434s31.00x
🌐 RedisNext.js (Turbopack)26.899s (~)27.386s (+1.2%)0.487s31.01x
💻 LocalNext.js (Turbopack)27.178s28.053s0.875s31.02x
🐘 PostgresNitro27.194s (~)28.061s (~)0.867s31.02x
🐘 PostgresNext.js (Turbopack)27.223s28.065s0.842s31.02x
💻 LocalExpress27.472s (+2.5%)28.052s (+3.7%)0.580s31.03x
💻 LocalNitro27.562s (~)28.055s (~)0.493s31.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro44.575s (-1.1%)45.973s (-0.8%)1.398s21.00x
▲ VercelExpress44.762s (~)46.273s (~)1.511s21.00x
▲ VercelNext.js (Turbopack)45.453s (+1.0%)47.201s (~)1.748s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express53.172s (-2.1%)54.095s (-1.8%)0.924s21.00x
🌐 RedisNext.js (Turbopack)53.654s (~)54.095s (~)0.440s21.01x
🐘 PostgresNext.js (Turbopack)53.995s54.104s0.109s21.02x
🐘 PostgresNitro54.279s (~)55.101s (~)0.823s21.02x
💻 LocalNext.js (Turbopack)55.916s56.101s0.185s21.05x
💻 LocalExpress56.606s (+2.9%)57.100s (+3.6%)0.494s21.06x
💻 LocalNitro56.653s (~)57.100s (~)0.447s21.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)95.438s (~)96.638s (~)1.200s11.00x
▲ VercelExpress95.831s (~)97.331s (~)1.500s11.00x
▲ VercelNitro96.484s (-7.4% 🟢)98.789s (-6.2% 🟢)2.305s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.219s (-4.6%)2.011s (~)0.793s151.00x
🐘 PostgresNext.js (Turbopack)1.255s2.012s0.756s151.03x
🐘 PostgresNitro1.271s (-0.5%)2.011s (~)0.740s151.04x
🌐 RedisNext.js (Turbopack)1.377s (~)2.006s (~)0.629s151.13x
💻 LocalExpress1.501s (+3.0%)2.006s (~)0.505s151.23x
💻 LocalNitro1.504s (-1.3%)2.006s (~)0.501s151.23x
💻 LocalNext.js (Turbopack)1.506s2.005s0.499s151.24x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.530s (+3.5%)3.846s (-4.0%)1.315s81.00x
▲ VercelExpress2.551s (+6.5% 🔺)4.030s (+7.1% 🔺)1.479s81.01x
▲ VercelNitro3.324s (+36.8% 🔺)4.916s (+46.9% 🔺)1.591s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.355s (-4.0%)3.012s (~)0.656s101.00x
🐘 PostgresNitro2.448s (-0.6%)3.013s (~)0.566s101.04x
🐘 PostgresNext.js (Turbopack)2.478s3.013s0.535s101.05x
🌐 RedisNext.js (Turbopack)2.566s (~)3.008s (~)0.442s101.09x
💻 LocalNext.js (Turbopack)2.704s3.007s0.303s101.15x
💻 LocalNitro2.972s (+3.6%)3.453s (+14.8% 🔺)0.481s91.26x
💻 LocalExpress3.083s (+18.5% 🔺)3.759s (+25.0% 🔺)0.675s81.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.515s (-6.4% 🟢)3.967s (+9.3% 🔺)1.452s81.00x
▲ VercelExpress2.639s (+10.8% 🔺)3.859s (-0.5%)1.219s81.05x
▲ VercelNext.js (Turbopack)2.743s (+8.6% 🔺)3.982s (-0.7%)1.239s81.09x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.495s (-2.9%)4.013s (~)0.518s81.00x
🐘 PostgresNitro3.588s (-0.7%)4.014s (~)0.426s81.03x
🐘 PostgresNext.js (Turbopack)3.755s4.015s0.260s81.07x
🌐 RedisNext.js (Turbopack)4.154s (+1.0%)5.012s (+2.9%)0.859s61.19x
💻 LocalNext.js (Turbopack)7.150s7.619s0.469s52.05x
💻 LocalNitro8.043s (-0.7%)8.519s (-5.6% 🟢)0.477s42.30x
💻 LocalExpress8.175s (+20.4% 🔺)8.773s (+25.1% 🔺)0.598s42.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.846s (-45.3% 🟢)4.390s (-34.4% 🟢)1.544s71.00x
▲ VercelNitro3.000s (+10.8% 🔺)4.414s (+13.3% 🔺)1.415s71.05x
▲ VercelNext.js (Turbopack)3.349s (+8.6% 🔺)4.966s (+5.9% 🔺)1.616s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.214s (-4.8%)2.010s (~)0.796s151.00x
🐘 PostgresNitro1.258s (-1.2%)2.011s (~)0.753s151.04x
🐘 PostgresNext.js (Turbopack)1.271s2.011s0.740s151.05x
🌐 RedisNext.js (Turbopack)1.279s (-2.4%)2.006s (~)0.728s151.05x
💻 LocalExpress1.512s (+3.3%)2.005s (~)0.494s151.25x
💻 LocalNitro1.528s (~)2.005s (~)0.477s151.26x
💻 LocalNext.js (Turbopack)1.571s2.073s0.502s151.29x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.206s (-5.2% 🟢)3.634s (-4.2%)1.428s91.00x
▲ VercelNitro2.208s (-18.1% 🟢)3.876s (-2.4%)1.669s81.00x
▲ VercelExpress2.231s (-1.9%)3.675s (-3.0%)1.444s91.01x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.337s (-4.8%)3.010s (~)0.673s101.00x
🐘 PostgresNitro2.447s (~)3.012s (~)0.565s101.05x
🐘 PostgresNext.js (Turbopack)2.494s3.012s0.518s101.07x
🌐 RedisNext.js (Turbopack)2.569s (+0.7%)3.008s (~)0.439s101.10x
💻 LocalNext.js (Turbopack)2.924s3.678s0.753s91.25x
💻 LocalNitro2.981s (~)3.454s (~)0.473s91.28x
💻 LocalExpress3.046s (+10.0% 🔺)3.760s (+21.0% 🔺)0.714s81.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.366s (-7.7% 🟢)4.048s (+11.8% 🔺)1.683s81.00x
▲ VercelExpress2.487s (+7.7% 🔺)3.979s (+8.6% 🔺)1.492s81.05x
▲ VercelNext.js (Turbopack)2.878s (-2.6%)4.150s (-4.1%)1.272s81.22x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.502s (-2.5%)4.014s (~)0.513s81.00x
🐘 PostgresNitro3.580s (-0.6%)4.015s (~)0.435s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.015s0.247s81.08x
🌐 RedisNext.js (Turbopack)4.191s (+0.7%)4.725s (-2.9%)0.534s71.20x
💻 LocalNitro8.503s (-0.7%)9.023s (~)0.520s42.43x
💻 LocalExpress8.588s (+18.5% 🔺)9.023s (+16.2% 🔺)0.435s42.45x
💻 LocalNext.js (Turbopack)8.697s9.018s0.320s42.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.942s (+11.3% 🔺)4.442s (+18.0% 🔺)1.499s71.00x
▲ VercelNitro3.719s (+1.1%)5.269s (+7.9% 🔺)1.550s61.26x
▲ VercelNext.js (Turbopack)3.749s (+16.6% 🔺)5.463s (+18.2% 🔺)1.714s61.27x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.159s (-28.2% 🟢)1.000s (+0.8%)0.001s (-18.8% 🟢)1.011s (~)0.853s101.00x
🌐 RedisNext.js (Turbopack)0.187s (+2.9%)1.000s (~)0.002s (-11.8% 🟢)1.007s (~)0.820s101.18x
💻 LocalNext.js (Turbopack)0.188s1.000s0.011s1.017s0.830s101.18x
💻 LocalNitro0.197s (~)1.003s (~)0.012s (~)1.017s (~)0.820s101.24x
💻 LocalExpress0.199s (+43.6% 🔺)1.003s (~)0.012s (+11.5% 🔺)1.017s (~)0.819s101.25x
🐘 PostgresNext.js (Turbopack)0.217s1.002s0.002s1.014s0.797s101.37x
🐘 PostgresNitro0.224s (+2.8%)0.995s (-0.5%)0.001s (-6.7% 🟢)1.013s (~)0.789s101.41x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro1.627s (~)2.396s (~)0.668s (+12979.3% 🔺)3.690s (-75.2% 🟢)2.063s101.00x
▲ VercelExpress1.636s (+1.0%)2.438s (-12.3% 🟢)0.653s (+14413.3% 🔺)3.686s (+10.6% 🔺)2.050s101.00x
▲ VercelNext.js (Turbopack)1.747s (+8.7% 🔺)3.071s (+20.1% 🔺)0.398s (+1897.5% 🔺)4.149s (+32.7% 🔺)2.402s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresExpress12/12
▲ VercelNitro5/12
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

VaguelySeriousand others added 2 commits March 18, 2026 13:26
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Restore and update test coverage that was reduced in the initial change.
The test suite now covers 15 scenarios (up from 9):
Flush-on-write behavior:
- write() resolves only after data reaches server
- Single chunk uses writeToStream (not writeToStreamMulti)
- Falls back to sequential writes when writeToStreamMulti unavailable
- Multiple sequential writes trigger separate flush cycles
- Concurrent writes wait for in-progress flush before buffering
Close behavior:
- closeStream called on close
- Remaining buffer flushed on close
- Empty buffer on close skips write methods
Abort & error handling:
- Abort discards buffer and skips closeStream
- Write errors propagate to caller
- Close errors propagate to caller
- Flush errors during write propagate to caller
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@vercelvercelBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

The abort() handler in BufferedWritableStream clears the flush timer but never settles the flushWaiters promises, causing the internal write() async function to hang forever on an unsettled promise.

Fix on Vercel

@@ -0,0 +1,15 @@
---
title: Changelog

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a stub so we can add changelog entries for bigger changes later

Comment thread.github/CODEOWNERS
* @vercel/workflow

packages/next/ @ijjk @vercel/workflow
packages/next/src @ijjk @vercel/workflow

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This ensures JJ doesn't get accidentally tagged on every release PR when only changesets change

@VaguelySerious
VaguelySerious marked this pull request as ready for review March 18, 2026 21:17
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 18, 2026 21:17
…sh timer but never settles the `flushWaiters` promises, causing the internal `write()` async function to hang forever on an unsettled promise.
This commit fixes the issue reported at packages/core/src/serialization.ts:560
**Bug explanation:**
In `BufferedWritableStream`, the `write()` method (line 530) pushes chunks to a buffer, schedules a flush via a timer, and then awaits a promise that is added to `flushWaiters` (line 545):
```js
await new Promise<void>((resolve, reject) => {
flushWaiters.push({ resolve, reject });
});
```
Normally, when the flush timer fires (line 514), it captures `flushWaiters`, replaces it with a fresh array, calls `flush()`, and then resolves or rejects the captured waiters based on the flush result.
When `abort()` is called (line 560), it:
1. Clears the flush timer (preventing the timer callback from ever running)
2. Discards the buffer
But it does NOT settle the promises in `flushWaiters`. Since the timer that would have resolved/rejected those waiters has been cleared, and nothing else references them, those promises will **never settle**. The internal async function of `write()` is suspended at the `await` on line 545 and will remain suspended forever - it becomes a memory leak. The closures captured by those async functions (referencing `buffer`, `flushWaiters`, the world object, etc.) will also be retained in memory.
While the WritableStream infrastructure will reject the external write promise returned to consumers, the *internal* async function body doesn't get cancelled - JavaScript has no mechanism to cancel a suspended async function. It will hang indefinitely on the unsettled promise.
**Fix explanation:**
The fix adds code to the `abort()` handler to reject all pending `flushWaiters` before clearing the array. It:
1. Captures the current `flushWaiters` into a local variable
2. Replaces `flushWaiters` with an empty array (same pattern used in the timer callback)
3. Rejects each waiter with the abort reason (or a default "Stream aborted" error)
This ensures the `write()` async functions' awaited promises settle (with rejection), allowing those async functions to complete and their closures to be garbage collected. The rejection from `w.reject()` will propagate up through the `write()` function, but since the stream is already being aborted, this is the correct behavior.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
@VaguelySerious
VaguelySerious merged commit 2b07294 into mainMar 20, 2026
165 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/stream-flush-op branch March 20, 2026 20:28
@ghostghost mentioned this pull request Mar 20, 2026
VaguelySerious added a commit that referenced this pull request Mar 20, 2026
…hods
Merge main into peter/step-optional, resolving conflicts in the Streamer
interface, world-local streamer, world-postgres streamer, and writable
stream tests. Incorporates negative startIndex support from main (#1460)
and pendingOps flush behavior (#1446) into the namespaced streams API.
Additionally swaps argument order so runId is always the first parameter
for all stream methods: write, writeMulti, close, get, and list. Updates
all implementations (local, postgres, vercel), callers (serialization,
runtime, CLI, web), tests, and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

[core] Ensure open stream flush is await-able in pendingOps - #1446

Merged
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op
Mar 20, 2026
Merged

[core] Ensure open stream flush is await-able in pendingOps#1446
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 18, 2026

Copy link
Copy Markdown
Member

Stream tests seemed slightly flaky, and I suspect it might be partially because the 10ms buffer on streams wasn't await-able.

VaguelySeriousand others added 3 commits March 18, 2026 13:20
WorkflowServerWritableStream buffers writes and flushes via a 10ms
setTimeout for batching. The write() callback returned immediately
after buffering, causing flushablePipe's pendingOps counter to reach 0
before data actually reached the server via the deferred HTTP flush.
Fix: write() now returns a promise that resolves only after the
scheduled flush completes. Multiple writes within the 10ms window
still share a single batched flush — the batching optimization is
preserved. Each write's promise resolves when the batch's HTTP
round-trip finishes, so pendingOps accurately reflects server state.
This is implemented via a flushWaiters array: each write() pushes
a {resolve, reject} pair. When the setTimeout fires and flush()
completes, all waiters are resolved (or rejected on error).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b5d85b

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production758067825
✅ 💻 Local Development7820118900
✅ 📦 Local Production7820118900
✅ 🐘 Local Postgres7820118900
✅ 🪟 Windows720375
❌ 🌍 Community Worlds1185615189
✅ 📋 Other198027225
Total3492564664014

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6807
✅ example6807
✅ express6807
✅ fastify6807
✅ hono6807
✅ nextjs-turbopack7302
✅ nextjs-webpack7302
✅ nitro6807
✅ nuxt6807
✅ sveltekit6807
✅ vite6807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7203
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5233
✅ redis-dev302
❌ redis5323
✅ turso-dev302
❌ turso4513
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6609
✅ e2e-local-postgres-nest-stable6609
✅ e2e-local-prod-nest-stable6609

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.045s (+12.6% 🔺)1.006s (~)0.961s101.00x
💻 LocalNitro0.046s (+8.1% 🔺)1.006s (~)0.959s101.04x
🐘 PostgresExpress0.048s (-23.1% 🟢)1.011s (~)0.963s101.07x
💻 LocalNext.js (Turbopack)0.048s1.006s0.957s101.08x
🌐 RedisNext.js (Turbopack)0.054s (-4.6%)1.005s (~)0.951s101.22x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.952s101.33x
🐘 PostgresNitro0.060s (-6.1% 🟢)1.011s (~)0.951s101.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.523s (+13.6% 🔺)2.432s (+15.0% 🔺)1.909s101.00x
▲ VercelNext.js (Turbopack)0.531s (-28.0% 🟢)2.621s (-3.9%)2.089s101.02x
▲ VercelExpress0.621s (+13.0% 🔺)2.469s (+6.4% 🔺)1.849s101.19x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.113s2.005s0.892s101.00x
🐘 PostgresExpress1.115s (-2.8%)2.012s (~)0.898s101.00x
🌐 RedisNext.js (Turbopack)1.124s (~)2.007s (~)0.883s101.01x
💻 LocalExpress1.135s (+3.3%)2.006s (~)0.871s101.02x
💻 LocalNitro1.140s (+0.9%)2.007s (~)0.867s101.02x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.03x
🐘 PostgresNitro1.151s (~)2.013s (~)0.863s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.072s (-3.7%)3.619s (-4.4%)1.547s101.00x
▲ VercelNitro2.194s (+6.9% 🔺)3.819s (+18.7% 🔺)1.625s101.06x
▲ VercelExpress2.719s (+28.7% 🔺)4.291s (+16.6% 🔺)1.572s101.31x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.761s (-1.7%)11.042s (~)0.281s31.00x
🌐 RedisNext.js (Turbopack)10.765s (~)11.022s (~)0.257s31.00x
💻 LocalNext.js (Turbopack)10.776s11.023s0.247s31.00x
💻 LocalExpress10.908s (+2.4%)11.023s (~)0.115s31.01x
🐘 PostgresNitro10.947s (~)11.041s (~)0.094s31.02x
🐘 PostgresNext.js (Turbopack)10.947s11.374s0.426s31.02x
💻 LocalNitro10.948s (~)11.024s (~)0.076s31.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.128s (-1.0%)19.146s (+1.9%)2.019s21.00x
▲ VercelNext.js (Turbopack)17.854s (+5.2% 🔺)19.361s (+3.5%)1.507s21.04x
▲ VercelNitro17.919s (+1.5%)20.020s (+8.2% 🔺)2.101s21.05x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.618s (-2.2%)27.053s (-3.6%)0.434s31.00x
🌐 RedisNext.js (Turbopack)26.899s (~)27.386s (+1.2%)0.487s31.01x
💻 LocalNext.js (Turbopack)27.178s28.053s0.875s31.02x
🐘 PostgresNitro27.194s (~)28.061s (~)0.867s31.02x
🐘 PostgresNext.js (Turbopack)27.223s28.065s0.842s31.02x
💻 LocalExpress27.472s (+2.5%)28.052s (+3.7%)0.580s31.03x
💻 LocalNitro27.562s (~)28.055s (~)0.493s31.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro44.575s (-1.1%)45.973s (-0.8%)1.398s21.00x
▲ VercelExpress44.762s (~)46.273s (~)1.511s21.00x
▲ VercelNext.js (Turbopack)45.453s (+1.0%)47.201s (~)1.748s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express53.172s (-2.1%)54.095s (-1.8%)0.924s21.00x
🌐 RedisNext.js (Turbopack)53.654s (~)54.095s (~)0.440s21.01x
🐘 PostgresNext.js (Turbopack)53.995s54.104s0.109s21.02x
🐘 PostgresNitro54.279s (~)55.101s (~)0.823s21.02x
💻 LocalNext.js (Turbopack)55.916s56.101s0.185s21.05x
💻 LocalExpress56.606s (+2.9%)57.100s (+3.6%)0.494s21.06x
💻 LocalNitro56.653s (~)57.100s (~)0.447s21.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)95.438s (~)96.638s (~)1.200s11.00x
▲ VercelExpress95.831s (~)97.331s (~)1.500s11.00x
▲ VercelNitro96.484s (-7.4% 🟢)98.789s (-6.2% 🟢)2.305s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.219s (-4.6%)2.011s (~)0.793s151.00x
🐘 PostgresNext.js (Turbopack)1.255s2.012s0.756s151.03x
🐘 PostgresNitro1.271s (-0.5%)2.011s (~)0.740s151.04x
🌐 RedisNext.js (Turbopack)1.377s (~)2.006s (~)0.629s151.13x
💻 LocalExpress1.501s (+3.0%)2.006s (~)0.505s151.23x
💻 LocalNitro1.504s (-1.3%)2.006s (~)0.501s151.23x
💻 LocalNext.js (Turbopack)1.506s2.005s0.499s151.24x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.530s (+3.5%)3.846s (-4.0%)1.315s81.00x
▲ VercelExpress2.551s (+6.5% 🔺)4.030s (+7.1% 🔺)1.479s81.01x
▲ VercelNitro3.324s (+36.8% 🔺)4.916s (+46.9% 🔺)1.591s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.355s (-4.0%)3.012s (~)0.656s101.00x
🐘 PostgresNitro2.448s (-0.6%)3.013s (~)0.566s101.04x
🐘 PostgresNext.js (Turbopack)2.478s3.013s0.535s101.05x
🌐 RedisNext.js (Turbopack)2.566s (~)3.008s (~)0.442s101.09x
💻 LocalNext.js (Turbopack)2.704s3.007s0.303s101.15x
💻 LocalNitro2.972s (+3.6%)3.453s (+14.8% 🔺)0.481s91.26x
💻 LocalExpress3.083s (+18.5% 🔺)3.759s (+25.0% 🔺)0.675s81.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.515s (-6.4% 🟢)3.967s (+9.3% 🔺)1.452s81.00x
▲ VercelExpress2.639s (+10.8% 🔺)3.859s (-0.5%)1.219s81.05x
▲ VercelNext.js (Turbopack)2.743s (+8.6% 🔺)3.982s (-0.7%)1.239s81.09x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.495s (-2.9%)4.013s (~)0.518s81.00x
🐘 PostgresNitro3.588s (-0.7%)4.014s (~)0.426s81.03x
🐘 PostgresNext.js (Turbopack)3.755s4.015s0.260s81.07x
🌐 RedisNext.js (Turbopack)4.154s (+1.0%)5.012s (+2.9%)0.859s61.19x
💻 LocalNext.js (Turbopack)7.150s7.619s0.469s52.05x
💻 LocalNitro8.043s (-0.7%)8.519s (-5.6% 🟢)0.477s42.30x
💻 LocalExpress8.175s (+20.4% 🔺)8.773s (+25.1% 🔺)0.598s42.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.846s (-45.3% 🟢)4.390s (-34.4% 🟢)1.544s71.00x
▲ VercelNitro3.000s (+10.8% 🔺)4.414s (+13.3% 🔺)1.415s71.05x
▲ VercelNext.js (Turbopack)3.349s (+8.6% 🔺)4.966s (+5.9% 🔺)1.616s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.214s (-4.8%)2.010s (~)0.796s151.00x
🐘 PostgresNitro1.258s (-1.2%)2.011s (~)0.753s151.04x
🐘 PostgresNext.js (Turbopack)1.271s2.011s0.740s151.05x
🌐 RedisNext.js (Turbopack)1.279s (-2.4%)2.006s (~)0.728s151.05x
💻 LocalExpress1.512s (+3.3%)2.005s (~)0.494s151.25x
💻 LocalNitro1.528s (~)2.005s (~)0.477s151.26x
💻 LocalNext.js (Turbopack)1.571s2.073s0.502s151.29x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.206s (-5.2% 🟢)3.634s (-4.2%)1.428s91.00x
▲ VercelNitro2.208s (-18.1% 🟢)3.876s (-2.4%)1.669s81.00x
▲ VercelExpress2.231s (-1.9%)3.675s (-3.0%)1.444s91.01x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.337s (-4.8%)3.010s (~)0.673s101.00x
🐘 PostgresNitro2.447s (~)3.012s (~)0.565s101.05x
🐘 PostgresNext.js (Turbopack)2.494s3.012s0.518s101.07x
🌐 RedisNext.js (Turbopack)2.569s (+0.7%)3.008s (~)0.439s101.10x
💻 LocalNext.js (Turbopack)2.924s3.678s0.753s91.25x
💻 LocalNitro2.981s (~)3.454s (~)0.473s91.28x
💻 LocalExpress3.046s (+10.0% 🔺)3.760s (+21.0% 🔺)0.714s81.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.366s (-7.7% 🟢)4.048s (+11.8% 🔺)1.683s81.00x
▲ VercelExpress2.487s (+7.7% 🔺)3.979s (+8.6% 🔺)1.492s81.05x
▲ VercelNext.js (Turbopack)2.878s (-2.6%)4.150s (-4.1%)1.272s81.22x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.502s (-2.5%)4.014s (~)0.513s81.00x
🐘 PostgresNitro3.580s (-0.6%)4.015s (~)0.435s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.015s0.247s81.08x
🌐 RedisNext.js (Turbopack)4.191s (+0.7%)4.725s (-2.9%)0.534s71.20x
💻 LocalNitro8.503s (-0.7%)9.023s (~)0.520s42.43x
💻 LocalExpress8.588s (+18.5% 🔺)9.023s (+16.2% 🔺)0.435s42.45x
💻 LocalNext.js (Turbopack)8.697s9.018s0.320s42.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.942s (+11.3% 🔺)4.442s (+18.0% 🔺)1.499s71.00x
▲ VercelNitro3.719s (+1.1%)5.269s (+7.9% 🔺)1.550s61.26x
▲ VercelNext.js (Turbopack)3.749s (+16.6% 🔺)5.463s (+18.2% 🔺)1.714s61.27x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.159s (-28.2% 🟢)1.000s (+0.8%)0.001s (-18.8% 🟢)1.011s (~)0.853s101.00x
🌐 RedisNext.js (Turbopack)0.187s (+2.9%)1.000s (~)0.002s (-11.8% 🟢)1.007s (~)0.820s101.18x
💻 LocalNext.js (Turbopack)0.188s1.000s0.011s1.017s0.830s101.18x
💻 LocalNitro0.197s (~)1.003s (~)0.012s (~)1.017s (~)0.820s101.24x
💻 LocalExpress0.199s (+43.6% 🔺)1.003s (~)0.012s (+11.5% 🔺)1.017s (~)0.819s101.25x
🐘 PostgresNext.js (Turbopack)0.217s1.002s0.002s1.014s0.797s101.37x
🐘 PostgresNitro0.224s (+2.8%)0.995s (-0.5%)0.001s (-6.7% 🟢)1.013s (~)0.789s101.41x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro1.627s (~)2.396s (~)0.668s (+12979.3% 🔺)3.690s (-75.2% 🟢)2.063s101.00x
▲ VercelExpress1.636s (+1.0%)2.438s (-12.3% 🟢)0.653s (+14413.3% 🔺)3.686s (+10.6% 🔺)2.050s101.00x
▲ VercelNext.js (Turbopack)1.747s (+8.7% 🔺)3.071s (+20.1% 🔺)0.398s (+1897.5% 🔺)4.149s (+32.7% 🔺)2.402s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresExpress12/12
▲ VercelNitro5/12
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

VaguelySeriousand others added 2 commits March 18, 2026 13:26
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Restore and update test coverage that was reduced in the initial change.
The test suite now covers 15 scenarios (up from 9):
Flush-on-write behavior:
- write() resolves only after data reaches server
- Single chunk uses writeToStream (not writeToStreamMulti)
- Falls back to sequential writes when writeToStreamMulti unavailable
- Multiple sequential writes trigger separate flush cycles
- Concurrent writes wait for in-progress flush before buffering
Close behavior:
- closeStream called on close
- Remaining buffer flushed on close
- Empty buffer on close skips write methods
Abort & error handling:
- Abort discards buffer and skips closeStream
- Write errors propagate to caller
- Close errors propagate to caller
- Flush errors during write propagate to caller
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@vercelvercelBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

The abort() handler in BufferedWritableStream clears the flush timer but never settles the flushWaiters promises, causing the internal write() async function to hang forever on an unsettled promise.

Fix on Vercel

@@ -0,0 +1,15 @@
---
title: Changelog

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a stub so we can add changelog entries for bigger changes later

Comment thread.github/CODEOWNERS
* @vercel/workflow

packages/next/ @ijjk @vercel/workflow
packages/next/src @ijjk @vercel/workflow

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This ensures JJ doesn't get accidentally tagged on every release PR when only changesets change

@VaguelySerious
VaguelySerious marked this pull request as ready for review March 18, 2026 21:17
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 18, 2026 21:17
…sh timer but never settles the `flushWaiters` promises, causing the internal `write()` async function to hang forever on an unsettled promise.
This commit fixes the issue reported at packages/core/src/serialization.ts:560
**Bug explanation:**
In `BufferedWritableStream`, the `write()` method (line 530) pushes chunks to a buffer, schedules a flush via a timer, and then awaits a promise that is added to `flushWaiters` (line 545):
```js
await new Promise<void>((resolve, reject) => {
flushWaiters.push({ resolve, reject });
});
```
Normally, when the flush timer fires (line 514), it captures `flushWaiters`, replaces it with a fresh array, calls `flush()`, and then resolves or rejects the captured waiters based on the flush result.
When `abort()` is called (line 560), it:
1. Clears the flush timer (preventing the timer callback from ever running)
2. Discards the buffer
But it does NOT settle the promises in `flushWaiters`. Since the timer that would have resolved/rejected those waiters has been cleared, and nothing else references them, those promises will **never settle**. The internal async function of `write()` is suspended at the `await` on line 545 and will remain suspended forever - it becomes a memory leak. The closures captured by those async functions (referencing `buffer`, `flushWaiters`, the world object, etc.) will also be retained in memory.
While the WritableStream infrastructure will reject the external write promise returned to consumers, the *internal* async function body doesn't get cancelled - JavaScript has no mechanism to cancel a suspended async function. It will hang indefinitely on the unsettled promise.
**Fix explanation:**
The fix adds code to the `abort()` handler to reject all pending `flushWaiters` before clearing the array. It:
1. Captures the current `flushWaiters` into a local variable
2. Replaces `flushWaiters` with an empty array (same pattern used in the timer callback)
3. Rejects each waiter with the abort reason (or a default "Stream aborted" error)
This ensures the `write()` async functions' awaited promises settle (with rejection), allowing those async functions to complete and their closures to be garbage collected. The rejection from `w.reject()` will propagate up through the `write()` function, but since the stream is already being aborted, this is the correct behavior.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
@VaguelySerious
VaguelySerious merged commit 2b07294 into mainMar 20, 2026
165 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/stream-flush-op branch March 20, 2026 20:28
@ghostghost mentioned this pull request Mar 20, 2026
VaguelySerious added a commit that referenced this pull request Mar 20, 2026
…hods
Merge main into peter/step-optional, resolving conflicts in the Streamer
interface, world-local streamer, world-postgres streamer, and writable
stream tests. Incorporates negative startIndex support from main (#1460)
and pendingOps flush behavior (#1446) into the namespaced streams API.
Additionally swaps argument order so runId is always the first parameter
for all stream methods: write, writeMulti, close, get, and list. Updates
all implementations (local, postgres, vercel), callers (serialization,
runtime, CLI, web), tests, and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

[core] Ensure open stream flush is await-able in pendingOps - #1446

Merged
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op
Mar 20, 2026
Merged

[core] Ensure open stream flush is await-able in pendingOps#1446
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 18, 2026

Copy link
Copy Markdown
Member

Stream tests seemed slightly flaky, and I suspect it might be partially because the 10ms buffer on streams wasn't await-able.

VaguelySeriousand others added 3 commits March 18, 2026 13:20
WorkflowServerWritableStream buffers writes and flushes via a 10ms
setTimeout for batching. The write() callback returned immediately
after buffering, causing flushablePipe's pendingOps counter to reach 0
before data actually reached the server via the deferred HTTP flush.
Fix: write() now returns a promise that resolves only after the
scheduled flush completes. Multiple writes within the 10ms window
still share a single batched flush — the batching optimization is
preserved. Each write's promise resolves when the batch's HTTP
round-trip finishes, so pendingOps accurately reflects server state.
This is implemented via a flushWaiters array: each write() pushes
a {resolve, reject} pair. When the setTimeout fires and flush()
completes, all waiters are resolved (or rejected on error).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b5d85b

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production758067825
✅ 💻 Local Development7820118900
✅ 📦 Local Production7820118900
✅ 🐘 Local Postgres7820118900
✅ 🪟 Windows720375
❌ 🌍 Community Worlds1185615189
✅ 📋 Other198027225
Total3492564664014

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6807
✅ example6807
✅ express6807
✅ fastify6807
✅ hono6807
✅ nextjs-turbopack7302
✅ nextjs-webpack7302
✅ nitro6807
✅ nuxt6807
✅ sveltekit6807
✅ vite6807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7203
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5233
✅ redis-dev302
❌ redis5323
✅ turso-dev302
❌ turso4513
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6609
✅ e2e-local-postgres-nest-stable6609
✅ e2e-local-prod-nest-stable6609

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.045s (+12.6% 🔺)1.006s (~)0.961s101.00x
💻 LocalNitro0.046s (+8.1% 🔺)1.006s (~)0.959s101.04x
🐘 PostgresExpress0.048s (-23.1% 🟢)1.011s (~)0.963s101.07x
💻 LocalNext.js (Turbopack)0.048s1.006s0.957s101.08x
🌐 RedisNext.js (Turbopack)0.054s (-4.6%)1.005s (~)0.951s101.22x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.952s101.33x
🐘 PostgresNitro0.060s (-6.1% 🟢)1.011s (~)0.951s101.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.523s (+13.6% 🔺)2.432s (+15.0% 🔺)1.909s101.00x
▲ VercelNext.js (Turbopack)0.531s (-28.0% 🟢)2.621s (-3.9%)2.089s101.02x
▲ VercelExpress0.621s (+13.0% 🔺)2.469s (+6.4% 🔺)1.849s101.19x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.113s2.005s0.892s101.00x
🐘 PostgresExpress1.115s (-2.8%)2.012s (~)0.898s101.00x
🌐 RedisNext.js (Turbopack)1.124s (~)2.007s (~)0.883s101.01x
💻 LocalExpress1.135s (+3.3%)2.006s (~)0.871s101.02x
💻 LocalNitro1.140s (+0.9%)2.007s (~)0.867s101.02x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.03x
🐘 PostgresNitro1.151s (~)2.013s (~)0.863s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.072s (-3.7%)3.619s (-4.4%)1.547s101.00x
▲ VercelNitro2.194s (+6.9% 🔺)3.819s (+18.7% 🔺)1.625s101.06x
▲ VercelExpress2.719s (+28.7% 🔺)4.291s (+16.6% 🔺)1.572s101.31x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.761s (-1.7%)11.042s (~)0.281s31.00x
🌐 RedisNext.js (Turbopack)10.765s (~)11.022s (~)0.257s31.00x
💻 LocalNext.js (Turbopack)10.776s11.023s0.247s31.00x
💻 LocalExpress10.908s (+2.4%)11.023s (~)0.115s31.01x
🐘 PostgresNitro10.947s (~)11.041s (~)0.094s31.02x
🐘 PostgresNext.js (Turbopack)10.947s11.374s0.426s31.02x
💻 LocalNitro10.948s (~)11.024s (~)0.076s31.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.128s (-1.0%)19.146s (+1.9%)2.019s21.00x
▲ VercelNext.js (Turbopack)17.854s (+5.2% 🔺)19.361s (+3.5%)1.507s21.04x
▲ VercelNitro17.919s (+1.5%)20.020s (+8.2% 🔺)2.101s21.05x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.618s (-2.2%)27.053s (-3.6%)0.434s31.00x
🌐 RedisNext.js (Turbopack)26.899s (~)27.386s (+1.2%)0.487s31.01x
💻 LocalNext.js (Turbopack)27.178s28.053s0.875s31.02x
🐘 PostgresNitro27.194s (~)28.061s (~)0.867s31.02x
🐘 PostgresNext.js (Turbopack)27.223s28.065s0.842s31.02x
💻 LocalExpress27.472s (+2.5%)28.052s (+3.7%)0.580s31.03x
💻 LocalNitro27.562s (~)28.055s (~)0.493s31.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro44.575s (-1.1%)45.973s (-0.8%)1.398s21.00x
▲ VercelExpress44.762s (~)46.273s (~)1.511s21.00x
▲ VercelNext.js (Turbopack)45.453s (+1.0%)47.201s (~)1.748s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express53.172s (-2.1%)54.095s (-1.8%)0.924s21.00x
🌐 RedisNext.js (Turbopack)53.654s (~)54.095s (~)0.440s21.01x
🐘 PostgresNext.js (Turbopack)53.995s54.104s0.109s21.02x
🐘 PostgresNitro54.279s (~)55.101s (~)0.823s21.02x
💻 LocalNext.js (Turbopack)55.916s56.101s0.185s21.05x
💻 LocalExpress56.606s (+2.9%)57.100s (+3.6%)0.494s21.06x
💻 LocalNitro56.653s (~)57.100s (~)0.447s21.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)95.438s (~)96.638s (~)1.200s11.00x
▲ VercelExpress95.831s (~)97.331s (~)1.500s11.00x
▲ VercelNitro96.484s (-7.4% 🟢)98.789s (-6.2% 🟢)2.305s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.219s (-4.6%)2.011s (~)0.793s151.00x
🐘 PostgresNext.js (Turbopack)1.255s2.012s0.756s151.03x
🐘 PostgresNitro1.271s (-0.5%)2.011s (~)0.740s151.04x
🌐 RedisNext.js (Turbopack)1.377s (~)2.006s (~)0.629s151.13x
💻 LocalExpress1.501s (+3.0%)2.006s (~)0.505s151.23x
💻 LocalNitro1.504s (-1.3%)2.006s (~)0.501s151.23x
💻 LocalNext.js (Turbopack)1.506s2.005s0.499s151.24x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.530s (+3.5%)3.846s (-4.0%)1.315s81.00x
▲ VercelExpress2.551s (+6.5% 🔺)4.030s (+7.1% 🔺)1.479s81.01x
▲ VercelNitro3.324s (+36.8% 🔺)4.916s (+46.9% 🔺)1.591s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.355s (-4.0%)3.012s (~)0.656s101.00x
🐘 PostgresNitro2.448s (-0.6%)3.013s (~)0.566s101.04x
🐘 PostgresNext.js (Turbopack)2.478s3.013s0.535s101.05x
🌐 RedisNext.js (Turbopack)2.566s (~)3.008s (~)0.442s101.09x
💻 LocalNext.js (Turbopack)2.704s3.007s0.303s101.15x
💻 LocalNitro2.972s (+3.6%)3.453s (+14.8% 🔺)0.481s91.26x
💻 LocalExpress3.083s (+18.5% 🔺)3.759s (+25.0% 🔺)0.675s81.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.515s (-6.4% 🟢)3.967s (+9.3% 🔺)1.452s81.00x
▲ VercelExpress2.639s (+10.8% 🔺)3.859s (-0.5%)1.219s81.05x
▲ VercelNext.js (Turbopack)2.743s (+8.6% 🔺)3.982s (-0.7%)1.239s81.09x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.495s (-2.9%)4.013s (~)0.518s81.00x
🐘 PostgresNitro3.588s (-0.7%)4.014s (~)0.426s81.03x
🐘 PostgresNext.js (Turbopack)3.755s4.015s0.260s81.07x
🌐 RedisNext.js (Turbopack)4.154s (+1.0%)5.012s (+2.9%)0.859s61.19x
💻 LocalNext.js (Turbopack)7.150s7.619s0.469s52.05x
💻 LocalNitro8.043s (-0.7%)8.519s (-5.6% 🟢)0.477s42.30x
💻 LocalExpress8.175s (+20.4% 🔺)8.773s (+25.1% 🔺)0.598s42.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.846s (-45.3% 🟢)4.390s (-34.4% 🟢)1.544s71.00x
▲ VercelNitro3.000s (+10.8% 🔺)4.414s (+13.3% 🔺)1.415s71.05x
▲ VercelNext.js (Turbopack)3.349s (+8.6% 🔺)4.966s (+5.9% 🔺)1.616s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.214s (-4.8%)2.010s (~)0.796s151.00x
🐘 PostgresNitro1.258s (-1.2%)2.011s (~)0.753s151.04x
🐘 PostgresNext.js (Turbopack)1.271s2.011s0.740s151.05x
🌐 RedisNext.js (Turbopack)1.279s (-2.4%)2.006s (~)0.728s151.05x
💻 LocalExpress1.512s (+3.3%)2.005s (~)0.494s151.25x
💻 LocalNitro1.528s (~)2.005s (~)0.477s151.26x
💻 LocalNext.js (Turbopack)1.571s2.073s0.502s151.29x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.206s (-5.2% 🟢)3.634s (-4.2%)1.428s91.00x
▲ VercelNitro2.208s (-18.1% 🟢)3.876s (-2.4%)1.669s81.00x
▲ VercelExpress2.231s (-1.9%)3.675s (-3.0%)1.444s91.01x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.337s (-4.8%)3.010s (~)0.673s101.00x
🐘 PostgresNitro2.447s (~)3.012s (~)0.565s101.05x
🐘 PostgresNext.js (Turbopack)2.494s3.012s0.518s101.07x
🌐 RedisNext.js (Turbopack)2.569s (+0.7%)3.008s (~)0.439s101.10x
💻 LocalNext.js (Turbopack)2.924s3.678s0.753s91.25x
💻 LocalNitro2.981s (~)3.454s (~)0.473s91.28x
💻 LocalExpress3.046s (+10.0% 🔺)3.760s (+21.0% 🔺)0.714s81.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.366s (-7.7% 🟢)4.048s (+11.8% 🔺)1.683s81.00x
▲ VercelExpress2.487s (+7.7% 🔺)3.979s (+8.6% 🔺)1.492s81.05x
▲ VercelNext.js (Turbopack)2.878s (-2.6%)4.150s (-4.1%)1.272s81.22x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.502s (-2.5%)4.014s (~)0.513s81.00x
🐘 PostgresNitro3.580s (-0.6%)4.015s (~)0.435s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.015s0.247s81.08x
🌐 RedisNext.js (Turbopack)4.191s (+0.7%)4.725s (-2.9%)0.534s71.20x
💻 LocalNitro8.503s (-0.7%)9.023s (~)0.520s42.43x
💻 LocalExpress8.588s (+18.5% 🔺)9.023s (+16.2% 🔺)0.435s42.45x
💻 LocalNext.js (Turbopack)8.697s9.018s0.320s42.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.942s (+11.3% 🔺)4.442s (+18.0% 🔺)1.499s71.00x
▲ VercelNitro3.719s (+1.1%)5.269s (+7.9% 🔺)1.550s61.26x
▲ VercelNext.js (Turbopack)3.749s (+16.6% 🔺)5.463s (+18.2% 🔺)1.714s61.27x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.159s (-28.2% 🟢)1.000s (+0.8%)0.001s (-18.8% 🟢)1.011s (~)0.853s101.00x
🌐 RedisNext.js (Turbopack)0.187s (+2.9%)1.000s (~)0.002s (-11.8% 🟢)1.007s (~)0.820s101.18x
💻 LocalNext.js (Turbopack)0.188s1.000s0.011s1.017s0.830s101.18x
💻 LocalNitro0.197s (~)1.003s (~)0.012s (~)1.017s (~)0.820s101.24x
💻 LocalExpress0.199s (+43.6% 🔺)1.003s (~)0.012s (+11.5% 🔺)1.017s (~)0.819s101.25x
🐘 PostgresNext.js (Turbopack)0.217s1.002s0.002s1.014s0.797s101.37x
🐘 PostgresNitro0.224s (+2.8%)0.995s (-0.5%)0.001s (-6.7% 🟢)1.013s (~)0.789s101.41x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro1.627s (~)2.396s (~)0.668s (+12979.3% 🔺)3.690s (-75.2% 🟢)2.063s101.00x
▲ VercelExpress1.636s (+1.0%)2.438s (-12.3% 🟢)0.653s (+14413.3% 🔺)3.686s (+10.6% 🔺)2.050s101.00x
▲ VercelNext.js (Turbopack)1.747s (+8.7% 🔺)3.071s (+20.1% 🔺)0.398s (+1897.5% 🔺)4.149s (+32.7% 🔺)2.402s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresExpress12/12
▲ VercelNitro5/12
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

VaguelySeriousand others added 2 commits March 18, 2026 13:26
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Restore and update test coverage that was reduced in the initial change.
The test suite now covers 15 scenarios (up from 9):
Flush-on-write behavior:
- write() resolves only after data reaches server
- Single chunk uses writeToStream (not writeToStreamMulti)
- Falls back to sequential writes when writeToStreamMulti unavailable
- Multiple sequential writes trigger separate flush cycles
- Concurrent writes wait for in-progress flush before buffering
Close behavior:
- closeStream called on close
- Remaining buffer flushed on close
- Empty buffer on close skips write methods
Abort & error handling:
- Abort discards buffer and skips closeStream
- Write errors propagate to caller
- Close errors propagate to caller
- Flush errors during write propagate to caller
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@vercelvercelBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

The abort() handler in BufferedWritableStream clears the flush timer but never settles the flushWaiters promises, causing the internal write() async function to hang forever on an unsettled promise.

Fix on Vercel

@@ -0,0 +1,15 @@
---
title: Changelog

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a stub so we can add changelog entries for bigger changes later

Comment thread.github/CODEOWNERS
* @vercel/workflow

packages/next/ @ijjk @vercel/workflow
packages/next/src @ijjk @vercel/workflow

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This ensures JJ doesn't get accidentally tagged on every release PR when only changesets change

@VaguelySerious
VaguelySerious marked this pull request as ready for review March 18, 2026 21:17
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 18, 2026 21:17
…sh timer but never settles the `flushWaiters` promises, causing the internal `write()` async function to hang forever on an unsettled promise.
This commit fixes the issue reported at packages/core/src/serialization.ts:560
**Bug explanation:**
In `BufferedWritableStream`, the `write()` method (line 530) pushes chunks to a buffer, schedules a flush via a timer, and then awaits a promise that is added to `flushWaiters` (line 545):
```js
await new Promise<void>((resolve, reject) => {
flushWaiters.push({ resolve, reject });
});
```
Normally, when the flush timer fires (line 514), it captures `flushWaiters`, replaces it with a fresh array, calls `flush()`, and then resolves or rejects the captured waiters based on the flush result.
When `abort()` is called (line 560), it:
1. Clears the flush timer (preventing the timer callback from ever running)
2. Discards the buffer
But it does NOT settle the promises in `flushWaiters`. Since the timer that would have resolved/rejected those waiters has been cleared, and nothing else references them, those promises will **never settle**. The internal async function of `write()` is suspended at the `await` on line 545 and will remain suspended forever - it becomes a memory leak. The closures captured by those async functions (referencing `buffer`, `flushWaiters`, the world object, etc.) will also be retained in memory.
While the WritableStream infrastructure will reject the external write promise returned to consumers, the *internal* async function body doesn't get cancelled - JavaScript has no mechanism to cancel a suspended async function. It will hang indefinitely on the unsettled promise.
**Fix explanation:**
The fix adds code to the `abort()` handler to reject all pending `flushWaiters` before clearing the array. It:
1. Captures the current `flushWaiters` into a local variable
2. Replaces `flushWaiters` with an empty array (same pattern used in the timer callback)
3. Rejects each waiter with the abort reason (or a default "Stream aborted" error)
This ensures the `write()` async functions' awaited promises settle (with rejection), allowing those async functions to complete and their closures to be garbage collected. The rejection from `w.reject()` will propagate up through the `write()` function, but since the stream is already being aborted, this is the correct behavior.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
@VaguelySerious
VaguelySerious merged commit 2b07294 into mainMar 20, 2026
165 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/stream-flush-op branch March 20, 2026 20:28
@ghostghost mentioned this pull request Mar 20, 2026
VaguelySerious added a commit that referenced this pull request Mar 20, 2026
…hods
Merge main into peter/step-optional, resolving conflicts in the Streamer
interface, world-local streamer, world-postgres streamer, and writable
stream tests. Incorporates negative startIndex support from main (#1460)
and pendingOps flush behavior (#1446) into the namespaced streams API.
Additionally swaps argument order so runId is always the first parameter
for all stream methods: write, writeMulti, close, get, and list. Updates
all implementations (local, postgres, vercel), callers (serialization,
runtime, CLI, web), tests, and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

[core] Ensure open stream flush is await-able in pendingOps - #1446

Merged
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op
Mar 20, 2026
Merged

[core] Ensure open stream flush is await-able in pendingOps#1446
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 18, 2026

Copy link
Copy Markdown
Member

Stream tests seemed slightly flaky, and I suspect it might be partially because the 10ms buffer on streams wasn't await-able.

VaguelySeriousand others added 3 commits March 18, 2026 13:20
WorkflowServerWritableStream buffers writes and flushes via a 10ms
setTimeout for batching. The write() callback returned immediately
after buffering, causing flushablePipe's pendingOps counter to reach 0
before data actually reached the server via the deferred HTTP flush.
Fix: write() now returns a promise that resolves only after the
scheduled flush completes. Multiple writes within the 10ms window
still share a single batched flush — the batching optimization is
preserved. Each write's promise resolves when the batch's HTTP
round-trip finishes, so pendingOps accurately reflects server state.
This is implemented via a flushWaiters array: each write() pushes
a {resolve, reject} pair. When the setTimeout fires and flush()
completes, all waiters are resolved (or rejected on error).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b5d85b

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production758067825
✅ 💻 Local Development7820118900
✅ 📦 Local Production7820118900
✅ 🐘 Local Postgres7820118900
✅ 🪟 Windows720375
❌ 🌍 Community Worlds1185615189
✅ 📋 Other198027225
Total3492564664014

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6807
✅ example6807
✅ express6807
✅ fastify6807
✅ hono6807
✅ nextjs-turbopack7302
✅ nextjs-webpack7302
✅ nitro6807
✅ nuxt6807
✅ sveltekit6807
✅ vite6807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7203
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5233
✅ redis-dev302
❌ redis5323
✅ turso-dev302
❌ turso4513
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6609
✅ e2e-local-postgres-nest-stable6609
✅ e2e-local-prod-nest-stable6609

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.045s (+12.6% 🔺)1.006s (~)0.961s101.00x
💻 LocalNitro0.046s (+8.1% 🔺)1.006s (~)0.959s101.04x
🐘 PostgresExpress0.048s (-23.1% 🟢)1.011s (~)0.963s101.07x
💻 LocalNext.js (Turbopack)0.048s1.006s0.957s101.08x
🌐 RedisNext.js (Turbopack)0.054s (-4.6%)1.005s (~)0.951s101.22x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.952s101.33x
🐘 PostgresNitro0.060s (-6.1% 🟢)1.011s (~)0.951s101.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.523s (+13.6% 🔺)2.432s (+15.0% 🔺)1.909s101.00x
▲ VercelNext.js (Turbopack)0.531s (-28.0% 🟢)2.621s (-3.9%)2.089s101.02x
▲ VercelExpress0.621s (+13.0% 🔺)2.469s (+6.4% 🔺)1.849s101.19x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.113s2.005s0.892s101.00x
🐘 PostgresExpress1.115s (-2.8%)2.012s (~)0.898s101.00x
🌐 RedisNext.js (Turbopack)1.124s (~)2.007s (~)0.883s101.01x
💻 LocalExpress1.135s (+3.3%)2.006s (~)0.871s101.02x
💻 LocalNitro1.140s (+0.9%)2.007s (~)0.867s101.02x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.03x
🐘 PostgresNitro1.151s (~)2.013s (~)0.863s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.072s (-3.7%)3.619s (-4.4%)1.547s101.00x
▲ VercelNitro2.194s (+6.9% 🔺)3.819s (+18.7% 🔺)1.625s101.06x
▲ VercelExpress2.719s (+28.7% 🔺)4.291s (+16.6% 🔺)1.572s101.31x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.761s (-1.7%)11.042s (~)0.281s31.00x
🌐 RedisNext.js (Turbopack)10.765s (~)11.022s (~)0.257s31.00x
💻 LocalNext.js (Turbopack)10.776s11.023s0.247s31.00x
💻 LocalExpress10.908s (+2.4%)11.023s (~)0.115s31.01x
🐘 PostgresNitro10.947s (~)11.041s (~)0.094s31.02x
🐘 PostgresNext.js (Turbopack)10.947s11.374s0.426s31.02x
💻 LocalNitro10.948s (~)11.024s (~)0.076s31.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.128s (-1.0%)19.146s (+1.9%)2.019s21.00x
▲ VercelNext.js (Turbopack)17.854s (+5.2% 🔺)19.361s (+3.5%)1.507s21.04x
▲ VercelNitro17.919s (+1.5%)20.020s (+8.2% 🔺)2.101s21.05x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.618s (-2.2%)27.053s (-3.6%)0.434s31.00x
🌐 RedisNext.js (Turbopack)26.899s (~)27.386s (+1.2%)0.487s31.01x
💻 LocalNext.js (Turbopack)27.178s28.053s0.875s31.02x
🐘 PostgresNitro27.194s (~)28.061s (~)0.867s31.02x
🐘 PostgresNext.js (Turbopack)27.223s28.065s0.842s31.02x
💻 LocalExpress27.472s (+2.5%)28.052s (+3.7%)0.580s31.03x
💻 LocalNitro27.562s (~)28.055s (~)0.493s31.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro44.575s (-1.1%)45.973s (-0.8%)1.398s21.00x
▲ VercelExpress44.762s (~)46.273s (~)1.511s21.00x
▲ VercelNext.js (Turbopack)45.453s (+1.0%)47.201s (~)1.748s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express53.172s (-2.1%)54.095s (-1.8%)0.924s21.00x
🌐 RedisNext.js (Turbopack)53.654s (~)54.095s (~)0.440s21.01x
🐘 PostgresNext.js (Turbopack)53.995s54.104s0.109s21.02x
🐘 PostgresNitro54.279s (~)55.101s (~)0.823s21.02x
💻 LocalNext.js (Turbopack)55.916s56.101s0.185s21.05x
💻 LocalExpress56.606s (+2.9%)57.100s (+3.6%)0.494s21.06x
💻 LocalNitro56.653s (~)57.100s (~)0.447s21.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)95.438s (~)96.638s (~)1.200s11.00x
▲ VercelExpress95.831s (~)97.331s (~)1.500s11.00x
▲ VercelNitro96.484s (-7.4% 🟢)98.789s (-6.2% 🟢)2.305s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.219s (-4.6%)2.011s (~)0.793s151.00x
🐘 PostgresNext.js (Turbopack)1.255s2.012s0.756s151.03x
🐘 PostgresNitro1.271s (-0.5%)2.011s (~)0.740s151.04x
🌐 RedisNext.js (Turbopack)1.377s (~)2.006s (~)0.629s151.13x
💻 LocalExpress1.501s (+3.0%)2.006s (~)0.505s151.23x
💻 LocalNitro1.504s (-1.3%)2.006s (~)0.501s151.23x
💻 LocalNext.js (Turbopack)1.506s2.005s0.499s151.24x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.530s (+3.5%)3.846s (-4.0%)1.315s81.00x
▲ VercelExpress2.551s (+6.5% 🔺)4.030s (+7.1% 🔺)1.479s81.01x
▲ VercelNitro3.324s (+36.8% 🔺)4.916s (+46.9% 🔺)1.591s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.355s (-4.0%)3.012s (~)0.656s101.00x
🐘 PostgresNitro2.448s (-0.6%)3.013s (~)0.566s101.04x
🐘 PostgresNext.js (Turbopack)2.478s3.013s0.535s101.05x
🌐 RedisNext.js (Turbopack)2.566s (~)3.008s (~)0.442s101.09x
💻 LocalNext.js (Turbopack)2.704s3.007s0.303s101.15x
💻 LocalNitro2.972s (+3.6%)3.453s (+14.8% 🔺)0.481s91.26x
💻 LocalExpress3.083s (+18.5% 🔺)3.759s (+25.0% 🔺)0.675s81.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.515s (-6.4% 🟢)3.967s (+9.3% 🔺)1.452s81.00x
▲ VercelExpress2.639s (+10.8% 🔺)3.859s (-0.5%)1.219s81.05x
▲ VercelNext.js (Turbopack)2.743s (+8.6% 🔺)3.982s (-0.7%)1.239s81.09x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.495s (-2.9%)4.013s (~)0.518s81.00x
🐘 PostgresNitro3.588s (-0.7%)4.014s (~)0.426s81.03x
🐘 PostgresNext.js (Turbopack)3.755s4.015s0.260s81.07x
🌐 RedisNext.js (Turbopack)4.154s (+1.0%)5.012s (+2.9%)0.859s61.19x
💻 LocalNext.js (Turbopack)7.150s7.619s0.469s52.05x
💻 LocalNitro8.043s (-0.7%)8.519s (-5.6% 🟢)0.477s42.30x
💻 LocalExpress8.175s (+20.4% 🔺)8.773s (+25.1% 🔺)0.598s42.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.846s (-45.3% 🟢)4.390s (-34.4% 🟢)1.544s71.00x
▲ VercelNitro3.000s (+10.8% 🔺)4.414s (+13.3% 🔺)1.415s71.05x
▲ VercelNext.js (Turbopack)3.349s (+8.6% 🔺)4.966s (+5.9% 🔺)1.616s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.214s (-4.8%)2.010s (~)0.796s151.00x
🐘 PostgresNitro1.258s (-1.2%)2.011s (~)0.753s151.04x
🐘 PostgresNext.js (Turbopack)1.271s2.011s0.740s151.05x
🌐 RedisNext.js (Turbopack)1.279s (-2.4%)2.006s (~)0.728s151.05x
💻 LocalExpress1.512s (+3.3%)2.005s (~)0.494s151.25x
💻 LocalNitro1.528s (~)2.005s (~)0.477s151.26x
💻 LocalNext.js (Turbopack)1.571s2.073s0.502s151.29x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.206s (-5.2% 🟢)3.634s (-4.2%)1.428s91.00x
▲ VercelNitro2.208s (-18.1% 🟢)3.876s (-2.4%)1.669s81.00x
▲ VercelExpress2.231s (-1.9%)3.675s (-3.0%)1.444s91.01x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.337s (-4.8%)3.010s (~)0.673s101.00x
🐘 PostgresNitro2.447s (~)3.012s (~)0.565s101.05x
🐘 PostgresNext.js (Turbopack)2.494s3.012s0.518s101.07x
🌐 RedisNext.js (Turbopack)2.569s (+0.7%)3.008s (~)0.439s101.10x
💻 LocalNext.js (Turbopack)2.924s3.678s0.753s91.25x
💻 LocalNitro2.981s (~)3.454s (~)0.473s91.28x
💻 LocalExpress3.046s (+10.0% 🔺)3.760s (+21.0% 🔺)0.714s81.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.366s (-7.7% 🟢)4.048s (+11.8% 🔺)1.683s81.00x
▲ VercelExpress2.487s (+7.7% 🔺)3.979s (+8.6% 🔺)1.492s81.05x
▲ VercelNext.js (Turbopack)2.878s (-2.6%)4.150s (-4.1%)1.272s81.22x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.502s (-2.5%)4.014s (~)0.513s81.00x
🐘 PostgresNitro3.580s (-0.6%)4.015s (~)0.435s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.015s0.247s81.08x
🌐 RedisNext.js (Turbopack)4.191s (+0.7%)4.725s (-2.9%)0.534s71.20x
💻 LocalNitro8.503s (-0.7%)9.023s (~)0.520s42.43x
💻 LocalExpress8.588s (+18.5% 🔺)9.023s (+16.2% 🔺)0.435s42.45x
💻 LocalNext.js (Turbopack)8.697s9.018s0.320s42.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.942s (+11.3% 🔺)4.442s (+18.0% 🔺)1.499s71.00x
▲ VercelNitro3.719s (+1.1%)5.269s (+7.9% 🔺)1.550s61.26x
▲ VercelNext.js (Turbopack)3.749s (+16.6% 🔺)5.463s (+18.2% 🔺)1.714s61.27x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.159s (-28.2% 🟢)1.000s (+0.8%)0.001s (-18.8% 🟢)1.011s (~)0.853s101.00x
🌐 RedisNext.js (Turbopack)0.187s (+2.9%)1.000s (~)0.002s (-11.8% 🟢)1.007s (~)0.820s101.18x
💻 LocalNext.js (Turbopack)0.188s1.000s0.011s1.017s0.830s101.18x
💻 LocalNitro0.197s (~)1.003s (~)0.012s (~)1.017s (~)0.820s101.24x
💻 LocalExpress0.199s (+43.6% 🔺)1.003s (~)0.012s (+11.5% 🔺)1.017s (~)0.819s101.25x
🐘 PostgresNext.js (Turbopack)0.217s1.002s0.002s1.014s0.797s101.37x
🐘 PostgresNitro0.224s (+2.8%)0.995s (-0.5%)0.001s (-6.7% 🟢)1.013s (~)0.789s101.41x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro1.627s (~)2.396s (~)0.668s (+12979.3% 🔺)3.690s (-75.2% 🟢)2.063s101.00x
▲ VercelExpress1.636s (+1.0%)2.438s (-12.3% 🟢)0.653s (+14413.3% 🔺)3.686s (+10.6% 🔺)2.050s101.00x
▲ VercelNext.js (Turbopack)1.747s (+8.7% 🔺)3.071s (+20.1% 🔺)0.398s (+1897.5% 🔺)4.149s (+32.7% 🔺)2.402s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresExpress12/12
▲ VercelNitro5/12
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

VaguelySeriousand others added 2 commits March 18, 2026 13:26
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Restore and update test coverage that was reduced in the initial change.
The test suite now covers 15 scenarios (up from 9):
Flush-on-write behavior:
- write() resolves only after data reaches server
- Single chunk uses writeToStream (not writeToStreamMulti)
- Falls back to sequential writes when writeToStreamMulti unavailable
- Multiple sequential writes trigger separate flush cycles
- Concurrent writes wait for in-progress flush before buffering
Close behavior:
- closeStream called on close
- Remaining buffer flushed on close
- Empty buffer on close skips write methods
Abort & error handling:
- Abort discards buffer and skips closeStream
- Write errors propagate to caller
- Close errors propagate to caller
- Flush errors during write propagate to caller
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@vercelvercelBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

The abort() handler in BufferedWritableStream clears the flush timer but never settles the flushWaiters promises, causing the internal write() async function to hang forever on an unsettled promise.

Fix on Vercel

@@ -0,0 +1,15 @@
---
title: Changelog

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a stub so we can add changelog entries for bigger changes later

Comment thread.github/CODEOWNERS
* @vercel/workflow

packages/next/ @ijjk @vercel/workflow
packages/next/src @ijjk @vercel/workflow

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This ensures JJ doesn't get accidentally tagged on every release PR when only changesets change

@VaguelySerious
VaguelySerious marked this pull request as ready for review March 18, 2026 21:17
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 18, 2026 21:17
…sh timer but never settles the `flushWaiters` promises, causing the internal `write()` async function to hang forever on an unsettled promise.
This commit fixes the issue reported at packages/core/src/serialization.ts:560
**Bug explanation:**
In `BufferedWritableStream`, the `write()` method (line 530) pushes chunks to a buffer, schedules a flush via a timer, and then awaits a promise that is added to `flushWaiters` (line 545):
```js
await new Promise<void>((resolve, reject) => {
flushWaiters.push({ resolve, reject });
});
```
Normally, when the flush timer fires (line 514), it captures `flushWaiters`, replaces it with a fresh array, calls `flush()`, and then resolves or rejects the captured waiters based on the flush result.
When `abort()` is called (line 560), it:
1. Clears the flush timer (preventing the timer callback from ever running)
2. Discards the buffer
But it does NOT settle the promises in `flushWaiters`. Since the timer that would have resolved/rejected those waiters has been cleared, and nothing else references them, those promises will **never settle**. The internal async function of `write()` is suspended at the `await` on line 545 and will remain suspended forever - it becomes a memory leak. The closures captured by those async functions (referencing `buffer`, `flushWaiters`, the world object, etc.) will also be retained in memory.
While the WritableStream infrastructure will reject the external write promise returned to consumers, the *internal* async function body doesn't get cancelled - JavaScript has no mechanism to cancel a suspended async function. It will hang indefinitely on the unsettled promise.
**Fix explanation:**
The fix adds code to the `abort()` handler to reject all pending `flushWaiters` before clearing the array. It:
1. Captures the current `flushWaiters` into a local variable
2. Replaces `flushWaiters` with an empty array (same pattern used in the timer callback)
3. Rejects each waiter with the abort reason (or a default "Stream aborted" error)
This ensures the `write()` async functions' awaited promises settle (with rejection), allowing those async functions to complete and their closures to be garbage collected. The rejection from `w.reject()` will propagate up through the `write()` function, but since the stream is already being aborted, this is the correct behavior.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
@VaguelySerious
VaguelySerious merged commit 2b07294 into mainMar 20, 2026
165 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/stream-flush-op branch March 20, 2026 20:28
@ghostghost mentioned this pull request Mar 20, 2026
VaguelySerious added a commit that referenced this pull request Mar 20, 2026
…hods
Merge main into peter/step-optional, resolving conflicts in the Streamer
interface, world-local streamer, world-postgres streamer, and writable
stream tests. Incorporates negative startIndex support from main (#1460)
and pendingOps flush behavior (#1446) into the namespaced streams API.
Additionally swaps argument order so runId is always the first parameter
for all stream methods: write, writeMulti, close, get, and list. Updates
all implementations (local, postgres, vercel), callers (serialization,
runtime, CLI, web), tests, and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

[core] Ensure open stream flush is await-able in pendingOps - #1446

Merged
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op
Mar 20, 2026
Merged

[core] Ensure open stream flush is await-able in pendingOps#1446
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 18, 2026

Copy link
Copy Markdown
Member

Stream tests seemed slightly flaky, and I suspect it might be partially because the 10ms buffer on streams wasn't await-able.

VaguelySeriousand others added 3 commits March 18, 2026 13:20
WorkflowServerWritableStream buffers writes and flushes via a 10ms
setTimeout for batching. The write() callback returned immediately
after buffering, causing flushablePipe's pendingOps counter to reach 0
before data actually reached the server via the deferred HTTP flush.
Fix: write() now returns a promise that resolves only after the
scheduled flush completes. Multiple writes within the 10ms window
still share a single batched flush — the batching optimization is
preserved. Each write's promise resolves when the batch's HTTP
round-trip finishes, so pendingOps accurately reflects server state.
This is implemented via a flushWaiters array: each write() pushes
a {resolve, reject} pair. When the setTimeout fires and flush()
completes, all waiters are resolved (or rejected on error).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b5d85b

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production758067825
✅ 💻 Local Development7820118900
✅ 📦 Local Production7820118900
✅ 🐘 Local Postgres7820118900
✅ 🪟 Windows720375
❌ 🌍 Community Worlds1185615189
✅ 📋 Other198027225
Total3492564664014

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6807
✅ example6807
✅ express6807
✅ fastify6807
✅ hono6807
✅ nextjs-turbopack7302
✅ nextjs-webpack7302
✅ nitro6807
✅ nuxt6807
✅ sveltekit6807
✅ vite6807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7203
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5233
✅ redis-dev302
❌ redis5323
✅ turso-dev302
❌ turso4513
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6609
✅ e2e-local-postgres-nest-stable6609
✅ e2e-local-prod-nest-stable6609

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.045s (+12.6% 🔺)1.006s (~)0.961s101.00x
💻 LocalNitro0.046s (+8.1% 🔺)1.006s (~)0.959s101.04x
🐘 PostgresExpress0.048s (-23.1% 🟢)1.011s (~)0.963s101.07x
💻 LocalNext.js (Turbopack)0.048s1.006s0.957s101.08x
🌐 RedisNext.js (Turbopack)0.054s (-4.6%)1.005s (~)0.951s101.22x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.952s101.33x
🐘 PostgresNitro0.060s (-6.1% 🟢)1.011s (~)0.951s101.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.523s (+13.6% 🔺)2.432s (+15.0% 🔺)1.909s101.00x
▲ VercelNext.js (Turbopack)0.531s (-28.0% 🟢)2.621s (-3.9%)2.089s101.02x
▲ VercelExpress0.621s (+13.0% 🔺)2.469s (+6.4% 🔺)1.849s101.19x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.113s2.005s0.892s101.00x
🐘 PostgresExpress1.115s (-2.8%)2.012s (~)0.898s101.00x
🌐 RedisNext.js (Turbopack)1.124s (~)2.007s (~)0.883s101.01x
💻 LocalExpress1.135s (+3.3%)2.006s (~)0.871s101.02x
💻 LocalNitro1.140s (+0.9%)2.007s (~)0.867s101.02x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.03x
🐘 PostgresNitro1.151s (~)2.013s (~)0.863s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.072s (-3.7%)3.619s (-4.4%)1.547s101.00x
▲ VercelNitro2.194s (+6.9% 🔺)3.819s (+18.7% 🔺)1.625s101.06x
▲ VercelExpress2.719s (+28.7% 🔺)4.291s (+16.6% 🔺)1.572s101.31x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.761s (-1.7%)11.042s (~)0.281s31.00x
🌐 RedisNext.js (Turbopack)10.765s (~)11.022s (~)0.257s31.00x
💻 LocalNext.js (Turbopack)10.776s11.023s0.247s31.00x
💻 LocalExpress10.908s (+2.4%)11.023s (~)0.115s31.01x
🐘 PostgresNitro10.947s (~)11.041s (~)0.094s31.02x
🐘 PostgresNext.js (Turbopack)10.947s11.374s0.426s31.02x
💻 LocalNitro10.948s (~)11.024s (~)0.076s31.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.128s (-1.0%)19.146s (+1.9%)2.019s21.00x
▲ VercelNext.js (Turbopack)17.854s (+5.2% 🔺)19.361s (+3.5%)1.507s21.04x
▲ VercelNitro17.919s (+1.5%)20.020s (+8.2% 🔺)2.101s21.05x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.618s (-2.2%)27.053s (-3.6%)0.434s31.00x
🌐 RedisNext.js (Turbopack)26.899s (~)27.386s (+1.2%)0.487s31.01x
💻 LocalNext.js (Turbopack)27.178s28.053s0.875s31.02x
🐘 PostgresNitro27.194s (~)28.061s (~)0.867s31.02x
🐘 PostgresNext.js (Turbopack)27.223s28.065s0.842s31.02x
💻 LocalExpress27.472s (+2.5%)28.052s (+3.7%)0.580s31.03x
💻 LocalNitro27.562s (~)28.055s (~)0.493s31.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro44.575s (-1.1%)45.973s (-0.8%)1.398s21.00x
▲ VercelExpress44.762s (~)46.273s (~)1.511s21.00x
▲ VercelNext.js (Turbopack)45.453s (+1.0%)47.201s (~)1.748s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express53.172s (-2.1%)54.095s (-1.8%)0.924s21.00x
🌐 RedisNext.js (Turbopack)53.654s (~)54.095s (~)0.440s21.01x
🐘 PostgresNext.js (Turbopack)53.995s54.104s0.109s21.02x
🐘 PostgresNitro54.279s (~)55.101s (~)0.823s21.02x
💻 LocalNext.js (Turbopack)55.916s56.101s0.185s21.05x
💻 LocalExpress56.606s (+2.9%)57.100s (+3.6%)0.494s21.06x
💻 LocalNitro56.653s (~)57.100s (~)0.447s21.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)95.438s (~)96.638s (~)1.200s11.00x
▲ VercelExpress95.831s (~)97.331s (~)1.500s11.00x
▲ VercelNitro96.484s (-7.4% 🟢)98.789s (-6.2% 🟢)2.305s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.219s (-4.6%)2.011s (~)0.793s151.00x
🐘 PostgresNext.js (Turbopack)1.255s2.012s0.756s151.03x
🐘 PostgresNitro1.271s (-0.5%)2.011s (~)0.740s151.04x
🌐 RedisNext.js (Turbopack)1.377s (~)2.006s (~)0.629s151.13x
💻 LocalExpress1.501s (+3.0%)2.006s (~)0.505s151.23x
💻 LocalNitro1.504s (-1.3%)2.006s (~)0.501s151.23x
💻 LocalNext.js (Turbopack)1.506s2.005s0.499s151.24x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.530s (+3.5%)3.846s (-4.0%)1.315s81.00x
▲ VercelExpress2.551s (+6.5% 🔺)4.030s (+7.1% 🔺)1.479s81.01x
▲ VercelNitro3.324s (+36.8% 🔺)4.916s (+46.9% 🔺)1.591s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.355s (-4.0%)3.012s (~)0.656s101.00x
🐘 PostgresNitro2.448s (-0.6%)3.013s (~)0.566s101.04x
🐘 PostgresNext.js (Turbopack)2.478s3.013s0.535s101.05x
🌐 RedisNext.js (Turbopack)2.566s (~)3.008s (~)0.442s101.09x
💻 LocalNext.js (Turbopack)2.704s3.007s0.303s101.15x
💻 LocalNitro2.972s (+3.6%)3.453s (+14.8% 🔺)0.481s91.26x
💻 LocalExpress3.083s (+18.5% 🔺)3.759s (+25.0% 🔺)0.675s81.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.515s (-6.4% 🟢)3.967s (+9.3% 🔺)1.452s81.00x
▲ VercelExpress2.639s (+10.8% 🔺)3.859s (-0.5%)1.219s81.05x
▲ VercelNext.js (Turbopack)2.743s (+8.6% 🔺)3.982s (-0.7%)1.239s81.09x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.495s (-2.9%)4.013s (~)0.518s81.00x
🐘 PostgresNitro3.588s (-0.7%)4.014s (~)0.426s81.03x
🐘 PostgresNext.js (Turbopack)3.755s4.015s0.260s81.07x
🌐 RedisNext.js (Turbopack)4.154s (+1.0%)5.012s (+2.9%)0.859s61.19x
💻 LocalNext.js (Turbopack)7.150s7.619s0.469s52.05x
💻 LocalNitro8.043s (-0.7%)8.519s (-5.6% 🟢)0.477s42.30x
💻 LocalExpress8.175s (+20.4% 🔺)8.773s (+25.1% 🔺)0.598s42.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.846s (-45.3% 🟢)4.390s (-34.4% 🟢)1.544s71.00x
▲ VercelNitro3.000s (+10.8% 🔺)4.414s (+13.3% 🔺)1.415s71.05x
▲ VercelNext.js (Turbopack)3.349s (+8.6% 🔺)4.966s (+5.9% 🔺)1.616s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.214s (-4.8%)2.010s (~)0.796s151.00x
🐘 PostgresNitro1.258s (-1.2%)2.011s (~)0.753s151.04x
🐘 PostgresNext.js (Turbopack)1.271s2.011s0.740s151.05x
🌐 RedisNext.js (Turbopack)1.279s (-2.4%)2.006s (~)0.728s151.05x
💻 LocalExpress1.512s (+3.3%)2.005s (~)0.494s151.25x
💻 LocalNitro1.528s (~)2.005s (~)0.477s151.26x
💻 LocalNext.js (Turbopack)1.571s2.073s0.502s151.29x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.206s (-5.2% 🟢)3.634s (-4.2%)1.428s91.00x
▲ VercelNitro2.208s (-18.1% 🟢)3.876s (-2.4%)1.669s81.00x
▲ VercelExpress2.231s (-1.9%)3.675s (-3.0%)1.444s91.01x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.337s (-4.8%)3.010s (~)0.673s101.00x
🐘 PostgresNitro2.447s (~)3.012s (~)0.565s101.05x
🐘 PostgresNext.js (Turbopack)2.494s3.012s0.518s101.07x
🌐 RedisNext.js (Turbopack)2.569s (+0.7%)3.008s (~)0.439s101.10x
💻 LocalNext.js (Turbopack)2.924s3.678s0.753s91.25x
💻 LocalNitro2.981s (~)3.454s (~)0.473s91.28x
💻 LocalExpress3.046s (+10.0% 🔺)3.760s (+21.0% 🔺)0.714s81.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.366s (-7.7% 🟢)4.048s (+11.8% 🔺)1.683s81.00x
▲ VercelExpress2.487s (+7.7% 🔺)3.979s (+8.6% 🔺)1.492s81.05x
▲ VercelNext.js (Turbopack)2.878s (-2.6%)4.150s (-4.1%)1.272s81.22x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.502s (-2.5%)4.014s (~)0.513s81.00x
🐘 PostgresNitro3.580s (-0.6%)4.015s (~)0.435s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.015s0.247s81.08x
🌐 RedisNext.js (Turbopack)4.191s (+0.7%)4.725s (-2.9%)0.534s71.20x
💻 LocalNitro8.503s (-0.7%)9.023s (~)0.520s42.43x
💻 LocalExpress8.588s (+18.5% 🔺)9.023s (+16.2% 🔺)0.435s42.45x
💻 LocalNext.js (Turbopack)8.697s9.018s0.320s42.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.942s (+11.3% 🔺)4.442s (+18.0% 🔺)1.499s71.00x
▲ VercelNitro3.719s (+1.1%)5.269s (+7.9% 🔺)1.550s61.26x
▲ VercelNext.js (Turbopack)3.749s (+16.6% 🔺)5.463s (+18.2% 🔺)1.714s61.27x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.159s (-28.2% 🟢)1.000s (+0.8%)0.001s (-18.8% 🟢)1.011s (~)0.853s101.00x
🌐 RedisNext.js (Turbopack)0.187s (+2.9%)1.000s (~)0.002s (-11.8% 🟢)1.007s (~)0.820s101.18x
💻 LocalNext.js (Turbopack)0.188s1.000s0.011s1.017s0.830s101.18x
💻 LocalNitro0.197s (~)1.003s (~)0.012s (~)1.017s (~)0.820s101.24x
💻 LocalExpress0.199s (+43.6% 🔺)1.003s (~)0.012s (+11.5% 🔺)1.017s (~)0.819s101.25x
🐘 PostgresNext.js (Turbopack)0.217s1.002s0.002s1.014s0.797s101.37x
🐘 PostgresNitro0.224s (+2.8%)0.995s (-0.5%)0.001s (-6.7% 🟢)1.013s (~)0.789s101.41x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro1.627s (~)2.396s (~)0.668s (+12979.3% 🔺)3.690s (-75.2% 🟢)2.063s101.00x
▲ VercelExpress1.636s (+1.0%)2.438s (-12.3% 🟢)0.653s (+14413.3% 🔺)3.686s (+10.6% 🔺)2.050s101.00x
▲ VercelNext.js (Turbopack)1.747s (+8.7% 🔺)3.071s (+20.1% 🔺)0.398s (+1897.5% 🔺)4.149s (+32.7% 🔺)2.402s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresExpress12/12
▲ VercelNitro5/12
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

VaguelySeriousand others added 2 commits March 18, 2026 13:26
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Restore and update test coverage that was reduced in the initial change.
The test suite now covers 15 scenarios (up from 9):
Flush-on-write behavior:
- write() resolves only after data reaches server
- Single chunk uses writeToStream (not writeToStreamMulti)
- Falls back to sequential writes when writeToStreamMulti unavailable
- Multiple sequential writes trigger separate flush cycles
- Concurrent writes wait for in-progress flush before buffering
Close behavior:
- closeStream called on close
- Remaining buffer flushed on close
- Empty buffer on close skips write methods
Abort & error handling:
- Abort discards buffer and skips closeStream
- Write errors propagate to caller
- Close errors propagate to caller
- Flush errors during write propagate to caller
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@vercelvercelBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

The abort() handler in BufferedWritableStream clears the flush timer but never settles the flushWaiters promises, causing the internal write() async function to hang forever on an unsettled promise.

Fix on Vercel

@@ -0,0 +1,15 @@
---
title: Changelog

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a stub so we can add changelog entries for bigger changes later

Comment thread.github/CODEOWNERS
* @vercel/workflow

packages/next/ @ijjk @vercel/workflow
packages/next/src @ijjk @vercel/workflow

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This ensures JJ doesn't get accidentally tagged on every release PR when only changesets change

@VaguelySerious
VaguelySerious marked this pull request as ready for review March 18, 2026 21:17
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 18, 2026 21:17
…sh timer but never settles the `flushWaiters` promises, causing the internal `write()` async function to hang forever on an unsettled promise.
This commit fixes the issue reported at packages/core/src/serialization.ts:560
**Bug explanation:**
In `BufferedWritableStream`, the `write()` method (line 530) pushes chunks to a buffer, schedules a flush via a timer, and then awaits a promise that is added to `flushWaiters` (line 545):
```js
await new Promise<void>((resolve, reject) => {
flushWaiters.push({ resolve, reject });
});
```
Normally, when the flush timer fires (line 514), it captures `flushWaiters`, replaces it with a fresh array, calls `flush()`, and then resolves or rejects the captured waiters based on the flush result.
When `abort()` is called (line 560), it:
1. Clears the flush timer (preventing the timer callback from ever running)
2. Discards the buffer
But it does NOT settle the promises in `flushWaiters`. Since the timer that would have resolved/rejected those waiters has been cleared, and nothing else references them, those promises will **never settle**. The internal async function of `write()` is suspended at the `await` on line 545 and will remain suspended forever - it becomes a memory leak. The closures captured by those async functions (referencing `buffer`, `flushWaiters`, the world object, etc.) will also be retained in memory.
While the WritableStream infrastructure will reject the external write promise returned to consumers, the *internal* async function body doesn't get cancelled - JavaScript has no mechanism to cancel a suspended async function. It will hang indefinitely on the unsettled promise.
**Fix explanation:**
The fix adds code to the `abort()` handler to reject all pending `flushWaiters` before clearing the array. It:
1. Captures the current `flushWaiters` into a local variable
2. Replaces `flushWaiters` with an empty array (same pattern used in the timer callback)
3. Rejects each waiter with the abort reason (or a default "Stream aborted" error)
This ensures the `write()` async functions' awaited promises settle (with rejection), allowing those async functions to complete and their closures to be garbage collected. The rejection from `w.reject()` will propagate up through the `write()` function, but since the stream is already being aborted, this is the correct behavior.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
@VaguelySerious
VaguelySerious merged commit 2b07294 into mainMar 20, 2026
165 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/stream-flush-op branch March 20, 2026 20:28
@ghostghost mentioned this pull request Mar 20, 2026
VaguelySerious added a commit that referenced this pull request Mar 20, 2026
…hods
Merge main into peter/step-optional, resolving conflicts in the Streamer
interface, world-local streamer, world-postgres streamer, and writable
stream tests. Incorporates negative startIndex support from main (#1460)
and pendingOps flush behavior (#1446) into the namespaced streams API.
Additionally swaps argument order so runId is always the first parameter
for all stream methods: write, writeMulti, close, get, and list. Updates
all implementations (local, postgres, vercel), callers (serialization,
runtime, CLI, web), tests, and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

[core] Ensure open stream flush is await-able in pendingOps - #1446

Merged
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op
Mar 20, 2026
Merged

[core] Ensure open stream flush is await-able in pendingOps#1446
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 18, 2026

Copy link
Copy Markdown
Member

Stream tests seemed slightly flaky, and I suspect it might be partially because the 10ms buffer on streams wasn't await-able.

VaguelySeriousand others added 3 commits March 18, 2026 13:20
WorkflowServerWritableStream buffers writes and flushes via a 10ms
setTimeout for batching. The write() callback returned immediately
after buffering, causing flushablePipe's pendingOps counter to reach 0
before data actually reached the server via the deferred HTTP flush.
Fix: write() now returns a promise that resolves only after the
scheduled flush completes. Multiple writes within the 10ms window
still share a single batched flush — the batching optimization is
preserved. Each write's promise resolves when the batch's HTTP
round-trip finishes, so pendingOps accurately reflects server state.
This is implemented via a flushWaiters array: each write() pushes
a {resolve, reject} pair. When the setTimeout fires and flush()
completes, all waiters are resolved (or rejected on error).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b5d85b

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production758067825
✅ 💻 Local Development7820118900
✅ 📦 Local Production7820118900
✅ 🐘 Local Postgres7820118900
✅ 🪟 Windows720375
❌ 🌍 Community Worlds1185615189
✅ 📋 Other198027225
Total3492564664014

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6807
✅ example6807
✅ express6807
✅ fastify6807
✅ hono6807
✅ nextjs-turbopack7302
✅ nextjs-webpack7302
✅ nitro6807
✅ nuxt6807
✅ sveltekit6807
✅ vite6807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7203
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5233
✅ redis-dev302
❌ redis5323
✅ turso-dev302
❌ turso4513
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6609
✅ e2e-local-postgres-nest-stable6609
✅ e2e-local-prod-nest-stable6609

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.045s (+12.6% 🔺)1.006s (~)0.961s101.00x
💻 LocalNitro0.046s (+8.1% 🔺)1.006s (~)0.959s101.04x
🐘 PostgresExpress0.048s (-23.1% 🟢)1.011s (~)0.963s101.07x
💻 LocalNext.js (Turbopack)0.048s1.006s0.957s101.08x
🌐 RedisNext.js (Turbopack)0.054s (-4.6%)1.005s (~)0.951s101.22x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.952s101.33x
🐘 PostgresNitro0.060s (-6.1% 🟢)1.011s (~)0.951s101.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.523s (+13.6% 🔺)2.432s (+15.0% 🔺)1.909s101.00x
▲ VercelNext.js (Turbopack)0.531s (-28.0% 🟢)2.621s (-3.9%)2.089s101.02x
▲ VercelExpress0.621s (+13.0% 🔺)2.469s (+6.4% 🔺)1.849s101.19x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.113s2.005s0.892s101.00x
🐘 PostgresExpress1.115s (-2.8%)2.012s (~)0.898s101.00x
🌐 RedisNext.js (Turbopack)1.124s (~)2.007s (~)0.883s101.01x
💻 LocalExpress1.135s (+3.3%)2.006s (~)0.871s101.02x
💻 LocalNitro1.140s (+0.9%)2.007s (~)0.867s101.02x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.03x
🐘 PostgresNitro1.151s (~)2.013s (~)0.863s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.072s (-3.7%)3.619s (-4.4%)1.547s101.00x
▲ VercelNitro2.194s (+6.9% 🔺)3.819s (+18.7% 🔺)1.625s101.06x
▲ VercelExpress2.719s (+28.7% 🔺)4.291s (+16.6% 🔺)1.572s101.31x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.761s (-1.7%)11.042s (~)0.281s31.00x
🌐 RedisNext.js (Turbopack)10.765s (~)11.022s (~)0.257s31.00x
💻 LocalNext.js (Turbopack)10.776s11.023s0.247s31.00x
💻 LocalExpress10.908s (+2.4%)11.023s (~)0.115s31.01x
🐘 PostgresNitro10.947s (~)11.041s (~)0.094s31.02x
🐘 PostgresNext.js (Turbopack)10.947s11.374s0.426s31.02x
💻 LocalNitro10.948s (~)11.024s (~)0.076s31.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.128s (-1.0%)19.146s (+1.9%)2.019s21.00x
▲ VercelNext.js (Turbopack)17.854s (+5.2% 🔺)19.361s (+3.5%)1.507s21.04x
▲ VercelNitro17.919s (+1.5%)20.020s (+8.2% 🔺)2.101s21.05x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.618s (-2.2%)27.053s (-3.6%)0.434s31.00x
🌐 RedisNext.js (Turbopack)26.899s (~)27.386s (+1.2%)0.487s31.01x
💻 LocalNext.js (Turbopack)27.178s28.053s0.875s31.02x
🐘 PostgresNitro27.194s (~)28.061s (~)0.867s31.02x
🐘 PostgresNext.js (Turbopack)27.223s28.065s0.842s31.02x
💻 LocalExpress27.472s (+2.5%)28.052s (+3.7%)0.580s31.03x
💻 LocalNitro27.562s (~)28.055s (~)0.493s31.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro44.575s (-1.1%)45.973s (-0.8%)1.398s21.00x
▲ VercelExpress44.762s (~)46.273s (~)1.511s21.00x
▲ VercelNext.js (Turbopack)45.453s (+1.0%)47.201s (~)1.748s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express53.172s (-2.1%)54.095s (-1.8%)0.924s21.00x
🌐 RedisNext.js (Turbopack)53.654s (~)54.095s (~)0.440s21.01x
🐘 PostgresNext.js (Turbopack)53.995s54.104s0.109s21.02x
🐘 PostgresNitro54.279s (~)55.101s (~)0.823s21.02x
💻 LocalNext.js (Turbopack)55.916s56.101s0.185s21.05x
💻 LocalExpress56.606s (+2.9%)57.100s (+3.6%)0.494s21.06x
💻 LocalNitro56.653s (~)57.100s (~)0.447s21.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)95.438s (~)96.638s (~)1.200s11.00x
▲ VercelExpress95.831s (~)97.331s (~)1.500s11.00x
▲ VercelNitro96.484s (-7.4% 🟢)98.789s (-6.2% 🟢)2.305s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.219s (-4.6%)2.011s (~)0.793s151.00x
🐘 PostgresNext.js (Turbopack)1.255s2.012s0.756s151.03x
🐘 PostgresNitro1.271s (-0.5%)2.011s (~)0.740s151.04x
🌐 RedisNext.js (Turbopack)1.377s (~)2.006s (~)0.629s151.13x
💻 LocalExpress1.501s (+3.0%)2.006s (~)0.505s151.23x
💻 LocalNitro1.504s (-1.3%)2.006s (~)0.501s151.23x
💻 LocalNext.js (Turbopack)1.506s2.005s0.499s151.24x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.530s (+3.5%)3.846s (-4.0%)1.315s81.00x
▲ VercelExpress2.551s (+6.5% 🔺)4.030s (+7.1% 🔺)1.479s81.01x
▲ VercelNitro3.324s (+36.8% 🔺)4.916s (+46.9% 🔺)1.591s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.355s (-4.0%)3.012s (~)0.656s101.00x
🐘 PostgresNitro2.448s (-0.6%)3.013s (~)0.566s101.04x
🐘 PostgresNext.js (Turbopack)2.478s3.013s0.535s101.05x
🌐 RedisNext.js (Turbopack)2.566s (~)3.008s (~)0.442s101.09x
💻 LocalNext.js (Turbopack)2.704s3.007s0.303s101.15x
💻 LocalNitro2.972s (+3.6%)3.453s (+14.8% 🔺)0.481s91.26x
💻 LocalExpress3.083s (+18.5% 🔺)3.759s (+25.0% 🔺)0.675s81.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.515s (-6.4% 🟢)3.967s (+9.3% 🔺)1.452s81.00x
▲ VercelExpress2.639s (+10.8% 🔺)3.859s (-0.5%)1.219s81.05x
▲ VercelNext.js (Turbopack)2.743s (+8.6% 🔺)3.982s (-0.7%)1.239s81.09x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.495s (-2.9%)4.013s (~)0.518s81.00x
🐘 PostgresNitro3.588s (-0.7%)4.014s (~)0.426s81.03x
🐘 PostgresNext.js (Turbopack)3.755s4.015s0.260s81.07x
🌐 RedisNext.js (Turbopack)4.154s (+1.0%)5.012s (+2.9%)0.859s61.19x
💻 LocalNext.js (Turbopack)7.150s7.619s0.469s52.05x
💻 LocalNitro8.043s (-0.7%)8.519s (-5.6% 🟢)0.477s42.30x
💻 LocalExpress8.175s (+20.4% 🔺)8.773s (+25.1% 🔺)0.598s42.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.846s (-45.3% 🟢)4.390s (-34.4% 🟢)1.544s71.00x
▲ VercelNitro3.000s (+10.8% 🔺)4.414s (+13.3% 🔺)1.415s71.05x
▲ VercelNext.js (Turbopack)3.349s (+8.6% 🔺)4.966s (+5.9% 🔺)1.616s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.214s (-4.8%)2.010s (~)0.796s151.00x
🐘 PostgresNitro1.258s (-1.2%)2.011s (~)0.753s151.04x
🐘 PostgresNext.js (Turbopack)1.271s2.011s0.740s151.05x
🌐 RedisNext.js (Turbopack)1.279s (-2.4%)2.006s (~)0.728s151.05x
💻 LocalExpress1.512s (+3.3%)2.005s (~)0.494s151.25x
💻 LocalNitro1.528s (~)2.005s (~)0.477s151.26x
💻 LocalNext.js (Turbopack)1.571s2.073s0.502s151.29x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.206s (-5.2% 🟢)3.634s (-4.2%)1.428s91.00x
▲ VercelNitro2.208s (-18.1% 🟢)3.876s (-2.4%)1.669s81.00x
▲ VercelExpress2.231s (-1.9%)3.675s (-3.0%)1.444s91.01x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.337s (-4.8%)3.010s (~)0.673s101.00x
🐘 PostgresNitro2.447s (~)3.012s (~)0.565s101.05x
🐘 PostgresNext.js (Turbopack)2.494s3.012s0.518s101.07x
🌐 RedisNext.js (Turbopack)2.569s (+0.7%)3.008s (~)0.439s101.10x
💻 LocalNext.js (Turbopack)2.924s3.678s0.753s91.25x
💻 LocalNitro2.981s (~)3.454s (~)0.473s91.28x
💻 LocalExpress3.046s (+10.0% 🔺)3.760s (+21.0% 🔺)0.714s81.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.366s (-7.7% 🟢)4.048s (+11.8% 🔺)1.683s81.00x
▲ VercelExpress2.487s (+7.7% 🔺)3.979s (+8.6% 🔺)1.492s81.05x
▲ VercelNext.js (Turbopack)2.878s (-2.6%)4.150s (-4.1%)1.272s81.22x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.502s (-2.5%)4.014s (~)0.513s81.00x
🐘 PostgresNitro3.580s (-0.6%)4.015s (~)0.435s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.015s0.247s81.08x
🌐 RedisNext.js (Turbopack)4.191s (+0.7%)4.725s (-2.9%)0.534s71.20x
💻 LocalNitro8.503s (-0.7%)9.023s (~)0.520s42.43x
💻 LocalExpress8.588s (+18.5% 🔺)9.023s (+16.2% 🔺)0.435s42.45x
💻 LocalNext.js (Turbopack)8.697s9.018s0.320s42.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.942s (+11.3% 🔺)4.442s (+18.0% 🔺)1.499s71.00x
▲ VercelNitro3.719s (+1.1%)5.269s (+7.9% 🔺)1.550s61.26x
▲ VercelNext.js (Turbopack)3.749s (+16.6% 🔺)5.463s (+18.2% 🔺)1.714s61.27x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.159s (-28.2% 🟢)1.000s (+0.8%)0.001s (-18.8% 🟢)1.011s (~)0.853s101.00x
🌐 RedisNext.js (Turbopack)0.187s (+2.9%)1.000s (~)0.002s (-11.8% 🟢)1.007s (~)0.820s101.18x
💻 LocalNext.js (Turbopack)0.188s1.000s0.011s1.017s0.830s101.18x
💻 LocalNitro0.197s (~)1.003s (~)0.012s (~)1.017s (~)0.820s101.24x
💻 LocalExpress0.199s (+43.6% 🔺)1.003s (~)0.012s (+11.5% 🔺)1.017s (~)0.819s101.25x
🐘 PostgresNext.js (Turbopack)0.217s1.002s0.002s1.014s0.797s101.37x
🐘 PostgresNitro0.224s (+2.8%)0.995s (-0.5%)0.001s (-6.7% 🟢)1.013s (~)0.789s101.41x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro1.627s (~)2.396s (~)0.668s (+12979.3% 🔺)3.690s (-75.2% 🟢)2.063s101.00x
▲ VercelExpress1.636s (+1.0%)2.438s (-12.3% 🟢)0.653s (+14413.3% 🔺)3.686s (+10.6% 🔺)2.050s101.00x
▲ VercelNext.js (Turbopack)1.747s (+8.7% 🔺)3.071s (+20.1% 🔺)0.398s (+1897.5% 🔺)4.149s (+32.7% 🔺)2.402s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresExpress12/12
▲ VercelNitro5/12
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

VaguelySeriousand others added 2 commits March 18, 2026 13:26
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Restore and update test coverage that was reduced in the initial change.
The test suite now covers 15 scenarios (up from 9):
Flush-on-write behavior:
- write() resolves only after data reaches server
- Single chunk uses writeToStream (not writeToStreamMulti)
- Falls back to sequential writes when writeToStreamMulti unavailable
- Multiple sequential writes trigger separate flush cycles
- Concurrent writes wait for in-progress flush before buffering
Close behavior:
- closeStream called on close
- Remaining buffer flushed on close
- Empty buffer on close skips write methods
Abort & error handling:
- Abort discards buffer and skips closeStream
- Write errors propagate to caller
- Close errors propagate to caller
- Flush errors during write propagate to caller
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@vercelvercelBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

The abort() handler in BufferedWritableStream clears the flush timer but never settles the flushWaiters promises, causing the internal write() async function to hang forever on an unsettled promise.

Fix on Vercel

@@ -0,0 +1,15 @@
---
title: Changelog

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a stub so we can add changelog entries for bigger changes later

Comment thread.github/CODEOWNERS
* @vercel/workflow

packages/next/ @ijjk @vercel/workflow
packages/next/src @ijjk @vercel/workflow

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This ensures JJ doesn't get accidentally tagged on every release PR when only changesets change

@VaguelySerious
VaguelySerious marked this pull request as ready for review March 18, 2026 21:17
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 18, 2026 21:17
…sh timer but never settles the `flushWaiters` promises, causing the internal `write()` async function to hang forever on an unsettled promise.
This commit fixes the issue reported at packages/core/src/serialization.ts:560
**Bug explanation:**
In `BufferedWritableStream`, the `write()` method (line 530) pushes chunks to a buffer, schedules a flush via a timer, and then awaits a promise that is added to `flushWaiters` (line 545):
```js
await new Promise<void>((resolve, reject) => {
flushWaiters.push({ resolve, reject });
});
```
Normally, when the flush timer fires (line 514), it captures `flushWaiters`, replaces it with a fresh array, calls `flush()`, and then resolves or rejects the captured waiters based on the flush result.
When `abort()` is called (line 560), it:
1. Clears the flush timer (preventing the timer callback from ever running)
2. Discards the buffer
But it does NOT settle the promises in `flushWaiters`. Since the timer that would have resolved/rejected those waiters has been cleared, and nothing else references them, those promises will **never settle**. The internal async function of `write()` is suspended at the `await` on line 545 and will remain suspended forever - it becomes a memory leak. The closures captured by those async functions (referencing `buffer`, `flushWaiters`, the world object, etc.) will also be retained in memory.
While the WritableStream infrastructure will reject the external write promise returned to consumers, the *internal* async function body doesn't get cancelled - JavaScript has no mechanism to cancel a suspended async function. It will hang indefinitely on the unsettled promise.
**Fix explanation:**
The fix adds code to the `abort()` handler to reject all pending `flushWaiters` before clearing the array. It:
1. Captures the current `flushWaiters` into a local variable
2. Replaces `flushWaiters` with an empty array (same pattern used in the timer callback)
3. Rejects each waiter with the abort reason (or a default "Stream aborted" error)
This ensures the `write()` async functions' awaited promises settle (with rejection), allowing those async functions to complete and their closures to be garbage collected. The rejection from `w.reject()` will propagate up through the `write()` function, but since the stream is already being aborted, this is the correct behavior.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
@VaguelySerious
VaguelySerious merged commit 2b07294 into mainMar 20, 2026
165 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/stream-flush-op branch March 20, 2026 20:28
@ghostghost mentioned this pull request Mar 20, 2026
VaguelySerious added a commit that referenced this pull request Mar 20, 2026
…hods
Merge main into peter/step-optional, resolving conflicts in the Streamer
interface, world-local streamer, world-postgres streamer, and writable
stream tests. Incorporates negative startIndex support from main (#1460)
and pendingOps flush behavior (#1446) into the namespaced streams API.
Additionally swaps argument order so runId is always the first parameter
for all stream methods: write, writeMulti, close, get, and list. Updates
all implementations (local, postgres, vercel), callers (serialization,
runtime, CLI, web), tests, and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

[core] Ensure open stream flush is await-able in pendingOps - #1446

Merged
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op
Mar 20, 2026
Merged

[core] Ensure open stream flush is await-able in pendingOps#1446
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 18, 2026

Copy link
Copy Markdown
Member

Stream tests seemed slightly flaky, and I suspect it might be partially because the 10ms buffer on streams wasn't await-able.

VaguelySeriousand others added 3 commits March 18, 2026 13:20
WorkflowServerWritableStream buffers writes and flushes via a 10ms
setTimeout for batching. The write() callback returned immediately
after buffering, causing flushablePipe's pendingOps counter to reach 0
before data actually reached the server via the deferred HTTP flush.
Fix: write() now returns a promise that resolves only after the
scheduled flush completes. Multiple writes within the 10ms window
still share a single batched flush — the batching optimization is
preserved. Each write's promise resolves when the batch's HTTP
round-trip finishes, so pendingOps accurately reflects server state.
This is implemented via a flushWaiters array: each write() pushes
a {resolve, reject} pair. When the setTimeout fires and flush()
completes, all waiters are resolved (or rejected on error).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b5d85b

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production758067825
✅ 💻 Local Development7820118900
✅ 📦 Local Production7820118900
✅ 🐘 Local Postgres7820118900
✅ 🪟 Windows720375
❌ 🌍 Community Worlds1185615189
✅ 📋 Other198027225
Total3492564664014

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6807
✅ example6807
✅ express6807
✅ fastify6807
✅ hono6807
✅ nextjs-turbopack7302
✅ nextjs-webpack7302
✅ nitro6807
✅ nuxt6807
✅ sveltekit6807
✅ vite6807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7203
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5233
✅ redis-dev302
❌ redis5323
✅ turso-dev302
❌ turso4513
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6609
✅ e2e-local-postgres-nest-stable6609
✅ e2e-local-prod-nest-stable6609

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.045s (+12.6% 🔺)1.006s (~)0.961s101.00x
💻 LocalNitro0.046s (+8.1% 🔺)1.006s (~)0.959s101.04x
🐘 PostgresExpress0.048s (-23.1% 🟢)1.011s (~)0.963s101.07x
💻 LocalNext.js (Turbopack)0.048s1.006s0.957s101.08x
🌐 RedisNext.js (Turbopack)0.054s (-4.6%)1.005s (~)0.951s101.22x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.952s101.33x
🐘 PostgresNitro0.060s (-6.1% 🟢)1.011s (~)0.951s101.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.523s (+13.6% 🔺)2.432s (+15.0% 🔺)1.909s101.00x
▲ VercelNext.js (Turbopack)0.531s (-28.0% 🟢)2.621s (-3.9%)2.089s101.02x
▲ VercelExpress0.621s (+13.0% 🔺)2.469s (+6.4% 🔺)1.849s101.19x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.113s2.005s0.892s101.00x
🐘 PostgresExpress1.115s (-2.8%)2.012s (~)0.898s101.00x
🌐 RedisNext.js (Turbopack)1.124s (~)2.007s (~)0.883s101.01x
💻 LocalExpress1.135s (+3.3%)2.006s (~)0.871s101.02x
💻 LocalNitro1.140s (+0.9%)2.007s (~)0.867s101.02x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.03x
🐘 PostgresNitro1.151s (~)2.013s (~)0.863s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.072s (-3.7%)3.619s (-4.4%)1.547s101.00x
▲ VercelNitro2.194s (+6.9% 🔺)3.819s (+18.7% 🔺)1.625s101.06x
▲ VercelExpress2.719s (+28.7% 🔺)4.291s (+16.6% 🔺)1.572s101.31x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.761s (-1.7%)11.042s (~)0.281s31.00x
🌐 RedisNext.js (Turbopack)10.765s (~)11.022s (~)0.257s31.00x
💻 LocalNext.js (Turbopack)10.776s11.023s0.247s31.00x
💻 LocalExpress10.908s (+2.4%)11.023s (~)0.115s31.01x
🐘 PostgresNitro10.947s (~)11.041s (~)0.094s31.02x
🐘 PostgresNext.js (Turbopack)10.947s11.374s0.426s31.02x
💻 LocalNitro10.948s (~)11.024s (~)0.076s31.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.128s (-1.0%)19.146s (+1.9%)2.019s21.00x
▲ VercelNext.js (Turbopack)17.854s (+5.2% 🔺)19.361s (+3.5%)1.507s21.04x
▲ VercelNitro17.919s (+1.5%)20.020s (+8.2% 🔺)2.101s21.05x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.618s (-2.2%)27.053s (-3.6%)0.434s31.00x
🌐 RedisNext.js (Turbopack)26.899s (~)27.386s (+1.2%)0.487s31.01x
💻 LocalNext.js (Turbopack)27.178s28.053s0.875s31.02x
🐘 PostgresNitro27.194s (~)28.061s (~)0.867s31.02x
🐘 PostgresNext.js (Turbopack)27.223s28.065s0.842s31.02x
💻 LocalExpress27.472s (+2.5%)28.052s (+3.7%)0.580s31.03x
💻 LocalNitro27.562s (~)28.055s (~)0.493s31.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro44.575s (-1.1%)45.973s (-0.8%)1.398s21.00x
▲ VercelExpress44.762s (~)46.273s (~)1.511s21.00x
▲ VercelNext.js (Turbopack)45.453s (+1.0%)47.201s (~)1.748s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express53.172s (-2.1%)54.095s (-1.8%)0.924s21.00x
🌐 RedisNext.js (Turbopack)53.654s (~)54.095s (~)0.440s21.01x
🐘 PostgresNext.js (Turbopack)53.995s54.104s0.109s21.02x
🐘 PostgresNitro54.279s (~)55.101s (~)0.823s21.02x
💻 LocalNext.js (Turbopack)55.916s56.101s0.185s21.05x
💻 LocalExpress56.606s (+2.9%)57.100s (+3.6%)0.494s21.06x
💻 LocalNitro56.653s (~)57.100s (~)0.447s21.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)95.438s (~)96.638s (~)1.200s11.00x
▲ VercelExpress95.831s (~)97.331s (~)1.500s11.00x
▲ VercelNitro96.484s (-7.4% 🟢)98.789s (-6.2% 🟢)2.305s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.219s (-4.6%)2.011s (~)0.793s151.00x
🐘 PostgresNext.js (Turbopack)1.255s2.012s0.756s151.03x
🐘 PostgresNitro1.271s (-0.5%)2.011s (~)0.740s151.04x
🌐 RedisNext.js (Turbopack)1.377s (~)2.006s (~)0.629s151.13x
💻 LocalExpress1.501s (+3.0%)2.006s (~)0.505s151.23x
💻 LocalNitro1.504s (-1.3%)2.006s (~)0.501s151.23x
💻 LocalNext.js (Turbopack)1.506s2.005s0.499s151.24x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.530s (+3.5%)3.846s (-4.0%)1.315s81.00x
▲ VercelExpress2.551s (+6.5% 🔺)4.030s (+7.1% 🔺)1.479s81.01x
▲ VercelNitro3.324s (+36.8% 🔺)4.916s (+46.9% 🔺)1.591s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.355s (-4.0%)3.012s (~)0.656s101.00x
🐘 PostgresNitro2.448s (-0.6%)3.013s (~)0.566s101.04x
🐘 PostgresNext.js (Turbopack)2.478s3.013s0.535s101.05x
🌐 RedisNext.js (Turbopack)2.566s (~)3.008s (~)0.442s101.09x
💻 LocalNext.js (Turbopack)2.704s3.007s0.303s101.15x
💻 LocalNitro2.972s (+3.6%)3.453s (+14.8% 🔺)0.481s91.26x
💻 LocalExpress3.083s (+18.5% 🔺)3.759s (+25.0% 🔺)0.675s81.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.515s (-6.4% 🟢)3.967s (+9.3% 🔺)1.452s81.00x
▲ VercelExpress2.639s (+10.8% 🔺)3.859s (-0.5%)1.219s81.05x
▲ VercelNext.js (Turbopack)2.743s (+8.6% 🔺)3.982s (-0.7%)1.239s81.09x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.495s (-2.9%)4.013s (~)0.518s81.00x
🐘 PostgresNitro3.588s (-0.7%)4.014s (~)0.426s81.03x
🐘 PostgresNext.js (Turbopack)3.755s4.015s0.260s81.07x
🌐 RedisNext.js (Turbopack)4.154s (+1.0%)5.012s (+2.9%)0.859s61.19x
💻 LocalNext.js (Turbopack)7.150s7.619s0.469s52.05x
💻 LocalNitro8.043s (-0.7%)8.519s (-5.6% 🟢)0.477s42.30x
💻 LocalExpress8.175s (+20.4% 🔺)8.773s (+25.1% 🔺)0.598s42.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.846s (-45.3% 🟢)4.390s (-34.4% 🟢)1.544s71.00x
▲ VercelNitro3.000s (+10.8% 🔺)4.414s (+13.3% 🔺)1.415s71.05x
▲ VercelNext.js (Turbopack)3.349s (+8.6% 🔺)4.966s (+5.9% 🔺)1.616s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.214s (-4.8%)2.010s (~)0.796s151.00x
🐘 PostgresNitro1.258s (-1.2%)2.011s (~)0.753s151.04x
🐘 PostgresNext.js (Turbopack)1.271s2.011s0.740s151.05x
🌐 RedisNext.js (Turbopack)1.279s (-2.4%)2.006s (~)0.728s151.05x
💻 LocalExpress1.512s (+3.3%)2.005s (~)0.494s151.25x
💻 LocalNitro1.528s (~)2.005s (~)0.477s151.26x
💻 LocalNext.js (Turbopack)1.571s2.073s0.502s151.29x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.206s (-5.2% 🟢)3.634s (-4.2%)1.428s91.00x
▲ VercelNitro2.208s (-18.1% 🟢)3.876s (-2.4%)1.669s81.00x
▲ VercelExpress2.231s (-1.9%)3.675s (-3.0%)1.444s91.01x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.337s (-4.8%)3.010s (~)0.673s101.00x
🐘 PostgresNitro2.447s (~)3.012s (~)0.565s101.05x
🐘 PostgresNext.js (Turbopack)2.494s3.012s0.518s101.07x
🌐 RedisNext.js (Turbopack)2.569s (+0.7%)3.008s (~)0.439s101.10x
💻 LocalNext.js (Turbopack)2.924s3.678s0.753s91.25x
💻 LocalNitro2.981s (~)3.454s (~)0.473s91.28x
💻 LocalExpress3.046s (+10.0% 🔺)3.760s (+21.0% 🔺)0.714s81.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.366s (-7.7% 🟢)4.048s (+11.8% 🔺)1.683s81.00x
▲ VercelExpress2.487s (+7.7% 🔺)3.979s (+8.6% 🔺)1.492s81.05x
▲ VercelNext.js (Turbopack)2.878s (-2.6%)4.150s (-4.1%)1.272s81.22x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.502s (-2.5%)4.014s (~)0.513s81.00x
🐘 PostgresNitro3.580s (-0.6%)4.015s (~)0.435s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.015s0.247s81.08x
🌐 RedisNext.js (Turbopack)4.191s (+0.7%)4.725s (-2.9%)0.534s71.20x
💻 LocalNitro8.503s (-0.7%)9.023s (~)0.520s42.43x
💻 LocalExpress8.588s (+18.5% 🔺)9.023s (+16.2% 🔺)0.435s42.45x
💻 LocalNext.js (Turbopack)8.697s9.018s0.320s42.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.942s (+11.3% 🔺)4.442s (+18.0% 🔺)1.499s71.00x
▲ VercelNitro3.719s (+1.1%)5.269s (+7.9% 🔺)1.550s61.26x
▲ VercelNext.js (Turbopack)3.749s (+16.6% 🔺)5.463s (+18.2% 🔺)1.714s61.27x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.159s (-28.2% 🟢)1.000s (+0.8%)0.001s (-18.8% 🟢)1.011s (~)0.853s101.00x
🌐 RedisNext.js (Turbopack)0.187s (+2.9%)1.000s (~)0.002s (-11.8% 🟢)1.007s (~)0.820s101.18x
💻 LocalNext.js (Turbopack)0.188s1.000s0.011s1.017s0.830s101.18x
💻 LocalNitro0.197s (~)1.003s (~)0.012s (~)1.017s (~)0.820s101.24x
💻 LocalExpress0.199s (+43.6% 🔺)1.003s (~)0.012s (+11.5% 🔺)1.017s (~)0.819s101.25x
🐘 PostgresNext.js (Turbopack)0.217s1.002s0.002s1.014s0.797s101.37x
🐘 PostgresNitro0.224s (+2.8%)0.995s (-0.5%)0.001s (-6.7% 🟢)1.013s (~)0.789s101.41x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro1.627s (~)2.396s (~)0.668s (+12979.3% 🔺)3.690s (-75.2% 🟢)2.063s101.00x
▲ VercelExpress1.636s (+1.0%)2.438s (-12.3% 🟢)0.653s (+14413.3% 🔺)3.686s (+10.6% 🔺)2.050s101.00x
▲ VercelNext.js (Turbopack)1.747s (+8.7% 🔺)3.071s (+20.1% 🔺)0.398s (+1897.5% 🔺)4.149s (+32.7% 🔺)2.402s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresExpress12/12
▲ VercelNitro5/12
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

VaguelySeriousand others added 2 commits March 18, 2026 13:26
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Restore and update test coverage that was reduced in the initial change.
The test suite now covers 15 scenarios (up from 9):
Flush-on-write behavior:
- write() resolves only after data reaches server
- Single chunk uses writeToStream (not writeToStreamMulti)
- Falls back to sequential writes when writeToStreamMulti unavailable
- Multiple sequential writes trigger separate flush cycles
- Concurrent writes wait for in-progress flush before buffering
Close behavior:
- closeStream called on close
- Remaining buffer flushed on close
- Empty buffer on close skips write methods
Abort & error handling:
- Abort discards buffer and skips closeStream
- Write errors propagate to caller
- Close errors propagate to caller
- Flush errors during write propagate to caller
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@vercelvercelBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

The abort() handler in BufferedWritableStream clears the flush timer but never settles the flushWaiters promises, causing the internal write() async function to hang forever on an unsettled promise.

Fix on Vercel

@@ -0,0 +1,15 @@
---
title: Changelog

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a stub so we can add changelog entries for bigger changes later

Comment thread.github/CODEOWNERS
* @vercel/workflow

packages/next/ @ijjk @vercel/workflow
packages/next/src @ijjk @vercel/workflow

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This ensures JJ doesn't get accidentally tagged on every release PR when only changesets change

@VaguelySerious
VaguelySerious marked this pull request as ready for review March 18, 2026 21:17
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 18, 2026 21:17
…sh timer but never settles the `flushWaiters` promises, causing the internal `write()` async function to hang forever on an unsettled promise.
This commit fixes the issue reported at packages/core/src/serialization.ts:560
**Bug explanation:**
In `BufferedWritableStream`, the `write()` method (line 530) pushes chunks to a buffer, schedules a flush via a timer, and then awaits a promise that is added to `flushWaiters` (line 545):
```js
await new Promise<void>((resolve, reject) => {
flushWaiters.push({ resolve, reject });
});
```
Normally, when the flush timer fires (line 514), it captures `flushWaiters`, replaces it with a fresh array, calls `flush()`, and then resolves or rejects the captured waiters based on the flush result.
When `abort()` is called (line 560), it:
1. Clears the flush timer (preventing the timer callback from ever running)
2. Discards the buffer
But it does NOT settle the promises in `flushWaiters`. Since the timer that would have resolved/rejected those waiters has been cleared, and nothing else references them, those promises will **never settle**. The internal async function of `write()` is suspended at the `await` on line 545 and will remain suspended forever - it becomes a memory leak. The closures captured by those async functions (referencing `buffer`, `flushWaiters`, the world object, etc.) will also be retained in memory.
While the WritableStream infrastructure will reject the external write promise returned to consumers, the *internal* async function body doesn't get cancelled - JavaScript has no mechanism to cancel a suspended async function. It will hang indefinitely on the unsettled promise.
**Fix explanation:**
The fix adds code to the `abort()` handler to reject all pending `flushWaiters` before clearing the array. It:
1. Captures the current `flushWaiters` into a local variable
2. Replaces `flushWaiters` with an empty array (same pattern used in the timer callback)
3. Rejects each waiter with the abort reason (or a default "Stream aborted" error)
This ensures the `write()` async functions' awaited promises settle (with rejection), allowing those async functions to complete and their closures to be garbage collected. The rejection from `w.reject()` will propagate up through the `write()` function, but since the stream is already being aborted, this is the correct behavior.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
@VaguelySerious
VaguelySerious merged commit 2b07294 into mainMar 20, 2026
165 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/stream-flush-op branch March 20, 2026 20:28
@ghostghost mentioned this pull request Mar 20, 2026
VaguelySerious added a commit that referenced this pull request Mar 20, 2026
…hods
Merge main into peter/step-optional, resolving conflicts in the Streamer
interface, world-local streamer, world-postgres streamer, and writable
stream tests. Incorporates negative startIndex support from main (#1460)
and pendingOps flush behavior (#1446) into the namespaced streams API.
Additionally swaps argument order so runId is always the first parameter
for all stream methods: write, writeMulti, close, get, and list. Updates
all implementations (local, postgres, vercel), callers (serialization,
runtime, CLI, web), tests, and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

[core] Ensure open stream flush is await-able in pendingOps - #1446

Merged
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op
Mar 20, 2026
Merged

[core] Ensure open stream flush is await-able in pendingOps#1446
VaguelySerious merged 6 commits into
mainfrom
peter/stream-flush-op

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 18, 2026

Copy link
Copy Markdown
Member

Stream tests seemed slightly flaky, and I suspect it might be partially because the 10ms buffer on streams wasn't await-able.

VaguelySeriousand others added 3 commits March 18, 2026 13:20
WorkflowServerWritableStream buffers writes and flushes via a 10ms
setTimeout for batching. The write() callback returned immediately
after buffering, causing flushablePipe's pendingOps counter to reach 0
before data actually reached the server via the deferred HTTP flush.
Fix: write() now returns a promise that resolves only after the
scheduled flush completes. Multiple writes within the 10ms window
still share a single batched flush — the batching optimization is
preserved. Each write's promise resolves when the batch's HTTP
round-trip finishes, so pendingOps accurately reflects server state.
This is implemented via a flushWaiters array: each write() pushes
a {resolve, reject} pair. When the setTimeout fires and flush()
completes, all waiters are resolved (or rejected on error).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Mar 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b5d85b

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production758067825
✅ 💻 Local Development7820118900
✅ 📦 Local Production7820118900
✅ 🐘 Local Postgres7820118900
✅ 🪟 Windows720375
❌ 🌍 Community Worlds1185615189
✅ 📋 Other198027225
Total3492564664014

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6807
✅ example6807
✅ express6807
✅ fastify6807
✅ hono6807
✅ nextjs-turbopack7302
✅ nextjs-webpack7302
✅ nitro6807
✅ nuxt6807
✅ sveltekit6807
✅ vite6807
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6609
✅ express-stable6609
✅ fastify-stable6609
✅ hono-stable6609
✅ nextjs-turbopack-canary55020
✅ nextjs-turbopack-stable7203
✅ nextjs-webpack-canary55020
✅ nextjs-webpack-stable7203
✅ nitro-stable6609
✅ nuxt-stable6609
✅ sveltekit-stable6609
✅ vite-stable6609
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7203
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5233
✅ redis-dev302
❌ redis5323
✅ turso-dev302
❌ turso4513
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6609
✅ e2e-local-postgres-nest-stable6609
✅ e2e-local-prod-nest-stable6609

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.045s (+12.6% 🔺)1.006s (~)0.961s101.00x
💻 LocalNitro0.046s (+8.1% 🔺)1.006s (~)0.959s101.04x
🐘 PostgresExpress0.048s (-23.1% 🟢)1.011s (~)0.963s101.07x
💻 LocalNext.js (Turbopack)0.048s1.006s0.957s101.08x
🌐 RedisNext.js (Turbopack)0.054s (-4.6%)1.005s (~)0.951s101.22x
🐘 PostgresNext.js (Turbopack)0.059s1.011s0.952s101.33x
🐘 PostgresNitro0.060s (-6.1% 🟢)1.011s (~)0.951s101.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.523s (+13.6% 🔺)2.432s (+15.0% 🔺)1.909s101.00x
▲ VercelNext.js (Turbopack)0.531s (-28.0% 🟢)2.621s (-3.9%)2.089s101.02x
▲ VercelExpress0.621s (+13.0% 🔺)2.469s (+6.4% 🔺)1.849s101.19x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.113s2.005s0.892s101.00x
🐘 PostgresExpress1.115s (-2.8%)2.012s (~)0.898s101.00x
🌐 RedisNext.js (Turbopack)1.124s (~)2.007s (~)0.883s101.01x
💻 LocalExpress1.135s (+3.3%)2.006s (~)0.871s101.02x
💻 LocalNitro1.140s (+0.9%)2.007s (~)0.867s101.02x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.03x
🐘 PostgresNitro1.151s (~)2.013s (~)0.863s101.03x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.072s (-3.7%)3.619s (-4.4%)1.547s101.00x
▲ VercelNitro2.194s (+6.9% 🔺)3.819s (+18.7% 🔺)1.625s101.06x
▲ VercelExpress2.719s (+28.7% 🔺)4.291s (+16.6% 🔺)1.572s101.31x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.761s (-1.7%)11.042s (~)0.281s31.00x
🌐 RedisNext.js (Turbopack)10.765s (~)11.022s (~)0.257s31.00x
💻 LocalNext.js (Turbopack)10.776s11.023s0.247s31.00x
💻 LocalExpress10.908s (+2.4%)11.023s (~)0.115s31.01x
🐘 PostgresNitro10.947s (~)11.041s (~)0.094s31.02x
🐘 PostgresNext.js (Turbopack)10.947s11.374s0.426s31.02x
💻 LocalNitro10.948s (~)11.024s (~)0.076s31.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.128s (-1.0%)19.146s (+1.9%)2.019s21.00x
▲ VercelNext.js (Turbopack)17.854s (+5.2% 🔺)19.361s (+3.5%)1.507s21.04x
▲ VercelNitro17.919s (+1.5%)20.020s (+8.2% 🔺)2.101s21.05x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.618s (-2.2%)27.053s (-3.6%)0.434s31.00x
🌐 RedisNext.js (Turbopack)26.899s (~)27.386s (+1.2%)0.487s31.01x
💻 LocalNext.js (Turbopack)27.178s28.053s0.875s31.02x
🐘 PostgresNitro27.194s (~)28.061s (~)0.867s31.02x
🐘 PostgresNext.js (Turbopack)27.223s28.065s0.842s31.02x
💻 LocalExpress27.472s (+2.5%)28.052s (+3.7%)0.580s31.03x
💻 LocalNitro27.562s (~)28.055s (~)0.493s31.04x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro44.575s (-1.1%)45.973s (-0.8%)1.398s21.00x
▲ VercelExpress44.762s (~)46.273s (~)1.511s21.00x
▲ VercelNext.js (Turbopack)45.453s (+1.0%)47.201s (~)1.748s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express53.172s (-2.1%)54.095s (-1.8%)0.924s21.00x
🌐 RedisNext.js (Turbopack)53.654s (~)54.095s (~)0.440s21.01x
🐘 PostgresNext.js (Turbopack)53.995s54.104s0.109s21.02x
🐘 PostgresNitro54.279s (~)55.101s (~)0.823s21.02x
💻 LocalNext.js (Turbopack)55.916s56.101s0.185s21.05x
💻 LocalExpress56.606s (+2.9%)57.100s (+3.6%)0.494s21.06x
💻 LocalNitro56.653s (~)57.100s (~)0.447s21.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)95.438s (~)96.638s (~)1.200s11.00x
▲ VercelExpress95.831s (~)97.331s (~)1.500s11.00x
▲ VercelNitro96.484s (-7.4% 🟢)98.789s (-6.2% 🟢)2.305s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.219s (-4.6%)2.011s (~)0.793s151.00x
🐘 PostgresNext.js (Turbopack)1.255s2.012s0.756s151.03x
🐘 PostgresNitro1.271s (-0.5%)2.011s (~)0.740s151.04x
🌐 RedisNext.js (Turbopack)1.377s (~)2.006s (~)0.629s151.13x
💻 LocalExpress1.501s (+3.0%)2.006s (~)0.505s151.23x
💻 LocalNitro1.504s (-1.3%)2.006s (~)0.501s151.23x
💻 LocalNext.js (Turbopack)1.506s2.005s0.499s151.24x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.530s (+3.5%)3.846s (-4.0%)1.315s81.00x
▲ VercelExpress2.551s (+6.5% 🔺)4.030s (+7.1% 🔺)1.479s81.01x
▲ VercelNitro3.324s (+36.8% 🔺)4.916s (+46.9% 🔺)1.591s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.355s (-4.0%)3.012s (~)0.656s101.00x
🐘 PostgresNitro2.448s (-0.6%)3.013s (~)0.566s101.04x
🐘 PostgresNext.js (Turbopack)2.478s3.013s0.535s101.05x
🌐 RedisNext.js (Turbopack)2.566s (~)3.008s (~)0.442s101.09x
💻 LocalNext.js (Turbopack)2.704s3.007s0.303s101.15x
💻 LocalNitro2.972s (+3.6%)3.453s (+14.8% 🔺)0.481s91.26x
💻 LocalExpress3.083s (+18.5% 🔺)3.759s (+25.0% 🔺)0.675s81.31x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.515s (-6.4% 🟢)3.967s (+9.3% 🔺)1.452s81.00x
▲ VercelExpress2.639s (+10.8% 🔺)3.859s (-0.5%)1.219s81.05x
▲ VercelNext.js (Turbopack)2.743s (+8.6% 🔺)3.982s (-0.7%)1.239s81.09x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.495s (-2.9%)4.013s (~)0.518s81.00x
🐘 PostgresNitro3.588s (-0.7%)4.014s (~)0.426s81.03x
🐘 PostgresNext.js (Turbopack)3.755s4.015s0.260s81.07x
🌐 RedisNext.js (Turbopack)4.154s (+1.0%)5.012s (+2.9%)0.859s61.19x
💻 LocalNext.js (Turbopack)7.150s7.619s0.469s52.05x
💻 LocalNitro8.043s (-0.7%)8.519s (-5.6% 🟢)0.477s42.30x
💻 LocalExpress8.175s (+20.4% 🔺)8.773s (+25.1% 🔺)0.598s42.34x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.846s (-45.3% 🟢)4.390s (-34.4% 🟢)1.544s71.00x
▲ VercelNitro3.000s (+10.8% 🔺)4.414s (+13.3% 🔺)1.415s71.05x
▲ VercelNext.js (Turbopack)3.349s (+8.6% 🔺)4.966s (+5.9% 🔺)1.616s71.18x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.214s (-4.8%)2.010s (~)0.796s151.00x
🐘 PostgresNitro1.258s (-1.2%)2.011s (~)0.753s151.04x
🐘 PostgresNext.js (Turbopack)1.271s2.011s0.740s151.05x
🌐 RedisNext.js (Turbopack)1.279s (-2.4%)2.006s (~)0.728s151.05x
💻 LocalExpress1.512s (+3.3%)2.005s (~)0.494s151.25x
💻 LocalNitro1.528s (~)2.005s (~)0.477s151.26x
💻 LocalNext.js (Turbopack)1.571s2.073s0.502s151.29x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.206s (-5.2% 🟢)3.634s (-4.2%)1.428s91.00x
▲ VercelNitro2.208s (-18.1% 🟢)3.876s (-2.4%)1.669s81.00x
▲ VercelExpress2.231s (-1.9%)3.675s (-3.0%)1.444s91.01x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.337s (-4.8%)3.010s (~)0.673s101.00x
🐘 PostgresNitro2.447s (~)3.012s (~)0.565s101.05x
🐘 PostgresNext.js (Turbopack)2.494s3.012s0.518s101.07x
🌐 RedisNext.js (Turbopack)2.569s (+0.7%)3.008s (~)0.439s101.10x
💻 LocalNext.js (Turbopack)2.924s3.678s0.753s91.25x
💻 LocalNitro2.981s (~)3.454s (~)0.473s91.28x
💻 LocalExpress3.046s (+10.0% 🔺)3.760s (+21.0% 🔺)0.714s81.30x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.366s (-7.7% 🟢)4.048s (+11.8% 🔺)1.683s81.00x
▲ VercelExpress2.487s (+7.7% 🔺)3.979s (+8.6% 🔺)1.492s81.05x
▲ VercelNext.js (Turbopack)2.878s (-2.6%)4.150s (-4.1%)1.272s81.22x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.502s (-2.5%)4.014s (~)0.513s81.00x
🐘 PostgresNitro3.580s (-0.6%)4.015s (~)0.435s81.02x
🐘 PostgresNext.js (Turbopack)3.768s4.015s0.247s81.08x
🌐 RedisNext.js (Turbopack)4.191s (+0.7%)4.725s (-2.9%)0.534s71.20x
💻 LocalNitro8.503s (-0.7%)9.023s (~)0.520s42.43x
💻 LocalExpress8.588s (+18.5% 🔺)9.023s (+16.2% 🔺)0.435s42.45x
💻 LocalNext.js (Turbopack)8.697s9.018s0.320s42.48x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.942s (+11.3% 🔺)4.442s (+18.0% 🔺)1.499s71.00x
▲ VercelNitro3.719s (+1.1%)5.269s (+7.9% 🔺)1.550s61.26x
▲ VercelNext.js (Turbopack)3.749s (+16.6% 🔺)5.463s (+18.2% 🔺)1.714s61.27x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.159s (-28.2% 🟢)1.000s (+0.8%)0.001s (-18.8% 🟢)1.011s (~)0.853s101.00x
🌐 RedisNext.js (Turbopack)0.187s (+2.9%)1.000s (~)0.002s (-11.8% 🟢)1.007s (~)0.820s101.18x
💻 LocalNext.js (Turbopack)0.188s1.000s0.011s1.017s0.830s101.18x
💻 LocalNitro0.197s (~)1.003s (~)0.012s (~)1.017s (~)0.820s101.24x
💻 LocalExpress0.199s (+43.6% 🔺)1.003s (~)0.012s (+11.5% 🔺)1.017s (~)0.819s101.25x
🐘 PostgresNext.js (Turbopack)0.217s1.002s0.002s1.014s0.797s101.37x
🐘 PostgresNitro0.224s (+2.8%)0.995s (-0.5%)0.001s (-6.7% 🟢)1.013s (~)0.789s101.41x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro1.627s (~)2.396s (~)0.668s (+12979.3% 🔺)3.690s (-75.2% 🟢)2.063s101.00x
▲ VercelExpress1.636s (+1.0%)2.438s (-12.3% 🟢)0.653s (+14413.3% 🔺)3.686s (+10.6% 🔺)2.050s101.00x
▲ VercelNext.js (Turbopack)1.747s (+8.7% 🔺)3.071s (+20.1% 🔺)0.398s (+1897.5% 🔺)4.149s (+32.7% 🔺)2.402s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresExpress12/12
▲ VercelNitro5/12
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

VaguelySeriousand others added 2 commits March 18, 2026 13:26
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Restore and update test coverage that was reduced in the initial change.
The test suite now covers 15 scenarios (up from 9):
Flush-on-write behavior:
- write() resolves only after data reaches server
- Single chunk uses writeToStream (not writeToStreamMulti)
- Falls back to sequential writes when writeToStreamMulti unavailable
- Multiple sequential writes trigger separate flush cycles
- Concurrent writes wait for in-progress flush before buffering
Close behavior:
- closeStream called on close
- Remaining buffer flushed on close
- Empty buffer on close skips write methods
Abort & error handling:
- Abort discards buffer and skips closeStream
- Write errors propagate to caller
- Close errors propagate to caller
- Flush errors during write propagate to caller
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@vercelvercelBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional Suggestion:

The abort() handler in BufferedWritableStream clears the flush timer but never settles the flushWaiters promises, causing the internal write() async function to hang forever on an unsettled promise.

Fix on Vercel

@@ -0,0 +1,15 @@
---
title: Changelog

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a stub so we can add changelog entries for bigger changes later

Comment thread.github/CODEOWNERS
* @vercel/workflow

packages/next/ @ijjk @vercel/workflow
packages/next/src @ijjk @vercel/workflow

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This ensures JJ doesn't get accidentally tagged on every release PR when only changesets change

@VaguelySerious
VaguelySerious marked this pull request as ready for review March 18, 2026 21:17
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 18, 2026 21:17
…sh timer but never settles the `flushWaiters` promises, causing the internal `write()` async function to hang forever on an unsettled promise.
This commit fixes the issue reported at packages/core/src/serialization.ts:560
**Bug explanation:**
In `BufferedWritableStream`, the `write()` method (line 530) pushes chunks to a buffer, schedules a flush via a timer, and then awaits a promise that is added to `flushWaiters` (line 545):
```js
await new Promise<void>((resolve, reject) => {
flushWaiters.push({ resolve, reject });
});
```
Normally, when the flush timer fires (line 514), it captures `flushWaiters`, replaces it with a fresh array, calls `flush()`, and then resolves or rejects the captured waiters based on the flush result.
When `abort()` is called (line 560), it:
1. Clears the flush timer (preventing the timer callback from ever running)
2. Discards the buffer
But it does NOT settle the promises in `flushWaiters`. Since the timer that would have resolved/rejected those waiters has been cleared, and nothing else references them, those promises will **never settle**. The internal async function of `write()` is suspended at the `await` on line 545 and will remain suspended forever - it becomes a memory leak. The closures captured by those async functions (referencing `buffer`, `flushWaiters`, the world object, etc.) will also be retained in memory.
While the WritableStream infrastructure will reject the external write promise returned to consumers, the *internal* async function body doesn't get cancelled - JavaScript has no mechanism to cancel a suspended async function. It will hang indefinitely on the unsettled promise.
**Fix explanation:**
The fix adds code to the `abort()` handler to reject all pending `flushWaiters` before clearing the array. It:
1. Captures the current `flushWaiters` into a local variable
2. Replaces `flushWaiters` with an empty array (same pattern used in the timer callback)
3. Rejects each waiter with the abort reason (or a default "Stream aborted" error)
This ensures the `write()` async functions' awaited promises settle (with rejection), allowing those async functions to complete and their closures to be garbage collected. The rejection from `w.reject()` will propagate up through the `write()` function, but since the stream is already being aborted, this is the correct behavior.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
@VaguelySerious
VaguelySerious merged commit 2b07294 into mainMar 20, 2026
165 of 169 checks passed
@VaguelySerious
VaguelySerious deleted the peter/stream-flush-op branch March 20, 2026 20:28
@ghostghost mentioned this pull request Mar 20, 2026
VaguelySerious added a commit that referenced this pull request Mar 20, 2026
…hods
Merge main into peter/step-optional, resolving conflicts in the Streamer
interface, world-local streamer, world-postgres streamer, and writable
stream tests. Incorporates negative startIndex support from main (#1460)
and pendingOps flush behavior (#1446) into the namespaced streams API.
Additionally swaps argument order so runId is always the first parameter
for all stream methods: write, writeMulti, close, get, and list. Updates
all implementations (local, postgres, vercel), callers (serialization,
runtime, CLI, web), tests, and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@VaguelySerious@pranaygp