Skip to content

feat: chaos testing infrastructure for workflow resilience#1333

Open
TooTallNate wants to merge 5 commits intomainfrom
nrajlich/chaos-testing
Open

feat: chaos testing infrastructure for workflow resilience#1333
TooTallNate wants to merge 5 commits intomainfrom
nrajlich/chaos-testing

Conversation

@TooTallNate
Copy link
Member

Summary

Adds chaos testing infrastructure to validate that the Workflow DevKit's retry stack and durability guarantees hold up under server-side failures. This is the SDK side — the server-side counterpart is in vercel/workflow-server.

How it works

  1. CI sets WORKFLOW_CHAOS=random-500 (or random-429) env var
  2. start() reads the env var and enters a RequestContext ALS with chaos config
  3. Chaos propagates through queue messages (WorkflowInvokePayload.chaos, StepInvokePayload.chaos) so deployed workbench apps also participate
  4. world-vercel interprets the context: routes HTTP requests to https://chaos.workflow-server.com and adds X-Chaos / X-Chaos-Seed headers
  5. The chaos workflow-server injects random 500s/429s based on the header
  6. The SDK's retry stack (undici RetryAgent, withServerErrorRetry, withThrottleRetry) handles the failures and the workflow completes correctly

Changes

New files

  • packages/world/src/request-context.ts — World-agnostic AsyncLocalStorage<RequestContext> with chaos and chaosSeed fields

Modified files

  • packages/world/src/queue.ts — Added optional chaos field to both payload schemas
  • packages/world/src/index.ts — Exports request context
  • packages/world-vercel/src/utils.ts — Routes to chaos server and adds headers when chaos is active
  • packages/core/src/runtime/start.ts — Reads env var, enters ALS, propagates to executionContext + queue payload
  • packages/core/src/runtime.ts — Workflow handler: parse chaos, enter ALS, propagate on re-enqueue
  • packages/core/src/runtime/suspension-handler.ts — Propagates chaos to step queue payloads
  • packages/core/src/runtime/step-handler.ts — Step handler: parse chaos, enter ALS, propagate at all 4 re-enqueue sites
  • packages/core/src/runtime/resume-hook.ts — Reads chaos from executionContext for hook resume
  • .github/workflows/tests.yml — New chaos-e2e-vercel CI job (matrix: 2 chaos modes × 2 apps)

Related PRs

  • Server side: vercel/workflow-server (chaos middleware PR)

…tion

Add a world-agnostic RequestContext ALS that propagates chaos testing
configuration through the entire workflow execution chain — from start()
through queue messages to workflow/step handlers. Each World implementation
interprets the context independently (world-vercel routes to a dedicated
chaos server and adds X-Chaos headers).

Changes:
- New RequestContext ALS in @workflow/world for cross-cutting per-request concerns
- Chaos mode propagation through WorkflowInvokePayload and StepInvokePayload
- world-vercel routes to chaos.workflow-server.com and sets X-Chaos headers
- CI job running E2E suite under chaos modes (random-500, random-429)
@TooTallNate TooTallNate requested a review from a team as a code owner March 11, 2026 21:22
Copilot AI review requested due to automatic review settings March 11, 2026 21:22
@changeset-bot
Copy link

changeset-bot bot commented Mar 11, 2026

⚠️ No Changeset found

Latest commit: 368da44

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link
Contributor

vercel bot commented Mar 11, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 570 1 67 638
✅ 💻 Local Development 612 0 84 696
✅ 📦 Local Production 612 0 84 696
❌ 🐘 Local Postgres 610 2 84 696
✅ 🪟 Windows 55 0 3 58
❌ 🌍 Community Worlds 118 56 15 189
✅ 📋 Other 147 0 27 174
Total 2724 59 364 3147

❌ Failed Tests

▲ Vercel Production (1 failed)

