Skip to content

Add discovered serializable classes in all context modes#874

Merged
TooTallNate merged 3 commits intomainfrom
01-27-add_discovered_serializable_classes_in_all_context_modes
Feb 3, 2026
Merged

Add discovered serializable classes in all context modes#874
TooTallNate merged 3 commits intomainfrom
01-27-add_discovered_serializable_classes_in_all_context_modes

Conversation

@TooTallNate
Copy link
Member

@TooTallNate TooTallNate commented Jan 27, 2026

This PR ensures that all classes with custom serialization are automatically included in all bundle contexts (step, workflow, client) to ensure proper serialization/deserialization when crossing execution boundaries:

  • Classes defined in any context can now be properly serialized when passing data between:

    • Client → Workflow (when starting workflows)
    • Workflow → Step (when calling steps)
    • Step → Workflow (when returning step results)
    • Workflow → Client (when returning workflow results)
  • The build system now automatically discovers all files containing serializable classes and includes them in each bundle, regardless of where the class is originally defined.

  • No manual configuration is required - cross-registration happens automatically during the build process.

@changeset-bot
Copy link

changeset-bot bot commented Jan 27, 2026

🦋 Changeset detected

Latest commit: 5894707

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

This PR includes changesets to release 16 packages
Name Type
@workflow/swc-plugin Patch
@workflow/builders Patch
@workflow/astro Patch
@workflow/cli Patch
@workflow/nest Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
workflow Patch
@workflow/world-testing Patch
@workflow/docs-typecheck Patch
@workflow/nuxt Patch
@workflow/core Patch
@workflow/web-shared Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 468 0 38 506
✅ 💻 Local Development 428 0 32 460
✅ 📦 Local Production 428 0 32 460
✅ 🐘 Local Postgres 428 0 32 460
✅ 🪟 Windows 46 0 0 46
❌ 🌍 Community Worlds 31 165 0 196
✅ 📋 Other 126 0 12 138
Total 1955 165 146 2266

❌ Failed Tests

🌍 Community Worlds (165 failed)

