Skip to content

feat: add HookConflictError for hook token conflicts#1448

Open
pranaygp wants to merge 1 commit intomainfrom
pgp/hook-conflict-error
Open

feat: add HookConflictError for hook token conflicts#1448
pranaygp wants to merge 1 commit intomainfrom
pgp/hook-conflict-error

Conversation

@pranaygp
Copy link
Collaborator

Summary

  • Add a dedicated HookConflictError class in @workflow/errors for hook token conflicts, replacing the generic WorkflowRuntimeError
  • HookConflictError extends WorkflowError (not WorkflowRuntimeError), so it correctly classifies as USER_ERROR rather than RUNTIME_ERROR — duplicate tokens are a user mistake, not an infrastructure issue
  • The error exposes a token property so users can programmatically access the conflicting token
  • Update docs in errors/hook-conflict.mdx to reference the new error type

Test plan

  • cd packages/core && pnpm test — all 473 tests pass
  • pnpm test:docs — all docs typecheck passes
  • pnpm build — all 27 packages build
  • New test in classify-error.test.ts confirms HookConflictError classifies as USER_ERROR
  • Updated assertions in hook.test.ts and workflow.test.ts

🤖 Generated with Claude Code

Replace WorkflowRuntimeError with a dedicated HookConflictError class
for hook token conflicts. This correctly classifies the error as a
USER_ERROR (duplicate token is a user mistake) rather than a
RUNTIME_ERROR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pranaygp pranaygp requested a review from a team as a code owner March 19, 2026 01:00
Copilot AI review requested due to automatic review settings March 19, 2026 01:00
@changeset-bot
Copy link

changeset-bot bot commented Mar 19, 2026

🦋 Changeset detected

Latest commit: b4a41cd

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

This PR includes changesets to release 20 packages
Name Type
@workflow/errors Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
workflow Patch
@workflow/world-local Patch
@workflow/world-postgres Patch
@workflow/world-vercel Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/world-testing Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/ai 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 Mar 19, 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 Mar 19, 2026 1:02am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Mar 19, 2026 1:02am
example-workflow Ready Ready Preview, Comment Mar 19, 2026 1:02am
workbench-astro-workflow Ready Ready Preview, Comment Mar 19, 2026 1:02am
workbench-express-workflow Ready Ready Preview, Comment Mar 19, 2026 1:02am
workbench-fastify-workflow Ready Ready Preview, Comment Mar 19, 2026 1:02am
workbench-hono-workflow Ready Ready Preview, Comment Mar 19, 2026 1:02am
workbench-nitro-workflow Ready Ready Preview, Comment Mar 19, 2026 1:02am
workbench-nuxt-workflow Ready Ready Preview, Comment Mar 19, 2026 1:02am
workbench-sveltekit-workflow Ready Ready Preview, Comment Mar 19, 2026 1:02am
workbench-vite-workflow Ready Ready Preview, Comment Mar 19, 2026 1:02am
workflow-docs Ready Ready Preview, Comment, Open in v0 Mar 19, 2026 1:02am
workflow-nest Ready Ready Preview, Comment Mar 19, 2026 1:02am
workflow-swc-playground Ready Ready Preview, Comment Mar 19, 2026 1:02am

@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 756 2 67 825
✅ 💻 Local Development 782 0 118 900
✅ 📦 Local Production 782 0 118 900
❌ 🐘 Local Postgres 781 1 118 900
✅ 🪟 Windows 72 0 3 75
❌ 🌍 Community Worlds 119 55 15 189
✅ 📋 Other 198 0 27 225
Total 3490 58 466 4014

❌ Failed Tests

▲ Vercel Production (2 failed)

nextjs-webpack (1 failed):

sveltekit (1 failed):

🐘 Local Postgres (1 failed)

hono-stable (1 failed):

  • webhookWorkflow | wrun_01KM1SV1WCT7H2CX0KH9KRTPDB
🌍 Community Worlds (55 failed)

mongodb (2 failed):

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

redis (2 failed):

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

