feat(world-vercel): allow a custom dispatcher - #2235

Merged
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch
Jun 4, 2026
Merged

feat(world-vercel): allow a custom dispatcher#2235
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch

Conversation

@AndrewBarba

@AndrewBarbaAndrewBarba commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dispatcher option to APIConfig (consumed by createVercelWorld) so callers can supply a custom undici dispatcher. It is threaded through every request path — HTTP API calls, refs, encryption key fetch, deployment resolution, and the @vercel/queue client — and defaults to the shared undici RetryAgent.

Why

The Vercel world relies on Node's built-in fetch being undici-backed and pins a specific undici version. Both the HTTP and queue paths already issue requests via global fetch with an undici dispatcher, so exposing the dispatcher gives callers a single, uniform knob to bring their own undici Agent/RetryAgent (e.g. to tune pooling/retries on newer Node runtimes) without us changing defaults.

Note: this intentionally exposes the dispatcher rather than a custom fetch. @vercel/queue only accepts a dispatcher (it calls global fetch directly with no fetch-injection point), so the dispatcher is the one option that works consistently across both paths.

How

  • New APIConfig.dispatcher?: unknown (mirrors @vercel/queue's own dispatcher?: unknown).
  • getDispatcher(config?) now returns the caller's dispatcher when set, else the shared default agent (the previous singleton, renamed to getDefaultDispatcher).
  • All call sites pass config through; default behavior is unchanged.

Usage

At Vercel runtime createWorld() calls createVercelWorld() with no config, so injection is via the existing setWorld escape hatch (documented in the README):

import{Agent}from'undici';import{createVercelWorld}from'@workflow/world-vercel';import{setWorld}from'@workflow/core/runtime';setWorld(createVercelWorld({dispatcher: newAgent({connections: 16})}));

Tests

  • New http-client.test.ts covering getDispatcher default vs. override.
  • Full package suite green (115 tests).

No public API removed; dispatcher is purely additive and defaults to current undici behavior.

@vercel

vercelBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9949659

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelMinor
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@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 Jun 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production126602191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total7183010528235

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro109026
✅ example109026
✅ express109026
✅ fastify109026
✅ hono109026
✅ nextjs-turbopack13302
✅ nextjs-webpack13302
✅ nitro109026
✅ nuxt109026
✅ sveltekit12807
✅ vite109026
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.038s (-11.3% 🟢)1.005s (~)0.967s101.00x
🐘 PostgresExpress0.062s (-4.9%)1.011s (~)0.949s101.62x
💻 LocalNext.js (Turbopack)0.063s (-1.4%)1.007s (~)0.944s101.63x
🐘 PostgresNitro0.067s (-25.1% 🟢)1.012s (-1.8%)0.945s101.75x
🐘 PostgresNext.js (Turbopack)0.068s (-2.3%)1.011s (~)0.943s101.77x
💻 LocalExpress0.545s (+1232.3% 🔺)1.508s (+50.0% 🔺)0.963s1014.15x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.091s (~)2.006s (~)0.915s101.00x
💻 LocalExpress1.092s (~)2.006s (~)0.914s101.00x
🐘 PostgresExpress1.106s (~)2.010s (~)0.904s101.01x
🐘 PostgresNitro1.108s (-3.0%)2.009s (-1.2%)0.901s101.02x
💻 LocalNext.js (Turbopack)1.135s (~)2.007s (~)0.872s101.04x
🐘 PostgresNext.js (Turbopack)1.137s (~)2.009s (~)0.872s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.504s (~)11.021s (~)0.517s31.00x
🐘 PostgresNitro10.509s (-1.8%)11.016s (~)0.507s31.00x
💻 LocalExpress10.544s (+0.6%)11.021s (~)0.477s31.00x
🐘 PostgresExpress10.574s (~)11.019s (~)0.446s31.01x
💻 LocalNext.js (Turbopack)10.777s (~)11.023s (~)0.246s31.03x
🐘 PostgresNext.js (Turbopack)10.824s (~)11.019s (~)0.195s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.657s (-0.7%)14.027s (~)0.370s51.00x
🐘 PostgresNitro13.714s (-6.5% 🟢)14.018s (-6.7% 🟢)0.303s51.00x
💻 LocalExpress13.742s (~)14.026s (~)0.284s51.01x
🐘 PostgresExpress13.752s (-1.3%)14.017s (~)0.266s51.01x
💻 LocalNext.js (Turbopack)14.383s (~)15.029s (~)0.646s41.05x
🐘 PostgresNext.js (Turbopack)14.582s (+1.4%)15.024s (~)0.442s41.07x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.314s (-0.7%)13.025s (~)0.711s71.00x
🐘 PostgresNitro12.488s (-1.6%)13.024s (-2.1%)0.536s71.01x
💻 LocalExpress12.513s (+1.4%)13.024s (~)0.511s71.02x
🐘 PostgresExpress12.550s (~)13.019s (~)0.470s71.02x
💻 LocalNext.js (Turbopack)13.583s (~)14.026s (~)0.443s71.10x
🐘 PostgresNext.js (Turbopack)13.757s (+0.8%)14.020s (~)0.263s71.12x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.181s (-1.0%)2.008s (~)0.827s151.00x
🐘 PostgresNitro1.181s (-6.1% 🟢)2.008s (~)0.827s151.00x
💻 LocalExpress1.200s (-3.0%)2.006s (~)0.806s151.02x
🐘 PostgresNext.js (Turbopack)1.228s (~)2.008s (~)0.780s151.04x
💻 LocalNitro1.264s (+3.9%)2.006s (~)0.742s151.07x
💻 LocalNext.js (Turbopack)1.322s (~)2.006s (~)0.684s151.12x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.249s (-0.9%)2.007s (~)0.758s151.00x
🐘 PostgresNitro1.251s (-7.9% 🟢)2.007s (~)0.756s151.00x
🐘 PostgresNext.js (Turbopack)1.375s (-0.7%)2.007s (~)0.632s151.10x
💻 LocalExpress1.636s (-4.1%)2.006s (~)0.370s151.31x
💻 LocalNitro1.708s (-2.7%)2.006s (~)0.298s151.37x
💻 LocalNext.js (Turbopack)1.898s (~)2.469s (+6.7% 🔺)0.571s131.52x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.396s (-5.1% 🟢)2.007s (-13.5% 🟢)0.611s151.00x
🐘 PostgresExpress1.432s (+2.3%)2.008s (~)0.576s151.03x
🐘 PostgresNext.js (Turbopack)1.729s (+1.9%)2.075s (-3.2%)0.346s151.24x
💻 LocalExpress3.912s (-18.8% 🟢)4.439s (-16.9% 🟢)0.527s72.80x
💻 LocalNitro4.610s (-2.9%)5.347s (+3.2%)0.737s63.30x
💻 LocalNext.js (Turbopack)5.487s (~)6.012s (-3.3%)0.526s53.93x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.180s (-0.7%)2.009s (~)0.829s151.00x
🐘 PostgresNitro1.186s (-9.7% 🟢)2.008s (-3.4%)0.823s151.00x
🐘 PostgresNext.js (Turbopack)1.248s (~)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.402s (+1.5%)2.006s (~)0.604s151.19x
💻 LocalNitro1.496s (-9.4% 🟢)2.006s (-3.2%)0.510s151.27x
💻 LocalExpress1.551s (+2.1%)2.006s (~)0.455s151.31x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (+0.8%)2.008s (~)0.748s151.00x
🐘 PostgresExpress1.284s (+2.3%)2.009s (~)0.725s151.02x
🐘 PostgresNext.js (Turbopack)1.374s (-5.3% 🟢)2.008s (-3.2%)0.634s151.09x
💻 LocalNitro1.889s (-10.6% 🟢)2.316s (-15.3% 🟢)0.427s131.50x
💻 LocalExpress1.962s (+3.5%)2.316s (~)0.353s131.56x
💻 LocalNext.js (Turbopack)2.091s (~)2.826s (~)0.736s111.66x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.409s (-3.1%)2.008s (-3.4%)0.599s151.00x
🐘 PostgresExpress1.422s (+1.9%)2.007s (~)0.585s151.01x
🐘 PostgresNext.js (Turbopack)1.691s (-1.8%)2.316s (+4.3%)0.625s131.20x
💻 LocalExpress4.932s (-6.9% 🟢)5.513s (-5.7% 🟢)0.581s63.50x
💻 LocalNitro5.226s (-11.6% 🟢)5.683s (-11.4% 🟢)0.457s63.71x
💻 LocalNext.js (Turbopack)5.591s (-3.5%)6.213s (~)0.622s53.97x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.566s (+13.1% 🔺)1.024s (+1.2%)0.458s591.00x
🐘 PostgresExpress0.586s (+2.8%)1.024s (+1.7%)0.438s601.04x
💻 LocalExpress0.593s (-1.2%)1.004s (~)0.412s601.05x
💻 LocalNitro0.627s (+6.0% 🔺)1.022s (+1.7%)0.395s591.11x
🐘 PostgresNext.js (Turbopack)0.819s (-2.4%)1.024s (-3.4%)0.205s591.45x
💻 LocalNext.js (Turbopack)0.852s (-2.3%)1.004s (-3.3%)0.152s601.51x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-7.9% 🟢)2.008s (~)0.681s451.00x
🐘 PostgresExpress1.351s (~)2.008s (~)0.656s451.02x
💻 LocalNitro1.452s (-3.2%)2.006s (-1.1%)0.554s451.09x
💻 LocalExpress1.471s (-3.7%)2.005s (-1.1%)0.535s451.11x
🐘 PostgresNext.js (Turbopack)1.927s (+0.8%)2.150s (+2.4%)0.224s421.45x
💻 LocalNext.js (Turbopack)2.066s (-1.7%)2.882s (-4.2%)0.816s321.56x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.676s (+1.5%)3.111s (-6.3% 🟢)0.435s391.00x
🐘 PostgresExpress2.740s (-1.0%)3.085s (-1.7%)0.346s391.02x
💻 LocalNitro3.170s (+0.6%)3.912s (-0.8%)0.742s311.18x
💻 LocalExpress3.242s (~)3.945s (-0.8%)0.703s311.21x
🐘 PostgresNext.js (Turbopack)3.796s (-0.8%)4.009s (-2.4%)0.214s301.42x
💻 LocalNext.js (Turbopack)4.310s (-2.9%)5.010s (~)0.700s241.61x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.213s (-4.0%)1.006s (~)0.793s601.00x
🐘 PostgresExpress0.235s (+3.1%)1.006s (~)0.772s601.10x
🐘 PostgresNext.js (Turbopack)0.271s (+2.8%)1.007s (~)0.736s601.27x
💻 LocalExpress0.417s (-0.8%)1.004s (~)0.586s601.96x
💻 LocalNitro0.506s (+12.3% 🔺)1.095s (+9.1% 🔺)0.589s552.38x
💻 LocalNext.js (Turbopack)0.565s (-12.0% 🟢)1.005s (-5.1% 🟢)0.440s602.66x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.344s (-12.6% 🟢)1.018s (~)0.673s891.00x
🐘 PostgresExpress0.358s (-0.7%)1.006s (~)0.648s901.04x
🐘 PostgresNext.js (Turbopack)0.483s (+1.6%)1.006s (~)0.522s901.40x
💻 LocalExpress2.012s (-4.5%)2.580s (-2.9%)0.567s355.85x
💻 LocalNitro2.091s (+1.2%)2.579s (-2.2%)0.488s356.07x
💻 LocalNext.js (Turbopack)2.337s (-8.2% 🟢)3.044s (-7.7% 🟢)0.707s306.79x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.647s (+4.1%)1.006s (-6.2% 🟢)0.359s1201.00x
🐘 PostgresExpress0.703s (+1.9%)1.006s (~)0.303s1201.09x
🐘 PostgresNext.js (Turbopack)0.985s (+1.6%)1.527s (-2.5%)0.543s791.52x
💻 LocalExpress8.786s (-7.3% 🟢)9.330s (-6.9% 🟢)0.543s1313.58x
💻 LocalNitro9.638s (+2.1%)10.109s (+0.8%)0.471s1214.89x
💻 LocalNext.js (Turbopack)10.511s (-3.9%)11.298s (-3.9%)0.787s1116.24x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.158s (~)2.005s (~)0.011s (-9.5% 🟢)2.017s (~)0.859s101.00x
💻 LocalExpress1.162s (~)2.005s (~)0.010s (-4.8%)2.017s (~)0.855s101.00x
🐘 PostgresNitro1.162s (~)2.001s (~)0.001s (+83.3% 🔺)2.010s (~)0.848s101.00x
🐘 PostgresExpress1.163s (-0.7%)1.999s (~)0.001s (-22.2% 🟢)2.011s (~)0.848s101.00x
💻 LocalNext.js (Turbopack)1.202s (-0.6%)2.003s (~)0.012s (+3.3%)2.019s (~)0.818s101.04x
🐘 PostgresNext.js (Turbopack)1.218s (-1.2%)2.002s (~)0.002s (+15.4% 🔺)2.011s (~)0.793s101.05x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.561s (~)2.009s (~)0.010s (~)2.021s (~)0.460s301.00x
🐘 PostgresNitro1.564s (-5.4% 🟢)2.008s (-3.0%)0.004s (+20.4% 🔺)2.025s (-3.0%)0.461s301.00x
💻 LocalNitro1.580s (~)2.009s (~)0.011s (+2.6%)2.022s (~)0.442s301.01x
🐘 PostgresExpress1.599s (+0.6%)2.003s (~)0.004s (-2.6%)2.026s (~)0.427s301.02x
💻 LocalNext.js (Turbopack)1.724s (-3.8%)2.009s (~)0.011s (-15.8% 🟢)2.023s (~)0.299s301.10x
🐘 PostgresNext.js (Turbopack)1.730s (+0.9%)2.010s (~)0.004s (-2.6%)2.025s (~)0.295s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.690s (-27.9% 🟢)1.013s (-20.3% 🟢)0.000s (-18.6% 🟢)1.040s (-20.5% 🟢)0.350s591.00x
🐘 PostgresExpress0.720s (+1.0%)1.013s (-1.7%)0.000s (+50.0% 🔺)1.039s (~)0.320s581.04x
🐘 PostgresNext.js (Turbopack)0.850s (+10.3% 🔺)1.109s (+7.2% 🔺)0.000s (+110.9% 🔺)1.124s (+7.1% 🔺)0.274s551.23x
💻 LocalExpress1.370s (-1.6%)2.012s (~)0.000s (-15.4% 🟢)2.014s (~)0.644s301.99x
💻 LocalNitro1.430s (+3.2%)2.014s (~)0.001s (-15.8% 🟢)2.017s (~)0.587s302.07x
💻 LocalNext.js (Turbopack)1.492s (~)2.013s (~)0.000s (+80.0% 🔺)2.016s (~)0.524s302.16x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.374s (-28.7% 🟢)2.103s (-10.1% 🟢)0.000s (-100.0% 🟢)2.123s (-10.3% 🟢)0.749s291.00x
🐘 PostgresExpress1.397s (-2.4%)2.063s (-3.4%)0.000s (~)2.081s (-3.7%)0.684s291.02x
🐘 PostgresNext.js (Turbopack)1.680s (-1.1%)2.181s (-1.6%)0.000s (-100.0% 🟢)2.189s (-2.4%)0.508s281.22x
💻 LocalNext.js (Turbopack)2.900s (-2.2%)3.466s (-4.1%)0.001s (+20.2% 🔺)3.474s (-4.0%)0.573s182.11x
💻 LocalExpress3.047s (-0.8%)3.774s (-1.7%)0.001s (~)3.777s (-1.7%)0.730s162.22x
💻 LocalNitro3.196s (+7.6% 🔺)3.901s (+8.0% 🔺)0.000s (-20.3% 🟢)3.905s (+8.0% 🔺)0.709s162.33x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress10/21
🐘 PostgresNitro16/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed for correctness and regression risk — backward-compatible and safe to merge, defaults are unchanged and every request path threads config consistently. A few non-blocking notes inline.

import { createVercelWorld } from '@workflow/world-vercel';
import { setWorld } from '@workflow/core/runtime';

setWorld(createVercelWorld({ dispatcher: new Agent({ connections: 16 }) }));

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.

Injection timing caveat worth documenting here: at Vercel runtime createWorld() calls createVercelWorld() with no config, so setWorld(...) is the only injection path. If the runtime has already created/cached the world before this setWorld call runs, the custom dispatcher silently won't take effect. Worth a one-line note that setWorld must run before the world is first used (i.e. before the first workflow request).

* dispatcher from a different undici version. Callers may pass any undici
* version's dispatcher, or any object implementing the dispatcher contract.
*/
dispatcher?: unknown;

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.

unknown is the right call given undici's version-specific Dispatcher type (the doc comment explains it well). Just flagging the trade-off: callers get zero type safety, so a malformed/incompatible dispatcher fails only at runtime inside fetch/@vercel/queue rather than at compile time. Acceptable here, but worth keeping in mind for the error story.