mongodb (41 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • 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
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

redis (41 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • 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
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • 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
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • 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 (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
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • 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
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • 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
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 42 0 4
✅ example 42 0 4
✅ express 42 0 4
✅ fastify 42 0 4
✅ hono 42 0 4
✅ nextjs-turbopack 45 0 1
✅ nextjs-webpack 45 0 1
✅ nitro 42 0 4
✅ nuxt 42 0 4
✅ sveltekit 42 0 4
✅ vite 42 0 4
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 42 0 4
✅ express-stable 42 0 4
✅ fastify-stable 42 0 4
✅ hono-stable 42 0 4
✅ nextjs-turbopack-stable 46 0 0
✅ nextjs-webpack-stable 46 0 0
✅ nitro-stable 42 0 4
✅ nuxt-stable 42 0 4
✅ sveltekit-stable 42 0 4
✅ vite-stable 42 0 4
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 42 0 4
✅ express-stable 42 0 4
✅ fastify-stable 42 0 4
✅ hono-stable 42 0 4
✅ nextjs-turbopack-stable 46 0 0
✅ nextjs-webpack-stable 46 0 0
✅ nitro-stable 42 0 4
✅ nuxt-stable 42 0 4
✅ sveltekit-stable 42 0 4
✅ vite-stable 42 0 4
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 42 0 4
✅ express-stable 42 0 4
✅ fastify-stable 42 0 4
✅ hono-stable 42 0 4
✅ nextjs-turbopack-stable 46 0 0
✅ nextjs-webpack-stable 46 0 0
✅ nitro-stable 42 0 4
✅ nuxt-stable 42 0 4
✅ sveltekit-stable 42 0 4
✅ vite-stable 42 0 4
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 46 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 0
❌ mongodb 5 41 0
✅ redis-dev 3 0 0
❌ redis 5 41 0
✅ starter-dev 3 0 0
❌ starter 4 42 0
✅ turso-dev 3 0 0
❌ turso 5 41 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 42 0 4
✅ e2e-local-postgres-nest-stable 42 0 4
✅ e2e-local-prod-nest-stable 42 0 4

📋 View full workflow run

@vercel
Copy link
Contributor

vercel bot commented Jan 27, 2026

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

Step bundle does not include discoveredSerdeFiles, breaking cross-context class deserialization for Workflow → Step boundaries

Fix on Vercel

Copy link
Member Author

TooTallNate commented Feb 3, 2026

Merge activity

@TooTallNate TooTallNate changed the base branch from 01-27-ensure_class_serialization___deserialization_only_happens_in_the_proper_global_context to graphite-base/874 February 3, 2026 07:23
@TooTallNate TooTallNate changed the base branch from graphite-base/874 to main February 3, 2026 07:24
All classes that are Workflow serializable need to be registered and available in all context modes (client, workflow, step).
@TooTallNate TooTallNate force-pushed the 01-27-add_discovered_serializable_classes_in_all_context_modes branch from ab3dd44 to 5894707 Compare February 3, 2026 07:25
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.043s (+0.9%) 1.008s (~) 0.965s 10 1.00x
🐘 Postgres Express 0.300s (+31.0% 🔺) 1.015s (~) 0.714s 10 6.92x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 0.688s (+17.6% 🔺) 1.552s (~) 0.864s 10 1.00x

🔍 Observability: Express

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.117s (~) 2.009s (~) 0.892s 10 1.00x
🐘 Postgres Express 2.143s (-5.2% 🟢) 3.015s (~) 0.872s 10 1.92x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.719s (-7.3% 🟢) 3.647s (-4.6%) 0.928s 10 1.00x

🔍 Observability: Express

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 10.851s (~) 11.017s (~) 0.166s 5 1.00x
🐘 Postgres Express 20.483s (+0.5%) 21.029s (~) 0.546s 5 1.89x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 22.691s (-2.5%) 23.271s (-2.4%) 0.580s 5 1.00x

🔍 Observability: Express

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 5.084s (-1.4%) 6.096s (-1.1%) 1.012s 5 1.00x
🐘 Postgres Express 28.372s (-0.6%) 29.149s (~) 0.777s 2 5.58x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.232s (-12.3% 🟢) 4.077s (-9.7% 🟢) 0.845s 8 1.00x

🔍 Observability: Express

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 5.231s (-1.2%) 6.232s (-0.9%) 1.001s 5 1.00x
🐘 Postgres Express 33.923s (+2.4%) 34.335s (+3.5%) 0.412s 1 6.48x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.122s (~) 3.685s (-1.0%) 0.563s 9 1.00x

🔍 Observability: Express

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 5.366s (~) 6.341s (~) 0.976s 5 1.00x
🐘 Postgres Express 28.939s (-17.1% 🟢) 29.654s (-15.8% 🟢) 0.714s 2 5.39x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.045s (-5.7% 🟢) 3.636s (-11.1% 🟢) 0.591s 9 1.00x

🔍 Observability: Express

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 5.575s (+1.9%) 6.546s (+1.6%) 0.971s 5 1.00x
🐘 Postgres Express 31.468s (-3.9%) 32.083s (-3.0%) 0.615s 1 5.64x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.397s (-25.3% 🟢) 4.011s (-25.3% 🟢) 0.614s 8 1.00x

🔍 Observability: Express

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.189s (+0.8%) 0.994s (~) 0.016s (+9.4% 🔺) 1.025s (~) 0.837s 10 1.00x
🐘 Postgres Express 2.298s (+7.2% 🔺) 2.744s (-5.4% 🟢) 0.000s (+100.0% 🔺) 3.014s (~) 0.716s 10 12.19x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.930s (-4.0%) 3.191s (-1.0%) 0.730s (-15.5% 🟢) 4.430s (-4.9%) 1.501s 10 1.00x

🔍 Observability: Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Express 8/8
🐘 Postgres Express 8/8
▲ Vercel Express 8/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 💻 Local 4/8
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

@TooTallNate TooTallNate merged commit b5296a7 into main Feb 3, 2026
66 of 79 checks passed
@TooTallNate TooTallNate deleted the 01-27-add_discovered_serializable_classes_in_all_context_modes branch February 3, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants