Skip to content

feat: add HookConflictError for hook token conflicts#1448

Merged
pranaygp merged 2 commits intomainfrom
pgp/hook-conflict-error
Mar 19, 2026
Merged

feat: add HookConflictError for hook token conflicts#1448
pranaygp merged 2 commits 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: 5d654fe

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

@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 757 1 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 3436 57 446 3939

❌ Failed Tests

▲ Vercel Production (1 failed)

hono (1 failed):

🌍 Community Worlds (56 failed)

mongodb (3 failed):

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

redis (2 failed):

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

turso (51 failed):

  • addTenWorkflow | wrun_01KM3N513YD9Z17HEJ4BJFVR09
  • addTenWorkflow | wrun_01KM3N513YD9Z17HEJ4BJFVR09
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM3N6KA4JCDKA1HGRA0PNKSZ
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM3N57PQPXVDGZHQNBQSXDHG
  • promiseRaceWorkflow | wrun_01KM3N5B7KDRX5B337WT3EHR4P
  • promiseAnyWorkflow | wrun_01KM3N5EBQVD8S0BDD50V0BHAQ
  • importedStepOnlyWorkflow | wrun_01KM3N6Y5R1A3D1A1WPQW8J6Z5
  • hookWorkflow | wrun_01KM3N5VQB7BW1GSB4689QAY10
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM3N66D8CSX055T5XSDRQJXD
  • webhookWorkflow | wrun_01KM3N6EYM4PZN7EYH3XFW8N4C
  • sleepingWorkflow | wrun_01KM3N6N9K9C1J155H1W7A27PM
  • parallelSleepWorkflow | wrun_01KM3N70PD0PK0JWR31JXNHPHS
  • nullByteWorkflow | wrun_01KM3N750N4M33Z769036JE7P2
  • workflowAndStepMetadataWorkflow | wrun_01KM3N771DFE3MYSCBFPMGMGYW
  • fetchWorkflow | wrun_01KM3N864N1RAP5B97XHTYWN6E
  • promiseRaceStressTestWorkflow | wrun_01KM3N89QPSKPQRHCG346JPX2D
  • 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_01KM3NB51E3FVW3KA7SMWPTYR8
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM3NBS7DVA5QE256AQ09Q1N2
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM3NCDYXSHVJZ374KYW85HNZ
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM3ND2X9246KY4NA7TP5N08D
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM3NDBFVT6V50F25KRFHEMHN
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM3NDGSS0KCF7HN9Y0W1SDMK
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM3NDJXVGQWRPTK0AAJPSDZ4
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM3NE37QTZ1XAHPFQMJNC9YY
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM3NE8M8HXSD0FVXS76T2N4Q
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM3NEFCZZZYCH11PA2PNEQ5C
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM3NENZEC080FV6BZQ9EWWBP
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM3NEWCPWD0RHWEE320HPD20
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM3NF2TA0NP5X1KG0EPT70MQ
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM3NF95FP2014692Z1HMDH3S
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM3NFKWZSDG2TPG9T8VA4ZY7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM3NG10FM0W3BAB87AT0N8XK
  • cancelRun - cancelling a running workflow | wrun_01KM3NG7G2ATQJE9BF580QH1T0
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM3NGHR6ASEQJ00DKMXDXJ4V
  • 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_01KM3NGXVHDVW2G1CWW2ZCYG42
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM3NHJ0SD3DVW65JWMD8R11J
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM3NHW6AEG1H4MMRB2N0SCRP

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 67 1 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: failure
  • 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.044s (-32.8% 🟢) 1.005s (~) 0.962s 10 1.00x
💻 Local Express 0.044s (+1.1%) 1.005s (~) 0.961s 10 1.01x
💻 Local Next.js (Turbopack) 0.049s 1.005s 0.957s 10 1.12x
🌐 Redis Next.js (Turbopack) 0.056s 1.006s 0.950s 10 1.28x
🐘 Postgres Nitro 0.056s (-14.5% 🟢) 1.011s (~) 0.955s 10 1.29x
🐘 Postgres Next.js (Turbopack) 0.060s 1.012s 0.952s 10 1.38x
🐘 Postgres Express 0.068s (+26.9% 🔺) 1.013s (~) 0.945s 10 1.56x
🌐 MongoDB Next.js (Turbopack) 0.112s 1.008s 0.897s 10 2.56x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 0.486s (-17.8% 🟢) 2.731s (+5.3% 🔺) 2.245s 10 1.00x
▲ Vercel Next.js (Turbopack) 0.519s (-15.6% 🟢) 3.157s (+17.1% 🔺) 2.638s 10 1.07x
▲ Vercel Nitro 0.917s (+84.2% 🔺) 3.122s (+22.3% 🔺) 2.205s 10 1.89x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.118s 2.005s 0.887s 10 1.00x
🌐 Redis Next.js (Turbopack) 1.129s 2.007s 0.878s 10 1.01x
💻 Local Express 1.130s (~) 2.006s (~) 0.877s 10 1.01x
💻 Local Nitro 1.130s (~) 2.005s (~) 0.875s 10 1.01x
🐘 Postgres Next.js (Turbopack) 1.140s 2.013s 0.873s 10 1.02x
🐘 Postgres Nitro 1.149s (~) 2.012s (~) 0.864s 10 1.03x
🐘 Postgres Express 1.151s (+3.6%) 2.013s (~) 0.863s 10 1.03x
🌐 MongoDB Next.js (Turbopack) 1.335s 2.010s 0.674s 10 1.19x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.055s (-38.7% 🟢) 4.007s (-18.1% 🟢) 1.952s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.287s (+2.3%) 3.823s (-5.4% 🟢) 1.535s 10 1.11x
▲ Vercel Express 2.732s (+27.2% 🔺) 4.294s (+14.4% 🔺) 1.562s 10 1.33x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 10.739s 11.022s 0.283s 3 1.00x
💻 Local Next.js (Turbopack) 10.779s 11.024s 0.244s 3 1.00x
🐘 Postgres Nitro 10.922s (~) 11.040s (~) 0.118s 3 1.02x
💻 Local Express 10.924s (~) 11.023s (~) 0.098s 3 1.02x
💻 Local Nitro 10.926s (~) 11.023s (~) 0.097s 3 1.02x
🐘 Postgres Express 10.951s (+2.4%) 11.041s (~) 0.090s 3 1.02x
🐘 Postgres Next.js (Turbopack) 10.991s 11.372s 0.381s 3 1.02x
🌐 MongoDB Next.js (Turbopack) 12.288s 13.022s 0.734s 3 1.14x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 17.979s (~) 20.154s (+4.5%) 2.175s 2 1.00x
▲ Vercel Express 18.146s (+3.6%) 20.134s (+4.4%) 1.988s 2 1.01x
▲ Vercel Nitro 33.030s (+87.0% 🔺) 34.435s (+79.3% 🔺) 1.405s 1 1.84x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 26.783s 27.052s 0.269s 3 1.00x
🐘 Postgres Next.js (Turbopack) 27.062s 27.735s 0.673s 3 1.01x
🐘 Postgres Nitro 27.158s (~) 28.057s (~) 0.899s 3 1.01x
💻 Local Next.js (Turbopack) 27.195s 28.053s 0.857s 3 1.02x
🐘 Postgres Express 27.321s (+2.5%) 28.069s (+3.7%) 0.748s 3 1.02x
💻 Local Express 27.457s (~) 28.052s (~) 0.595s 3 1.03x
💻 Local Nitro 27.480s (~) 28.051s (~) 0.571s 3 1.03x
🌐 MongoDB Next.js (Turbopack) 30.596s 31.050s 0.454s 2 1.14x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 44.011s (-4.3%) 45.987s (-3.7%) 1.976s 2 1.00x
▲ Vercel Express 44.317s (-4.3%) 46.054s (-4.1%) 1.737s 2 1.01x
▲ Vercel Next.js (Turbopack) 45.949s (-3.9%) 47.683s (-5.6% 🟢) 1.734s 2 1.04x

🔍 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.453s 54.100s 0.647s 2 1.00x
🐘 Postgres Next.js (Turbopack) 54.047s 54.109s 0.062s 2 1.01x
🐘 Postgres Nitro 54.200s (~) 55.092s (~) 0.892s 2 1.01x
🐘 Postgres Express 54.543s (+2.4%) 55.098s (+1.8%) 0.555s 2 1.02x
💻 Local Next.js (Turbopack) 55.977s 56.102s 0.125s 2 1.05x
💻 Local Express 56.489s (~) 57.102s (~) 0.613s 2 1.06x
💻 Local Nitro 56.580s (~) 57.103s (~) 0.523s 2 1.06x
🌐 MongoDB Next.js (Turbopack) 60.961s 61.081s 0.120s 2 1.14x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 96.979s (-1.8%) 98.150s (-1.9%) 1.171s 1 1.00x
▲ Vercel Next.js (Turbopack) 107.691s (+6.0% 🔺) 109.555s (+5.7% 🔺) 1.864s 1 1.11x
▲ Vercel Express 110.377s (+9.6% 🔺) 111.893s (+9.2% 🔺) 1.516s 1 1.14x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.254s 2.011s 0.757s 15 1.00x
🐘 Postgres Nitro 1.286s (+0.5%) 2.011s (~) 0.725s 15 1.02x
🐘 Postgres Express 1.298s (+8.5% 🔺) 2.011s (~) 0.713s 15 1.04x
🌐 Redis Next.js (Turbopack) 1.325s 2.007s 0.681s 15 1.06x
💻 Local Express 1.496s (-0.7%) 2.006s (~) 0.510s 15 1.19x
💻 Local Nitro 1.514s (-1.5%) 2.006s (~) 0.492s 15 1.21x
💻 Local Next.js (Turbopack) 1.544s 2.006s 0.462s 15 1.23x
🌐 MongoDB Next.js (Turbopack) 2.180s 3.010s 0.830s 10 1.74x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.261s (-1.6%) 3.651s (-8.6% 🟢) 1.389s 9 1.00x
▲ Vercel Nitro 2.578s (-2.3%) 4.243s (~) 1.665s 8 1.14x
▲ Vercel Next.js (Turbopack) 2.605s (+9.9% 🔺) 4.069s (+7.1% 🔺) 1.464s 8 1.15x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.482s (+5.4% 🔺) 3.012s (~) 0.530s 10 1.00x
🐘 Postgres Next.js (Turbopack) 2.489s 3.012s 0.524s 10 1.00x
🐘 Postgres Nitro 2.526s (+1.9%) 3.113s (+3.3%) 0.587s 10 1.02x
🌐 Redis Next.js (Turbopack) 2.574s 3.008s 0.435s 10 1.04x
💻 Local Express 2.901s (+4.4%) 3.108s (~) 0.207s 10 1.17x
💻 Local Next.js (Turbopack) 2.934s 3.342s 0.408s 9 1.18x
💻 Local Nitro 3.093s (+0.9%) 3.760s (~) 0.667s 8 1.25x
🌐 MongoDB Next.js (Turbopack) 4.760s 5.177s 0.417s 6 1.92x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.837s (-24.0% 🟢) 4.152s (-20.8% 🟢) 1.315s 8 1.00x
▲ Vercel Nitro 2.925s (+6.3% 🔺) 4.326s (-4.8%) 1.402s 7 1.03x
▲ Vercel Next.js (Turbopack) 3.333s (+23.1% 🔺) 4.733s (+14.2% 🔺) 1.400s 7 1.17x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.616s (~) 4.013s (~) 0.397s 8 1.00x
🐘 Postgres Express 3.624s (+2.9%) 4.015s (~) 0.390s 8 1.00x
🐘 Postgres Next.js (Turbopack) 3.797s 4.016s 0.218s 8 1.05x
🌐 Redis Next.js (Turbopack) 4.168s 5.011s 0.843s 6 1.15x
💻 Local Express 7.796s (+3.4%) 8.020s (~) 0.224s 4 2.16x
💻 Local Nitro 8.051s (+0.7%) 8.521s (-2.9%) 0.470s 4 2.23x
💻 Local Next.js (Turbopack) 8.057s 8.767s 0.709s 4 2.23x
🌐 MongoDB Next.js (Turbopack) 10.096s 10.684s 0.588s 3 2.79x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.991s (-21.5% 🟢) 4.384s (-15.8% 🟢) 1.393s 7 1.00x
▲ Vercel Nitro 3.446s (-17.4% 🟢) 5.038s (-7.8% 🟢) 1.593s 7 1.15x
▲ Vercel Next.js (Turbopack) 3.684s (+12.1% 🔺) 5.394s (+6.0% 🔺) 1.710s 6 1.23x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Next.js (Turbopack) 1.260s 2.012s 0.752s 15 1.00x
🐘 Postgres Nitro 1.278s (-0.5%) 2.011s (~) 0.734s 15 1.01x
🐘 Postgres Express 1.287s (+7.4% 🔺) 2.011s (~) 0.724s 15 1.02x
🌐 Redis Next.js (Turbopack) 1.318s 2.007s 0.688s 15 1.05x
💻 Local Express 1.504s (-0.9%) 2.006s (~) 0.501s 15 1.19x
💻 Local Next.js (Turbopack) 1.521s 2.006s 0.485s 15 1.21x
💻 Local Nitro 1.558s (+2.0%) 2.005s (~) 0.447s 15 1.24x
🌐 MongoDB Next.js (Turbopack) 2.204s 3.009s 0.805s 10 1.75x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.144s (-10.3% 🟢) 3.557s (-12.8% 🟢) 1.413s 9 1.00x
▲ Vercel Nitro 2.509s (+2.0%) 4.112s (-5.8% 🟢) 1.603s 8 1.17x
▲ Vercel Next.js (Turbopack) 2.605s (+11.4% 🔺) 4.155s (+10.0% 🔺) 1.550s 8 1.22x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.446s (+4.5%) 3.012s (~) 0.566s 10 1.00x
🐘 Postgres Next.js (Turbopack) 2.471s 3.012s 0.542s 10 1.01x
🐘 Postgres Nitro 2.481s (+1.0%) 3.011s (~) 0.530s 10 1.01x
🌐 Redis Next.js (Turbopack) 2.712s 3.208s 0.496s 10 1.11x
💻 Local Next.js (Turbopack) 2.807s 3.453s 0.647s 9 1.15x
💻 Local Nitro 2.917s (-7.1% 🟢) 3.342s (-14.0% 🟢) 0.425s 9 1.19x
💻 Local Express 3.083s (+6.3% 🔺) 3.761s (+21.0% 🔺) 0.678s 8 1.26x
🌐 MongoDB Next.js (Turbopack) 4.804s 5.346s 0.542s 6 1.96x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.689s (+10.9% 🔺) 3.783s (-8.0% 🟢) 1.093s 8 1.00x
▲ Vercel Nitro 2.898s (+21.4% 🔺) 4.412s (+6.9% 🔺) 1.514s 7 1.08x
▲ Vercel Next.js (Turbopack) 2.958s (-8.9% 🟢) 4.446s (-14.7% 🟢) 1.487s 7 1.10x

