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
Copy link
Copy Markdown
Contributor

@AndrewBarba AndrewBarba commented Jun 3, 2026

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: new Agent({ 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
Copy link
Copy Markdown
Contributor

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jun 4, 2026 1:18am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jun 4, 2026 1:18am
example-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workbench-astro-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workbench-express-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workbench-fastify-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workbench-hono-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workbench-nitro-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workbench-nuxt-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workbench-sveltekit-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workbench-vite-workflow Ready Ready Preview, Comment Jun 4, 2026 1:18am
workflow-docs Ready Ready Preview, Comment, Open in v0 Jun 4, 2026 1:18am
workflow-swc-playground Ready Ready Preview, Comment Jun 4, 2026 1:18am
workflow-tarballs Ready Ready Preview, Comment Jun 4, 2026 1:18am
workflow-web Ready Ready Preview, Comment Jun 4, 2026 1:18am

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 3, 2026

🦋 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
Name Type
@workflow/world-vercel Minor
@workflow/cli Patch
@workflow/core Patch
@workflow/web Patch
workflow Patch
@workflow/world-testing Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt Patch

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1266 0 219 1485
✅ 💻 Local Development 1671 0 219 1890
✅ 📦 Local Production 1671 0 219 1890
✅ 🐘 Local Postgres 1671 0 219 1890
✅ 🪟 Windows 135 0 0 135
✅ 📋 Other 769 0 176 945
Total 7183 0 1052 8235

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 109 0 26
✅ example 109 0 26
✅ express 109 0 26
✅ fastify 109 0 26
✅ hono 109 0 26
✅ nextjs-turbopack 133 0 2
✅ nextjs-webpack 133 0 2
✅ nitro 109 0 26
✅ nuxt 109 0 26
✅ sveltekit 128 0 7
✅ vite 109 0 26
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 110 0 25
✅ express-stable 110 0 25
✅ fastify-stable 110 0 25
✅ hono-stable 110 0 25
✅ nextjs-turbopack-canary 116 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 135 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 135 0 0
✅ nextjs-webpack-canary 116 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 135 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 135 0 0
✅ nitro-stable 110 0 25
✅ nuxt-stable 110 0 25
✅ sveltekit-stable 129 0 6
✅ vite-stable 110 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 110 0 25
✅ express-stable 110 0 25
✅ fastify-stable 110 0 25
✅ hono-stable 110 0 25
✅ nextjs-turbopack-canary 116 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 135 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 135 0 0
✅ nextjs-webpack-canary 116 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 135 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 135 0 0
✅ nitro-stable 110 0 25
✅ nuxt-stable 110 0 25
✅ sveltekit-stable 129 0 6
✅ vite-stable 110 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 110 0 25
✅ express-stable 110 0 25
✅ fastify-stable 110 0 25
✅ hono-stable 110 0 25
✅ nextjs-turbopack-canary 116 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 135 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 135 0 0
✅ nextjs-webpack-canary 116 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 135 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 135 0 0
✅ nitro-stable 110 0 25
✅ nuxt-stable 110 0 25
✅ sveltekit-stable 129 0 6
✅ vite-stable 110 0 25
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 135 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 110 0 25
✅ e2e-local-dev-tanstack-start- 110 0 25
✅ e2e-local-postgres-nest-stable 110 0 25
✅ e2e-local-postgres-tanstack-start- 110 0 25
✅ e2e-local-prod-nest-stable 110 0 25
✅ e2e-local-prod-tanstack-start- 110 0 25
✅ e2e-vercel-prod-tanstack-start 109 0 26

📋 View full workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 0.038s (-11.3% 🟢) 1.005s (~) 0.967s 10 1.00x
🐘 Postgres Express 0.062s (-4.9%) 1.011s (~) 0.949s 10 1.62x
💻 Local Next.js (Turbopack) 0.063s (-1.4%) 1.007s (~) 0.944s 10 1.63x
🐘 Postgres Nitro 0.067s (-25.1% 🟢) 1.012s (-1.8%) 0.945s 10 1.75x
🐘 Postgres Next.js (Turbopack) 0.068s (-2.3%) 1.011s (~) 0.943s 10 1.77x
💻 Local Express 0.545s (+1232.3% 🔺) 1.508s (+50.0% 🔺) 0.963s 10 14.15x
workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.091s (~) 2.006s (~) 0.915s 10 1.00x
💻 Local Express 1.092s (~) 2.006s (~) 0.914s 10 1.00x
🐘 Postgres Express 1.106s (~) 2.010s (~) 0.904s 10 1.01x
🐘 Postgres Nitro 1.108s (-3.0%) 2.009s (-1.2%) 0.901s 10 1.02x
💻 Local Next.js (Turbopack) 1.135s (~) 2.007s (~) 0.872s 10 1.04x
🐘 Postgres Next.js (Turbopack) 1.137s (~) 2.009s (~) 0.872s 10 1.04x
workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 10.504s (~) 11.021s (~) 0.517s 3 1.00x
🐘 Postgres Nitro 10.509s (-1.8%) 11.016s (~) 0.507s 3 1.00x
💻 Local Express 10.544s (+0.6%) 11.021s (~) 0.477s 3 1.00x
🐘 Postgres Express 10.574s (~) 11.019s (~) 0.446s 3 1.01x
💻 Local Next.js (Turbopack) 10.777s (~) 11.023s (~) 0.246s 3 1.03x
🐘 Postgres Next.js (Turbopack) 10.824s (~) 11.019s (~) 0.195s 3 1.03x
workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 13.657s (-0.7%) 14.027s (~) 0.370s 5 1.00x
🐘 Postgres Nitro 13.714s (-6.5% 🟢) 14.018s (-6.7% 🟢) 0.303s 5 1.00x
💻 Local Express 13.742s (~) 14.026s (~) 0.284s 5 1.01x
🐘 Postgres Express 13.752s (-1.3%) 14.017s (~) 0.266s 5 1.01x
💻 Local Next.js (Turbopack) 14.383s (~) 15.029s (~) 0.646s 4 1.05x
🐘 Postgres Next.js (Turbopack) 14.582s (+1.4%) 15.024s (~) 0.442s 4 1.07x
workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 12.314s (-0.7%) 13.025s (~) 0.711s 7 1.00x
🐘 Postgres Nitro 12.488s (-1.6%) 13.024s (-2.1%) 0.536s 7 1.01x
💻 Local Express 12.513s (+1.4%) 13.024s (~) 0.511s 7 1.02x
🐘 Postgres Express 12.550s (~) 13.019s (~) 0.470s 7 1.02x
💻 Local Next.js (Turbopack) 13.583s (~) 14.026s (~) 0.443s 7 1.10x
🐘 Postgres Next.js (Turbopack) 13.757s (+0.8%) 14.020s (~) 0.263s 7 1.12x
Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.181s (-1.0%) 2.008s (~) 0.827s 15 1.00x
🐘 Postgres Nitro 1.181s (-6.1% 🟢) 2.008s (~) 0.827s 15 1.00x
💻 Local Express 1.200s (-3.0%) 2.006s (~) 0.806s 15 1.02x
🐘 Postgres Next.js (Turbopack) 1.228s (~) 2.008s (~) 0.780s 15 1.04x
💻 Local Nitro 1.264s (+3.9%) 2.006s (~) 0.742s 15 1.07x
💻 Local Next.js (Turbopack) 1.322s (~) 2.006s (~) 0.684s 15 1.12x
Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.249s (-0.9%) 2.007s (~) 0.758s 15 1.00x
🐘 Postgres Nitro 1.251s (-7.9% 🟢) 2.007s (~) 0.756s 15 1.00x
🐘 Postgres Next.js (Turbopack) 1.375s (-0.7%) 2.007s (~) 0.632s 15 1.10x
💻 Local Express 1.636s (-4.1%) 2.006s (~) 0.370s 15 1.31x
💻 Local Nitro 1.708s (-2.7%) 2.006s (~) 0.298s 15 1.37x
💻 Local Next.js (Turbopack) 1.898s (~) 2.469s (+6.7% 🔺) 0.571s 13 1.52x
Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.396s (-5.1% 🟢) 2.007s (-13.5% 🟢) 0.611s 15 1.00x
🐘 Postgres Express 1.432s (+2.3%) 2.008s (~) 0.576s 15 1.03x
🐘 Postgres Next.js (Turbopack) 1.729s (+1.9%) 2.075s (-3.2%) 0.346s 15 1.24x
💻 Local Express 3.912s (-18.8% 🟢) 4.439s (-16.9% 🟢) 0.527s 7 2.80x
💻 Local Nitro 4.610s (-2.9%) 5.347s (+3.2%) 0.737s 6 3.30x
💻 Local Next.js (Turbopack) 5.487s (~) 6.012s (-3.3%) 0.526s 5 3.93x
Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.180s (-0.7%) 2.009s (~) 0.829s 15 1.00x
🐘 Postgres Nitro 1.186s (-9.7% 🟢) 2.008s (-3.4%) 0.823s 15 1.00x
🐘 Postgres Next.js (Turbopack) 1.248s (~) 2.008s (~) 0.760s 15 1.06x
💻 Local Next.js (Turbopack) 1.402s (+1.5%) 2.006s (~) 0.604s 15 1.19x
💻 Local Nitro 1.496s (-9.4% 🟢) 2.006s (-3.2%) 0.510s 15 1.27x
💻 Local Express 1.551s (+2.1%) 2.006s (~) 0.455s 15 1.31x
Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.260s (+0.8%) 2.008s (~) 0.748s 15 1.00x
🐘 Postgres Express 1.284s (+2.3%) 2.009s (~) 0.725s 15 1.02x
🐘 Postgres Next.js (Turbopack) 1.374s (-5.3% 🟢) 2.008s (-3.2%) 0.634s 15 1.09x
💻 Local Nitro 1.889s (-10.6% 🟢) 2.316s (-15.3% 🟢) 0.427s 13 1.50x
💻 Local Express 1.962s (+3.5%) 2.316s (~) 0.353s 13 1.56x
💻 Local Next.js (Turbopack) 2.091s (~) 2.826s (~) 0.736s 11 1.66x
Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.409s (-3.1%) 2.008s (-3.4%) 0.599s 15 1.00x
🐘 Postgres Express 1.422s (+1.9%) 2.007s (~) 0.585s 15 1.01x
🐘 Postgres Next.js (Turbopack) 1.691s (-1.8%) 2.316s (+4.3%) 0.625s 13 1.20x
💻 Local Express 4.932s (-6.9% 🟢) 5.513s (-5.7% 🟢) 0.581s 6 3.50x
💻 Local Nitro 5.226s (-11.6% 🟢) 5.683s (-11.4% 🟢) 0.457s 6 3.71x
💻 Local Next.js (Turbopack) 5.591s (-3.5%) 6.213s (~) 0.622s 5 3.97x
workflow with 10 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.566s (+13.1% 🔺) 1.024s (+1.2%) 0.458s 59 1.00x
🐘 Postgres Express 0.586s (+2.8%) 1.024s (+1.7%) 0.438s 60 1.04x
💻 Local Express 0.593s (-1.2%) 1.004s (~) 0.412s 60 1.05x
💻 Local Nitro 0.627s (+6.0% 🔺) 1.022s (+1.7%) 0.395s 59 1.11x
🐘 Postgres Next.js (Turbopack) 0.819s (-2.4%) 1.024s (-3.4%) 0.205s 59 1.45x
💻 Local Next.js (Turbopack) 0.852s (-2.3%) 1.004s (-3.3%) 0.152s 60 1.51x
workflow with 25 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.327s (-7.9% 🟢) 2.008s (~) 0.681s 45 1.00x
🐘 Postgres Express 1.351s (~) 2.008s (~) 0.656s 45 1.02x
💻 Local Nitro 1.452s (-3.2%) 2.006s (-1.1%) 0.554s 45 1.09x
💻 Local Express 1.471s (-3.7%) 2.005s (-1.1%) 0.535s 45 1.11x
🐘 Postgres Next.js (Turbopack) 1.927s (+0.8%) 2.150s (+2.4%) 0.224s 42 1.45x
💻 Local Next.js (Turbopack) 2.066s (-1.7%) 2.882s (-4.2%) 0.816s 32 1.56x
workflow with 50 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.676s (+1.5%) 3.111s (-6.3% 🟢) 0.435s 39 1.00x
🐘 Postgres Express 2.740s (-1.0%) 3.085s (-1.7%) 0.346s 39 1.02x
💻 Local Nitro 3.170s (+0.6%) 3.912s (-0.8%) 0.742s 31 1.18x
💻 Local Express 3.242s (~) 3.945s (-0.8%) 0.703s 31 1.21x
🐘 Postgres Next.js (Turbopack) 3.796s (-0.8%) 4.009s (-2.4%) 0.214s 30 1.42x
💻 Local Next.js (Turbopack) 4.310s (-2.9%) 5.010s (~) 0.700s 24 1.61x
workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.213s (-4.0%) 1.006s (~) 0.793s 60 1.00x
🐘 Postgres Express 0.235s (+3.1%) 1.006s (~) 0.772s 60 1.10x
🐘 Postgres Next.js (Turbopack) 0.271s (+2.8%) 1.007s (~) 0.736s 60 1.27x
💻 Local Express 0.417s (-0.8%) 1.004s (~) 0.586s 60 1.96x
💻 Local Nitro 0.506s (+12.3% 🔺) 1.095s (+9.1% 🔺) 0.589s 55 2.38x
💻 Local Next.js (Turbopack) 0.565s (-12.0% 🟢) 1.005s (-5.1% 🟢) 0.440s 60 2.66x
workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.344s (-12.6% 🟢) 1.018s (~) 0.673s 89 1.00x
🐘 Postgres Express 0.358s (-0.7%) 1.006s (~) 0.648s 90 1.04x
🐘 Postgres Next.js (Turbopack) 0.483s (+1.6%) 1.006s (~) 0.522s 90 1.40x
💻 Local Express 2.012s (-4.5%) 2.580s (-2.9%) 0.567s 35 5.85x
💻 Local Nitro 2.091s (+1.2%) 2.579s (-2.2%) 0.488s 35 6.07x
💻 Local Next.js (Turbopack) 2.337s (-8.2% 🟢) 3.044s (-7.7% 🟢) 0.707s 30 6.79x
workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.647s (+4.1%) 1.006s (-6.2% 🟢) 0.359s 120 1.00x
🐘 Postgres Express 0.703s (+1.9%) 1.006s (~) 0.303s 120 1.09x
🐘 Postgres Next.js (Turbopack) 0.985s (+1.6%) 1.527s (-2.5%) 0.543s 79 1.52x
💻 Local Express 8.786s (-7.3% 🟢) 9.330s (-6.9% 🟢) 0.543s 13 13.58x
💻 Local Nitro 9.638s (+2.1%) 10.109s (+0.8%) 0.471s 12 14.89x
💻 Local Next.js (Turbopack) 10.511s (-3.9%) 11.298s (-3.9%) 0.787s 11 16.24x
Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.158s (~) 2.005s (~) 0.011s (-9.5% 🟢) 2.017s (~) 0.859s 10 1.00x
💻 Local Express 1.162s (~) 2.005s (~) 0.010s (-4.8%) 2.017s (~) 0.855s 10 1.00x
🐘 Postgres Nitro 1.162s (~) 2.001s (~) 0.001s (+83.3% 🔺) 2.010s (~) 0.848s 10 1.00x
🐘 Postgres Express 1.163s (-0.7%) 1.999s (~) 0.001s (-22.2% 🟢) 2.011s (~) 0.848s 10 1.00x
💻 Local Next.js (Turbopack) 1.202s (-0.6%) 2.003s (~) 0.012s (+3.3%) 2.019s (~) 0.818s 10 1.04x
🐘 Postgres Next.js (Turbopack) 1.218s (-1.2%) 2.002s (~) 0.002s (+15.4% 🔺) 2.011s (~) 0.793s 10 1.05x
stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.561s (~) 2.009s (~) 0.010s (~) 2.021s (~) 0.460s 30 1.00x
🐘 Postgres Nitro 1.564s (-5.4% 🟢) 2.008s (-3.0%) 0.004s (+20.4% 🔺) 2.025s (-3.0%) 0.461s 30 1.00x
💻 Local Nitro 1.580s (~) 2.009s (~) 0.011s (+2.6%) 2.022s (~) 0.442s 30 1.01x
🐘 Postgres Express 1.599s (+0.6%) 2.003s (~) 0.004s (-2.6%) 2.026s (~) 0.427s 30 1.02x
💻 Local Next.js (Turbopack) 1.724s (-3.8%) 2.009s (~) 0.011s (-15.8% 🟢) 2.023s (~) 0.299s 30 1.10x
🐘 Postgres Next.js (Turbopack) 1.730s (+0.9%) 2.010s (~) 0.004s (-2.6%) 2.025s (~) 0.295s 30 1.11x
10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.690s (-27.9% 🟢) 1.013s (-20.3% 🟢) 0.000s (-18.6% 🟢) 1.040s (-20.5% 🟢) 0.350s 59 1.00x
🐘 Postgres Express 0.720s (+1.0%) 1.013s (-1.7%) 0.000s (+50.0% 🔺) 1.039s (~) 0.320s 58 1.04x
🐘 Postgres Next.js (Turbopack) 0.850s (+10.3% 🔺) 1.109s (+7.2% 🔺) 0.000s (+110.9% 🔺) 1.124s (+7.1% 🔺) 0.274s 55 1.23x
💻 Local Express 1.370s (-1.6%) 2.012s (~) 0.000s (-15.4% 🟢) 2.014s (~) 0.644s 30 1.99x
💻 Local Nitro 1.430s (+3.2%) 2.014s (~) 0.001s (-15.8% 🟢) 2.017s (~) 0.587s 30 2.07x
💻 Local Next.js (Turbopack) 1.492s (~) 2.013s (~) 0.000s (+80.0% 🔺) 2.016s (~) 0.524s 30 2.16x
fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.374s (-28.7% 🟢) 2.103s (-10.1% 🟢) 0.000s (-100.0% 🟢) 2.123s (-10.3% 🟢) 0.749s 29 1.00x
🐘 Postgres Express 1.397s (-2.4%) 2.063s (-3.4%) 0.000s (~) 2.081s (-3.7%) 0.684s 29 1.02x
🐘 Postgres Next.js (Turbopack) 1.680s (-1.1%) 2.181s (-1.6%) 0.000s (-100.0% 🟢) 2.189s (-2.4%) 0.508s 28 1.22x
💻 Local Next.js (Turbopack) 2.900s (-2.2%) 3.466s (-4.1%) 0.001s (+20.2% 🔺) 3.474s (-4.0%) 0.573s 18 2.11x
💻 Local Express 3.047s (-0.8%) 3.774s (-1.7%) 0.001s (~) 3.777s (-1.7%) 0.730s 16 2.22x
💻 Local Nitro 3.196s (+7.6% 🔺) 3.901s (+8.0% 🔺) 0.000s (-20.3% 🟢) 3.905s (+8.0% 🔺) 0.709s 16 2.33x

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Express 10/21
🐘 Postgres Nitro 16/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 15/21
Next.js (Turbopack) 🐘 Postgres 14/21
Nitro 🐘 Postgres 15/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.

@AndrewBarba AndrewBarba marked this pull request as ready for review June 3, 2026 19:29
@AndrewBarba AndrewBarba requested a review from a team as a code owner June 3, 2026 19:29
Copy link
Copy Markdown
Contributor

@karthikscale3 karthikscale3 left a comment

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

github-actions Bot commented Jun 4, 2026

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

Sign up for free to 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