Skip to content

Fix workflow/step not found errors to fail run instead of queue retry#1452

Draft
pranaygp wants to merge 3 commits intomainfrom
v0/pranaygp-db9e68c1
Draft

Fix workflow/step not found errors to fail run instead of queue retry#1452
pranaygp wants to merge 3 commits intomainfrom
v0/pranaygp-db9e68c1

Conversation

@pranaygp
Copy link
Collaborator

When a workflow or step function is not found during queue message processing, the error was bubbling up to the queue handler causing infinite retries. This is a code deployment mismatch that retries will never fix.

What changed

  • step-handler.ts: Added proper error handling for step not found - now creates a run_failed event with RUNTIME_ERROR code instead of throwing a plain error
  • workflow.ts: Changed ReferenceError to WorkflowRuntimeError for workflow not found - this is already caught by the runtime and properly fails the run
  • workflow.test.ts: Updated test to expect the new error type and message

Both cases now provide helpful error messages indicating this is likely a deployment mismatch (workflow/step removed or renamed in a newer deployment while run was in progress).

Slack Thread

Copilot AI review requested due to automatic review settings March 19, 2026 17:49
@vercel vercel bot added the v0 label Mar 19, 2026
@pranaygp pranaygp requested a review from a team as a code owner March 19, 2026 17:49
@changeset-bot
Copy link

changeset-bot bot commented Mar 19, 2026

🦋 Changeset detected

Latest commit: 5033859

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

This PR includes changesets to release 16 packages
Name Type
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
workflow Patch
@workflow/world-testing Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt Patch
@workflow/ai 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
Contributor

github-actions bot commented Mar 19, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 758 0 67 825
✅ 💻 Local Development 727 0 98 825
✅ 📦 Local Production 782 0 118 900
✅ 🐘 Local Postgres 782 0 118 900
✅ 🪟 Windows 72 0 3 75
❌ 🌍 Community Worlds 118 56 15 189
✅ 📋 Other 198 0 27 225
Total 3437 56 446 3939

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

  • addTenWorkflow | wrun_01KM3XWD5GVMM9Z1N2A3XER5AT
  • addTenWorkflow | wrun_01KM3XWD5GVMM9Z1N2A3XER5AT
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM3XXKSXCWXFNA5EM6730V4K
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM3XWKMRCGGP00FK32S6CTY7
  • promiseRaceWorkflow | wrun_01KM3XWPZR5KPYYE4Q50X0H5FM
  • promiseAnyWorkflow | wrun_01KM3XWT7820546V6VH3QYHG9W
  • importedStepOnlyWorkflow | wrun_01KM3XY08MF2H0VK9F32WSH844
  • hookWorkflow | wrun_01KM3XX69X8X3K9D9HJZEB06RZ
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM3XXGPBWT6RXE3HT2ZKDF62
  • webhookWorkflow | wrun_01KM3XXR66GMPXW3KYQA8FXBQ6
  • sleepingWorkflow | wrun_01KM3XXYP2NPSBGYYPY6348742
  • parallelSleepWorkflow | wrun_01KM3XYAG1MB8TKN1N7MA1ESWG
  • nullByteWorkflow | wrun_01KM3XYEYESN577ED97VARFQC9
  • workflowAndStepMetadataWorkflow | wrun_01KM3XYGZYZWWEZAQMH8287ZHS
  • fetchWorkflow | wrun_01KM3XZDNGWTVHF3FEF2VD9ZW9
  • promiseRaceStressTestWorkflow | wrun_01KM3XZGGYXHTZ79T2RWBQ69XW
  • 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 catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM3Y2C2W0BH3NZBQP2VPZDK3
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM3Y306495STS2R7VXHPV5KE
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM3Y3MP8DHV7NDB7YEJGF4CW
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM3Y492H24KDRA6NCVB06RN9
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM3Y4J9QFN0FYRGB17K0DXH3
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM3Y4QPCVQFV328X35KT3ZFX
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM3Y4SQYC93M1WDF2BFHJ5K2
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM3Y58QW0228PQVMQJJQ7PJM
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM3Y5E52JAJ2SW91CD24XM6C
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM3Y5MN8WNQJVT37Q8BW3P87
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM3Y5V48SH89Y0J7XYTNHTCQ
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM3Y60KJCAWGP130X5Y4751W
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM3Y6763313KQYB6VCSDJTP8
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM3Y6E5AA22E9ZXGNRSS46WJ
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM3Y6QWRBA9K41M5SREHDYF2
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM3Y70N40DX7P3VAJBG1PSAD
  • cancelRun - cancelling a running workflow | wrun_01KM3Y773B2A4F4891WV2HCXQH
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM3Y7GQXXB2C3NFRCKYVSYXG
  • 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 | wrun_01KM3Y7WSDPFQAJAC8HZB0TGFN
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM3Y8G696DH7A1GEMXFMSB6N
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM3Y8VN0ES3572EAZ90N9CP2

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 68 0 7
✅ example 68 0 7
✅ express 68 0 7
✅ fastify 68 0 7
✅ hono 68 0 7
✅ nextjs-turbopack 73 0 2
✅ nextjs-webpack 73 0 2
✅ nitro 68 0 7
✅ nuxt 68 0 7
✅ sveltekit 68 0 7
✅ vite 68 0 7
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 66 0 9
✅ express-stable 66 0 9
✅ fastify-stable 66 0 9
✅ hono-stable 66 0 9
✅ nextjs-turbopack-stable 72 0 3
✅ nextjs-webpack-canary 55 0 20
✅ nextjs-webpack-stable 72 0 3
✅ nitro-stable 66 0 9
✅ nuxt-stable 66 0 9
✅ sveltekit-stable 66 0 9
✅ vite-stable 66 0 9
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 66 0 9
✅ express-stable 66 0 9
✅ fastify-stable 66 0 9
✅ hono-stable 66 0 9
✅ nextjs-turbopack-canary 55 0 20
✅ nextjs-turbopack-stable 72 0 3
✅ nextjs-webpack-canary 55 0 20
✅ nextjs-webpack-stable 72 0 3
✅ nitro-stable 66 0 9
✅ nuxt-stable 66 0 9
✅ sveltekit-stable 66 0 9
✅ vite-stable 66 0 9
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 66 0 9
✅ express-stable 66 0 9
✅ fastify-stable 66 0 9
✅ hono-stable 66 0 9
✅ nextjs-turbopack-canary 55 0 20
✅ nextjs-turbopack-stable 72 0 3
✅ nextjs-webpack-canary 55 0 20
✅ nextjs-webpack-stable 72 0 3
✅ nitro-stable 66 0 9
✅ nuxt-stable 66 0 9
✅ sveltekit-stable 66 0 9
✅ vite-stable 66 0 9
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 72 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 66 0 9
✅ e2e-local-postgres-nest-stable 66 0 9
✅ e2e-local-prod-nest-stable 66 0 9

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 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 (-1.0%) 1.005s (~) 0.967s 10 1.00x
💻 Local Express 0.048s (-1.0%) 1.006s (~) 0.959s 10 1.25x
🐘 Postgres Express 0.060s (-25.5% 🟢) 1.012s (~) 0.952s 10 1.56x
🐘 Postgres Nitro 0.060s (-13.0% 🟢) 1.011s (-0.8%) 0.951s 10 1.58x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.376s (-27.4% 🟢) 1.872s (-24.0% 🟢) 1.497s 10 1.00x
▲ Vercel Next.js (Turbopack) 0.444s (-23.2% 🟢) 1.850s (-26.5% 🟢) 1.407s 10 1.18x
▲ Vercel Express 0.541s (+4.2%) 2.203s (-9.2% 🟢) 1.661s 10 1.44x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.095s (~) 2.005s (~) 0.911s 10 1.00x
💻 Local Express 1.125s (-0.7%) 2.006s (~) 0.881s 10 1.03x
🐘 Postgres Express 1.152s (+0.6%) 2.012s (~) 0.860s 10 1.05x
🐘 Postgres Nitro 1.167s (+1.6%) 2.013s (~) 0.846s 10 1.07x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.062s (+1.3%) 3.489s (-4.7%) 1.428s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.074s (-3.2%) 3.094s (-15.6% 🟢) 1.020s 10 1.01x
▲ Vercel Nitro 2.074s (-5.8% 🟢) 3.133s (-18.1% 🟢) 1.060s 10 1.01x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 10.649s (~) 11.022s (~) 0.373s 3 1.00x
💻 Local Express 10.919s (-0.5%) 11.023s (~) 0.104s 3 1.03x
🐘 Postgres Nitro 10.986s (~) 11.376s (-2.9%) 0.390s 3 1.03x
🐘 Postgres Express 11.036s (+1.5%) 11.375s (+3.1%) 0.339s 3 1.04x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 17.849s (+5.8% 🔺) 19.377s (+3.5%) 1.528s 2 1.00x
▲ Vercel Express 18.084s (+8.3% 🔺) 19.662s (+7.5% 🔺) 1.578s 2 1.01x
▲ Vercel Next.js (Turbopack) 18.521s (+8.7% 🔺) 19.554s (+6.9% 🔺) 1.033s 2 1.04x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 26.783s (~) 27.050s (~) 0.267s 3 1.00x
🐘 Postgres Express 27.270s (~) 28.068s (~) 0.798s 3 1.02x
🐘 Postgres Nitro 27.284s (~) 28.069s (~) 0.786s 3 1.02x
💻 Local Express 27.546s (~) 28.054s (~) 0.508s 3 1.03x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 44.319s (-1.3%) 45.503s (-3.1%) 1.184s 2 1.00x
▲ Vercel Next.js (Turbopack) 45.230s (-3.9%) 46.214s (-5.4% 🟢) 0.984s 2 1.02x
▲ Vercel Express 46.884s (+3.4%) 48.043s (+3.1%) 1.159s 2 1.06x

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

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 54.356s (~) 55.104s (~) 0.748s 2 1.00x
🐘 Postgres Nitro 54.407s (~) 55.105s (~) 0.698s 2 1.00x
💻 Local Nitro 54.919s (~) 55.099s (~) 0.180s 2 1.01x
💻 Local Express 56.589s (~) 57.103s (~) 0.514s 2 1.04x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 94.399s (-7.1% 🟢) 95.268s (-7.8% 🟢) 0.869s 1 1.00x
▲ Vercel Express 95.272s (~) 96.849s (~) 1.577s 1 1.01x
▲ Vercel Next.js (Turbopack) 100.477s (+5.1% 🔺) 102.146s (+4.8%) 1.669s 1 1.06x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.279s (~) 2.011s (~) 0.732s 15 1.00x
🐘 Postgres Nitro 1.283s (-0.8%) 2.011s (~) 0.728s 15 1.00x
💻 Local Nitro 1.502s (+1.8%) 2.005s (~) 0.503s 15 1.17x
💻 Local Express 1.530s (~) 2.005s (~) 0.475s 15 1.20x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.387s (-3.8%) 3.545s (-8.9% 🟢) 1.158s 9 1.00x
▲ Vercel Express 2.481s (+7.0% 🔺) 3.510s (-7.0% 🟢) 1.029s 9 1.04x
▲ Vercel Next.js (Turbopack) 2.663s (+6.0% 🔺) 3.889s (+1.9%) 1.226s 8 1.12x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.428s (-1.6%) 3.012s (~) 0.584s 10 1.00x
🐘 Postgres Express 2.493s (+1.5%) 3.013s (~) 0.520s 10 1.03x
💻 Local Nitro 2.724s (+6.2% 🔺) 3.108s (+3.3%) 0.384s 10 1.12x
💻 Local Express 3.051s (~) 3.759s (+8.9% 🔺) 0.709s 8 1.26x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.570s (-5.6% 🟢) 3.681s (-9.9% 🟢) 1.111s 9 1.00x
▲ Vercel Express 2.899s (+2.7%) 4.131s (-5.3% 🟢) 1.232s 8 1.13x
▲ Vercel Next.js (Turbopack) 2.925s (+5.5% 🔺) 4.231s (+3.9%) 1.306s 8 1.14x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.598s (~) 4.014s (~) 0.416s 8 1.00x
🐘 Postgres Express 3.626s (+1.3%) 4.138s (+3.1%) 0.512s 8 1.01x
💻 Local Nitro 6.949s (-8.4% 🟢) 7.514s (-9.1% 🟢) 0.564s 4 1.93x
💻 Local Express 8.339s (-2.5%) 9.021s (-2.7%) 0.682s 4 2.32x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.888s (-6.9% 🟢) 4.099s (-5.2% 🟢) 1.212s 8 1.00x
▲ Vercel Express 3.295s (+18.4% 🔺) 4.633s (+7.0% 🔺) 1.338s 7 1.14x
▲ Vercel Next.js (Turbopack) 3.854s (-3.9%) 5.231s (~) 1.377s 6 1.33x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.259s (-2.0%) 2.011s (~) 0.752s 15 1.00x
🐘 Postgres Express 1.291s (+2.3%) 2.011s (~) 0.720s 15 1.02x
💻 Local Nitro 1.473s (-1.4%) 2.004s (~) 0.531s 15 1.17x
💻 Local Express 1.514s (-2.8%) 2.006s (~) 0.493s 15 1.20x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.149s (-33.5% 🟢) 3.269s (-31.6% 🟢) 1.120s 10 1.00x
▲ Vercel Nitro 2.530s (+9.7% 🔺) 3.760s (~) 1.229s 8 1.18x
▲ Vercel Express 3.245s (-1.3%) 4.329s (-8.2% 🟢) 1.085s 7 1.51x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.444s (-1.4%) 3.012s (~) 0.568s 10 1.00x
🐘 Postgres Express 2.449s (~) 3.012s (~) 0.562s 10 1.00x
💻 Local Nitro 2.715s (+2.7%) 3.007s (~) 0.292s 10 1.11x
💻 Local Express 3.022s (-8.8% 🟢) 3.455s (-16.5% 🟢) 0.433s 9 1.24x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.379s (-10.9% 🟢) 3.570s (-10.7% 🟢) 1.191s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.865s (-7.9% 🟢) 4.094s (-8.1% 🟢) 1.229s 8 1.20x
▲ Vercel Nitro 4.228s (+61.4% 🔺) 5.318s (+30.9% 🔺) 1.090s 6 1.78x

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

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.613s (~) 4.015s (~) 0.403s 8 1.00x
🐘 Postgres Express 3.619s (~) 4.014s (~) 0.395s 8 1.00x
💻 Local Nitro 7.776s (+1.1%) 8.017s (~) 0.241s 4 2.15x
💻 Local Express 8.626s (-2.9%) 9.021s (-2.7%) 0.395s 4 2.39x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.194s (+9.9% 🔺) 4.392s (+4.8%) 1.198s 7 1.00x
▲ Vercel Express 3.197s (+1.4%) 4.609s (-4.4%) 1.411s 7 1.00x
▲ Vercel Next.js (Turbopack) 3.983s (+13.5% 🔺) 4.991s (-1.7%) 1.008s 7 1.25x

🔍 Observability: Nitro | 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 🥇 Nitro 0.141s (+2.5%) 1.003s (~) 0.009s (-4.2%) 1.015s (~) 0.874s 10 1.00x
💻 Local Express 0.206s (+1.4%) 1.003s (~) 0.011s (-4.3%) 1.017s (~) 0.811s 10 1.46x
🐘 Postgres Express 0.217s (+6.3% 🔺) 0.998s (~) 0.002s (-21.1% 🟢) 1.013s (~) 0.796s 10 1.54x
🐘 Postgres Nitro 0.226s (-3.6%) 0.995s (-0.5%) 0.001s (~) 1.012s (~) 0.786s 10 1.60x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 1.559s (-6.6% 🟢) 2.666s (+10.1% 🔺) 0.005s (-98.9% 🟢) 3.124s (-8.8% 🟢) 1.564s 10 1.00x
▲ Vercel Express 1.698s (+7.3% 🔺) 2.837s (+15.2% 🔺) 0.006s (+5.2% 🔺) 3.344s (+10.5% 🔺) 1.646s 10 1.09x
▲ Vercel Next.js (Turbopack) 1.766s (+9.3% 🔺) 2.673s (+10.1% 🔺) 0.005s (+45.9% 🔺) 3.124s (+3.9%) 1.357s 10 1.13x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Nitro 12/12
🐘 Postgres Express 6/12
▲ Vercel Nitro 9/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 5/12
Next.js (Turbopack) ▲ Vercel 12/12
Nitro 💻 Local 5/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

@vercel
Copy link
Contributor

vercel bot commented Mar 19, 2026

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 prevents infinite queue retries caused by deployment mismatches (workflow/step removed or renamed) by turning “not found” conditions into run failures that the runtime can persist via run_failed events.

Changes:

  • Throw WorkflowRuntimeError when the workflow function can’t be resolved, so the runtime fails the run instead of retrying the queue message.
  • In the step queue handler, detect missing/non-function step handlers and immediately create a run_failed event with errorCode=RUNTIME_ERROR rather than throwing.
  • Update runWorkflow tests to assert the new error type/message for missing workflow functions.

Reviewed changes

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

File Description
packages/core/src/workflow.ts Converts “workflow not found” into WorkflowRuntimeError so runtime failure handling kicks in.
packages/core/src/runtime/step-handler.ts Fails runs via run_failed when the step function is missing/non-callable, avoiding queue retry loops.
packages/core/src/workflow.test.ts Updates assertions for the new workflow-not-found error type/message.

💡 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.

Comment on lines 706 to 715
if (typeof workflowFn !== 'function') {
throw new ReferenceError(
// Use WorkflowRuntimeError so this is caught and properly fails the run
// rather than bubbling up to the queue for infinite retries.
// A missing workflow function indicates a code deployment mismatch that
// retries won't fix.
throw new WorkflowRuntimeError(
`Workflow ${JSON.stringify(
workflowRun.workflowName
)} must be a function, but got "${typeof workflowFn}" instead`
)} not found. This usually means the workflow was removed or renamed in a newer deployment while the run was in progress.`
);
Comment on lines 100 to 150
// Validate step function exists before attempting to start it.
// A missing step function indicates a code deployment mismatch that
// retries won't fix, so we fail the run immediately.
const stepFn = getStepFunction(stepName);
if (!stepFn) {
throw new Error(`Step "${stepName}" not found`);
}
if (typeof stepFn !== 'function') {
throw new Error(
`Step "${stepName}" is not a function (got ${typeof stepFn})`
);
if (!stepFn || typeof stepFn !== 'function') {
const errorMessage = !stepFn
? `Step "${stepName}" not found. This usually means the step was removed or renamed in a newer deployment while the run was in progress.`
: `Step "${stepName}" is not a function (got ${typeof stepFn})`;

runtimeLogger.error('Fatal step lookup error, failing run', {
workflowRunId,
stepName,
error: errorMessage,
});

// Fail the run via event - this is a fatal condition that retries won't fix
try {
await world.events.create(
workflowRunId,
{
eventType: 'run_failed',
specVersion: SPEC_VERSION_CURRENT,
eventData: {
error: {
message: errorMessage,
stack: new Error(errorMessage).stack,
},
errorCode: RUN_ERROR_CODES.RUNTIME_ERROR,
},
},
{ requestId }
);
} catch (failErr) {
if (
EntityConflictError.is(failErr) ||
RunExpiredError.is(failErr)
) {
runtimeLogger.info(
'Tried failing run for missing step, but run has already finished.',
{
workflowRunId,
stepName,
message: failErr.message,
}
);
return;
}
throw failErr;
}
return;
}
@pranaygp pranaygp marked this pull request as draft March 19, 2026 18:32
Move step function validation after step_started and call step_failed directly if not found. Co-authored-by: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
Comment on lines +221 to +226
// Validate step function exists AFTER step_started so we can
// properly fail the step (not the run) if the function is missing.
// This allows the workflow to handle the step failure gracefully,
// similar to how FatalError is handled.
if (!stepFn || typeof stepFn !== 'function') {
const errorMessage = !stepFn
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we need to test this behavior

`Workflow ${JSON.stringify(
workflowRun.workflowName
)} must be a function, but got "${typeof workflowFn}" instead`
)} not found. This usually means the workflow was removed or renamed in a newer deployment while the run was in progress.`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
)} not found. This usually means the workflow was removed or renamed in a newer deployment while the run was in progress.`
)} must be a function but got "${typeof workflowFn}" instead. This usually means an attempt was made to start a workflow against a deployment that does not have the workflow registered`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

honestly we should probably have an error sling and and error doc explaining this. Troubleshooting this means that either

  • something went wrong with the bundling/build tooling that caused the workflow to not get build correctly
  • a run was started (ore restarted on the UI) to target a new deployment, but the the workflow was either renamed, or moved to a different directory and so it is no longer accessible
    • in this case, triggering a new deployment with the workflow moved back to the old location and name, and then triggering a "rerun on lates" against the run will cause it to work again

this stuff is too long for an error message and requires an error slug + doc

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

Labels

2 participants