🔍 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 🥇 Nitro 3.595s (-0.7%) 4.014s (~) 0.419s 8 1.00x
🐘 Postgres Express 3.615s (+2.0%) 4.013s (~) 0.398s 8 1.01x
🐘 Postgres Next.js (Turbopack) 3.799s 4.014s 0.215s 8 1.06x
🌐 Redis Next.js (Turbopack) 4.184s 5.011s 0.827s 6 1.16x
💻 Local Next.js (Turbopack) 7.678s 8.268s 0.590s 4 2.14x
💻 Local Express 8.550s (+8.8% 🔺) 9.021s (+2.9%) 0.471s 4 2.38x
💻 Local Nitro 9.454s (+7.9% 🔺) 10.028s (+8.2% 🔺) 0.574s 3 2.63x
🌐 MongoDB Next.js (Turbopack) 10.201s 10.682s 0.481s 3 2.84x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.805s (~) 3.864s (-9.3% 🟢) 1.058s 8 1.00x
▲ Vercel Next.js (Turbopack) 3.448s (-11.4% 🟢) 5.058s (-8.3% 🟢) 1.610s 6 1.23x
▲ Vercel Express 3.478s (+19.4% 🔺) 4.825s (+3.9%) 1.347s 7 1.24x

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

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.012s 1.017s 0.843s 10 1.00x
🌐 Redis Next.js (Turbopack) 0.177s 1.000s 0.002s 1.007s 0.830s 10 1.02x
💻 Local Express 0.196s (+2.5%) 1.003s (~) 0.011s (+8.5% 🔺) 1.017s (~) 0.821s 10 1.12x
💻 Local Nitro 0.202s (-1.5%) 1.003s (~) 0.011s (-11.0% 🟢) 1.016s (~) 0.815s 10 1.16x
🐘 Postgres Next.js (Turbopack) 0.208s 1.002s 0.002s 1.013s 0.805s 10 1.19x
🐘 Postgres Nitro 0.219s (-3.1%) 0.994s (~) 0.002s (+6.7% 🔺) 1.013s (~) 0.794s 10 1.26x
🐘 Postgres Express 0.228s (+40.8% 🔺) 0.994s (-0.6%) 0.001s (-6.7% 🟢) 1.013s (~) 0.786s 10 1.30x
🌐 MongoDB Next.js (Turbopack) 0.515s 0.942s 0.002s 1.010s 0.494s 10 2.96x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 1.688s (~) 2.744s (+8.5% 🔺) 0.005s (+8.5% 🔺) 3.353s (+7.1% 🔺) 1.664s 10 1.00x
▲ Vercel Express 1.903s (-8.6% 🟢) 2.930s (+12.8% 🔺) 0.004s (-21.2% 🟢) 3.626s (~) 1.723s 10 1.13x
▲ Vercel Nitro 2.097s (+29.2% 🔺) 2.951s (+29.5% 🔺) 0.005s (+17.8% 🔺) 3.602s (+22.4% 🔺) 1.505s 10 1.24x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 6/12
Next.js (Turbopack) 🐘 Postgres 4/12
Nitro 🐘 Postgres 7/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]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch — switched to HookConflictError.is(error) which handles cross-VM/realm boundaries correctly.

The .is() static method handles cross-VM/realm boundaries where
instanceof can be unreliable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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