Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[world-vercel] Fix run_failed event schema validation failure in lazy ref mode#1222

Open
TooTallNate wants to merge 1 commit intomainfrom
fix/run-failed-event-schema-validation
Open

[world-vercel] Fix run_failed event schema validation failure in lazy ref mode#1222
TooTallNate wants to merge 1 commit intomainfrom
fix/run-failed-event-schema-validation

Conversation

@TooTallNate
Copy link
Member

@TooTallNate TooTallNate commented Feb 27, 2026

Summary

  • EventResultWireSchema was using the strict WorkflowRunSchema (discriminated union) to validate the run entity in the server response. For status: 'failed', this requires error: StructuredErrorSchema — but run_failed events use remoteRefBehavior: 'lazy', so the server returns the error field as a RemoteRef descriptor or undefined, causing Zod validation to fail.
  • Switched to WorkflowRunWireBaseSchema which accepts error as a string (legacy), structured object, or undefined (lazy ref mode).
  • Applied deserializeError() to normalize the wire-format run entity before returning it to consumers, matching the pattern used in all other run-returning functions in runs.ts.

The EventResultWireSchema used the strict WorkflowRunSchema (discriminated
union) which requires error: StructuredErrorSchema for status 'failed'. When
run_failed events use remoteRefBehavior 'lazy', the server returns the error
field as a RemoteRef or undefined, causing Zod validation to fail.

Switch to WorkflowRunWireBaseSchema which accepts error as string, structured
object, or undefined, and apply deserializeError() to normalize the run entity
before returning it to consumers.

Closes #1180
Copilot AI review requested due to automatic review settings February 27, 2026 19:25
@TooTallNate TooTallNate requested a review from a team as a code owner February 27, 2026 19:25
@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

🦋 Changeset detected

Latest commit: ac5db6a

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

This PR includes changesets to release 15 packages
Name Type
@workflow/world-vercel Patch
@workflow/cli Patch
@workflow/core Patch
workflow Patch
@workflow/world-testing Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/nitro 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

@vercel
Copy link
Contributor

vercel bot commented Feb 27, 2026

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Building Building Preview, Comment Feb 27, 2026 7:26pm
example-nextjs-workflow-webpack Building Building Preview, Comment Feb 27, 2026 7:26pm
example-workflow Building Building Preview, Comment Feb 27, 2026 7:26pm
workbench-astro-workflow Building Building Preview, Comment Feb 27, 2026 7:26pm
workbench-express-workflow Building Building Preview, Comment Feb 27, 2026 7:26pm
workbench-fastify-workflow Building Building Preview, Comment Feb 27, 2026 7:26pm
workbench-hono-workflow Building Building Preview, Comment Feb 27, 2026 7:26pm
workbench-nitro-workflow Building Building Preview, Comment Feb 27, 2026 7:26pm
workbench-nuxt-workflow Building Building Preview, Comment Feb 27, 2026 7:26pm
workbench-sveltekit-workflow Building Building Preview, Comment Feb 27, 2026 7:26pm
workbench-vite-workflow Building Building Preview, Comment Feb 27, 2026 7:26pm
workflow-nest Building Building Preview, Comment Feb 27, 2026 7:26pm
workflow-swc-playground Building Building Preview, Comment Feb 27, 2026 7:26pm

@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 521 2 49 572
✅ 💻 Local Development 556 0 68 624
✅ 📦 Local Production 507 0 65 572
✅ 🐘 Local Postgres 556 0 68 624
✅ 🪟 Windows 49 0 3 52
❌ 🌍 Community Worlds 110 46 9 165
✅ 📋 Other 135 0 21 156
Total 2434 48 283 2765

❌ Failed Tests

▲ Vercel Production (2 failed)

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed

vite (1 failed):

  • readableStreamWorkflow
🌍 Community Worlds (46 failed)

mongodb (1 failed):

  • webhookWorkflow

turso (45 failed):

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

Details by Category

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

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 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.032s (-9.3% 🟢) 1.004s (~) 0.972s 10 1.00x
💻 Local Express 0.033s (+0.9%) 1.005s (~) 0.972s 10 1.02x
💻 Local Next.js (Turbopack) 0.042s 1.005s 0.964s 10 1.30x
🌐 Redis Next.js (Turbopack) 0.042s 1.005s 0.963s 10 1.32x
🐘 Postgres Express 0.043s (-19.7% 🟢) 1.012s (~) 0.968s 10 1.35x
🐘 Postgres Next.js (Turbopack) 0.049s 1.010s 0.962s 10 1.51x
🐘 Postgres Nitro 0.052s (-5.4% 🟢) 1.012s (~) 0.959s 10 1.63x
🌐 MongoDB Next.js (Turbopack) 0.097s 1.007s 0.911s 10 3.01x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 0.584s (-15.3% 🟢) 2.088s (-17.3% 🟢) 1.504s 10 1.00x
▲ Vercel Express 0.612s (-10.3% 🟢) 2.072s (+12.3% 🔺) 1.460s 10 1.05x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.101s (-1.5%) 2.012s (~) 0.912s 10 1.00x
🌐 Redis Next.js (Turbopack) 1.102s 2.006s 0.904s 10 1.00x
💻 Local Next.js (Turbopack) 1.104s 2.006s 0.902s 10 1.00x
💻 Local Nitro 1.104s (~) 2.005s (~) 0.901s 10 1.00x
💻 Local Express 1.105s (~) 2.005s (~) 0.901s 10 1.00x
🐘 Postgres Next.js (Turbopack) 1.119s 2.011s 0.891s 10 1.02x
🐘 Postgres Nitro 1.131s (~) 2.011s (~) 0.879s 10 1.03x
🌐 MongoDB Next.js (Turbopack) 1.318s 2.009s 0.691s 10 1.20x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.116s (-11.6% 🟢) 3.549s (+7.8% 🔺) 1.432s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.146s (-8.7% 🟢) 3.460s (-2.6%) 1.314s 10 1.01x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 10.664s (-1.5%) 11.040s (~) 0.375s 3 1.00x
🌐 Redis Next.js (Turbopack) 10.725s 11.022s 0.297s 3 1.01x
💻 Local Next.js (Turbopack) 10.768s 11.023s 0.255s 3 1.01x
💻 Local Nitro 10.823s (~) 11.022s (~) 0.199s 3 1.01x
💻 Local Express 10.825s (~) 11.022s (~) 0.197s 3 1.02x
🐘 Postgres Next.js (Turbopack) 10.842s 11.042s 0.200s 3 1.02x
🐘 Postgres Nitro 10.859s (~) 11.043s (~) 0.184s 3 1.02x
🌐 MongoDB Next.js (Turbopack) 12.319s 13.024s 0.705s 3 1.16x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 17.685s (-1.6%) 18.677s (-3.0%) 0.992s 2 1.00x
▲ Vercel Next.js (Turbopack) 17.886s (-1.9%) 18.987s (-2.0%) 1.102s 2 1.01x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 26.746s (-1.7%) 27.061s (-3.6%) 0.314s 3 1.00x
🌐 Redis Next.js (Turbopack) 26.918s 27.051s 0.133s 3 1.01x
🐘 Postgres Next.js (Turbopack) 27.182s 28.057s 0.876s 3 1.02x
🐘 Postgres Nitro 27.252s (~) 28.062s (~) 0.810s 3 1.02x
💻 Local Next.js (Turbopack) 27.322s 28.053s 0.731s 3 1.02x
💻 Local Express 27.491s (~) 28.050s (~) 0.559s 3 1.03x
💻 Local Nitro 27.500s (~) 28.051s (~) 0.551s 3 1.03x
🌐 MongoDB Next.js (Turbopack) 30.608s 31.052s 0.444s 2 1.14x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 45.560s (+3.0%) 47.237s (+4.7%) 1.677s 2 1.00x
▲ Vercel Next.js (Turbopack) 47.635s (+4.5%) 49.847s (+6.2% 🔺) 2.212s 2 1.05x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 54.151s (-1.6%) 55.090s (-0.9%) 0.939s 2 1.00x
🌐 Redis Next.js (Turbopack) 54.370s 55.096s 0.726s 2 1.00x
🐘 Postgres Next.js (Turbopack) 54.989s 55.095s 0.106s 2 1.02x
🐘 Postgres Nitro 55.072s (~) 55.597s (+0.9%) 0.525s 2 1.02x
💻 Local Next.js (Turbopack) 56.846s 57.104s 0.258s 2 1.05x
💻 Local Express 57.332s (~) 58.102s (~) 0.770s 2 1.06x
💻 Local Nitro 57.392s (~) 58.101s (~) 0.710s 2 1.06x
🌐 MongoDB Next.js (Turbopack) 61.169s 62.084s 0.915s 2 1.13x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 96.817s (-2.4%) 97.768s (-2.2%) 0.951s 1 1.00x
▲ Vercel Express 97.932s (-2.8%) 98.953s (-3.2%) 1.021s 1 1.01x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: 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.249s 2.006s 0.757s 15 1.00x
🐘 Postgres Express 1.308s (-3.8%) 2.010s (~) 0.701s 15 1.05x
🐘 Postgres Nitro 1.359s (~) 2.010s (~) 0.651s 15 1.09x
🐘 Postgres Next.js (Turbopack) 1.378s 2.011s 0.632s 15 1.10x
💻 Local Nitro 1.407s (-2.7%) 2.006s (~) 0.599s 15 1.13x
💻 Local Express 1.421s (~) 2.005s (~) 0.584s 15 1.14x
💻 Local Next.js (Turbopack) 1.422s 2.005s 0.583s 15 1.14x
🌐 MongoDB Next.js (Turbopack) 2.138s 3.009s 0.871s 10 1.71x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.729s (-10.0% 🟢) 3.987s (-4.5%) 1.258s 8 1.00x
▲ Vercel Express 2.869s (+20.7% 🔺) 4.059s (+31.6% 🔺) 1.190s 8 1.05x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.798s (-11.0% 🟢) 2.322s (-7.6% 🟢) 0.525s 13 1.00x
🐘 Postgres Nitro 1.988s (-4.7%) 2.595s (-3.4%) 0.607s 12 1.11x
🐘 Postgres Next.js (Turbopack) 2.047s 2.398s 0.350s 13 1.14x
🌐 Redis Next.js (Turbopack) 2.509s 3.008s 0.499s 10 1.40x
💻 Local Next.js (Turbopack) 2.588s 3.007s 0.419s 10 1.44x
💻 Local Nitro 2.637s (-1.1%) 3.007s (~) 0.370s 10 1.47x
💻 Local Express 2.649s (+0.5%) 3.007s (~) 0.358s 10 1.47x
🌐 MongoDB Next.js (Turbopack) 4.769s 5.178s 0.409s 6 2.65x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.473s (+28.5% 🔺) 4.552s (+26.5% 🔺) 1.079s 7 1.00x
▲ Vercel Next.js (Turbopack) 3.599s (+6.8% 🔺) 4.521s (~) 0.923s 7 1.04x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.727s (-15.3% 🟢) 3.683s (-8.4% 🟢) 0.957s 9 1.00x
🐘 Postgres Nitro 3.447s (-4.5%) 4.021s (-8.8% 🟢) 0.575s 8 1.26x
🌐 Redis Next.js (Turbopack) 4.004s 4.295s 0.291s 7 1.47x
🐘 Postgres Next.js (Turbopack) 4.046s 4.889s 0.843s 7 1.48x
💻 Local Next.js (Turbopack) 7.034s 7.768s 0.735s 4 2.58x
💻 Local Express 7.495s (~) 8.019s (~) 0.524s 4 2.75x
💻 Local Nitro 7.803s (+1.6%) 8.017s (~) 0.213s 4 2.86x
🌐 MongoDB Next.js (Turbopack) 9.982s 10.690s 0.708s 3 3.66x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.372s (-26.3% 🟢) 4.367s (-23.1% 🟢) 0.995s 7 1.00x
▲ Vercel Next.js (Turbopack) 3.644s (+11.1% 🔺) 4.518s (+5.2% 🔺) 0.874s 7 1.08x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.246s 2.006s 0.760s 15 1.00x
🐘 Postgres Express 1.296s (-6.1% 🟢) 2.010s (~) 0.714s 15 1.04x
🐘 Postgres Nitro 1.382s (-2.2%) 2.011s (~) 0.629s 15 1.11x
🐘 Postgres Next.js (Turbopack) 1.412s 2.010s 0.598s 15 1.13x
💻 Local Express 1.428s (+1.2%) 2.006s (~) 0.577s 15 1.15x
💻 Local Nitro 1.454s (~) 2.004s (~) 0.550s 15 1.17x
💻 Local Next.js (Turbopack) 1.467s 2.005s 0.538s 15 1.18x
🌐 MongoDB Next.js (Turbopack) 2.149s 3.009s 0.860s 10 1.72x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.345s (+9.9% 🔺) 3.587s (+18.2% 🔺) 1.242s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.545s (+16.3% 🔺) 3.779s (+8.5% 🔺) 1.235s 8 1.08x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.803s (-6.6% 🟢) 2.156s (-16.9% 🟢) 0.353s 14 1.00x
🐘 Postgres Next.js (Turbopack) 2.007s 2.598s 0.591s 12 1.11x
🐘 Postgres Nitro 2.060s (+1.0%) 2.595s (+4.8%) 0.534s 12 1.14x
🌐 Redis Next.js (Turbopack) 2.508s 3.007s 0.499s 10 1.39x
💻 Local Nitro 2.694s (-2.8%) 3.007s (~) 0.314s 10 1.49x
💻 Local Express 2.698s (-1.4%) 3.008s (~) 0.310s 10 1.50x
💻 Local Next.js (Turbopack) 2.702s 3.008s 0.306s 10 1.50x
🌐 MongoDB Next.js (Turbopack) 4.799s 5.178s 0.379s 6 2.66x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.540s (-4.4%) 3.649s (+1.9%) 1.109s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.835s (-10.0% 🟢) 4.105s (-2.1%) 1.270s 8 1.12x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.255s (-14.8% 🟢) 4.140s (-4.1%) 0.885s 8 1.00x
🐘 Postgres Nitro 3.900s (+15.7% 🔺) 4.596s (+10.8% 🔺) 0.696s 7 1.20x
🌐 Redis Next.js (Turbopack) 4.039s 4.582s 0.543s 7 1.24x
🐘 Postgres Next.js (Turbopack) 4.091s 4.735s 0.644s 7 1.26x
💻 Local Next.js (Turbopack) 7.485s 8.016s 0.531s 4 2.30x
💻 Local Express 7.818s (-4.8%) 8.020s (-11.1% 🟢) 0.202s 4 2.40x
💻 Local Nitro 7.848s (-5.8% 🟢) 8.270s (-8.3% 🟢) 0.421s 4 2.41x
🌐 MongoDB Next.js (Turbopack) 10.178s 10.684s 0.506s 3 3.13x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.491s (-10.7% 🟢) 4.533s (-13.5% 🟢) 1.042s 7 1.00x
▲ Vercel Next.js (Turbopack) 3.747s (+24.1% 🔺) 5.030s (+23.1% 🔺) 1.283s 6 1.07x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | 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
💻 Local 🥇 Next.js (Turbopack) 0.145s 1.001s 0.011s 1.016s 0.871s 10 1.00x
🐘 Postgres Express 0.145s (-23.4% 🟢) 0.999s (+0.7%) 0.001s (-13.3% 🟢) 1.011s (~) 0.866s 10 1.00x
🌐 Redis Next.js (Turbopack) 0.146s 1.000s 0.001s 1.007s 0.860s 10 1.01x
💻 Local Express 0.169s (-1.3%) 1.002s (~) 0.011s (+1.8%) 1.016s (~) 0.848s 10 1.16x
💻 Local Nitro 0.173s (-6.8% 🟢) 1.003s (~) 0.012s (-1.7%) 1.017s (~) 0.844s 10 1.19x
🐘 Postgres Next.js (Turbopack) 0.175s 1.000s 0.002s 1.011s 0.836s 10 1.21x
🐘 Postgres Nitro 0.190s (-3.9%) 0.999s (~) 0.001s (-22.2% 🟢) 1.013s (~) 0.823s 10 1.31x
🌐 MongoDB Next.js (Turbopack) 0.494s 0.953s 0.002s 1.009s 0.515s 10 3.41x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 1.683s (-26.5% 🟢) 1.844s (-36.8% 🟢) 0.150s (+8.6% 🔺) 2.604s (-92.3% 🟢) 0.920s 10 1.00x
▲ Vercel Express 1.962s (+26.6% 🔺) 1.992s (-12.4% 🟢) 0.112s (-35.3% 🟢) 3.029s (+5.6% 🔺) 1.066s 10 1.17x
▲ Vercel Nitro ⚠️ missing - - - - -

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 11/12
Next.js (Turbopack) 🌐 Redis 6/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

