Support step function serialization in "client" mode - #924

Merged
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode
Feb 7, 2026
Merged

Support step function serialization in "client" mode#924
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
Member

Added support for step function serialization in client mode by setting the stepId property and registering step functions.

What changed?

  • Added a stepId property to step functions in registerStepFunction to support serialization
  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated the client mode transformation to preserve step function bodies while also registering them
  • Updated the plugin specification documentation to reflect these changes
  • Added appropriate imports for registerStepFunction in client mode output

How to test?

  1. Create a workflow that passes step functions as arguments to other step functions
  2. Run the workflow in client mode
  3. Verify that step functions are properly serialized and can be passed between boundaries
  4. Check that step functions maintain their identity when passed as arguments or returned from other functions

Why make this change?

This change enables proper serialization of step functions in client mode. Previously, step functions in client mode weren't registered, which meant they couldn't be properly serialized when passed as arguments to start() or returned from other step functions. By setting the stepId property and registering step functions in client mode, we ensure consistent behavior between client and server modes when step functions are passed across boundaries.

@changeset-bot

changeset-botBot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cee25ef

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

This PR includes changesets to release 15 packages
NameType
@workflow/corePatch
@workflow/swc-pluginPatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production490038528
✅ 💻 Local Development418062480
✅ 📦 Local Production418062480
✅ 🐘 Local Postgres418062480
✅ 🪟 Windows450348
❌ 🌍 Community Worlds2916312204
✅ 📋 Other123021144
Total19411632602364

❌ Failed Tests

🌍 Community Worlds (163 failed)

mongodb (40 failed):

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

redis (40 failed):

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

starter (42 failed):

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

turso (41 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4404
✅ example4404
✅ express4404
✅ fastify4404
✅ hono4404
✅ nextjs-turbopack4701
✅ nextjs-webpack4701
✅ nitro4404
✅ nuxt4404
✅ sveltekit4404
✅ vite4404
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4503
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb5403
✅ redis-dev300
❌ redis5403
✅ starter-dev300
❌ starter3423
✅ turso-dev300
❌ turso4413
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4107
✅ e2e-local-postgres-nest-stable4107
✅ e2e-local-prod-nest-stable4107

📋 View full workflow run

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

@TooTallNate
TooTallNate marked this pull request as ready for review February 3, 2026 19:57
@TooTallNateGraphite App

TooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
MemberAuthor

CopilotAI review requested due to automatic review settings February 3, 2026 20:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for step function serialization in client mode by registering step functions and setting their stepId property. This enables step functions to be properly serialized when passed as arguments to start() or returned from other step functions.

Changes:

  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated registerStepFunction in packages/core/src/private.ts to set the stepId property on functions for serialization support
  • Added a custom StepFunction reviver in getWorkflowRevivers that wraps deserialized step functions with the useStep wrapper when in workflow context, allowing them to be called directly from workflow code
  • Updated test fixtures to include registerStepFunction calls and necessary imports in client mode outputs
  • Added an E2E test and example code demonstrating step functions being passed as arguments to start()

Reviewed changes

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

Show a summary per file
FileDescription
packages/core/src/private.tsAdded stepId property to StepFunction type and modified registerStepFunction to set it
packages/core/src/serialization.tsAdded custom StepFunction reviver in getWorkflowRevivers that returns useStep wrapper in workflow context
packages/swc-plugin-workflow/transform/src/lib.rsModified client mode transformation to register step functions and added import generation
packages/swc-plugin-workflow/spec.mdUpdated documentation to reflect client mode step registration
workbench/example/workflows/99_e2e.tsAdded test workflow and step functions for E2E testing
workbench/example/api/trigger.tsAdded support for injecting step function references as test arguments
packages/core/e2e/e2e.test.tsAdded E2E test for step function serialization
Multiple test fixturesUpdated expected outputs to include registerStepFunction calls
.changeset/*.mdAdded changeset entries for the changes

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

Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
@github-actions

github-actionsBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.026s (-18.8% 🟢)1.004s (~)0.978s101.00x
💻 LocalNitro0.032s (+21.5% 🔺)1.004s (~)0.972s101.24x
💻 LocalNext.js (Turbopack)0.040s (+1.0%)1.005s (~)0.965s101.52x
🐘 PostgresNitro0.140s (-68.2% 🟢)1.013s (-1.2%)0.873s105.37x
🐘 PostgresExpress0.173s (-43.6% 🟢)1.009s (-2.3%)0.836s106.65x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.786s (-9.6% 🟢)2.388s (-10.0% 🟢)1.602s101.00x
▲ VercelNext.js (Turbopack)0.826s (-17.5% 🟢)2.554s (-10.0% 🟢)1.728s101.05x
▲ VercelNitro0.887s (-6.4% 🟢)2.760s (+7.0% 🔺)1.874s101.13x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.074s (-2.9%)2.005s (~)0.930s101.00x
💻 LocalNext.js (Turbopack)1.101s (~)2.005s (~)0.904s101.03x
💻 LocalNitro1.105s (+2.9%)2.005s (~)0.900s101.03x
🐘 PostgresExpress2.256s (+0.8%)3.013s (~)0.757s102.10x
🐘 PostgresNitro2.470s (+6.2% 🔺)3.014s (~)0.545s102.30x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.678s (-2.1%)3.821s (-6.4% 🟢)1.143s101.00x
▲ VercelNitro2.780s (+1.4%)4.039s (+2.3%)1.259s101.04x
▲ VercelNext.js (Turbopack)2.801s (-0.9%)3.955s (-3.6%)1.154s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.562s (-2.5%)11.021s (~)0.458s31.00x
💻 LocalNext.js (Turbopack)10.707s (~)11.021s (~)0.314s31.01x
💻 LocalNitro10.817s (+2.5%)11.021s (~)0.203s31.02x
🐘 PostgresNitro20.342s (+0.6%)21.060s (~)0.718s21.93x
🐘 PostgresExpress20.456s (+1.7%)21.053s (~)0.597s21.94x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.520s (+1.1%)21.320s (+5.3% 🔺)1.800s21.00x
▲ VercelNext.js (Turbopack)19.956s (-1.5%)21.187s (-2.1%)1.230s21.02x
▲ VercelExpress19.983s (-1.2%)21.127s (-3.7%)1.144s21.02x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.802s (-2.5%)27.048s (-3.6%)0.246s31.00x
💻 LocalNext.js (Turbopack)27.161s (~)28.051s (~)0.889s31.01x
💻 LocalNitro27.458s (+2.6%)28.048s (+3.7%)0.590s31.02x
🐘 PostgresExpress50.305s (~)51.130s (~)0.825s21.88x
🐘 PostgresNitro50.392s (~)51.127s (~)0.736s21.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro49.602s (-3.3%)50.839s (-3.5%)1.237s21.00x
▲ VercelNext.js (Turbopack)50.457s (-3.9%)51.889s (-4.7%)1.432s21.02x
▲ VercelExpress51.941s (~)52.982s (-1.2%)1.041s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express55.697s (-2.7%)56.099s (-3.4%)0.401s21.00x
💻 LocalNext.js (Turbopack)56.536s (~)57.097s (~)0.561s21.02x
💻 LocalNitro57.110s (+2.7%)57.601s (+2.7%)0.491s21.03x
🐘 PostgresNitro100.340s (~)101.245s (~)0.905s11.80x
🐘 PostgresExpress100.510s (~)101.224s (+1.0%)0.714s11.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)104.752s (-2.6%)106.051s (-3.2%)1.299s11.00x
▲ VercelNitro105.366s (~)107.231s (+0.8%)1.865s11.01x
▲ VercelExpress107.446s (~)108.516s (-0.8%)1.070s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.364s (-2.8%)2.005s (~)0.641s151.00x
💻 LocalNitro1.416s (+5.2% 🔺)2.006s (~)0.589s151.04x
💻 LocalNext.js (Turbopack)1.439s (+2.9%)2.005s (~)0.566s151.06x
🐘 PostgresNitro2.399s (+2.5%)3.014s (~)0.615s101.76x
🐘 PostgresExpress2.442s (+5.5% 🔺)3.013s (~)0.571s101.79x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.926s (-4.4%)4.660s (+1.9%)1.735s71.00x
▲ VercelNitro3.194s (+12.9% 🔺)4.537s (+8.8% 🔺)1.343s71.09x
▲ VercelNext.js (Turbopack)3.924s (+16.9% 🔺)5.490s (+11.2% 🔺)1.566s61.34x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.264s (-12.0% 🟢)3.007s (~)0.744s101.00x
💻 LocalNitro2.573s (+14.2% 🔺)3.007s (~)0.434s101.14x
💻 LocalNext.js (Turbopack)2.582s (+4.4%)3.007s (~)0.425s101.14x
🐘 PostgresNitro8.428s (+14.2% 🔺)8.780s (+9.4% 🔺)0.351s43.72x
🐘 PostgresExpress9.486s (+11.9% 🔺)10.034s (+11.1% 🔺)0.548s34.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.139s (-17.1% 🟢)4.080s (-23.3% 🟢)0.940s81.00x
▲ VercelNext.js (Turbopack)3.348s (-30.6% 🟢)4.921s (-23.5% 🟢)1.573s71.07x
▲ VercelNitro3.448s (-9.0% 🟢)4.700s (-13.8% 🟢)1.253s71.10x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express6.274s (-13.9% 🟢)7.013s (-12.6% 🟢)0.739s51.00x
💻 LocalNext.js (Turbopack)6.877s (-1.6%)7.416s (-4.5%)0.539s51.10x
💻 LocalNitro7.179s (+11.3% 🔺)7.771s (+10.8% 🔺)0.592s41.14x
🐘 PostgresNitro46.457s (+5.7% 🔺)47.114s (+6.8% 🔺)0.657s17.40x
🐘 PostgresExpress50.619s (+9.0% 🔺)51.116s (+8.5% 🔺)0.497s18.07x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.332s (+9.8% 🔺)6.845s (+1.2%)1.513s51.00x
▲ VercelNext.js (Turbopack)6.969s (+10.2% 🔺)8.608s (+6.6% 🔺)1.639s41.31x
▲ VercelExpress7.277s (+114.1% 🔺)8.272s (+63.1% 🔺)0.995s41.36x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.376s (-3.4%)2.004s (~)0.629s151.00x
💻 LocalNitro1.399s (+0.8%)2.004s (~)0.605s151.02x
💻 LocalNext.js (Turbopack)1.416s (-1.1%)2.005s (~)0.589s151.03x
🐘 PostgresNitro2.102s (+11.5% 🔺)2.597s (+3.4%)0.495s121.53x
🐘 PostgresExpress2.133s (+2.2%)2.595s (-5.4% 🟢)0.462s121.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.309s (+190.4% 🔺)9.555s (+136.6% 🔺)1.246s41.00x
▲ VercelNitro10.590s (+286.2% 🔺)12.117s (+199.4% 🔺)1.527s31.27x
▲ VercelNext.js (Turbopack)12.175s (+299.5% 🔺)13.496s (+206.2% 🔺)1.321s31.47x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.479s (-8.9% 🟢)3.007s (~)0.528s101.00x
💻 LocalNext.js (Turbopack)2.515s (-5.4% 🟢)3.007s (~)0.492s101.01x
💻 LocalNitro2.688s (+9.9% 🔺)3.006s (~)0.318s101.08x
🐘 PostgresNitro10.606s (-9.0% 🟢)11.361s (-5.6% 🟢)0.755s34.28x
🐘 PostgresExpress12.147s (+16.5% 🔺)13.039s (+18.2% 🔺)0.892s34.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.017s (-47.8% 🟢)4.244s (-42.0% 🟢)1.226s81.00x
▲ VercelExpress3.152s (-31.5% 🟢)4.116s (-35.6% 🟢)0.964s81.04x
▲ VercelNitro3.922s (-23.6% 🟢)5.358s (-16.3% 🟢)1.435s61.30x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.333s (-7.4% 🟢)8.018s (-3.1%)0.684s41.00x
💻 LocalNext.js (Turbopack)7.683s (-3.4%)8.013s (-5.9% 🟢)0.330s41.05x
💻 LocalNitro7.751s (+10.6% 🔺)8.022s (+8.2% 🔺)0.271s41.06x
🐘 PostgresNitro50.836s (-4.6%)51.112s (-5.5% 🟢)0.276s16.93x
🐘 PostgresExpress52.327s (+4.3%)53.100s (+3.9%)0.773s17.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.357s (-64.5% 🟢)5.385s (-51.6% 🟢)2.029s61.00x
▲ VercelExpress3.784s (-48.0% 🟢)5.187s (-39.9% 🟢)1.403s61.13x
▲ VercelNitro4.435s (-44.0% 🟢)5.609s (-40.0% 🟢)1.175s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.116s (-32.8% 🟢)1.002s (~)0.009s (-15.8% 🟢)1.013s (~)0.897s101.00x
💻 LocalNext.js (Turbopack)0.141s (-2.5%)1.001s (~)0.010s (-5.6% 🟢)1.015s (~)0.874s101.22x
💻 LocalNitro0.171s (+52.6% 🔺)1.002s (~)0.010s (+8.5% 🔺)1.015s (~)0.844s101.47x
🐘 PostgresExpress2.147s (-8.9% 🟢)2.895s (+7.9% 🔺)0.001s (-8.3% 🟢)3.014s (~)0.867s1018.48x
🐘 PostgresNitro2.452s (+2.4%)2.590s (-2.2%)0.001s (-15.4% 🟢)3.014s (~)0.562s1021.10x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.803s (+3.1%)3.346s (+6.2% 🔺)0.168s (-38.5% 🟢)4.378s (~)1.575s101.00x
▲ VercelNext.js (Turbopack)2.893s (+6.9% 🔺)3.221s (+1.2%)0.203s (+45.1% 🔺)4.336s (+2.7%)1.443s101.03x
▲ VercelExpress3.186s (+18.0% 🔺)3.631s (+6.7% 🔺)0.221s (+57.7% 🔺)4.679s (+6.2% 🔺)1.493s101.14x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresNitro9/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)💻 Local11/12
Nitro💻 Local10/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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

Sign up for freeto 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

@TooTallNate@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Support step function serialization in "client" mode - #924

Merged
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode
Feb 7, 2026
Merged

Support step function serialization in "client" mode#924
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
Member

Added support for step function serialization in client mode by setting the stepId property and registering step functions.

What changed?

  • Added a stepId property to step functions in registerStepFunction to support serialization
  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated the client mode transformation to preserve step function bodies while also registering them
  • Updated the plugin specification documentation to reflect these changes
  • Added appropriate imports for registerStepFunction in client mode output

How to test?

  1. Create a workflow that passes step functions as arguments to other step functions
  2. Run the workflow in client mode
  3. Verify that step functions are properly serialized and can be passed between boundaries
  4. Check that step functions maintain their identity when passed as arguments or returned from other functions

Why make this change?

This change enables proper serialization of step functions in client mode. Previously, step functions in client mode weren't registered, which meant they couldn't be properly serialized when passed as arguments to start() or returned from other step functions. By setting the stepId property and registering step functions in client mode, we ensure consistent behavior between client and server modes when step functions are passed across boundaries.

@changeset-bot

changeset-botBot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cee25ef

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

This PR includes changesets to release 15 packages
NameType
@workflow/corePatch
@workflow/swc-pluginPatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production490038528
✅ 💻 Local Development418062480
✅ 📦 Local Production418062480
✅ 🐘 Local Postgres418062480
✅ 🪟 Windows450348
❌ 🌍 Community Worlds2916312204
✅ 📋 Other123021144
Total19411632602364

❌ Failed Tests

🌍 Community Worlds (163 failed)

mongodb (40 failed):

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

redis (40 failed):

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

starter (42 failed):

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

turso (41 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4404
✅ example4404
✅ express4404
✅ fastify4404
✅ hono4404
✅ nextjs-turbopack4701
✅ nextjs-webpack4701
✅ nitro4404
✅ nuxt4404
✅ sveltekit4404
✅ vite4404
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4503
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb5403
✅ redis-dev300
❌ redis5403
✅ starter-dev300
❌ starter3423
✅ turso-dev300
❌ turso4413
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4107
✅ e2e-local-postgres-nest-stable4107
✅ e2e-local-prod-nest-stable4107

📋 View full workflow run

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

@TooTallNate
TooTallNate marked this pull request as ready for review February 3, 2026 19:57
@TooTallNateGraphite App

TooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
MemberAuthor

CopilotAI review requested due to automatic review settings February 3, 2026 20:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for step function serialization in client mode by registering step functions and setting their stepId property. This enables step functions to be properly serialized when passed as arguments to start() or returned from other step functions.

Changes:

  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated registerStepFunction in packages/core/src/private.ts to set the stepId property on functions for serialization support
  • Added a custom StepFunction reviver in getWorkflowRevivers that wraps deserialized step functions with the useStep wrapper when in workflow context, allowing them to be called directly from workflow code
  • Updated test fixtures to include registerStepFunction calls and necessary imports in client mode outputs
  • Added an E2E test and example code demonstrating step functions being passed as arguments to start()

Reviewed changes

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

Show a summary per file
FileDescription
packages/core/src/private.tsAdded stepId property to StepFunction type and modified registerStepFunction to set it
packages/core/src/serialization.tsAdded custom StepFunction reviver in getWorkflowRevivers that returns useStep wrapper in workflow context
packages/swc-plugin-workflow/transform/src/lib.rsModified client mode transformation to register step functions and added import generation
packages/swc-plugin-workflow/spec.mdUpdated documentation to reflect client mode step registration
workbench/example/workflows/99_e2e.tsAdded test workflow and step functions for E2E testing
workbench/example/api/trigger.tsAdded support for injecting step function references as test arguments
packages/core/e2e/e2e.test.tsAdded E2E test for step function serialization
Multiple test fixturesUpdated expected outputs to include registerStepFunction calls
.changeset/*.mdAdded changeset entries for the changes

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

Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
@github-actions

github-actionsBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.026s (-18.8% 🟢)1.004s (~)0.978s101.00x
💻 LocalNitro0.032s (+21.5% 🔺)1.004s (~)0.972s101.24x
💻 LocalNext.js (Turbopack)0.040s (+1.0%)1.005s (~)0.965s101.52x
🐘 PostgresNitro0.140s (-68.2% 🟢)1.013s (-1.2%)0.873s105.37x
🐘 PostgresExpress0.173s (-43.6% 🟢)1.009s (-2.3%)0.836s106.65x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.786s (-9.6% 🟢)2.388s (-10.0% 🟢)1.602s101.00x
▲ VercelNext.js (Turbopack)0.826s (-17.5% 🟢)2.554s (-10.0% 🟢)1.728s101.05x
▲ VercelNitro0.887s (-6.4% 🟢)2.760s (+7.0% 🔺)1.874s101.13x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.074s (-2.9%)2.005s (~)0.930s101.00x
💻 LocalNext.js (Turbopack)1.101s (~)2.005s (~)0.904s101.03x
💻 LocalNitro1.105s (+2.9%)2.005s (~)0.900s101.03x
🐘 PostgresExpress2.256s (+0.8%)3.013s (~)0.757s102.10x
🐘 PostgresNitro2.470s (+6.2% 🔺)3.014s (~)0.545s102.30x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.678s (-2.1%)3.821s (-6.4% 🟢)1.143s101.00x
▲ VercelNitro2.780s (+1.4%)4.039s (+2.3%)1.259s101.04x
▲ VercelNext.js (Turbopack)2.801s (-0.9%)3.955s (-3.6%)1.154s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.562s (-2.5%)11.021s (~)0.458s31.00x
💻 LocalNext.js (Turbopack)10.707s (~)11.021s (~)0.314s31.01x
💻 LocalNitro10.817s (+2.5%)11.021s (~)0.203s31.02x
🐘 PostgresNitro20.342s (+0.6%)21.060s (~)0.718s21.93x
🐘 PostgresExpress20.456s (+1.7%)21.053s (~)0.597s21.94x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.520s (+1.1%)21.320s (+5.3% 🔺)1.800s21.00x
▲ VercelNext.js (Turbopack)19.956s (-1.5%)21.187s (-2.1%)1.230s21.02x
▲ VercelExpress19.983s (-1.2%)21.127s (-3.7%)1.144s21.02x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.802s (-2.5%)27.048s (-3.6%)0.246s31.00x
💻 LocalNext.js (Turbopack)27.161s (~)28.051s (~)0.889s31.01x
💻 LocalNitro27.458s (+2.6%)28.048s (+3.7%)0.590s31.02x
🐘 PostgresExpress50.305s (~)51.130s (~)0.825s21.88x
🐘 PostgresNitro50.392s (~)51.127s (~)0.736s21.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro49.602s (-3.3%)50.839s (-3.5%)1.237s21.00x
▲ VercelNext.js (Turbopack)50.457s (-3.9%)51.889s (-4.7%)1.432s21.02x
▲ VercelExpress51.941s (~)52.982s (-1.2%)1.041s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express55.697s (-2.7%)56.099s (-3.4%)0.401s21.00x
💻 LocalNext.js (Turbopack)56.536s (~)57.097s (~)0.561s21.02x
💻 LocalNitro57.110s (+2.7%)57.601s (+2.7%)0.491s21.03x
🐘 PostgresNitro100.340s (~)101.245s (~)0.905s11.80x
🐘 PostgresExpress100.510s (~)101.224s (+1.0%)0.714s11.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)104.752s (-2.6%)106.051s (-3.2%)1.299s11.00x
▲ VercelNitro105.366s (~)107.231s (+0.8%)1.865s11.01x
▲ VercelExpress107.446s (~)108.516s (-0.8%)1.070s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.364s (-2.8%)2.005s (~)0.641s151.00x
💻 LocalNitro1.416s (+5.2% 🔺)2.006s (~)0.589s151.04x
💻 LocalNext.js (Turbopack)1.439s (+2.9%)2.005s (~)0.566s151.06x
🐘 PostgresNitro2.399s (+2.5%)3.014s (~)0.615s101.76x
🐘 PostgresExpress2.442s (+5.5% 🔺)3.013s (~)0.571s101.79x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.926s (-4.4%)4.660s (+1.9%)1.735s71.00x
▲ VercelNitro3.194s (+12.9% 🔺)4.537s (+8.8% 🔺)1.343s71.09x
▲ VercelNext.js (Turbopack)3.924s (+16.9% 🔺)5.490s (+11.2% 🔺)1.566s61.34x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.264s (-12.0% 🟢)3.007s (~)0.744s101.00x
💻 LocalNitro2.573s (+14.2% 🔺)3.007s (~)0.434s101.14x
💻 LocalNext.js (Turbopack)2.582s (+4.4%)3.007s (~)0.425s101.14x
🐘 PostgresNitro8.428s (+14.2% 🔺)8.780s (+9.4% 🔺)0.351s43.72x
🐘 PostgresExpress9.486s (+11.9% 🔺)10.034s (+11.1% 🔺)0.548s34.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.139s (-17.1% 🟢)4.080s (-23.3% 🟢)0.940s81.00x
▲ VercelNext.js (Turbopack)3.348s (-30.6% 🟢)4.921s (-23.5% 🟢)1.573s71.07x
▲ VercelNitro3.448s (-9.0% 🟢)4.700s (-13.8% 🟢)1.253s71.10x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express6.274s (-13.9% 🟢)7.013s (-12.6% 🟢)0.739s51.00x
💻 LocalNext.js (Turbopack)6.877s (-1.6%)7.416s (-4.5%)0.539s51.10x
💻 LocalNitro7.179s (+11.3% 🔺)7.771s (+10.8% 🔺)0.592s41.14x
🐘 PostgresNitro46.457s (+5.7% 🔺)47.114s (+6.8% 🔺)0.657s17.40x
🐘 PostgresExpress50.619s (+9.0% 🔺)51.116s (+8.5% 🔺)0.497s18.07x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.332s (+9.8% 🔺)6.845s (+1.2%)1.513s51.00x
▲ VercelNext.js (Turbopack)6.969s (+10.2% 🔺)8.608s (+6.6% 🔺)1.639s41.31x
▲ VercelExpress7.277s (+114.1% 🔺)8.272s (+63.1% 🔺)0.995s41.36x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.376s (-3.4%)2.004s (~)0.629s151.00x
💻 LocalNitro1.399s (+0.8%)2.004s (~)0.605s151.02x
💻 LocalNext.js (Turbopack)1.416s (-1.1%)2.005s (~)0.589s151.03x
🐘 PostgresNitro2.102s (+11.5% 🔺)2.597s (+3.4%)0.495s121.53x
🐘 PostgresExpress2.133s (+2.2%)2.595s (-5.4% 🟢)0.462s121.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.309s (+190.4% 🔺)9.555s (+136.6% 🔺)1.246s41.00x
▲ VercelNitro10.590s (+286.2% 🔺)12.117s (+199.4% 🔺)1.527s31.27x
▲ VercelNext.js (Turbopack)12.175s (+299.5% 🔺)13.496s (+206.2% 🔺)1.321s31.47x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.479s (-8.9% 🟢)3.007s (~)0.528s101.00x
💻 LocalNext.js (Turbopack)2.515s (-5.4% 🟢)3.007s (~)0.492s101.01x
💻 LocalNitro2.688s (+9.9% 🔺)3.006s (~)0.318s101.08x
🐘 PostgresNitro10.606s (-9.0% 🟢)11.361s (-5.6% 🟢)0.755s34.28x
🐘 PostgresExpress12.147s (+16.5% 🔺)13.039s (+18.2% 🔺)0.892s34.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.017s (-47.8% 🟢)4.244s (-42.0% 🟢)1.226s81.00x
▲ VercelExpress3.152s (-31.5% 🟢)4.116s (-35.6% 🟢)0.964s81.04x
▲ VercelNitro3.922s (-23.6% 🟢)5.358s (-16.3% 🟢)1.435s61.30x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.333s (-7.4% 🟢)8.018s (-3.1%)0.684s41.00x
💻 LocalNext.js (Turbopack)7.683s (-3.4%)8.013s (-5.9% 🟢)0.330s41.05x
💻 LocalNitro7.751s (+10.6% 🔺)8.022s (+8.2% 🔺)0.271s41.06x
🐘 PostgresNitro50.836s (-4.6%)51.112s (-5.5% 🟢)0.276s16.93x
🐘 PostgresExpress52.327s (+4.3%)53.100s (+3.9%)0.773s17.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.357s (-64.5% 🟢)5.385s (-51.6% 🟢)2.029s61.00x
▲ VercelExpress3.784s (-48.0% 🟢)5.187s (-39.9% 🟢)1.403s61.13x
▲ VercelNitro4.435s (-44.0% 🟢)5.609s (-40.0% 🟢)1.175s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.116s (-32.8% 🟢)1.002s (~)0.009s (-15.8% 🟢)1.013s (~)0.897s101.00x
💻 LocalNext.js (Turbopack)0.141s (-2.5%)1.001s (~)0.010s (-5.6% 🟢)1.015s (~)0.874s101.22x
💻 LocalNitro0.171s (+52.6% 🔺)1.002s (~)0.010s (+8.5% 🔺)1.015s (~)0.844s101.47x
🐘 PostgresExpress2.147s (-8.9% 🟢)2.895s (+7.9% 🔺)0.001s (-8.3% 🟢)3.014s (~)0.867s1018.48x
🐘 PostgresNitro2.452s (+2.4%)2.590s (-2.2%)0.001s (-15.4% 🟢)3.014s (~)0.562s1021.10x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.803s (+3.1%)3.346s (+6.2% 🔺)0.168s (-38.5% 🟢)4.378s (~)1.575s101.00x
▲ VercelNext.js (Turbopack)2.893s (+6.9% 🔺)3.221s (+1.2%)0.203s (+45.1% 🔺)4.336s (+2.7%)1.443s101.03x
▲ VercelExpress3.186s (+18.0% 🔺)3.631s (+6.7% 🔺)0.221s (+57.7% 🔺)4.679s (+6.2% 🔺)1.493s101.14x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresNitro9/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)💻 Local11/12
Nitro💻 Local10/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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

Sign up for freeto 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

@TooTallNate@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Support step function serialization in "client" mode - #924

Merged
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode
Feb 7, 2026
Merged

Support step function serialization in "client" mode#924
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
Member

Added support for step function serialization in client mode by setting the stepId property and registering step functions.

What changed?

  • Added a stepId property to step functions in registerStepFunction to support serialization
  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated the client mode transformation to preserve step function bodies while also registering them
  • Updated the plugin specification documentation to reflect these changes
  • Added appropriate imports for registerStepFunction in client mode output

How to test?

  1. Create a workflow that passes step functions as arguments to other step functions
  2. Run the workflow in client mode
  3. Verify that step functions are properly serialized and can be passed between boundaries
  4. Check that step functions maintain their identity when passed as arguments or returned from other functions

Why make this change?

This change enables proper serialization of step functions in client mode. Previously, step functions in client mode weren't registered, which meant they couldn't be properly serialized when passed as arguments to start() or returned from other step functions. By setting the stepId property and registering step functions in client mode, we ensure consistent behavior between client and server modes when step functions are passed across boundaries.

@changeset-bot

changeset-botBot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cee25ef

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

This PR includes changesets to release 15 packages
NameType
@workflow/corePatch
@workflow/swc-pluginPatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production490038528
✅ 💻 Local Development418062480
✅ 📦 Local Production418062480
✅ 🐘 Local Postgres418062480
✅ 🪟 Windows450348
❌ 🌍 Community Worlds2916312204
✅ 📋 Other123021144
Total19411632602364

❌ Failed Tests

🌍 Community Worlds (163 failed)

mongodb (40 failed):

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

redis (40 failed):

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

starter (42 failed):

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

turso (41 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4404
✅ example4404
✅ express4404
✅ fastify4404
✅ hono4404
✅ nextjs-turbopack4701
✅ nextjs-webpack4701
✅ nitro4404
✅ nuxt4404
✅ sveltekit4404
✅ vite4404
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4503
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb5403
✅ redis-dev300
❌ redis5403
✅ starter-dev300
❌ starter3423
✅ turso-dev300
❌ turso4413
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4107
✅ e2e-local-postgres-nest-stable4107
✅ e2e-local-prod-nest-stable4107

📋 View full workflow run

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

@TooTallNate
TooTallNate marked this pull request as ready for review February 3, 2026 19:57
@TooTallNateGraphite App

TooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
MemberAuthor

CopilotAI review requested due to automatic review settings February 3, 2026 20:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for step function serialization in client mode by registering step functions and setting their stepId property. This enables step functions to be properly serialized when passed as arguments to start() or returned from other step functions.

Changes:

  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated registerStepFunction in packages/core/src/private.ts to set the stepId property on functions for serialization support
  • Added a custom StepFunction reviver in getWorkflowRevivers that wraps deserialized step functions with the useStep wrapper when in workflow context, allowing them to be called directly from workflow code
  • Updated test fixtures to include registerStepFunction calls and necessary imports in client mode outputs
  • Added an E2E test and example code demonstrating step functions being passed as arguments to start()

Reviewed changes

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

Show a summary per file
FileDescription
packages/core/src/private.tsAdded stepId property to StepFunction type and modified registerStepFunction to set it
packages/core/src/serialization.tsAdded custom StepFunction reviver in getWorkflowRevivers that returns useStep wrapper in workflow context
packages/swc-plugin-workflow/transform/src/lib.rsModified client mode transformation to register step functions and added import generation
packages/swc-plugin-workflow/spec.mdUpdated documentation to reflect client mode step registration
workbench/example/workflows/99_e2e.tsAdded test workflow and step functions for E2E testing
workbench/example/api/trigger.tsAdded support for injecting step function references as test arguments
packages/core/e2e/e2e.test.tsAdded E2E test for step function serialization
Multiple test fixturesUpdated expected outputs to include registerStepFunction calls
.changeset/*.mdAdded changeset entries for the changes

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

Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
@github-actions

github-actionsBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.026s (-18.8% 🟢)1.004s (~)0.978s101.00x
💻 LocalNitro0.032s (+21.5% 🔺)1.004s (~)0.972s101.24x
💻 LocalNext.js (Turbopack)0.040s (+1.0%)1.005s (~)0.965s101.52x
🐘 PostgresNitro0.140s (-68.2% 🟢)1.013s (-1.2%)0.873s105.37x
🐘 PostgresExpress0.173s (-43.6% 🟢)1.009s (-2.3%)0.836s106.65x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.786s (-9.6% 🟢)2.388s (-10.0% 🟢)1.602s101.00x
▲ VercelNext.js (Turbopack)0.826s (-17.5% 🟢)2.554s (-10.0% 🟢)1.728s101.05x
▲ VercelNitro0.887s (-6.4% 🟢)2.760s (+7.0% 🔺)1.874s101.13x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.074s (-2.9%)2.005s (~)0.930s101.00x
💻 LocalNext.js (Turbopack)1.101s (~)2.005s (~)0.904s101.03x
💻 LocalNitro1.105s (+2.9%)2.005s (~)0.900s101.03x
🐘 PostgresExpress2.256s (+0.8%)3.013s (~)0.757s102.10x
🐘 PostgresNitro2.470s (+6.2% 🔺)3.014s (~)0.545s102.30x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.678s (-2.1%)3.821s (-6.4% 🟢)1.143s101.00x
▲ VercelNitro2.780s (+1.4%)4.039s (+2.3%)1.259s101.04x
▲ VercelNext.js (Turbopack)2.801s (-0.9%)3.955s (-3.6%)1.154s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.562s (-2.5%)11.021s (~)0.458s31.00x
💻 LocalNext.js (Turbopack)10.707s (~)11.021s (~)0.314s31.01x
💻 LocalNitro10.817s (+2.5%)11.021s (~)0.203s31.02x
🐘 PostgresNitro20.342s (+0.6%)21.060s (~)0.718s21.93x
🐘 PostgresExpress20.456s (+1.7%)21.053s (~)0.597s21.94x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.520s (+1.1%)21.320s (+5.3% 🔺)1.800s21.00x
▲ VercelNext.js (Turbopack)19.956s (-1.5%)21.187s (-2.1%)1.230s21.02x
▲ VercelExpress19.983s (-1.2%)21.127s (-3.7%)1.144s21.02x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.802s (-2.5%)27.048s (-3.6%)0.246s31.00x
💻 LocalNext.js (Turbopack)27.161s (~)28.051s (~)0.889s31.01x
💻 LocalNitro27.458s (+2.6%)28.048s (+3.7%)0.590s31.02x
🐘 PostgresExpress50.305s (~)51.130s (~)0.825s21.88x
🐘 PostgresNitro50.392s (~)51.127s (~)0.736s21.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro49.602s (-3.3%)50.839s (-3.5%)1.237s21.00x
▲ VercelNext.js (Turbopack)50.457s (-3.9%)51.889s (-4.7%)1.432s21.02x
▲ VercelExpress51.941s (~)52.982s (-1.2%)1.041s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express55.697s (-2.7%)56.099s (-3.4%)0.401s21.00x
💻 LocalNext.js (Turbopack)56.536s (~)57.097s (~)0.561s21.02x
💻 LocalNitro57.110s (+2.7%)57.601s (+2.7%)0.491s21.03x
🐘 PostgresNitro100.340s (~)101.245s (~)0.905s11.80x
🐘 PostgresExpress100.510s (~)101.224s (+1.0%)0.714s11.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)104.752s (-2.6%)106.051s (-3.2%)1.299s11.00x
▲ VercelNitro105.366s (~)107.231s (+0.8%)1.865s11.01x
▲ VercelExpress107.446s (~)108.516s (-0.8%)1.070s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.364s (-2.8%)2.005s (~)0.641s151.00x
💻 LocalNitro1.416s (+5.2% 🔺)2.006s (~)0.589s151.04x
💻 LocalNext.js (Turbopack)1.439s (+2.9%)2.005s (~)0.566s151.06x
🐘 PostgresNitro2.399s (+2.5%)3.014s (~)0.615s101.76x
🐘 PostgresExpress2.442s (+5.5% 🔺)3.013s (~)0.571s101.79x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.926s (-4.4%)4.660s (+1.9%)1.735s71.00x
▲ VercelNitro3.194s (+12.9% 🔺)4.537s (+8.8% 🔺)1.343s71.09x
▲ VercelNext.js (Turbopack)3.924s (+16.9% 🔺)5.490s (+11.2% 🔺)1.566s61.34x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.264s (-12.0% 🟢)3.007s (~)0.744s101.00x
💻 LocalNitro2.573s (+14.2% 🔺)3.007s (~)0.434s101.14x
💻 LocalNext.js (Turbopack)2.582s (+4.4%)3.007s (~)0.425s101.14x
🐘 PostgresNitro8.428s (+14.2% 🔺)8.780s (+9.4% 🔺)0.351s43.72x
🐘 PostgresExpress9.486s (+11.9% 🔺)10.034s (+11.1% 🔺)0.548s34.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.139s (-17.1% 🟢)4.080s (-23.3% 🟢)0.940s81.00x
▲ VercelNext.js (Turbopack)3.348s (-30.6% 🟢)4.921s (-23.5% 🟢)1.573s71.07x
▲ VercelNitro3.448s (-9.0% 🟢)4.700s (-13.8% 🟢)1.253s71.10x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express6.274s (-13.9% 🟢)7.013s (-12.6% 🟢)0.739s51.00x
💻 LocalNext.js (Turbopack)6.877s (-1.6%)7.416s (-4.5%)0.539s51.10x
💻 LocalNitro7.179s (+11.3% 🔺)7.771s (+10.8% 🔺)0.592s41.14x
🐘 PostgresNitro46.457s (+5.7% 🔺)47.114s (+6.8% 🔺)0.657s17.40x
🐘 PostgresExpress50.619s (+9.0% 🔺)51.116s (+8.5% 🔺)0.497s18.07x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.332s (+9.8% 🔺)6.845s (+1.2%)1.513s51.00x
▲ VercelNext.js (Turbopack)6.969s (+10.2% 🔺)8.608s (+6.6% 🔺)1.639s41.31x
▲ VercelExpress7.277s (+114.1% 🔺)8.272s (+63.1% 🔺)0.995s41.36x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.376s (-3.4%)2.004s (~)0.629s151.00x
💻 LocalNitro1.399s (+0.8%)2.004s (~)0.605s151.02x
💻 LocalNext.js (Turbopack)1.416s (-1.1%)2.005s (~)0.589s151.03x
🐘 PostgresNitro2.102s (+11.5% 🔺)2.597s (+3.4%)0.495s121.53x
🐘 PostgresExpress2.133s (+2.2%)2.595s (-5.4% 🟢)0.462s121.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.309s (+190.4% 🔺)9.555s (+136.6% 🔺)1.246s41.00x
▲ VercelNitro10.590s (+286.2% 🔺)12.117s (+199.4% 🔺)1.527s31.27x
▲ VercelNext.js (Turbopack)12.175s (+299.5% 🔺)13.496s (+206.2% 🔺)1.321s31.47x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.479s (-8.9% 🟢)3.007s (~)0.528s101.00x
💻 LocalNext.js (Turbopack)2.515s (-5.4% 🟢)3.007s (~)0.492s101.01x
💻 LocalNitro2.688s (+9.9% 🔺)3.006s (~)0.318s101.08x
🐘 PostgresNitro10.606s (-9.0% 🟢)11.361s (-5.6% 🟢)0.755s34.28x
🐘 PostgresExpress12.147s (+16.5% 🔺)13.039s (+18.2% 🔺)0.892s34.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.017s (-47.8% 🟢)4.244s (-42.0% 🟢)1.226s81.00x
▲ VercelExpress3.152s (-31.5% 🟢)4.116s (-35.6% 🟢)0.964s81.04x
▲ VercelNitro3.922s (-23.6% 🟢)5.358s (-16.3% 🟢)1.435s61.30x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.333s (-7.4% 🟢)8.018s (-3.1%)0.684s41.00x
💻 LocalNext.js (Turbopack)7.683s (-3.4%)8.013s (-5.9% 🟢)0.330s41.05x
💻 LocalNitro7.751s (+10.6% 🔺)8.022s (+8.2% 🔺)0.271s41.06x
🐘 PostgresNitro50.836s (-4.6%)51.112s (-5.5% 🟢)0.276s16.93x
🐘 PostgresExpress52.327s (+4.3%)53.100s (+3.9%)0.773s17.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.357s (-64.5% 🟢)5.385s (-51.6% 🟢)2.029s61.00x
▲ VercelExpress3.784s (-48.0% 🟢)5.187s (-39.9% 🟢)1.403s61.13x
▲ VercelNitro4.435s (-44.0% 🟢)5.609s (-40.0% 🟢)1.175s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.116s (-32.8% 🟢)1.002s (~)0.009s (-15.8% 🟢)1.013s (~)0.897s101.00x
💻 LocalNext.js (Turbopack)0.141s (-2.5%)1.001s (~)0.010s (-5.6% 🟢)1.015s (~)0.874s101.22x
💻 LocalNitro0.171s (+52.6% 🔺)1.002s (~)0.010s (+8.5% 🔺)1.015s (~)0.844s101.47x
🐘 PostgresExpress2.147s (-8.9% 🟢)2.895s (+7.9% 🔺)0.001s (-8.3% 🟢)3.014s (~)0.867s1018.48x
🐘 PostgresNitro2.452s (+2.4%)2.590s (-2.2%)0.001s (-15.4% 🟢)3.014s (~)0.562s1021.10x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.803s (+3.1%)3.346s (+6.2% 🔺)0.168s (-38.5% 🟢)4.378s (~)1.575s101.00x
▲ VercelNext.js (Turbopack)2.893s (+6.9% 🔺)3.221s (+1.2%)0.203s (+45.1% 🔺)4.336s (+2.7%)1.443s101.03x
▲ VercelExpress3.186s (+18.0% 🔺)3.631s (+6.7% 🔺)0.221s (+57.7% 🔺)4.679s (+6.2% 🔺)1.493s101.14x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresNitro9/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)💻 Local11/12
Nitro💻 Local10/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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

Sign up for freeto 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

@TooTallNate@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Support step function serialization in "client" mode - #924

Merged
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode
Feb 7, 2026
Merged

Support step function serialization in "client" mode#924
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
Member

Added support for step function serialization in client mode by setting the stepId property and registering step functions.

What changed?

  • Added a stepId property to step functions in registerStepFunction to support serialization
  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated the client mode transformation to preserve step function bodies while also registering them
  • Updated the plugin specification documentation to reflect these changes
  • Added appropriate imports for registerStepFunction in client mode output

How to test?

  1. Create a workflow that passes step functions as arguments to other step functions
  2. Run the workflow in client mode
  3. Verify that step functions are properly serialized and can be passed between boundaries
  4. Check that step functions maintain their identity when passed as arguments or returned from other functions

Why make this change?

This change enables proper serialization of step functions in client mode. Previously, step functions in client mode weren't registered, which meant they couldn't be properly serialized when passed as arguments to start() or returned from other step functions. By setting the stepId property and registering step functions in client mode, we ensure consistent behavior between client and server modes when step functions are passed across boundaries.

@changeset-bot

changeset-botBot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cee25ef

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

This PR includes changesets to release 15 packages
NameType
@workflow/corePatch
@workflow/swc-pluginPatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production490038528
✅ 💻 Local Development418062480
✅ 📦 Local Production418062480
✅ 🐘 Local Postgres418062480
✅ 🪟 Windows450348
❌ 🌍 Community Worlds2916312204
✅ 📋 Other123021144
Total19411632602364

❌ Failed Tests

🌍 Community Worlds (163 failed)

mongodb (40 failed):

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

redis (40 failed):

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

starter (42 failed):

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

turso (41 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4404
✅ example4404
✅ express4404
✅ fastify4404
✅ hono4404
✅ nextjs-turbopack4701
✅ nextjs-webpack4701
✅ nitro4404
✅ nuxt4404
✅ sveltekit4404
✅ vite4404
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4503
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb5403
✅ redis-dev300
❌ redis5403
✅ starter-dev300
❌ starter3423
✅ turso-dev300
❌ turso4413
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4107
✅ e2e-local-postgres-nest-stable4107
✅ e2e-local-prod-nest-stable4107

📋 View full workflow run

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

@TooTallNate
TooTallNate marked this pull request as ready for review February 3, 2026 19:57
@TooTallNateGraphite App

TooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
MemberAuthor

CopilotAI review requested due to automatic review settings February 3, 2026 20:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for step function serialization in client mode by registering step functions and setting their stepId property. This enables step functions to be properly serialized when passed as arguments to start() or returned from other step functions.

Changes:

  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated registerStepFunction in packages/core/src/private.ts to set the stepId property on functions for serialization support
  • Added a custom StepFunction reviver in getWorkflowRevivers that wraps deserialized step functions with the useStep wrapper when in workflow context, allowing them to be called directly from workflow code
  • Updated test fixtures to include registerStepFunction calls and necessary imports in client mode outputs
  • Added an E2E test and example code demonstrating step functions being passed as arguments to start()

Reviewed changes

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

Show a summary per file
FileDescription
packages/core/src/private.tsAdded stepId property to StepFunction type and modified registerStepFunction to set it
packages/core/src/serialization.tsAdded custom StepFunction reviver in getWorkflowRevivers that returns useStep wrapper in workflow context
packages/swc-plugin-workflow/transform/src/lib.rsModified client mode transformation to register step functions and added import generation
packages/swc-plugin-workflow/spec.mdUpdated documentation to reflect client mode step registration
workbench/example/workflows/99_e2e.tsAdded test workflow and step functions for E2E testing
workbench/example/api/trigger.tsAdded support for injecting step function references as test arguments
packages/core/e2e/e2e.test.tsAdded E2E test for step function serialization
Multiple test fixturesUpdated expected outputs to include registerStepFunction calls
.changeset/*.mdAdded changeset entries for the changes

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

Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
@github-actions

github-actionsBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.026s (-18.8% 🟢)1.004s (~)0.978s101.00x
💻 LocalNitro0.032s (+21.5% 🔺)1.004s (~)0.972s101.24x
💻 LocalNext.js (Turbopack)0.040s (+1.0%)1.005s (~)0.965s101.52x
🐘 PostgresNitro0.140s (-68.2% 🟢)1.013s (-1.2%)0.873s105.37x
🐘 PostgresExpress0.173s (-43.6% 🟢)1.009s (-2.3%)0.836s106.65x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.786s (-9.6% 🟢)2.388s (-10.0% 🟢)1.602s101.00x
▲ VercelNext.js (Turbopack)0.826s (-17.5% 🟢)2.554s (-10.0% 🟢)1.728s101.05x
▲ VercelNitro0.887s (-6.4% 🟢)2.760s (+7.0% 🔺)1.874s101.13x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.074s (-2.9%)2.005s (~)0.930s101.00x
💻 LocalNext.js (Turbopack)1.101s (~)2.005s (~)0.904s101.03x
💻 LocalNitro1.105s (+2.9%)2.005s (~)0.900s101.03x
🐘 PostgresExpress2.256s (+0.8%)3.013s (~)0.757s102.10x
🐘 PostgresNitro2.470s (+6.2% 🔺)3.014s (~)0.545s102.30x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.678s (-2.1%)3.821s (-6.4% 🟢)1.143s101.00x
▲ VercelNitro2.780s (+1.4%)4.039s (+2.3%)1.259s101.04x
▲ VercelNext.js (Turbopack)2.801s (-0.9%)3.955s (-3.6%)1.154s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.562s (-2.5%)11.021s (~)0.458s31.00x
💻 LocalNext.js (Turbopack)10.707s (~)11.021s (~)0.314s31.01x
💻 LocalNitro10.817s (+2.5%)11.021s (~)0.203s31.02x
🐘 PostgresNitro20.342s (+0.6%)21.060s (~)0.718s21.93x
🐘 PostgresExpress20.456s (+1.7%)21.053s (~)0.597s21.94x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.520s (+1.1%)21.320s (+5.3% 🔺)1.800s21.00x
▲ VercelNext.js (Turbopack)19.956s (-1.5%)21.187s (-2.1%)1.230s21.02x
▲ VercelExpress19.983s (-1.2%)21.127s (-3.7%)1.144s21.02x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.802s (-2.5%)27.048s (-3.6%)0.246s31.00x
💻 LocalNext.js (Turbopack)27.161s (~)28.051s (~)0.889s31.01x
💻 LocalNitro27.458s (+2.6%)28.048s (+3.7%)0.590s31.02x
🐘 PostgresExpress50.305s (~)51.130s (~)0.825s21.88x
🐘 PostgresNitro50.392s (~)51.127s (~)0.736s21.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro49.602s (-3.3%)50.839s (-3.5%)1.237s21.00x
▲ VercelNext.js (Turbopack)50.457s (-3.9%)51.889s (-4.7%)1.432s21.02x
▲ VercelExpress51.941s (~)52.982s (-1.2%)1.041s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express55.697s (-2.7%)56.099s (-3.4%)0.401s21.00x
💻 LocalNext.js (Turbopack)56.536s (~)57.097s (~)0.561s21.02x
💻 LocalNitro57.110s (+2.7%)57.601s (+2.7%)0.491s21.03x
🐘 PostgresNitro100.340s (~)101.245s (~)0.905s11.80x
🐘 PostgresExpress100.510s (~)101.224s (+1.0%)0.714s11.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)104.752s (-2.6%)106.051s (-3.2%)1.299s11.00x
▲ VercelNitro105.366s (~)107.231s (+0.8%)1.865s11.01x
▲ VercelExpress107.446s (~)108.516s (-0.8%)1.070s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.364s (-2.8%)2.005s (~)0.641s151.00x
💻 LocalNitro1.416s (+5.2% 🔺)2.006s (~)0.589s151.04x
💻 LocalNext.js (Turbopack)1.439s (+2.9%)2.005s (~)0.566s151.06x
🐘 PostgresNitro2.399s (+2.5%)3.014s (~)0.615s101.76x
🐘 PostgresExpress2.442s (+5.5% 🔺)3.013s (~)0.571s101.79x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.926s (-4.4%)4.660s (+1.9%)1.735s71.00x
▲ VercelNitro3.194s (+12.9% 🔺)4.537s (+8.8% 🔺)1.343s71.09x
▲ VercelNext.js (Turbopack)3.924s (+16.9% 🔺)5.490s (+11.2% 🔺)1.566s61.34x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.264s (-12.0% 🟢)3.007s (~)0.744s101.00x
💻 LocalNitro2.573s (+14.2% 🔺)3.007s (~)0.434s101.14x
💻 LocalNext.js (Turbopack)2.582s (+4.4%)3.007s (~)0.425s101.14x
🐘 PostgresNitro8.428s (+14.2% 🔺)8.780s (+9.4% 🔺)0.351s43.72x
🐘 PostgresExpress9.486s (+11.9% 🔺)10.034s (+11.1% 🔺)0.548s34.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.139s (-17.1% 🟢)4.080s (-23.3% 🟢)0.940s81.00x
▲ VercelNext.js (Turbopack)3.348s (-30.6% 🟢)4.921s (-23.5% 🟢)1.573s71.07x
▲ VercelNitro3.448s (-9.0% 🟢)4.700s (-13.8% 🟢)1.253s71.10x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express6.274s (-13.9% 🟢)7.013s (-12.6% 🟢)0.739s51.00x
💻 LocalNext.js (Turbopack)6.877s (-1.6%)7.416s (-4.5%)0.539s51.10x
💻 LocalNitro7.179s (+11.3% 🔺)7.771s (+10.8% 🔺)0.592s41.14x
🐘 PostgresNitro46.457s (+5.7% 🔺)47.114s (+6.8% 🔺)0.657s17.40x
🐘 PostgresExpress50.619s (+9.0% 🔺)51.116s (+8.5% 🔺)0.497s18.07x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.332s (+9.8% 🔺)6.845s (+1.2%)1.513s51.00x
▲ VercelNext.js (Turbopack)6.969s (+10.2% 🔺)8.608s (+6.6% 🔺)1.639s41.31x
▲ VercelExpress7.277s (+114.1% 🔺)8.272s (+63.1% 🔺)0.995s41.36x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.376s (-3.4%)2.004s (~)0.629s151.00x
💻 LocalNitro1.399s (+0.8%)2.004s (~)0.605s151.02x
💻 LocalNext.js (Turbopack)1.416s (-1.1%)2.005s (~)0.589s151.03x
🐘 PostgresNitro2.102s (+11.5% 🔺)2.597s (+3.4%)0.495s121.53x
🐘 PostgresExpress2.133s (+2.2%)2.595s (-5.4% 🟢)0.462s121.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.309s (+190.4% 🔺)9.555s (+136.6% 🔺)1.246s41.00x
▲ VercelNitro10.590s (+286.2% 🔺)12.117s (+199.4% 🔺)1.527s31.27x
▲ VercelNext.js (Turbopack)12.175s (+299.5% 🔺)13.496s (+206.2% 🔺)1.321s31.47x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.479s (-8.9% 🟢)3.007s (~)0.528s101.00x
💻 LocalNext.js (Turbopack)2.515s (-5.4% 🟢)3.007s (~)0.492s101.01x
💻 LocalNitro2.688s (+9.9% 🔺)3.006s (~)0.318s101.08x
🐘 PostgresNitro10.606s (-9.0% 🟢)11.361s (-5.6% 🟢)0.755s34.28x
🐘 PostgresExpress12.147s (+16.5% 🔺)13.039s (+18.2% 🔺)0.892s34.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.017s (-47.8% 🟢)4.244s (-42.0% 🟢)1.226s81.00x
▲ VercelExpress3.152s (-31.5% 🟢)4.116s (-35.6% 🟢)0.964s81.04x
▲ VercelNitro3.922s (-23.6% 🟢)5.358s (-16.3% 🟢)1.435s61.30x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.333s (-7.4% 🟢)8.018s (-3.1%)0.684s41.00x
💻 LocalNext.js (Turbopack)7.683s (-3.4%)8.013s (-5.9% 🟢)0.330s41.05x
💻 LocalNitro7.751s (+10.6% 🔺)8.022s (+8.2% 🔺)0.271s41.06x
🐘 PostgresNitro50.836s (-4.6%)51.112s (-5.5% 🟢)0.276s16.93x
🐘 PostgresExpress52.327s (+4.3%)53.100s (+3.9%)0.773s17.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.357s (-64.5% 🟢)5.385s (-51.6% 🟢)2.029s61.00x
▲ VercelExpress3.784s (-48.0% 🟢)5.187s (-39.9% 🟢)1.403s61.13x
▲ VercelNitro4.435s (-44.0% 🟢)5.609s (-40.0% 🟢)1.175s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.116s (-32.8% 🟢)1.002s (~)0.009s (-15.8% 🟢)1.013s (~)0.897s101.00x
💻 LocalNext.js (Turbopack)0.141s (-2.5%)1.001s (~)0.010s (-5.6% 🟢)1.015s (~)0.874s101.22x
💻 LocalNitro0.171s (+52.6% 🔺)1.002s (~)0.010s (+8.5% 🔺)1.015s (~)0.844s101.47x
🐘 PostgresExpress2.147s (-8.9% 🟢)2.895s (+7.9% 🔺)0.001s (-8.3% 🟢)3.014s (~)0.867s1018.48x
🐘 PostgresNitro2.452s (+2.4%)2.590s (-2.2%)0.001s (-15.4% 🟢)3.014s (~)0.562s1021.10x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.803s (+3.1%)3.346s (+6.2% 🔺)0.168s (-38.5% 🟢)4.378s (~)1.575s101.00x
▲ VercelNext.js (Turbopack)2.893s (+6.9% 🔺)3.221s (+1.2%)0.203s (+45.1% 🔺)4.336s (+2.7%)1.443s101.03x
▲ VercelExpress3.186s (+18.0% 🔺)3.631s (+6.7% 🔺)0.221s (+57.7% 🔺)4.679s (+6.2% 🔺)1.493s101.14x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresNitro9/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)💻 Local11/12
Nitro💻 Local10/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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

Sign up for freeto 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

@TooTallNate@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Support step function serialization in "client" mode - #924

Merged
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode
Feb 7, 2026
Merged

Support step function serialization in "client" mode#924
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
Member

Added support for step function serialization in client mode by setting the stepId property and registering step functions.

What changed?

  • Added a stepId property to step functions in registerStepFunction to support serialization
  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated the client mode transformation to preserve step function bodies while also registering them
  • Updated the plugin specification documentation to reflect these changes
  • Added appropriate imports for registerStepFunction in client mode output

How to test?

  1. Create a workflow that passes step functions as arguments to other step functions
  2. Run the workflow in client mode
  3. Verify that step functions are properly serialized and can be passed between boundaries
  4. Check that step functions maintain their identity when passed as arguments or returned from other functions

Why make this change?

This change enables proper serialization of step functions in client mode. Previously, step functions in client mode weren't registered, which meant they couldn't be properly serialized when passed as arguments to start() or returned from other step functions. By setting the stepId property and registering step functions in client mode, we ensure consistent behavior between client and server modes when step functions are passed across boundaries.

@changeset-bot

changeset-botBot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cee25ef

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

This PR includes changesets to release 15 packages
NameType
@workflow/corePatch
@workflow/swc-pluginPatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production490038528
✅ 💻 Local Development418062480
✅ 📦 Local Production418062480
✅ 🐘 Local Postgres418062480
✅ 🪟 Windows450348
❌ 🌍 Community Worlds2916312204
✅ 📋 Other123021144
Total19411632602364

❌ Failed Tests

🌍 Community Worlds (163 failed)

mongodb (40 failed):

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

redis (40 failed):

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

starter (42 failed):

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

turso (41 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4404
✅ example4404
✅ express4404
✅ fastify4404
✅ hono4404
✅ nextjs-turbopack4701
✅ nextjs-webpack4701
✅ nitro4404
✅ nuxt4404
✅ sveltekit4404
✅ vite4404
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4503
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb5403
✅ redis-dev300
❌ redis5403
✅ starter-dev300
❌ starter3423
✅ turso-dev300
❌ turso4413
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4107
✅ e2e-local-postgres-nest-stable4107
✅ e2e-local-prod-nest-stable4107

📋 View full workflow run

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

@TooTallNate
TooTallNate marked this pull request as ready for review February 3, 2026 19:57
@TooTallNateGraphite App

TooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
MemberAuthor

CopilotAI review requested due to automatic review settings February 3, 2026 20:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for step function serialization in client mode by registering step functions and setting their stepId property. This enables step functions to be properly serialized when passed as arguments to start() or returned from other step functions.

Changes:

  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated registerStepFunction in packages/core/src/private.ts to set the stepId property on functions for serialization support
  • Added a custom StepFunction reviver in getWorkflowRevivers that wraps deserialized step functions with the useStep wrapper when in workflow context, allowing them to be called directly from workflow code
  • Updated test fixtures to include registerStepFunction calls and necessary imports in client mode outputs
  • Added an E2E test and example code demonstrating step functions being passed as arguments to start()

Reviewed changes

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

Show a summary per file
FileDescription
packages/core/src/private.tsAdded stepId property to StepFunction type and modified registerStepFunction to set it
packages/core/src/serialization.tsAdded custom StepFunction reviver in getWorkflowRevivers that returns useStep wrapper in workflow context
packages/swc-plugin-workflow/transform/src/lib.rsModified client mode transformation to register step functions and added import generation
packages/swc-plugin-workflow/spec.mdUpdated documentation to reflect client mode step registration
workbench/example/workflows/99_e2e.tsAdded test workflow and step functions for E2E testing
workbench/example/api/trigger.tsAdded support for injecting step function references as test arguments
packages/core/e2e/e2e.test.tsAdded E2E test for step function serialization
Multiple test fixturesUpdated expected outputs to include registerStepFunction calls
.changeset/*.mdAdded changeset entries for the changes

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

Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
@github-actions

github-actionsBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.026s (-18.8% 🟢)1.004s (~)0.978s101.00x
💻 LocalNitro0.032s (+21.5% 🔺)1.004s (~)0.972s101.24x
💻 LocalNext.js (Turbopack)0.040s (+1.0%)1.005s (~)0.965s101.52x
🐘 PostgresNitro0.140s (-68.2% 🟢)1.013s (-1.2%)0.873s105.37x
🐘 PostgresExpress0.173s (-43.6% 🟢)1.009s (-2.3%)0.836s106.65x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.786s (-9.6% 🟢)2.388s (-10.0% 🟢)1.602s101.00x
▲ VercelNext.js (Turbopack)0.826s (-17.5% 🟢)2.554s (-10.0% 🟢)1.728s101.05x
▲ VercelNitro0.887s (-6.4% 🟢)2.760s (+7.0% 🔺)1.874s101.13x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.074s (-2.9%)2.005s (~)0.930s101.00x
💻 LocalNext.js (Turbopack)1.101s (~)2.005s (~)0.904s101.03x
💻 LocalNitro1.105s (+2.9%)2.005s (~)0.900s101.03x
🐘 PostgresExpress2.256s (+0.8%)3.013s (~)0.757s102.10x
🐘 PostgresNitro2.470s (+6.2% 🔺)3.014s (~)0.545s102.30x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.678s (-2.1%)3.821s (-6.4% 🟢)1.143s101.00x
▲ VercelNitro2.780s (+1.4%)4.039s (+2.3%)1.259s101.04x
▲ VercelNext.js (Turbopack)2.801s (-0.9%)3.955s (-3.6%)1.154s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.562s (-2.5%)11.021s (~)0.458s31.00x
💻 LocalNext.js (Turbopack)10.707s (~)11.021s (~)0.314s31.01x
💻 LocalNitro10.817s (+2.5%)11.021s (~)0.203s31.02x
🐘 PostgresNitro20.342s (+0.6%)21.060s (~)0.718s21.93x
🐘 PostgresExpress20.456s (+1.7%)21.053s (~)0.597s21.94x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.520s (+1.1%)21.320s (+5.3% 🔺)1.800s21.00x
▲ VercelNext.js (Turbopack)19.956s (-1.5%)21.187s (-2.1%)1.230s21.02x
▲ VercelExpress19.983s (-1.2%)21.127s (-3.7%)1.144s21.02x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.802s (-2.5%)27.048s (-3.6%)0.246s31.00x
💻 LocalNext.js (Turbopack)27.161s (~)28.051s (~)0.889s31.01x
💻 LocalNitro27.458s (+2.6%)28.048s (+3.7%)0.590s31.02x
🐘 PostgresExpress50.305s (~)51.130s (~)0.825s21.88x
🐘 PostgresNitro50.392s (~)51.127s (~)0.736s21.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro49.602s (-3.3%)50.839s (-3.5%)1.237s21.00x
▲ VercelNext.js (Turbopack)50.457s (-3.9%)51.889s (-4.7%)1.432s21.02x
▲ VercelExpress51.941s (~)52.982s (-1.2%)1.041s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express55.697s (-2.7%)56.099s (-3.4%)0.401s21.00x
💻 LocalNext.js (Turbopack)56.536s (~)57.097s (~)0.561s21.02x
💻 LocalNitro57.110s (+2.7%)57.601s (+2.7%)0.491s21.03x
🐘 PostgresNitro100.340s (~)101.245s (~)0.905s11.80x
🐘 PostgresExpress100.510s (~)101.224s (+1.0%)0.714s11.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)104.752s (-2.6%)106.051s (-3.2%)1.299s11.00x
▲ VercelNitro105.366s (~)107.231s (+0.8%)1.865s11.01x
▲ VercelExpress107.446s (~)108.516s (-0.8%)1.070s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.364s (-2.8%)2.005s (~)0.641s151.00x
💻 LocalNitro1.416s (+5.2% 🔺)2.006s (~)0.589s151.04x
💻 LocalNext.js (Turbopack)1.439s (+2.9%)2.005s (~)0.566s151.06x
🐘 PostgresNitro2.399s (+2.5%)3.014s (~)0.615s101.76x
🐘 PostgresExpress2.442s (+5.5% 🔺)3.013s (~)0.571s101.79x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.926s (-4.4%)4.660s (+1.9%)1.735s71.00x
▲ VercelNitro3.194s (+12.9% 🔺)4.537s (+8.8% 🔺)1.343s71.09x
▲ VercelNext.js (Turbopack)3.924s (+16.9% 🔺)5.490s (+11.2% 🔺)1.566s61.34x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.264s (-12.0% 🟢)3.007s (~)0.744s101.00x
💻 LocalNitro2.573s (+14.2% 🔺)3.007s (~)0.434s101.14x
💻 LocalNext.js (Turbopack)2.582s (+4.4%)3.007s (~)0.425s101.14x
🐘 PostgresNitro8.428s (+14.2% 🔺)8.780s (+9.4% 🔺)0.351s43.72x
🐘 PostgresExpress9.486s (+11.9% 🔺)10.034s (+11.1% 🔺)0.548s34.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.139s (-17.1% 🟢)4.080s (-23.3% 🟢)0.940s81.00x
▲ VercelNext.js (Turbopack)3.348s (-30.6% 🟢)4.921s (-23.5% 🟢)1.573s71.07x
▲ VercelNitro3.448s (-9.0% 🟢)4.700s (-13.8% 🟢)1.253s71.10x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express6.274s (-13.9% 🟢)7.013s (-12.6% 🟢)0.739s51.00x
💻 LocalNext.js (Turbopack)6.877s (-1.6%)7.416s (-4.5%)0.539s51.10x
💻 LocalNitro7.179s (+11.3% 🔺)7.771s (+10.8% 🔺)0.592s41.14x
🐘 PostgresNitro46.457s (+5.7% 🔺)47.114s (+6.8% 🔺)0.657s17.40x
🐘 PostgresExpress50.619s (+9.0% 🔺)51.116s (+8.5% 🔺)0.497s18.07x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.332s (+9.8% 🔺)6.845s (+1.2%)1.513s51.00x
▲ VercelNext.js (Turbopack)6.969s (+10.2% 🔺)8.608s (+6.6% 🔺)1.639s41.31x
▲ VercelExpress7.277s (+114.1% 🔺)8.272s (+63.1% 🔺)0.995s41.36x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.376s (-3.4%)2.004s (~)0.629s151.00x
💻 LocalNitro1.399s (+0.8%)2.004s (~)0.605s151.02x
💻 LocalNext.js (Turbopack)1.416s (-1.1%)2.005s (~)0.589s151.03x
🐘 PostgresNitro2.102s (+11.5% 🔺)2.597s (+3.4%)0.495s121.53x
🐘 PostgresExpress2.133s (+2.2%)2.595s (-5.4% 🟢)0.462s121.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.309s (+190.4% 🔺)9.555s (+136.6% 🔺)1.246s41.00x
▲ VercelNitro10.590s (+286.2% 🔺)12.117s (+199.4% 🔺)1.527s31.27x
▲ VercelNext.js (Turbopack)12.175s (+299.5% 🔺)13.496s (+206.2% 🔺)1.321s31.47x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.479s (-8.9% 🟢)3.007s (~)0.528s101.00x
💻 LocalNext.js (Turbopack)2.515s (-5.4% 🟢)3.007s (~)0.492s101.01x
💻 LocalNitro2.688s (+9.9% 🔺)3.006s (~)0.318s101.08x
🐘 PostgresNitro10.606s (-9.0% 🟢)11.361s (-5.6% 🟢)0.755s34.28x
🐘 PostgresExpress12.147s (+16.5% 🔺)13.039s (+18.2% 🔺)0.892s34.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.017s (-47.8% 🟢)4.244s (-42.0% 🟢)1.226s81.00x
▲ VercelExpress3.152s (-31.5% 🟢)4.116s (-35.6% 🟢)0.964s81.04x
▲ VercelNitro3.922s (-23.6% 🟢)5.358s (-16.3% 🟢)1.435s61.30x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.333s (-7.4% 🟢)8.018s (-3.1%)0.684s41.00x
💻 LocalNext.js (Turbopack)7.683s (-3.4%)8.013s (-5.9% 🟢)0.330s41.05x
💻 LocalNitro7.751s (+10.6% 🔺)8.022s (+8.2% 🔺)0.271s41.06x
🐘 PostgresNitro50.836s (-4.6%)51.112s (-5.5% 🟢)0.276s16.93x
🐘 PostgresExpress52.327s (+4.3%)53.100s (+3.9%)0.773s17.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.357s (-64.5% 🟢)5.385s (-51.6% 🟢)2.029s61.00x
▲ VercelExpress3.784s (-48.0% 🟢)5.187s (-39.9% 🟢)1.403s61.13x
▲ VercelNitro4.435s (-44.0% 🟢)5.609s (-40.0% 🟢)1.175s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.116s (-32.8% 🟢)1.002s (~)0.009s (-15.8% 🟢)1.013s (~)0.897s101.00x
💻 LocalNext.js (Turbopack)0.141s (-2.5%)1.001s (~)0.010s (-5.6% 🟢)1.015s (~)0.874s101.22x
💻 LocalNitro0.171s (+52.6% 🔺)1.002s (~)0.010s (+8.5% 🔺)1.015s (~)0.844s101.47x
🐘 PostgresExpress2.147s (-8.9% 🟢)2.895s (+7.9% 🔺)0.001s (-8.3% 🟢)3.014s (~)0.867s1018.48x
🐘 PostgresNitro2.452s (+2.4%)2.590s (-2.2%)0.001s (-15.4% 🟢)3.014s (~)0.562s1021.10x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.803s (+3.1%)3.346s (+6.2% 🔺)0.168s (-38.5% 🟢)4.378s (~)1.575s101.00x
▲ VercelNext.js (Turbopack)2.893s (+6.9% 🔺)3.221s (+1.2%)0.203s (+45.1% 🔺)4.336s (+2.7%)1.443s101.03x
▲ VercelExpress3.186s (+18.0% 🔺)3.631s (+6.7% 🔺)0.221s (+57.7% 🔺)4.679s (+6.2% 🔺)1.493s101.14x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresNitro9/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)💻 Local11/12
Nitro💻 Local10/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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

Sign up for freeto 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

@TooTallNate@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Support step function serialization in "client" mode - #924

Merged
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode
Feb 7, 2026
Merged

Support step function serialization in "client" mode#924
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
Member

Added support for step function serialization in client mode by setting the stepId property and registering step functions.

What changed?

  • Added a stepId property to step functions in registerStepFunction to support serialization
  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated the client mode transformation to preserve step function bodies while also registering them
  • Updated the plugin specification documentation to reflect these changes
  • Added appropriate imports for registerStepFunction in client mode output

How to test?

  1. Create a workflow that passes step functions as arguments to other step functions
  2. Run the workflow in client mode
  3. Verify that step functions are properly serialized and can be passed between boundaries
  4. Check that step functions maintain their identity when passed as arguments or returned from other functions

Why make this change?

This change enables proper serialization of step functions in client mode. Previously, step functions in client mode weren't registered, which meant they couldn't be properly serialized when passed as arguments to start() or returned from other step functions. By setting the stepId property and registering step functions in client mode, we ensure consistent behavior between client and server modes when step functions are passed across boundaries.

@changeset-bot

changeset-botBot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cee25ef

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

This PR includes changesets to release 15 packages
NameType
@workflow/corePatch
@workflow/swc-pluginPatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production490038528
✅ 💻 Local Development418062480
✅ 📦 Local Production418062480
✅ 🐘 Local Postgres418062480
✅ 🪟 Windows450348
❌ 🌍 Community Worlds2916312204
✅ 📋 Other123021144
Total19411632602364

❌ Failed Tests

🌍 Community Worlds (163 failed)

mongodb (40 failed):

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

redis (40 failed):

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

starter (42 failed):

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

turso (41 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4404
✅ example4404
✅ express4404
✅ fastify4404
✅ hono4404
✅ nextjs-turbopack4701
✅ nextjs-webpack4701
✅ nitro4404
✅ nuxt4404
✅ sveltekit4404
✅ vite4404
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4503
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb5403
✅ redis-dev300
❌ redis5403
✅ starter-dev300
❌ starter3423
✅ turso-dev300
❌ turso4413
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4107
✅ e2e-local-postgres-nest-stable4107
✅ e2e-local-prod-nest-stable4107

📋 View full workflow run

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

@TooTallNate
TooTallNate marked this pull request as ready for review February 3, 2026 19:57
@TooTallNateGraphite App

TooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
MemberAuthor

CopilotAI review requested due to automatic review settings February 3, 2026 20:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for step function serialization in client mode by registering step functions and setting their stepId property. This enables step functions to be properly serialized when passed as arguments to start() or returned from other step functions.

Changes:

  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated registerStepFunction in packages/core/src/private.ts to set the stepId property on functions for serialization support
  • Added a custom StepFunction reviver in getWorkflowRevivers that wraps deserialized step functions with the useStep wrapper when in workflow context, allowing them to be called directly from workflow code
  • Updated test fixtures to include registerStepFunction calls and necessary imports in client mode outputs
  • Added an E2E test and example code demonstrating step functions being passed as arguments to start()

Reviewed changes

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

Show a summary per file
FileDescription
packages/core/src/private.tsAdded stepId property to StepFunction type and modified registerStepFunction to set it
packages/core/src/serialization.tsAdded custom StepFunction reviver in getWorkflowRevivers that returns useStep wrapper in workflow context
packages/swc-plugin-workflow/transform/src/lib.rsModified client mode transformation to register step functions and added import generation
packages/swc-plugin-workflow/spec.mdUpdated documentation to reflect client mode step registration
workbench/example/workflows/99_e2e.tsAdded test workflow and step functions for E2E testing
workbench/example/api/trigger.tsAdded support for injecting step function references as test arguments
packages/core/e2e/e2e.test.tsAdded E2E test for step function serialization
Multiple test fixturesUpdated expected outputs to include registerStepFunction calls
.changeset/*.mdAdded changeset entries for the changes

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

Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
@github-actions

github-actionsBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.026s (-18.8% 🟢)1.004s (~)0.978s101.00x
💻 LocalNitro0.032s (+21.5% 🔺)1.004s (~)0.972s101.24x
💻 LocalNext.js (Turbopack)0.040s (+1.0%)1.005s (~)0.965s101.52x
🐘 PostgresNitro0.140s (-68.2% 🟢)1.013s (-1.2%)0.873s105.37x
🐘 PostgresExpress0.173s (-43.6% 🟢)1.009s (-2.3%)0.836s106.65x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.786s (-9.6% 🟢)2.388s (-10.0% 🟢)1.602s101.00x
▲ VercelNext.js (Turbopack)0.826s (-17.5% 🟢)2.554s (-10.0% 🟢)1.728s101.05x
▲ VercelNitro0.887s (-6.4% 🟢)2.760s (+7.0% 🔺)1.874s101.13x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.074s (-2.9%)2.005s (~)0.930s101.00x
💻 LocalNext.js (Turbopack)1.101s (~)2.005s (~)0.904s101.03x
💻 LocalNitro1.105s (+2.9%)2.005s (~)0.900s101.03x
🐘 PostgresExpress2.256s (+0.8%)3.013s (~)0.757s102.10x
🐘 PostgresNitro2.470s (+6.2% 🔺)3.014s (~)0.545s102.30x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.678s (-2.1%)3.821s (-6.4% 🟢)1.143s101.00x
▲ VercelNitro2.780s (+1.4%)4.039s (+2.3%)1.259s101.04x
▲ VercelNext.js (Turbopack)2.801s (-0.9%)3.955s (-3.6%)1.154s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.562s (-2.5%)11.021s (~)0.458s31.00x
💻 LocalNext.js (Turbopack)10.707s (~)11.021s (~)0.314s31.01x
💻 LocalNitro10.817s (+2.5%)11.021s (~)0.203s31.02x
🐘 PostgresNitro20.342s (+0.6%)21.060s (~)0.718s21.93x
🐘 PostgresExpress20.456s (+1.7%)21.053s (~)0.597s21.94x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.520s (+1.1%)21.320s (+5.3% 🔺)1.800s21.00x
▲ VercelNext.js (Turbopack)19.956s (-1.5%)21.187s (-2.1%)1.230s21.02x
▲ VercelExpress19.983s (-1.2%)21.127s (-3.7%)1.144s21.02x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.802s (-2.5%)27.048s (-3.6%)0.246s31.00x
💻 LocalNext.js (Turbopack)27.161s (~)28.051s (~)0.889s31.01x
💻 LocalNitro27.458s (+2.6%)28.048s (+3.7%)0.590s31.02x
🐘 PostgresExpress50.305s (~)51.130s (~)0.825s21.88x
🐘 PostgresNitro50.392s (~)51.127s (~)0.736s21.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro49.602s (-3.3%)50.839s (-3.5%)1.237s21.00x
▲ VercelNext.js (Turbopack)50.457s (-3.9%)51.889s (-4.7%)1.432s21.02x
▲ VercelExpress51.941s (~)52.982s (-1.2%)1.041s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express55.697s (-2.7%)56.099s (-3.4%)0.401s21.00x
💻 LocalNext.js (Turbopack)56.536s (~)57.097s (~)0.561s21.02x
💻 LocalNitro57.110s (+2.7%)57.601s (+2.7%)0.491s21.03x
🐘 PostgresNitro100.340s (~)101.245s (~)0.905s11.80x
🐘 PostgresExpress100.510s (~)101.224s (+1.0%)0.714s11.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)104.752s (-2.6%)106.051s (-3.2%)1.299s11.00x
▲ VercelNitro105.366s (~)107.231s (+0.8%)1.865s11.01x
▲ VercelExpress107.446s (~)108.516s (-0.8%)1.070s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.364s (-2.8%)2.005s (~)0.641s151.00x
💻 LocalNitro1.416s (+5.2% 🔺)2.006s (~)0.589s151.04x
💻 LocalNext.js (Turbopack)1.439s (+2.9%)2.005s (~)0.566s151.06x
🐘 PostgresNitro2.399s (+2.5%)3.014s (~)0.615s101.76x
🐘 PostgresExpress2.442s (+5.5% 🔺)3.013s (~)0.571s101.79x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.926s (-4.4%)4.660s (+1.9%)1.735s71.00x
▲ VercelNitro3.194s (+12.9% 🔺)4.537s (+8.8% 🔺)1.343s71.09x
▲ VercelNext.js (Turbopack)3.924s (+16.9% 🔺)5.490s (+11.2% 🔺)1.566s61.34x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.264s (-12.0% 🟢)3.007s (~)0.744s101.00x
💻 LocalNitro2.573s (+14.2% 🔺)3.007s (~)0.434s101.14x
💻 LocalNext.js (Turbopack)2.582s (+4.4%)3.007s (~)0.425s101.14x
🐘 PostgresNitro8.428s (+14.2% 🔺)8.780s (+9.4% 🔺)0.351s43.72x
🐘 PostgresExpress9.486s (+11.9% 🔺)10.034s (+11.1% 🔺)0.548s34.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.139s (-17.1% 🟢)4.080s (-23.3% 🟢)0.940s81.00x
▲ VercelNext.js (Turbopack)3.348s (-30.6% 🟢)4.921s (-23.5% 🟢)1.573s71.07x
▲ VercelNitro3.448s (-9.0% 🟢)4.700s (-13.8% 🟢)1.253s71.10x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express6.274s (-13.9% 🟢)7.013s (-12.6% 🟢)0.739s51.00x
💻 LocalNext.js (Turbopack)6.877s (-1.6%)7.416s (-4.5%)0.539s51.10x
💻 LocalNitro7.179s (+11.3% 🔺)7.771s (+10.8% 🔺)0.592s41.14x
🐘 PostgresNitro46.457s (+5.7% 🔺)47.114s (+6.8% 🔺)0.657s17.40x
🐘 PostgresExpress50.619s (+9.0% 🔺)51.116s (+8.5% 🔺)0.497s18.07x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.332s (+9.8% 🔺)6.845s (+1.2%)1.513s51.00x
▲ VercelNext.js (Turbopack)6.969s (+10.2% 🔺)8.608s (+6.6% 🔺)1.639s41.31x
▲ VercelExpress7.277s (+114.1% 🔺)8.272s (+63.1% 🔺)0.995s41.36x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.376s (-3.4%)2.004s (~)0.629s151.00x
💻 LocalNitro1.399s (+0.8%)2.004s (~)0.605s151.02x
💻 LocalNext.js (Turbopack)1.416s (-1.1%)2.005s (~)0.589s151.03x
🐘 PostgresNitro2.102s (+11.5% 🔺)2.597s (+3.4%)0.495s121.53x
🐘 PostgresExpress2.133s (+2.2%)2.595s (-5.4% 🟢)0.462s121.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.309s (+190.4% 🔺)9.555s (+136.6% 🔺)1.246s41.00x
▲ VercelNitro10.590s (+286.2% 🔺)12.117s (+199.4% 🔺)1.527s31.27x
▲ VercelNext.js (Turbopack)12.175s (+299.5% 🔺)13.496s (+206.2% 🔺)1.321s31.47x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.479s (-8.9% 🟢)3.007s (~)0.528s101.00x
💻 LocalNext.js (Turbopack)2.515s (-5.4% 🟢)3.007s (~)0.492s101.01x
💻 LocalNitro2.688s (+9.9% 🔺)3.006s (~)0.318s101.08x
🐘 PostgresNitro10.606s (-9.0% 🟢)11.361s (-5.6% 🟢)0.755s34.28x
🐘 PostgresExpress12.147s (+16.5% 🔺)13.039s (+18.2% 🔺)0.892s34.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.017s (-47.8% 🟢)4.244s (-42.0% 🟢)1.226s81.00x
▲ VercelExpress3.152s (-31.5% 🟢)4.116s (-35.6% 🟢)0.964s81.04x
▲ VercelNitro3.922s (-23.6% 🟢)5.358s (-16.3% 🟢)1.435s61.30x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.333s (-7.4% 🟢)8.018s (-3.1%)0.684s41.00x
💻 LocalNext.js (Turbopack)7.683s (-3.4%)8.013s (-5.9% 🟢)0.330s41.05x
💻 LocalNitro7.751s (+10.6% 🔺)8.022s (+8.2% 🔺)0.271s41.06x
🐘 PostgresNitro50.836s (-4.6%)51.112s (-5.5% 🟢)0.276s16.93x
🐘 PostgresExpress52.327s (+4.3%)53.100s (+3.9%)0.773s17.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.357s (-64.5% 🟢)5.385s (-51.6% 🟢)2.029s61.00x
▲ VercelExpress3.784s (-48.0% 🟢)5.187s (-39.9% 🟢)1.403s61.13x
▲ VercelNitro4.435s (-44.0% 🟢)5.609s (-40.0% 🟢)1.175s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.116s (-32.8% 🟢)1.002s (~)0.009s (-15.8% 🟢)1.013s (~)0.897s101.00x
💻 LocalNext.js (Turbopack)0.141s (-2.5%)1.001s (~)0.010s (-5.6% 🟢)1.015s (~)0.874s101.22x
💻 LocalNitro0.171s (+52.6% 🔺)1.002s (~)0.010s (+8.5% 🔺)1.015s (~)0.844s101.47x
🐘 PostgresExpress2.147s (-8.9% 🟢)2.895s (+7.9% 🔺)0.001s (-8.3% 🟢)3.014s (~)0.867s1018.48x
🐘 PostgresNitro2.452s (+2.4%)2.590s (-2.2%)0.001s (-15.4% 🟢)3.014s (~)0.562s1021.10x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.803s (+3.1%)3.346s (+6.2% 🔺)0.168s (-38.5% 🟢)4.378s (~)1.575s101.00x
▲ VercelNext.js (Turbopack)2.893s (+6.9% 🔺)3.221s (+1.2%)0.203s (+45.1% 🔺)4.336s (+2.7%)1.443s101.03x
▲ VercelExpress3.186s (+18.0% 🔺)3.631s (+6.7% 🔺)0.221s (+57.7% 🔺)4.679s (+6.2% 🔺)1.493s101.14x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresNitro9/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)💻 Local11/12
Nitro💻 Local10/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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

Sign up for freeto 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

@TooTallNate@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Support step function serialization in "client" mode - #924

Merged
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode
Feb 7, 2026
Merged

Support step function serialization in "client" mode#924
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
Member

Added support for step function serialization in client mode by setting the stepId property and registering step functions.

What changed?

  • Added a stepId property to step functions in registerStepFunction to support serialization
  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated the client mode transformation to preserve step function bodies while also registering them
  • Updated the plugin specification documentation to reflect these changes
  • Added appropriate imports for registerStepFunction in client mode output

How to test?

  1. Create a workflow that passes step functions as arguments to other step functions
  2. Run the workflow in client mode
  3. Verify that step functions are properly serialized and can be passed between boundaries
  4. Check that step functions maintain their identity when passed as arguments or returned from other functions

Why make this change?

This change enables proper serialization of step functions in client mode. Previously, step functions in client mode weren't registered, which meant they couldn't be properly serialized when passed as arguments to start() or returned from other step functions. By setting the stepId property and registering step functions in client mode, we ensure consistent behavior between client and server modes when step functions are passed across boundaries.

@changeset-bot

changeset-botBot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cee25ef

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

This PR includes changesets to release 15 packages
NameType
@workflow/corePatch
@workflow/swc-pluginPatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production490038528
✅ 💻 Local Development418062480
✅ 📦 Local Production418062480
✅ 🐘 Local Postgres418062480
✅ 🪟 Windows450348
❌ 🌍 Community Worlds2916312204
✅ 📋 Other123021144
Total19411632602364

❌ Failed Tests

🌍 Community Worlds (163 failed)

mongodb (40 failed):

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

redis (40 failed):

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

starter (42 failed):

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

turso (41 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4404
✅ example4404
✅ express4404
✅ fastify4404
✅ hono4404
✅ nextjs-turbopack4701
✅ nextjs-webpack4701
✅ nitro4404
✅ nuxt4404
✅ sveltekit4404
✅ vite4404
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4503
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb5403
✅ redis-dev300
❌ redis5403
✅ starter-dev300
❌ starter3423
✅ turso-dev300
❌ turso4413
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4107
✅ e2e-local-postgres-nest-stable4107
✅ e2e-local-prod-nest-stable4107

📋 View full workflow run

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

@TooTallNate
TooTallNate marked this pull request as ready for review February 3, 2026 19:57
@TooTallNateGraphite App

TooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
MemberAuthor

CopilotAI review requested due to automatic review settings February 3, 2026 20:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for step function serialization in client mode by registering step functions and setting their stepId property. This enables step functions to be properly serialized when passed as arguments to start() or returned from other step functions.

Changes:

  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated registerStepFunction in packages/core/src/private.ts to set the stepId property on functions for serialization support
  • Added a custom StepFunction reviver in getWorkflowRevivers that wraps deserialized step functions with the useStep wrapper when in workflow context, allowing them to be called directly from workflow code
  • Updated test fixtures to include registerStepFunction calls and necessary imports in client mode outputs
  • Added an E2E test and example code demonstrating step functions being passed as arguments to start()

Reviewed changes

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

Show a summary per file
FileDescription
packages/core/src/private.tsAdded stepId property to StepFunction type and modified registerStepFunction to set it
packages/core/src/serialization.tsAdded custom StepFunction reviver in getWorkflowRevivers that returns useStep wrapper in workflow context
packages/swc-plugin-workflow/transform/src/lib.rsModified client mode transformation to register step functions and added import generation
packages/swc-plugin-workflow/spec.mdUpdated documentation to reflect client mode step registration
workbench/example/workflows/99_e2e.tsAdded test workflow and step functions for E2E testing
workbench/example/api/trigger.tsAdded support for injecting step function references as test arguments
packages/core/e2e/e2e.test.tsAdded E2E test for step function serialization
Multiple test fixturesUpdated expected outputs to include registerStepFunction calls
.changeset/*.mdAdded changeset entries for the changes

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

Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
@github-actions

github-actionsBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.026s (-18.8% 🟢)1.004s (~)0.978s101.00x
💻 LocalNitro0.032s (+21.5% 🔺)1.004s (~)0.972s101.24x
💻 LocalNext.js (Turbopack)0.040s (+1.0%)1.005s (~)0.965s101.52x
🐘 PostgresNitro0.140s (-68.2% 🟢)1.013s (-1.2%)0.873s105.37x
🐘 PostgresExpress0.173s (-43.6% 🟢)1.009s (-2.3%)0.836s106.65x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.786s (-9.6% 🟢)2.388s (-10.0% 🟢)1.602s101.00x
▲ VercelNext.js (Turbopack)0.826s (-17.5% 🟢)2.554s (-10.0% 🟢)1.728s101.05x
▲ VercelNitro0.887s (-6.4% 🟢)2.760s (+7.0% 🔺)1.874s101.13x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.074s (-2.9%)2.005s (~)0.930s101.00x
💻 LocalNext.js (Turbopack)1.101s (~)2.005s (~)0.904s101.03x
💻 LocalNitro1.105s (+2.9%)2.005s (~)0.900s101.03x
🐘 PostgresExpress2.256s (+0.8%)3.013s (~)0.757s102.10x
🐘 PostgresNitro2.470s (+6.2% 🔺)3.014s (~)0.545s102.30x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.678s (-2.1%)3.821s (-6.4% 🟢)1.143s101.00x
▲ VercelNitro2.780s (+1.4%)4.039s (+2.3%)1.259s101.04x
▲ VercelNext.js (Turbopack)2.801s (-0.9%)3.955s (-3.6%)1.154s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.562s (-2.5%)11.021s (~)0.458s31.00x
💻 LocalNext.js (Turbopack)10.707s (~)11.021s (~)0.314s31.01x
💻 LocalNitro10.817s (+2.5%)11.021s (~)0.203s31.02x
🐘 PostgresNitro20.342s (+0.6%)21.060s (~)0.718s21.93x
🐘 PostgresExpress20.456s (+1.7%)21.053s (~)0.597s21.94x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.520s (+1.1%)21.320s (+5.3% 🔺)1.800s21.00x
▲ VercelNext.js (Turbopack)19.956s (-1.5%)21.187s (-2.1%)1.230s21.02x
▲ VercelExpress19.983s (-1.2%)21.127s (-3.7%)1.144s21.02x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.802s (-2.5%)27.048s (-3.6%)0.246s31.00x
💻 LocalNext.js (Turbopack)27.161s (~)28.051s (~)0.889s31.01x
💻 LocalNitro27.458s (+2.6%)28.048s (+3.7%)0.590s31.02x
🐘 PostgresExpress50.305s (~)51.130s (~)0.825s21.88x
🐘 PostgresNitro50.392s (~)51.127s (~)0.736s21.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro49.602s (-3.3%)50.839s (-3.5%)1.237s21.00x
▲ VercelNext.js (Turbopack)50.457s (-3.9%)51.889s (-4.7%)1.432s21.02x
▲ VercelExpress51.941s (~)52.982s (-1.2%)1.041s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express55.697s (-2.7%)56.099s (-3.4%)0.401s21.00x
💻 LocalNext.js (Turbopack)56.536s (~)57.097s (~)0.561s21.02x
💻 LocalNitro57.110s (+2.7%)57.601s (+2.7%)0.491s21.03x
🐘 PostgresNitro100.340s (~)101.245s (~)0.905s11.80x
🐘 PostgresExpress100.510s (~)101.224s (+1.0%)0.714s11.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)104.752s (-2.6%)106.051s (-3.2%)1.299s11.00x
▲ VercelNitro105.366s (~)107.231s (+0.8%)1.865s11.01x
▲ VercelExpress107.446s (~)108.516s (-0.8%)1.070s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.364s (-2.8%)2.005s (~)0.641s151.00x
💻 LocalNitro1.416s (+5.2% 🔺)2.006s (~)0.589s151.04x
💻 LocalNext.js (Turbopack)1.439s (+2.9%)2.005s (~)0.566s151.06x
🐘 PostgresNitro2.399s (+2.5%)3.014s (~)0.615s101.76x
🐘 PostgresExpress2.442s (+5.5% 🔺)3.013s (~)0.571s101.79x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.926s (-4.4%)4.660s (+1.9%)1.735s71.00x
▲ VercelNitro3.194s (+12.9% 🔺)4.537s (+8.8% 🔺)1.343s71.09x
▲ VercelNext.js (Turbopack)3.924s (+16.9% 🔺)5.490s (+11.2% 🔺)1.566s61.34x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.264s (-12.0% 🟢)3.007s (~)0.744s101.00x
💻 LocalNitro2.573s (+14.2% 🔺)3.007s (~)0.434s101.14x
💻 LocalNext.js (Turbopack)2.582s (+4.4%)3.007s (~)0.425s101.14x
🐘 PostgresNitro8.428s (+14.2% 🔺)8.780s (+9.4% 🔺)0.351s43.72x
🐘 PostgresExpress9.486s (+11.9% 🔺)10.034s (+11.1% 🔺)0.548s34.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.139s (-17.1% 🟢)4.080s (-23.3% 🟢)0.940s81.00x
▲ VercelNext.js (Turbopack)3.348s (-30.6% 🟢)4.921s (-23.5% 🟢)1.573s71.07x
▲ VercelNitro3.448s (-9.0% 🟢)4.700s (-13.8% 🟢)1.253s71.10x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express6.274s (-13.9% 🟢)7.013s (-12.6% 🟢)0.739s51.00x
💻 LocalNext.js (Turbopack)6.877s (-1.6%)7.416s (-4.5%)0.539s51.10x
💻 LocalNitro7.179s (+11.3% 🔺)7.771s (+10.8% 🔺)0.592s41.14x
🐘 PostgresNitro46.457s (+5.7% 🔺)47.114s (+6.8% 🔺)0.657s17.40x
🐘 PostgresExpress50.619s (+9.0% 🔺)51.116s (+8.5% 🔺)0.497s18.07x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.332s (+9.8% 🔺)6.845s (+1.2%)1.513s51.00x
▲ VercelNext.js (Turbopack)6.969s (+10.2% 🔺)8.608s (+6.6% 🔺)1.639s41.31x
▲ VercelExpress7.277s (+114.1% 🔺)8.272s (+63.1% 🔺)0.995s41.36x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.376s (-3.4%)2.004s (~)0.629s151.00x
💻 LocalNitro1.399s (+0.8%)2.004s (~)0.605s151.02x
💻 LocalNext.js (Turbopack)1.416s (-1.1%)2.005s (~)0.589s151.03x
🐘 PostgresNitro2.102s (+11.5% 🔺)2.597s (+3.4%)0.495s121.53x
🐘 PostgresExpress2.133s (+2.2%)2.595s (-5.4% 🟢)0.462s121.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.309s (+190.4% 🔺)9.555s (+136.6% 🔺)1.246s41.00x
▲ VercelNitro10.590s (+286.2% 🔺)12.117s (+199.4% 🔺)1.527s31.27x
▲ VercelNext.js (Turbopack)12.175s (+299.5% 🔺)13.496s (+206.2% 🔺)1.321s31.47x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.479s (-8.9% 🟢)3.007s (~)0.528s101.00x
💻 LocalNext.js (Turbopack)2.515s (-5.4% 🟢)3.007s (~)0.492s101.01x
💻 LocalNitro2.688s (+9.9% 🔺)3.006s (~)0.318s101.08x
🐘 PostgresNitro10.606s (-9.0% 🟢)11.361s (-5.6% 🟢)0.755s34.28x
🐘 PostgresExpress12.147s (+16.5% 🔺)13.039s (+18.2% 🔺)0.892s34.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.017s (-47.8% 🟢)4.244s (-42.0% 🟢)1.226s81.00x
▲ VercelExpress3.152s (-31.5% 🟢)4.116s (-35.6% 🟢)0.964s81.04x
▲ VercelNitro3.922s (-23.6% 🟢)5.358s (-16.3% 🟢)1.435s61.30x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.333s (-7.4% 🟢)8.018s (-3.1%)0.684s41.00x
💻 LocalNext.js (Turbopack)7.683s (-3.4%)8.013s (-5.9% 🟢)0.330s41.05x
💻 LocalNitro7.751s (+10.6% 🔺)8.022s (+8.2% 🔺)0.271s41.06x
🐘 PostgresNitro50.836s (-4.6%)51.112s (-5.5% 🟢)0.276s16.93x
🐘 PostgresExpress52.327s (+4.3%)53.100s (+3.9%)0.773s17.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.357s (-64.5% 🟢)5.385s (-51.6% 🟢)2.029s61.00x
▲ VercelExpress3.784s (-48.0% 🟢)5.187s (-39.9% 🟢)1.403s61.13x
▲ VercelNitro4.435s (-44.0% 🟢)5.609s (-40.0% 🟢)1.175s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.116s (-32.8% 🟢)1.002s (~)0.009s (-15.8% 🟢)1.013s (~)0.897s101.00x
💻 LocalNext.js (Turbopack)0.141s (-2.5%)1.001s (~)0.010s (-5.6% 🟢)1.015s (~)0.874s101.22x
💻 LocalNitro0.171s (+52.6% 🔺)1.002s (~)0.010s (+8.5% 🔺)1.015s (~)0.844s101.47x
🐘 PostgresExpress2.147s (-8.9% 🟢)2.895s (+7.9% 🔺)0.001s (-8.3% 🟢)3.014s (~)0.867s1018.48x
🐘 PostgresNitro2.452s (+2.4%)2.590s (-2.2%)0.001s (-15.4% 🟢)3.014s (~)0.562s1021.10x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.803s (+3.1%)3.346s (+6.2% 🔺)0.168s (-38.5% 🟢)4.378s (~)1.575s101.00x
▲ VercelNext.js (Turbopack)2.893s (+6.9% 🔺)3.221s (+1.2%)0.203s (+45.1% 🔺)4.336s (+2.7%)1.443s101.03x
▲ VercelExpress3.186s (+18.0% 🔺)3.631s (+6.7% 🔺)0.221s (+57.7% 🔺)4.679s (+6.2% 🔺)1.493s101.14x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresNitro9/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)💻 Local11/12
Nitro💻 Local10/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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

Sign up for freeto 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

@TooTallNate@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Support step function serialization in "client" mode - #924

Merged
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode
Feb 7, 2026
Merged

Support step function serialization in "client" mode#924
TooTallNate merged 1 commit into
mainfrom
02-03-support_step_function_serialization_in_client_mode

Conversation

@TooTallNate

@TooTallNateTooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
Member

Added support for step function serialization in client mode by setting the stepId property and registering step functions.

What changed?

  • Added a stepId property to step functions in registerStepFunction to support serialization
  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated the client mode transformation to preserve step function bodies while also registering them
  • Updated the plugin specification documentation to reflect these changes
  • Added appropriate imports for registerStepFunction in client mode output

How to test?

  1. Create a workflow that passes step functions as arguments to other step functions
  2. Run the workflow in client mode
  3. Verify that step functions are properly serialized and can be passed between boundaries
  4. Check that step functions maintain their identity when passed as arguments or returned from other functions

Why make this change?

This change enables proper serialization of step functions in client mode. Previously, step functions in client mode weren't registered, which meant they couldn't be properly serialized when passed as arguments to start() or returned from other step functions. By setting the stepId property and registering step functions in client mode, we ensure consistent behavior between client and server modes when step functions are passed across boundaries.

@changeset-bot

changeset-botBot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cee25ef

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

This PR includes changesets to release 15 packages
NameType
@workflow/corePatch
@workflow/swc-pluginPatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production490038528
✅ 💻 Local Development418062480
✅ 📦 Local Production418062480
✅ 🐘 Local Postgres418062480
✅ 🪟 Windows450348
❌ 🌍 Community Worlds2916312204
✅ 📋 Other123021144
Total19411632602364

❌ Failed Tests

🌍 Community Worlds (163 failed)

mongodb (40 failed):

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

redis (40 failed):

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

starter (42 failed):

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

turso (41 failed):

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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro4404
✅ example4404
✅ express4404
✅ fastify4404
✅ hono4404
✅ nextjs-turbopack4701
✅ nextjs-webpack4701
✅ nitro4404
✅ nuxt4404
✅ sveltekit4404
✅ vite4404
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4107
✅ express-stable4107
✅ fastify-stable4107
✅ hono-stable4107
✅ nextjs-turbopack-stable4503
✅ nextjs-webpack-stable4503
✅ nitro-stable4107
✅ nuxt-stable4107
✅ sveltekit-stable4107
✅ vite-stable4107
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4503
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb5403
✅ redis-dev300
❌ redis5403
✅ starter-dev300
❌ starter3423
✅ turso-dev300
❌ turso4413
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4107
✅ e2e-local-postgres-nest-stable4107
✅ e2e-local-prod-nest-stable4107

📋 View full workflow run

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

@TooTallNate
TooTallNate marked this pull request as ready for review February 3, 2026 19:57
@TooTallNateGraphite App

TooTallNate commented Feb 3, 2026

Copy link
Copy Markdown
MemberAuthor

CopilotAI review requested due to automatic review settings February 3, 2026 20:40

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for step function serialization in client mode by registering step functions and setting their stepId property. This enables step functions to be properly serialized when passed as arguments to start() or returned from other step functions.

Changes:

  • Modified the SWC plugin to call registerStepFunction() on step functions in client mode
  • Updated registerStepFunction in packages/core/src/private.ts to set the stepId property on functions for serialization support
  • Added a custom StepFunction reviver in getWorkflowRevivers that wraps deserialized step functions with the useStep wrapper when in workflow context, allowing them to be called directly from workflow code
  • Updated test fixtures to include registerStepFunction calls and necessary imports in client mode outputs
  • Added an E2E test and example code demonstrating step functions being passed as arguments to start()

Reviewed changes

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

Show a summary per file
FileDescription
packages/core/src/private.tsAdded stepId property to StepFunction type and modified registerStepFunction to set it
packages/core/src/serialization.tsAdded custom StepFunction reviver in getWorkflowRevivers that returns useStep wrapper in workflow context
packages/swc-plugin-workflow/transform/src/lib.rsModified client mode transformation to register step functions and added import generation
packages/swc-plugin-workflow/spec.mdUpdated documentation to reflect client mode step registration
workbench/example/workflows/99_e2e.tsAdded test workflow and step functions for E2E testing
workbench/example/api/trigger.tsAdded support for injecting step function references as test arguments
packages/core/e2e/e2e.test.tsAdded E2E test for step function serialization
Multiple test fixturesUpdated expected outputs to include registerStepFunction calls
.changeset/*.mdAdded changeset entries for the changes

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

Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
Comment threadpackages/swc-plugin-workflow/transform/src/lib.rs Outdated
@github-actions

github-actionsBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.026s (-18.8% 🟢)1.004s (~)0.978s101.00x
💻 LocalNitro0.032s (+21.5% 🔺)1.004s (~)0.972s101.24x
💻 LocalNext.js (Turbopack)0.040s (+1.0%)1.005s (~)0.965s101.52x
🐘 PostgresNitro0.140s (-68.2% 🟢)1.013s (-1.2%)0.873s105.37x
🐘 PostgresExpress0.173s (-43.6% 🟢)1.009s (-2.3%)0.836s106.65x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.786s (-9.6% 🟢)2.388s (-10.0% 🟢)1.602s101.00x
▲ VercelNext.js (Turbopack)0.826s (-17.5% 🟢)2.554s (-10.0% 🟢)1.728s101.05x
▲ VercelNitro0.887s (-6.4% 🟢)2.760s (+7.0% 🔺)1.874s101.13x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.074s (-2.9%)2.005s (~)0.930s101.00x
💻 LocalNext.js (Turbopack)1.101s (~)2.005s (~)0.904s101.03x
💻 LocalNitro1.105s (+2.9%)2.005s (~)0.900s101.03x
🐘 PostgresExpress2.256s (+0.8%)3.013s (~)0.757s102.10x
🐘 PostgresNitro2.470s (+6.2% 🔺)3.014s (~)0.545s102.30x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.678s (-2.1%)3.821s (-6.4% 🟢)1.143s101.00x
▲ VercelNitro2.780s (+1.4%)4.039s (+2.3%)1.259s101.04x
▲ VercelNext.js (Turbopack)2.801s (-0.9%)3.955s (-3.6%)1.154s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.562s (-2.5%)11.021s (~)0.458s31.00x
💻 LocalNext.js (Turbopack)10.707s (~)11.021s (~)0.314s31.01x
💻 LocalNitro10.817s (+2.5%)11.021s (~)0.203s31.02x
🐘 PostgresNitro20.342s (+0.6%)21.060s (~)0.718s21.93x
🐘 PostgresExpress20.456s (+1.7%)21.053s (~)0.597s21.94x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.520s (+1.1%)21.320s (+5.3% 🔺)1.800s21.00x
▲ VercelNext.js (Turbopack)19.956s (-1.5%)21.187s (-2.1%)1.230s21.02x
▲ VercelExpress19.983s (-1.2%)21.127s (-3.7%)1.144s21.02x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express26.802s (-2.5%)27.048s (-3.6%)0.246s31.00x
💻 LocalNext.js (Turbopack)27.161s (~)28.051s (~)0.889s31.01x
💻 LocalNitro27.458s (+2.6%)28.048s (+3.7%)0.590s31.02x
🐘 PostgresExpress50.305s (~)51.130s (~)0.825s21.88x
🐘 PostgresNitro50.392s (~)51.127s (~)0.736s21.88x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro49.602s (-3.3%)50.839s (-3.5%)1.237s21.00x
▲ VercelNext.js (Turbopack)50.457s (-3.9%)51.889s (-4.7%)1.432s21.02x
▲ VercelExpress51.941s (~)52.982s (-1.2%)1.041s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express55.697s (-2.7%)56.099s (-3.4%)0.401s21.00x
💻 LocalNext.js (Turbopack)56.536s (~)57.097s (~)0.561s21.02x
💻 LocalNitro57.110s (+2.7%)57.601s (+2.7%)0.491s21.03x
🐘 PostgresNitro100.340s (~)101.245s (~)0.905s11.80x
🐘 PostgresExpress100.510s (~)101.224s (+1.0%)0.714s11.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)104.752s (-2.6%)106.051s (-3.2%)1.299s11.00x
▲ VercelNitro105.366s (~)107.231s (+0.8%)1.865s11.01x
▲ VercelExpress107.446s (~)108.516s (-0.8%)1.070s11.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.364s (-2.8%)2.005s (~)0.641s151.00x
💻 LocalNitro1.416s (+5.2% 🔺)2.006s (~)0.589s151.04x
💻 LocalNext.js (Turbopack)1.439s (+2.9%)2.005s (~)0.566s151.06x
🐘 PostgresNitro2.399s (+2.5%)3.014s (~)0.615s101.76x
🐘 PostgresExpress2.442s (+5.5% 🔺)3.013s (~)0.571s101.79x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.926s (-4.4%)4.660s (+1.9%)1.735s71.00x
▲ VercelNitro3.194s (+12.9% 🔺)4.537s (+8.8% 🔺)1.343s71.09x
▲ VercelNext.js (Turbopack)3.924s (+16.9% 🔺)5.490s (+11.2% 🔺)1.566s61.34x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.264s (-12.0% 🟢)3.007s (~)0.744s101.00x
💻 LocalNitro2.573s (+14.2% 🔺)3.007s (~)0.434s101.14x
💻 LocalNext.js (Turbopack)2.582s (+4.4%)3.007s (~)0.425s101.14x
🐘 PostgresNitro8.428s (+14.2% 🔺)8.780s (+9.4% 🔺)0.351s43.72x
🐘 PostgresExpress9.486s (+11.9% 🔺)10.034s (+11.1% 🔺)0.548s34.19x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.139s (-17.1% 🟢)4.080s (-23.3% 🟢)0.940s81.00x
▲ VercelNext.js (Turbopack)3.348s (-30.6% 🟢)4.921s (-23.5% 🟢)1.573s71.07x
▲ VercelNitro3.448s (-9.0% 🟢)4.700s (-13.8% 🟢)1.253s71.10x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express6.274s (-13.9% 🟢)7.013s (-12.6% 🟢)0.739s51.00x
💻 LocalNext.js (Turbopack)6.877s (-1.6%)7.416s (-4.5%)0.539s51.10x
💻 LocalNitro7.179s (+11.3% 🔺)7.771s (+10.8% 🔺)0.592s41.14x
🐘 PostgresNitro46.457s (+5.7% 🔺)47.114s (+6.8% 🔺)0.657s17.40x
🐘 PostgresExpress50.619s (+9.0% 🔺)51.116s (+8.5% 🔺)0.497s18.07x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.332s (+9.8% 🔺)6.845s (+1.2%)1.513s51.00x
▲ VercelNext.js (Turbopack)6.969s (+10.2% 🔺)8.608s (+6.6% 🔺)1.639s41.31x
▲ VercelExpress7.277s (+114.1% 🔺)8.272s (+63.1% 🔺)0.995s41.36x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.376s (-3.4%)2.004s (~)0.629s151.00x
💻 LocalNitro1.399s (+0.8%)2.004s (~)0.605s151.02x
💻 LocalNext.js (Turbopack)1.416s (-1.1%)2.005s (~)0.589s151.03x
🐘 PostgresNitro2.102s (+11.5% 🔺)2.597s (+3.4%)0.495s121.53x
🐘 PostgresExpress2.133s (+2.2%)2.595s (-5.4% 🟢)0.462s121.55x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express8.309s (+190.4% 🔺)9.555s (+136.6% 🔺)1.246s41.00x
▲ VercelNitro10.590s (+286.2% 🔺)12.117s (+199.4% 🔺)1.527s31.27x
▲ VercelNext.js (Turbopack)12.175s (+299.5% 🔺)13.496s (+206.2% 🔺)1.321s31.47x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.479s (-8.9% 🟢)3.007s (~)0.528s101.00x
💻 LocalNext.js (Turbopack)2.515s (-5.4% 🟢)3.007s (~)0.492s101.01x
💻 LocalNitro2.688s (+9.9% 🔺)3.006s (~)0.318s101.08x
🐘 PostgresNitro10.606s (-9.0% 🟢)11.361s (-5.6% 🟢)0.755s34.28x
🐘 PostgresExpress12.147s (+16.5% 🔺)13.039s (+18.2% 🔺)0.892s34.90x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.017s (-47.8% 🟢)4.244s (-42.0% 🟢)1.226s81.00x
▲ VercelExpress3.152s (-31.5% 🟢)4.116s (-35.6% 🟢)0.964s81.04x
▲ VercelNitro3.922s (-23.6% 🟢)5.358s (-16.3% 🟢)1.435s61.30x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.333s (-7.4% 🟢)8.018s (-3.1%)0.684s41.00x
💻 LocalNext.js (Turbopack)7.683s (-3.4%)8.013s (-5.9% 🟢)0.330s41.05x
💻 LocalNitro7.751s (+10.6% 🔺)8.022s (+8.2% 🔺)0.271s41.06x
🐘 PostgresNitro50.836s (-4.6%)51.112s (-5.5% 🟢)0.276s16.93x
🐘 PostgresExpress52.327s (+4.3%)53.100s (+3.9%)0.773s17.14x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.357s (-64.5% 🟢)5.385s (-51.6% 🟢)2.029s61.00x
▲ VercelExpress3.784s (-48.0% 🟢)5.187s (-39.9% 🟢)1.403s61.13x
▲ VercelNitro4.435s (-44.0% 🟢)5.609s (-40.0% 🟢)1.175s61.32x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.116s (-32.8% 🟢)1.002s (~)0.009s (-15.8% 🟢)1.013s (~)0.897s101.00x
💻 LocalNext.js (Turbopack)0.141s (-2.5%)1.001s (~)0.010s (-5.6% 🟢)1.015s (~)0.874s101.22x
💻 LocalNitro0.171s (+52.6% 🔺)1.002s (~)0.010s (+8.5% 🔺)1.015s (~)0.844s101.47x
🐘 PostgresExpress2.147s (-8.9% 🟢)2.895s (+7.9% 🔺)0.001s (-8.3% 🟢)3.014s (~)0.867s1018.48x
🐘 PostgresNitro2.452s (+2.4%)2.590s (-2.2%)0.001s (-15.4% 🟢)3.014s (~)0.562s1021.10x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.803s (+3.1%)3.346s (+6.2% 🔺)0.168s (-38.5% 🟢)4.378s (~)1.575s101.00x
▲ VercelNext.js (Turbopack)2.893s (+6.9% 🔺)3.221s (+1.2%)0.203s (+45.1% 🔺)4.336s (+2.7%)1.443s101.03x
▲ VercelExpress3.186s (+18.0% 🔺)3.631s (+6.7% 🔺)0.221s (+57.7% 🔺)4.679s (+6.2% 🔺)1.493s101.14x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress12/12
🐘 PostgresNitro9/12
▲ VercelExpress5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)💻 Local11/12
Nitro💻 Local10/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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

Sign up for freeto 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

@TooTallNate@VaguelySerious