Skip to content

Change compiler ID generation logic to use Node.js import specifier#899

Merged
TooTallNate merged 7 commits intomainfrom
01-30-change_compiler_id_generation_logic_to_use_node.js_import_specifier
Feb 4, 2026
Merged

Change compiler ID generation logic to use Node.js import specifier#899
TooTallNate merged 7 commits intomainfrom
01-30-change_compiler_id_generation_logic_to_use_node.js_import_specifier

Conversation

@TooTallNate
Copy link
Copy Markdown
Member

@TooTallNate TooTallNate commented Jan 30, 2026

Summary

This PR changes how the SWC compiler generates IDs for workflows, steps, and classes. Instead of using raw file paths, IDs are now based on Node.js module specifiers when the file belongs to a package (either in node_modules or a workspace package).

Motivation

Previously, IDs were generated using file paths like step//src/jobs/order.ts//fetchData. This caused several issues:

  1. Package exports conditions: When a package uses conditional exports (e.g., "workflow" vs "default" conditions in package.json), the same import specifier can resolve to different files. Using file paths meant IDs could differ based on which export condition was used.
  2. Cross-bundle consistency: Classes serialized in one bundle couldn't be deserialized in another if the file paths differed.
  3. Version tracking: No way to include package versions in IDs for cache invalidation.

Changes

New ID Format

IDs now use the format {type}//{modulePath}//{identifier} where modulePath is either:

  • A module specifier like point@0.0.1 or @myorg/shared@1.2.3 for package files
  • A relative path prefixed with ./ like ./src/jobs/order for local app files

Examples:

  • step//workflow@4.0.1-beta.50//fetch (SDK step)
  • step//./workflows/order//processOrder (local step)
  • class//point@0.0.1//Point (package class)
  • class//./src/models/User//User (local class)

New Module Specifier Resolution

Added packages/builders/src/module-specifier.ts which:

  • Detects if a file is in node_modules or a workspace package
  • Finds the nearest package.json and extracts name/version
  • Returns the module specifier for the SWC plugin to use

SWC Plugin Changes

  • Added moduleSpecifier option to plugin config
  • Updated naming.rs to support both module specifiers and relative paths
  • Added get_module_path() helper that uses specifier when available, falls back to ./filename format

Special Cases

  • Builtin functions (__builtin_*): Continue to use just the function name as the ID for stable, version-independent lookup from the workflow VM runtime.

Testing

  • Updated all 125+ SWC plugin test fixtures to use new ID format
  • Added tests for module specifier resolution
  • Added tests for Windows path normalization in naming

Breaking Changes

This is technically a breaking change for any persisted workflow runs that reference the old ID format. However, since IDs are internal implementation details and not user-facing, this should not affect end users.

Files Changed

  • packages/builders/src/module-specifier.ts - NEW: Module specifier resolution logic
  • packages/builders/src/apply-swc-transform.ts - Pass module specifier to SWC plugin
  • packages/builders/src/base-builder.ts - Use getImportPath for virtual entry imports
  • packages/swc-plugin-workflow/transform/src/lib.rs - Accept and use module specifier
  • packages/swc-plugin-workflow/transform/src/naming.rs - New ID formatting with module paths
  • packages/swc-plugin-workflow/spec.md - Updated documentation
  • packages/core/e2e/e2e.test.ts - Updated test assertions for new ID format

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: 2e1b436

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

This PR includes changesets to release 17 packages
Name Type
@workflow/swc-plugin Patch
@workflow/builders Patch
@workflow/rollup Patch
@workflow/next Patch
workflow-devkit-compiler-playground Patch
@workflow/astro Patch
@workflow/cli Patch
@workflow/nest Patch
@workflow/nitro Patch
@workflow/sveltekit Patch
@workflow/vite Patch
workflow Patch
@workflow/docs-typecheck Patch
@workflow/world-testing 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
Copy Markdown
Contributor