This PR updates the @workflow/world-vercel client to avoid Zod validation failures when creating run_failed events in remoteRefBehavior: 'lazy' mode, by loosening the wire-schema for the returned run and normalizing the wire error format before returning results.

Changes:

  • Exported WorkflowRunWireBaseSchema from runs.ts so it can be reused elsewhere.
  • Updated events.create result validation to use WorkflowRunWireBaseSchema for the optional run field and applied deserializeError() before returning run.
  • Added a changeset to publish a patch release documenting the fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/world-vercel/src/runs.ts Exports WorkflowRunWireBaseSchema for reuse by event result parsing.
packages/world-vercel/src/events.ts Uses the wire-base run schema for event-create responses and normalizes run errors via deserializeError().
.changeset/fix-run-failed-schema.md Declares a patch release and documents the validation fix.

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

Comment on lines +52 to 61
// Uses wire format schemas for step and run to handle field name mapping
// and accept both resolved and lazy (ref-based) responses from the server.
// WorkflowRunWireBaseSchema is used instead of WorkflowRunSchema because the
// server may return error as a string (legacy) or undefined (lazy ref mode).
const EventResultWireSchema = z.object({
event: EventSchema,
run: WorkflowRunSchema.optional(),
run: WorkflowRunWireBaseSchema.optional(),
step: StepWireSchema.optional(),
hook: HookSchema.optional(),
});
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

EventResult is typed to return run?: WorkflowRun, but swapping to WorkflowRunWireBaseSchema means the response no longer has to satisfy the WorkflowRunSchema discriminated union (e.g., a status: 'failed' run can now pass validation without an error). That can leak invalid run shapes to callers and hide backend regressions for event types that use remoteRefBehavior: 'resolve'. Consider validating run with WorkflowRunSchema.safeParse after normalization (and dropping/transforming on failure), or using the strict schema when remoteRefBehavior is resolve and the wire-base schema only for lazy.

Copilot uses AI. Check for mistakes.
Comment on lines 359 to +363
return {
event: filterEventData(wireResult.event, resolveData),
run: wireResult.run,
run: wireResult.run
? deserializeError<WorkflowRun>(wireResult.run)
: undefined,
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

deserializeError<WorkflowRun>(wireResult.run) asserts the result is a WorkflowRun, but with WorkflowRunWireBaseSchema the parsed run may still violate WorkflowRun’s invariants (notably status: 'failed' without error). Returning an object that doesn’t conform to the discriminated union can break consumers that assume run.error exists for failed runs. Suggestion: after deserializing, WorkflowRunSchema.safeParse and return undefined (or synthesize an error from eventData) if it doesn’t validate.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about this?

Comment on lines 359 to +363
return {
event: filterEventData(wireResult.event, resolveData),
run: wireResult.run,
run: wireResult.run
? deserializeError<WorkflowRun>(wireResult.run)
: undefined,
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about this?

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