[world-vercel] Use undici for request HTTP 2 and automatic re-tries - #1211

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/undici
Feb 27, 2026
Merged

[world-vercel] Use undici for request HTTP 2 and automatic re-tries#1211
VaguelySerious merged 4 commits into
mainfrom
peter/undici

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Feb 27, 2026

Copy link
Copy Markdown
Member
  1. Automatic re-tries for most connection issues built-in, also observes re-try after if less than 30s away
  2. HTTP/2 multiplexing enabled (allowH2: true) — provides concurrent requests without head-of-line blocking
  3. HTTP/1.1 pipelining disabled (pipelining: 1) — pipelining deadlocks the webhook respondWith: 'manual' mechanism because the webhook handler and workflow handler share connections via
    the same Agent
  4. Streaming calls excluded from H2 dispatcher — undici's experimental H2 client hangs on both streaming writes (duplex: 'half' PUT) and streaming reads (long-lived GET responses).

@vercel

vercelBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40493fa

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

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

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

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

@github-actions

github-actionsBot commented Feb 27, 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.031s (-11.5% 🟢)1.006s (~)0.974s101.00x
💻 LocalNitro0.034s (+4.0%)1.005s (~)0.972s101.07x
🐘 PostgresExpress0.041s (-33.3% 🟢)1.011s (~)0.971s101.29x
💻 LocalNext.js (Turbopack)0.043s (+5.7% 🔺)1.005s (~)0.962s101.36x
🌐 RedisNext.js (Turbopack)0.043s (-5.3% 🟢)1.005s (~)0.962s101.38x
🐘 PostgresNitro0.051s (-8.4% 🟢)1.011s (~)0.960s101.63x
🌐 MongoDBNext.js (Turbopack)0.076s (-17.8% 🟢)1.007s (~)0.931s102.44x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.492s (-20.9% 🟢)1.975s (-2.9%)1.483s101.00x
▲ VercelExpress0.506s (-25.6% 🟢)2.020s (-4.7%)1.514s101.03x
▲ VercelNext.js (Turbopack)0.511s (-25.2% 🟢)1.916s (-15.5% 🟢)1.405s101.04x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.099s (-3.1%)2.012s (~)0.913s101.00x
💻 LocalNext.js (Turbopack)1.100s (~)2.005s (~)0.905s101.00x
💻 LocalExpress1.103s (-0.9%)2.005s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)1.105s (~)2.006s (~)0.901s101.01x
💻 LocalNitro1.108s (~)2.005s (~)0.897s101.01x
🐘 PostgresNitro1.134s (~)2.011s (~)0.877s101.03x
🌐 MongoDBNext.js (Turbopack)1.305s (~)2.007s (~)0.702s101.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.096s (-11.5% 🟢)3.433s (-3.3%)1.337s101.00x
▲ VercelExpress2.103s (-5.2% 🟢)3.290s (-3.4%)1.187s101.00x
▲ VercelNext.js (Turbopack)2.442s (+11.3% 🔺)3.574s (+6.4% 🔺)1.132s101.16x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.659s (-2.1%)11.038s (~)0.379s31.00x
🌐 RedisNext.js (Turbopack)10.721s (~)11.023s (~)0.302s31.01x
💻 LocalNext.js (Turbopack)10.772s (~)11.023s (~)0.250s31.01x
💻 LocalExpress10.824s (-0.7%)11.021s (~)0.196s31.02x
💻 LocalNitro10.867s (~)11.023s (~)0.156s31.02x
🐘 PostgresNitro10.877s (~)11.041s (~)0.164s31.02x
🌐 MongoDBNext.js (Turbopack)12.216s (~)13.018s (~)0.802s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro16.584s (~)17.876s (+0.6%)1.292s21.00x
▲ VercelExpress17.295s (+3.3%)18.341s (+2.5%)1.046s21.04x
▲ VercelNext.js (Turbopack)17.544s (+0.6%)19.217s (+1.5%)1.673s21.06x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.715s (-2.0%)27.058s (-3.6%)0.343s31.00x
🌐 RedisNext.js (Turbopack)26.915s (~)27.051s (~)0.136s31.01x
🐘 PostgresNitro27.258s (~)28.066s (~)0.808s31.02x
💻 LocalNext.js (Turbopack)27.314s (~)28.052s (~)0.737s31.02x
💻 LocalExpress27.502s (-0.8%)28.049s (~)0.548s31.03x
💻 LocalNitro27.573s (~)28.052s (~)0.479s31.03x
🌐 MongoDBNext.js (Turbopack)30.519s (~)31.046s (~)0.527s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro43.275s (-7.3% 🟢)44.363s (-7.7% 🟢)1.088s21.00x
▲ VercelNext.js (Turbopack)43.682s (-5.6% 🟢)45.267s (-4.2%)1.584s21.01x
▲ VercelExpress44.078s (-2.6%)45.422s (-3.0%)1.344s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express54.082s (-2.1%)54.597s (-2.7%)0.515s21.00x
🌐 RedisNext.js (Turbopack)54.438s (~)55.098s (~)0.659s21.01x
🐘 PostgresNitro55.130s (~)55.604s (+0.9%)0.474s21.02x
💻 LocalNext.js (Turbopack)57.079s (+0.6%)57.603s (+0.9%)0.524s21.06x
💻 LocalExpress57.201s (-0.9%)58.096s (~)0.895s21.06x
💻 LocalNitro57.542s (~)58.102s (~)0.559s21.06x
🌐 MongoDBNext.js (Turbopack)60.938s (~)61.062s (~)0.123s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro94.415s (-2.6%)95.274s (-3.1%)0.859s11.00x
▲ VercelNext.js (Turbopack)95.280s (-3.2%)96.310s (-3.6%)1.030s11.01x
▲ VercelExpress95.360s (-3.6%)96.794s (-3.4%)1.434s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.261s (+0.7%)2.006s (~)0.746s151.00x
🐘 PostgresExpress1.323s (-3.9%)2.010s (~)0.687s151.05x
🐘 PostgresNitro1.397s (~)2.011s (~)0.614s151.11x
💻 LocalExpress1.410s (~)2.004s (~)0.594s151.12x
💻 LocalNitro1.415s (+0.5%)2.005s (~)0.590s151.12x
💻 LocalNext.js (Turbopack)1.442s (+2.9%)2.005s (~)0.563s151.14x
🌐 MongoDBNext.js (Turbopack)2.153s (~)3.007s (~)0.853s101.71x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.368s (-3.3%)3.505s (-3.6%)1.137s91.00x
▲ VercelNitro2.398s (-23.0% 🟢)3.498s (-19.3% 🟢)1.101s91.01x
▲ VercelExpress3.109s (+15.5% 🔺)4.329s (+22.4% 🔺)1.221s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.767s (-13.4% 🟢)2.011s (-22.7% 🟢)0.245s151.00x
🐘 PostgresNitro1.993s (-0.8%)2.513s (~)0.520s121.13x
🌐 RedisNext.js (Turbopack)2.500s (~)3.008s (~)0.508s101.42x
💻 LocalNitro2.617s (+0.6%)3.008s (~)0.391s101.48x
💻 LocalExpress2.618s (+2.9%)3.007s (~)0.390s101.48x
💻 LocalNext.js (Turbopack)2.619s (+3.4%)3.008s (+3.1%)0.388s101.48x
🌐 MongoDBNext.js (Turbopack)4.580s (-3.5%)5.176s (~)0.596s62.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.796s (-6.6% 🟢)3.977s (-4.3%)1.180s81.00x
▲ VercelNext.js (Turbopack)2.972s (-10.1% 🟢)3.818s (-13.9% 🟢)0.845s81.06x
▲ VercelExpress3.922s (+32.2% 🔺)5.139s (+27.8% 🔺)1.216s61.40x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.652s (-20.1% 🟢)3.682s (-8.4% 🟢)1.029s91.00x
🐘 PostgresNitro3.909s (+8.1% 🔺)4.449s (~)0.540s71.47x
🌐 RedisNext.js (Turbopack)4.048s (~)4.582s (~)0.534s71.53x
💻 LocalExpress7.272s (-2.2%)8.020s (~)0.748s42.74x
💻 LocalNitro7.516s (-2.5%)8.016s (~)0.500s42.83x
💻 LocalNext.js (Turbopack)7.840s (+17.6% 🔺)8.268s (+17.9% 🔺)0.428s42.96x
🌐 MongoDBNext.js (Turbopack)9.743s (-0.6%)10.350s (~)0.606s33.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.087s (+4.4%)4.139s (~)1.052s81.00x
▲ VercelNext.js (Turbopack)3.677s (+10.3% 🔺)4.751s (-7.3% 🟢)1.074s71.19x
▲ VercelExpress4.375s (+54.7% 🔺)5.276s (+32.7% 🔺)0.901s61.42x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.251s (-2.1%)2.006s (~)0.755s151.00x
🐘 PostgresExpress1.287s (-7.8% 🟢)2.011s (~)0.723s151.03x
🐘 PostgresNitro1.387s (+1.4%)2.010s (~)0.623s151.11x
💻 LocalExpress1.432s (-2.4%)2.005s (~)0.573s151.14x
💻 LocalNext.js (Turbopack)1.435s (+4.0%)2.005s (~)0.570s151.15x
💻 LocalNitro1.443s (+1.8%)2.005s (~)0.562s151.15x
🌐 MongoDBNext.js (Turbopack)2.170s (~)3.007s (~)0.838s101.73x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.358s (+9.3% 🔺)3.576s (+4.4%)1.218s91.00x
▲ VercelNitro2.378s (-12.0% 🟢)4.027s (+3.2%)1.649s81.01x
▲ VercelNext.js (Turbopack)3.858s (+67.4% 🔺)6.820s (+94.2% 🔺)2.962s51.64x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.837s (-7.6% 🟢)2.227s (-11.5% 🟢)0.390s141.00x
🐘 PostgresNitro2.050s (+3.1%)2.739s (+9.0% 🔺)0.689s111.12x
🌐 RedisNext.js (Turbopack)2.513s (+1.2%)3.008s (~)0.494s101.37x
💻 LocalExpress2.699s (+0.7%)3.007s (~)0.308s101.47x
💻 LocalNitro2.776s (+1.2%)3.008s (~)0.232s101.51x
💻 LocalNext.js (Turbopack)2.804s (+6.4% 🔺)3.108s (+3.3%)0.304s101.53x
🌐 MongoDBNext.js (Turbopack)4.682s (~)5.177s (~)0.495s62.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.650s (-6.6% 🟢)3.767s (-3.8%)1.117s81.00x
▲ VercelNitro2.756s (-21.6% 🟢)3.966s (-14.5% 🟢)1.209s81.04x
▲ VercelExpress2.979s (+11.7% 🔺)4.131s (+3.5%)1.152s81.12x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.075s (-8.8% 🟢)3.891s (-3.2%)0.815s81.00x
🐘 PostgresNitro3.877s (+9.3% 🔺)4.465s (+7.6% 🔺)0.588s71.26x
🌐 RedisNext.js (Turbopack)4.078s (+1.6%)4.868s (+9.7% 🔺)0.790s71.33x
💻 LocalExpress8.158s (+1.1%)8.521s (~)0.363s42.65x
💻 LocalNitro8.384s (+1.2%)9.020s (~)0.636s42.73x
💻 LocalNext.js (Turbopack)8.616s (+13.4% 🔺)9.018s (+12.5% 🔺)0.402s42.80x
🌐 MongoDBNext.js (Turbopack)10.108s (+3.1%)10.347s (~)0.239s33.29x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.384s (+18.6% 🔺)4.291s (+8.6% 🔺)0.907s71.00x
▲ VercelNext.js (Turbopack)3.806s (+28.5% 🔺)4.739s (+20.4% 🔺)0.933s81.12x
▲ VercelNitro4.481s (+43.8% 🔺)5.772s (+34.7% 🔺)1.291s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.146s (-25.2% 🟢)0.998s (+0.7%)0.002s (+7.1% 🔺)1.012s (~)0.866s101.00x
💻 LocalNext.js (Turbopack)0.147s (+5.7% 🔺)1.001s (~)0.011s (+0.9%)1.016s (~)0.869s101.01x
🌐 RedisNext.js (Turbopack)0.150s (+2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.03x
💻 LocalExpress0.174s (-7.4% 🟢)1.002s (~)0.011s (~)1.016s (~)0.842s101.20x
💻 LocalNitro0.184s (+5.3% 🔺)1.002s (~)0.012s (+6.1% 🔺)1.018s (~)0.834s101.26x
🐘 PostgresNitro0.203s (+6.2% 🔺)0.994s (~)0.002s (-5.9% 🟢)1.012s (~)0.809s101.39x
🌐 MongoDBNext.js (Turbopack)0.471s (-2.8%)0.975s (+1.3%)0.002s (~)1.008s (~)0.537s103.23x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.575s (-10.3% 🟢)2.194s (+1.0%)0.128s (-5.9% 🟢)2.769s (-3.3%)1.194s101.00x
▲ VercelExpress1.740s (-3.2%)2.519s (-15.4% 🟢)0.614s (+311.3% 🔺)33.539s (~)31.799s101.10x
▲ VercelNitro1.775s (~)2.509s (+2.4%)0.099s (-84.2% 🟢)63.102s (+1615.8% 🔺)61.326s101.13x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress6/12
🐘 PostgresExpress12/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres11/12
Next.js (Turbopack)🌐 Redis7/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

@github-actions

github-actionsBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production523049572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds112479168
✅ 📋 Other135021156
Total2487472862820

❌ Failed Tests

🌍 Community Worlds (47 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (46 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4705
✅ example4705
✅ express4705
✅ fastify4705
✅ hono4705
✅ nextjs-turbopack5002
✅ nextjs-webpack5002
✅ nitro4705
✅ nuxt4705
✅ sveltekit4705
✅ vite4705
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4913
✅ redis-dev300
✅ redis5003
✅ turso-dev300
❌ turso4463
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

Comment threadpackages/world-vercel/src/http-client.ts Outdated
@socket-security

socket-securityBot commented Feb 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​turbo@​2.8.11 ⏵ 2.8.121001008597100

View full report

VaguelySeriousand others added 3 commits February 27, 2026 11:59
Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. This provides:
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming write operations (writeToStream, writeToStreamMulti, closeStream)
are excluded from the H2 dispatcher because undici's HTTP/2 client hangs
when combined with request bodies on PUT endpoints. Read-only stream calls
(readFromStream, listStreamsByRunId) safely use the dispatcher.
HTTP/1.1 pipelining is left at 1 (disabled) to avoid head-of-line blocking
that deadlocks the webhook respondWith mechanism. HTTP/2 multiplexing
provides the same throughput benefit without this problem.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
test.skipIf(isLocalDeployment())(
'readableStreamWorkflow',
{ timeout: 60_000 },
{ timeout: 80_000 },

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.

:'(

need to tackle improving test perf, especially in my benchmark PR

const response = await fetch(
new Request(url, { method: 'GET', headers })
);
const response = await fetch(url, {

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.

should we not use undici.request / undici.pipeline for maximum performance (as per undici's README where they recommend that to using fetch

// Observe Retry-After header if received
retryAfter: true,
// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.

@TooTallNateTooTallNateFeb 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these status codes retried by default? I'm not seeing any relevant configuration for them.

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.

Yes

method: 'PUT',
body: chunk,
headers: httpConfig.headers,
duplex: 'half',

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.

can you explain why you're removing duplex: 'half'?

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.

There's a comment saying:

 * IMPORTANT: This dispatcher must NOT be used with `duplex: 'half'`
* streaming requests — undici's H2 client hangs when combined with
* half-duplex streams. See streamer.ts for the streaming code path.

headers,
});
const response = await fetch(request);
const response = await fetch(request, {

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.

same. shouldn't we use undici.request for max performance over fetch?

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.

Claude didn't get it working, and the overhead is 0.001% or something, I think it's fine. H2 is what matters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that also apparently undici.request() does not follow redirects by default, but fetch() does - so we should be careful about that (we want to follow redirects to leave the option open to redirect to S3 for the refs):

Yes, fetch() follows HTTP redirects by default, even when using undici's custom dispatcher. The key distinction is:
- undici's Agent.dispatch() / Agent.request() — maxRedirections defaults to 0 (no redirect following). This is the low-level undici API.
- fetch() (the Fetch API) — redirect defaults to 'follow' per the Fetch spec (request.js:850). This is true regardless of which dispatcher is used, because redirect handling is implemented in the Fetch spec layer (lib/web/fetch/index.js:1194), not in the dispatcher layer.
Since the PR uses fetch() with dispatcher: getDispatcher(), redirects will be followed (up to 20 times per the Fetch spec, index.js:1247). The Agent's maxRedirections: 0 setting only applies to undici's own client.request() / client.dispatch() APIs, not to fetch().

Comment threadpackages/world-vercel/package.json Outdated
"@workflow/errors": "workspace:*",
"@workflow/world": "workspace:*",
"cbor-x": "1.6.0",
"undici": "6.22.0",

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.

can we use undici@7? I know there were some issues when I tried to bump it but maybe coudl spend some cycles to just upgrade to 7?

also we should probably put undici in catalog since local world also uses it and we should pin versions across all undici uage in our monorepo

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.

Sure! Will do

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid infrastructure improvement. The HTTP/2 multiplexing and automatic retry via undici's RetryAgent are good wins. The streaming exclusion from H2 is well-documented and the reasoning is sound. A few observations inline.

);
}
return _dispatcher;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The module-level singleton means the dispatcher lives for the entire process lifetime with no way to shut it down. In serverless / short-lived processes this is fine, but if this code ever runs in a long-lived dev server or test suite, the 128 connections and keep-alive timers could leak.

Consider adding a closeDispatcher() export (or making it configurable via APIConfig) for test teardown. Not blocking, but worth noting.

// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
// TODO: We might want to let 429s pass through, so that we can do
// runtime retry-after handling through the queue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The TODO about letting 429s pass through is worth tracking. With RetryAgent retrying 429s up to 5 times (the default maxRetries), and makeRequest in utils.ts also parsing Retry-After headers and throwing WorkflowAPIError with retryAfter for the queue system to handle — there's now a layered retry: undici retries 5 times silently, and only if all 5 fail does the application-level retry kick in.

This is probably fine (belt and suspenders), but the comment on utils.ts:306 ("RetryAgent handles most 429 retries automatically, but this catches the case where retries are exhausted") correctly documents it. Just want to flag that the total retry budget is now 5 * (undici retries) + queue-level retries, which could delay error surfacing.

headers: httpConfig.headers,
}
);
await response.text();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good addition — await response.text() ensures the response body is fully consumed, preventing connection leaks with HTTP/1.1 keep-alive. Without this, unconsumed bodies can hold connections open.

One thing: if the server returns an error status (e.g. 500), this silently discards the error body. The write methods don't check response.ok. Was this intentional? If these endpoints can fail, you might want at least a status check before the early return.

// streaming calls. undici's experimental HTTP/2 client hangs on both
// streaming writes (PUT with body) and streaming reads (long-lived GET
// responses). Standard request/response calls (makeRequest, encryption,
// refs) work fine with H2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comment is clear and well-placed. Since this is a critical constraint, consider also adding a brief note about why the streaming calls don't use the dispatcher at all (not even for retry) — i.e., streaming writes are fire-and-forget with Uint8Array bodies (not ReadableStream), so duplex: 'half' is no longer needed, but the H2 dispatcher is still excluded because the retry behavior could cause duplicate stream writes.

Comment threadpackages/world-vercel/src/utils.ts Outdated
const response = await fetch(request);
const response = await fetch(request, {
dispatcher: getDispatcher(),
} as RequestInit);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: fetch(request, { dispatcher } as RequestInit) — passing a Request object as the first argument and options as the second is a valid pattern, but note that undici's dispatcher option is read from the second argument. If Request already has a body, some implementations may not respect the dispatcher from the second arg. This works in practice with Node's built-in fetch (which is undici under the hood), but it's a subtle API surface. Just flagging for awareness.

Comment threadpackages/world-vercel/src/refs.ts
Comment threadpackages/world-vercel/src/encryption.test.ts
@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Updated to undici 7 and addressed feedback, waiting for CI

Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. Upgrade undici to v7 and
share the version via pnpm catalog between world-vercel and world-local.
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming calls in streamer.ts are excluded from the H2 dispatcher
because undici's HTTP/2 client hangs on both streaming writes and
long-lived streaming reads.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <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.

3 participants

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

[world-vercel] Use undici for request HTTP 2 and automatic re-tries - #1211

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/undici
Feb 27, 2026
Merged

[world-vercel] Use undici for request HTTP 2 and automatic re-tries#1211
VaguelySerious merged 4 commits into
mainfrom
peter/undici

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Feb 27, 2026

Copy link
Copy Markdown
Member
  1. Automatic re-tries for most connection issues built-in, also observes re-try after if less than 30s away
  2. HTTP/2 multiplexing enabled (allowH2: true) — provides concurrent requests without head-of-line blocking
  3. HTTP/1.1 pipelining disabled (pipelining: 1) — pipelining deadlocks the webhook respondWith: 'manual' mechanism because the webhook handler and workflow handler share connections via
    the same Agent
  4. Streaming calls excluded from H2 dispatcher — undici's experimental H2 client hangs on both streaming writes (duplex: 'half' PUT) and streaming reads (long-lived GET responses).

@vercel

vercelBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40493fa

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

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

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

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

@github-actions

github-actionsBot commented Feb 27, 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.031s (-11.5% 🟢)1.006s (~)0.974s101.00x
💻 LocalNitro0.034s (+4.0%)1.005s (~)0.972s101.07x
🐘 PostgresExpress0.041s (-33.3% 🟢)1.011s (~)0.971s101.29x
💻 LocalNext.js (Turbopack)0.043s (+5.7% 🔺)1.005s (~)0.962s101.36x
🌐 RedisNext.js (Turbopack)0.043s (-5.3% 🟢)1.005s (~)0.962s101.38x
🐘 PostgresNitro0.051s (-8.4% 🟢)1.011s (~)0.960s101.63x
🌐 MongoDBNext.js (Turbopack)0.076s (-17.8% 🟢)1.007s (~)0.931s102.44x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.492s (-20.9% 🟢)1.975s (-2.9%)1.483s101.00x
▲ VercelExpress0.506s (-25.6% 🟢)2.020s (-4.7%)1.514s101.03x
▲ VercelNext.js (Turbopack)0.511s (-25.2% 🟢)1.916s (-15.5% 🟢)1.405s101.04x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.099s (-3.1%)2.012s (~)0.913s101.00x
💻 LocalNext.js (Turbopack)1.100s (~)2.005s (~)0.905s101.00x
💻 LocalExpress1.103s (-0.9%)2.005s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)1.105s (~)2.006s (~)0.901s101.01x
💻 LocalNitro1.108s (~)2.005s (~)0.897s101.01x
🐘 PostgresNitro1.134s (~)2.011s (~)0.877s101.03x
🌐 MongoDBNext.js (Turbopack)1.305s (~)2.007s (~)0.702s101.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.096s (-11.5% 🟢)3.433s (-3.3%)1.337s101.00x
▲ VercelExpress2.103s (-5.2% 🟢)3.290s (-3.4%)1.187s101.00x
▲ VercelNext.js (Turbopack)2.442s (+11.3% 🔺)3.574s (+6.4% 🔺)1.132s101.16x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.659s (-2.1%)11.038s (~)0.379s31.00x
🌐 RedisNext.js (Turbopack)10.721s (~)11.023s (~)0.302s31.01x
💻 LocalNext.js (Turbopack)10.772s (~)11.023s (~)0.250s31.01x
💻 LocalExpress10.824s (-0.7%)11.021s (~)0.196s31.02x
💻 LocalNitro10.867s (~)11.023s (~)0.156s31.02x
🐘 PostgresNitro10.877s (~)11.041s (~)0.164s31.02x
🌐 MongoDBNext.js (Turbopack)12.216s (~)13.018s (~)0.802s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro16.584s (~)17.876s (+0.6%)1.292s21.00x
▲ VercelExpress17.295s (+3.3%)18.341s (+2.5%)1.046s21.04x
▲ VercelNext.js (Turbopack)17.544s (+0.6%)19.217s (+1.5%)1.673s21.06x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.715s (-2.0%)27.058s (-3.6%)0.343s31.00x
🌐 RedisNext.js (Turbopack)26.915s (~)27.051s (~)0.136s31.01x
🐘 PostgresNitro27.258s (~)28.066s (~)0.808s31.02x
💻 LocalNext.js (Turbopack)27.314s (~)28.052s (~)0.737s31.02x
💻 LocalExpress27.502s (-0.8%)28.049s (~)0.548s31.03x
💻 LocalNitro27.573s (~)28.052s (~)0.479s31.03x
🌐 MongoDBNext.js (Turbopack)30.519s (~)31.046s (~)0.527s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro43.275s (-7.3% 🟢)44.363s (-7.7% 🟢)1.088s21.00x
▲ VercelNext.js (Turbopack)43.682s (-5.6% 🟢)45.267s (-4.2%)1.584s21.01x
▲ VercelExpress44.078s (-2.6%)45.422s (-3.0%)1.344s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express54.082s (-2.1%)54.597s (-2.7%)0.515s21.00x
🌐 RedisNext.js (Turbopack)54.438s (~)55.098s (~)0.659s21.01x
🐘 PostgresNitro55.130s (~)55.604s (+0.9%)0.474s21.02x
💻 LocalNext.js (Turbopack)57.079s (+0.6%)57.603s (+0.9%)0.524s21.06x
💻 LocalExpress57.201s (-0.9%)58.096s (~)0.895s21.06x
💻 LocalNitro57.542s (~)58.102s (~)0.559s21.06x
🌐 MongoDBNext.js (Turbopack)60.938s (~)61.062s (~)0.123s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro94.415s (-2.6%)95.274s (-3.1%)0.859s11.00x
▲ VercelNext.js (Turbopack)95.280s (-3.2%)96.310s (-3.6%)1.030s11.01x
▲ VercelExpress95.360s (-3.6%)96.794s (-3.4%)1.434s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.261s (+0.7%)2.006s (~)0.746s151.00x
🐘 PostgresExpress1.323s (-3.9%)2.010s (~)0.687s151.05x
🐘 PostgresNitro1.397s (~)2.011s (~)0.614s151.11x
💻 LocalExpress1.410s (~)2.004s (~)0.594s151.12x
💻 LocalNitro1.415s (+0.5%)2.005s (~)0.590s151.12x
💻 LocalNext.js (Turbopack)1.442s (+2.9%)2.005s (~)0.563s151.14x
🌐 MongoDBNext.js (Turbopack)2.153s (~)3.007s (~)0.853s101.71x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.368s (-3.3%)3.505s (-3.6%)1.137s91.00x
▲ VercelNitro2.398s (-23.0% 🟢)3.498s (-19.3% 🟢)1.101s91.01x
▲ VercelExpress3.109s (+15.5% 🔺)4.329s (+22.4% 🔺)1.221s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.767s (-13.4% 🟢)2.011s (-22.7% 🟢)0.245s151.00x
🐘 PostgresNitro1.993s (-0.8%)2.513s (~)0.520s121.13x
🌐 RedisNext.js (Turbopack)2.500s (~)3.008s (~)0.508s101.42x
💻 LocalNitro2.617s (+0.6%)3.008s (~)0.391s101.48x
💻 LocalExpress2.618s (+2.9%)3.007s (~)0.390s101.48x
💻 LocalNext.js (Turbopack)2.619s (+3.4%)3.008s (+3.1%)0.388s101.48x
🌐 MongoDBNext.js (Turbopack)4.580s (-3.5%)5.176s (~)0.596s62.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.796s (-6.6% 🟢)3.977s (-4.3%)1.180s81.00x
▲ VercelNext.js (Turbopack)2.972s (-10.1% 🟢)3.818s (-13.9% 🟢)0.845s81.06x
▲ VercelExpress3.922s (+32.2% 🔺)5.139s (+27.8% 🔺)1.216s61.40x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.652s (-20.1% 🟢)3.682s (-8.4% 🟢)1.029s91.00x
🐘 PostgresNitro3.909s (+8.1% 🔺)4.449s (~)0.540s71.47x
🌐 RedisNext.js (Turbopack)4.048s (~)4.582s (~)0.534s71.53x
💻 LocalExpress7.272s (-2.2%)8.020s (~)0.748s42.74x
💻 LocalNitro7.516s (-2.5%)8.016s (~)0.500s42.83x
💻 LocalNext.js (Turbopack)7.840s (+17.6% 🔺)8.268s (+17.9% 🔺)0.428s42.96x
🌐 MongoDBNext.js (Turbopack)9.743s (-0.6%)10.350s (~)0.606s33.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.087s (+4.4%)4.139s (~)1.052s81.00x
▲ VercelNext.js (Turbopack)3.677s (+10.3% 🔺)4.751s (-7.3% 🟢)1.074s71.19x
▲ VercelExpress4.375s (+54.7% 🔺)5.276s (+32.7% 🔺)0.901s61.42x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.251s (-2.1%)2.006s (~)0.755s151.00x
🐘 PostgresExpress1.287s (-7.8% 🟢)2.011s (~)0.723s151.03x
🐘 PostgresNitro1.387s (+1.4%)2.010s (~)0.623s151.11x
💻 LocalExpress1.432s (-2.4%)2.005s (~)0.573s151.14x
💻 LocalNext.js (Turbopack)1.435s (+4.0%)2.005s (~)0.570s151.15x
💻 LocalNitro1.443s (+1.8%)2.005s (~)0.562s151.15x
🌐 MongoDBNext.js (Turbopack)2.170s (~)3.007s (~)0.838s101.73x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.358s (+9.3% 🔺)3.576s (+4.4%)1.218s91.00x
▲ VercelNitro2.378s (-12.0% 🟢)4.027s (+3.2%)1.649s81.01x
▲ VercelNext.js (Turbopack)3.858s (+67.4% 🔺)6.820s (+94.2% 🔺)2.962s51.64x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.837s (-7.6% 🟢)2.227s (-11.5% 🟢)0.390s141.00x
🐘 PostgresNitro2.050s (+3.1%)2.739s (+9.0% 🔺)0.689s111.12x
🌐 RedisNext.js (Turbopack)2.513s (+1.2%)3.008s (~)0.494s101.37x
💻 LocalExpress2.699s (+0.7%)3.007s (~)0.308s101.47x
💻 LocalNitro2.776s (+1.2%)3.008s (~)0.232s101.51x
💻 LocalNext.js (Turbopack)2.804s (+6.4% 🔺)3.108s (+3.3%)0.304s101.53x
🌐 MongoDBNext.js (Turbopack)4.682s (~)5.177s (~)0.495s62.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.650s (-6.6% 🟢)3.767s (-3.8%)1.117s81.00x
▲ VercelNitro2.756s (-21.6% 🟢)3.966s (-14.5% 🟢)1.209s81.04x
▲ VercelExpress2.979s (+11.7% 🔺)4.131s (+3.5%)1.152s81.12x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.075s (-8.8% 🟢)3.891s (-3.2%)0.815s81.00x
🐘 PostgresNitro3.877s (+9.3% 🔺)4.465s (+7.6% 🔺)0.588s71.26x
🌐 RedisNext.js (Turbopack)4.078s (+1.6%)4.868s (+9.7% 🔺)0.790s71.33x
💻 LocalExpress8.158s (+1.1%)8.521s (~)0.363s42.65x
💻 LocalNitro8.384s (+1.2%)9.020s (~)0.636s42.73x
💻 LocalNext.js (Turbopack)8.616s (+13.4% 🔺)9.018s (+12.5% 🔺)0.402s42.80x
🌐 MongoDBNext.js (Turbopack)10.108s (+3.1%)10.347s (~)0.239s33.29x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.384s (+18.6% 🔺)4.291s (+8.6% 🔺)0.907s71.00x
▲ VercelNext.js (Turbopack)3.806s (+28.5% 🔺)4.739s (+20.4% 🔺)0.933s81.12x
▲ VercelNitro4.481s (+43.8% 🔺)5.772s (+34.7% 🔺)1.291s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.146s (-25.2% 🟢)0.998s (+0.7%)0.002s (+7.1% 🔺)1.012s (~)0.866s101.00x
💻 LocalNext.js (Turbopack)0.147s (+5.7% 🔺)1.001s (~)0.011s (+0.9%)1.016s (~)0.869s101.01x
🌐 RedisNext.js (Turbopack)0.150s (+2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.03x
💻 LocalExpress0.174s (-7.4% 🟢)1.002s (~)0.011s (~)1.016s (~)0.842s101.20x
💻 LocalNitro0.184s (+5.3% 🔺)1.002s (~)0.012s (+6.1% 🔺)1.018s (~)0.834s101.26x
🐘 PostgresNitro0.203s (+6.2% 🔺)0.994s (~)0.002s (-5.9% 🟢)1.012s (~)0.809s101.39x
🌐 MongoDBNext.js (Turbopack)0.471s (-2.8%)0.975s (+1.3%)0.002s (~)1.008s (~)0.537s103.23x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.575s (-10.3% 🟢)2.194s (+1.0%)0.128s (-5.9% 🟢)2.769s (-3.3%)1.194s101.00x
▲ VercelExpress1.740s (-3.2%)2.519s (-15.4% 🟢)0.614s (+311.3% 🔺)33.539s (~)31.799s101.10x
▲ VercelNitro1.775s (~)2.509s (+2.4%)0.099s (-84.2% 🟢)63.102s (+1615.8% 🔺)61.326s101.13x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress6/12
🐘 PostgresExpress12/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres11/12
Next.js (Turbopack)🌐 Redis7/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

@github-actions

github-actionsBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production523049572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds112479168
✅ 📋 Other135021156
Total2487472862820

❌ Failed Tests

🌍 Community Worlds (47 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (46 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4705
✅ example4705
✅ express4705
✅ fastify4705
✅ hono4705
✅ nextjs-turbopack5002
✅ nextjs-webpack5002
✅ nitro4705
✅ nuxt4705
✅ sveltekit4705
✅ vite4705
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4913
✅ redis-dev300
✅ redis5003
✅ turso-dev300
❌ turso4463
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

Comment threadpackages/world-vercel/src/http-client.ts Outdated
@socket-security

socket-securityBot commented Feb 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​turbo@​2.8.11 ⏵ 2.8.121001008597100

View full report

VaguelySeriousand others added 3 commits February 27, 2026 11:59
Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. This provides:
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming write operations (writeToStream, writeToStreamMulti, closeStream)
are excluded from the H2 dispatcher because undici's HTTP/2 client hangs
when combined with request bodies on PUT endpoints. Read-only stream calls
(readFromStream, listStreamsByRunId) safely use the dispatcher.
HTTP/1.1 pipelining is left at 1 (disabled) to avoid head-of-line blocking
that deadlocks the webhook respondWith mechanism. HTTP/2 multiplexing
provides the same throughput benefit without this problem.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
test.skipIf(isLocalDeployment())(
'readableStreamWorkflow',
{ timeout: 60_000 },
{ timeout: 80_000 },

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.

:'(

need to tackle improving test perf, especially in my benchmark PR

const response = await fetch(
new Request(url, { method: 'GET', headers })
);
const response = await fetch(url, {

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.

should we not use undici.request / undici.pipeline for maximum performance (as per undici's README where they recommend that to using fetch

// Observe Retry-After header if received
retryAfter: true,
// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.

@TooTallNateTooTallNateFeb 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these status codes retried by default? I'm not seeing any relevant configuration for them.

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.

Yes

method: 'PUT',
body: chunk,
headers: httpConfig.headers,
duplex: 'half',

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.

can you explain why you're removing duplex: 'half'?

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.

There's a comment saying:

 * IMPORTANT: This dispatcher must NOT be used with `duplex: 'half'`
* streaming requests — undici's H2 client hangs when combined with
* half-duplex streams. See streamer.ts for the streaming code path.

headers,
});
const response = await fetch(request);
const response = await fetch(request, {

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.

same. shouldn't we use undici.request for max performance over fetch?

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.

Claude didn't get it working, and the overhead is 0.001% or something, I think it's fine. H2 is what matters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that also apparently undici.request() does not follow redirects by default, but fetch() does - so we should be careful about that (we want to follow redirects to leave the option open to redirect to S3 for the refs):

Yes, fetch() follows HTTP redirects by default, even when using undici's custom dispatcher. The key distinction is:
- undici's Agent.dispatch() / Agent.request() — maxRedirections defaults to 0 (no redirect following). This is the low-level undici API.
- fetch() (the Fetch API) — redirect defaults to 'follow' per the Fetch spec (request.js:850). This is true regardless of which dispatcher is used, because redirect handling is implemented in the Fetch spec layer (lib/web/fetch/index.js:1194), not in the dispatcher layer.
Since the PR uses fetch() with dispatcher: getDispatcher(), redirects will be followed (up to 20 times per the Fetch spec, index.js:1247). The Agent's maxRedirections: 0 setting only applies to undici's own client.request() / client.dispatch() APIs, not to fetch().

Comment threadpackages/world-vercel/package.json Outdated
"@workflow/errors": "workspace:*",
"@workflow/world": "workspace:*",
"cbor-x": "1.6.0",
"undici": "6.22.0",

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.

can we use undici@7? I know there were some issues when I tried to bump it but maybe coudl spend some cycles to just upgrade to 7?

also we should probably put undici in catalog since local world also uses it and we should pin versions across all undici uage in our monorepo

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.

Sure! Will do

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid infrastructure improvement. The HTTP/2 multiplexing and automatic retry via undici's RetryAgent are good wins. The streaming exclusion from H2 is well-documented and the reasoning is sound. A few observations inline.

);
}
return _dispatcher;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The module-level singleton means the dispatcher lives for the entire process lifetime with no way to shut it down. In serverless / short-lived processes this is fine, but if this code ever runs in a long-lived dev server or test suite, the 128 connections and keep-alive timers could leak.

Consider adding a closeDispatcher() export (or making it configurable via APIConfig) for test teardown. Not blocking, but worth noting.

// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
// TODO: We might want to let 429s pass through, so that we can do
// runtime retry-after handling through the queue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The TODO about letting 429s pass through is worth tracking. With RetryAgent retrying 429s up to 5 times (the default maxRetries), and makeRequest in utils.ts also parsing Retry-After headers and throwing WorkflowAPIError with retryAfter for the queue system to handle — there's now a layered retry: undici retries 5 times silently, and only if all 5 fail does the application-level retry kick in.

This is probably fine (belt and suspenders), but the comment on utils.ts:306 ("RetryAgent handles most 429 retries automatically, but this catches the case where retries are exhausted") correctly documents it. Just want to flag that the total retry budget is now 5 * (undici retries) + queue-level retries, which could delay error surfacing.

headers: httpConfig.headers,
}
);
await response.text();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good addition — await response.text() ensures the response body is fully consumed, preventing connection leaks with HTTP/1.1 keep-alive. Without this, unconsumed bodies can hold connections open.

One thing: if the server returns an error status (e.g. 500), this silently discards the error body. The write methods don't check response.ok. Was this intentional? If these endpoints can fail, you might want at least a status check before the early return.

// streaming calls. undici's experimental HTTP/2 client hangs on both
// streaming writes (PUT with body) and streaming reads (long-lived GET
// responses). Standard request/response calls (makeRequest, encryption,
// refs) work fine with H2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comment is clear and well-placed. Since this is a critical constraint, consider also adding a brief note about why the streaming calls don't use the dispatcher at all (not even for retry) — i.e., streaming writes are fire-and-forget with Uint8Array bodies (not ReadableStream), so duplex: 'half' is no longer needed, but the H2 dispatcher is still excluded because the retry behavior could cause duplicate stream writes.

Comment threadpackages/world-vercel/src/utils.ts Outdated
const response = await fetch(request);
const response = await fetch(request, {
dispatcher: getDispatcher(),
} as RequestInit);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: fetch(request, { dispatcher } as RequestInit) — passing a Request object as the first argument and options as the second is a valid pattern, but note that undici's dispatcher option is read from the second argument. If Request already has a body, some implementations may not respect the dispatcher from the second arg. This works in practice with Node's built-in fetch (which is undici under the hood), but it's a subtle API surface. Just flagging for awareness.

Comment threadpackages/world-vercel/src/refs.ts
Comment threadpackages/world-vercel/src/encryption.test.ts
@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Updated to undici 7 and addressed feedback, waiting for CI

Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. Upgrade undici to v7 and
share the version via pnpm catalog between world-vercel and world-local.
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming calls in streamer.ts are excluded from the H2 dispatcher
because undici's HTTP/2 client hangs on both streaming writes and
long-lived streaming reads.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <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.

3 participants

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

[world-vercel] Use undici for request HTTP 2 and automatic re-tries - #1211

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/undici
Feb 27, 2026
Merged

[world-vercel] Use undici for request HTTP 2 and automatic re-tries#1211
VaguelySerious merged 4 commits into
mainfrom
peter/undici

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Feb 27, 2026

Copy link
Copy Markdown
Member
  1. Automatic re-tries for most connection issues built-in, also observes re-try after if less than 30s away
  2. HTTP/2 multiplexing enabled (allowH2: true) — provides concurrent requests without head-of-line blocking
  3. HTTP/1.1 pipelining disabled (pipelining: 1) — pipelining deadlocks the webhook respondWith: 'manual' mechanism because the webhook handler and workflow handler share connections via
    the same Agent
  4. Streaming calls excluded from H2 dispatcher — undici's experimental H2 client hangs on both streaming writes (duplex: 'half' PUT) and streaming reads (long-lived GET responses).

@vercel

vercelBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40493fa

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

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

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

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

@github-actions

github-actionsBot commented Feb 27, 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.031s (-11.5% 🟢)1.006s (~)0.974s101.00x
💻 LocalNitro0.034s (+4.0%)1.005s (~)0.972s101.07x
🐘 PostgresExpress0.041s (-33.3% 🟢)1.011s (~)0.971s101.29x
💻 LocalNext.js (Turbopack)0.043s (+5.7% 🔺)1.005s (~)0.962s101.36x
🌐 RedisNext.js (Turbopack)0.043s (-5.3% 🟢)1.005s (~)0.962s101.38x
🐘 PostgresNitro0.051s (-8.4% 🟢)1.011s (~)0.960s101.63x
🌐 MongoDBNext.js (Turbopack)0.076s (-17.8% 🟢)1.007s (~)0.931s102.44x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.492s (-20.9% 🟢)1.975s (-2.9%)1.483s101.00x
▲ VercelExpress0.506s (-25.6% 🟢)2.020s (-4.7%)1.514s101.03x
▲ VercelNext.js (Turbopack)0.511s (-25.2% 🟢)1.916s (-15.5% 🟢)1.405s101.04x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.099s (-3.1%)2.012s (~)0.913s101.00x
💻 LocalNext.js (Turbopack)1.100s (~)2.005s (~)0.905s101.00x
💻 LocalExpress1.103s (-0.9%)2.005s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)1.105s (~)2.006s (~)0.901s101.01x
💻 LocalNitro1.108s (~)2.005s (~)0.897s101.01x
🐘 PostgresNitro1.134s (~)2.011s (~)0.877s101.03x
🌐 MongoDBNext.js (Turbopack)1.305s (~)2.007s (~)0.702s101.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.096s (-11.5% 🟢)3.433s (-3.3%)1.337s101.00x
▲ VercelExpress2.103s (-5.2% 🟢)3.290s (-3.4%)1.187s101.00x
▲ VercelNext.js (Turbopack)2.442s (+11.3% 🔺)3.574s (+6.4% 🔺)1.132s101.16x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.659s (-2.1%)11.038s (~)0.379s31.00x
🌐 RedisNext.js (Turbopack)10.721s (~)11.023s (~)0.302s31.01x
💻 LocalNext.js (Turbopack)10.772s (~)11.023s (~)0.250s31.01x
💻 LocalExpress10.824s (-0.7%)11.021s (~)0.196s31.02x
💻 LocalNitro10.867s (~)11.023s (~)0.156s31.02x
🐘 PostgresNitro10.877s (~)11.041s (~)0.164s31.02x
🌐 MongoDBNext.js (Turbopack)12.216s (~)13.018s (~)0.802s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro16.584s (~)17.876s (+0.6%)1.292s21.00x
▲ VercelExpress17.295s (+3.3%)18.341s (+2.5%)1.046s21.04x
▲ VercelNext.js (Turbopack)17.544s (+0.6%)19.217s (+1.5%)1.673s21.06x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.715s (-2.0%)27.058s (-3.6%)0.343s31.00x
🌐 RedisNext.js (Turbopack)26.915s (~)27.051s (~)0.136s31.01x
🐘 PostgresNitro27.258s (~)28.066s (~)0.808s31.02x
💻 LocalNext.js (Turbopack)27.314s (~)28.052s (~)0.737s31.02x
💻 LocalExpress27.502s (-0.8%)28.049s (~)0.548s31.03x
💻 LocalNitro27.573s (~)28.052s (~)0.479s31.03x
🌐 MongoDBNext.js (Turbopack)30.519s (~)31.046s (~)0.527s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro43.275s (-7.3% 🟢)44.363s (-7.7% 🟢)1.088s21.00x
▲ VercelNext.js (Turbopack)43.682s (-5.6% 🟢)45.267s (-4.2%)1.584s21.01x
▲ VercelExpress44.078s (-2.6%)45.422s (-3.0%)1.344s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express54.082s (-2.1%)54.597s (-2.7%)0.515s21.00x
🌐 RedisNext.js (Turbopack)54.438s (~)55.098s (~)0.659s21.01x
🐘 PostgresNitro55.130s (~)55.604s (+0.9%)0.474s21.02x
💻 LocalNext.js (Turbopack)57.079s (+0.6%)57.603s (+0.9%)0.524s21.06x
💻 LocalExpress57.201s (-0.9%)58.096s (~)0.895s21.06x
💻 LocalNitro57.542s (~)58.102s (~)0.559s21.06x
🌐 MongoDBNext.js (Turbopack)60.938s (~)61.062s (~)0.123s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro94.415s (-2.6%)95.274s (-3.1%)0.859s11.00x
▲ VercelNext.js (Turbopack)95.280s (-3.2%)96.310s (-3.6%)1.030s11.01x
▲ VercelExpress95.360s (-3.6%)96.794s (-3.4%)1.434s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.261s (+0.7%)2.006s (~)0.746s151.00x
🐘 PostgresExpress1.323s (-3.9%)2.010s (~)0.687s151.05x
🐘 PostgresNitro1.397s (~)2.011s (~)0.614s151.11x
💻 LocalExpress1.410s (~)2.004s (~)0.594s151.12x
💻 LocalNitro1.415s (+0.5%)2.005s (~)0.590s151.12x
💻 LocalNext.js (Turbopack)1.442s (+2.9%)2.005s (~)0.563s151.14x
🌐 MongoDBNext.js (Turbopack)2.153s (~)3.007s (~)0.853s101.71x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.368s (-3.3%)3.505s (-3.6%)1.137s91.00x
▲ VercelNitro2.398s (-23.0% 🟢)3.498s (-19.3% 🟢)1.101s91.01x
▲ VercelExpress3.109s (+15.5% 🔺)4.329s (+22.4% 🔺)1.221s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.767s (-13.4% 🟢)2.011s (-22.7% 🟢)0.245s151.00x
🐘 PostgresNitro1.993s (-0.8%)2.513s (~)0.520s121.13x
🌐 RedisNext.js (Turbopack)2.500s (~)3.008s (~)0.508s101.42x
💻 LocalNitro2.617s (+0.6%)3.008s (~)0.391s101.48x
💻 LocalExpress2.618s (+2.9%)3.007s (~)0.390s101.48x
💻 LocalNext.js (Turbopack)2.619s (+3.4%)3.008s (+3.1%)0.388s101.48x
🌐 MongoDBNext.js (Turbopack)4.580s (-3.5%)5.176s (~)0.596s62.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.796s (-6.6% 🟢)3.977s (-4.3%)1.180s81.00x
▲ VercelNext.js (Turbopack)2.972s (-10.1% 🟢)3.818s (-13.9% 🟢)0.845s81.06x
▲ VercelExpress3.922s (+32.2% 🔺)5.139s (+27.8% 🔺)1.216s61.40x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.652s (-20.1% 🟢)3.682s (-8.4% 🟢)1.029s91.00x
🐘 PostgresNitro3.909s (+8.1% 🔺)4.449s (~)0.540s71.47x
🌐 RedisNext.js (Turbopack)4.048s (~)4.582s (~)0.534s71.53x
💻 LocalExpress7.272s (-2.2%)8.020s (~)0.748s42.74x
💻 LocalNitro7.516s (-2.5%)8.016s (~)0.500s42.83x
💻 LocalNext.js (Turbopack)7.840s (+17.6% 🔺)8.268s (+17.9% 🔺)0.428s42.96x
🌐 MongoDBNext.js (Turbopack)9.743s (-0.6%)10.350s (~)0.606s33.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.087s (+4.4%)4.139s (~)1.052s81.00x
▲ VercelNext.js (Turbopack)3.677s (+10.3% 🔺)4.751s (-7.3% 🟢)1.074s71.19x
▲ VercelExpress4.375s (+54.7% 🔺)5.276s (+32.7% 🔺)0.901s61.42x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.251s (-2.1%)2.006s (~)0.755s151.00x
🐘 PostgresExpress1.287s (-7.8% 🟢)2.011s (~)0.723s151.03x
🐘 PostgresNitro1.387s (+1.4%)2.010s (~)0.623s151.11x
💻 LocalExpress1.432s (-2.4%)2.005s (~)0.573s151.14x
💻 LocalNext.js (Turbopack)1.435s (+4.0%)2.005s (~)0.570s151.15x
💻 LocalNitro1.443s (+1.8%)2.005s (~)0.562s151.15x
🌐 MongoDBNext.js (Turbopack)2.170s (~)3.007s (~)0.838s101.73x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.358s (+9.3% 🔺)3.576s (+4.4%)1.218s91.00x
▲ VercelNitro2.378s (-12.0% 🟢)4.027s (+3.2%)1.649s81.01x
▲ VercelNext.js (Turbopack)3.858s (+67.4% 🔺)6.820s (+94.2% 🔺)2.962s51.64x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.837s (-7.6% 🟢)2.227s (-11.5% 🟢)0.390s141.00x
🐘 PostgresNitro2.050s (+3.1%)2.739s (+9.0% 🔺)0.689s111.12x
🌐 RedisNext.js (Turbopack)2.513s (+1.2%)3.008s (~)0.494s101.37x
💻 LocalExpress2.699s (+0.7%)3.007s (~)0.308s101.47x
💻 LocalNitro2.776s (+1.2%)3.008s (~)0.232s101.51x
💻 LocalNext.js (Turbopack)2.804s (+6.4% 🔺)3.108s (+3.3%)0.304s101.53x
🌐 MongoDBNext.js (Turbopack)4.682s (~)5.177s (~)0.495s62.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.650s (-6.6% 🟢)3.767s (-3.8%)1.117s81.00x
▲ VercelNitro2.756s (-21.6% 🟢)3.966s (-14.5% 🟢)1.209s81.04x
▲ VercelExpress2.979s (+11.7% 🔺)4.131s (+3.5%)1.152s81.12x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.075s (-8.8% 🟢)3.891s (-3.2%)0.815s81.00x
🐘 PostgresNitro3.877s (+9.3% 🔺)4.465s (+7.6% 🔺)0.588s71.26x
🌐 RedisNext.js (Turbopack)4.078s (+1.6%)4.868s (+9.7% 🔺)0.790s71.33x
💻 LocalExpress8.158s (+1.1%)8.521s (~)0.363s42.65x
💻 LocalNitro8.384s (+1.2%)9.020s (~)0.636s42.73x
💻 LocalNext.js (Turbopack)8.616s (+13.4% 🔺)9.018s (+12.5% 🔺)0.402s42.80x
🌐 MongoDBNext.js (Turbopack)10.108s (+3.1%)10.347s (~)0.239s33.29x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.384s (+18.6% 🔺)4.291s (+8.6% 🔺)0.907s71.00x
▲ VercelNext.js (Turbopack)3.806s (+28.5% 🔺)4.739s (+20.4% 🔺)0.933s81.12x
▲ VercelNitro4.481s (+43.8% 🔺)5.772s (+34.7% 🔺)1.291s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.146s (-25.2% 🟢)0.998s (+0.7%)0.002s (+7.1% 🔺)1.012s (~)0.866s101.00x
💻 LocalNext.js (Turbopack)0.147s (+5.7% 🔺)1.001s (~)0.011s (+0.9%)1.016s (~)0.869s101.01x
🌐 RedisNext.js (Turbopack)0.150s (+2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.03x
💻 LocalExpress0.174s (-7.4% 🟢)1.002s (~)0.011s (~)1.016s (~)0.842s101.20x
💻 LocalNitro0.184s (+5.3% 🔺)1.002s (~)0.012s (+6.1% 🔺)1.018s (~)0.834s101.26x
🐘 PostgresNitro0.203s (+6.2% 🔺)0.994s (~)0.002s (-5.9% 🟢)1.012s (~)0.809s101.39x
🌐 MongoDBNext.js (Turbopack)0.471s (-2.8%)0.975s (+1.3%)0.002s (~)1.008s (~)0.537s103.23x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.575s (-10.3% 🟢)2.194s (+1.0%)0.128s (-5.9% 🟢)2.769s (-3.3%)1.194s101.00x
▲ VercelExpress1.740s (-3.2%)2.519s (-15.4% 🟢)0.614s (+311.3% 🔺)33.539s (~)31.799s101.10x
▲ VercelNitro1.775s (~)2.509s (+2.4%)0.099s (-84.2% 🟢)63.102s (+1615.8% 🔺)61.326s101.13x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress6/12
🐘 PostgresExpress12/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres11/12
Next.js (Turbopack)🌐 Redis7/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

@github-actions

github-actionsBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production523049572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds112479168
✅ 📋 Other135021156
Total2487472862820

❌ Failed Tests

🌍 Community Worlds (47 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (46 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4705
✅ example4705
✅ express4705
✅ fastify4705
✅ hono4705
✅ nextjs-turbopack5002
✅ nextjs-webpack5002
✅ nitro4705
✅ nuxt4705
✅ sveltekit4705
✅ vite4705
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4913
✅ redis-dev300
✅ redis5003
✅ turso-dev300
❌ turso4463
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

Comment threadpackages/world-vercel/src/http-client.ts Outdated
@socket-security

socket-securityBot commented Feb 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​turbo@​2.8.11 ⏵ 2.8.121001008597100

View full report

VaguelySeriousand others added 3 commits February 27, 2026 11:59
Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. This provides:
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming write operations (writeToStream, writeToStreamMulti, closeStream)
are excluded from the H2 dispatcher because undici's HTTP/2 client hangs
when combined with request bodies on PUT endpoints. Read-only stream calls
(readFromStream, listStreamsByRunId) safely use the dispatcher.
HTTP/1.1 pipelining is left at 1 (disabled) to avoid head-of-line blocking
that deadlocks the webhook respondWith mechanism. HTTP/2 multiplexing
provides the same throughput benefit without this problem.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
test.skipIf(isLocalDeployment())(
'readableStreamWorkflow',
{ timeout: 60_000 },
{ timeout: 80_000 },

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.

:'(

need to tackle improving test perf, especially in my benchmark PR

const response = await fetch(
new Request(url, { method: 'GET', headers })
);
const response = await fetch(url, {

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.

should we not use undici.request / undici.pipeline for maximum performance (as per undici's README where they recommend that to using fetch

// Observe Retry-After header if received
retryAfter: true,
// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.

@TooTallNateTooTallNateFeb 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these status codes retried by default? I'm not seeing any relevant configuration for them.

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.

Yes

method: 'PUT',
body: chunk,
headers: httpConfig.headers,
duplex: 'half',

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.

can you explain why you're removing duplex: 'half'?

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.

There's a comment saying:

 * IMPORTANT: This dispatcher must NOT be used with `duplex: 'half'`
* streaming requests — undici's H2 client hangs when combined with
* half-duplex streams. See streamer.ts for the streaming code path.

headers,
});
const response = await fetch(request);
const response = await fetch(request, {

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.

same. shouldn't we use undici.request for max performance over fetch?

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.

Claude didn't get it working, and the overhead is 0.001% or something, I think it's fine. H2 is what matters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that also apparently undici.request() does not follow redirects by default, but fetch() does - so we should be careful about that (we want to follow redirects to leave the option open to redirect to S3 for the refs):

Yes, fetch() follows HTTP redirects by default, even when using undici's custom dispatcher. The key distinction is:
- undici's Agent.dispatch() / Agent.request() — maxRedirections defaults to 0 (no redirect following). This is the low-level undici API.
- fetch() (the Fetch API) — redirect defaults to 'follow' per the Fetch spec (request.js:850). This is true regardless of which dispatcher is used, because redirect handling is implemented in the Fetch spec layer (lib/web/fetch/index.js:1194), not in the dispatcher layer.
Since the PR uses fetch() with dispatcher: getDispatcher(), redirects will be followed (up to 20 times per the Fetch spec, index.js:1247). The Agent's maxRedirections: 0 setting only applies to undici's own client.request() / client.dispatch() APIs, not to fetch().

Comment threadpackages/world-vercel/package.json Outdated
"@workflow/errors": "workspace:*",
"@workflow/world": "workspace:*",
"cbor-x": "1.6.0",
"undici": "6.22.0",

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.

can we use undici@7? I know there were some issues when I tried to bump it but maybe coudl spend some cycles to just upgrade to 7?

also we should probably put undici in catalog since local world also uses it and we should pin versions across all undici uage in our monorepo

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.

Sure! Will do

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid infrastructure improvement. The HTTP/2 multiplexing and automatic retry via undici's RetryAgent are good wins. The streaming exclusion from H2 is well-documented and the reasoning is sound. A few observations inline.

);
}
return _dispatcher;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The module-level singleton means the dispatcher lives for the entire process lifetime with no way to shut it down. In serverless / short-lived processes this is fine, but if this code ever runs in a long-lived dev server or test suite, the 128 connections and keep-alive timers could leak.

Consider adding a closeDispatcher() export (or making it configurable via APIConfig) for test teardown. Not blocking, but worth noting.

// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
// TODO: We might want to let 429s pass through, so that we can do
// runtime retry-after handling through the queue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The TODO about letting 429s pass through is worth tracking. With RetryAgent retrying 429s up to 5 times (the default maxRetries), and makeRequest in utils.ts also parsing Retry-After headers and throwing WorkflowAPIError with retryAfter for the queue system to handle — there's now a layered retry: undici retries 5 times silently, and only if all 5 fail does the application-level retry kick in.

This is probably fine (belt and suspenders), but the comment on utils.ts:306 ("RetryAgent handles most 429 retries automatically, but this catches the case where retries are exhausted") correctly documents it. Just want to flag that the total retry budget is now 5 * (undici retries) + queue-level retries, which could delay error surfacing.

headers: httpConfig.headers,
}
);
await response.text();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good addition — await response.text() ensures the response body is fully consumed, preventing connection leaks with HTTP/1.1 keep-alive. Without this, unconsumed bodies can hold connections open.

One thing: if the server returns an error status (e.g. 500), this silently discards the error body. The write methods don't check response.ok. Was this intentional? If these endpoints can fail, you might want at least a status check before the early return.

// streaming calls. undici's experimental HTTP/2 client hangs on both
// streaming writes (PUT with body) and streaming reads (long-lived GET
// responses). Standard request/response calls (makeRequest, encryption,
// refs) work fine with H2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comment is clear and well-placed. Since this is a critical constraint, consider also adding a brief note about why the streaming calls don't use the dispatcher at all (not even for retry) — i.e., streaming writes are fire-and-forget with Uint8Array bodies (not ReadableStream), so duplex: 'half' is no longer needed, but the H2 dispatcher is still excluded because the retry behavior could cause duplicate stream writes.

Comment threadpackages/world-vercel/src/utils.ts Outdated
const response = await fetch(request);
const response = await fetch(request, {
dispatcher: getDispatcher(),
} as RequestInit);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: fetch(request, { dispatcher } as RequestInit) — passing a Request object as the first argument and options as the second is a valid pattern, but note that undici's dispatcher option is read from the second argument. If Request already has a body, some implementations may not respect the dispatcher from the second arg. This works in practice with Node's built-in fetch (which is undici under the hood), but it's a subtle API surface. Just flagging for awareness.

Comment threadpackages/world-vercel/src/refs.ts
Comment threadpackages/world-vercel/src/encryption.test.ts
@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Updated to undici 7 and addressed feedback, waiting for CI

Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. Upgrade undici to v7 and
share the version via pnpm catalog between world-vercel and world-local.
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming calls in streamer.ts are excluded from the H2 dispatcher
because undici's HTTP/2 client hangs on both streaming writes and
long-lived streaming reads.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <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.

3 participants

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

[world-vercel] Use undici for request HTTP 2 and automatic re-tries - #1211

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/undici
Feb 27, 2026
Merged

[world-vercel] Use undici for request HTTP 2 and automatic re-tries#1211
VaguelySerious merged 4 commits into
mainfrom
peter/undici

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Feb 27, 2026

Copy link
Copy Markdown
Member
  1. Automatic re-tries for most connection issues built-in, also observes re-try after if less than 30s away
  2. HTTP/2 multiplexing enabled (allowH2: true) — provides concurrent requests without head-of-line blocking
  3. HTTP/1.1 pipelining disabled (pipelining: 1) — pipelining deadlocks the webhook respondWith: 'manual' mechanism because the webhook handler and workflow handler share connections via
    the same Agent
  4. Streaming calls excluded from H2 dispatcher — undici's experimental H2 client hangs on both streaming writes (duplex: 'half' PUT) and streaming reads (long-lived GET responses).

@vercel

vercelBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40493fa

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

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

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

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

@github-actions

github-actionsBot commented Feb 27, 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.031s (-11.5% 🟢)1.006s (~)0.974s101.00x
💻 LocalNitro0.034s (+4.0%)1.005s (~)0.972s101.07x
🐘 PostgresExpress0.041s (-33.3% 🟢)1.011s (~)0.971s101.29x
💻 LocalNext.js (Turbopack)0.043s (+5.7% 🔺)1.005s (~)0.962s101.36x
🌐 RedisNext.js (Turbopack)0.043s (-5.3% 🟢)1.005s (~)0.962s101.38x
🐘 PostgresNitro0.051s (-8.4% 🟢)1.011s (~)0.960s101.63x
🌐 MongoDBNext.js (Turbopack)0.076s (-17.8% 🟢)1.007s (~)0.931s102.44x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.492s (-20.9% 🟢)1.975s (-2.9%)1.483s101.00x
▲ VercelExpress0.506s (-25.6% 🟢)2.020s (-4.7%)1.514s101.03x
▲ VercelNext.js (Turbopack)0.511s (-25.2% 🟢)1.916s (-15.5% 🟢)1.405s101.04x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.099s (-3.1%)2.012s (~)0.913s101.00x
💻 LocalNext.js (Turbopack)1.100s (~)2.005s (~)0.905s101.00x
💻 LocalExpress1.103s (-0.9%)2.005s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)1.105s (~)2.006s (~)0.901s101.01x
💻 LocalNitro1.108s (~)2.005s (~)0.897s101.01x
🐘 PostgresNitro1.134s (~)2.011s (~)0.877s101.03x
🌐 MongoDBNext.js (Turbopack)1.305s (~)2.007s (~)0.702s101.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.096s (-11.5% 🟢)3.433s (-3.3%)1.337s101.00x
▲ VercelExpress2.103s (-5.2% 🟢)3.290s (-3.4%)1.187s101.00x
▲ VercelNext.js (Turbopack)2.442s (+11.3% 🔺)3.574s (+6.4% 🔺)1.132s101.16x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.659s (-2.1%)11.038s (~)0.379s31.00x
🌐 RedisNext.js (Turbopack)10.721s (~)11.023s (~)0.302s31.01x
💻 LocalNext.js (Turbopack)10.772s (~)11.023s (~)0.250s31.01x
💻 LocalExpress10.824s (-0.7%)11.021s (~)0.196s31.02x
💻 LocalNitro10.867s (~)11.023s (~)0.156s31.02x
🐘 PostgresNitro10.877s (~)11.041s (~)0.164s31.02x
🌐 MongoDBNext.js (Turbopack)12.216s (~)13.018s (~)0.802s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro16.584s (~)17.876s (+0.6%)1.292s21.00x
▲ VercelExpress17.295s (+3.3%)18.341s (+2.5%)1.046s21.04x
▲ VercelNext.js (Turbopack)17.544s (+0.6%)19.217s (+1.5%)1.673s21.06x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.715s (-2.0%)27.058s (-3.6%)0.343s31.00x
🌐 RedisNext.js (Turbopack)26.915s (~)27.051s (~)0.136s31.01x
🐘 PostgresNitro27.258s (~)28.066s (~)0.808s31.02x
💻 LocalNext.js (Turbopack)27.314s (~)28.052s (~)0.737s31.02x
💻 LocalExpress27.502s (-0.8%)28.049s (~)0.548s31.03x
💻 LocalNitro27.573s (~)28.052s (~)0.479s31.03x
🌐 MongoDBNext.js (Turbopack)30.519s (~)31.046s (~)0.527s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro43.275s (-7.3% 🟢)44.363s (-7.7% 🟢)1.088s21.00x
▲ VercelNext.js (Turbopack)43.682s (-5.6% 🟢)45.267s (-4.2%)1.584s21.01x
▲ VercelExpress44.078s (-2.6%)45.422s (-3.0%)1.344s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express54.082s (-2.1%)54.597s (-2.7%)0.515s21.00x
🌐 RedisNext.js (Turbopack)54.438s (~)55.098s (~)0.659s21.01x
🐘 PostgresNitro55.130s (~)55.604s (+0.9%)0.474s21.02x
💻 LocalNext.js (Turbopack)57.079s (+0.6%)57.603s (+0.9%)0.524s21.06x
💻 LocalExpress57.201s (-0.9%)58.096s (~)0.895s21.06x
💻 LocalNitro57.542s (~)58.102s (~)0.559s21.06x
🌐 MongoDBNext.js (Turbopack)60.938s (~)61.062s (~)0.123s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro94.415s (-2.6%)95.274s (-3.1%)0.859s11.00x
▲ VercelNext.js (Turbopack)95.280s (-3.2%)96.310s (-3.6%)1.030s11.01x
▲ VercelExpress95.360s (-3.6%)96.794s (-3.4%)1.434s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.261s (+0.7%)2.006s (~)0.746s151.00x
🐘 PostgresExpress1.323s (-3.9%)2.010s (~)0.687s151.05x
🐘 PostgresNitro1.397s (~)2.011s (~)0.614s151.11x
💻 LocalExpress1.410s (~)2.004s (~)0.594s151.12x
💻 LocalNitro1.415s (+0.5%)2.005s (~)0.590s151.12x
💻 LocalNext.js (Turbopack)1.442s (+2.9%)2.005s (~)0.563s151.14x
🌐 MongoDBNext.js (Turbopack)2.153s (~)3.007s (~)0.853s101.71x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.368s (-3.3%)3.505s (-3.6%)1.137s91.00x
▲ VercelNitro2.398s (-23.0% 🟢)3.498s (-19.3% 🟢)1.101s91.01x
▲ VercelExpress3.109s (+15.5% 🔺)4.329s (+22.4% 🔺)1.221s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.767s (-13.4% 🟢)2.011s (-22.7% 🟢)0.245s151.00x
🐘 PostgresNitro1.993s (-0.8%)2.513s (~)0.520s121.13x
🌐 RedisNext.js (Turbopack)2.500s (~)3.008s (~)0.508s101.42x
💻 LocalNitro2.617s (+0.6%)3.008s (~)0.391s101.48x
💻 LocalExpress2.618s (+2.9%)3.007s (~)0.390s101.48x
💻 LocalNext.js (Turbopack)2.619s (+3.4%)3.008s (+3.1%)0.388s101.48x
🌐 MongoDBNext.js (Turbopack)4.580s (-3.5%)5.176s (~)0.596s62.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.796s (-6.6% 🟢)3.977s (-4.3%)1.180s81.00x
▲ VercelNext.js (Turbopack)2.972s (-10.1% 🟢)3.818s (-13.9% 🟢)0.845s81.06x
▲ VercelExpress3.922s (+32.2% 🔺)5.139s (+27.8% 🔺)1.216s61.40x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.652s (-20.1% 🟢)3.682s (-8.4% 🟢)1.029s91.00x
🐘 PostgresNitro3.909s (+8.1% 🔺)4.449s (~)0.540s71.47x
🌐 RedisNext.js (Turbopack)4.048s (~)4.582s (~)0.534s71.53x
💻 LocalExpress7.272s (-2.2%)8.020s (~)0.748s42.74x
💻 LocalNitro7.516s (-2.5%)8.016s (~)0.500s42.83x
💻 LocalNext.js (Turbopack)7.840s (+17.6% 🔺)8.268s (+17.9% 🔺)0.428s42.96x
🌐 MongoDBNext.js (Turbopack)9.743s (-0.6%)10.350s (~)0.606s33.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.087s (+4.4%)4.139s (~)1.052s81.00x
▲ VercelNext.js (Turbopack)3.677s (+10.3% 🔺)4.751s (-7.3% 🟢)1.074s71.19x
▲ VercelExpress4.375s (+54.7% 🔺)5.276s (+32.7% 🔺)0.901s61.42x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.251s (-2.1%)2.006s (~)0.755s151.00x
🐘 PostgresExpress1.287s (-7.8% 🟢)2.011s (~)0.723s151.03x
🐘 PostgresNitro1.387s (+1.4%)2.010s (~)0.623s151.11x
💻 LocalExpress1.432s (-2.4%)2.005s (~)0.573s151.14x
💻 LocalNext.js (Turbopack)1.435s (+4.0%)2.005s (~)0.570s151.15x
💻 LocalNitro1.443s (+1.8%)2.005s (~)0.562s151.15x
🌐 MongoDBNext.js (Turbopack)2.170s (~)3.007s (~)0.838s101.73x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.358s (+9.3% 🔺)3.576s (+4.4%)1.218s91.00x
▲ VercelNitro2.378s (-12.0% 🟢)4.027s (+3.2%)1.649s81.01x
▲ VercelNext.js (Turbopack)3.858s (+67.4% 🔺)6.820s (+94.2% 🔺)2.962s51.64x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.837s (-7.6% 🟢)2.227s (-11.5% 🟢)0.390s141.00x
🐘 PostgresNitro2.050s (+3.1%)2.739s (+9.0% 🔺)0.689s111.12x
🌐 RedisNext.js (Turbopack)2.513s (+1.2%)3.008s (~)0.494s101.37x
💻 LocalExpress2.699s (+0.7%)3.007s (~)0.308s101.47x
💻 LocalNitro2.776s (+1.2%)3.008s (~)0.232s101.51x
💻 LocalNext.js (Turbopack)2.804s (+6.4% 🔺)3.108s (+3.3%)0.304s101.53x
🌐 MongoDBNext.js (Turbopack)4.682s (~)5.177s (~)0.495s62.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.650s (-6.6% 🟢)3.767s (-3.8%)1.117s81.00x
▲ VercelNitro2.756s (-21.6% 🟢)3.966s (-14.5% 🟢)1.209s81.04x
▲ VercelExpress2.979s (+11.7% 🔺)4.131s (+3.5%)1.152s81.12x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.075s (-8.8% 🟢)3.891s (-3.2%)0.815s81.00x
🐘 PostgresNitro3.877s (+9.3% 🔺)4.465s (+7.6% 🔺)0.588s71.26x
🌐 RedisNext.js (Turbopack)4.078s (+1.6%)4.868s (+9.7% 🔺)0.790s71.33x
💻 LocalExpress8.158s (+1.1%)8.521s (~)0.363s42.65x
💻 LocalNitro8.384s (+1.2%)9.020s (~)0.636s42.73x
💻 LocalNext.js (Turbopack)8.616s (+13.4% 🔺)9.018s (+12.5% 🔺)0.402s42.80x
🌐 MongoDBNext.js (Turbopack)10.108s (+3.1%)10.347s (~)0.239s33.29x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.384s (+18.6% 🔺)4.291s (+8.6% 🔺)0.907s71.00x
▲ VercelNext.js (Turbopack)3.806s (+28.5% 🔺)4.739s (+20.4% 🔺)0.933s81.12x
▲ VercelNitro4.481s (+43.8% 🔺)5.772s (+34.7% 🔺)1.291s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.146s (-25.2% 🟢)0.998s (+0.7%)0.002s (+7.1% 🔺)1.012s (~)0.866s101.00x
💻 LocalNext.js (Turbopack)0.147s (+5.7% 🔺)1.001s (~)0.011s (+0.9%)1.016s (~)0.869s101.01x
🌐 RedisNext.js (Turbopack)0.150s (+2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.03x
💻 LocalExpress0.174s (-7.4% 🟢)1.002s (~)0.011s (~)1.016s (~)0.842s101.20x
💻 LocalNitro0.184s (+5.3% 🔺)1.002s (~)0.012s (+6.1% 🔺)1.018s (~)0.834s101.26x
🐘 PostgresNitro0.203s (+6.2% 🔺)0.994s (~)0.002s (-5.9% 🟢)1.012s (~)0.809s101.39x
🌐 MongoDBNext.js (Turbopack)0.471s (-2.8%)0.975s (+1.3%)0.002s (~)1.008s (~)0.537s103.23x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.575s (-10.3% 🟢)2.194s (+1.0%)0.128s (-5.9% 🟢)2.769s (-3.3%)1.194s101.00x
▲ VercelExpress1.740s (-3.2%)2.519s (-15.4% 🟢)0.614s (+311.3% 🔺)33.539s (~)31.799s101.10x
▲ VercelNitro1.775s (~)2.509s (+2.4%)0.099s (-84.2% 🟢)63.102s (+1615.8% 🔺)61.326s101.13x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress6/12
🐘 PostgresExpress12/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres11/12
Next.js (Turbopack)🌐 Redis7/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

@github-actions

github-actionsBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production523049572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds112479168
✅ 📋 Other135021156
Total2487472862820

❌ Failed Tests

🌍 Community Worlds (47 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (46 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4705
✅ example4705
✅ express4705
✅ fastify4705
✅ hono4705
✅ nextjs-turbopack5002
✅ nextjs-webpack5002
✅ nitro4705
✅ nuxt4705
✅ sveltekit4705
✅ vite4705
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4913
✅ redis-dev300
✅ redis5003
✅ turso-dev300
❌ turso4463
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

Comment threadpackages/world-vercel/src/http-client.ts Outdated
@socket-security

socket-securityBot commented Feb 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​turbo@​2.8.11 ⏵ 2.8.121001008597100

View full report

VaguelySeriousand others added 3 commits February 27, 2026 11:59
Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. This provides:
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming write operations (writeToStream, writeToStreamMulti, closeStream)
are excluded from the H2 dispatcher because undici's HTTP/2 client hangs
when combined with request bodies on PUT endpoints. Read-only stream calls
(readFromStream, listStreamsByRunId) safely use the dispatcher.
HTTP/1.1 pipelining is left at 1 (disabled) to avoid head-of-line blocking
that deadlocks the webhook respondWith mechanism. HTTP/2 multiplexing
provides the same throughput benefit without this problem.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
test.skipIf(isLocalDeployment())(
'readableStreamWorkflow',
{ timeout: 60_000 },
{ timeout: 80_000 },

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.

:'(

need to tackle improving test perf, especially in my benchmark PR

const response = await fetch(
new Request(url, { method: 'GET', headers })
);
const response = await fetch(url, {

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.

should we not use undici.request / undici.pipeline for maximum performance (as per undici's README where they recommend that to using fetch

// Observe Retry-After header if received
retryAfter: true,
// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.

@TooTallNateTooTallNateFeb 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these status codes retried by default? I'm not seeing any relevant configuration for them.

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.

Yes

method: 'PUT',
body: chunk,
headers: httpConfig.headers,
duplex: 'half',

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.

can you explain why you're removing duplex: 'half'?

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.

There's a comment saying:

 * IMPORTANT: This dispatcher must NOT be used with `duplex: 'half'`
* streaming requests — undici's H2 client hangs when combined with
* half-duplex streams. See streamer.ts for the streaming code path.

headers,
});
const response = await fetch(request);
const response = await fetch(request, {

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.

same. shouldn't we use undici.request for max performance over fetch?

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.

Claude didn't get it working, and the overhead is 0.001% or something, I think it's fine. H2 is what matters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that also apparently undici.request() does not follow redirects by default, but fetch() does - so we should be careful about that (we want to follow redirects to leave the option open to redirect to S3 for the refs):

Yes, fetch() follows HTTP redirects by default, even when using undici's custom dispatcher. The key distinction is:
- undici's Agent.dispatch() / Agent.request() — maxRedirections defaults to 0 (no redirect following). This is the low-level undici API.
- fetch() (the Fetch API) — redirect defaults to 'follow' per the Fetch spec (request.js:850). This is true regardless of which dispatcher is used, because redirect handling is implemented in the Fetch spec layer (lib/web/fetch/index.js:1194), not in the dispatcher layer.
Since the PR uses fetch() with dispatcher: getDispatcher(), redirects will be followed (up to 20 times per the Fetch spec, index.js:1247). The Agent's maxRedirections: 0 setting only applies to undici's own client.request() / client.dispatch() APIs, not to fetch().

Comment threadpackages/world-vercel/package.json Outdated
"@workflow/errors": "workspace:*",
"@workflow/world": "workspace:*",
"cbor-x": "1.6.0",
"undici": "6.22.0",

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.

can we use undici@7? I know there were some issues when I tried to bump it but maybe coudl spend some cycles to just upgrade to 7?

also we should probably put undici in catalog since local world also uses it and we should pin versions across all undici uage in our monorepo

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.

Sure! Will do

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid infrastructure improvement. The HTTP/2 multiplexing and automatic retry via undici's RetryAgent are good wins. The streaming exclusion from H2 is well-documented and the reasoning is sound. A few observations inline.

);
}
return _dispatcher;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The module-level singleton means the dispatcher lives for the entire process lifetime with no way to shut it down. In serverless / short-lived processes this is fine, but if this code ever runs in a long-lived dev server or test suite, the 128 connections and keep-alive timers could leak.

Consider adding a closeDispatcher() export (or making it configurable via APIConfig) for test teardown. Not blocking, but worth noting.

// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
// TODO: We might want to let 429s pass through, so that we can do
// runtime retry-after handling through the queue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The TODO about letting 429s pass through is worth tracking. With RetryAgent retrying 429s up to 5 times (the default maxRetries), and makeRequest in utils.ts also parsing Retry-After headers and throwing WorkflowAPIError with retryAfter for the queue system to handle — there's now a layered retry: undici retries 5 times silently, and only if all 5 fail does the application-level retry kick in.

This is probably fine (belt and suspenders), but the comment on utils.ts:306 ("RetryAgent handles most 429 retries automatically, but this catches the case where retries are exhausted") correctly documents it. Just want to flag that the total retry budget is now 5 * (undici retries) + queue-level retries, which could delay error surfacing.

headers: httpConfig.headers,
}
);
await response.text();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good addition — await response.text() ensures the response body is fully consumed, preventing connection leaks with HTTP/1.1 keep-alive. Without this, unconsumed bodies can hold connections open.

One thing: if the server returns an error status (e.g. 500), this silently discards the error body. The write methods don't check response.ok. Was this intentional? If these endpoints can fail, you might want at least a status check before the early return.

// streaming calls. undici's experimental HTTP/2 client hangs on both
// streaming writes (PUT with body) and streaming reads (long-lived GET
// responses). Standard request/response calls (makeRequest, encryption,
// refs) work fine with H2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comment is clear and well-placed. Since this is a critical constraint, consider also adding a brief note about why the streaming calls don't use the dispatcher at all (not even for retry) — i.e., streaming writes are fire-and-forget with Uint8Array bodies (not ReadableStream), so duplex: 'half' is no longer needed, but the H2 dispatcher is still excluded because the retry behavior could cause duplicate stream writes.

Comment threadpackages/world-vercel/src/utils.ts Outdated
const response = await fetch(request);
const response = await fetch(request, {
dispatcher: getDispatcher(),
} as RequestInit);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: fetch(request, { dispatcher } as RequestInit) — passing a Request object as the first argument and options as the second is a valid pattern, but note that undici's dispatcher option is read from the second argument. If Request already has a body, some implementations may not respect the dispatcher from the second arg. This works in practice with Node's built-in fetch (which is undici under the hood), but it's a subtle API surface. Just flagging for awareness.

Comment threadpackages/world-vercel/src/refs.ts
Comment threadpackages/world-vercel/src/encryption.test.ts
@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Updated to undici 7 and addressed feedback, waiting for CI

Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. Upgrade undici to v7 and
share the version via pnpm catalog between world-vercel and world-local.
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming calls in streamer.ts are excluded from the H2 dispatcher
because undici's HTTP/2 client hangs on both streaming writes and
long-lived streaming reads.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <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.

3 participants

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

[world-vercel] Use undici for request HTTP 2 and automatic re-tries - #1211

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/undici
Feb 27, 2026
Merged

[world-vercel] Use undici for request HTTP 2 and automatic re-tries#1211
VaguelySerious merged 4 commits into
mainfrom
peter/undici

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Feb 27, 2026

Copy link
Copy Markdown
Member
  1. Automatic re-tries for most connection issues built-in, also observes re-try after if less than 30s away
  2. HTTP/2 multiplexing enabled (allowH2: true) — provides concurrent requests without head-of-line blocking
  3. HTTP/1.1 pipelining disabled (pipelining: 1) — pipelining deadlocks the webhook respondWith: 'manual' mechanism because the webhook handler and workflow handler share connections via
    the same Agent
  4. Streaming calls excluded from H2 dispatcher — undici's experimental H2 client hangs on both streaming writes (duplex: 'half' PUT) and streaming reads (long-lived GET responses).

@vercel

vercelBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40493fa

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

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

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

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

@github-actions

github-actionsBot commented Feb 27, 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.031s (-11.5% 🟢)1.006s (~)0.974s101.00x
💻 LocalNitro0.034s (+4.0%)1.005s (~)0.972s101.07x
🐘 PostgresExpress0.041s (-33.3% 🟢)1.011s (~)0.971s101.29x
💻 LocalNext.js (Turbopack)0.043s (+5.7% 🔺)1.005s (~)0.962s101.36x
🌐 RedisNext.js (Turbopack)0.043s (-5.3% 🟢)1.005s (~)0.962s101.38x
🐘 PostgresNitro0.051s (-8.4% 🟢)1.011s (~)0.960s101.63x
🌐 MongoDBNext.js (Turbopack)0.076s (-17.8% 🟢)1.007s (~)0.931s102.44x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.492s (-20.9% 🟢)1.975s (-2.9%)1.483s101.00x
▲ VercelExpress0.506s (-25.6% 🟢)2.020s (-4.7%)1.514s101.03x
▲ VercelNext.js (Turbopack)0.511s (-25.2% 🟢)1.916s (-15.5% 🟢)1.405s101.04x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.099s (-3.1%)2.012s (~)0.913s101.00x
💻 LocalNext.js (Turbopack)1.100s (~)2.005s (~)0.905s101.00x
💻 LocalExpress1.103s (-0.9%)2.005s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)1.105s (~)2.006s (~)0.901s101.01x
💻 LocalNitro1.108s (~)2.005s (~)0.897s101.01x
🐘 PostgresNitro1.134s (~)2.011s (~)0.877s101.03x
🌐 MongoDBNext.js (Turbopack)1.305s (~)2.007s (~)0.702s101.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.096s (-11.5% 🟢)3.433s (-3.3%)1.337s101.00x
▲ VercelExpress2.103s (-5.2% 🟢)3.290s (-3.4%)1.187s101.00x
▲ VercelNext.js (Turbopack)2.442s (+11.3% 🔺)3.574s (+6.4% 🔺)1.132s101.16x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.659s (-2.1%)11.038s (~)0.379s31.00x
🌐 RedisNext.js (Turbopack)10.721s (~)11.023s (~)0.302s31.01x
💻 LocalNext.js (Turbopack)10.772s (~)11.023s (~)0.250s31.01x
💻 LocalExpress10.824s (-0.7%)11.021s (~)0.196s31.02x
💻 LocalNitro10.867s (~)11.023s (~)0.156s31.02x
🐘 PostgresNitro10.877s (~)11.041s (~)0.164s31.02x
🌐 MongoDBNext.js (Turbopack)12.216s (~)13.018s (~)0.802s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro16.584s (~)17.876s (+0.6%)1.292s21.00x
▲ VercelExpress17.295s (+3.3%)18.341s (+2.5%)1.046s21.04x
▲ VercelNext.js (Turbopack)17.544s (+0.6%)19.217s (+1.5%)1.673s21.06x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.715s (-2.0%)27.058s (-3.6%)0.343s31.00x
🌐 RedisNext.js (Turbopack)26.915s (~)27.051s (~)0.136s31.01x
🐘 PostgresNitro27.258s (~)28.066s (~)0.808s31.02x
💻 LocalNext.js (Turbopack)27.314s (~)28.052s (~)0.737s31.02x
💻 LocalExpress27.502s (-0.8%)28.049s (~)0.548s31.03x
💻 LocalNitro27.573s (~)28.052s (~)0.479s31.03x
🌐 MongoDBNext.js (Turbopack)30.519s (~)31.046s (~)0.527s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro43.275s (-7.3% 🟢)44.363s (-7.7% 🟢)1.088s21.00x
▲ VercelNext.js (Turbopack)43.682s (-5.6% 🟢)45.267s (-4.2%)1.584s21.01x
▲ VercelExpress44.078s (-2.6%)45.422s (-3.0%)1.344s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express54.082s (-2.1%)54.597s (-2.7%)0.515s21.00x
🌐 RedisNext.js (Turbopack)54.438s (~)55.098s (~)0.659s21.01x
🐘 PostgresNitro55.130s (~)55.604s (+0.9%)0.474s21.02x
💻 LocalNext.js (Turbopack)57.079s (+0.6%)57.603s (+0.9%)0.524s21.06x
💻 LocalExpress57.201s (-0.9%)58.096s (~)0.895s21.06x
💻 LocalNitro57.542s (~)58.102s (~)0.559s21.06x
🌐 MongoDBNext.js (Turbopack)60.938s (~)61.062s (~)0.123s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro94.415s (-2.6%)95.274s (-3.1%)0.859s11.00x
▲ VercelNext.js (Turbopack)95.280s (-3.2%)96.310s (-3.6%)1.030s11.01x
▲ VercelExpress95.360s (-3.6%)96.794s (-3.4%)1.434s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.261s (+0.7%)2.006s (~)0.746s151.00x
🐘 PostgresExpress1.323s (-3.9%)2.010s (~)0.687s151.05x
🐘 PostgresNitro1.397s (~)2.011s (~)0.614s151.11x
💻 LocalExpress1.410s (~)2.004s (~)0.594s151.12x
💻 LocalNitro1.415s (+0.5%)2.005s (~)0.590s151.12x
💻 LocalNext.js (Turbopack)1.442s (+2.9%)2.005s (~)0.563s151.14x
🌐 MongoDBNext.js (Turbopack)2.153s (~)3.007s (~)0.853s101.71x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.368s (-3.3%)3.505s (-3.6%)1.137s91.00x
▲ VercelNitro2.398s (-23.0% 🟢)3.498s (-19.3% 🟢)1.101s91.01x
▲ VercelExpress3.109s (+15.5% 🔺)4.329s (+22.4% 🔺)1.221s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.767s (-13.4% 🟢)2.011s (-22.7% 🟢)0.245s151.00x
🐘 PostgresNitro1.993s (-0.8%)2.513s (~)0.520s121.13x
🌐 RedisNext.js (Turbopack)2.500s (~)3.008s (~)0.508s101.42x
💻 LocalNitro2.617s (+0.6%)3.008s (~)0.391s101.48x
💻 LocalExpress2.618s (+2.9%)3.007s (~)0.390s101.48x
💻 LocalNext.js (Turbopack)2.619s (+3.4%)3.008s (+3.1%)0.388s101.48x
🌐 MongoDBNext.js (Turbopack)4.580s (-3.5%)5.176s (~)0.596s62.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.796s (-6.6% 🟢)3.977s (-4.3%)1.180s81.00x
▲ VercelNext.js (Turbopack)2.972s (-10.1% 🟢)3.818s (-13.9% 🟢)0.845s81.06x
▲ VercelExpress3.922s (+32.2% 🔺)5.139s (+27.8% 🔺)1.216s61.40x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.652s (-20.1% 🟢)3.682s (-8.4% 🟢)1.029s91.00x
🐘 PostgresNitro3.909s (+8.1% 🔺)4.449s (~)0.540s71.47x
🌐 RedisNext.js (Turbopack)4.048s (~)4.582s (~)0.534s71.53x
💻 LocalExpress7.272s (-2.2%)8.020s (~)0.748s42.74x
💻 LocalNitro7.516s (-2.5%)8.016s (~)0.500s42.83x
💻 LocalNext.js (Turbopack)7.840s (+17.6% 🔺)8.268s (+17.9% 🔺)0.428s42.96x
🌐 MongoDBNext.js (Turbopack)9.743s (-0.6%)10.350s (~)0.606s33.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.087s (+4.4%)4.139s (~)1.052s81.00x
▲ VercelNext.js (Turbopack)3.677s (+10.3% 🔺)4.751s (-7.3% 🟢)1.074s71.19x
▲ VercelExpress4.375s (+54.7% 🔺)5.276s (+32.7% 🔺)0.901s61.42x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.251s (-2.1%)2.006s (~)0.755s151.00x
🐘 PostgresExpress1.287s (-7.8% 🟢)2.011s (~)0.723s151.03x
🐘 PostgresNitro1.387s (+1.4%)2.010s (~)0.623s151.11x
💻 LocalExpress1.432s (-2.4%)2.005s (~)0.573s151.14x
💻 LocalNext.js (Turbopack)1.435s (+4.0%)2.005s (~)0.570s151.15x
💻 LocalNitro1.443s (+1.8%)2.005s (~)0.562s151.15x
🌐 MongoDBNext.js (Turbopack)2.170s (~)3.007s (~)0.838s101.73x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.358s (+9.3% 🔺)3.576s (+4.4%)1.218s91.00x
▲ VercelNitro2.378s (-12.0% 🟢)4.027s (+3.2%)1.649s81.01x
▲ VercelNext.js (Turbopack)3.858s (+67.4% 🔺)6.820s (+94.2% 🔺)2.962s51.64x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.837s (-7.6% 🟢)2.227s (-11.5% 🟢)0.390s141.00x
🐘 PostgresNitro2.050s (+3.1%)2.739s (+9.0% 🔺)0.689s111.12x
🌐 RedisNext.js (Turbopack)2.513s (+1.2%)3.008s (~)0.494s101.37x
💻 LocalExpress2.699s (+0.7%)3.007s (~)0.308s101.47x
💻 LocalNitro2.776s (+1.2%)3.008s (~)0.232s101.51x
💻 LocalNext.js (Turbopack)2.804s (+6.4% 🔺)3.108s (+3.3%)0.304s101.53x
🌐 MongoDBNext.js (Turbopack)4.682s (~)5.177s (~)0.495s62.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.650s (-6.6% 🟢)3.767s (-3.8%)1.117s81.00x
▲ VercelNitro2.756s (-21.6% 🟢)3.966s (-14.5% 🟢)1.209s81.04x
▲ VercelExpress2.979s (+11.7% 🔺)4.131s (+3.5%)1.152s81.12x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.075s (-8.8% 🟢)3.891s (-3.2%)0.815s81.00x
🐘 PostgresNitro3.877s (+9.3% 🔺)4.465s (+7.6% 🔺)0.588s71.26x
🌐 RedisNext.js (Turbopack)4.078s (+1.6%)4.868s (+9.7% 🔺)0.790s71.33x
💻 LocalExpress8.158s (+1.1%)8.521s (~)0.363s42.65x
💻 LocalNitro8.384s (+1.2%)9.020s (~)0.636s42.73x
💻 LocalNext.js (Turbopack)8.616s (+13.4% 🔺)9.018s (+12.5% 🔺)0.402s42.80x
🌐 MongoDBNext.js (Turbopack)10.108s (+3.1%)10.347s (~)0.239s33.29x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.384s (+18.6% 🔺)4.291s (+8.6% 🔺)0.907s71.00x
▲ VercelNext.js (Turbopack)3.806s (+28.5% 🔺)4.739s (+20.4% 🔺)0.933s81.12x
▲ VercelNitro4.481s (+43.8% 🔺)5.772s (+34.7% 🔺)1.291s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.146s (-25.2% 🟢)0.998s (+0.7%)0.002s (+7.1% 🔺)1.012s (~)0.866s101.00x
💻 LocalNext.js (Turbopack)0.147s (+5.7% 🔺)1.001s (~)0.011s (+0.9%)1.016s (~)0.869s101.01x
🌐 RedisNext.js (Turbopack)0.150s (+2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.03x
💻 LocalExpress0.174s (-7.4% 🟢)1.002s (~)0.011s (~)1.016s (~)0.842s101.20x
💻 LocalNitro0.184s (+5.3% 🔺)1.002s (~)0.012s (+6.1% 🔺)1.018s (~)0.834s101.26x
🐘 PostgresNitro0.203s (+6.2% 🔺)0.994s (~)0.002s (-5.9% 🟢)1.012s (~)0.809s101.39x
🌐 MongoDBNext.js (Turbopack)0.471s (-2.8%)0.975s (+1.3%)0.002s (~)1.008s (~)0.537s103.23x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.575s (-10.3% 🟢)2.194s (+1.0%)0.128s (-5.9% 🟢)2.769s (-3.3%)1.194s101.00x
▲ VercelExpress1.740s (-3.2%)2.519s (-15.4% 🟢)0.614s (+311.3% 🔺)33.539s (~)31.799s101.10x
▲ VercelNitro1.775s (~)2.509s (+2.4%)0.099s (-84.2% 🟢)63.102s (+1615.8% 🔺)61.326s101.13x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress6/12
🐘 PostgresExpress12/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres11/12
Next.js (Turbopack)🌐 Redis7/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

@github-actions

github-actionsBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production523049572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds112479168
✅ 📋 Other135021156
Total2487472862820

❌ Failed Tests

🌍 Community Worlds (47 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (46 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4705
✅ example4705
✅ express4705
✅ fastify4705
✅ hono4705
✅ nextjs-turbopack5002
✅ nextjs-webpack5002
✅ nitro4705
✅ nuxt4705
✅ sveltekit4705
✅ vite4705
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4913
✅ redis-dev300
✅ redis5003
✅ turso-dev300
❌ turso4463
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

Comment threadpackages/world-vercel/src/http-client.ts Outdated
@socket-security

socket-securityBot commented Feb 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​turbo@​2.8.11 ⏵ 2.8.121001008597100

View full report

VaguelySeriousand others added 3 commits February 27, 2026 11:59
Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. This provides:
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming write operations (writeToStream, writeToStreamMulti, closeStream)
are excluded from the H2 dispatcher because undici's HTTP/2 client hangs
when combined with request bodies on PUT endpoints. Read-only stream calls
(readFromStream, listStreamsByRunId) safely use the dispatcher.
HTTP/1.1 pipelining is left at 1 (disabled) to avoid head-of-line blocking
that deadlocks the webhook respondWith mechanism. HTTP/2 multiplexing
provides the same throughput benefit without this problem.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
test.skipIf(isLocalDeployment())(
'readableStreamWorkflow',
{ timeout: 60_000 },
{ timeout: 80_000 },

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.

:'(

need to tackle improving test perf, especially in my benchmark PR

const response = await fetch(
new Request(url, { method: 'GET', headers })
);
const response = await fetch(url, {

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.

should we not use undici.request / undici.pipeline for maximum performance (as per undici's README where they recommend that to using fetch

// Observe Retry-After header if received
retryAfter: true,
// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.

@TooTallNateTooTallNateFeb 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these status codes retried by default? I'm not seeing any relevant configuration for them.

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.

Yes

method: 'PUT',
body: chunk,
headers: httpConfig.headers,
duplex: 'half',

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.

can you explain why you're removing duplex: 'half'?

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.

There's a comment saying:

 * IMPORTANT: This dispatcher must NOT be used with `duplex: 'half'`
* streaming requests — undici's H2 client hangs when combined with
* half-duplex streams. See streamer.ts for the streaming code path.

headers,
});
const response = await fetch(request);
const response = await fetch(request, {

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.

same. shouldn't we use undici.request for max performance over fetch?

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.

Claude didn't get it working, and the overhead is 0.001% or something, I think it's fine. H2 is what matters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that also apparently undici.request() does not follow redirects by default, but fetch() does - so we should be careful about that (we want to follow redirects to leave the option open to redirect to S3 for the refs):

Yes, fetch() follows HTTP redirects by default, even when using undici's custom dispatcher. The key distinction is:
- undici's Agent.dispatch() / Agent.request() — maxRedirections defaults to 0 (no redirect following). This is the low-level undici API.
- fetch() (the Fetch API) — redirect defaults to 'follow' per the Fetch spec (request.js:850). This is true regardless of which dispatcher is used, because redirect handling is implemented in the Fetch spec layer (lib/web/fetch/index.js:1194), not in the dispatcher layer.
Since the PR uses fetch() with dispatcher: getDispatcher(), redirects will be followed (up to 20 times per the Fetch spec, index.js:1247). The Agent's maxRedirections: 0 setting only applies to undici's own client.request() / client.dispatch() APIs, not to fetch().

Comment threadpackages/world-vercel/package.json Outdated
"@workflow/errors": "workspace:*",
"@workflow/world": "workspace:*",
"cbor-x": "1.6.0",
"undici": "6.22.0",

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.

can we use undici@7? I know there were some issues when I tried to bump it but maybe coudl spend some cycles to just upgrade to 7?

also we should probably put undici in catalog since local world also uses it and we should pin versions across all undici uage in our monorepo

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.

Sure! Will do

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid infrastructure improvement. The HTTP/2 multiplexing and automatic retry via undici's RetryAgent are good wins. The streaming exclusion from H2 is well-documented and the reasoning is sound. A few observations inline.

);
}
return _dispatcher;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The module-level singleton means the dispatcher lives for the entire process lifetime with no way to shut it down. In serverless / short-lived processes this is fine, but if this code ever runs in a long-lived dev server or test suite, the 128 connections and keep-alive timers could leak.

Consider adding a closeDispatcher() export (or making it configurable via APIConfig) for test teardown. Not blocking, but worth noting.

// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
// TODO: We might want to let 429s pass through, so that we can do
// runtime retry-after handling through the queue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The TODO about letting 429s pass through is worth tracking. With RetryAgent retrying 429s up to 5 times (the default maxRetries), and makeRequest in utils.ts also parsing Retry-After headers and throwing WorkflowAPIError with retryAfter for the queue system to handle — there's now a layered retry: undici retries 5 times silently, and only if all 5 fail does the application-level retry kick in.

This is probably fine (belt and suspenders), but the comment on utils.ts:306 ("RetryAgent handles most 429 retries automatically, but this catches the case where retries are exhausted") correctly documents it. Just want to flag that the total retry budget is now 5 * (undici retries) + queue-level retries, which could delay error surfacing.

headers: httpConfig.headers,
}
);
await response.text();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good addition — await response.text() ensures the response body is fully consumed, preventing connection leaks with HTTP/1.1 keep-alive. Without this, unconsumed bodies can hold connections open.

One thing: if the server returns an error status (e.g. 500), this silently discards the error body. The write methods don't check response.ok. Was this intentional? If these endpoints can fail, you might want at least a status check before the early return.

// streaming calls. undici's experimental HTTP/2 client hangs on both
// streaming writes (PUT with body) and streaming reads (long-lived GET
// responses). Standard request/response calls (makeRequest, encryption,
// refs) work fine with H2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comment is clear and well-placed. Since this is a critical constraint, consider also adding a brief note about why the streaming calls don't use the dispatcher at all (not even for retry) — i.e., streaming writes are fire-and-forget with Uint8Array bodies (not ReadableStream), so duplex: 'half' is no longer needed, but the H2 dispatcher is still excluded because the retry behavior could cause duplicate stream writes.

Comment threadpackages/world-vercel/src/utils.ts Outdated
const response = await fetch(request);
const response = await fetch(request, {
dispatcher: getDispatcher(),
} as RequestInit);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: fetch(request, { dispatcher } as RequestInit) — passing a Request object as the first argument and options as the second is a valid pattern, but note that undici's dispatcher option is read from the second argument. If Request already has a body, some implementations may not respect the dispatcher from the second arg. This works in practice with Node's built-in fetch (which is undici under the hood), but it's a subtle API surface. Just flagging for awareness.

Comment threadpackages/world-vercel/src/refs.ts
Comment threadpackages/world-vercel/src/encryption.test.ts
@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Updated to undici 7 and addressed feedback, waiting for CI

Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. Upgrade undici to v7 and
share the version via pnpm catalog between world-vercel and world-local.
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming calls in streamer.ts are excluded from the H2 dispatcher
because undici's HTTP/2 client hangs on both streaming writes and
long-lived streaming reads.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <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.

3 participants

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

[world-vercel] Use undici for request HTTP 2 and automatic re-tries - #1211

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/undici
Feb 27, 2026
Merged

[world-vercel] Use undici for request HTTP 2 and automatic re-tries#1211
VaguelySerious merged 4 commits into
mainfrom
peter/undici

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Feb 27, 2026

Copy link
Copy Markdown
Member
  1. Automatic re-tries for most connection issues built-in, also observes re-try after if less than 30s away
  2. HTTP/2 multiplexing enabled (allowH2: true) — provides concurrent requests without head-of-line blocking
  3. HTTP/1.1 pipelining disabled (pipelining: 1) — pipelining deadlocks the webhook respondWith: 'manual' mechanism because the webhook handler and workflow handler share connections via
    the same Agent
  4. Streaming calls excluded from H2 dispatcher — undici's experimental H2 client hangs on both streaming writes (duplex: 'half' PUT) and streaming reads (long-lived GET responses).

@vercel

vercelBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40493fa

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

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

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

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

@github-actions

github-actionsBot commented Feb 27, 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.031s (-11.5% 🟢)1.006s (~)0.974s101.00x
💻 LocalNitro0.034s (+4.0%)1.005s (~)0.972s101.07x
🐘 PostgresExpress0.041s (-33.3% 🟢)1.011s (~)0.971s101.29x
💻 LocalNext.js (Turbopack)0.043s (+5.7% 🔺)1.005s (~)0.962s101.36x
🌐 RedisNext.js (Turbopack)0.043s (-5.3% 🟢)1.005s (~)0.962s101.38x
🐘 PostgresNitro0.051s (-8.4% 🟢)1.011s (~)0.960s101.63x
🌐 MongoDBNext.js (Turbopack)0.076s (-17.8% 🟢)1.007s (~)0.931s102.44x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.492s (-20.9% 🟢)1.975s (-2.9%)1.483s101.00x
▲ VercelExpress0.506s (-25.6% 🟢)2.020s (-4.7%)1.514s101.03x
▲ VercelNext.js (Turbopack)0.511s (-25.2% 🟢)1.916s (-15.5% 🟢)1.405s101.04x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.099s (-3.1%)2.012s (~)0.913s101.00x
💻 LocalNext.js (Turbopack)1.100s (~)2.005s (~)0.905s101.00x
💻 LocalExpress1.103s (-0.9%)2.005s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)1.105s (~)2.006s (~)0.901s101.01x
💻 LocalNitro1.108s (~)2.005s (~)0.897s101.01x
🐘 PostgresNitro1.134s (~)2.011s (~)0.877s101.03x
🌐 MongoDBNext.js (Turbopack)1.305s (~)2.007s (~)0.702s101.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.096s (-11.5% 🟢)3.433s (-3.3%)1.337s101.00x
▲ VercelExpress2.103s (-5.2% 🟢)3.290s (-3.4%)1.187s101.00x
▲ VercelNext.js (Turbopack)2.442s (+11.3% 🔺)3.574s (+6.4% 🔺)1.132s101.16x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.659s (-2.1%)11.038s (~)0.379s31.00x
🌐 RedisNext.js (Turbopack)10.721s (~)11.023s (~)0.302s31.01x
💻 LocalNext.js (Turbopack)10.772s (~)11.023s (~)0.250s31.01x
💻 LocalExpress10.824s (-0.7%)11.021s (~)0.196s31.02x
💻 LocalNitro10.867s (~)11.023s (~)0.156s31.02x
🐘 PostgresNitro10.877s (~)11.041s (~)0.164s31.02x
🌐 MongoDBNext.js (Turbopack)12.216s (~)13.018s (~)0.802s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro16.584s (~)17.876s (+0.6%)1.292s21.00x
▲ VercelExpress17.295s (+3.3%)18.341s (+2.5%)1.046s21.04x
▲ VercelNext.js (Turbopack)17.544s (+0.6%)19.217s (+1.5%)1.673s21.06x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.715s (-2.0%)27.058s (-3.6%)0.343s31.00x
🌐 RedisNext.js (Turbopack)26.915s (~)27.051s (~)0.136s31.01x
🐘 PostgresNitro27.258s (~)28.066s (~)0.808s31.02x
💻 LocalNext.js (Turbopack)27.314s (~)28.052s (~)0.737s31.02x
💻 LocalExpress27.502s (-0.8%)28.049s (~)0.548s31.03x
💻 LocalNitro27.573s (~)28.052s (~)0.479s31.03x
🌐 MongoDBNext.js (Turbopack)30.519s (~)31.046s (~)0.527s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro43.275s (-7.3% 🟢)44.363s (-7.7% 🟢)1.088s21.00x
▲ VercelNext.js (Turbopack)43.682s (-5.6% 🟢)45.267s (-4.2%)1.584s21.01x
▲ VercelExpress44.078s (-2.6%)45.422s (-3.0%)1.344s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express54.082s (-2.1%)54.597s (-2.7%)0.515s21.00x
🌐 RedisNext.js (Turbopack)54.438s (~)55.098s (~)0.659s21.01x
🐘 PostgresNitro55.130s (~)55.604s (+0.9%)0.474s21.02x
💻 LocalNext.js (Turbopack)57.079s (+0.6%)57.603s (+0.9%)0.524s21.06x
💻 LocalExpress57.201s (-0.9%)58.096s (~)0.895s21.06x
💻 LocalNitro57.542s (~)58.102s (~)0.559s21.06x
🌐 MongoDBNext.js (Turbopack)60.938s (~)61.062s (~)0.123s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro94.415s (-2.6%)95.274s (-3.1%)0.859s11.00x
▲ VercelNext.js (Turbopack)95.280s (-3.2%)96.310s (-3.6%)1.030s11.01x
▲ VercelExpress95.360s (-3.6%)96.794s (-3.4%)1.434s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.261s (+0.7%)2.006s (~)0.746s151.00x
🐘 PostgresExpress1.323s (-3.9%)2.010s (~)0.687s151.05x
🐘 PostgresNitro1.397s (~)2.011s (~)0.614s151.11x
💻 LocalExpress1.410s (~)2.004s (~)0.594s151.12x
💻 LocalNitro1.415s (+0.5%)2.005s (~)0.590s151.12x
💻 LocalNext.js (Turbopack)1.442s (+2.9%)2.005s (~)0.563s151.14x
🌐 MongoDBNext.js (Turbopack)2.153s (~)3.007s (~)0.853s101.71x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.368s (-3.3%)3.505s (-3.6%)1.137s91.00x
▲ VercelNitro2.398s (-23.0% 🟢)3.498s (-19.3% 🟢)1.101s91.01x
▲ VercelExpress3.109s (+15.5% 🔺)4.329s (+22.4% 🔺)1.221s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.767s (-13.4% 🟢)2.011s (-22.7% 🟢)0.245s151.00x
🐘 PostgresNitro1.993s (-0.8%)2.513s (~)0.520s121.13x
🌐 RedisNext.js (Turbopack)2.500s (~)3.008s (~)0.508s101.42x
💻 LocalNitro2.617s (+0.6%)3.008s (~)0.391s101.48x
💻 LocalExpress2.618s (+2.9%)3.007s (~)0.390s101.48x
💻 LocalNext.js (Turbopack)2.619s (+3.4%)3.008s (+3.1%)0.388s101.48x
🌐 MongoDBNext.js (Turbopack)4.580s (-3.5%)5.176s (~)0.596s62.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.796s (-6.6% 🟢)3.977s (-4.3%)1.180s81.00x
▲ VercelNext.js (Turbopack)2.972s (-10.1% 🟢)3.818s (-13.9% 🟢)0.845s81.06x
▲ VercelExpress3.922s (+32.2% 🔺)5.139s (+27.8% 🔺)1.216s61.40x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.652s (-20.1% 🟢)3.682s (-8.4% 🟢)1.029s91.00x
🐘 PostgresNitro3.909s (+8.1% 🔺)4.449s (~)0.540s71.47x
🌐 RedisNext.js (Turbopack)4.048s (~)4.582s (~)0.534s71.53x
💻 LocalExpress7.272s (-2.2%)8.020s (~)0.748s42.74x
💻 LocalNitro7.516s (-2.5%)8.016s (~)0.500s42.83x
💻 LocalNext.js (Turbopack)7.840s (+17.6% 🔺)8.268s (+17.9% 🔺)0.428s42.96x
🌐 MongoDBNext.js (Turbopack)9.743s (-0.6%)10.350s (~)0.606s33.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.087s (+4.4%)4.139s (~)1.052s81.00x
▲ VercelNext.js (Turbopack)3.677s (+10.3% 🔺)4.751s (-7.3% 🟢)1.074s71.19x
▲ VercelExpress4.375s (+54.7% 🔺)5.276s (+32.7% 🔺)0.901s61.42x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.251s (-2.1%)2.006s (~)0.755s151.00x
🐘 PostgresExpress1.287s (-7.8% 🟢)2.011s (~)0.723s151.03x
🐘 PostgresNitro1.387s (+1.4%)2.010s (~)0.623s151.11x
💻 LocalExpress1.432s (-2.4%)2.005s (~)0.573s151.14x
💻 LocalNext.js (Turbopack)1.435s (+4.0%)2.005s (~)0.570s151.15x
💻 LocalNitro1.443s (+1.8%)2.005s (~)0.562s151.15x
🌐 MongoDBNext.js (Turbopack)2.170s (~)3.007s (~)0.838s101.73x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.358s (+9.3% 🔺)3.576s (+4.4%)1.218s91.00x
▲ VercelNitro2.378s (-12.0% 🟢)4.027s (+3.2%)1.649s81.01x
▲ VercelNext.js (Turbopack)3.858s (+67.4% 🔺)6.820s (+94.2% 🔺)2.962s51.64x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.837s (-7.6% 🟢)2.227s (-11.5% 🟢)0.390s141.00x
🐘 PostgresNitro2.050s (+3.1%)2.739s (+9.0% 🔺)0.689s111.12x
🌐 RedisNext.js (Turbopack)2.513s (+1.2%)3.008s (~)0.494s101.37x
💻 LocalExpress2.699s (+0.7%)3.007s (~)0.308s101.47x
💻 LocalNitro2.776s (+1.2%)3.008s (~)0.232s101.51x
💻 LocalNext.js (Turbopack)2.804s (+6.4% 🔺)3.108s (+3.3%)0.304s101.53x
🌐 MongoDBNext.js (Turbopack)4.682s (~)5.177s (~)0.495s62.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.650s (-6.6% 🟢)3.767s (-3.8%)1.117s81.00x
▲ VercelNitro2.756s (-21.6% 🟢)3.966s (-14.5% 🟢)1.209s81.04x
▲ VercelExpress2.979s (+11.7% 🔺)4.131s (+3.5%)1.152s81.12x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.075s (-8.8% 🟢)3.891s (-3.2%)0.815s81.00x
🐘 PostgresNitro3.877s (+9.3% 🔺)4.465s (+7.6% 🔺)0.588s71.26x
🌐 RedisNext.js (Turbopack)4.078s (+1.6%)4.868s (+9.7% 🔺)0.790s71.33x
💻 LocalExpress8.158s (+1.1%)8.521s (~)0.363s42.65x
💻 LocalNitro8.384s (+1.2%)9.020s (~)0.636s42.73x
💻 LocalNext.js (Turbopack)8.616s (+13.4% 🔺)9.018s (+12.5% 🔺)0.402s42.80x
🌐 MongoDBNext.js (Turbopack)10.108s (+3.1%)10.347s (~)0.239s33.29x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.384s (+18.6% 🔺)4.291s (+8.6% 🔺)0.907s71.00x
▲ VercelNext.js (Turbopack)3.806s (+28.5% 🔺)4.739s (+20.4% 🔺)0.933s81.12x
▲ VercelNitro4.481s (+43.8% 🔺)5.772s (+34.7% 🔺)1.291s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.146s (-25.2% 🟢)0.998s (+0.7%)0.002s (+7.1% 🔺)1.012s (~)0.866s101.00x
💻 LocalNext.js (Turbopack)0.147s (+5.7% 🔺)1.001s (~)0.011s (+0.9%)1.016s (~)0.869s101.01x
🌐 RedisNext.js (Turbopack)0.150s (+2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.03x
💻 LocalExpress0.174s (-7.4% 🟢)1.002s (~)0.011s (~)1.016s (~)0.842s101.20x
💻 LocalNitro0.184s (+5.3% 🔺)1.002s (~)0.012s (+6.1% 🔺)1.018s (~)0.834s101.26x
🐘 PostgresNitro0.203s (+6.2% 🔺)0.994s (~)0.002s (-5.9% 🟢)1.012s (~)0.809s101.39x
🌐 MongoDBNext.js (Turbopack)0.471s (-2.8%)0.975s (+1.3%)0.002s (~)1.008s (~)0.537s103.23x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.575s (-10.3% 🟢)2.194s (+1.0%)0.128s (-5.9% 🟢)2.769s (-3.3%)1.194s101.00x
▲ VercelExpress1.740s (-3.2%)2.519s (-15.4% 🟢)0.614s (+311.3% 🔺)33.539s (~)31.799s101.10x
▲ VercelNitro1.775s (~)2.509s (+2.4%)0.099s (-84.2% 🟢)63.102s (+1615.8% 🔺)61.326s101.13x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress6/12
🐘 PostgresExpress12/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres11/12
Next.js (Turbopack)🌐 Redis7/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

@github-actions

github-actionsBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production523049572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds112479168
✅ 📋 Other135021156
Total2487472862820

❌ Failed Tests

🌍 Community Worlds (47 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (46 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4705
✅ example4705
✅ express4705
✅ fastify4705
✅ hono4705
✅ nextjs-turbopack5002
✅ nextjs-webpack5002
✅ nitro4705
✅ nuxt4705
✅ sveltekit4705
✅ vite4705
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4913
✅ redis-dev300
✅ redis5003
✅ turso-dev300
❌ turso4463
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

Comment threadpackages/world-vercel/src/http-client.ts Outdated
@socket-security

socket-securityBot commented Feb 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​turbo@​2.8.11 ⏵ 2.8.121001008597100

View full report

VaguelySeriousand others added 3 commits February 27, 2026 11:59
Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. This provides:
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming write operations (writeToStream, writeToStreamMulti, closeStream)
are excluded from the H2 dispatcher because undici's HTTP/2 client hangs
when combined with request bodies on PUT endpoints. Read-only stream calls
(readFromStream, listStreamsByRunId) safely use the dispatcher.
HTTP/1.1 pipelining is left at 1 (disabled) to avoid head-of-line blocking
that deadlocks the webhook respondWith mechanism. HTTP/2 multiplexing
provides the same throughput benefit without this problem.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
test.skipIf(isLocalDeployment())(
'readableStreamWorkflow',
{ timeout: 60_000 },
{ timeout: 80_000 },

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.

:'(

need to tackle improving test perf, especially in my benchmark PR

const response = await fetch(
new Request(url, { method: 'GET', headers })
);
const response = await fetch(url, {

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.

should we not use undici.request / undici.pipeline for maximum performance (as per undici's README where they recommend that to using fetch

// Observe Retry-After header if received
retryAfter: true,
// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.

@TooTallNateTooTallNateFeb 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these status codes retried by default? I'm not seeing any relevant configuration for them.

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.

Yes

method: 'PUT',
body: chunk,
headers: httpConfig.headers,
duplex: 'half',

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.

can you explain why you're removing duplex: 'half'?

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.

There's a comment saying:

 * IMPORTANT: This dispatcher must NOT be used with `duplex: 'half'`
* streaming requests — undici's H2 client hangs when combined with
* half-duplex streams. See streamer.ts for the streaming code path.

headers,
});
const response = await fetch(request);
const response = await fetch(request, {

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.

same. shouldn't we use undici.request for max performance over fetch?

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.

Claude didn't get it working, and the overhead is 0.001% or something, I think it's fine. H2 is what matters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that also apparently undici.request() does not follow redirects by default, but fetch() does - so we should be careful about that (we want to follow redirects to leave the option open to redirect to S3 for the refs):

Yes, fetch() follows HTTP redirects by default, even when using undici's custom dispatcher. The key distinction is:
- undici's Agent.dispatch() / Agent.request() — maxRedirections defaults to 0 (no redirect following). This is the low-level undici API.
- fetch() (the Fetch API) — redirect defaults to 'follow' per the Fetch spec (request.js:850). This is true regardless of which dispatcher is used, because redirect handling is implemented in the Fetch spec layer (lib/web/fetch/index.js:1194), not in the dispatcher layer.
Since the PR uses fetch() with dispatcher: getDispatcher(), redirects will be followed (up to 20 times per the Fetch spec, index.js:1247). The Agent's maxRedirections: 0 setting only applies to undici's own client.request() / client.dispatch() APIs, not to fetch().

Comment threadpackages/world-vercel/package.json Outdated
"@workflow/errors": "workspace:*",
"@workflow/world": "workspace:*",
"cbor-x": "1.6.0",
"undici": "6.22.0",

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.

can we use undici@7? I know there were some issues when I tried to bump it but maybe coudl spend some cycles to just upgrade to 7?

also we should probably put undici in catalog since local world also uses it and we should pin versions across all undici uage in our monorepo

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.

Sure! Will do

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid infrastructure improvement. The HTTP/2 multiplexing and automatic retry via undici's RetryAgent are good wins. The streaming exclusion from H2 is well-documented and the reasoning is sound. A few observations inline.

);
}
return _dispatcher;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The module-level singleton means the dispatcher lives for the entire process lifetime with no way to shut it down. In serverless / short-lived processes this is fine, but if this code ever runs in a long-lived dev server or test suite, the 128 connections and keep-alive timers could leak.

Consider adding a closeDispatcher() export (or making it configurable via APIConfig) for test teardown. Not blocking, but worth noting.

// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
// TODO: We might want to let 429s pass through, so that we can do
// runtime retry-after handling through the queue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The TODO about letting 429s pass through is worth tracking. With RetryAgent retrying 429s up to 5 times (the default maxRetries), and makeRequest in utils.ts also parsing Retry-After headers and throwing WorkflowAPIError with retryAfter for the queue system to handle — there's now a layered retry: undici retries 5 times silently, and only if all 5 fail does the application-level retry kick in.

This is probably fine (belt and suspenders), but the comment on utils.ts:306 ("RetryAgent handles most 429 retries automatically, but this catches the case where retries are exhausted") correctly documents it. Just want to flag that the total retry budget is now 5 * (undici retries) + queue-level retries, which could delay error surfacing.

headers: httpConfig.headers,
}
);
await response.text();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good addition — await response.text() ensures the response body is fully consumed, preventing connection leaks with HTTP/1.1 keep-alive. Without this, unconsumed bodies can hold connections open.

One thing: if the server returns an error status (e.g. 500), this silently discards the error body. The write methods don't check response.ok. Was this intentional? If these endpoints can fail, you might want at least a status check before the early return.

// streaming calls. undici's experimental HTTP/2 client hangs on both
// streaming writes (PUT with body) and streaming reads (long-lived GET
// responses). Standard request/response calls (makeRequest, encryption,
// refs) work fine with H2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comment is clear and well-placed. Since this is a critical constraint, consider also adding a brief note about why the streaming calls don't use the dispatcher at all (not even for retry) — i.e., streaming writes are fire-and-forget with Uint8Array bodies (not ReadableStream), so duplex: 'half' is no longer needed, but the H2 dispatcher is still excluded because the retry behavior could cause duplicate stream writes.

Comment threadpackages/world-vercel/src/utils.ts Outdated
const response = await fetch(request);
const response = await fetch(request, {
dispatcher: getDispatcher(),
} as RequestInit);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: fetch(request, { dispatcher } as RequestInit) — passing a Request object as the first argument and options as the second is a valid pattern, but note that undici's dispatcher option is read from the second argument. If Request already has a body, some implementations may not respect the dispatcher from the second arg. This works in practice with Node's built-in fetch (which is undici under the hood), but it's a subtle API surface. Just flagging for awareness.

Comment threadpackages/world-vercel/src/refs.ts
Comment threadpackages/world-vercel/src/encryption.test.ts
@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Updated to undici 7 and addressed feedback, waiting for CI

Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. Upgrade undici to v7 and
share the version via pnpm catalog between world-vercel and world-local.
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming calls in streamer.ts are excluded from the H2 dispatcher
because undici's HTTP/2 client hangs on both streaming writes and
long-lived streaming reads.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <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.

3 participants

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

[world-vercel] Use undici for request HTTP 2 and automatic re-tries - #1211

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/undici
Feb 27, 2026
Merged

[world-vercel] Use undici for request HTTP 2 and automatic re-tries#1211
VaguelySerious merged 4 commits into
mainfrom
peter/undici

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Feb 27, 2026

Copy link
Copy Markdown
Member
  1. Automatic re-tries for most connection issues built-in, also observes re-try after if less than 30s away
  2. HTTP/2 multiplexing enabled (allowH2: true) — provides concurrent requests without head-of-line blocking
  3. HTTP/1.1 pipelining disabled (pipelining: 1) — pipelining deadlocks the webhook respondWith: 'manual' mechanism because the webhook handler and workflow handler share connections via
    the same Agent
  4. Streaming calls excluded from H2 dispatcher — undici's experimental H2 client hangs on both streaming writes (duplex: 'half' PUT) and streaming reads (long-lived GET responses).

@vercel

vercelBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40493fa

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

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

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

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

@github-actions

github-actionsBot commented Feb 27, 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.031s (-11.5% 🟢)1.006s (~)0.974s101.00x
💻 LocalNitro0.034s (+4.0%)1.005s (~)0.972s101.07x
🐘 PostgresExpress0.041s (-33.3% 🟢)1.011s (~)0.971s101.29x
💻 LocalNext.js (Turbopack)0.043s (+5.7% 🔺)1.005s (~)0.962s101.36x
🌐 RedisNext.js (Turbopack)0.043s (-5.3% 🟢)1.005s (~)0.962s101.38x
🐘 PostgresNitro0.051s (-8.4% 🟢)1.011s (~)0.960s101.63x
🌐 MongoDBNext.js (Turbopack)0.076s (-17.8% 🟢)1.007s (~)0.931s102.44x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.492s (-20.9% 🟢)1.975s (-2.9%)1.483s101.00x
▲ VercelExpress0.506s (-25.6% 🟢)2.020s (-4.7%)1.514s101.03x
▲ VercelNext.js (Turbopack)0.511s (-25.2% 🟢)1.916s (-15.5% 🟢)1.405s101.04x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.099s (-3.1%)2.012s (~)0.913s101.00x
💻 LocalNext.js (Turbopack)1.100s (~)2.005s (~)0.905s101.00x
💻 LocalExpress1.103s (-0.9%)2.005s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)1.105s (~)2.006s (~)0.901s101.01x
💻 LocalNitro1.108s (~)2.005s (~)0.897s101.01x
🐘 PostgresNitro1.134s (~)2.011s (~)0.877s101.03x
🌐 MongoDBNext.js (Turbopack)1.305s (~)2.007s (~)0.702s101.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.096s (-11.5% 🟢)3.433s (-3.3%)1.337s101.00x
▲ VercelExpress2.103s (-5.2% 🟢)3.290s (-3.4%)1.187s101.00x
▲ VercelNext.js (Turbopack)2.442s (+11.3% 🔺)3.574s (+6.4% 🔺)1.132s101.16x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.659s (-2.1%)11.038s (~)0.379s31.00x
🌐 RedisNext.js (Turbopack)10.721s (~)11.023s (~)0.302s31.01x
💻 LocalNext.js (Turbopack)10.772s (~)11.023s (~)0.250s31.01x
💻 LocalExpress10.824s (-0.7%)11.021s (~)0.196s31.02x
💻 LocalNitro10.867s (~)11.023s (~)0.156s31.02x
🐘 PostgresNitro10.877s (~)11.041s (~)0.164s31.02x
🌐 MongoDBNext.js (Turbopack)12.216s (~)13.018s (~)0.802s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro16.584s (~)17.876s (+0.6%)1.292s21.00x
▲ VercelExpress17.295s (+3.3%)18.341s (+2.5%)1.046s21.04x
▲ VercelNext.js (Turbopack)17.544s (+0.6%)19.217s (+1.5%)1.673s21.06x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.715s (-2.0%)27.058s (-3.6%)0.343s31.00x
🌐 RedisNext.js (Turbopack)26.915s (~)27.051s (~)0.136s31.01x
🐘 PostgresNitro27.258s (~)28.066s (~)0.808s31.02x
💻 LocalNext.js (Turbopack)27.314s (~)28.052s (~)0.737s31.02x
💻 LocalExpress27.502s (-0.8%)28.049s (~)0.548s31.03x
💻 LocalNitro27.573s (~)28.052s (~)0.479s31.03x
🌐 MongoDBNext.js (Turbopack)30.519s (~)31.046s (~)0.527s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro43.275s (-7.3% 🟢)44.363s (-7.7% 🟢)1.088s21.00x
▲ VercelNext.js (Turbopack)43.682s (-5.6% 🟢)45.267s (-4.2%)1.584s21.01x
▲ VercelExpress44.078s (-2.6%)45.422s (-3.0%)1.344s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express54.082s (-2.1%)54.597s (-2.7%)0.515s21.00x
🌐 RedisNext.js (Turbopack)54.438s (~)55.098s (~)0.659s21.01x
🐘 PostgresNitro55.130s (~)55.604s (+0.9%)0.474s21.02x
💻 LocalNext.js (Turbopack)57.079s (+0.6%)57.603s (+0.9%)0.524s21.06x
💻 LocalExpress57.201s (-0.9%)58.096s (~)0.895s21.06x
💻 LocalNitro57.542s (~)58.102s (~)0.559s21.06x
🌐 MongoDBNext.js (Turbopack)60.938s (~)61.062s (~)0.123s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro94.415s (-2.6%)95.274s (-3.1%)0.859s11.00x
▲ VercelNext.js (Turbopack)95.280s (-3.2%)96.310s (-3.6%)1.030s11.01x
▲ VercelExpress95.360s (-3.6%)96.794s (-3.4%)1.434s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.261s (+0.7%)2.006s (~)0.746s151.00x
🐘 PostgresExpress1.323s (-3.9%)2.010s (~)0.687s151.05x
🐘 PostgresNitro1.397s (~)2.011s (~)0.614s151.11x
💻 LocalExpress1.410s (~)2.004s (~)0.594s151.12x
💻 LocalNitro1.415s (+0.5%)2.005s (~)0.590s151.12x
💻 LocalNext.js (Turbopack)1.442s (+2.9%)2.005s (~)0.563s151.14x
🌐 MongoDBNext.js (Turbopack)2.153s (~)3.007s (~)0.853s101.71x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.368s (-3.3%)3.505s (-3.6%)1.137s91.00x
▲ VercelNitro2.398s (-23.0% 🟢)3.498s (-19.3% 🟢)1.101s91.01x
▲ VercelExpress3.109s (+15.5% 🔺)4.329s (+22.4% 🔺)1.221s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.767s (-13.4% 🟢)2.011s (-22.7% 🟢)0.245s151.00x
🐘 PostgresNitro1.993s (-0.8%)2.513s (~)0.520s121.13x
🌐 RedisNext.js (Turbopack)2.500s (~)3.008s (~)0.508s101.42x
💻 LocalNitro2.617s (+0.6%)3.008s (~)0.391s101.48x
💻 LocalExpress2.618s (+2.9%)3.007s (~)0.390s101.48x
💻 LocalNext.js (Turbopack)2.619s (+3.4%)3.008s (+3.1%)0.388s101.48x
🌐 MongoDBNext.js (Turbopack)4.580s (-3.5%)5.176s (~)0.596s62.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.796s (-6.6% 🟢)3.977s (-4.3%)1.180s81.00x
▲ VercelNext.js (Turbopack)2.972s (-10.1% 🟢)3.818s (-13.9% 🟢)0.845s81.06x
▲ VercelExpress3.922s (+32.2% 🔺)5.139s (+27.8% 🔺)1.216s61.40x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.652s (-20.1% 🟢)3.682s (-8.4% 🟢)1.029s91.00x
🐘 PostgresNitro3.909s (+8.1% 🔺)4.449s (~)0.540s71.47x
🌐 RedisNext.js (Turbopack)4.048s (~)4.582s (~)0.534s71.53x
💻 LocalExpress7.272s (-2.2%)8.020s (~)0.748s42.74x
💻 LocalNitro7.516s (-2.5%)8.016s (~)0.500s42.83x
💻 LocalNext.js (Turbopack)7.840s (+17.6% 🔺)8.268s (+17.9% 🔺)0.428s42.96x
🌐 MongoDBNext.js (Turbopack)9.743s (-0.6%)10.350s (~)0.606s33.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.087s (+4.4%)4.139s (~)1.052s81.00x
▲ VercelNext.js (Turbopack)3.677s (+10.3% 🔺)4.751s (-7.3% 🟢)1.074s71.19x
▲ VercelExpress4.375s (+54.7% 🔺)5.276s (+32.7% 🔺)0.901s61.42x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.251s (-2.1%)2.006s (~)0.755s151.00x
🐘 PostgresExpress1.287s (-7.8% 🟢)2.011s (~)0.723s151.03x
🐘 PostgresNitro1.387s (+1.4%)2.010s (~)0.623s151.11x
💻 LocalExpress1.432s (-2.4%)2.005s (~)0.573s151.14x
💻 LocalNext.js (Turbopack)1.435s (+4.0%)2.005s (~)0.570s151.15x
💻 LocalNitro1.443s (+1.8%)2.005s (~)0.562s151.15x
🌐 MongoDBNext.js (Turbopack)2.170s (~)3.007s (~)0.838s101.73x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.358s (+9.3% 🔺)3.576s (+4.4%)1.218s91.00x
▲ VercelNitro2.378s (-12.0% 🟢)4.027s (+3.2%)1.649s81.01x
▲ VercelNext.js (Turbopack)3.858s (+67.4% 🔺)6.820s (+94.2% 🔺)2.962s51.64x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.837s (-7.6% 🟢)2.227s (-11.5% 🟢)0.390s141.00x
🐘 PostgresNitro2.050s (+3.1%)2.739s (+9.0% 🔺)0.689s111.12x
🌐 RedisNext.js (Turbopack)2.513s (+1.2%)3.008s (~)0.494s101.37x
💻 LocalExpress2.699s (+0.7%)3.007s (~)0.308s101.47x
💻 LocalNitro2.776s (+1.2%)3.008s (~)0.232s101.51x
💻 LocalNext.js (Turbopack)2.804s (+6.4% 🔺)3.108s (+3.3%)0.304s101.53x
🌐 MongoDBNext.js (Turbopack)4.682s (~)5.177s (~)0.495s62.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.650s (-6.6% 🟢)3.767s (-3.8%)1.117s81.00x
▲ VercelNitro2.756s (-21.6% 🟢)3.966s (-14.5% 🟢)1.209s81.04x
▲ VercelExpress2.979s (+11.7% 🔺)4.131s (+3.5%)1.152s81.12x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.075s (-8.8% 🟢)3.891s (-3.2%)0.815s81.00x
🐘 PostgresNitro3.877s (+9.3% 🔺)4.465s (+7.6% 🔺)0.588s71.26x
🌐 RedisNext.js (Turbopack)4.078s (+1.6%)4.868s (+9.7% 🔺)0.790s71.33x
💻 LocalExpress8.158s (+1.1%)8.521s (~)0.363s42.65x
💻 LocalNitro8.384s (+1.2%)9.020s (~)0.636s42.73x
💻 LocalNext.js (Turbopack)8.616s (+13.4% 🔺)9.018s (+12.5% 🔺)0.402s42.80x
🌐 MongoDBNext.js (Turbopack)10.108s (+3.1%)10.347s (~)0.239s33.29x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.384s (+18.6% 🔺)4.291s (+8.6% 🔺)0.907s71.00x
▲ VercelNext.js (Turbopack)3.806s (+28.5% 🔺)4.739s (+20.4% 🔺)0.933s81.12x
▲ VercelNitro4.481s (+43.8% 🔺)5.772s (+34.7% 🔺)1.291s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.146s (-25.2% 🟢)0.998s (+0.7%)0.002s (+7.1% 🔺)1.012s (~)0.866s101.00x
💻 LocalNext.js (Turbopack)0.147s (+5.7% 🔺)1.001s (~)0.011s (+0.9%)1.016s (~)0.869s101.01x
🌐 RedisNext.js (Turbopack)0.150s (+2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.03x
💻 LocalExpress0.174s (-7.4% 🟢)1.002s (~)0.011s (~)1.016s (~)0.842s101.20x
💻 LocalNitro0.184s (+5.3% 🔺)1.002s (~)0.012s (+6.1% 🔺)1.018s (~)0.834s101.26x
🐘 PostgresNitro0.203s (+6.2% 🔺)0.994s (~)0.002s (-5.9% 🟢)1.012s (~)0.809s101.39x
🌐 MongoDBNext.js (Turbopack)0.471s (-2.8%)0.975s (+1.3%)0.002s (~)1.008s (~)0.537s103.23x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.575s (-10.3% 🟢)2.194s (+1.0%)0.128s (-5.9% 🟢)2.769s (-3.3%)1.194s101.00x
▲ VercelExpress1.740s (-3.2%)2.519s (-15.4% 🟢)0.614s (+311.3% 🔺)33.539s (~)31.799s101.10x
▲ VercelNitro1.775s (~)2.509s (+2.4%)0.099s (-84.2% 🟢)63.102s (+1615.8% 🔺)61.326s101.13x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress6/12
🐘 PostgresExpress12/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres11/12
Next.js (Turbopack)🌐 Redis7/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

@github-actions

github-actionsBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production523049572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds112479168
✅ 📋 Other135021156
Total2487472862820

❌ Failed Tests

🌍 Community Worlds (47 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (46 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4705
✅ example4705
✅ express4705
✅ fastify4705
✅ hono4705
✅ nextjs-turbopack5002
✅ nextjs-webpack5002
✅ nitro4705
✅ nuxt4705
✅ sveltekit4705
✅ vite4705
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4913
✅ redis-dev300
✅ redis5003
✅ turso-dev300
❌ turso4463
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

Comment threadpackages/world-vercel/src/http-client.ts Outdated
@socket-security

socket-securityBot commented Feb 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​turbo@​2.8.11 ⏵ 2.8.121001008597100

View full report

VaguelySeriousand others added 3 commits February 27, 2026 11:59
Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. This provides:
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming write operations (writeToStream, writeToStreamMulti, closeStream)
are excluded from the H2 dispatcher because undici's HTTP/2 client hangs
when combined with request bodies on PUT endpoints. Read-only stream calls
(readFromStream, listStreamsByRunId) safely use the dispatcher.
HTTP/1.1 pipelining is left at 1 (disabled) to avoid head-of-line blocking
that deadlocks the webhook respondWith mechanism. HTTP/2 multiplexing
provides the same throughput benefit without this problem.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
test.skipIf(isLocalDeployment())(
'readableStreamWorkflow',
{ timeout: 60_000 },
{ timeout: 80_000 },

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.

:'(

need to tackle improving test perf, especially in my benchmark PR

const response = await fetch(
new Request(url, { method: 'GET', headers })
);
const response = await fetch(url, {

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.

should we not use undici.request / undici.pipeline for maximum performance (as per undici's README where they recommend that to using fetch

// Observe Retry-After header if received
retryAfter: true,
// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.

@TooTallNateTooTallNateFeb 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these status codes retried by default? I'm not seeing any relevant configuration for them.

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.

Yes

method: 'PUT',
body: chunk,
headers: httpConfig.headers,
duplex: 'half',

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.

can you explain why you're removing duplex: 'half'?

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.

There's a comment saying:

 * IMPORTANT: This dispatcher must NOT be used with `duplex: 'half'`
* streaming requests — undici's H2 client hangs when combined with
* half-duplex streams. See streamer.ts for the streaming code path.

headers,
});
const response = await fetch(request);
const response = await fetch(request, {

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.

same. shouldn't we use undici.request for max performance over fetch?

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.

Claude didn't get it working, and the overhead is 0.001% or something, I think it's fine. H2 is what matters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that also apparently undici.request() does not follow redirects by default, but fetch() does - so we should be careful about that (we want to follow redirects to leave the option open to redirect to S3 for the refs):

Yes, fetch() follows HTTP redirects by default, even when using undici's custom dispatcher. The key distinction is:
- undici's Agent.dispatch() / Agent.request() — maxRedirections defaults to 0 (no redirect following). This is the low-level undici API.
- fetch() (the Fetch API) — redirect defaults to 'follow' per the Fetch spec (request.js:850). This is true regardless of which dispatcher is used, because redirect handling is implemented in the Fetch spec layer (lib/web/fetch/index.js:1194), not in the dispatcher layer.
Since the PR uses fetch() with dispatcher: getDispatcher(), redirects will be followed (up to 20 times per the Fetch spec, index.js:1247). The Agent's maxRedirections: 0 setting only applies to undici's own client.request() / client.dispatch() APIs, not to fetch().

Comment threadpackages/world-vercel/package.json Outdated
"@workflow/errors": "workspace:*",
"@workflow/world": "workspace:*",
"cbor-x": "1.6.0",
"undici": "6.22.0",

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.

can we use undici@7? I know there were some issues when I tried to bump it but maybe coudl spend some cycles to just upgrade to 7?

also we should probably put undici in catalog since local world also uses it and we should pin versions across all undici uage in our monorepo

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.

Sure! Will do

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid infrastructure improvement. The HTTP/2 multiplexing and automatic retry via undici's RetryAgent are good wins. The streaming exclusion from H2 is well-documented and the reasoning is sound. A few observations inline.

);
}
return _dispatcher;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The module-level singleton means the dispatcher lives for the entire process lifetime with no way to shut it down. In serverless / short-lived processes this is fine, but if this code ever runs in a long-lived dev server or test suite, the 128 connections and keep-alive timers could leak.

Consider adding a closeDispatcher() export (or making it configurable via APIConfig) for test teardown. Not blocking, but worth noting.

// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
// TODO: We might want to let 429s pass through, so that we can do
// runtime retry-after handling through the queue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The TODO about letting 429s pass through is worth tracking. With RetryAgent retrying 429s up to 5 times (the default maxRetries), and makeRequest in utils.ts also parsing Retry-After headers and throwing WorkflowAPIError with retryAfter for the queue system to handle — there's now a layered retry: undici retries 5 times silently, and only if all 5 fail does the application-level retry kick in.

This is probably fine (belt and suspenders), but the comment on utils.ts:306 ("RetryAgent handles most 429 retries automatically, but this catches the case where retries are exhausted") correctly documents it. Just want to flag that the total retry budget is now 5 * (undici retries) + queue-level retries, which could delay error surfacing.

headers: httpConfig.headers,
}
);
await response.text();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good addition — await response.text() ensures the response body is fully consumed, preventing connection leaks with HTTP/1.1 keep-alive. Without this, unconsumed bodies can hold connections open.

One thing: if the server returns an error status (e.g. 500), this silently discards the error body. The write methods don't check response.ok. Was this intentional? If these endpoints can fail, you might want at least a status check before the early return.

// streaming calls. undici's experimental HTTP/2 client hangs on both
// streaming writes (PUT with body) and streaming reads (long-lived GET
// responses). Standard request/response calls (makeRequest, encryption,
// refs) work fine with H2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comment is clear and well-placed. Since this is a critical constraint, consider also adding a brief note about why the streaming calls don't use the dispatcher at all (not even for retry) — i.e., streaming writes are fire-and-forget with Uint8Array bodies (not ReadableStream), so duplex: 'half' is no longer needed, but the H2 dispatcher is still excluded because the retry behavior could cause duplicate stream writes.

Comment threadpackages/world-vercel/src/utils.ts Outdated
const response = await fetch(request);
const response = await fetch(request, {
dispatcher: getDispatcher(),
} as RequestInit);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: fetch(request, { dispatcher } as RequestInit) — passing a Request object as the first argument and options as the second is a valid pattern, but note that undici's dispatcher option is read from the second argument. If Request already has a body, some implementations may not respect the dispatcher from the second arg. This works in practice with Node's built-in fetch (which is undici under the hood), but it's a subtle API surface. Just flagging for awareness.

Comment threadpackages/world-vercel/src/refs.ts
Comment threadpackages/world-vercel/src/encryption.test.ts
@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Updated to undici 7 and addressed feedback, waiting for CI

Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. Upgrade undici to v7 and
share the version via pnpm catalog between world-vercel and world-local.
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming calls in streamer.ts are excluded from the H2 dispatcher
because undici's HTTP/2 client hangs on both streaming writes and
long-lived streaming reads.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <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.

3 participants

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

[world-vercel] Use undici for request HTTP 2 and automatic re-tries - #1211

Merged
VaguelySerious merged 4 commits into
mainfrom
peter/undici
Feb 27, 2026
Merged

[world-vercel] Use undici for request HTTP 2 and automatic re-tries#1211
VaguelySerious merged 4 commits into
mainfrom
peter/undici

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Feb 27, 2026

Copy link
Copy Markdown
Member
  1. Automatic re-tries for most connection issues built-in, also observes re-try after if less than 30s away
  2. HTTP/2 multiplexing enabled (allowH2: true) — provides concurrent requests without head-of-line blocking
  3. HTTP/1.1 pipelining disabled (pipelining: 1) — pipelining deadlocks the webhook respondWith: 'manual' mechanism because the webhook handler and workflow handler share connections via
    the same Agent
  4. Streaming calls excluded from H2 dispatcher — undici's experimental H2 client hangs on both streaming writes (duplex: 'half' PUT) and streaming reads (long-lived GET responses).

@vercel

vercelBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40493fa

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

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

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

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

@github-actions

github-actionsBot commented Feb 27, 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.031s (-11.5% 🟢)1.006s (~)0.974s101.00x
💻 LocalNitro0.034s (+4.0%)1.005s (~)0.972s101.07x
🐘 PostgresExpress0.041s (-33.3% 🟢)1.011s (~)0.971s101.29x
💻 LocalNext.js (Turbopack)0.043s (+5.7% 🔺)1.005s (~)0.962s101.36x
🌐 RedisNext.js (Turbopack)0.043s (-5.3% 🟢)1.005s (~)0.962s101.38x
🐘 PostgresNitro0.051s (-8.4% 🟢)1.011s (~)0.960s101.63x
🌐 MongoDBNext.js (Turbopack)0.076s (-17.8% 🟢)1.007s (~)0.931s102.44x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.492s (-20.9% 🟢)1.975s (-2.9%)1.483s101.00x
▲ VercelExpress0.506s (-25.6% 🟢)2.020s (-4.7%)1.514s101.03x
▲ VercelNext.js (Turbopack)0.511s (-25.2% 🟢)1.916s (-15.5% 🟢)1.405s101.04x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.099s (-3.1%)2.012s (~)0.913s101.00x
💻 LocalNext.js (Turbopack)1.100s (~)2.005s (~)0.905s101.00x
💻 LocalExpress1.103s (-0.9%)2.005s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)1.105s (~)2.006s (~)0.901s101.01x
💻 LocalNitro1.108s (~)2.005s (~)0.897s101.01x
🐘 PostgresNitro1.134s (~)2.011s (~)0.877s101.03x
🌐 MongoDBNext.js (Turbopack)1.305s (~)2.007s (~)0.702s101.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.096s (-11.5% 🟢)3.433s (-3.3%)1.337s101.00x
▲ VercelExpress2.103s (-5.2% 🟢)3.290s (-3.4%)1.187s101.00x
▲ VercelNext.js (Turbopack)2.442s (+11.3% 🔺)3.574s (+6.4% 🔺)1.132s101.16x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.659s (-2.1%)11.038s (~)0.379s31.00x
🌐 RedisNext.js (Turbopack)10.721s (~)11.023s (~)0.302s31.01x
💻 LocalNext.js (Turbopack)10.772s (~)11.023s (~)0.250s31.01x
💻 LocalExpress10.824s (-0.7%)11.021s (~)0.196s31.02x
💻 LocalNitro10.867s (~)11.023s (~)0.156s31.02x
🐘 PostgresNitro10.877s (~)11.041s (~)0.164s31.02x
🌐 MongoDBNext.js (Turbopack)12.216s (~)13.018s (~)0.802s31.15x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro16.584s (~)17.876s (+0.6%)1.292s21.00x
▲ VercelExpress17.295s (+3.3%)18.341s (+2.5%)1.046s21.04x
▲ VercelNext.js (Turbopack)17.544s (+0.6%)19.217s (+1.5%)1.673s21.06x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express26.715s (-2.0%)27.058s (-3.6%)0.343s31.00x
🌐 RedisNext.js (Turbopack)26.915s (~)27.051s (~)0.136s31.01x
🐘 PostgresNitro27.258s (~)28.066s (~)0.808s31.02x
💻 LocalNext.js (Turbopack)27.314s (~)28.052s (~)0.737s31.02x
💻 LocalExpress27.502s (-0.8%)28.049s (~)0.548s31.03x
💻 LocalNitro27.573s (~)28.052s (~)0.479s31.03x
🌐 MongoDBNext.js (Turbopack)30.519s (~)31.046s (~)0.527s21.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro43.275s (-7.3% 🟢)44.363s (-7.7% 🟢)1.088s21.00x
▲ VercelNext.js (Turbopack)43.682s (-5.6% 🟢)45.267s (-4.2%)1.584s21.01x
▲ VercelExpress44.078s (-2.6%)45.422s (-3.0%)1.344s21.02x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express54.082s (-2.1%)54.597s (-2.7%)0.515s21.00x
🌐 RedisNext.js (Turbopack)54.438s (~)55.098s (~)0.659s21.01x
🐘 PostgresNitro55.130s (~)55.604s (+0.9%)0.474s21.02x
💻 LocalNext.js (Turbopack)57.079s (+0.6%)57.603s (+0.9%)0.524s21.06x
💻 LocalExpress57.201s (-0.9%)58.096s (~)0.895s21.06x
💻 LocalNitro57.542s (~)58.102s (~)0.559s21.06x
🌐 MongoDBNext.js (Turbopack)60.938s (~)61.062s (~)0.123s21.13x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro94.415s (-2.6%)95.274s (-3.1%)0.859s11.00x
▲ VercelNext.js (Turbopack)95.280s (-3.2%)96.310s (-3.6%)1.030s11.01x
▲ VercelExpress95.360s (-3.6%)96.794s (-3.4%)1.434s11.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.261s (+0.7%)2.006s (~)0.746s151.00x
🐘 PostgresExpress1.323s (-3.9%)2.010s (~)0.687s151.05x
🐘 PostgresNitro1.397s (~)2.011s (~)0.614s151.11x
💻 LocalExpress1.410s (~)2.004s (~)0.594s151.12x
💻 LocalNitro1.415s (+0.5%)2.005s (~)0.590s151.12x
💻 LocalNext.js (Turbopack)1.442s (+2.9%)2.005s (~)0.563s151.14x
🌐 MongoDBNext.js (Turbopack)2.153s (~)3.007s (~)0.853s101.71x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.368s (-3.3%)3.505s (-3.6%)1.137s91.00x
▲ VercelNitro2.398s (-23.0% 🟢)3.498s (-19.3% 🟢)1.101s91.01x
▲ VercelExpress3.109s (+15.5% 🔺)4.329s (+22.4% 🔺)1.221s71.31x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.767s (-13.4% 🟢)2.011s (-22.7% 🟢)0.245s151.00x
🐘 PostgresNitro1.993s (-0.8%)2.513s (~)0.520s121.13x
🌐 RedisNext.js (Turbopack)2.500s (~)3.008s (~)0.508s101.42x
💻 LocalNitro2.617s (+0.6%)3.008s (~)0.391s101.48x
💻 LocalExpress2.618s (+2.9%)3.007s (~)0.390s101.48x
💻 LocalNext.js (Turbopack)2.619s (+3.4%)3.008s (+3.1%)0.388s101.48x
🌐 MongoDBNext.js (Turbopack)4.580s (-3.5%)5.176s (~)0.596s62.59x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.796s (-6.6% 🟢)3.977s (-4.3%)1.180s81.00x
▲ VercelNext.js (Turbopack)2.972s (-10.1% 🟢)3.818s (-13.9% 🟢)0.845s81.06x
▲ VercelExpress3.922s (+32.2% 🔺)5.139s (+27.8% 🔺)1.216s61.40x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.652s (-20.1% 🟢)3.682s (-8.4% 🟢)1.029s91.00x
🐘 PostgresNitro3.909s (+8.1% 🔺)4.449s (~)0.540s71.47x
🌐 RedisNext.js (Turbopack)4.048s (~)4.582s (~)0.534s71.53x
💻 LocalExpress7.272s (-2.2%)8.020s (~)0.748s42.74x
💻 LocalNitro7.516s (-2.5%)8.016s (~)0.500s42.83x
💻 LocalNext.js (Turbopack)7.840s (+17.6% 🔺)8.268s (+17.9% 🔺)0.428s42.96x
🌐 MongoDBNext.js (Turbopack)9.743s (-0.6%)10.350s (~)0.606s33.67x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.087s (+4.4%)4.139s (~)1.052s81.00x
▲ VercelNext.js (Turbopack)3.677s (+10.3% 🔺)4.751s (-7.3% 🟢)1.074s71.19x
▲ VercelExpress4.375s (+54.7% 🔺)5.276s (+32.7% 🔺)0.901s61.42x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.251s (-2.1%)2.006s (~)0.755s151.00x
🐘 PostgresExpress1.287s (-7.8% 🟢)2.011s (~)0.723s151.03x
🐘 PostgresNitro1.387s (+1.4%)2.010s (~)0.623s151.11x
💻 LocalExpress1.432s (-2.4%)2.005s (~)0.573s151.14x
💻 LocalNext.js (Turbopack)1.435s (+4.0%)2.005s (~)0.570s151.15x
💻 LocalNitro1.443s (+1.8%)2.005s (~)0.562s151.15x
🌐 MongoDBNext.js (Turbopack)2.170s (~)3.007s (~)0.838s101.73x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.358s (+9.3% 🔺)3.576s (+4.4%)1.218s91.00x
▲ VercelNitro2.378s (-12.0% 🟢)4.027s (+3.2%)1.649s81.01x
▲ VercelNext.js (Turbopack)3.858s (+67.4% 🔺)6.820s (+94.2% 🔺)2.962s51.64x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.837s (-7.6% 🟢)2.227s (-11.5% 🟢)0.390s141.00x
🐘 PostgresNitro2.050s (+3.1%)2.739s (+9.0% 🔺)0.689s111.12x
🌐 RedisNext.js (Turbopack)2.513s (+1.2%)3.008s (~)0.494s101.37x
💻 LocalExpress2.699s (+0.7%)3.007s (~)0.308s101.47x
💻 LocalNitro2.776s (+1.2%)3.008s (~)0.232s101.51x
💻 LocalNext.js (Turbopack)2.804s (+6.4% 🔺)3.108s (+3.3%)0.304s101.53x
🌐 MongoDBNext.js (Turbopack)4.682s (~)5.177s (~)0.495s62.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.650s (-6.6% 🟢)3.767s (-3.8%)1.117s81.00x
▲ VercelNitro2.756s (-21.6% 🟢)3.966s (-14.5% 🟢)1.209s81.04x
▲ VercelExpress2.979s (+11.7% 🔺)4.131s (+3.5%)1.152s81.12x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.075s (-8.8% 🟢)3.891s (-3.2%)0.815s81.00x
🐘 PostgresNitro3.877s (+9.3% 🔺)4.465s (+7.6% 🔺)0.588s71.26x
🌐 RedisNext.js (Turbopack)4.078s (+1.6%)4.868s (+9.7% 🔺)0.790s71.33x
💻 LocalExpress8.158s (+1.1%)8.521s (~)0.363s42.65x
💻 LocalNitro8.384s (+1.2%)9.020s (~)0.636s42.73x
💻 LocalNext.js (Turbopack)8.616s (+13.4% 🔺)9.018s (+12.5% 🔺)0.402s42.80x
🌐 MongoDBNext.js (Turbopack)10.108s (+3.1%)10.347s (~)0.239s33.29x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.384s (+18.6% 🔺)4.291s (+8.6% 🔺)0.907s71.00x
▲ VercelNext.js (Turbopack)3.806s (+28.5% 🔺)4.739s (+20.4% 🔺)0.933s81.12x
▲ VercelNitro4.481s (+43.8% 🔺)5.772s (+34.7% 🔺)1.291s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.146s (-25.2% 🟢)0.998s (+0.7%)0.002s (+7.1% 🔺)1.012s (~)0.866s101.00x
💻 LocalNext.js (Turbopack)0.147s (+5.7% 🔺)1.001s (~)0.011s (+0.9%)1.016s (~)0.869s101.01x
🌐 RedisNext.js (Turbopack)0.150s (+2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.03x
💻 LocalExpress0.174s (-7.4% 🟢)1.002s (~)0.011s (~)1.016s (~)0.842s101.20x
💻 LocalNitro0.184s (+5.3% 🔺)1.002s (~)0.012s (+6.1% 🔺)1.018s (~)0.834s101.26x
🐘 PostgresNitro0.203s (+6.2% 🔺)0.994s (~)0.002s (-5.9% 🟢)1.012s (~)0.809s101.39x
🌐 MongoDBNext.js (Turbopack)0.471s (-2.8%)0.975s (+1.3%)0.002s (~)1.008s (~)0.537s103.23x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.575s (-10.3% 🟢)2.194s (+1.0%)0.128s (-5.9% 🟢)2.769s (-3.3%)1.194s101.00x
▲ VercelExpress1.740s (-3.2%)2.519s (-15.4% 🟢)0.614s (+311.3% 🔺)33.539s (~)31.799s101.10x
▲ VercelNitro1.775s (~)2.509s (+2.4%)0.099s (-84.2% 🟢)63.102s (+1615.8% 🔺)61.326s101.13x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress6/12
🐘 PostgresExpress12/12
▲ VercelNitro7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres11/12
Next.js (Turbopack)🌐 Redis7/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

@github-actions

github-actionsBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production523049572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds112479168
✅ 📋 Other135021156
Total2487472862820

❌ Failed Tests

🌍 Community Worlds (47 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (46 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4705
✅ example4705
✅ express4705
✅ fastify4705
✅ hono4705
✅ nextjs-turbopack5002
✅ nextjs-webpack5002
✅ nitro4705
✅ nuxt4705
✅ sveltekit4705
✅ vite4705
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4913
✅ redis-dev300
✅ redis5003
✅ turso-dev300
❌ turso4463
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run

Comment threadpackages/world-vercel/src/http-client.ts Outdated
@socket-security

socket-securityBot commented Feb 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​turbo@​2.8.11 ⏵ 2.8.121001008597100

View full report

VaguelySeriousand others added 3 commits February 27, 2026 11:59
Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. This provides:
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming write operations (writeToStream, writeToStreamMulti, closeStream)
are excluded from the H2 dispatcher because undici's HTTP/2 client hangs
when combined with request bodies on PUT endpoints. Read-only stream calls
(readFromStream, listStreamsByRunId) safely use the dispatcher.
HTTP/1.1 pipelining is left at 1 (disabled) to avoid head-of-line blocking
that deadlocks the webhook respondWith mechanism. HTTP/2 multiplexing
provides the same throughput benefit without this problem.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
test.skipIf(isLocalDeployment())(
'readableStreamWorkflow',
{ timeout: 60_000 },
{ timeout: 80_000 },

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.

:'(

need to tackle improving test perf, especially in my benchmark PR

const response = await fetch(
new Request(url, { method: 'GET', headers })
);
const response = await fetch(url, {

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.

should we not use undici.request / undici.pipeline for maximum performance (as per undici's README where they recommend that to using fetch

// Observe Retry-After header if received
retryAfter: true,
// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.

@TooTallNateTooTallNateFeb 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these status codes retried by default? I'm not seeing any relevant configuration for them.

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.

Yes

method: 'PUT',
body: chunk,
headers: httpConfig.headers,
duplex: 'half',

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.

can you explain why you're removing duplex: 'half'?

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.

There's a comment saying:

 * IMPORTANT: This dispatcher must NOT be used with `duplex: 'half'`
* streaming requests — undici's H2 client hangs when combined with
* half-duplex streams. See streamer.ts for the streaming code path.

headers,
});
const response = await fetch(request);
const response = await fetch(request, {

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.

same. shouldn't we use undici.request for max performance over fetch?

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.

Claude didn't get it working, and the overhead is 0.001% or something, I think it's fine. H2 is what matters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that also apparently undici.request() does not follow redirects by default, but fetch() does - so we should be careful about that (we want to follow redirects to leave the option open to redirect to S3 for the refs):

Yes, fetch() follows HTTP redirects by default, even when using undici's custom dispatcher. The key distinction is:
- undici's Agent.dispatch() / Agent.request() — maxRedirections defaults to 0 (no redirect following). This is the low-level undici API.
- fetch() (the Fetch API) — redirect defaults to 'follow' per the Fetch spec (request.js:850). This is true regardless of which dispatcher is used, because redirect handling is implemented in the Fetch spec layer (lib/web/fetch/index.js:1194), not in the dispatcher layer.
Since the PR uses fetch() with dispatcher: getDispatcher(), redirects will be followed (up to 20 times per the Fetch spec, index.js:1247). The Agent's maxRedirections: 0 setting only applies to undici's own client.request() / client.dispatch() APIs, not to fetch().

Comment threadpackages/world-vercel/package.json Outdated
"@workflow/errors": "workspace:*",
"@workflow/world": "workspace:*",
"cbor-x": "1.6.0",
"undici": "6.22.0",

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.

can we use undici@7? I know there were some issues when I tried to bump it but maybe coudl spend some cycles to just upgrade to 7?

also we should probably put undici in catalog since local world also uses it and we should pin versions across all undici uage in our monorepo

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.

Sure! Will do

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Solid infrastructure improvement. The HTTP/2 multiplexing and automatic retry via undici's RetryAgent are good wins. The streaming exclusion from H2 is well-documented and the reasoning is sound. A few observations inline.

);
}
return _dispatcher;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The module-level singleton means the dispatcher lives for the entire process lifetime with no way to shut it down. In serverless / short-lived processes this is fine, but if this code ever runs in a long-lived dev server or test suite, the 128 connections and keep-alive timers could leak.

Consider adding a closeDispatcher() export (or making it configurable via APIConfig) for test teardown. Not blocking, but worth noting.

// By default, we observe re-try headers, and also separately
// re-try on these status codes: 429 / 500 / 502 / 503 / 504.
// TODO: We might want to let 429s pass through, so that we can do
// runtime retry-after handling through the queue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The TODO about letting 429s pass through is worth tracking. With RetryAgent retrying 429s up to 5 times (the default maxRetries), and makeRequest in utils.ts also parsing Retry-After headers and throwing WorkflowAPIError with retryAfter for the queue system to handle — there's now a layered retry: undici retries 5 times silently, and only if all 5 fail does the application-level retry kick in.

This is probably fine (belt and suspenders), but the comment on utils.ts:306 ("RetryAgent handles most 429 retries automatically, but this catches the case where retries are exhausted") correctly documents it. Just want to flag that the total retry budget is now 5 * (undici retries) + queue-level retries, which could delay error surfacing.

headers: httpConfig.headers,
}
);
await response.text();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good addition — await response.text() ensures the response body is fully consumed, preventing connection leaks with HTTP/1.1 keep-alive. Without this, unconsumed bodies can hold connections open.

One thing: if the server returns an error status (e.g. 500), this silently discards the error body. The write methods don't check response.ok. Was this intentional? If these endpoints can fail, you might want at least a status check before the early return.

// streaming calls. undici's experimental HTTP/2 client hangs on both
// streaming writes (PUT with body) and streaming reads (long-lived GET
// responses). Standard request/response calls (makeRequest, encryption,
// refs) work fine with H2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The comment is clear and well-placed. Since this is a critical constraint, consider also adding a brief note about why the streaming calls don't use the dispatcher at all (not even for retry) — i.e., streaming writes are fire-and-forget with Uint8Array bodies (not ReadableStream), so duplex: 'half' is no longer needed, but the H2 dispatcher is still excluded because the retry behavior could cause duplicate stream writes.

Comment threadpackages/world-vercel/src/utils.ts Outdated
const response = await fetch(request);
const response = await fetch(request, {
dispatcher: getDispatcher(),
} as RequestInit);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor: fetch(request, { dispatcher } as RequestInit) — passing a Request object as the first argument and options as the second is a valid pattern, but note that undici's dispatcher option is read from the second argument. If Request already has a body, some implementations may not respect the dispatcher from the second arg. This works in practice with Node's built-in fetch (which is undici under the hood), but it's a subtle API surface. Just flagging for awareness.

Comment threadpackages/world-vercel/src/refs.ts
Comment threadpackages/world-vercel/src/encryption.test.ts
@VaguelySerious

Copy link
Copy Markdown
MemberAuthor

Updated to undici 7 and addressed feedback, waiting for CI

Add a shared undici Agent (wrapped in RetryAgent) as the fetch dispatcher
for all outgoing HTTP calls in world-vercel. Upgrade undici to v7 and
share the version via pnpm catalog between world-vercel and world-local.
- HTTP/2 multiplexing via ALPN negotiation (allowH2: true)
- Connection pooling (128 connections per origin)
- Automatic retry on 429/5xx with Retry-After header support
Streaming calls in streamer.ts are excluded from the H2 dispatcher
because undici's HTTP/2 client hangs on both streaming writes and
long-lived streaming reads.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <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.

3 participants

@VaguelySerious@TooTallNate@pranaygp