github-actions Bot commented Jan 30, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 479 0 38 517
✅ 💻 Local Development 438 0 32 470
✅ 📦 Local Production 438 0 32 470
✅ 🐘 Local Postgres 438 0 32 470
✅ 🪟 Windows 47 0 0 47
❌ 🌍 Community Worlds 31 169 0 200
✅ 📋 Other 129 0 12 141
Total 2000 169 146 2315

❌ Failed Tests

🌍 Community Worlds (169 failed)

mongodb (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
  • 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
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

redis (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
  • 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
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

starter (43 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
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • 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 (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
  • 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
  • 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 43 0 4
✅ example 43 0 4
✅ express 43 0 4
✅ fastify 43 0 4
✅ hono 43 0 4
✅ nextjs-turbopack 46 0 1
✅ nextjs-webpack 46 0 1
✅ nitro 43 0 4
✅ nuxt 43 0 4
✅ sveltekit 43 0 4
✅ vite 43 0 4
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 43 0 4
✅ express-stable 43 0 4
✅ fastify-stable 43 0 4
✅ hono-stable 43 0 4
✅ nextjs-turbopack-stable 47 0 0
✅ nextjs-webpack-stable 47 0 0
✅ nitro-stable 43 0 4
✅ nuxt-stable 43 0 4
✅ sveltekit-stable 43 0 4
✅ vite-stable 43 0 4
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 43 0 4
✅ express-stable 43 0 4
✅ fastify-stable 43 0 4
✅ hono-stable 43 0 4
✅ nextjs-turbopack-stable 47 0 0
✅ nextjs-webpack-stable 47 0 0
✅ nitro-stable 43 0 4
✅ nuxt-stable 43 0 4
✅ sveltekit-stable 43 0 4
✅ vite-stable 43 0 4
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 43 0 4
✅ express-stable 43 0 4
✅ fastify-stable 43 0 4
✅ hono-stable 43 0 4
✅ nextjs-turbopack-stable 47 0 0
✅ nextjs-webpack-stable 47 0 0
✅ nitro-stable 43 0 4
✅ nuxt-stable 43 0 4
✅ sveltekit-stable 43 0 4
✅ vite-stable 43 0 4
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 47 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 0
❌ mongodb 5 42 0
✅ redis-dev 3 0 0
❌ redis 5 42 0
✅ starter-dev 3 0 0
❌ starter 4 43 0
✅ turso-dev 3 0 0
❌ turso 5 42 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 43 0 4
✅ e2e-local-postgres-nest-stable 43 0 4
✅ e2e-local-prod-nest-stable 43 0 4

📋 View full workflow run

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Jan 30, 2026

Comment on lines +33 to +35
const root = dirname(dir);

while (dir !== root) {
Copy link
Copy Markdown
Contributor

@vercel vercel Bot Jan 30, 2026

Choose a reason for hiding this comment

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

The findPackageJson function only checks one parent directory due to incorrect loop termination condition, preventing it from finding package.json files in higher directories.

Fix on Vercel

@TooTallNate TooTallNate marked this pull request as ready for review January 30, 2026 20:53
Copilot AI review requested due to automatic review settings January 30, 2026 20:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request changes the compiler's ID generation logic from using file paths to using Node.js import specifiers. The change enables stable workflow/step/class IDs when the same package specifier resolves to different files depending on package.json export conditions.

Changes:

  • Modified ID format from workflow//path/file.ts//functionName to workflow//./path/file//functionName for local files and workflow//packageName@version//functionName for packages
  • Added module_specifier parameter to SWC plugin config to support package-based ID generation
  • Implemented module specifier resolution logic in @workflow/builders to detect node_modules and workspace packages
  • Updated all test fixtures to reflect the new ID format with "./" prefix for local files and stripped extensions

Reviewed changes

Copilot reviewed 139 out of 139 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
packages/swc-plugin-workflow/transform/src/naming.rs Core ID formatting logic, adds module path resolution and extension stripping
packages/swc-plugin-workflow/transform/src/lib.rs Integration of module_specifier parameter into StepTransform
packages/swc-plugin-workflow/src/lib.rs WASM plugin config with new moduleSpecifier option
packages/builders/src/module-specifier.ts New module implementing package detection and import path resolution
packages/builders/src/apply-swc-transform.ts Passes module specifier to SWC transform
packages/builders/src/base-builder.ts Uses package names for imports to respect export conditions
packages/rollup/src/index.ts Integration of module specifier resolution
packages/next/src/loader.ts Integration of module specifier resolution
packages/swc-plugin-workflow/spec.md Updated specification with new ID format and examples
Test fixture files (60+ files) All updated to reflect new ID format
packages/core/e2e/e2e.test.ts Updated regex to match new ID format

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

Comment on lines +32 to +33
let dir = dirname(filePath);
const root = dirname(dir);
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The findPackageJson function has a potential infinite loop issue. The termination condition while (dir !== root) where root = dirname(dir) is incorrect. This will cause the loop to never terminate on Unix-like systems where the root is "/", since when dir becomes "/", dirname("/") also returns "/", making dir !== root always true.

The termination condition should check if we've reached the filesystem root by comparing dir with its parent directory, e.g., while (dir !== dirname(dir)).

Copilot uses AI. Check for mistakes.
use std::path::PathBuf;
use swc_core::ecma::{
transforms::testing::{FixtureTestConfig, test_fixture},
transforms::testing::{test_fixture, FixtureTestConfig},
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The imports in this file are being reordered. While this doesn't affect functionality, it's a formatting change that should ideally be done separately or avoided if the project doesn't enforce import ordering. The change from FixtureTestConfig, test_fixture to test_fixture, FixtureTestConfig appears to be an alphabetical sorting, but mixing this with functional changes makes the diff harder to review.

Suggested change
transforms::testing::{test_fixture, FixtureTestConfig},
transforms::testing::{FixtureTestConfig, test_fixture},

Copilot uses AI. Check for mistakes.
use std::path::PathBuf;
use swc_core::ecma::{
transforms::testing::{FixtureTestConfig, test_fixture},
transforms::testing::{test_fixture, FixtureTestConfig},
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The imports in this file are being reordered. While this doesn't affect functionality, it's a formatting change that should ideally be done separately or avoided if the project doesn't enforce import ordering. The change from FixtureTestConfig, test_fixture to test_fixture, FixtureTestConfig appears to be an alphabetical sorting, but mixing this with functional changes makes the diff harder to review.

Suggested change
transforms::testing::{test_fixture, FixtureTestConfig},
transforms::testing::{FixtureTestConfig, test_fixture},

Copilot uses AI. Check for mistakes.
Comment on lines +88 to +100
const rootPkgPath = join(projectRoot, 'package.json');

// Walk up to find the package.json directory
let dir = dirname(filePath);
while (dir !== dirname(dir)) {
const pkgPath = join(dir, 'package.json');
if (existsSync(pkgPath)) {
// If this is the root package.json, it's not a workspace package
if (pkgPath === rootPkgPath) {
return false;
}
// Found a package.json that's not the root - it's a workspace package
return true;
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The path comparison if (pkgPath === rootPkgPath) may not work correctly on Windows due to path separator differences and case sensitivity. The rootPkgPath is created using join(projectRoot, 'package.json'), while pkgPath is created from dir which was derived from filePath. If these paths use different separators (backslashes vs forward slashes) or have different casing, the comparison will fail even when they refer to the same file.

Consider normalizing both paths before comparison, for example:

const normalizedPkgPath = pkgPath.replace(/\\/g, '/').toLowerCase();
const normalizedRootPkgPath = rootPkgPath.replace(/\\/g, '/').toLowerCase();
if (normalizedPkgPath === normalizedRootPkgPath) {

Alternatively, use path.resolve() on both paths to ensure they're in the same format.

Copilot uses AI. Check for mistakes.
Comment thread .changeset/rich-symbols-fold.md Outdated
"@workflow/next": patch
---

Change compiler ID generation logic to use Node.js import specifier
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The changeset description "Change compiler ID generation logic to use Node.js import specifier" is somewhat vague and doesn't fully explain the impact of this change. Consider expanding it to mention:

  1. This is a breaking change that alters the format of workflow/step/class IDs
  2. IDs now use "./path/to/file" format instead of "path/to/file.ext" for local files
  3. Package files now use "packageName@version" format
  4. This enables stable IDs across different package.json export conditions

This will help users understand the impact when reviewing changelogs.

Suggested change
Change compiler ID generation logic to use Node.js import specifier
Change compiler ID generation logic to use Node.js import specifiers and update ID formats.
This is a breaking change that alters the format of workflow, step, and class IDs:
- Local files now use a "./path/to/file" format instead of "path/to/file.ext".
- Package files now use a "packageName@version" format.
- This enables stable IDs across different package.json export conditions.

Copilot uses AI. Check for mistakes.
// Test case: regular function BEFORE step function in same declaration
// This verifies that processing doesn't skip the step function
const regularArrow = ()=>1, stepAfterRegular = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//input.js//stepAfterRegular");
const regularArrow = ()=>1, stepAfterRegular = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//./input//stepAfterRegular");
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Unused variable regularArrow.

Copilot uses AI. Check for mistakes.
// Test case: regular function BEFORE step function in same declaration
// This verifies that processing doesn't skip the step function
const regularArrow = ()=>1, stepAfterRegular = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//input.js//stepAfterRegular");
const regularArrow = ()=>1, stepAfterRegular = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//./input//stepAfterRegular");
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Unused variable stepAfterRegular.

Copilot uses AI. Check for mistakes.
const regularFn = function() {
return 2;
}, stepAfterRegularFn = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//input.js//stepAfterRegularFn");
}, stepAfterRegularFn = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//./input//stepAfterRegularFn");
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Unused variable stepAfterRegularFn.

Copilot uses AI. Check for mistakes.
export async function wflow() {
let count = 42;
var namedStepWithClosureVars = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//input.js//wflow/namedStepWithClosureVars", ()=>({
var namedStepWithClosureVars = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//./input//wflow/namedStepWithClosureVars", ()=>({
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Unused variable namedStepWithClosureVars.

Copilot uses AI. Check for mistakes.
var namedStep = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//input.js//namedStep");
export var exportedNamedStep = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//input.js//exportedNamedStep");
/**__internal_workflows{"steps":{"input.js":{"exportedNamedStep":{"stepId":"step//./input//exportedNamedStep"},"namedStep":{"stepId":"step//./input//namedStep"}}}}*/;
var namedStep = globalThis[Symbol.for("WORKFLOW_USE_STEP")]("step//./input//namedStep");
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Unused variable namedStep.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@VaguelySerious VaguelySerious left a comment

Choose a reason for hiding this comment

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

Given we're changing the ID format, it seems like o11y/util code like parseName should be updated in this PR too

@github-actions
Copy link
Copy Markdown
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 🥇 Next.js (Turbopack) 0.041s (-8.2% 🟢) 1.017s (~) 0.976s 10 1.00x
💻 Local Nitro 0.042s (-0.7%) 1.008s (~) 0.966s 10 1.02x
💻 Local Express 0.043s (-4.5%) 1.007s (~) 0.964s 10 1.03x
🐘 Postgres Next.js (Turbopack) 0.145s (-61.9% 🟢) 1.020s (~) 0.876s 10 3.51x
🐘 Postgres Nitro 0.209s (-1.9%) 1.015s (~) 0.806s 10 5.06x
🐘 Postgres Express 0.263s (+7.7% 🔺) 1.014s (~) 0.752s 10 6.37x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.628s (-12.5% 🟢) 1.528s (-13.2% 🟢) 0.900s 10 1.00x
▲ Vercel Next.js (Turbopack) 0.763s (-11.3% 🟢) 1.750s (~) 0.987s 10 1.22x
▲ Vercel Express 0.777s (-1.4%) 1.606s (-6.9% 🟢) 0.829s 10 1.24x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.090s (~) 2.014s (~) 0.923s 10 1.00x
💻 Local Express 1.113s (-0.6%) 2.007s (~) 0.894s 10 1.02x
💻 Local Nitro 1.116s (~) 2.008s (~) 0.892s 10 1.02x
🐘 Postgres Next.js (Turbopack) 1.933s (+3.5%) 2.118s (~) 0.185s 10 1.77x
🐘 Postgres Express 2.106s (-5.5% 🟢) 3.016s (~) 0.910s 10 1.93x
🐘 Postgres Nitro 2.251s (-7.6% 🟢) 3.016s (~) 0.765s 10 2.06x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.911s (-3.5%) 3.733s (-2.8%) 0.822s 10 1.00x
▲ Vercel Express 2.981s (+3.7%) 3.658s (-2.1%) 0.677s 10 1.02x
▲ Vercel Next.js (Turbopack) 3.033s (-2.3%) 3.877s (~) 0.844s 10 1.04x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 10.728s (~) 11.022s (~) 0.294s 3 1.00x
💻 Local Express 10.822s (~) 11.010s (~) 0.188s 3 1.01x
💻 Local Nitro 10.844s (~) 11.015s (~) 0.172s 3 1.01x
🐘 Postgres Next.js (Turbopack) 15.311s (+2.5%) 16.040s (+3.3%) 0.729s 2 1.43x
🐘 Postgres Nitro 20.465s (+0.7%) 21.038s (~) 0.574s 2 1.91x
🐘 Postgres Express 20.513s (~) 21.045s (~) 0.532s 2 1.91x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 23.281s (-4.0%) 23.902s (-5.1% 🟢) 0.621s 2 1.00x
▲ Vercel Next.js (Turbopack) 23.428s (-1.5%) 24.191s (-1.4%) 0.762s 2 1.01x
▲ Vercel Express 23.726s (+1.5%) 24.370s (+1.2%) 0.644s 2 1.02x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 27.197s (~) 28.023s (~) 0.826s 3 1.00x
💻 Local Express 27.447s (~) 28.025s (~) 0.578s 3 1.01x
💻 Local Nitro 27.483s (~) 28.025s (~) 0.541s 3 1.01x
🐘 Postgres Next.js (Turbopack) 37.947s (+2.9%) 38.566s (+2.6%) 0.620s 2 1.40x
🐘 Postgres Nitro 50.349s (~) 51.087s (~) 0.738s 2 1.85x
🐘 Postgres Express 50.447s (~) 51.078s (~) 0.632s 2 1.85x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 58.086s (-3.7%) 58.794s (-3.9%) 0.708s 2 1.00x
▲ Vercel Nitro 58.615s (-1.8%) 59.797s (-1.2%) 1.182s 2 1.01x
▲ Vercel Next.js (Turbopack) 59.343s (~) 59.882s (~) 0.540s 2 1.02x

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

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 56.557s (~) 57.058s (~) 0.501s 2 1.00x
💻 Local Express 57.102s (-0.5%) 58.039s (~) 0.937s 2 1.01x
💻 Local Nitro 57.173s (~) 58.048s (~) 0.875s 2 1.01x
🐘 Postgres Next.js (Turbopack) 75.456s (+2.0%) 76.102s (+2.7%) 0.646s 2 1.33x
🐘 Postgres Nitro 100.151s (~) 100.174s (-1.0%) 0.023s 1 1.77x
🐘 Postgres Express 100.321s (~) 101.170s (~) 0.849s 1 1.77x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 124.927s (+4.4%) 125.467s (+3.9%) 0.540s 1 1.00x
▲ Vercel Next.js (Turbopack) 132.389s (+9.0% 🔺) 133.132s (+8.6% 🔺) 0.743s 1 1.06x
▲ Vercel Express 132.828s (+8.3% 🔺) 133.822s (+8.5% 🔺) 0.994s 1 1.06x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.390s (~) 2.011s (~) 0.621s 15 1.00x
💻 Local Express 1.407s (-1.5%) 2.006s (~) 0.599s 15 1.01x
💻 Local Nitro 1.417s (~) 2.007s (~) 0.590s 15 1.02x
🐘 Postgres Next.js (Turbopack) 1.842s (-9.5% 🟢) 2.080s (-20.2% 🟢) 0.238s 15 1.33x
🐘 Postgres Nitro 2.220s (-4.7%) 3.014s (~) 0.794s 10 1.60x
🐘 Postgres Express 2.413s (+3.8%) 3.014s (~) 0.601s 10 1.74x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.852s (~) 3.687s (-3.9%) 0.836s 9 1.00x
▲ Vercel Nitro 3.207s (+6.8% 🔺) 3.977s (+1.0%) 0.770s 8 1.12x
▲ Vercel Next.js (Turbopack) 3.280s (+5.6% 🔺) 4.027s (+6.0% 🔺) 0.747s 8 1.15x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 2.394s (-4.8%) 3.039s (~) 0.645s 10 1.00x
💻 Local Express 2.581s (-0.5%) 3.016s (~) 0.435s 10 1.08x
💻 Local Nitro 2.663s (+3.8%) 3.011s (~) 0.349s 10 1.11x
🐘 Postgres Express 8.095s (-15.3% 🟢) 8.527s (-18.2% 🟢) 0.432s 4 3.38x
🐘 Postgres Nitro 8.727s (+5.7% 🔺) 9.328s (+3.1%) 0.601s 4 3.64x
🐘 Postgres Next.js (Turbopack) 11.069s (-11.6% 🟢) 11.716s (-7.7% 🟢) 0.647s 3 4.62x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.200s (-2.1%) 3.881s (-6.7% 🟢) 0.681s 8 1.00x
▲ Vercel Next.js (Turbopack) 3.459s (-1.0%) 4.297s (+0.9%) 0.838s 7 1.08x
▲ Vercel Nitro 3.550s (~) 4.213s (-2.6%) 0.663s 8 1.11x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 6.960s (~) 8.007s (-1.1%) 1.047s 4 1.00x
💻 Local Express 7.353s (-2.1%) 8.330s (-2.0%) 0.977s 4 1.06x
💻 Local Nitro 7.794s (+6.7% 🔺) 8.744s (+8.4% 🔺) 0.950s 4 1.12x
🐘 Postgres Express 44.598s (-1.2%) 45.079s (-0.6%) 0.481s 1 6.41x
🐘 Postgres Nitro 46.431s (-4.0%) 47.255s (-3.9%) 0.824s 1 6.67x
🐘 Postgres Next.js (Turbopack) 53.190s (+2.5%) 53.291s (+2.2%) 0.101s 1 7.64x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 4.035s (+22.5% 🔺) 4.712s (+21.7% 🔺) 0.677s 8 1.00x
▲ Vercel Express 5.087s (+47.2% 🔺) 5.843s (+44.1% 🔺) 0.756s 6 1.26x
▲ Vercel Next.js (Turbopack) 5.686s (+63.3% 🔺) 6.601s (+51.6% 🔺) 0.915s 5 1.41x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.429s (-1.3%) 2.006s (~) 0.577s 15 1.00x
💻 Local Nitro 1.438s (~) 2.006s (~) 0.568s 15 1.01x
💻 Local Next.js (Turbopack) 1.441s (+1.8%) 2.010s (~) 0.569s 15 1.01x
🐘 Postgres Next.js (Turbopack) 1.931s (-10.9% 🟢) 2.323s (-7.9% 🟢) 0.392s 13 1.35x
🐘 Postgres Nitro 2.100s (+6.2% 🔺) 2.939s (+37.1% 🔺) 0.839s 11 1.47x
🐘 Postgres Express 2.163s (+3.5%) 2.602s (~) 0.439s 12 1.51x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.906s (+2.4%) 3.796s (~) 0.890s 8 1.00x
▲ Vercel Next.js (Turbopack) 2.957s (+1.0%) 3.866s (+2.3%) 0.909s 8 1.02x
▲ Vercel Nitro 3.317s (+17.7% 🔺) 4.144s (+10.1% 🔺) 0.827s 8 1.14x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 2.692s (+1.9%) 3.018s (~) 0.325s 10 1.00x
💻 Local Nitro 2.716s (-2.0%) 3.015s (~) 0.299s 10 1.01x
💻 Local Express 2.716s (+0.6%) 3.014s (~) 0.297s 10 1.01x
🐘 Postgres Next.js (Turbopack) 10.121s (-20.2% 🟢) 10.689s (-20.1% 🟢) 0.568s 3 3.76x
🐘 Postgres Nitro 11.043s (+6.2% 🔺) 11.379s (+3.2%) 0.336s 3 4.10x
🐘 Postgres Express 11.962s (+9.7% 🔺) 12.360s (+5.5% 🔺) 0.398s 3 4.44x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.958s (-3.7%) 3.665s (-5.3% 🟢) 0.708s 9 1.00x
▲ Vercel Next.js (Turbopack) 3.026s (-2.5%) 3.808s (-1.9%) 0.782s 8 1.02x
▲ Vercel Express 3.049s (~) 3.764s (-0.8%) 0.715s 9 1.03x

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

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 7.960s (+7.4% 🔺) 8.805s (+5.2% 🔺) 0.844s 4 1.00x
💻 Local Nitro 8.068s (+4.5%) 8.395s (-3.5%) 0.328s 4 1.01x
💻 Local Express 8.124s (+1.2%) 8.643s (-3.4%) 0.519s 4 1.02x
🐘 Postgres Next.js (Turbopack) 50.171s (-12.8% 🟢) 51.091s (-12.2% 🟢) 0.920s 1 6.30x
🐘 Postgres Nitro 51.180s (+1.1%) 52.119s (+1.5%) 0.939s 1 6.43x
🐘 Postgres Express 53.012s (+11.2% 🔺) 53.093s (+10.0% 🔺) 0.081s 1 6.66x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.221s (-7.5% 🟢) 3.807s (-8.1% 🟢) 0.586s 8 1.00x
▲ Vercel Nitro 3.659s (+13.5% 🔺) 4.340s (+12.2% 🔺) 0.681s 7 1.14x
▲ Vercel Next.js (Turbopack) 3.712s (-5.4% 🟢) 4.624s (-0.6%) 0.912s 7 1.15x

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

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 0.150s (+3.7%) 1.003s (~) 0.015s (-8.9% 🟢) 1.026s (~) 0.877s 10 1.00x
💻 Local Express 0.176s (-6.1% 🟢) 0.992s (~) 0.014s (-11.6% 🟢) 1.020s (~) 0.844s 10 1.18x
💻 Local Nitro 0.180s (-1.9%) 0.992s (~) 0.014s (~) 1.021s (~) 0.841s 10 1.20x
🐘 Postgres Next.js (Turbopack) 1.140s (+71.2% 🔺) 1.905s (+96.3% 🔺) 0.000s (NaN%) 2.016s (+98.6% 🔺) 0.876s 10 7.62x
🐘 Postgres Nitro 2.321s (+4.8%) 2.725s (-3.7%) 0.000s (-100.0% 🟢) 3.018s (~) 0.696s 10 15.52x
🐘 Postgres Express 2.332s (-3.1%) 2.708s (+2.4%) 0.000s (+Infinity% 🔺) 3.020s (~) 0.688s 10 15.59x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.115s (+1.0%) 3.341s (-3.0%) 0.193s (+40.8% 🔺) 4.041s (-2.1%) 0.926s 10 1.00x
▲ Vercel Next.js (Turbopack) 3.185s (+2.1%) 3.263s (+0.7%) 0.249s (+66.2% 🔺) 4.042s (+4.1%) 0.857s 10 1.02x
▲ Vercel Express 3.206s (+3.3%) 3.410s (+3.0%) 0.227s (+19.1% 🔺) 4.158s (+3.4%) 0.952s 10 1.03x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 💻 Local 10/12
Next.js (Turbopack) 💻 Local 10/12
Nitro 💻 Local 10/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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants