Skip to content

Fix Nitro Vercel workflow routes#2645

Draft
NathanColosimo wants to merge 3 commits into
stablefrom
codex/issue-2460-repro-stable
Draft

Fix Nitro Vercel workflow routes#2645
NathanColosimo wants to merge 3 commits into
stablefrom
codex/issue-2460-repro-stable

Conversation

@NathanColosimo

@NathanColosimo NathanColosimo commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the Nitro Vercel Build Output shape for Workflow apps on stable.

Issue #2460 happens when Nitro's Vercel preset emits the public Workflow HTTP endpoints as routes into Nitro's server function while Workflow also needs real queue-triggered functions for flow/step execution. If those generated function entries are left as Nitro aliases instead of Workflow queue functions, the deployment has the wrong runtime shape for Workflow's queue-triggered execution model.

This PR keeps the public Workflow HTTP endpoints on Nitro's generated server function, while ensuring the flow/step workers are emitted as real Workflow queue-trigger functions.

Concretely, the Nitro Vercel builder now:

  • reads Nitro's generated .vercel/output/config.json
  • finds the generated Nitro server function (__server.func or __fallback.func)
  • removes Nitro's workflow function alias directories
  • lets the shared Workflow builder emit real flow/step queue-trigger functions
  • prepends the Workflow HTTP routes to Nitro's server function destination before filesystem