* shared default agent.
*/
export function getDispatcher(config?: APIConfig): unknown {
return config?.dispatcher ?? getDefaultDispatcher();

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.

Nullish coalescing means an explicit dispatcher: null (or undefined) falls back to the shared default — sensible and probably the desired behavior. Only note: a caller who passes a falsy-but-intentional value expecting it to be used would be surprised, but for a dispatcher that's the correct semantics. No change needed; documenting the intent.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2242. (backport job run)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

feat(world-vercel): allow a custom dispatcher - #2235

Merged
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch
Jun 4, 2026
Merged

feat(world-vercel): allow a custom dispatcher#2235
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch

Conversation

@AndrewBarba

@AndrewBarbaAndrewBarba commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dispatcher option to APIConfig (consumed by createVercelWorld) so callers can supply a custom undici dispatcher. It is threaded through every request path — HTTP API calls, refs, encryption key fetch, deployment resolution, and the @vercel/queue client — and defaults to the shared undici RetryAgent.

Why

The Vercel world relies on Node's built-in fetch being undici-backed and pins a specific undici version. Both the HTTP and queue paths already issue requests via global fetch with an undici dispatcher, so exposing the dispatcher gives callers a single, uniform knob to bring their own undici Agent/RetryAgent (e.g. to tune pooling/retries on newer Node runtimes) without us changing defaults.

Note: this intentionally exposes the dispatcher rather than a custom fetch. @vercel/queue only accepts a dispatcher (it calls global fetch directly with no fetch-injection point), so the dispatcher is the one option that works consistently across both paths.

How

  • New APIConfig.dispatcher?: unknown (mirrors @vercel/queue's own dispatcher?: unknown).
  • getDispatcher(config?) now returns the caller's dispatcher when set, else the shared default agent (the previous singleton, renamed to getDefaultDispatcher).
  • All call sites pass config through; default behavior is unchanged.

Usage

At Vercel runtime createWorld() calls createVercelWorld() with no config, so injection is via the existing setWorld escape hatch (documented in the README):

import{Agent}from'undici';import{createVercelWorld}from'@workflow/world-vercel';import{setWorld}from'@workflow/core/runtime';setWorld(createVercelWorld({dispatcher: newAgent({connections: 16})}));

Tests

  • New http-client.test.ts covering getDispatcher default vs. override.
  • Full package suite green (115 tests).

No public API removed; dispatcher is purely additive and defaults to current undici behavior.

@vercel

vercelBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9949659

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelMinor
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@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 Jun 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production126602191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total7183010528235

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro109026
✅ example109026
✅ express109026
✅ fastify109026
✅ hono109026
✅ nextjs-turbopack13302
✅ nextjs-webpack13302
✅ nitro109026
✅ nuxt109026
✅ sveltekit12807
✅ vite109026
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.038s (-11.3% 🟢)1.005s (~)0.967s101.00x
🐘 PostgresExpress0.062s (-4.9%)1.011s (~)0.949s101.62x
💻 LocalNext.js (Turbopack)0.063s (-1.4%)1.007s (~)0.944s101.63x
🐘 PostgresNitro0.067s (-25.1% 🟢)1.012s (-1.8%)0.945s101.75x
🐘 PostgresNext.js (Turbopack)0.068s (-2.3%)1.011s (~)0.943s101.77x
💻 LocalExpress0.545s (+1232.3% 🔺)1.508s (+50.0% 🔺)0.963s1014.15x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.091s (~)2.006s (~)0.915s101.00x
💻 LocalExpress1.092s (~)2.006s (~)0.914s101.00x
🐘 PostgresExpress1.106s (~)2.010s (~)0.904s101.01x
🐘 PostgresNitro1.108s (-3.0%)2.009s (-1.2%)0.901s101.02x
💻 LocalNext.js (Turbopack)1.135s (~)2.007s (~)0.872s101.04x
🐘 PostgresNext.js (Turbopack)1.137s (~)2.009s (~)0.872s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.504s (~)11.021s (~)0.517s31.00x
🐘 PostgresNitro10.509s (-1.8%)11.016s (~)0.507s31.00x
💻 LocalExpress10.544s (+0.6%)11.021s (~)0.477s31.00x
🐘 PostgresExpress10.574s (~)11.019s (~)0.446s31.01x
💻 LocalNext.js (Turbopack)10.777s (~)11.023s (~)0.246s31.03x
🐘 PostgresNext.js (Turbopack)10.824s (~)11.019s (~)0.195s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.657s (-0.7%)14.027s (~)0.370s51.00x
🐘 PostgresNitro13.714s (-6.5% 🟢)14.018s (-6.7% 🟢)0.303s51.00x
💻 LocalExpress13.742s (~)14.026s (~)0.284s51.01x
🐘 PostgresExpress13.752s (-1.3%)14.017s (~)0.266s51.01x
💻 LocalNext.js (Turbopack)14.383s (~)15.029s (~)0.646s41.05x
🐘 PostgresNext.js (Turbopack)14.582s (+1.4%)15.024s (~)0.442s41.07x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.314s (-0.7%)13.025s (~)0.711s71.00x
🐘 PostgresNitro12.488s (-1.6%)13.024s (-2.1%)0.536s71.01x
💻 LocalExpress12.513s (+1.4%)13.024s (~)0.511s71.02x
🐘 PostgresExpress12.550s (~)13.019s (~)0.470s71.02x
💻 LocalNext.js (Turbopack)13.583s (~)14.026s (~)0.443s71.10x
🐘 PostgresNext.js (Turbopack)13.757s (+0.8%)14.020s (~)0.263s71.12x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.181s (-1.0%)2.008s (~)0.827s151.00x
🐘 PostgresNitro1.181s (-6.1% 🟢)2.008s (~)0.827s151.00x
💻 LocalExpress1.200s (-3.0%)2.006s (~)0.806s151.02x
🐘 PostgresNext.js (Turbopack)1.228s (~)2.008s (~)0.780s151.04x
💻 LocalNitro1.264s (+3.9%)2.006s (~)0.742s151.07x
💻 LocalNext.js (Turbopack)1.322s (~)2.006s (~)0.684s151.12x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.249s (-0.9%)2.007s (~)0.758s151.00x
🐘 PostgresNitro1.251s (-7.9% 🟢)2.007s (~)0.756s151.00x
🐘 PostgresNext.js (Turbopack)1.375s (-0.7%)2.007s (~)0.632s151.10x
💻 LocalExpress1.636s (-4.1%)2.006s (~)0.370s151.31x
💻 LocalNitro1.708s (-2.7%)2.006s (~)0.298s151.37x
💻 LocalNext.js (Turbopack)1.898s (~)2.469s (+6.7% 🔺)0.571s131.52x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.396s (-5.1% 🟢)2.007s (-13.5% 🟢)0.611s151.00x
🐘 PostgresExpress1.432s (+2.3%)2.008s (~)0.576s151.03x
🐘 PostgresNext.js (Turbopack)1.729s (+1.9%)2.075s (-3.2%)0.346s151.24x
💻 LocalExpress3.912s (-18.8% 🟢)4.439s (-16.9% 🟢)0.527s72.80x
💻 LocalNitro4.610s (-2.9%)5.347s (+3.2%)0.737s63.30x
💻 LocalNext.js (Turbopack)5.487s (~)6.012s (-3.3%)0.526s53.93x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.180s (-0.7%)2.009s (~)0.829s151.00x
🐘 PostgresNitro1.186s (-9.7% 🟢)2.008s (-3.4%)0.823s151.00x
🐘 PostgresNext.js (Turbopack)1.248s (~)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.402s (+1.5%)2.006s (~)0.604s151.19x
💻 LocalNitro1.496s (-9.4% 🟢)2.006s (-3.2%)0.510s151.27x
💻 LocalExpress1.551s (+2.1%)2.006s (~)0.455s151.31x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (+0.8%)2.008s (~)0.748s151.00x
🐘 PostgresExpress1.284s (+2.3%)2.009s (~)0.725s151.02x
🐘 PostgresNext.js (Turbopack)1.374s (-5.3% 🟢)2.008s (-3.2%)0.634s151.09x
💻 LocalNitro1.889s (-10.6% 🟢)2.316s (-15.3% 🟢)0.427s131.50x
💻 LocalExpress1.962s (+3.5%)2.316s (~)0.353s131.56x
💻 LocalNext.js (Turbopack)2.091s (~)2.826s (~)0.736s111.66x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.409s (-3.1%)2.008s (-3.4%)0.599s151.00x
🐘 PostgresExpress1.422s (+1.9%)2.007s (~)0.585s151.01x
🐘 PostgresNext.js (Turbopack)1.691s (-1.8%)2.316s (+4.3%)0.625s131.20x
💻 LocalExpress4.932s (-6.9% 🟢)5.513s (-5.7% 🟢)0.581s63.50x
💻 LocalNitro5.226s (-11.6% 🟢)5.683s (-11.4% 🟢)0.457s63.71x
💻 LocalNext.js (Turbopack)5.591s (-3.5%)6.213s (~)0.622s53.97x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.566s (+13.1% 🔺)1.024s (+1.2%)0.458s591.00x
🐘 PostgresExpress0.586s (+2.8%)1.024s (+1.7%)0.438s601.04x
💻 LocalExpress0.593s (-1.2%)1.004s (~)0.412s601.05x
💻 LocalNitro0.627s (+6.0% 🔺)1.022s (+1.7%)0.395s591.11x
🐘 PostgresNext.js (Turbopack)0.819s (-2.4%)1.024s (-3.4%)0.205s591.45x
💻 LocalNext.js (Turbopack)0.852s (-2.3%)1.004s (-3.3%)0.152s601.51x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-7.9% 🟢)2.008s (~)0.681s451.00x
🐘 PostgresExpress1.351s (~)2.008s (~)0.656s451.02x
💻 LocalNitro1.452s (-3.2%)2.006s (-1.1%)0.554s451.09x
💻 LocalExpress1.471s (-3.7%)2.005s (-1.1%)0.535s451.11x
🐘 PostgresNext.js (Turbopack)1.927s (+0.8%)2.150s (+2.4%)0.224s421.45x
💻 LocalNext.js (Turbopack)2.066s (-1.7%)2.882s (-4.2%)0.816s321.56x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.676s (+1.5%)3.111s (-6.3% 🟢)0.435s391.00x
🐘 PostgresExpress2.740s (-1.0%)3.085s (-1.7%)0.346s391.02x
💻 LocalNitro3.170s (+0.6%)3.912s (-0.8%)0.742s311.18x
💻 LocalExpress3.242s (~)3.945s (-0.8%)0.703s311.21x
🐘 PostgresNext.js (Turbopack)3.796s (-0.8%)4.009s (-2.4%)0.214s301.42x
💻 LocalNext.js (Turbopack)4.310s (-2.9%)5.010s (~)0.700s241.61x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.213s (-4.0%)1.006s (~)0.793s601.00x
🐘 PostgresExpress0.235s (+3.1%)1.006s (~)0.772s601.10x
🐘 PostgresNext.js (Turbopack)0.271s (+2.8%)1.007s (~)0.736s601.27x
💻 LocalExpress0.417s (-0.8%)1.004s (~)0.586s601.96x
💻 LocalNitro0.506s (+12.3% 🔺)1.095s (+9.1% 🔺)0.589s552.38x
💻 LocalNext.js (Turbopack)0.565s (-12.0% 🟢)1.005s (-5.1% 🟢)0.440s602.66x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.344s (-12.6% 🟢)1.018s (~)0.673s891.00x
🐘 PostgresExpress0.358s (-0.7%)1.006s (~)0.648s901.04x
🐘 PostgresNext.js (Turbopack)0.483s (+1.6%)1.006s (~)0.522s901.40x
💻 LocalExpress2.012s (-4.5%)2.580s (-2.9%)0.567s355.85x
💻 LocalNitro2.091s (+1.2%)2.579s (-2.2%)0.488s356.07x
💻 LocalNext.js (Turbopack)2.337s (-8.2% 🟢)3.044s (-7.7% 🟢)0.707s306.79x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.647s (+4.1%)1.006s (-6.2% 🟢)0.359s1201.00x
🐘 PostgresExpress0.703s (+1.9%)1.006s (~)0.303s1201.09x
🐘 PostgresNext.js (Turbopack)0.985s (+1.6%)1.527s (-2.5%)0.543s791.52x
💻 LocalExpress8.786s (-7.3% 🟢)9.330s (-6.9% 🟢)0.543s1313.58x
💻 LocalNitro9.638s (+2.1%)10.109s (+0.8%)0.471s1214.89x
💻 LocalNext.js (Turbopack)10.511s (-3.9%)11.298s (-3.9%)0.787s1116.24x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.158s (~)2.005s (~)0.011s (-9.5% 🟢)2.017s (~)0.859s101.00x
💻 LocalExpress1.162s (~)2.005s (~)0.010s (-4.8%)2.017s (~)0.855s101.00x
🐘 PostgresNitro1.162s (~)2.001s (~)0.001s (+83.3% 🔺)2.010s (~)0.848s101.00x
🐘 PostgresExpress1.163s (-0.7%)1.999s (~)0.001s (-22.2% 🟢)2.011s (~)0.848s101.00x
💻 LocalNext.js (Turbopack)1.202s (-0.6%)2.003s (~)0.012s (+3.3%)2.019s (~)0.818s101.04x
🐘 PostgresNext.js (Turbopack)1.218s (-1.2%)2.002s (~)0.002s (+15.4% 🔺)2.011s (~)0.793s101.05x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.561s (~)2.009s (~)0.010s (~)2.021s (~)0.460s301.00x
🐘 PostgresNitro1.564s (-5.4% 🟢)2.008s (-3.0%)0.004s (+20.4% 🔺)2.025s (-3.0%)0.461s301.00x
💻 LocalNitro1.580s (~)2.009s (~)0.011s (+2.6%)2.022s (~)0.442s301.01x
🐘 PostgresExpress1.599s (+0.6%)2.003s (~)0.004s (-2.6%)2.026s (~)0.427s301.02x
💻 LocalNext.js (Turbopack)1.724s (-3.8%)2.009s (~)0.011s (-15.8% 🟢)2.023s (~)0.299s301.10x
🐘 PostgresNext.js (Turbopack)1.730s (+0.9%)2.010s (~)0.004s (-2.6%)2.025s (~)0.295s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.690s (-27.9% 🟢)1.013s (-20.3% 🟢)0.000s (-18.6% 🟢)1.040s (-20.5% 🟢)0.350s591.00x
🐘 PostgresExpress0.720s (+1.0%)1.013s (-1.7%)0.000s (+50.0% 🔺)1.039s (~)0.320s581.04x
🐘 PostgresNext.js (Turbopack)0.850s (+10.3% 🔺)1.109s (+7.2% 🔺)0.000s (+110.9% 🔺)1.124s (+7.1% 🔺)0.274s551.23x
💻 LocalExpress1.370s (-1.6%)2.012s (~)0.000s (-15.4% 🟢)2.014s (~)0.644s301.99x
💻 LocalNitro1.430s (+3.2%)2.014s (~)0.001s (-15.8% 🟢)2.017s (~)0.587s302.07x
💻 LocalNext.js (Turbopack)1.492s (~)2.013s (~)0.000s (+80.0% 🔺)2.016s (~)0.524s302.16x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.374s (-28.7% 🟢)2.103s (-10.1% 🟢)0.000s (-100.0% 🟢)2.123s (-10.3% 🟢)0.749s291.00x
🐘 PostgresExpress1.397s (-2.4%)2.063s (-3.4%)0.000s (~)2.081s (-3.7%)0.684s291.02x
🐘 PostgresNext.js (Turbopack)1.680s (-1.1%)2.181s (-1.6%)0.000s (-100.0% 🟢)2.189s (-2.4%)0.508s281.22x
💻 LocalNext.js (Turbopack)2.900s (-2.2%)3.466s (-4.1%)0.001s (+20.2% 🔺)3.474s (-4.0%)0.573s182.11x
💻 LocalExpress3.047s (-0.8%)3.774s (-1.7%)0.001s (~)3.777s (-1.7%)0.730s162.22x
💻 LocalNitro3.196s (+7.6% 🔺)3.901s (+8.0% 🔺)0.000s (-20.3% 🟢)3.905s (+8.0% 🔺)0.709s162.33x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress10/21
🐘 PostgresNitro16/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed for correctness and regression risk — backward-compatible and safe to merge, defaults are unchanged and every request path threads config consistently. A few non-blocking notes inline.

import { createVercelWorld } from '@workflow/world-vercel';
import { setWorld } from '@workflow/core/runtime';

setWorld(createVercelWorld({ dispatcher: new Agent({ connections: 16 }) }));

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.

Injection timing caveat worth documenting here: at Vercel runtime createWorld() calls createVercelWorld() with no config, so setWorld(...) is the only injection path. If the runtime has already created/cached the world before this setWorld call runs, the custom dispatcher silently won't take effect. Worth a one-line note that setWorld must run before the world is first used (i.e. before the first workflow request).

* dispatcher from a different undici version. Callers may pass any undici
* version's dispatcher, or any object implementing the dispatcher contract.
*/
dispatcher?: unknown;

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.

unknown is the right call given undici's version-specific Dispatcher type (the doc comment explains it well). Just flagging the trade-off: callers get zero type safety, so a malformed/incompatible dispatcher fails only at runtime inside fetch/@vercel/queue rather than at compile time. Acceptable here, but worth keeping in mind for the error story.

* shared default agent.
*/
export function getDispatcher(config?: APIConfig): unknown {
return config?.dispatcher ?? getDefaultDispatcher();

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.

Nullish coalescing means an explicit dispatcher: null (or undefined) falls back to the shared default — sensible and probably the desired behavior. Only note: a caller who passes a falsy-but-intentional value expecting it to be used would be surprised, but for a dispatcher that's the correct semantics. No change needed; documenting the intent.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2242. (backport job run)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

feat(world-vercel): allow a custom dispatcher - #2235

Merged
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch
Jun 4, 2026
Merged

feat(world-vercel): allow a custom dispatcher#2235
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch

Conversation

@AndrewBarba

@AndrewBarbaAndrewBarba commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dispatcher option to APIConfig (consumed by createVercelWorld) so callers can supply a custom undici dispatcher. It is threaded through every request path — HTTP API calls, refs, encryption key fetch, deployment resolution, and the @vercel/queue client — and defaults to the shared undici RetryAgent.

Why

The Vercel world relies on Node's built-in fetch being undici-backed and pins a specific undici version. Both the HTTP and queue paths already issue requests via global fetch with an undici dispatcher, so exposing the dispatcher gives callers a single, uniform knob to bring their own undici Agent/RetryAgent (e.g. to tune pooling/retries on newer Node runtimes) without us changing defaults.

Note: this intentionally exposes the dispatcher rather than a custom fetch. @vercel/queue only accepts a dispatcher (it calls global fetch directly with no fetch-injection point), so the dispatcher is the one option that works consistently across both paths.

How

  • New APIConfig.dispatcher?: unknown (mirrors @vercel/queue's own dispatcher?: unknown).
  • getDispatcher(config?) now returns the caller's dispatcher when set, else the shared default agent (the previous singleton, renamed to getDefaultDispatcher).
  • All call sites pass config through; default behavior is unchanged.

Usage

At Vercel runtime createWorld() calls createVercelWorld() with no config, so injection is via the existing setWorld escape hatch (documented in the README):

import{Agent}from'undici';import{createVercelWorld}from'@workflow/world-vercel';import{setWorld}from'@workflow/core/runtime';setWorld(createVercelWorld({dispatcher: newAgent({connections: 16})}));

Tests

  • New http-client.test.ts covering getDispatcher default vs. override.
  • Full package suite green (115 tests).

No public API removed; dispatcher is purely additive and defaults to current undici behavior.

@vercel

vercelBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9949659

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelMinor
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@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 Jun 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production126602191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total7183010528235

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro109026
✅ example109026
✅ express109026
✅ fastify109026
✅ hono109026
✅ nextjs-turbopack13302
✅ nextjs-webpack13302
✅ nitro109026
✅ nuxt109026
✅ sveltekit12807
✅ vite109026
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.038s (-11.3% 🟢)1.005s (~)0.967s101.00x
🐘 PostgresExpress0.062s (-4.9%)1.011s (~)0.949s101.62x
💻 LocalNext.js (Turbopack)0.063s (-1.4%)1.007s (~)0.944s101.63x
🐘 PostgresNitro0.067s (-25.1% 🟢)1.012s (-1.8%)0.945s101.75x
🐘 PostgresNext.js (Turbopack)0.068s (-2.3%)1.011s (~)0.943s101.77x
💻 LocalExpress0.545s (+1232.3% 🔺)1.508s (+50.0% 🔺)0.963s1014.15x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.091s (~)2.006s (~)0.915s101.00x
💻 LocalExpress1.092s (~)2.006s (~)0.914s101.00x
🐘 PostgresExpress1.106s (~)2.010s (~)0.904s101.01x
🐘 PostgresNitro1.108s (-3.0%)2.009s (-1.2%)0.901s101.02x
💻 LocalNext.js (Turbopack)1.135s (~)2.007s (~)0.872s101.04x
🐘 PostgresNext.js (Turbopack)1.137s (~)2.009s (~)0.872s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.504s (~)11.021s (~)0.517s31.00x
🐘 PostgresNitro10.509s (-1.8%)11.016s (~)0.507s31.00x
💻 LocalExpress10.544s (+0.6%)11.021s (~)0.477s31.00x
🐘 PostgresExpress10.574s (~)11.019s (~)0.446s31.01x
💻 LocalNext.js (Turbopack)10.777s (~)11.023s (~)0.246s31.03x
🐘 PostgresNext.js (Turbopack)10.824s (~)11.019s (~)0.195s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.657s (-0.7%)14.027s (~)0.370s51.00x
🐘 PostgresNitro13.714s (-6.5% 🟢)14.018s (-6.7% 🟢)0.303s51.00x
💻 LocalExpress13.742s (~)14.026s (~)0.284s51.01x
🐘 PostgresExpress13.752s (-1.3%)14.017s (~)0.266s51.01x
💻 LocalNext.js (Turbopack)14.383s (~)15.029s (~)0.646s41.05x
🐘 PostgresNext.js (Turbopack)14.582s (+1.4%)15.024s (~)0.442s41.07x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.314s (-0.7%)13.025s (~)0.711s71.00x
🐘 PostgresNitro12.488s (-1.6%)13.024s (-2.1%)0.536s71.01x
💻 LocalExpress12.513s (+1.4%)13.024s (~)0.511s71.02x
🐘 PostgresExpress12.550s (~)13.019s (~)0.470s71.02x
💻 LocalNext.js (Turbopack)13.583s (~)14.026s (~)0.443s71.10x
🐘 PostgresNext.js (Turbopack)13.757s (+0.8%)14.020s (~)0.263s71.12x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.181s (-1.0%)2.008s (~)0.827s151.00x
🐘 PostgresNitro1.181s (-6.1% 🟢)2.008s (~)0.827s151.00x
💻 LocalExpress1.200s (-3.0%)2.006s (~)0.806s151.02x
🐘 PostgresNext.js (Turbopack)1.228s (~)2.008s (~)0.780s151.04x
💻 LocalNitro1.264s (+3.9%)2.006s (~)0.742s151.07x
💻 LocalNext.js (Turbopack)1.322s (~)2.006s (~)0.684s151.12x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.249s (-0.9%)2.007s (~)0.758s151.00x
🐘 PostgresNitro1.251s (-7.9% 🟢)2.007s (~)0.756s151.00x
🐘 PostgresNext.js (Turbopack)1.375s (-0.7%)2.007s (~)0.632s151.10x
💻 LocalExpress1.636s (-4.1%)2.006s (~)0.370s151.31x
💻 LocalNitro1.708s (-2.7%)2.006s (~)0.298s151.37x
💻 LocalNext.js (Turbopack)1.898s (~)2.469s (+6.7% 🔺)0.571s131.52x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.396s (-5.1% 🟢)2.007s (-13.5% 🟢)0.611s151.00x
🐘 PostgresExpress1.432s (+2.3%)2.008s (~)0.576s151.03x
🐘 PostgresNext.js (Turbopack)1.729s (+1.9%)2.075s (-3.2%)0.346s151.24x
💻 LocalExpress3.912s (-18.8% 🟢)4.439s (-16.9% 🟢)0.527s72.80x
💻 LocalNitro4.610s (-2.9%)5.347s (+3.2%)0.737s63.30x
💻 LocalNext.js (Turbopack)5.487s (~)6.012s (-3.3%)0.526s53.93x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.180s (-0.7%)2.009s (~)0.829s151.00x
🐘 PostgresNitro1.186s (-9.7% 🟢)2.008s (-3.4%)0.823s151.00x
🐘 PostgresNext.js (Turbopack)1.248s (~)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.402s (+1.5%)2.006s (~)0.604s151.19x
💻 LocalNitro1.496s (-9.4% 🟢)2.006s (-3.2%)0.510s151.27x
💻 LocalExpress1.551s (+2.1%)2.006s (~)0.455s151.31x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (+0.8%)2.008s (~)0.748s151.00x
🐘 PostgresExpress1.284s (+2.3%)2.009s (~)0.725s151.02x
🐘 PostgresNext.js (Turbopack)1.374s (-5.3% 🟢)2.008s (-3.2%)0.634s151.09x
💻 LocalNitro1.889s (-10.6% 🟢)2.316s (-15.3% 🟢)0.427s131.50x
💻 LocalExpress1.962s (+3.5%)2.316s (~)0.353s131.56x
💻 LocalNext.js (Turbopack)2.091s (~)2.826s (~)0.736s111.66x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.409s (-3.1%)2.008s (-3.4%)0.599s151.00x
🐘 PostgresExpress1.422s (+1.9%)2.007s (~)0.585s151.01x
🐘 PostgresNext.js (Turbopack)1.691s (-1.8%)2.316s (+4.3%)0.625s131.20x
💻 LocalExpress4.932s (-6.9% 🟢)5.513s (-5.7% 🟢)0.581s63.50x
💻 LocalNitro5.226s (-11.6% 🟢)5.683s (-11.4% 🟢)0.457s63.71x
💻 LocalNext.js (Turbopack)5.591s (-3.5%)6.213s (~)0.622s53.97x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.566s (+13.1% 🔺)1.024s (+1.2%)0.458s591.00x
🐘 PostgresExpress0.586s (+2.8%)1.024s (+1.7%)0.438s601.04x
💻 LocalExpress0.593s (-1.2%)1.004s (~)0.412s601.05x
💻 LocalNitro0.627s (+6.0% 🔺)1.022s (+1.7%)0.395s591.11x
🐘 PostgresNext.js (Turbopack)0.819s (-2.4%)1.024s (-3.4%)0.205s591.45x
💻 LocalNext.js (Turbopack)0.852s (-2.3%)1.004s (-3.3%)0.152s601.51x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-7.9% 🟢)2.008s (~)0.681s451.00x
🐘 PostgresExpress1.351s (~)2.008s (~)0.656s451.02x
💻 LocalNitro1.452s (-3.2%)2.006s (-1.1%)0.554s451.09x
💻 LocalExpress1.471s (-3.7%)2.005s (-1.1%)0.535s451.11x
🐘 PostgresNext.js (Turbopack)1.927s (+0.8%)2.150s (+2.4%)0.224s421.45x
💻 LocalNext.js (Turbopack)2.066s (-1.7%)2.882s (-4.2%)0.816s321.56x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.676s (+1.5%)3.111s (-6.3% 🟢)0.435s391.00x
🐘 PostgresExpress2.740s (-1.0%)3.085s (-1.7%)0.346s391.02x
💻 LocalNitro3.170s (+0.6%)3.912s (-0.8%)0.742s311.18x
💻 LocalExpress3.242s (~)3.945s (-0.8%)0.703s311.21x
🐘 PostgresNext.js (Turbopack)3.796s (-0.8%)4.009s (-2.4%)0.214s301.42x
💻 LocalNext.js (Turbopack)4.310s (-2.9%)5.010s (~)0.700s241.61x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.213s (-4.0%)1.006s (~)0.793s601.00x
🐘 PostgresExpress0.235s (+3.1%)1.006s (~)0.772s601.10x
🐘 PostgresNext.js (Turbopack)0.271s (+2.8%)1.007s (~)0.736s601.27x
💻 LocalExpress0.417s (-0.8%)1.004s (~)0.586s601.96x
💻 LocalNitro0.506s (+12.3% 🔺)1.095s (+9.1% 🔺)0.589s552.38x
💻 LocalNext.js (Turbopack)0.565s (-12.0% 🟢)1.005s (-5.1% 🟢)0.440s602.66x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.344s (-12.6% 🟢)1.018s (~)0.673s891.00x
🐘 PostgresExpress0.358s (-0.7%)1.006s (~)0.648s901.04x
🐘 PostgresNext.js (Turbopack)0.483s (+1.6%)1.006s (~)0.522s901.40x
💻 LocalExpress2.012s (-4.5%)2.580s (-2.9%)0.567s355.85x
💻 LocalNitro2.091s (+1.2%)2.579s (-2.2%)0.488s356.07x
💻 LocalNext.js (Turbopack)2.337s (-8.2% 🟢)3.044s (-7.7% 🟢)0.707s306.79x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.647s (+4.1%)1.006s (-6.2% 🟢)0.359s1201.00x
🐘 PostgresExpress0.703s (+1.9%)1.006s (~)0.303s1201.09x
🐘 PostgresNext.js (Turbopack)0.985s (+1.6%)1.527s (-2.5%)0.543s791.52x
💻 LocalExpress8.786s (-7.3% 🟢)9.330s (-6.9% 🟢)0.543s1313.58x
💻 LocalNitro9.638s (+2.1%)10.109s (+0.8%)0.471s1214.89x
💻 LocalNext.js (Turbopack)10.511s (-3.9%)11.298s (-3.9%)0.787s1116.24x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.158s (~)2.005s (~)0.011s (-9.5% 🟢)2.017s (~)0.859s101.00x
💻 LocalExpress1.162s (~)2.005s (~)0.010s (-4.8%)2.017s (~)0.855s101.00x
🐘 PostgresNitro1.162s (~)2.001s (~)0.001s (+83.3% 🔺)2.010s (~)0.848s101.00x
🐘 PostgresExpress1.163s (-0.7%)1.999s (~)0.001s (-22.2% 🟢)2.011s (~)0.848s101.00x
💻 LocalNext.js (Turbopack)1.202s (-0.6%)2.003s (~)0.012s (+3.3%)2.019s (~)0.818s101.04x
🐘 PostgresNext.js (Turbopack)1.218s (-1.2%)2.002s (~)0.002s (+15.4% 🔺)2.011s (~)0.793s101.05x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.561s (~)2.009s (~)0.010s (~)2.021s (~)0.460s301.00x
🐘 PostgresNitro1.564s (-5.4% 🟢)2.008s (-3.0%)0.004s (+20.4% 🔺)2.025s (-3.0%)0.461s301.00x
💻 LocalNitro1.580s (~)2.009s (~)0.011s (+2.6%)2.022s (~)0.442s301.01x
🐘 PostgresExpress1.599s (+0.6%)2.003s (~)0.004s (-2.6%)2.026s (~)0.427s301.02x
💻 LocalNext.js (Turbopack)1.724s (-3.8%)2.009s (~)0.011s (-15.8% 🟢)2.023s (~)0.299s301.10x
🐘 PostgresNext.js (Turbopack)1.730s (+0.9%)2.010s (~)0.004s (-2.6%)2.025s (~)0.295s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.690s (-27.9% 🟢)1.013s (-20.3% 🟢)0.000s (-18.6% 🟢)1.040s (-20.5% 🟢)0.350s591.00x
🐘 PostgresExpress0.720s (+1.0%)1.013s (-1.7%)0.000s (+50.0% 🔺)1.039s (~)0.320s581.04x
🐘 PostgresNext.js (Turbopack)0.850s (+10.3% 🔺)1.109s (+7.2% 🔺)0.000s (+110.9% 🔺)1.124s (+7.1% 🔺)0.274s551.23x
💻 LocalExpress1.370s (-1.6%)2.012s (~)0.000s (-15.4% 🟢)2.014s (~)0.644s301.99x
💻 LocalNitro1.430s (+3.2%)2.014s (~)0.001s (-15.8% 🟢)2.017s (~)0.587s302.07x
💻 LocalNext.js (Turbopack)1.492s (~)2.013s (~)0.000s (+80.0% 🔺)2.016s (~)0.524s302.16x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.374s (-28.7% 🟢)2.103s (-10.1% 🟢)0.000s (-100.0% 🟢)2.123s (-10.3% 🟢)0.749s291.00x
🐘 PostgresExpress1.397s (-2.4%)2.063s (-3.4%)0.000s (~)2.081s (-3.7%)0.684s291.02x
🐘 PostgresNext.js (Turbopack)1.680s (-1.1%)2.181s (-1.6%)0.000s (-100.0% 🟢)2.189s (-2.4%)0.508s281.22x
💻 LocalNext.js (Turbopack)2.900s (-2.2%)3.466s (-4.1%)0.001s (+20.2% 🔺)3.474s (-4.0%)0.573s182.11x
💻 LocalExpress3.047s (-0.8%)3.774s (-1.7%)0.001s (~)3.777s (-1.7%)0.730s162.22x
💻 LocalNitro3.196s (+7.6% 🔺)3.901s (+8.0% 🔺)0.000s (-20.3% 🟢)3.905s (+8.0% 🔺)0.709s162.33x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress10/21
🐘 PostgresNitro16/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed for correctness and regression risk — backward-compatible and safe to merge, defaults are unchanged and every request path threads config consistently. A few non-blocking notes inline.

import { createVercelWorld } from '@workflow/world-vercel';
import { setWorld } from '@workflow/core/runtime';

setWorld(createVercelWorld({ dispatcher: new Agent({ connections: 16 }) }));

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.

Injection timing caveat worth documenting here: at Vercel runtime createWorld() calls createVercelWorld() with no config, so setWorld(...) is the only injection path. If the runtime has already created/cached the world before this setWorld call runs, the custom dispatcher silently won't take effect. Worth a one-line note that setWorld must run before the world is first used (i.e. before the first workflow request).

* dispatcher from a different undici version. Callers may pass any undici
* version's dispatcher, or any object implementing the dispatcher contract.
*/
dispatcher?: unknown;

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.

unknown is the right call given undici's version-specific Dispatcher type (the doc comment explains it well). Just flagging the trade-off: callers get zero type safety, so a malformed/incompatible dispatcher fails only at runtime inside fetch/@vercel/queue rather than at compile time. Acceptable here, but worth keeping in mind for the error story.

* shared default agent.
*/
export function getDispatcher(config?: APIConfig): unknown {
return config?.dispatcher ?? getDefaultDispatcher();

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.

Nullish coalescing means an explicit dispatcher: null (or undefined) falls back to the shared default — sensible and probably the desired behavior. Only note: a caller who passes a falsy-but-intentional value expecting it to be used would be surprised, but for a dispatcher that's the correct semantics. No change needed; documenting the intent.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2242. (backport job run)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

feat(world-vercel): allow a custom dispatcher - #2235

Merged
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch
Jun 4, 2026
Merged

feat(world-vercel): allow a custom dispatcher#2235
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch

Conversation

@AndrewBarba

@AndrewBarbaAndrewBarba commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dispatcher option to APIConfig (consumed by createVercelWorld) so callers can supply a custom undici dispatcher. It is threaded through every request path — HTTP API calls, refs, encryption key fetch, deployment resolution, and the @vercel/queue client — and defaults to the shared undici RetryAgent.

Why

The Vercel world relies on Node's built-in fetch being undici-backed and pins a specific undici version. Both the HTTP and queue paths already issue requests via global fetch with an undici dispatcher, so exposing the dispatcher gives callers a single, uniform knob to bring their own undici Agent/RetryAgent (e.g. to tune pooling/retries on newer Node runtimes) without us changing defaults.

Note: this intentionally exposes the dispatcher rather than a custom fetch. @vercel/queue only accepts a dispatcher (it calls global fetch directly with no fetch-injection point), so the dispatcher is the one option that works consistently across both paths.

How

  • New APIConfig.dispatcher?: unknown (mirrors @vercel/queue's own dispatcher?: unknown).
  • getDispatcher(config?) now returns the caller's dispatcher when set, else the shared default agent (the previous singleton, renamed to getDefaultDispatcher).
  • All call sites pass config through; default behavior is unchanged.

Usage

At Vercel runtime createWorld() calls createVercelWorld() with no config, so injection is via the existing setWorld escape hatch (documented in the README):

import{Agent}from'undici';import{createVercelWorld}from'@workflow/world-vercel';import{setWorld}from'@workflow/core/runtime';setWorld(createVercelWorld({dispatcher: newAgent({connections: 16})}));

Tests

  • New http-client.test.ts covering getDispatcher default vs. override.
  • Full package suite green (115 tests).

No public API removed; dispatcher is purely additive and defaults to current undici behavior.

@vercel

vercelBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9949659

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelMinor
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@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 Jun 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production126602191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total7183010528235

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro109026
✅ example109026
✅ express109026
✅ fastify109026
✅ hono109026
✅ nextjs-turbopack13302
✅ nextjs-webpack13302
✅ nitro109026
✅ nuxt109026
✅ sveltekit12807
✅ vite109026
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.038s (-11.3% 🟢)1.005s (~)0.967s101.00x
🐘 PostgresExpress0.062s (-4.9%)1.011s (~)0.949s101.62x
💻 LocalNext.js (Turbopack)0.063s (-1.4%)1.007s (~)0.944s101.63x
🐘 PostgresNitro0.067s (-25.1% 🟢)1.012s (-1.8%)0.945s101.75x
🐘 PostgresNext.js (Turbopack)0.068s (-2.3%)1.011s (~)0.943s101.77x
💻 LocalExpress0.545s (+1232.3% 🔺)1.508s (+50.0% 🔺)0.963s1014.15x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.091s (~)2.006s (~)0.915s101.00x
💻 LocalExpress1.092s (~)2.006s (~)0.914s101.00x
🐘 PostgresExpress1.106s (~)2.010s (~)0.904s101.01x
🐘 PostgresNitro1.108s (-3.0%)2.009s (-1.2%)0.901s101.02x
💻 LocalNext.js (Turbopack)1.135s (~)2.007s (~)0.872s101.04x
🐘 PostgresNext.js (Turbopack)1.137s (~)2.009s (~)0.872s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.504s (~)11.021s (~)0.517s31.00x
🐘 PostgresNitro10.509s (-1.8%)11.016s (~)0.507s31.00x
💻 LocalExpress10.544s (+0.6%)11.021s (~)0.477s31.00x
🐘 PostgresExpress10.574s (~)11.019s (~)0.446s31.01x
💻 LocalNext.js (Turbopack)10.777s (~)11.023s (~)0.246s31.03x
🐘 PostgresNext.js (Turbopack)10.824s (~)11.019s (~)0.195s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.657s (-0.7%)14.027s (~)0.370s51.00x
🐘 PostgresNitro13.714s (-6.5% 🟢)14.018s (-6.7% 🟢)0.303s51.00x
💻 LocalExpress13.742s (~)14.026s (~)0.284s51.01x
🐘 PostgresExpress13.752s (-1.3%)14.017s (~)0.266s51.01x
💻 LocalNext.js (Turbopack)14.383s (~)15.029s (~)0.646s41.05x
🐘 PostgresNext.js (Turbopack)14.582s (+1.4%)15.024s (~)0.442s41.07x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.314s (-0.7%)13.025s (~)0.711s71.00x
🐘 PostgresNitro12.488s (-1.6%)13.024s (-2.1%)0.536s71.01x
💻 LocalExpress12.513s (+1.4%)13.024s (~)0.511s71.02x
🐘 PostgresExpress12.550s (~)13.019s (~)0.470s71.02x
💻 LocalNext.js (Turbopack)13.583s (~)14.026s (~)0.443s71.10x
🐘 PostgresNext.js (Turbopack)13.757s (+0.8%)14.020s (~)0.263s71.12x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.181s (-1.0%)2.008s (~)0.827s151.00x
🐘 PostgresNitro1.181s (-6.1% 🟢)2.008s (~)0.827s151.00x
💻 LocalExpress1.200s (-3.0%)2.006s (~)0.806s151.02x
🐘 PostgresNext.js (Turbopack)1.228s (~)2.008s (~)0.780s151.04x
💻 LocalNitro1.264s (+3.9%)2.006s (~)0.742s151.07x
💻 LocalNext.js (Turbopack)1.322s (~)2.006s (~)0.684s151.12x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.249s (-0.9%)2.007s (~)0.758s151.00x
🐘 PostgresNitro1.251s (-7.9% 🟢)2.007s (~)0.756s151.00x
🐘 PostgresNext.js (Turbopack)1.375s (-0.7%)2.007s (~)0.632s151.10x
💻 LocalExpress1.636s (-4.1%)2.006s (~)0.370s151.31x
💻 LocalNitro1.708s (-2.7%)2.006s (~)0.298s151.37x
💻 LocalNext.js (Turbopack)1.898s (~)2.469s (+6.7% 🔺)0.571s131.52x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.396s (-5.1% 🟢)2.007s (-13.5% 🟢)0.611s151.00x
🐘 PostgresExpress1.432s (+2.3%)2.008s (~)0.576s151.03x
🐘 PostgresNext.js (Turbopack)1.729s (+1.9%)2.075s (-3.2%)0.346s151.24x
💻 LocalExpress3.912s (-18.8% 🟢)4.439s (-16.9% 🟢)0.527s72.80x
💻 LocalNitro4.610s (-2.9%)5.347s (+3.2%)0.737s63.30x
💻 LocalNext.js (Turbopack)5.487s (~)6.012s (-3.3%)0.526s53.93x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.180s (-0.7%)2.009s (~)0.829s151.00x
🐘 PostgresNitro1.186s (-9.7% 🟢)2.008s (-3.4%)0.823s151.00x
🐘 PostgresNext.js (Turbopack)1.248s (~)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.402s (+1.5%)2.006s (~)0.604s151.19x
💻 LocalNitro1.496s (-9.4% 🟢)2.006s (-3.2%)0.510s151.27x
💻 LocalExpress1.551s (+2.1%)2.006s (~)0.455s151.31x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (+0.8%)2.008s (~)0.748s151.00x
🐘 PostgresExpress1.284s (+2.3%)2.009s (~)0.725s151.02x
🐘 PostgresNext.js (Turbopack)1.374s (-5.3% 🟢)2.008s (-3.2%)0.634s151.09x
💻 LocalNitro1.889s (-10.6% 🟢)2.316s (-15.3% 🟢)0.427s131.50x
💻 LocalExpress1.962s (+3.5%)2.316s (~)0.353s131.56x
💻 LocalNext.js (Turbopack)2.091s (~)2.826s (~)0.736s111.66x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.409s (-3.1%)2.008s (-3.4%)0.599s151.00x
🐘 PostgresExpress1.422s (+1.9%)2.007s (~)0.585s151.01x
🐘 PostgresNext.js (Turbopack)1.691s (-1.8%)2.316s (+4.3%)0.625s131.20x
💻 LocalExpress4.932s (-6.9% 🟢)5.513s (-5.7% 🟢)0.581s63.50x
💻 LocalNitro5.226s (-11.6% 🟢)5.683s (-11.4% 🟢)0.457s63.71x
💻 LocalNext.js (Turbopack)5.591s (-3.5%)6.213s (~)0.622s53.97x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.566s (+13.1% 🔺)1.024s (+1.2%)0.458s591.00x
🐘 PostgresExpress0.586s (+2.8%)1.024s (+1.7%)0.438s601.04x
💻 LocalExpress0.593s (-1.2%)1.004s (~)0.412s601.05x
💻 LocalNitro0.627s (+6.0% 🔺)1.022s (+1.7%)0.395s591.11x
🐘 PostgresNext.js (Turbopack)0.819s (-2.4%)1.024s (-3.4%)0.205s591.45x
💻 LocalNext.js (Turbopack)0.852s (-2.3%)1.004s (-3.3%)0.152s601.51x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-7.9% 🟢)2.008s (~)0.681s451.00x
🐘 PostgresExpress1.351s (~)2.008s (~)0.656s451.02x
💻 LocalNitro1.452s (-3.2%)2.006s (-1.1%)0.554s451.09x
💻 LocalExpress1.471s (-3.7%)2.005s (-1.1%)0.535s451.11x
🐘 PostgresNext.js (Turbopack)1.927s (+0.8%)2.150s (+2.4%)0.224s421.45x
💻 LocalNext.js (Turbopack)2.066s (-1.7%)2.882s (-4.2%)0.816s321.56x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.676s (+1.5%)3.111s (-6.3% 🟢)0.435s391.00x
🐘 PostgresExpress2.740s (-1.0%)3.085s (-1.7%)0.346s391.02x
💻 LocalNitro3.170s (+0.6%)3.912s (-0.8%)0.742s311.18x
💻 LocalExpress3.242s (~)3.945s (-0.8%)0.703s311.21x
🐘 PostgresNext.js (Turbopack)3.796s (-0.8%)4.009s (-2.4%)0.214s301.42x
💻 LocalNext.js (Turbopack)4.310s (-2.9%)5.010s (~)0.700s241.61x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.213s (-4.0%)1.006s (~)0.793s601.00x
🐘 PostgresExpress0.235s (+3.1%)1.006s (~)0.772s601.10x
🐘 PostgresNext.js (Turbopack)0.271s (+2.8%)1.007s (~)0.736s601.27x
💻 LocalExpress0.417s (-0.8%)1.004s (~)0.586s601.96x
💻 LocalNitro0.506s (+12.3% 🔺)1.095s (+9.1% 🔺)0.589s552.38x
💻 LocalNext.js (Turbopack)0.565s (-12.0% 🟢)1.005s (-5.1% 🟢)0.440s602.66x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.344s (-12.6% 🟢)1.018s (~)0.673s891.00x
🐘 PostgresExpress0.358s (-0.7%)1.006s (~)0.648s901.04x
🐘 PostgresNext.js (Turbopack)0.483s (+1.6%)1.006s (~)0.522s901.40x
💻 LocalExpress2.012s (-4.5%)2.580s (-2.9%)0.567s355.85x
💻 LocalNitro2.091s (+1.2%)2.579s (-2.2%)0.488s356.07x
💻 LocalNext.js (Turbopack)2.337s (-8.2% 🟢)3.044s (-7.7% 🟢)0.707s306.79x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.647s (+4.1%)1.006s (-6.2% 🟢)0.359s1201.00x
🐘 PostgresExpress0.703s (+1.9%)1.006s (~)0.303s1201.09x
🐘 PostgresNext.js (Turbopack)0.985s (+1.6%)1.527s (-2.5%)0.543s791.52x
💻 LocalExpress8.786s (-7.3% 🟢)9.330s (-6.9% 🟢)0.543s1313.58x
💻 LocalNitro9.638s (+2.1%)10.109s (+0.8%)0.471s1214.89x
💻 LocalNext.js (Turbopack)10.511s (-3.9%)11.298s (-3.9%)0.787s1116.24x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.158s (~)2.005s (~)0.011s (-9.5% 🟢)2.017s (~)0.859s101.00x
💻 LocalExpress1.162s (~)2.005s (~)0.010s (-4.8%)2.017s (~)0.855s101.00x
🐘 PostgresNitro1.162s (~)2.001s (~)0.001s (+83.3% 🔺)2.010s (~)0.848s101.00x
🐘 PostgresExpress1.163s (-0.7%)1.999s (~)0.001s (-22.2% 🟢)2.011s (~)0.848s101.00x
💻 LocalNext.js (Turbopack)1.202s (-0.6%)2.003s (~)0.012s (+3.3%)2.019s (~)0.818s101.04x
🐘 PostgresNext.js (Turbopack)1.218s (-1.2%)2.002s (~)0.002s (+15.4% 🔺)2.011s (~)0.793s101.05x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.561s (~)2.009s (~)0.010s (~)2.021s (~)0.460s301.00x
🐘 PostgresNitro1.564s (-5.4% 🟢)2.008s (-3.0%)0.004s (+20.4% 🔺)2.025s (-3.0%)0.461s301.00x
💻 LocalNitro1.580s (~)2.009s (~)0.011s (+2.6%)2.022s (~)0.442s301.01x
🐘 PostgresExpress1.599s (+0.6%)2.003s (~)0.004s (-2.6%)2.026s (~)0.427s301.02x
💻 LocalNext.js (Turbopack)1.724s (-3.8%)2.009s (~)0.011s (-15.8% 🟢)2.023s (~)0.299s301.10x
🐘 PostgresNext.js (Turbopack)1.730s (+0.9%)2.010s (~)0.004s (-2.6%)2.025s (~)0.295s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.690s (-27.9% 🟢)1.013s (-20.3% 🟢)0.000s (-18.6% 🟢)1.040s (-20.5% 🟢)0.350s591.00x
🐘 PostgresExpress0.720s (+1.0%)1.013s (-1.7%)0.000s (+50.0% 🔺)1.039s (~)0.320s581.04x
🐘 PostgresNext.js (Turbopack)0.850s (+10.3% 🔺)1.109s (+7.2% 🔺)0.000s (+110.9% 🔺)1.124s (+7.1% 🔺)0.274s551.23x
💻 LocalExpress1.370s (-1.6%)2.012s (~)0.000s (-15.4% 🟢)2.014s (~)0.644s301.99x
💻 LocalNitro1.430s (+3.2%)2.014s (~)0.001s (-15.8% 🟢)2.017s (~)0.587s302.07x
💻 LocalNext.js (Turbopack)1.492s (~)2.013s (~)0.000s (+80.0% 🔺)2.016s (~)0.524s302.16x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.374s (-28.7% 🟢)2.103s (-10.1% 🟢)0.000s (-100.0% 🟢)2.123s (-10.3% 🟢)0.749s291.00x
🐘 PostgresExpress1.397s (-2.4%)2.063s (-3.4%)0.000s (~)2.081s (-3.7%)0.684s291.02x
🐘 PostgresNext.js (Turbopack)1.680s (-1.1%)2.181s (-1.6%)0.000s (-100.0% 🟢)2.189s (-2.4%)0.508s281.22x
💻 LocalNext.js (Turbopack)2.900s (-2.2%)3.466s (-4.1%)0.001s (+20.2% 🔺)3.474s (-4.0%)0.573s182.11x
💻 LocalExpress3.047s (-0.8%)3.774s (-1.7%)0.001s (~)3.777s (-1.7%)0.730s162.22x
💻 LocalNitro3.196s (+7.6% 🔺)3.901s (+8.0% 🔺)0.000s (-20.3% 🟢)3.905s (+8.0% 🔺)0.709s162.33x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress10/21
🐘 PostgresNitro16/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed for correctness and regression risk — backward-compatible and safe to merge, defaults are unchanged and every request path threads config consistently. A few non-blocking notes inline.

import { createVercelWorld } from '@workflow/world-vercel';
import { setWorld } from '@workflow/core/runtime';

setWorld(createVercelWorld({ dispatcher: new Agent({ connections: 16 }) }));

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.

Injection timing caveat worth documenting here: at Vercel runtime createWorld() calls createVercelWorld() with no config, so setWorld(...) is the only injection path. If the runtime has already created/cached the world before this setWorld call runs, the custom dispatcher silently won't take effect. Worth a one-line note that setWorld must run before the world is first used (i.e. before the first workflow request).

* dispatcher from a different undici version. Callers may pass any undici
* version's dispatcher, or any object implementing the dispatcher contract.
*/
dispatcher?: unknown;

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.

unknown is the right call given undici's version-specific Dispatcher type (the doc comment explains it well). Just flagging the trade-off: callers get zero type safety, so a malformed/incompatible dispatcher fails only at runtime inside fetch/@vercel/queue rather than at compile time. Acceptable here, but worth keeping in mind for the error story.

* shared default agent.
*/
export function getDispatcher(config?: APIConfig): unknown {
return config?.dispatcher ?? getDefaultDispatcher();

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.

Nullish coalescing means an explicit dispatcher: null (or undefined) falls back to the shared default — sensible and probably the desired behavior. Only note: a caller who passes a falsy-but-intentional value expecting it to be used would be surprised, but for a dispatcher that's the correct semantics. No change needed; documenting the intent.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2242. (backport job run)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

feat(world-vercel): allow a custom dispatcher - #2235

Merged
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch
Jun 4, 2026
Merged

feat(world-vercel): allow a custom dispatcher#2235
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch

Conversation

@AndrewBarba

@AndrewBarbaAndrewBarba commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dispatcher option to APIConfig (consumed by createVercelWorld) so callers can supply a custom undici dispatcher. It is threaded through every request path — HTTP API calls, refs, encryption key fetch, deployment resolution, and the @vercel/queue client — and defaults to the shared undici RetryAgent.

Why

The Vercel world relies on Node's built-in fetch being undici-backed and pins a specific undici version. Both the HTTP and queue paths already issue requests via global fetch with an undici dispatcher, so exposing the dispatcher gives callers a single, uniform knob to bring their own undici Agent/RetryAgent (e.g. to tune pooling/retries on newer Node runtimes) without us changing defaults.

Note: this intentionally exposes the dispatcher rather than a custom fetch. @vercel/queue only accepts a dispatcher (it calls global fetch directly with no fetch-injection point), so the dispatcher is the one option that works consistently across both paths.

How

  • New APIConfig.dispatcher?: unknown (mirrors @vercel/queue's own dispatcher?: unknown).
  • getDispatcher(config?) now returns the caller's dispatcher when set, else the shared default agent (the previous singleton, renamed to getDefaultDispatcher).
  • All call sites pass config through; default behavior is unchanged.

Usage

At Vercel runtime createWorld() calls createVercelWorld() with no config, so injection is via the existing setWorld escape hatch (documented in the README):

import{Agent}from'undici';import{createVercelWorld}from'@workflow/world-vercel';import{setWorld}from'@workflow/core/runtime';setWorld(createVercelWorld({dispatcher: newAgent({connections: 16})}));

Tests

  • New http-client.test.ts covering getDispatcher default vs. override.
  • Full package suite green (115 tests).

No public API removed; dispatcher is purely additive and defaults to current undici behavior.

@vercel

vercelBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9949659

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelMinor
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@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 Jun 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production126602191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total7183010528235

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro109026
✅ example109026
✅ express109026
✅ fastify109026
✅ hono109026
✅ nextjs-turbopack13302
✅ nextjs-webpack13302
✅ nitro109026
✅ nuxt109026
✅ sveltekit12807
✅ vite109026
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.038s (-11.3% 🟢)1.005s (~)0.967s101.00x
🐘 PostgresExpress0.062s (-4.9%)1.011s (~)0.949s101.62x
💻 LocalNext.js (Turbopack)0.063s (-1.4%)1.007s (~)0.944s101.63x
🐘 PostgresNitro0.067s (-25.1% 🟢)1.012s (-1.8%)0.945s101.75x
🐘 PostgresNext.js (Turbopack)0.068s (-2.3%)1.011s (~)0.943s101.77x
💻 LocalExpress0.545s (+1232.3% 🔺)1.508s (+50.0% 🔺)0.963s1014.15x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.091s (~)2.006s (~)0.915s101.00x
💻 LocalExpress1.092s (~)2.006s (~)0.914s101.00x
🐘 PostgresExpress1.106s (~)2.010s (~)0.904s101.01x
🐘 PostgresNitro1.108s (-3.0%)2.009s (-1.2%)0.901s101.02x
💻 LocalNext.js (Turbopack)1.135s (~)2.007s (~)0.872s101.04x
🐘 PostgresNext.js (Turbopack)1.137s (~)2.009s (~)0.872s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.504s (~)11.021s (~)0.517s31.00x
🐘 PostgresNitro10.509s (-1.8%)11.016s (~)0.507s31.00x
💻 LocalExpress10.544s (+0.6%)11.021s (~)0.477s31.00x
🐘 PostgresExpress10.574s (~)11.019s (~)0.446s31.01x
💻 LocalNext.js (Turbopack)10.777s (~)11.023s (~)0.246s31.03x
🐘 PostgresNext.js (Turbopack)10.824s (~)11.019s (~)0.195s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.657s (-0.7%)14.027s (~)0.370s51.00x
🐘 PostgresNitro13.714s (-6.5% 🟢)14.018s (-6.7% 🟢)0.303s51.00x
💻 LocalExpress13.742s (~)14.026s (~)0.284s51.01x
🐘 PostgresExpress13.752s (-1.3%)14.017s (~)0.266s51.01x
💻 LocalNext.js (Turbopack)14.383s (~)15.029s (~)0.646s41.05x
🐘 PostgresNext.js (Turbopack)14.582s (+1.4%)15.024s (~)0.442s41.07x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.314s (-0.7%)13.025s (~)0.711s71.00x
🐘 PostgresNitro12.488s (-1.6%)13.024s (-2.1%)0.536s71.01x
💻 LocalExpress12.513s (+1.4%)13.024s (~)0.511s71.02x
🐘 PostgresExpress12.550s (~)13.019s (~)0.470s71.02x
💻 LocalNext.js (Turbopack)13.583s (~)14.026s (~)0.443s71.10x
🐘 PostgresNext.js (Turbopack)13.757s (+0.8%)14.020s (~)0.263s71.12x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.181s (-1.0%)2.008s (~)0.827s151.00x
🐘 PostgresNitro1.181s (-6.1% 🟢)2.008s (~)0.827s151.00x
💻 LocalExpress1.200s (-3.0%)2.006s (~)0.806s151.02x
🐘 PostgresNext.js (Turbopack)1.228s (~)2.008s (~)0.780s151.04x
💻 LocalNitro1.264s (+3.9%)2.006s (~)0.742s151.07x
💻 LocalNext.js (Turbopack)1.322s (~)2.006s (~)0.684s151.12x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.249s (-0.9%)2.007s (~)0.758s151.00x
🐘 PostgresNitro1.251s (-7.9% 🟢)2.007s (~)0.756s151.00x
🐘 PostgresNext.js (Turbopack)1.375s (-0.7%)2.007s (~)0.632s151.10x
💻 LocalExpress1.636s (-4.1%)2.006s (~)0.370s151.31x
💻 LocalNitro1.708s (-2.7%)2.006s (~)0.298s151.37x
💻 LocalNext.js (Turbopack)1.898s (~)2.469s (+6.7% 🔺)0.571s131.52x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.396s (-5.1% 🟢)2.007s (-13.5% 🟢)0.611s151.00x
🐘 PostgresExpress1.432s (+2.3%)2.008s (~)0.576s151.03x
🐘 PostgresNext.js (Turbopack)1.729s (+1.9%)2.075s (-3.2%)0.346s151.24x
💻 LocalExpress3.912s (-18.8% 🟢)4.439s (-16.9% 🟢)0.527s72.80x
💻 LocalNitro4.610s (-2.9%)5.347s (+3.2%)0.737s63.30x
💻 LocalNext.js (Turbopack)5.487s (~)6.012s (-3.3%)0.526s53.93x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.180s (-0.7%)2.009s (~)0.829s151.00x
🐘 PostgresNitro1.186s (-9.7% 🟢)2.008s (-3.4%)0.823s151.00x
🐘 PostgresNext.js (Turbopack)1.248s (~)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.402s (+1.5%)2.006s (~)0.604s151.19x
💻 LocalNitro1.496s (-9.4% 🟢)2.006s (-3.2%)0.510s151.27x
💻 LocalExpress1.551s (+2.1%)2.006s (~)0.455s151.31x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (+0.8%)2.008s (~)0.748s151.00x
🐘 PostgresExpress1.284s (+2.3%)2.009s (~)0.725s151.02x
🐘 PostgresNext.js (Turbopack)1.374s (-5.3% 🟢)2.008s (-3.2%)0.634s151.09x
💻 LocalNitro1.889s (-10.6% 🟢)2.316s (-15.3% 🟢)0.427s131.50x
💻 LocalExpress1.962s (+3.5%)2.316s (~)0.353s131.56x
💻 LocalNext.js (Turbopack)2.091s (~)2.826s (~)0.736s111.66x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.409s (-3.1%)2.008s (-3.4%)0.599s151.00x
🐘 PostgresExpress1.422s (+1.9%)2.007s (~)0.585s151.01x
🐘 PostgresNext.js (Turbopack)1.691s (-1.8%)2.316s (+4.3%)0.625s131.20x
💻 LocalExpress4.932s (-6.9% 🟢)5.513s (-5.7% 🟢)0.581s63.50x
💻 LocalNitro5.226s (-11.6% 🟢)5.683s (-11.4% 🟢)0.457s63.71x
💻 LocalNext.js (Turbopack)5.591s (-3.5%)6.213s (~)0.622s53.97x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.566s (+13.1% 🔺)1.024s (+1.2%)0.458s591.00x
🐘 PostgresExpress0.586s (+2.8%)1.024s (+1.7%)0.438s601.04x
💻 LocalExpress0.593s (-1.2%)1.004s (~)0.412s601.05x
💻 LocalNitro0.627s (+6.0% 🔺)1.022s (+1.7%)0.395s591.11x
🐘 PostgresNext.js (Turbopack)0.819s (-2.4%)1.024s (-3.4%)0.205s591.45x
💻 LocalNext.js (Turbopack)0.852s (-2.3%)1.004s (-3.3%)0.152s601.51x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-7.9% 🟢)2.008s (~)0.681s451.00x
🐘 PostgresExpress1.351s (~)2.008s (~)0.656s451.02x
💻 LocalNitro1.452s (-3.2%)2.006s (-1.1%)0.554s451.09x
💻 LocalExpress1.471s (-3.7%)2.005s (-1.1%)0.535s451.11x
🐘 PostgresNext.js (Turbopack)1.927s (+0.8%)2.150s (+2.4%)0.224s421.45x
💻 LocalNext.js (Turbopack)2.066s (-1.7%)2.882s (-4.2%)0.816s321.56x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.676s (+1.5%)3.111s (-6.3% 🟢)0.435s391.00x
🐘 PostgresExpress2.740s (-1.0%)3.085s (-1.7%)0.346s391.02x
💻 LocalNitro3.170s (+0.6%)3.912s (-0.8%)0.742s311.18x
💻 LocalExpress3.242s (~)3.945s (-0.8%)0.703s311.21x
🐘 PostgresNext.js (Turbopack)3.796s (-0.8%)4.009s (-2.4%)0.214s301.42x
💻 LocalNext.js (Turbopack)4.310s (-2.9%)5.010s (~)0.700s241.61x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.213s (-4.0%)1.006s (~)0.793s601.00x
🐘 PostgresExpress0.235s (+3.1%)1.006s (~)0.772s601.10x
🐘 PostgresNext.js (Turbopack)0.271s (+2.8%)1.007s (~)0.736s601.27x
💻 LocalExpress0.417s (-0.8%)1.004s (~)0.586s601.96x
💻 LocalNitro0.506s (+12.3% 🔺)1.095s (+9.1% 🔺)0.589s552.38x
💻 LocalNext.js (Turbopack)0.565s (-12.0% 🟢)1.005s (-5.1% 🟢)0.440s602.66x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.344s (-12.6% 🟢)1.018s (~)0.673s891.00x
🐘 PostgresExpress0.358s (-0.7%)1.006s (~)0.648s901.04x
🐘 PostgresNext.js (Turbopack)0.483s (+1.6%)1.006s (~)0.522s901.40x
💻 LocalExpress2.012s (-4.5%)2.580s (-2.9%)0.567s355.85x
💻 LocalNitro2.091s (+1.2%)2.579s (-2.2%)0.488s356.07x
💻 LocalNext.js (Turbopack)2.337s (-8.2% 🟢)3.044s (-7.7% 🟢)0.707s306.79x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.647s (+4.1%)1.006s (-6.2% 🟢)0.359s1201.00x
🐘 PostgresExpress0.703s (+1.9%)1.006s (~)0.303s1201.09x
🐘 PostgresNext.js (Turbopack)0.985s (+1.6%)1.527s (-2.5%)0.543s791.52x
💻 LocalExpress8.786s (-7.3% 🟢)9.330s (-6.9% 🟢)0.543s1313.58x
💻 LocalNitro9.638s (+2.1%)10.109s (+0.8%)0.471s1214.89x
💻 LocalNext.js (Turbopack)10.511s (-3.9%)11.298s (-3.9%)0.787s1116.24x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.158s (~)2.005s (~)0.011s (-9.5% 🟢)2.017s (~)0.859s101.00x
💻 LocalExpress1.162s (~)2.005s (~)0.010s (-4.8%)2.017s (~)0.855s101.00x
🐘 PostgresNitro1.162s (~)2.001s (~)0.001s (+83.3% 🔺)2.010s (~)0.848s101.00x
🐘 PostgresExpress1.163s (-0.7%)1.999s (~)0.001s (-22.2% 🟢)2.011s (~)0.848s101.00x
💻 LocalNext.js (Turbopack)1.202s (-0.6%)2.003s (~)0.012s (+3.3%)2.019s (~)0.818s101.04x
🐘 PostgresNext.js (Turbopack)1.218s (-1.2%)2.002s (~)0.002s (+15.4% 🔺)2.011s (~)0.793s101.05x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.561s (~)2.009s (~)0.010s (~)2.021s (~)0.460s301.00x
🐘 PostgresNitro1.564s (-5.4% 🟢)2.008s (-3.0%)0.004s (+20.4% 🔺)2.025s (-3.0%)0.461s301.00x
💻 LocalNitro1.580s (~)2.009s (~)0.011s (+2.6%)2.022s (~)0.442s301.01x
🐘 PostgresExpress1.599s (+0.6%)2.003s (~)0.004s (-2.6%)2.026s (~)0.427s301.02x
💻 LocalNext.js (Turbopack)1.724s (-3.8%)2.009s (~)0.011s (-15.8% 🟢)2.023s (~)0.299s301.10x
🐘 PostgresNext.js (Turbopack)1.730s (+0.9%)2.010s (~)0.004s (-2.6%)2.025s (~)0.295s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.690s (-27.9% 🟢)1.013s (-20.3% 🟢)0.000s (-18.6% 🟢)1.040s (-20.5% 🟢)0.350s591.00x
🐘 PostgresExpress0.720s (+1.0%)1.013s (-1.7%)0.000s (+50.0% 🔺)1.039s (~)0.320s581.04x
🐘 PostgresNext.js (Turbopack)0.850s (+10.3% 🔺)1.109s (+7.2% 🔺)0.000s (+110.9% 🔺)1.124s (+7.1% 🔺)0.274s551.23x
💻 LocalExpress1.370s (-1.6%)2.012s (~)0.000s (-15.4% 🟢)2.014s (~)0.644s301.99x
💻 LocalNitro1.430s (+3.2%)2.014s (~)0.001s (-15.8% 🟢)2.017s (~)0.587s302.07x
💻 LocalNext.js (Turbopack)1.492s (~)2.013s (~)0.000s (+80.0% 🔺)2.016s (~)0.524s302.16x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.374s (-28.7% 🟢)2.103s (-10.1% 🟢)0.000s (-100.0% 🟢)2.123s (-10.3% 🟢)0.749s291.00x
🐘 PostgresExpress1.397s (-2.4%)2.063s (-3.4%)0.000s (~)2.081s (-3.7%)0.684s291.02x
🐘 PostgresNext.js (Turbopack)1.680s (-1.1%)2.181s (-1.6%)0.000s (-100.0% 🟢)2.189s (-2.4%)0.508s281.22x
💻 LocalNext.js (Turbopack)2.900s (-2.2%)3.466s (-4.1%)0.001s (+20.2% 🔺)3.474s (-4.0%)0.573s182.11x
💻 LocalExpress3.047s (-0.8%)3.774s (-1.7%)0.001s (~)3.777s (-1.7%)0.730s162.22x
💻 LocalNitro3.196s (+7.6% 🔺)3.901s (+8.0% 🔺)0.000s (-20.3% 🟢)3.905s (+8.0% 🔺)0.709s162.33x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress10/21
🐘 PostgresNitro16/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed for correctness and regression risk — backward-compatible and safe to merge, defaults are unchanged and every request path threads config consistently. A few non-blocking notes inline.

import { createVercelWorld } from '@workflow/world-vercel';
import { setWorld } from '@workflow/core/runtime';

setWorld(createVercelWorld({ dispatcher: new Agent({ connections: 16 }) }));

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.

Injection timing caveat worth documenting here: at Vercel runtime createWorld() calls createVercelWorld() with no config, so setWorld(...) is the only injection path. If the runtime has already created/cached the world before this setWorld call runs, the custom dispatcher silently won't take effect. Worth a one-line note that setWorld must run before the world is first used (i.e. before the first workflow request).

* dispatcher from a different undici version. Callers may pass any undici
* version's dispatcher, or any object implementing the dispatcher contract.
*/
dispatcher?: unknown;

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.

unknown is the right call given undici's version-specific Dispatcher type (the doc comment explains it well). Just flagging the trade-off: callers get zero type safety, so a malformed/incompatible dispatcher fails only at runtime inside fetch/@vercel/queue rather than at compile time. Acceptable here, but worth keeping in mind for the error story.

* shared default agent.
*/
export function getDispatcher(config?: APIConfig): unknown {
return config?.dispatcher ?? getDefaultDispatcher();

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.

Nullish coalescing means an explicit dispatcher: null (or undefined) falls back to the shared default — sensible and probably the desired behavior. Only note: a caller who passes a falsy-but-intentional value expecting it to be used would be surprised, but for a dispatcher that's the correct semantics. No change needed; documenting the intent.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2242. (backport job run)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

feat(world-vercel): allow a custom dispatcher - #2235

Merged
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch
Jun 4, 2026
Merged

feat(world-vercel): allow a custom dispatcher#2235
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch

Conversation

@AndrewBarba

@AndrewBarbaAndrewBarba commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dispatcher option to APIConfig (consumed by createVercelWorld) so callers can supply a custom undici dispatcher. It is threaded through every request path — HTTP API calls, refs, encryption key fetch, deployment resolution, and the @vercel/queue client — and defaults to the shared undici RetryAgent.

Why

The Vercel world relies on Node's built-in fetch being undici-backed and pins a specific undici version. Both the HTTP and queue paths already issue requests via global fetch with an undici dispatcher, so exposing the dispatcher gives callers a single, uniform knob to bring their own undici Agent/RetryAgent (e.g. to tune pooling/retries on newer Node runtimes) without us changing defaults.

Note: this intentionally exposes the dispatcher rather than a custom fetch. @vercel/queue only accepts a dispatcher (it calls global fetch directly with no fetch-injection point), so the dispatcher is the one option that works consistently across both paths.

How

  • New APIConfig.dispatcher?: unknown (mirrors @vercel/queue's own dispatcher?: unknown).
  • getDispatcher(config?) now returns the caller's dispatcher when set, else the shared default agent (the previous singleton, renamed to getDefaultDispatcher).
  • All call sites pass config through; default behavior is unchanged.

Usage

At Vercel runtime createWorld() calls createVercelWorld() with no config, so injection is via the existing setWorld escape hatch (documented in the README):

import{Agent}from'undici';import{createVercelWorld}from'@workflow/world-vercel';import{setWorld}from'@workflow/core/runtime';setWorld(createVercelWorld({dispatcher: newAgent({connections: 16})}));

Tests

  • New http-client.test.ts covering getDispatcher default vs. override.
  • Full package suite green (115 tests).

No public API removed; dispatcher is purely additive and defaults to current undici behavior.

@vercel

vercelBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9949659

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelMinor
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@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 Jun 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production126602191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total7183010528235

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro109026
✅ example109026
✅ express109026
✅ fastify109026
✅ hono109026
✅ nextjs-turbopack13302
✅ nextjs-webpack13302
✅ nitro109026
✅ nuxt109026
✅ sveltekit12807
✅ vite109026
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.038s (-11.3% 🟢)1.005s (~)0.967s101.00x
🐘 PostgresExpress0.062s (-4.9%)1.011s (~)0.949s101.62x
💻 LocalNext.js (Turbopack)0.063s (-1.4%)1.007s (~)0.944s101.63x
🐘 PostgresNitro0.067s (-25.1% 🟢)1.012s (-1.8%)0.945s101.75x
🐘 PostgresNext.js (Turbopack)0.068s (-2.3%)1.011s (~)0.943s101.77x
💻 LocalExpress0.545s (+1232.3% 🔺)1.508s (+50.0% 🔺)0.963s1014.15x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.091s (~)2.006s (~)0.915s101.00x
💻 LocalExpress1.092s (~)2.006s (~)0.914s101.00x
🐘 PostgresExpress1.106s (~)2.010s (~)0.904s101.01x
🐘 PostgresNitro1.108s (-3.0%)2.009s (-1.2%)0.901s101.02x
💻 LocalNext.js (Turbopack)1.135s (~)2.007s (~)0.872s101.04x
🐘 PostgresNext.js (Turbopack)1.137s (~)2.009s (~)0.872s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.504s (~)11.021s (~)0.517s31.00x
🐘 PostgresNitro10.509s (-1.8%)11.016s (~)0.507s31.00x
💻 LocalExpress10.544s (+0.6%)11.021s (~)0.477s31.00x
🐘 PostgresExpress10.574s (~)11.019s (~)0.446s31.01x
💻 LocalNext.js (Turbopack)10.777s (~)11.023s (~)0.246s31.03x
🐘 PostgresNext.js (Turbopack)10.824s (~)11.019s (~)0.195s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.657s (-0.7%)14.027s (~)0.370s51.00x
🐘 PostgresNitro13.714s (-6.5% 🟢)14.018s (-6.7% 🟢)0.303s51.00x
💻 LocalExpress13.742s (~)14.026s (~)0.284s51.01x
🐘 PostgresExpress13.752s (-1.3%)14.017s (~)0.266s51.01x
💻 LocalNext.js (Turbopack)14.383s (~)15.029s (~)0.646s41.05x
🐘 PostgresNext.js (Turbopack)14.582s (+1.4%)15.024s (~)0.442s41.07x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.314s (-0.7%)13.025s (~)0.711s71.00x
🐘 PostgresNitro12.488s (-1.6%)13.024s (-2.1%)0.536s71.01x
💻 LocalExpress12.513s (+1.4%)13.024s (~)0.511s71.02x
🐘 PostgresExpress12.550s (~)13.019s (~)0.470s71.02x
💻 LocalNext.js (Turbopack)13.583s (~)14.026s (~)0.443s71.10x
🐘 PostgresNext.js (Turbopack)13.757s (+0.8%)14.020s (~)0.263s71.12x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.181s (-1.0%)2.008s (~)0.827s151.00x
🐘 PostgresNitro1.181s (-6.1% 🟢)2.008s (~)0.827s151.00x
💻 LocalExpress1.200s (-3.0%)2.006s (~)0.806s151.02x
🐘 PostgresNext.js (Turbopack)1.228s (~)2.008s (~)0.780s151.04x
💻 LocalNitro1.264s (+3.9%)2.006s (~)0.742s151.07x
💻 LocalNext.js (Turbopack)1.322s (~)2.006s (~)0.684s151.12x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.249s (-0.9%)2.007s (~)0.758s151.00x
🐘 PostgresNitro1.251s (-7.9% 🟢)2.007s (~)0.756s151.00x
🐘 PostgresNext.js (Turbopack)1.375s (-0.7%)2.007s (~)0.632s151.10x
💻 LocalExpress1.636s (-4.1%)2.006s (~)0.370s151.31x
💻 LocalNitro1.708s (-2.7%)2.006s (~)0.298s151.37x
💻 LocalNext.js (Turbopack)1.898s (~)2.469s (+6.7% 🔺)0.571s131.52x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.396s (-5.1% 🟢)2.007s (-13.5% 🟢)0.611s151.00x
🐘 PostgresExpress1.432s (+2.3%)2.008s (~)0.576s151.03x
🐘 PostgresNext.js (Turbopack)1.729s (+1.9%)2.075s (-3.2%)0.346s151.24x
💻 LocalExpress3.912s (-18.8% 🟢)4.439s (-16.9% 🟢)0.527s72.80x
💻 LocalNitro4.610s (-2.9%)5.347s (+3.2%)0.737s63.30x
💻 LocalNext.js (Turbopack)5.487s (~)6.012s (-3.3%)0.526s53.93x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.180s (-0.7%)2.009s (~)0.829s151.00x
🐘 PostgresNitro1.186s (-9.7% 🟢)2.008s (-3.4%)0.823s151.00x
🐘 PostgresNext.js (Turbopack)1.248s (~)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.402s (+1.5%)2.006s (~)0.604s151.19x
💻 LocalNitro1.496s (-9.4% 🟢)2.006s (-3.2%)0.510s151.27x
💻 LocalExpress1.551s (+2.1%)2.006s (~)0.455s151.31x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (+0.8%)2.008s (~)0.748s151.00x
🐘 PostgresExpress1.284s (+2.3%)2.009s (~)0.725s151.02x
🐘 PostgresNext.js (Turbopack)1.374s (-5.3% 🟢)2.008s (-3.2%)0.634s151.09x
💻 LocalNitro1.889s (-10.6% 🟢)2.316s (-15.3% 🟢)0.427s131.50x
💻 LocalExpress1.962s (+3.5%)2.316s (~)0.353s131.56x
💻 LocalNext.js (Turbopack)2.091s (~)2.826s (~)0.736s111.66x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.409s (-3.1%)2.008s (-3.4%)0.599s151.00x
🐘 PostgresExpress1.422s (+1.9%)2.007s (~)0.585s151.01x
🐘 PostgresNext.js (Turbopack)1.691s (-1.8%)2.316s (+4.3%)0.625s131.20x
💻 LocalExpress4.932s (-6.9% 🟢)5.513s (-5.7% 🟢)0.581s63.50x
💻 LocalNitro5.226s (-11.6% 🟢)5.683s (-11.4% 🟢)0.457s63.71x
💻 LocalNext.js (Turbopack)5.591s (-3.5%)6.213s (~)0.622s53.97x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.566s (+13.1% 🔺)1.024s (+1.2%)0.458s591.00x
🐘 PostgresExpress0.586s (+2.8%)1.024s (+1.7%)0.438s601.04x
💻 LocalExpress0.593s (-1.2%)1.004s (~)0.412s601.05x
💻 LocalNitro0.627s (+6.0% 🔺)1.022s (+1.7%)0.395s591.11x
🐘 PostgresNext.js (Turbopack)0.819s (-2.4%)1.024s (-3.4%)0.205s591.45x
💻 LocalNext.js (Turbopack)0.852s (-2.3%)1.004s (-3.3%)0.152s601.51x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-7.9% 🟢)2.008s (~)0.681s451.00x
🐘 PostgresExpress1.351s (~)2.008s (~)0.656s451.02x
💻 LocalNitro1.452s (-3.2%)2.006s (-1.1%)0.554s451.09x
💻 LocalExpress1.471s (-3.7%)2.005s (-1.1%)0.535s451.11x
🐘 PostgresNext.js (Turbopack)1.927s (+0.8%)2.150s (+2.4%)0.224s421.45x
💻 LocalNext.js (Turbopack)2.066s (-1.7%)2.882s (-4.2%)0.816s321.56x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.676s (+1.5%)3.111s (-6.3% 🟢)0.435s391.00x
🐘 PostgresExpress2.740s (-1.0%)3.085s (-1.7%)0.346s391.02x
💻 LocalNitro3.170s (+0.6%)3.912s (-0.8%)0.742s311.18x
💻 LocalExpress3.242s (~)3.945s (-0.8%)0.703s311.21x
🐘 PostgresNext.js (Turbopack)3.796s (-0.8%)4.009s (-2.4%)0.214s301.42x
💻 LocalNext.js (Turbopack)4.310s (-2.9%)5.010s (~)0.700s241.61x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.213s (-4.0%)1.006s (~)0.793s601.00x
🐘 PostgresExpress0.235s (+3.1%)1.006s (~)0.772s601.10x
🐘 PostgresNext.js (Turbopack)0.271s (+2.8%)1.007s (~)0.736s601.27x
💻 LocalExpress0.417s (-0.8%)1.004s (~)0.586s601.96x
💻 LocalNitro0.506s (+12.3% 🔺)1.095s (+9.1% 🔺)0.589s552.38x
💻 LocalNext.js (Turbopack)0.565s (-12.0% 🟢)1.005s (-5.1% 🟢)0.440s602.66x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.344s (-12.6% 🟢)1.018s (~)0.673s891.00x
🐘 PostgresExpress0.358s (-0.7%)1.006s (~)0.648s901.04x
🐘 PostgresNext.js (Turbopack)0.483s (+1.6%)1.006s (~)0.522s901.40x
💻 LocalExpress2.012s (-4.5%)2.580s (-2.9%)0.567s355.85x
💻 LocalNitro2.091s (+1.2%)2.579s (-2.2%)0.488s356.07x
💻 LocalNext.js (Turbopack)2.337s (-8.2% 🟢)3.044s (-7.7% 🟢)0.707s306.79x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.647s (+4.1%)1.006s (-6.2% 🟢)0.359s1201.00x
🐘 PostgresExpress0.703s (+1.9%)1.006s (~)0.303s1201.09x
🐘 PostgresNext.js (Turbopack)0.985s (+1.6%)1.527s (-2.5%)0.543s791.52x
💻 LocalExpress8.786s (-7.3% 🟢)9.330s (-6.9% 🟢)0.543s1313.58x
💻 LocalNitro9.638s (+2.1%)10.109s (+0.8%)0.471s1214.89x
💻 LocalNext.js (Turbopack)10.511s (-3.9%)11.298s (-3.9%)0.787s1116.24x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.158s (~)2.005s (~)0.011s (-9.5% 🟢)2.017s (~)0.859s101.00x
💻 LocalExpress1.162s (~)2.005s (~)0.010s (-4.8%)2.017s (~)0.855s101.00x
🐘 PostgresNitro1.162s (~)2.001s (~)0.001s (+83.3% 🔺)2.010s (~)0.848s101.00x
🐘 PostgresExpress1.163s (-0.7%)1.999s (~)0.001s (-22.2% 🟢)2.011s (~)0.848s101.00x
💻 LocalNext.js (Turbopack)1.202s (-0.6%)2.003s (~)0.012s (+3.3%)2.019s (~)0.818s101.04x
🐘 PostgresNext.js (Turbopack)1.218s (-1.2%)2.002s (~)0.002s (+15.4% 🔺)2.011s (~)0.793s101.05x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.561s (~)2.009s (~)0.010s (~)2.021s (~)0.460s301.00x
🐘 PostgresNitro1.564s (-5.4% 🟢)2.008s (-3.0%)0.004s (+20.4% 🔺)2.025s (-3.0%)0.461s301.00x
💻 LocalNitro1.580s (~)2.009s (~)0.011s (+2.6%)2.022s (~)0.442s301.01x
🐘 PostgresExpress1.599s (+0.6%)2.003s (~)0.004s (-2.6%)2.026s (~)0.427s301.02x
💻 LocalNext.js (Turbopack)1.724s (-3.8%)2.009s (~)0.011s (-15.8% 🟢)2.023s (~)0.299s301.10x
🐘 PostgresNext.js (Turbopack)1.730s (+0.9%)2.010s (~)0.004s (-2.6%)2.025s (~)0.295s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.690s (-27.9% 🟢)1.013s (-20.3% 🟢)0.000s (-18.6% 🟢)1.040s (-20.5% 🟢)0.350s591.00x
🐘 PostgresExpress0.720s (+1.0%)1.013s (-1.7%)0.000s (+50.0% 🔺)1.039s (~)0.320s581.04x
🐘 PostgresNext.js (Turbopack)0.850s (+10.3% 🔺)1.109s (+7.2% 🔺)0.000s (+110.9% 🔺)1.124s (+7.1% 🔺)0.274s551.23x
💻 LocalExpress1.370s (-1.6%)2.012s (~)0.000s (-15.4% 🟢)2.014s (~)0.644s301.99x
💻 LocalNitro1.430s (+3.2%)2.014s (~)0.001s (-15.8% 🟢)2.017s (~)0.587s302.07x
💻 LocalNext.js (Turbopack)1.492s (~)2.013s (~)0.000s (+80.0% 🔺)2.016s (~)0.524s302.16x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.374s (-28.7% 🟢)2.103s (-10.1% 🟢)0.000s (-100.0% 🟢)2.123s (-10.3% 🟢)0.749s291.00x
🐘 PostgresExpress1.397s (-2.4%)2.063s (-3.4%)0.000s (~)2.081s (-3.7%)0.684s291.02x
🐘 PostgresNext.js (Turbopack)1.680s (-1.1%)2.181s (-1.6%)0.000s (-100.0% 🟢)2.189s (-2.4%)0.508s281.22x
💻 LocalNext.js (Turbopack)2.900s (-2.2%)3.466s (-4.1%)0.001s (+20.2% 🔺)3.474s (-4.0%)0.573s182.11x
💻 LocalExpress3.047s (-0.8%)3.774s (-1.7%)0.001s (~)3.777s (-1.7%)0.730s162.22x
💻 LocalNitro3.196s (+7.6% 🔺)3.901s (+8.0% 🔺)0.000s (-20.3% 🟢)3.905s (+8.0% 🔺)0.709s162.33x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress10/21
🐘 PostgresNitro16/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed for correctness and regression risk — backward-compatible and safe to merge, defaults are unchanged and every request path threads config consistently. A few non-blocking notes inline.

import { createVercelWorld } from '@workflow/world-vercel';
import { setWorld } from '@workflow/core/runtime';

setWorld(createVercelWorld({ dispatcher: new Agent({ connections: 16 }) }));

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.

Injection timing caveat worth documenting here: at Vercel runtime createWorld() calls createVercelWorld() with no config, so setWorld(...) is the only injection path. If the runtime has already created/cached the world before this setWorld call runs, the custom dispatcher silently won't take effect. Worth a one-line note that setWorld must run before the world is first used (i.e. before the first workflow request).

* dispatcher from a different undici version. Callers may pass any undici
* version's dispatcher, or any object implementing the dispatcher contract.
*/
dispatcher?: unknown;

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.

unknown is the right call given undici's version-specific Dispatcher type (the doc comment explains it well). Just flagging the trade-off: callers get zero type safety, so a malformed/incompatible dispatcher fails only at runtime inside fetch/@vercel/queue rather than at compile time. Acceptable here, but worth keeping in mind for the error story.

* shared default agent.
*/
export function getDispatcher(config?: APIConfig): unknown {
return config?.dispatcher ?? getDefaultDispatcher();

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.

Nullish coalescing means an explicit dispatcher: null (or undefined) falls back to the shared default — sensible and probably the desired behavior. Only note: a caller who passes a falsy-but-intentional value expecting it to be used would be surprised, but for a dispatcher that's the correct semantics. No change needed; documenting the intent.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2242. (backport job run)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

feat(world-vercel): allow a custom dispatcher - #2235

Merged
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch
Jun 4, 2026
Merged

feat(world-vercel): allow a custom dispatcher#2235
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch

Conversation

@AndrewBarba

@AndrewBarbaAndrewBarba commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dispatcher option to APIConfig (consumed by createVercelWorld) so callers can supply a custom undici dispatcher. It is threaded through every request path — HTTP API calls, refs, encryption key fetch, deployment resolution, and the @vercel/queue client — and defaults to the shared undici RetryAgent.

Why

The Vercel world relies on Node's built-in fetch being undici-backed and pins a specific undici version. Both the HTTP and queue paths already issue requests via global fetch with an undici dispatcher, so exposing the dispatcher gives callers a single, uniform knob to bring their own undici Agent/RetryAgent (e.g. to tune pooling/retries on newer Node runtimes) without us changing defaults.

Note: this intentionally exposes the dispatcher rather than a custom fetch. @vercel/queue only accepts a dispatcher (it calls global fetch directly with no fetch-injection point), so the dispatcher is the one option that works consistently across both paths.

How

  • New APIConfig.dispatcher?: unknown (mirrors @vercel/queue's own dispatcher?: unknown).
  • getDispatcher(config?) now returns the caller's dispatcher when set, else the shared default agent (the previous singleton, renamed to getDefaultDispatcher).
  • All call sites pass config through; default behavior is unchanged.

Usage

At Vercel runtime createWorld() calls createVercelWorld() with no config, so injection is via the existing setWorld escape hatch (documented in the README):

import{Agent}from'undici';import{createVercelWorld}from'@workflow/world-vercel';import{setWorld}from'@workflow/core/runtime';setWorld(createVercelWorld({dispatcher: newAgent({connections: 16})}));

Tests

  • New http-client.test.ts covering getDispatcher default vs. override.
  • Full package suite green (115 tests).

No public API removed; dispatcher is purely additive and defaults to current undici behavior.

@vercel

vercelBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9949659

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelMinor
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@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 Jun 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production126602191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total7183010528235

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro109026
✅ example109026
✅ express109026
✅ fastify109026
✅ hono109026
✅ nextjs-turbopack13302
✅ nextjs-webpack13302
✅ nitro109026
✅ nuxt109026
✅ sveltekit12807
✅ vite109026
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.038s (-11.3% 🟢)1.005s (~)0.967s101.00x
🐘 PostgresExpress0.062s (-4.9%)1.011s (~)0.949s101.62x
💻 LocalNext.js (Turbopack)0.063s (-1.4%)1.007s (~)0.944s101.63x
🐘 PostgresNitro0.067s (-25.1% 🟢)1.012s (-1.8%)0.945s101.75x
🐘 PostgresNext.js (Turbopack)0.068s (-2.3%)1.011s (~)0.943s101.77x
💻 LocalExpress0.545s (+1232.3% 🔺)1.508s (+50.0% 🔺)0.963s1014.15x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.091s (~)2.006s (~)0.915s101.00x
💻 LocalExpress1.092s (~)2.006s (~)0.914s101.00x
🐘 PostgresExpress1.106s (~)2.010s (~)0.904s101.01x
🐘 PostgresNitro1.108s (-3.0%)2.009s (-1.2%)0.901s101.02x
💻 LocalNext.js (Turbopack)1.135s (~)2.007s (~)0.872s101.04x
🐘 PostgresNext.js (Turbopack)1.137s (~)2.009s (~)0.872s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.504s (~)11.021s (~)0.517s31.00x
🐘 PostgresNitro10.509s (-1.8%)11.016s (~)0.507s31.00x
💻 LocalExpress10.544s (+0.6%)11.021s (~)0.477s31.00x
🐘 PostgresExpress10.574s (~)11.019s (~)0.446s31.01x
💻 LocalNext.js (Turbopack)10.777s (~)11.023s (~)0.246s31.03x
🐘 PostgresNext.js (Turbopack)10.824s (~)11.019s (~)0.195s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.657s (-0.7%)14.027s (~)0.370s51.00x
🐘 PostgresNitro13.714s (-6.5% 🟢)14.018s (-6.7% 🟢)0.303s51.00x
💻 LocalExpress13.742s (~)14.026s (~)0.284s51.01x
🐘 PostgresExpress13.752s (-1.3%)14.017s (~)0.266s51.01x
💻 LocalNext.js (Turbopack)14.383s (~)15.029s (~)0.646s41.05x
🐘 PostgresNext.js (Turbopack)14.582s (+1.4%)15.024s (~)0.442s41.07x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.314s (-0.7%)13.025s (~)0.711s71.00x
🐘 PostgresNitro12.488s (-1.6%)13.024s (-2.1%)0.536s71.01x
💻 LocalExpress12.513s (+1.4%)13.024s (~)0.511s71.02x
🐘 PostgresExpress12.550s (~)13.019s (~)0.470s71.02x
💻 LocalNext.js (Turbopack)13.583s (~)14.026s (~)0.443s71.10x
🐘 PostgresNext.js (Turbopack)13.757s (+0.8%)14.020s (~)0.263s71.12x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.181s (-1.0%)2.008s (~)0.827s151.00x
🐘 PostgresNitro1.181s (-6.1% 🟢)2.008s (~)0.827s151.00x
💻 LocalExpress1.200s (-3.0%)2.006s (~)0.806s151.02x
🐘 PostgresNext.js (Turbopack)1.228s (~)2.008s (~)0.780s151.04x
💻 LocalNitro1.264s (+3.9%)2.006s (~)0.742s151.07x
💻 LocalNext.js (Turbopack)1.322s (~)2.006s (~)0.684s151.12x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.249s (-0.9%)2.007s (~)0.758s151.00x
🐘 PostgresNitro1.251s (-7.9% 🟢)2.007s (~)0.756s151.00x
🐘 PostgresNext.js (Turbopack)1.375s (-0.7%)2.007s (~)0.632s151.10x
💻 LocalExpress1.636s (-4.1%)2.006s (~)0.370s151.31x
💻 LocalNitro1.708s (-2.7%)2.006s (~)0.298s151.37x
💻 LocalNext.js (Turbopack)1.898s (~)2.469s (+6.7% 🔺)0.571s131.52x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.396s (-5.1% 🟢)2.007s (-13.5% 🟢)0.611s151.00x
🐘 PostgresExpress1.432s (+2.3%)2.008s (~)0.576s151.03x
🐘 PostgresNext.js (Turbopack)1.729s (+1.9%)2.075s (-3.2%)0.346s151.24x
💻 LocalExpress3.912s (-18.8% 🟢)4.439s (-16.9% 🟢)0.527s72.80x
💻 LocalNitro4.610s (-2.9%)5.347s (+3.2%)0.737s63.30x
💻 LocalNext.js (Turbopack)5.487s (~)6.012s (-3.3%)0.526s53.93x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.180s (-0.7%)2.009s (~)0.829s151.00x
🐘 PostgresNitro1.186s (-9.7% 🟢)2.008s (-3.4%)0.823s151.00x
🐘 PostgresNext.js (Turbopack)1.248s (~)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.402s (+1.5%)2.006s (~)0.604s151.19x
💻 LocalNitro1.496s (-9.4% 🟢)2.006s (-3.2%)0.510s151.27x
💻 LocalExpress1.551s (+2.1%)2.006s (~)0.455s151.31x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (+0.8%)2.008s (~)0.748s151.00x
🐘 PostgresExpress1.284s (+2.3%)2.009s (~)0.725s151.02x
🐘 PostgresNext.js (Turbopack)1.374s (-5.3% 🟢)2.008s (-3.2%)0.634s151.09x
💻 LocalNitro1.889s (-10.6% 🟢)2.316s (-15.3% 🟢)0.427s131.50x
💻 LocalExpress1.962s (+3.5%)2.316s (~)0.353s131.56x
💻 LocalNext.js (Turbopack)2.091s (~)2.826s (~)0.736s111.66x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.409s (-3.1%)2.008s (-3.4%)0.599s151.00x
🐘 PostgresExpress1.422s (+1.9%)2.007s (~)0.585s151.01x
🐘 PostgresNext.js (Turbopack)1.691s (-1.8%)2.316s (+4.3%)0.625s131.20x
💻 LocalExpress4.932s (-6.9% 🟢)5.513s (-5.7% 🟢)0.581s63.50x
💻 LocalNitro5.226s (-11.6% 🟢)5.683s (-11.4% 🟢)0.457s63.71x
💻 LocalNext.js (Turbopack)5.591s (-3.5%)6.213s (~)0.622s53.97x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.566s (+13.1% 🔺)1.024s (+1.2%)0.458s591.00x
🐘 PostgresExpress0.586s (+2.8%)1.024s (+1.7%)0.438s601.04x
💻 LocalExpress0.593s (-1.2%)1.004s (~)0.412s601.05x
💻 LocalNitro0.627s (+6.0% 🔺)1.022s (+1.7%)0.395s591.11x
🐘 PostgresNext.js (Turbopack)0.819s (-2.4%)1.024s (-3.4%)0.205s591.45x
💻 LocalNext.js (Turbopack)0.852s (-2.3%)1.004s (-3.3%)0.152s601.51x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-7.9% 🟢)2.008s (~)0.681s451.00x
🐘 PostgresExpress1.351s (~)2.008s (~)0.656s451.02x
💻 LocalNitro1.452s (-3.2%)2.006s (-1.1%)0.554s451.09x
💻 LocalExpress1.471s (-3.7%)2.005s (-1.1%)0.535s451.11x
🐘 PostgresNext.js (Turbopack)1.927s (+0.8%)2.150s (+2.4%)0.224s421.45x
💻 LocalNext.js (Turbopack)2.066s (-1.7%)2.882s (-4.2%)0.816s321.56x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.676s (+1.5%)3.111s (-6.3% 🟢)0.435s391.00x
🐘 PostgresExpress2.740s (-1.0%)3.085s (-1.7%)0.346s391.02x
💻 LocalNitro3.170s (+0.6%)3.912s (-0.8%)0.742s311.18x
💻 LocalExpress3.242s (~)3.945s (-0.8%)0.703s311.21x
🐘 PostgresNext.js (Turbopack)3.796s (-0.8%)4.009s (-2.4%)0.214s301.42x
💻 LocalNext.js (Turbopack)4.310s (-2.9%)5.010s (~)0.700s241.61x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.213s (-4.0%)1.006s (~)0.793s601.00x
🐘 PostgresExpress0.235s (+3.1%)1.006s (~)0.772s601.10x
🐘 PostgresNext.js (Turbopack)0.271s (+2.8%)1.007s (~)0.736s601.27x
💻 LocalExpress0.417s (-0.8%)1.004s (~)0.586s601.96x
💻 LocalNitro0.506s (+12.3% 🔺)1.095s (+9.1% 🔺)0.589s552.38x
💻 LocalNext.js (Turbopack)0.565s (-12.0% 🟢)1.005s (-5.1% 🟢)0.440s602.66x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.344s (-12.6% 🟢)1.018s (~)0.673s891.00x
🐘 PostgresExpress0.358s (-0.7%)1.006s (~)0.648s901.04x
🐘 PostgresNext.js (Turbopack)0.483s (+1.6%)1.006s (~)0.522s901.40x
💻 LocalExpress2.012s (-4.5%)2.580s (-2.9%)0.567s355.85x
💻 LocalNitro2.091s (+1.2%)2.579s (-2.2%)0.488s356.07x
💻 LocalNext.js (Turbopack)2.337s (-8.2% 🟢)3.044s (-7.7% 🟢)0.707s306.79x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.647s (+4.1%)1.006s (-6.2% 🟢)0.359s1201.00x
🐘 PostgresExpress0.703s (+1.9%)1.006s (~)0.303s1201.09x
🐘 PostgresNext.js (Turbopack)0.985s (+1.6%)1.527s (-2.5%)0.543s791.52x
💻 LocalExpress8.786s (-7.3% 🟢)9.330s (-6.9% 🟢)0.543s1313.58x
💻 LocalNitro9.638s (+2.1%)10.109s (+0.8%)0.471s1214.89x
💻 LocalNext.js (Turbopack)10.511s (-3.9%)11.298s (-3.9%)0.787s1116.24x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.158s (~)2.005s (~)0.011s (-9.5% 🟢)2.017s (~)0.859s101.00x
💻 LocalExpress1.162s (~)2.005s (~)0.010s (-4.8%)2.017s (~)0.855s101.00x
🐘 PostgresNitro1.162s (~)2.001s (~)0.001s (+83.3% 🔺)2.010s (~)0.848s101.00x
🐘 PostgresExpress1.163s (-0.7%)1.999s (~)0.001s (-22.2% 🟢)2.011s (~)0.848s101.00x
💻 LocalNext.js (Turbopack)1.202s (-0.6%)2.003s (~)0.012s (+3.3%)2.019s (~)0.818s101.04x
🐘 PostgresNext.js (Turbopack)1.218s (-1.2%)2.002s (~)0.002s (+15.4% 🔺)2.011s (~)0.793s101.05x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.561s (~)2.009s (~)0.010s (~)2.021s (~)0.460s301.00x
🐘 PostgresNitro1.564s (-5.4% 🟢)2.008s (-3.0%)0.004s (+20.4% 🔺)2.025s (-3.0%)0.461s301.00x
💻 LocalNitro1.580s (~)2.009s (~)0.011s (+2.6%)2.022s (~)0.442s301.01x
🐘 PostgresExpress1.599s (+0.6%)2.003s (~)0.004s (-2.6%)2.026s (~)0.427s301.02x
💻 LocalNext.js (Turbopack)1.724s (-3.8%)2.009s (~)0.011s (-15.8% 🟢)2.023s (~)0.299s301.10x
🐘 PostgresNext.js (Turbopack)1.730s (+0.9%)2.010s (~)0.004s (-2.6%)2.025s (~)0.295s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.690s (-27.9% 🟢)1.013s (-20.3% 🟢)0.000s (-18.6% 🟢)1.040s (-20.5% 🟢)0.350s591.00x
🐘 PostgresExpress0.720s (+1.0%)1.013s (-1.7%)0.000s (+50.0% 🔺)1.039s (~)0.320s581.04x
🐘 PostgresNext.js (Turbopack)0.850s (+10.3% 🔺)1.109s (+7.2% 🔺)0.000s (+110.9% 🔺)1.124s (+7.1% 🔺)0.274s551.23x
💻 LocalExpress1.370s (-1.6%)2.012s (~)0.000s (-15.4% 🟢)2.014s (~)0.644s301.99x
💻 LocalNitro1.430s (+3.2%)2.014s (~)0.001s (-15.8% 🟢)2.017s (~)0.587s302.07x
💻 LocalNext.js (Turbopack)1.492s (~)2.013s (~)0.000s (+80.0% 🔺)2.016s (~)0.524s302.16x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.374s (-28.7% 🟢)2.103s (-10.1% 🟢)0.000s (-100.0% 🟢)2.123s (-10.3% 🟢)0.749s291.00x
🐘 PostgresExpress1.397s (-2.4%)2.063s (-3.4%)0.000s (~)2.081s (-3.7%)0.684s291.02x
🐘 PostgresNext.js (Turbopack)1.680s (-1.1%)2.181s (-1.6%)0.000s (-100.0% 🟢)2.189s (-2.4%)0.508s281.22x
💻 LocalNext.js (Turbopack)2.900s (-2.2%)3.466s (-4.1%)0.001s (+20.2% 🔺)3.474s (-4.0%)0.573s182.11x
💻 LocalExpress3.047s (-0.8%)3.774s (-1.7%)0.001s (~)3.777s (-1.7%)0.730s162.22x
💻 LocalNitro3.196s (+7.6% 🔺)3.901s (+8.0% 🔺)0.000s (-20.3% 🟢)3.905s (+8.0% 🔺)0.709s162.33x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress10/21
🐘 PostgresNitro16/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed for correctness and regression risk — backward-compatible and safe to merge, defaults are unchanged and every request path threads config consistently. A few non-blocking notes inline.

import { createVercelWorld } from '@workflow/world-vercel';
import { setWorld } from '@workflow/core/runtime';

setWorld(createVercelWorld({ dispatcher: new Agent({ connections: 16 }) }));

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.

Injection timing caveat worth documenting here: at Vercel runtime createWorld() calls createVercelWorld() with no config, so setWorld(...) is the only injection path. If the runtime has already created/cached the world before this setWorld call runs, the custom dispatcher silently won't take effect. Worth a one-line note that setWorld must run before the world is first used (i.e. before the first workflow request).

* dispatcher from a different undici version. Callers may pass any undici
* version's dispatcher, or any object implementing the dispatcher contract.
*/
dispatcher?: unknown;

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.

unknown is the right call given undici's version-specific Dispatcher type (the doc comment explains it well). Just flagging the trade-off: callers get zero type safety, so a malformed/incompatible dispatcher fails only at runtime inside fetch/@vercel/queue rather than at compile time. Acceptable here, but worth keeping in mind for the error story.

* shared default agent.
*/
export function getDispatcher(config?: APIConfig): unknown {
return config?.dispatcher ?? getDefaultDispatcher();

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.

Nullish coalescing means an explicit dispatcher: null (or undefined) falls back to the shared default — sensible and probably the desired behavior. Only note: a caller who passes a falsy-but-intentional value expecting it to be used would be surprised, but for a dispatcher that's the correct semantics. No change needed; documenting the intent.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2242. (backport job run)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

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

feat(world-vercel): allow a custom dispatcher - #2235

Merged
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch
Jun 4, 2026
Merged

feat(world-vercel): allow a custom dispatcher#2235
AndrewBarba merged 3 commits into
mainfrom
feat/world-vercel-custom-fetch

Conversation

@AndrewBarba

@AndrewBarbaAndrewBarba commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds a dispatcher option to APIConfig (consumed by createVercelWorld) so callers can supply a custom undici dispatcher. It is threaded through every request path — HTTP API calls, refs, encryption key fetch, deployment resolution, and the @vercel/queue client — and defaults to the shared undici RetryAgent.

Why

The Vercel world relies on Node's built-in fetch being undici-backed and pins a specific undici version. Both the HTTP and queue paths already issue requests via global fetch with an undici dispatcher, so exposing the dispatcher gives callers a single, uniform knob to bring their own undici Agent/RetryAgent (e.g. to tune pooling/retries on newer Node runtimes) without us changing defaults.

Note: this intentionally exposes the dispatcher rather than a custom fetch. @vercel/queue only accepts a dispatcher (it calls global fetch directly with no fetch-injection point), so the dispatcher is the one option that works consistently across both paths.

How

  • New APIConfig.dispatcher?: unknown (mirrors @vercel/queue's own dispatcher?: unknown).
  • getDispatcher(config?) now returns the caller's dispatcher when set, else the shared default agent (the previous singleton, renamed to getDefaultDispatcher).
  • All call sites pass config through; default behavior is unchanged.

Usage

At Vercel runtime createWorld() calls createVercelWorld() with no config, so injection is via the existing setWorld escape hatch (documented in the README):

import{Agent}from'undici';import{createVercelWorld}from'@workflow/world-vercel';import{setWorld}from'@workflow/core/runtime';setWorld(createVercelWorld({dispatcher: newAgent({connections: 16})}));

Tests

  • New http-client.test.ts covering getDispatcher default vs. override.
  • Full package suite green (115 tests).

No public API removed; dispatcher is purely additive and defaults to current undici behavior.

@vercel

vercelBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9949659

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

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelMinor
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@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 Jun 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production126602191485
✅ 💻 Local Development167102191890
✅ 📦 Local Production167102191890
✅ 🐘 Local Postgres167102191890
✅ 🪟 Windows13500135
✅ 📋 Other7690176945
Total7183010528235

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro109026
✅ example109026
✅ express109026
✅ fastify109026
✅ hono109026
✅ nextjs-turbopack13302
✅ nextjs-webpack13302
✅ nitro109026
✅ nuxt109026
✅ sveltekit12807
✅ vite109026
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable110025
✅ express-stable110025
✅ fastify-stable110025
✅ hono-stable110025
✅ nextjs-turbopack-canary116019
✅ nextjs-turbopack-stable-lazy-discovery-disabled13500
✅ nextjs-turbopack-stable-lazy-discovery-enabled13500
✅ nextjs-webpack-canary116019
✅ nextjs-webpack-stable-lazy-discovery-disabled13500
✅ nextjs-webpack-stable-lazy-discovery-enabled13500
✅ nitro-stable110025
✅ nuxt-stable110025
✅ sveltekit-stable12906
✅ vite-stable110025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack13500
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable110025
✅ e2e-local-dev-tanstack-start-110025
✅ e2e-local-postgres-nest-stable110025
✅ e2e-local-postgres-tanstack-start-110025
✅ e2e-local-prod-nest-stable110025
✅ e2e-local-prod-tanstack-start-110025
✅ e2e-vercel-prod-tanstack-start109026

📋 View full workflow run

@github-actions

github-actionsBot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.038s (-11.3% 🟢)1.005s (~)0.967s101.00x
🐘 PostgresExpress0.062s (-4.9%)1.011s (~)0.949s101.62x
💻 LocalNext.js (Turbopack)0.063s (-1.4%)1.007s (~)0.944s101.63x
🐘 PostgresNitro0.067s (-25.1% 🟢)1.012s (-1.8%)0.945s101.75x
🐘 PostgresNext.js (Turbopack)0.068s (-2.3%)1.011s (~)0.943s101.77x
💻 LocalExpress0.545s (+1232.3% 🔺)1.508s (+50.0% 🔺)0.963s1014.15x
workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.091s (~)2.006s (~)0.915s101.00x
💻 LocalExpress1.092s (~)2.006s (~)0.914s101.00x
🐘 PostgresExpress1.106s (~)2.010s (~)0.904s101.01x
🐘 PostgresNitro1.108s (-3.0%)2.009s (-1.2%)0.901s101.02x
💻 LocalNext.js (Turbopack)1.135s (~)2.007s (~)0.872s101.04x
🐘 PostgresNext.js (Turbopack)1.137s (~)2.009s (~)0.872s101.04x
workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.504s (~)11.021s (~)0.517s31.00x
🐘 PostgresNitro10.509s (-1.8%)11.016s (~)0.507s31.00x
💻 LocalExpress10.544s (+0.6%)11.021s (~)0.477s31.00x
🐘 PostgresExpress10.574s (~)11.019s (~)0.446s31.01x
💻 LocalNext.js (Turbopack)10.777s (~)11.023s (~)0.246s31.03x
🐘 PostgresNext.js (Turbopack)10.824s (~)11.019s (~)0.195s31.03x
workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro13.657s (-0.7%)14.027s (~)0.370s51.00x
🐘 PostgresNitro13.714s (-6.5% 🟢)14.018s (-6.7% 🟢)0.303s51.00x
💻 LocalExpress13.742s (~)14.026s (~)0.284s51.01x
🐘 PostgresExpress13.752s (-1.3%)14.017s (~)0.266s51.01x
💻 LocalNext.js (Turbopack)14.383s (~)15.029s (~)0.646s41.05x
🐘 PostgresNext.js (Turbopack)14.582s (+1.4%)15.024s (~)0.442s41.07x
workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro12.314s (-0.7%)13.025s (~)0.711s71.00x
🐘 PostgresNitro12.488s (-1.6%)13.024s (-2.1%)0.536s71.01x
💻 LocalExpress12.513s (+1.4%)13.024s (~)0.511s71.02x
🐘 PostgresExpress12.550s (~)13.019s (~)0.470s71.02x
💻 LocalNext.js (Turbopack)13.583s (~)14.026s (~)0.443s71.10x
🐘 PostgresNext.js (Turbopack)13.757s (+0.8%)14.020s (~)0.263s71.12x
Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.181s (-1.0%)2.008s (~)0.827s151.00x
🐘 PostgresNitro1.181s (-6.1% 🟢)2.008s (~)0.827s151.00x
💻 LocalExpress1.200s (-3.0%)2.006s (~)0.806s151.02x
🐘 PostgresNext.js (Turbopack)1.228s (~)2.008s (~)0.780s151.04x
💻 LocalNitro1.264s (+3.9%)2.006s (~)0.742s151.07x
💻 LocalNext.js (Turbopack)1.322s (~)2.006s (~)0.684s151.12x
Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.249s (-0.9%)2.007s (~)0.758s151.00x
🐘 PostgresNitro1.251s (-7.9% 🟢)2.007s (~)0.756s151.00x
🐘 PostgresNext.js (Turbopack)1.375s (-0.7%)2.007s (~)0.632s151.10x
💻 LocalExpress1.636s (-4.1%)2.006s (~)0.370s151.31x
💻 LocalNitro1.708s (-2.7%)2.006s (~)0.298s151.37x
💻 LocalNext.js (Turbopack)1.898s (~)2.469s (+6.7% 🔺)0.571s131.52x
Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.396s (-5.1% 🟢)2.007s (-13.5% 🟢)0.611s151.00x
🐘 PostgresExpress1.432s (+2.3%)2.008s (~)0.576s151.03x
🐘 PostgresNext.js (Turbopack)1.729s (+1.9%)2.075s (-3.2%)0.346s151.24x
💻 LocalExpress3.912s (-18.8% 🟢)4.439s (-16.9% 🟢)0.527s72.80x
💻 LocalNitro4.610s (-2.9%)5.347s (+3.2%)0.737s63.30x
💻 LocalNext.js (Turbopack)5.487s (~)6.012s (-3.3%)0.526s53.93x
Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.180s (-0.7%)2.009s (~)0.829s151.00x
🐘 PostgresNitro1.186s (-9.7% 🟢)2.008s (-3.4%)0.823s151.00x
🐘 PostgresNext.js (Turbopack)1.248s (~)2.008s (~)0.760s151.06x
💻 LocalNext.js (Turbopack)1.402s (+1.5%)2.006s (~)0.604s151.19x
💻 LocalNitro1.496s (-9.4% 🟢)2.006s (-3.2%)0.510s151.27x
💻 LocalExpress1.551s (+2.1%)2.006s (~)0.455s151.31x
Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.260s (+0.8%)2.008s (~)0.748s151.00x
🐘 PostgresExpress1.284s (+2.3%)2.009s (~)0.725s151.02x
🐘 PostgresNext.js (Turbopack)1.374s (-5.3% 🟢)2.008s (-3.2%)0.634s151.09x
💻 LocalNitro1.889s (-10.6% 🟢)2.316s (-15.3% 🟢)0.427s131.50x
💻 LocalExpress1.962s (+3.5%)2.316s (~)0.353s131.56x
💻 LocalNext.js (Turbopack)2.091s (~)2.826s (~)0.736s111.66x
Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.409s (-3.1%)2.008s (-3.4%)0.599s151.00x
🐘 PostgresExpress1.422s (+1.9%)2.007s (~)0.585s151.01x
🐘 PostgresNext.js (Turbopack)1.691s (-1.8%)2.316s (+4.3%)0.625s131.20x
💻 LocalExpress4.932s (-6.9% 🟢)5.513s (-5.7% 🟢)0.581s63.50x
💻 LocalNitro5.226s (-11.6% 🟢)5.683s (-11.4% 🟢)0.457s63.71x
💻 LocalNext.js (Turbopack)5.591s (-3.5%)6.213s (~)0.622s53.97x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.566s (+13.1% 🔺)1.024s (+1.2%)0.458s591.00x
🐘 PostgresExpress0.586s (+2.8%)1.024s (+1.7%)0.438s601.04x
💻 LocalExpress0.593s (-1.2%)1.004s (~)0.412s601.05x
💻 LocalNitro0.627s (+6.0% 🔺)1.022s (+1.7%)0.395s591.11x
🐘 PostgresNext.js (Turbopack)0.819s (-2.4%)1.024s (-3.4%)0.205s591.45x
💻 LocalNext.js (Turbopack)0.852s (-2.3%)1.004s (-3.3%)0.152s601.51x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.327s (-7.9% 🟢)2.008s (~)0.681s451.00x
🐘 PostgresExpress1.351s (~)2.008s (~)0.656s451.02x
💻 LocalNitro1.452s (-3.2%)2.006s (-1.1%)0.554s451.09x
💻 LocalExpress1.471s (-3.7%)2.005s (-1.1%)0.535s451.11x
🐘 PostgresNext.js (Turbopack)1.927s (+0.8%)2.150s (+2.4%)0.224s421.45x
💻 LocalNext.js (Turbopack)2.066s (-1.7%)2.882s (-4.2%)0.816s321.56x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.676s (+1.5%)3.111s (-6.3% 🟢)0.435s391.00x
🐘 PostgresExpress2.740s (-1.0%)3.085s (-1.7%)0.346s391.02x
💻 LocalNitro3.170s (+0.6%)3.912s (-0.8%)0.742s311.18x
💻 LocalExpress3.242s (~)3.945s (-0.8%)0.703s311.21x
🐘 PostgresNext.js (Turbopack)3.796s (-0.8%)4.009s (-2.4%)0.214s301.42x
💻 LocalNext.js (Turbopack)4.310s (-2.9%)5.010s (~)0.700s241.61x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.213s (-4.0%)1.006s (~)0.793s601.00x
🐘 PostgresExpress0.235s (+3.1%)1.006s (~)0.772s601.10x
🐘 PostgresNext.js (Turbopack)0.271s (+2.8%)1.007s (~)0.736s601.27x
💻 LocalExpress0.417s (-0.8%)1.004s (~)0.586s601.96x
💻 LocalNitro0.506s (+12.3% 🔺)1.095s (+9.1% 🔺)0.589s552.38x
💻 LocalNext.js (Turbopack)0.565s (-12.0% 🟢)1.005s (-5.1% 🟢)0.440s602.66x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.344s (-12.6% 🟢)1.018s (~)0.673s891.00x
🐘 PostgresExpress0.358s (-0.7%)1.006s (~)0.648s901.04x
🐘 PostgresNext.js (Turbopack)0.483s (+1.6%)1.006s (~)0.522s901.40x
💻 LocalExpress2.012s (-4.5%)2.580s (-2.9%)0.567s355.85x
💻 LocalNitro2.091s (+1.2%)2.579s (-2.2%)0.488s356.07x
💻 LocalNext.js (Turbopack)2.337s (-8.2% 🟢)3.044s (-7.7% 🟢)0.707s306.79x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.647s (+4.1%)1.006s (-6.2% 🟢)0.359s1201.00x
🐘 PostgresExpress0.703s (+1.9%)1.006s (~)0.303s1201.09x
🐘 PostgresNext.js (Turbopack)0.985s (+1.6%)1.527s (-2.5%)0.543s791.52x
💻 LocalExpress8.786s (-7.3% 🟢)9.330s (-6.9% 🟢)0.543s1313.58x
💻 LocalNitro9.638s (+2.1%)10.109s (+0.8%)0.471s1214.89x
💻 LocalNext.js (Turbopack)10.511s (-3.9%)11.298s (-3.9%)0.787s1116.24x
Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.158s (~)2.005s (~)0.011s (-9.5% 🟢)2.017s (~)0.859s101.00x
💻 LocalExpress1.162s (~)2.005s (~)0.010s (-4.8%)2.017s (~)0.855s101.00x
🐘 PostgresNitro1.162s (~)2.001s (~)0.001s (+83.3% 🔺)2.010s (~)0.848s101.00x
🐘 PostgresExpress1.163s (-0.7%)1.999s (~)0.001s (-22.2% 🟢)2.011s (~)0.848s101.00x
💻 LocalNext.js (Turbopack)1.202s (-0.6%)2.003s (~)0.012s (+3.3%)2.019s (~)0.818s101.04x
🐘 PostgresNext.js (Turbopack)1.218s (-1.2%)2.002s (~)0.002s (+15.4% 🔺)2.011s (~)0.793s101.05x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.561s (~)2.009s (~)0.010s (~)2.021s (~)0.460s301.00x
🐘 PostgresNitro1.564s (-5.4% 🟢)2.008s (-3.0%)0.004s (+20.4% 🔺)2.025s (-3.0%)0.461s301.00x
💻 LocalNitro1.580s (~)2.009s (~)0.011s (+2.6%)2.022s (~)0.442s301.01x
🐘 PostgresExpress1.599s (+0.6%)2.003s (~)0.004s (-2.6%)2.026s (~)0.427s301.02x
💻 LocalNext.js (Turbopack)1.724s (-3.8%)2.009s (~)0.011s (-15.8% 🟢)2.023s (~)0.299s301.10x
🐘 PostgresNext.js (Turbopack)1.730s (+0.9%)2.010s (~)0.004s (-2.6%)2.025s (~)0.295s301.11x
10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.690s (-27.9% 🟢)1.013s (-20.3% 🟢)0.000s (-18.6% 🟢)1.040s (-20.5% 🟢)0.350s591.00x
🐘 PostgresExpress0.720s (+1.0%)1.013s (-1.7%)0.000s (+50.0% 🔺)1.039s (~)0.320s581.04x
🐘 PostgresNext.js (Turbopack)0.850s (+10.3% 🔺)1.109s (+7.2% 🔺)0.000s (+110.9% 🔺)1.124s (+7.1% 🔺)0.274s551.23x
💻 LocalExpress1.370s (-1.6%)2.012s (~)0.000s (-15.4% 🟢)2.014s (~)0.644s301.99x
💻 LocalNitro1.430s (+3.2%)2.014s (~)0.001s (-15.8% 🟢)2.017s (~)0.587s302.07x
💻 LocalNext.js (Turbopack)1.492s (~)2.013s (~)0.000s (+80.0% 🔺)2.016s (~)0.524s302.16x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.374s (-28.7% 🟢)2.103s (-10.1% 🟢)0.000s (-100.0% 🟢)2.123s (-10.3% 🟢)0.749s291.00x
🐘 PostgresExpress1.397s (-2.4%)2.063s (-3.4%)0.000s (~)2.081s (-3.7%)0.684s291.02x
🐘 PostgresNext.js (Turbopack)1.680s (-1.1%)2.181s (-1.6%)0.000s (-100.0% 🟢)2.189s (-2.4%)0.508s281.22x
💻 LocalNext.js (Turbopack)2.900s (-2.2%)3.466s (-4.1%)0.001s (+20.2% 🔺)3.474s (-4.0%)0.573s182.11x
💻 LocalExpress3.047s (-0.8%)3.774s (-1.7%)0.001s (~)3.777s (-1.7%)0.730s162.22x
💻 LocalNitro3.196s (+7.6% 🔺)3.901s (+8.0% 🔺)0.000s (-20.3% 🟢)3.905s (+8.0% 🔺)0.709s162.33x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress10/21
🐘 PostgresNitro16/21
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@karthikscale3karthikscale3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed for correctness and regression risk — backward-compatible and safe to merge, defaults are unchanged and every request path threads config consistently. A few non-blocking notes inline.

import { createVercelWorld } from '@workflow/world-vercel';
import { setWorld } from '@workflow/core/runtime';

setWorld(createVercelWorld({ dispatcher: new Agent({ connections: 16 }) }));

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.

Injection timing caveat worth documenting here: at Vercel runtime createWorld() calls createVercelWorld() with no config, so setWorld(...) is the only injection path. If the runtime has already created/cached the world before this setWorld call runs, the custom dispatcher silently won't take effect. Worth a one-line note that setWorld must run before the world is first used (i.e. before the first workflow request).

* dispatcher from a different undici version. Callers may pass any undici
* version's dispatcher, or any object implementing the dispatcher contract.
*/
dispatcher?: unknown;

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.

unknown is the right call given undici's version-specific Dispatcher type (the doc comment explains it well). Just flagging the trade-off: callers get zero type safety, so a malformed/incompatible dispatcher fails only at runtime inside fetch/@vercel/queue rather than at compile time. Acceptable here, but worth keeping in mind for the error story.

* shared default agent.
*/
export function getDispatcher(config?: APIConfig): unknown {
return config?.dispatcher ?? getDefaultDispatcher();

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.

Nullish coalescing means an explicit dispatcher: null (or undefined) falls back to the shared default — sensible and probably the desired behavior. Only note: a caller who passes a falsy-but-intentional value expecting it to be used would be surprised, but for a dispatcher that's the correct semantics. No change needed; documenting the intent.

@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2242. (backport job run)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@AndrewBarba@karthikscale3