sveltekit (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🐘 Local Postgres (2 failed)

fastify-stable (1 failed):

  • webhookWorkflow

nextjs-turbopack-canary (1 failed):

  • webhookWorkflow
🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

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

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 51 0 7
✅ example 51 0 7
✅ express 51 0 7
✅ fastify 51 0 7
✅ hono 51 0 7
✅ nextjs-turbopack 56 0 2
✅ nextjs-webpack 56 0 2
✅ nitro 51 0 7
✅ nuxt 51 0 7
❌ sveltekit 50 1 7
✅ vite 51 0 7
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 49 0 9
✅ express-stable 49 0 9
✅ fastify-stable 49 0 9
✅ hono-stable 49 0 9
✅ nextjs-turbopack-canary 55 0 3
✅ nextjs-turbopack-stable 55 0 3
✅ nextjs-webpack-canary 55 0 3
✅ nextjs-webpack-stable 55 0 3
✅ nitro-stable 49 0 9
✅ nuxt-stable 49 0 9
✅ sveltekit-stable 49 0 9
✅ vite-stable 49 0 9
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 49 0 9
✅ express-stable 49 0 9
✅ fastify-stable 49 0 9
✅ hono-stable 49 0 9
✅ nextjs-turbopack-canary 55 0 3
✅ nextjs-turbopack-stable 55 0 3
✅ nextjs-webpack-canary 55 0 3
✅ nextjs-webpack-stable 55 0 3
✅ nitro-stable 49 0 9
✅ nuxt-stable 49 0 9
✅ sveltekit-stable 49 0 9
✅ vite-stable 49 0 9
❌ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 49 0 9
✅ express-stable 49 0 9
❌ fastify-stable 48 1 9
✅ hono-stable 49 0 9
❌ nextjs-turbopack-canary 54 1 3
✅ nextjs-turbopack-stable 55 0 3
✅ nextjs-webpack-canary 55 0 3
✅ nextjs-webpack-stable 55 0 3
✅ nitro-stable 49 0 9
✅ nuxt-stable 49 0 9
✅ sveltekit-stable 49 0 9
✅ vite-stable 49 0 9
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 55 0 3
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 2
❌ mongodb 52 3 3
✅ redis-dev 3 0 2
❌ redis 53 2 3
✅ turso-dev 3 0 2
❌ turso 4 51 3
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 49 0 9
✅ e2e-local-postgres-nest-stable 49 0 9
✅ e2e-local-prod-nest-stable 49 0 9

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 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 🥇 Express 0.033s (+3.4%) 1.005s (~) 0.972s 10 1.00x
💻 Local Nitro 0.035s (+4.2%) 1.005s (~) 0.971s 10 1.04x
💻 Local Next.js (Turbopack) 0.038s (-7.7% 🟢) 1.005s (~) 0.967s 10 1.14x
🌐 Redis Next.js (Turbopack) 0.039s (-15.6% 🟢) 1.005s (~) 0.966s 10 1.17x
🐘 Postgres Express 0.040s (-27.1% 🟢) 1.011s (~) 0.971s 10 1.19x
🐘 Postgres Next.js (Turbopack) 0.049s (-8.9% 🟢) 1.011s (~) 0.962s 10 1.48x
🐘 Postgres Nitro 0.056s (+24.9% 🔺) 1.010s (~) 0.955s 10 1.67x
🌐 MongoDB Next.js (Turbopack) 0.093s (-2.5%) 1.008s (~) 0.915s 10 2.79x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 0.407s (-19.1% 🟢) 1.876s (-10.0% 🟢) 1.469s 10 1.00x
▲ Vercel Nitro 0.546s (+42.1% 🔺) 2.306s (+14.8% 🔺) 1.760s 10 1.34x
▲ Vercel Next.js (Turbopack) 0.549s (+11.2% 🔺) 2.340s (-3.3%) 1.790s 10 1.35x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.085s (-2.5%) 2.006s (~) 0.921s 10 1.00x
🐘 Postgres Express 1.090s (-4.7%) 2.012s (~) 0.923s 10 1.00x
💻 Local Express 1.105s (~) 2.005s (~) 0.900s 10 1.02x
💻 Local Next.js (Turbopack) 1.105s (~) 2.005s (~) 0.900s 10 1.02x
💻 Local Nitro 1.110s (+0.6%) 2.006s (~) 0.897s 10 1.02x
🐘 Postgres Nitro 1.122s (+1.7%) 2.010s (~) 0.889s 10 1.03x
🐘 Postgres Next.js (Turbopack) 1.136s (+0.6%) 2.013s (~) 0.877s 10 1.05x
🌐 MongoDB Next.js (Turbopack) 1.304s (~) 2.008s (~) 0.704s 10 1.20x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.069s (+3.1%) 3.481s (-2.2%) 1.413s 10 1.00x
▲ Vercel Express 2.073s (-1.7%) 3.051s (-16.8% 🟢) 0.978s 10 1.00x
▲ Vercel Nitro 2.227s (+9.0% 🔺) 3.853s (+20.5% 🔺) 1.626s 10 1.08x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 10.514s (-1.6%) 11.024s (~) 0.510s 3 1.00x
🐘 Postgres Express 10.588s (-2.3%) 11.035s (~) 0.447s 3 1.01x
💻 Local Next.js (Turbopack) 10.718s (~) 11.024s (~) 0.307s 3 1.02x
💻 Local Express 10.798s (~) 11.023s (~) 0.225s 3 1.03x
🐘 Postgres Nitro 10.799s (+1.0%) 11.036s (~) 0.237s 3 1.03x
🐘 Postgres Next.js (Turbopack) 10.836s (~) 11.045s (~) 0.209s 3 1.03x
💻 Local Nitro 10.852s (+0.6%) 11.024s (~) 0.172s 3 1.03x
🌐 MongoDB Next.js (Turbopack) 12.281s (+0.6%) 13.024s (~) 0.743s 3 1.17x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 17.162s (+3.7%) 18.920s (+6.8% 🔺) 1.759s 2 1.00x
▲ Vercel Next.js (Turbopack) 17.241s (+2.5%) 18.998s (+1.7%) 1.758s 2 1.00x
▲ Vercel Express 17.878s (+6.6% 🔺) 18.972s (+2.2%) 1.094s 2 1.04x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 26.248s (-1.2%) 27.051s (~) 0.803s 3 1.00x
🐘 Postgres Express 26.345s (-2.5%) 27.048s (~) 0.703s 3 1.00x
🐘 Postgres Nitro 26.959s (+1.2%) 27.056s (~) 0.097s 3 1.03x
💻 Local Next.js (Turbopack) 26.960s (~) 27.054s (~) 0.094s 3 1.03x
🐘 Postgres Next.js (Turbopack) 26.982s (~) 27.071s (-1.2%) 0.089s 3 1.03x
💻 Local Express 27.247s (~) 28.052s (~) 0.805s 3 1.04x
💻 Local Nitro 27.364s (+0.5%) 28.055s (~) 0.691s 3 1.04x
🌐 MongoDB Next.js (Turbopack) 30.600s (~) 31.053s (~) 0.453s 2 1.17x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 43.841s (+3.4%) 45.469s (+2.7%) 1.628s 2 1.00x
▲ Vercel Express 44.862s (+5.5% 🔺) 46.278s (+4.6%) 1.416s 2 1.02x
▲ Vercel Nitro 53.071s (+25.5% 🔺) 54.518s (+26.0% 🔺) 1.447s 2 1.21x

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

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 52.340s (-1.5%) 53.098s (-1.8%) 0.759s 2 1.00x
🐘 Postgres Express 52.672s (-2.4%) 53.087s (-1.9%) 0.415s 2 1.01x
🐘 Postgres Nitro 53.767s (+1.1%) 54.088s (~) 0.320s 2 1.03x
🐘 Postgres Next.js (Turbopack) 53.794s (~) 54.111s (~) 0.317s 2 1.03x
💻 Local Next.js (Turbopack) 55.662s (+0.5%) 56.102s (~) 0.440s 2 1.06x
💻 Local Nitro 56.249s (~) 57.109s (+0.9%) 0.860s 2 1.07x
💻 Local Express 56.252s (~) 57.103s (+1.8%) 0.850s 2 1.07x
🌐 MongoDB Next.js (Turbopack) 60.854s (~) 61.072s (~) 0.218s 2 1.16x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 99.721s (+6.1% 🔺) 101.569s (+7.1% 🔺) 1.848s 1 1.00x
▲ Vercel Next.js (Turbopack) 100.698s (+7.3% 🔺) 102.058s (+6.6% 🔺) 1.360s 1 1.01x
▲ Vercel Express 103.439s (+10.0% 🔺) 104.933s (+9.8% 🔺) 1.494s 1 1.04x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.204s (-2.8%) 2.007s (~) 0.803s 15 1.00x
🐘 Postgres Express 1.250s (-8.6% 🟢) 2.011s (~) 0.760s 15 1.04x
🐘 Postgres Nitro 1.356s (+4.8%) 2.010s (~) 0.653s 15 1.13x
🐘 Postgres Next.js (Turbopack) 1.367s (-2.9%) 2.011s (~) 0.644s 15 1.14x
💻 Local Express 1.415s (+1.7%) 2.006s (~) 0.591s 15 1.18x
💻 Local Next.js (Turbopack) 1.415s (+0.8%) 2.005s (~) 0.590s 15 1.18x
💻 Local Nitro 1.436s (+2.4%) 2.007s (~) 0.570s 15 1.19x
🌐 MongoDB Next.js (Turbopack) 2.136s (~) 3.009s (~) 0.872s 10 1.77x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.504s (~) 3.473s (-15.2% 🟢) 0.969s 9 1.00x
▲ Vercel Nitro 2.804s (+25.5% 🔺) 4.166s (+26.2% 🔺) 1.363s 8 1.12x
▲ Vercel Next.js (Turbopack) 2.832s (+18.1% 🔺) 4.103s (+9.2% 🔺) 1.271s 8 1.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 2.393s (-4.7%) 3.008s (~) 0.615s 10 1.00x
🐘 Postgres Express 2.398s (-2.1%) 3.011s (~) 0.613s 10 1.00x
🐘 Postgres Nitro 2.421s (-2.9%) 3.012s (~) 0.591s 10 1.01x
💻 Local Nitro 2.568s (-4.4%) 3.008s (~) 0.440s 10 1.07x
💻 Local Express 2.595s (~) 3.008s (~) 0.413s 10 1.08x
🐘 Postgres Next.js (Turbopack) 2.608s (~) 3.014s (~) 0.407s 10 1.09x
💻 Local Next.js (Turbopack) 2.627s (+6.6% 🔺) 3.008s (~) 0.382s 10 1.10x
🌐 MongoDB Next.js (Turbopack) 4.734s (+1.6%) 5.178s (~) 0.444s 6 1.98x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.341s (-11.7% 🟢) 3.160s (-22.6% 🟢) 0.819s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.593s (-12.0% 🟢) 3.731s (-13.2% 🟢) 1.139s 9 1.11x
▲ Vercel Nitro 3.678s (+39.5% 🔺) 5.212s (+34.3% 🔺) 1.534s 6 1.57x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.792s (-5.0% 🟢) 4.013s (-9.8% 🟢) 0.221s 8 1.00x
🌐 Redis Next.js (Turbopack) 3.941s (-2.2%) 4.134s (-12.5% 🟢) 0.194s 8 1.04x
🐘 Postgres Nitro 3.970s (-2.1%) 4.442s (-6.2% 🟢) 0.472s 7 1.05x
🐘 Postgres Next.js (Turbopack) 4.174s (+0.6%) 5.016s (~) 0.842s 6 1.10x
💻 Local Next.js (Turbopack) 7.186s (+8.1% 🔺) 7.617s (+5.6% 🔺) 0.431s 5 1.89x
💻 Local Express 7.320s (-4.4%) 8.023s (-3.0%) 0.703s 4 1.93x
💻 Local Nitro 7.383s (-7.6% 🟢) 8.020s (-3.0%) 0.636s 4 1.95x
🌐 MongoDB Next.js (Turbopack) 9.941s (-0.7%) 10.687s (+3.3%) 0.746s 3 2.62x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.067s (-7.3% 🟢) 4.244s (-3.5%) 1.178s 8 1.00x
▲ Vercel Next.js (Turbopack) 3.421s (+9.0% 🔺) 5.142s (+7.9% 🔺) 1.721s 6 1.12x
▲ Vercel Nitro 3.526s (+15.2% 🔺) 5.000s (+8.4% 🔺) 1.474s 6 1.15x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.199s (-2.0%) 2.006s (~) 0.807s 15 1.00x
🐘 Postgres Express 1.269s (-6.4% 🟢) 2.010s (~) 0.741s 15 1.06x
🐘 Postgres Nitro 1.344s (-1.8%) 2.010s (~) 0.666s 15 1.12x
🐘 Postgres Next.js (Turbopack) 1.358s (-2.2%) 2.011s (~) 0.654s 15 1.13x
💻 Local Nitro 1.438s (-0.8%) 2.006s (~) 0.569s 15 1.20x
💻 Local Express 1.438s (-2.4%) 2.006s (~) 0.568s 15 1.20x
💻 Local Next.js (Turbopack) 1.461s (+3.5%) 2.006s (~) 0.544s 15 1.22x
🌐 MongoDB Next.js (Turbopack) 2.157s (-0.6%) 3.009s (~) 0.852s 10 1.80x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.165s (-16.7% 🟢) 3.652s (~) 1.487s 9 1.00x
▲ Vercel Express 2.169s (-14.4% 🟢) 3.258s (-20.4% 🟢) 1.089s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.568s (+5.5% 🔺) 3.798s (-8.0% 🟢) 1.230s 8 1.19x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.417s (-7.3% 🟢) 3.011s (-3.3%) 0.594s 10 1.00x
🐘 Postgres Express 2.417s (-3.9%) 3.011s (~) 0.593s 10 1.00x
🌐 Redis Next.js (Turbopack) 2.438s (-2.6%) 3.008s (~) 0.570s 10 1.01x
🐘 Postgres Next.js (Turbopack) 2.580s (-3.3%) 3.013s (~) 0.433s 10 1.07x
💻 Local Nitro 2.674s (-2.7%) 3.008s (~) 0.334s 10 1.11x
💻 Local Express 2.787s (-0.7%) 3.009s (~) 0.222s 10 1.15x
💻 Local Next.js (Turbopack) 2.818s (+7.3% 🔺) 3.109s (+3.3%) 0.290s 10 1.17x
🌐 MongoDB Next.js (Turbopack) 4.664s (-1.2%) 5.176s (~) 0.512s 6 1.93x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.598s (+8.7% 🔺) 3.589s (-5.6% 🟢) 0.991s 9 1.00x
▲ Vercel Nitro 2.603s (+1.1%) 3.918s (+12.3% 🔺) 1.315s 8 1.00x
▲ Vercel Next.js (Turbopack) 2.729s (+5.3% 🔺) 3.966s (+1.0%) 1.237s 8 1.05x

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

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.702s (-8.2% 🟢) 4.015s (-12.5% 🟢) 0.312s 8 1.00x
🌐 Redis Next.js (Turbopack) 3.833s (-6.0% 🟢) 4.009s (-17.6% 🟢) 0.176s 8 1.04x
🐘 Postgres Nitro 3.972s (-1.9%) 4.588s (-5.9% 🟢) 0.616s 7 1.07x
🐘 Postgres Next.js (Turbopack) 4.178s (-3.9%) 4.873s (-2.9%) 0.695s 7 1.13x
💻 Local Next.js (Turbopack) 7.660s (-0.8%) 8.018s (~) 0.358s 4 2.07x
💻 Local Nitro 7.766s (-3.1%) 8.022s (-8.5% 🟢) 0.256s 4 2.10x
💻 Local Express 8.155s (+2.3%) 8.524s (+3.1%) 0.369s 4 2.20x
🌐 MongoDB Next.js (Turbopack) 9.783s (-1.8%) 10.350s (-3.1%) 0.567s 3 2.64x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.876s (~) 3.883s (-5.6% 🟢) 1.007s 8 1.00x
▲ Vercel Nitro 3.212s (+16.2% 🔺) 4.837s (+28.7% 🔺) 1.625s 7 1.12x
▲ Vercel Next.js (Turbopack) 3.553s (+9.2% 🔺) 4.846s (+9.9% 🔺) 1.293s 7 1.24x

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

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 0.118s (-19.2% 🟢) 1.000s (~) 0.001s (-26.7% 🟢) 1.007s (~) 0.889s 10 1.00x
🐘 Postgres Express 0.130s (-30.6% 🟢) 0.998s (~) 0.001s (-12.5% 🟢) 1.011s (~) 0.881s 10 1.10x
💻 Local Next.js (Turbopack) 0.156s (+11.4% 🔺) 1.002s (~) 0.011s (+0.9%) 1.017s (~) 0.861s 10 1.32x
💻 Local Express 0.177s (+3.9%) 1.003s (~) 0.011s (+1.8%) 1.017s (~) 0.841s 10 1.49x
🐘 Postgres Next.js (Turbopack) 0.181s (-3.1%) 1.001s (~) 0.001s (~) 1.013s (~) 0.832s 10 1.53x
🐘 Postgres Nitro 0.186s (+12.1% 🔺) 0.995s (~) 0.002s (+13.3% 🔺) 1.013s (~) 0.827s 10 1.57x
💻 Local Nitro 0.193s (+12.6% 🔺) 1.003s (~) 0.011s (-4.3%) 1.017s (~) 0.825s 10 1.63x
🌐 MongoDB Next.js (Turbopack) 0.500s (+5.4% 🔺) 0.952s (-1.8%) 0.001s (~) 1.009s (~) 0.510s 10 4.22x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 1.590s (+5.5% 🔺) 2.489s (+14.7% 🔺) 0.005s (+7.0% 🔺) 2.897s (+4.7%) 1.307s 10 1.00x
▲ Vercel Nitro 1.600s (+6.3% 🔺) 2.295s (-0.9%) 0.010s (+81.5% 🔺) 2.866s (+3.6%) 1.266s 10 1.01x
▲ Vercel Next.js (Turbopack) 1.681s (+9.0% 🔺) 2.442s (+10.5% 🔺) 0.005s (-2.0%) 3.001s (+8.2% 🔺) 1.320s 10 1.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Next.js (Turbopack) 6/12
🐘 Postgres Express 11/12
▲ Vercel Express 7/12
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds SDK-side chaos testing plumbing so workflow/step execution can be exercised under injected server failures, with chaos configuration propagated through runtime context and queue payloads and interpreted by world-vercel.

Changes:

  • Introduces a World-agnostic AsyncLocalStorage<RequestContext> for propagating chaos config.
  • Extends workflow/step queue payload schemas to carry a chaos mode and wires it through core runtime enqueue/re-enqueue paths.
  • Updates world-vercel HTTP client utils to route to a chaos server and attach chaos headers; adds a new GitHub Actions chaos E2E job.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
packages/world/src/request-context.ts Adds RequestContext + ALS helpers for per-request cross-cutting settings.
packages/world/src/queue.ts Adds optional chaos to workflow/step invoke payload schemas.
packages/world/src/index.ts Exports request context types/helpers from @workflow/world.
packages/world-vercel/src/utils.ts Uses request context to route to chaos server and add X-Chaos* headers.
packages/core/src/runtime/start.ts Reads chaos env vars, enters ALS, propagates chaos into run creation/queueing.
packages/core/src/runtime.ts Workflow handler enters ALS from payload and propagates chaos on suspension/re-enqueue.
packages/core/src/runtime/suspension-handler.ts Propagates chaos into step queue messages created during suspension handling.
packages/core/src/runtime/step-handler.ts Step handler enters ALS from payload and propagates chaos on workflow re-enqueue paths.
packages/core/src/runtime/resume-hook.ts Propagates chaos from run executionContext on hook resume enqueue.
.github/workflows/tests.yml Adds chaos-e2e-vercel CI job running E2E under chaos modes.

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

You can also share your feedback on Copilot code review. Take the survey.

…ntry, rename CI matrix key

- Add chaosSeed field to WorkflowInvokePayloadSchema and StepInvokePayloadSchema
- Propagate chaosSeed through entire execution chain: start() -> executionContext,
  queue payloads, workflow handler, step handler, suspension handler, resume hook
- Only enter requestContext.run() when chaos config is present, so
  getRequestContext() returns undefined in non-chaos cases
- Fix getRequestContext() docs to match actual behavior
- Rename CI matrix key from chaos-mode to chaos_mode to avoid GitHub
  Actions expression syntax treating hyphen as subtraction
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.

3 participants