It also keeps stable compatible with current Nitro 3 beta releases by:

  • moving generated .nitro/workflow/** dev handling into a small compatibility path that both ignores those files for dev reloads and preserves the old Nitro alpha externalization behavior needed by stable CI
  • updating the Postgres Nitro workbench plugin to import definePlugin from Nitro's public runtime export instead of the removed private nitro/~internal/runtime/plugin path

Fixes #2460.

Verification

Targeted local checks on this branch:

  • pnpm exec biome check packages/nitro/src/builders.ts packages/nitro/src/index.ts packages/nitro/src/index.test.ts workbench/nitro-v3/plugins/start-pg-world.ts .changeset/brave-pandas-route.md
  • pnpm exec vitest run packages/nitro/src/index.test.ts
  • pnpm --filter @workflow/nitro build
  • WORKFLOW_PUBLIC_MANIFEST=1 pnpm --filter @workflow/example-nitro build
  • NITRO_PRESET=vercel WORKFLOW_PUBLIC_MANIFEST=1 pnpm --filter @workflow/example-nitro build
  • Nitro dev rebuild e2e for stable Nitro alpha: pnpm vitest run packages/core/e2e/dev.test.ts

Runtime/reproduction checks:

  • Built Nitro Vercel Output and inspected .vercel/output/config.json; /flow, /step, and /webhook/:token route to Nitro's server function before filesystem, while flow.func and step.func remain real queue-trigger functions.
  • Ran the full stable/v4 Nitro Vercel-output e2e locally against Nitro 3.0.260610-beta: 2 files passed, 96 passed, 6 skipped.
  • Ran the full stable/v4 Nitro Postgres e2e locally against Nitro 3.0.260610-beta: 2 files passed, 95 passed, 7 skipped.
  • Checked latest main/v5 separately against Nitro 3.0.260610-beta; Vercel-output and Postgres e2e both pass there, and v5 does not need a separate step route because it uses the combined flow handler.

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7ff29ef

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

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

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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 Jun 27, 2026 3:55am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jun 27, 2026 3:55am
example-workflow Ready Ready Preview, Comment Jun 27, 2026 3:55am
workbench-astro-workflow Ready Ready Preview, Comment Jun 27, 2026 3:55am
workbench-express-workflow Ready Ready Preview, Comment Jun 27, 2026 3:55am
workbench-fastify-workflow Ready Ready Preview, Comment Jun 27, 2026 3:55am
workbench-hono-workflow Ready Ready Preview, Comment Jun 27, 2026 3:55am
workbench-nitro-workflow Ready Ready Preview, Comment Jun 27, 2026 3:55am
workbench-nuxt-workflow Ready Ready Preview, Comment Jun 27, 2026 3:55am
workbench-sveltekit-workflow Ready Ready Preview, Comment Jun 27, 2026 3:55am
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jun 27, 2026 3:55am
workbench-vite-workflow Building Building Preview, Comment Jun 27, 2026 3:55am
workflow-docs Ready Ready Preview, Comment, Open in v0 Jun 27, 2026 3:55am
workflow-swc-playground Ready Ready Preview, Comment Jun 27, 2026 3:55am
workflow-tarballs Ready Ready Preview, Comment Jun 27, 2026 3:55am
workflow-web Ready Ready Preview, Comment Jun 27, 2026 3:55am

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1044 0 78 1122
✅ 💻 Local Development 1138 0 86 1224
✅ 📦 Local Production 1138 0 86 1224
✅ 🐘 Local Postgres 1126 0 98 1224
✅ 🪟 Windows 102 0 0 102
❌ 🌍 Community Worlds 76 99 6 181
✅ 📋 Other 574 0 38 612
Total 5198 99 392 5689

❌ Failed Tests

🌍 Community Worlds (99 failed)

redis (19 failed):

  • hookWorkflow | wrun_01KW3KC2FWW6QHZYZ78CHYZPF7
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KW3KC9QRNBY6AZ4393TJSDQ6
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KW3KCNFGQM833R4DMEMHGJ45
  • sleepingWorkflow | wrun_01KW3KDVWDKZAEAFVTPKYEE8H6
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KW3KNX87KGKASHRJ3KJ5TVM8
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KW3KP9Q5XP31B0NCPRHKG309
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KW3KPJJX6YQ93XATEP838FAV
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KW3KQ01SVHNG989WN0F4E7A6
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KW3KQVFMFA1XENAWNR2GCYNJ
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KW3KQYXYS0HS9GRJDAEJ6B84
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KW3KR59Y32M9XH1GC1NA15AX
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KW3KRBFT6ABE1S1H7TJ262M3
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KW3KRN2H99ZZ8R2B9DGNXXZ8
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KW3KYSPCE5WJXE5TRXRNAGZ0

turso (80 failed):

  • addTenWorkflow | wrun_01KW3KB06V4D6WDWAVN9ZKC8R6
  • addTenWorkflow | wrun_01KW3KB06V4D6WDWAVN9ZKC8R6
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KW3KC6CWKVTVJD45FZ77K8XD
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KW3KB9VEZWRE5CZ6F6QXMPMC
  • promiseRaceWorkflow | wrun_01KW3KBFTT4V2KJ30CDAJXB66W
  • promiseAnyWorkflow | wrun_01KW3KBJ27CY4HK53FE6N43YD7
  • importedStepOnlyWorkflow | wrun_01KW3KCMAB7N63EY4GBJ3HYNCT
  • readableStreamWorkflow | wrun_01KW3KBNVAG7ENFH1J7SK1E5YQ
  • hookWorkflow | wrun_01KW3KC2FWW6QHZYZ78CHYZPF7
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KW3KC9QRNBY6AZ4393TJSDQ6
  • webhookWorkflow | wrun_01KW3KCF3CVMXZVHZ1J62ZHZ15
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KW3KCNFGQM833R4DMEMHGJ45
  • sleepingWorkflow | wrun_01KW3KDVWDKZAEAFVTPKYEE8H6
  • parallelSleepWorkflow | wrun_01KW3KEBWBMC1QRSQQAWASV3VT
  • nullByteWorkflow | wrun_01KW3KEGQAKCDFNTS5KJASN3HX
  • workflowAndStepMetadataWorkflow | wrun_01KW3KEK1GG0B63VHC5PV076FY
  • outputStreamWorkflow no startIndex (reads all chunks)
  • outputStreamWorkflow positive startIndex (skips first chunk)
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions | wrun_01KW3KH42D7FGFPVHYTZB119W2
  • writableForwardedFromWorkflowWorkflow | wrun_01KW3KHJB56CG36K122SAKJRA0
  • writableForwardedFromStepWorkflow | wrun_01KW3KHQP856MZ0E69CKQSWZ6S
  • fetchWorkflow | wrun_01KW3KHTGK054X30V86WB0YVNM
  • promiseRaceStressTestWorkflow | wrun_01KW3KHZ6FK1KYTM2MD6Z2PHR0
  • 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()
  • error handling not registered WorkflowNotRegisteredError fails the run when workflow does not exist
  • error handling not registered StepNotRegisteredError fails the step but workflow can catch it
  • error handling not registered StepNotRegisteredError fails the run when not caught in workflow
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KW3KNGZSA50YJK04TWNTWD6G
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KW3KNX87KGKASHRJ3KJ5TVM8
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KW3KP9Q5XP31B0NCPRHKG309
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01KW3KPCCCTTQ2P2YYD31PJZ71
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01KW3KPG2QYEZX3P4CETS4JQXV
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KW3KPJJX6YQ93XATEP838FAV
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KW3KQ01SVHNG989WN0F4E7A6
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KW3KQVFMFA1XENAWNR2GCYNJ
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KW3KQYXYS0HS9GRJDAEJ6B84
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KW3KR59Y32M9XH1GC1NA15AX
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KW3KRBFT6ABE1S1H7TJ262M3
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KW3KRN2H99ZZ8R2B9DGNXXZ8
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KW3KRX6RFZJV76P9QRZ6JPJ2
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KW3KSFN2HE0W9MKYQ04YKES0
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KW3KSS7NG9CABWM9JAQSGMV2
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KW3KSZAMQMJBW89MS8GBHBFC
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KW3KT1SSM5JHNDFFS4F3YY32
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • health check (CLI) - workflow health command reports healthy endpoints
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KW3KTJV1DPQPX6EN8PQNNRHE
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KW3KTRW88CHJZSSYH0EKV2KD
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KW3KTZY2G6VVAWB90PGZQYT1
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KW3KV70C2B6APBN1H6RMF3ZN
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KW3KVE6Z781F4JD21JZRHW43
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KW3KVNA6E0KGTXADDB9939JV
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KW3KVWKX6Z55NK239650MVPN
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KW3KWB1GJMM8RV7H5T8029BG
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KW3KWMR84W09XFZ0ZRBVWS95
  • cancelRun - cancelling a running workflow | wrun_01KW3KWVZSK206R6MJ81E9SW4J
  • cancelRun via CLI - cancelling a running workflow | wrun_01KW3KX5KXKRDFP1XPEMMHH4ZG
  • 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_01KW3KXJ4KWGSPF19WJANAFV0M
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KW3KY31H900TB8VWJZ623ZAJ
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KW3KYDPMBBQEJHHMXB7Y0TWZ
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01KW3KYMYAR2YAGF67Q1HA1AYP
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01KW3KYQ7S30KX81AG495RPJMG
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KW3KYSPCE5WJXE5TRXRNAGZ0

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 94 0 8
✅ example 94 0 8
✅ express 94 0 8
✅ fastify 94 0 8
✅ hono 94 0 8
✅ nextjs-turbopack 99 0 3
✅ nextjs-webpack 99 0 3
✅ nitro 94 0 8
✅ nuxt 94 0 8
✅ sveltekit 94 0 8
✅ vite 94 0 8
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 96 0 6
✅ express-stable 96 0 6
✅ fastify-stable 96 0 6
✅ hono-stable 96 0 6
✅ nextjs-turbopack-canary 83 0 19
✅ nextjs-turbopack-stable 102 0 0
✅ nextjs-webpack-canary 83 0 19
✅ nextjs-webpack-stable 102 0 0
✅ nitro-stable 96 0 6
✅ nuxt-stable 96 0 6
✅ sveltekit-stable 96 0 6
✅ vite-stable 96 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 96 0 6
✅ express-stable 96 0 6
✅ fastify-stable 96 0 6
✅ hono-stable 96 0 6
✅ nextjs-turbopack-canary 83 0 19
✅ nextjs-turbopack-stable 102 0 0
✅ nextjs-webpack-canary 83 0 19
✅ nextjs-webpack-stable 102 0 0
✅ nitro-stable 96 0 6
✅ nuxt-stable 96 0 6
✅ sveltekit-stable 96 0 6
✅ vite-stable 96 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 95 0 7
✅ express-stable 95 0 7
✅ fastify-stable 95 0 7
✅ hono-stable 95 0 7
✅ nextjs-turbopack-canary 82 0 20
✅ nextjs-turbopack-stable 101 0 1
✅ nextjs-webpack-canary 82 0 20
✅ nextjs-webpack-stable 101 0 1
✅ nitro-stable 95 0 7
✅ nuxt-stable 95 0 7
✅ sveltekit-stable 95 0 7
✅ vite-stable 95 0 7
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 102 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 2
✅ redis-dev 3 0 2
❌ redis 64 19 0
✅ turso-dev 3 0 2
❌ turso 3 80 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 96 0 6
✅ e2e-local-dev-tanstack-start-stable 96 0 6
✅ e2e-local-postgres-nest-stable 95 0 7
✅ e2e-local-postgres-tanstack-start-stable 95 0 7
✅ e2e-local-prod-nest-stable 96 0 6
✅ e2e-local-prod-tanstack-start-stable 96 0 6

📋 View full workflow run

@vercel vercel Bot temporarily deployed to Preview – workflow-docs June 26, 2026 05:29 Inactive
@NathanColosimo NathanColosimo force-pushed the codex/issue-2460-repro-stable branch from 4a7d3e5 to fc89089 Compare June 26, 2026 22:50
@vercel vercel Bot temporarily deployed to Preview – workflow-docs June 27, 2026 00:12 Inactive
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.

1 participant