turso (51 failed):

  • addTenWorkflow | wrun_01KM1SSRKAT5SSYW13YZE4F6VZ
  • addTenWorkflow | wrun_01KM1SSRKAT5SSYW13YZE4F6VZ
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM1SWASGS486ETHEA8BXA3K3
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM1SSYN7B0S7VFXXDMJW3BH6
  • promiseRaceWorkflow | wrun_01KM1ST1QJF321JDSPG8JDESKV
  • promiseAnyWorkflow | wrun_01KM1ST3NA7D3ZM5YRQ292KHDC
  • importedStepOnlyWorkflow | wrun_01KM1SWNX8EENH8JZGN2HS997G
  • hookWorkflow | wrun_01KM1STFK03B0HMRQGD8NDEE5Z
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM1STSDK5WB3N9TZM6ZARNDG
  • webhookWorkflow | wrun_01KM1SV1WCT7H2CX0KH9KRTPDB
  • sleepingWorkflow | wrun_01KM1SV7MBP0MVNF8QH7P1PR6Y
  • parallelSleepWorkflow | wrun_01KM1SVKR5V7225PGWAA6MTBA6
  • nullByteWorkflow | wrun_01KM1SVPSEHRGXQ5TT3BGQ3520
  • workflowAndStepMetadataWorkflow | wrun_01KM1SVRTG903TY8FRE2MB6B87
  • fetchWorkflow | wrun_01KM1SWN1MAS1CGM668NZCQSB7
  • promiseRaceStressTestWorkflow | wrun_01KM1SWR46K10A2WEAB8SW6V9S
  • 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_01KM1SZGF154T6V64YB252G2QH
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM1T03Q00NRY81C59WGPA25D
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM1T0P6J8PGBE8GQ8W1SGXD3
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM1T18JNGVRY9568EGNKZB4H
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM1T1GT7X64H9MA46F96D5SP
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM1T1P0AQZQKD391CKZW21X7
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM1T1R3XHZ9AJX0ZF1TF2Z2F
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM1T26CXMSVHB83BRYE617DK
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM1T2BFEDG9PB0SNQF0NZEEH
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM1T2HHJMJET8GQDK2FCQ7WB
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM1T2QMPCNEQ3R1D9Y3RY828
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM1T2XMMMBDBFKM3XTMQMA7X
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM1T33SD64GMYGQSN8Z59N1H
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM1T39R9ZETKFXG0CKQ5N84N
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM1T3KHSCYEQQ906HWNKVVRW
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM1T3VWFTMSMA26HA5JGE8TZ
  • cancelRun - cancelling a running workflow | wrun_01KM1T421XG8070RX8R32NZQTN
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM1T4B0D4GB354MW1NZ0VYR5
  • 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_01KM1T4PJT36128WHA2XW6ESC0
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM1T59DNM194B8VM17MFVX06
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM1T5MJDG7KBEFA9MWWN0MS7

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 72 1 2
✅ nitro 68 0 7
✅ nuxt 68 0 7
❌ sveltekit 67 1 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-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 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 65 1 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 53 2 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: 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 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 🥇 Express 0.042s (+6.8% 🔺) 1.005s (~) 0.963s 10 1.00x
💻 Local Nitro 0.048s (+11.2% 🔺) 1.005s (~) 0.958s 10 1.13x
💻 Local Next.js (Turbopack) 0.049s 1.005s 0.956s 10 1.15x
🌐 Redis Next.js (Turbopack) 0.055s (-4.0%) 1.005s (~) 0.951s 10 1.29x
🐘 Postgres Next.js (Turbopack) 0.059s 1.012s 0.953s 10 1.40x
🐘 Postgres Nitro 0.060s (-5.0% 🟢) 1.011s (~) 0.951s 10 1.43x
🐘 Postgres Express 0.064s (+2.7%) 1.011s (~) 0.947s 10 1.51x
🌐 MongoDB Next.js (Turbopack) 0.101s 1.008s 0.907s 10 2.39x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.437s (-5.1% 🟢) 1.999s (-5.5% 🟢) 1.562s 10 1.00x
▲ Vercel Express 0.474s (-13.7% 🟢) 2.254s (-2.9%) 1.780s 10 1.09x
▲ Vercel Next.js (Turbopack) 0.501s (-32.1% 🟢) 2.374s (-12.9% 🟢) 1.873s 10 1.15x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.117s 2.006s 0.888s 10 1.00x
💻 Local Nitro 1.126s (~) 2.006s (~) 0.880s 10 1.01x
💻 Local Express 1.129s (+2.8%) 2.006s (~) 0.877s 10 1.01x
🌐 Redis Next.js (Turbopack) 1.129s (~) 2.007s (~) 0.877s 10 1.01x
🐘 Postgres Next.js (Turbopack) 1.149s 2.014s 0.865s 10 1.03x
🐘 Postgres Express 1.154s (+0.7%) 2.013s (~) 0.859s 10 1.03x
🐘 Postgres Nitro 1.158s (+0.6%) 2.012s (~) 0.853s 10 1.04x
🌐 MongoDB Next.js (Turbopack) 1.323s 2.009s 0.685s 10 1.18x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.067s (+0.8%) 3.421s (+6.3% 🔺) 1.354s 10 1.00x
▲ Vercel Express 2.136s (+1.1%) 3.587s (-2.5%) 1.451s 10 1.03x
▲ Vercel Next.js (Turbopack) 2.234s (+3.8%) 3.743s (-1.1%) 1.509s 10 1.08x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 10.762s 11.023s 0.261s 3 1.00x
🌐 Redis Next.js (Turbopack) 10.801s (~) 11.024s (~) 0.223s 3 1.00x
💻 Local Express 10.900s (+2.3%) 11.024s (~) 0.123s 3 1.01x
💻 Local Nitro 10.911s (~) 11.023s (~) 0.113s 3 1.01x
🐘 Postgres Next.js (Turbopack) 10.912s 11.041s 0.129s 3 1.01x
🐘 Postgres Nitro 10.926s (~) 11.040s (~) 0.114s 3 1.02x
🐘 Postgres Express 11.005s (+0.6%) 11.378s (+3.0%) 0.373s 3 1.02x
🌐 MongoDB Next.js (Turbopack) 12.368s 13.023s 0.655s 3 1.15x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 17.033s (-3.6%) 18.593s (~) 1.560s 2 1.00x
▲ Vercel Express 17.099s (-1.1%) 18.571s (-1.1%) 1.472s 2 1.00x
▲ Vercel Next.js (Turbopack) 17.242s (+1.6%) 18.721s (~) 1.479s 2 1.01x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 26.864s (~) 27.054s (~) 0.190s 3 1.00x
🐘 Postgres Nitro 27.152s (~) 28.060s (~) 0.908s 3 1.01x
💻 Local Next.js (Turbopack) 27.155s 28.053s 0.897s 3 1.01x
🐘 Postgres Express 27.239s (~) 28.066s (~) 0.827s 3 1.01x
🐘 Postgres Next.js (Turbopack) 27.249s 28.069s 0.819s 3 1.01x
💻 Local Nitro 27.491s (~) 28.052s (~) 0.561s 3 1.02x
💻 Local Express 27.514s (+2.6%) 28.053s (+3.7%) 0.539s 3 1.02x
🌐 MongoDB Next.js (Turbopack) 30.520s 31.046s 0.526s 2 1.14x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 44.423s (-1.4%) 45.572s (-1.6%) 1.149s 2 1.00x
▲ Vercel Express 44.913s (~) 46.060s (~) 1.147s 2 1.01x
▲ Vercel Next.js (Turbopack) 45.929s (+2.0%) 47.794s (+0.8%) 1.865s 2 1.03x

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

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 53.388s (~) 54.098s (~) 0.710s 2 1.00x
🐘 Postgres Next.js (Turbopack) 54.127s 54.609s 0.482s 2 1.01x
🐘 Postgres Express 54.398s (~) 55.104s (~) 0.705s 2 1.02x
🐘 Postgres Nitro 54.446s (~) 55.107s (~) 0.661s 2 1.02x
💻 Local Next.js (Turbopack) 55.926s 56.101s 0.175s 2 1.05x
💻 Local Nitro 56.696s (~) 57.099s (~) 0.403s 2 1.06x
💻 Local Express 56.715s (+3.1%) 57.105s (+3.6%) 0.389s 2 1.06x
🌐 MongoDB Next.js (Turbopack) 60.976s 61.083s 0.107s 2 1.14x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 93.682s (-2.6%) 95.743s (-1.8%) 2.061s 1 1.00x
▲ Vercel Nitro 94.538s (-9.2% 🟢) 95.924s (-8.9% 🟢) 1.386s 1 1.01x
▲ Vercel Next.js (Turbopack) 98.171s (+3.2%) 99.669s (+2.6%) 1.498s 1 1.05x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.282s 2.014s 0.732s 15 1.00x
🐘 Postgres Express 1.285s (+0.5%) 2.011s (~) 0.726s 15 1.00x
🐘 Postgres Nitro 1.289s (+0.9%) 2.011s (~) 0.723s 15 1.01x
🌐 Redis Next.js (Turbopack) 1.299s (-5.5% 🟢) 2.006s (~) 0.707s 15 1.01x
💻 Local Express 1.520s (+4.4%) 2.005s (~) 0.485s 15 1.19x
💻 Local Nitro 1.531s (~) 2.005s (~) 0.474s 15 1.19x
💻 Local Next.js (Turbopack) 1.549s 2.006s 0.457s 15 1.21x
🌐 MongoDB Next.js (Turbopack) 2.178s 3.008s 0.831s 10 1.70x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.353s (-3.2%) 3.441s (+2.9%) 1.088s 9 1.00x
▲ Vercel Express 2.545s (+6.2% 🔺) 3.825s (+1.7%) 1.280s 8 1.08x
▲ Vercel Next.js (Turbopack) 2.721s (+11.3% 🔺) 4.260s (+6.4% 🔺) 1.539s 8 1.16x

🔍 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.461s (~) 3.014s (~) 0.553s 10 1.00x
🐘 Postgres Express 2.476s (+0.9%) 3.013s (~) 0.537s 10 1.01x
🐘 Postgres Next.js (Turbopack) 2.574s 3.015s 0.441s 10 1.05x
🌐 Redis Next.js (Turbopack) 2.601s (+1.1%) 3.008s (~) 0.407s 10 1.06x
💻 Local Express 2.918s (+12.1% 🔺) 3.208s (+6.7% 🔺) 0.290s 10 1.19x
💻 Local Next.js (Turbopack) 2.928s 3.208s 0.280s 10 1.19x
💻 Local Nitro 3.029s (+5.5% 🔺) 3.564s (+18.5% 🔺) 0.535s 9 1.23x
🌐 MongoDB Next.js (Turbopack) 4.710s 5.178s 0.468s 6 1.91x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.291s (-14.8% 🟢) 3.174s (-12.5% 🟢) 0.884s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.862s (+13.4% 🔺) 4.322s (+7.7% 🔺) 1.459s 8 1.25x
▲ Vercel Express 3.085s (+29.5% 🔺) 4.436s (+14.4% 🔺) 1.351s 8 1.35x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.615s (~) 4.014s (~) 0.399s 8 1.00x
🐘 Postgres Nitro 3.619s (~) 4.014s (~) 0.395s 8 1.00x
🐘 Postgres Next.js (Turbopack) 3.900s 4.144s 0.245s 8 1.08x
🌐 Redis Next.js (Turbopack) 4.194s (+2.0%) 5.011s (+2.9%) 0.817s 6 1.16x
💻 Local Next.js (Turbopack) 7.371s 8.015s 0.645s 4 2.04x
💻 Local Nitro 7.981s (-1.5%) 8.770s (-2.8%) 0.789s 4 2.21x
💻 Local Express 8.203s (+20.8% 🔺) 9.021s (+28.6% 🔺) 0.818s 4 2.27x
🌐 MongoDB Next.js (Turbopack) 10.080s 10.685s 0.605s 3 2.79x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.885s (-44.6% 🟢) 4.810s (-28.1% 🟢) 1.925s 7 1.00x
▲ Vercel Next.js (Turbopack) 3.059s (-0.8%) 4.729s (+0.8%) 1.669s 7 1.06x
▲ Vercel Nitro 3.164s (+16.9% 🔺) 4.644s (+19.2% 🔺) 1.481s 7 1.10x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.265s (-0.8%) 2.010s (~) 0.745s 15 1.00x
🐘 Postgres Nitro 1.287s (+1.1%) 2.011s (~) 0.724s 15 1.02x
🐘 Postgres Next.js (Turbopack) 1.302s 2.012s 0.709s 15 1.03x
🌐 Redis Next.js (Turbopack) 1.331s (+1.6%) 2.006s (~) 0.676s 15 1.05x
💻 Local Nitro 1.511s (-1.5%) 2.005s (~) 0.494s 15 1.19x
💻 Local Express 1.522s (+4.1%) 2.006s (~) 0.484s 15 1.20x
💻 Local Next.js (Turbopack) 1.563s 2.005s 0.442s 15 1.24x
🌐 MongoDB Next.js (Turbopack) 2.158s 3.009s 0.851s 10 1.71x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.048s (-24.0% 🟢) 3.008s (-24.2% 🟢) 0.960s 10 1.00x
▲ Vercel Express 2.134s (-6.2% 🟢) 3.491s (-7.9% 🟢) 1.357s 9 1.04x
▲ Vercel Next.js (Turbopack) 2.252s (-3.3%) 3.775s (-0.5%) 1.522s 9 1.10x

🔍 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 🥇 Express 2.441s (-0.5%) 3.011s (~) 0.570s 10 1.00x
🐘 Postgres Nitro 2.472s (+1.0%) 3.012s (~) 0.541s 10 1.01x
🐘 Postgres Next.js (Turbopack) 2.559s 3.014s 0.455s 10 1.05x
🌐 Redis Next.js (Turbopack) 2.643s (+3.6%) 3.109s (+3.3%) 0.466s 10 1.08x
💻 Local Next.js (Turbopack) 2.922s 3.758s 0.836s 8 1.20x
💻 Local Nitro 2.950s (-0.7%) 3.453s (~) 0.503s 9 1.21x
💻 Local Express 2.969s (+7.2% 🔺) 3.567s (+14.8% 🔺) 0.598s 9 1.22x
🌐 MongoDB Next.js (Turbopack) 4.691s 5.177s 0.485s 6 1.92x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.273s (-11.3% 🟢) 3.302s (-8.8% 🟢) 1.029s 10 1.00x
▲ Vercel Express 2.382s (+3.2%) 3.655s (~) 1.273s 9 1.05x
▲ Vercel Next.js (Turbopack) 2.715s (-8.1% 🟢) 4.018s (-7.2% 🟢) 1.303s 8 1.19x

🔍 Observability: Nitro | 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.602s (~) 4.014s (~) 0.412s 8 1.00x
🐘 Postgres Nitro 3.607s (~) 4.014s (~) 0.407s 8 1.00x
🐘 Postgres Next.js (Turbopack) 3.755s 4.014s 0.259s 8 1.04x
🌐 Redis Next.js (Turbopack) 4.236s (+1.7%) 5.011s (+2.9%) 0.775s 6 1.18x
💻 Local Next.js (Turbopack) 7.652s 8.518s 0.866s 4 2.12x
💻 Local Nitro 8.671s (+1.2%) 9.020s (~) 0.350s 4 2.41x
💻 Local Express 8.774s (+21.0% 🔺) 9.022s (+16.2% 🔺) 0.248s 4 2.44x
🌐 MongoDB Next.js (Turbopack) 9.972s 10.684s 0.711s 3 2.77x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.705s (-26.5% 🟢) 3.922s (-19.7% 🟢) 1.217s 8 1.00x
▲ Vercel Express 3.163s (+19.6% 🔺) 4.733s (+25.8% 🔺) 1.570s 8 1.17x
▲ Vercel Next.js (Turbopack) 3.689s (+14.7% 🔺) 5.261s (+13.8% 🔺) 1.571s 6 1.36x

🔍 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 🥇 Next.js (Turbopack) 0.174s 1.002s 0.011s 1.017s 0.843s 10 1.00x
🌐 Redis Next.js (Turbopack) 0.179s (-1.6%) 1.000s (~) 0.002s (-11.8% 🟢) 1.008s (~) 0.829s 10 1.03x
💻 Local Express 0.198s (+43.6% 🔺) 1.003s (~) 0.012s (+11.5% 🔺) 1.017s (~) 0.819s 10 1.14x
💻 Local Nitro 0.199s (+1.3%) 1.003s (~) 0.011s (-3.4%) 1.017s (~) 0.818s 10 1.15x
🐘 Postgres Express 0.220s (~) 0.997s (~) 0.002s (-6.3% 🟢) 1.013s (~) 0.793s 10 1.27x
🐘 Postgres Nitro 0.236s (+8.5% 🔺) 0.993s (-0.7%) 0.002s (+33.3% 🔺) 1.013s (~) 0.777s 10 1.36x
🐘 Postgres Next.js (Turbopack) 0.253s 1.001s 0.002s 1.016s 0.763s 10 1.45x
🌐 MongoDB Next.js (Turbopack) 0.509s 0.942s 0.001s 1.009s 0.500s 10 2.93x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 1.595s (-1.6%) 2.329s (-16.2% 🟢) 0.004s (-6.7% 🟢) 2.844s (-14.7% 🟢) 1.249s 10 1.00x
▲ Vercel Next.js (Turbopack) 1.613s (~) 2.851s (+11.5% 🔺) 0.005s (-73.4% 🟢) 3.416s (+9.2% 🔺) 1.802s 10 1.01x
▲ Vercel Nitro 1.793s (+10.6% 🔺) 2.796s (+16.3% 🔺) 0.006s (+19.3% 🔺) 3.364s (-77.4% 🟢) 1.571s 10 1.12x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Next.js (Turbopack) 8/12
🐘 Postgres Next.js (Turbopack) 5/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) 💻 Local 4/12
Nitro 💻 Local 4/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 a dedicated, user-classified error type for hook token conflicts and updates core/tests/docs to use it instead of a generic runtime error.

Changes:

  • Introduce HookConflictError in @workflow/errors (extends WorkflowError) and include the conflicting token.
  • Switch hook conflict handling in core to throw HookConflictError and update related tests/assertions.
  • Update hook-conflict docs to reference the new error type and add changesets for release.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/errors/src/index.ts Adds HookConflictError (with token property) and slug for docs linking.
packages/core/src/workflow/hook.ts Throws HookConflictError on hook_conflict events instead of WorkflowRuntimeError.
packages/core/src/workflow/hook.test.ts Updates expectations to assert HookConflictError.
packages/core/src/workflow.test.ts Updates workflow runtime tests to assert HookConflictError on conflicts.
packages/core/src/classify-error.test.ts Adds a regression test ensuring HookConflictError classifies as USER_ERROR.
docs/content/docs/errors/hook-conflict.mdx Updates troubleshooting guidance to reference/catch HookConflictError and show token.
.changeset/add-hook-conflict-error.md Declares patch releases for @workflow/errors and @workflow/core.

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

return { success: true, payment };
} catch (error) {
if (error instanceof WorkflowRuntimeError && error.message.includes("hook-conflict")) { // [!code highlight]
if (error instanceof HookConflictError) { // [!code highlight]
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