Skip to content

Use "stepId" instead of Symbol.for("STEP_FUNCTION_NAME_SYMBOL") for annotating step functions#341

Merged
TooTallNate merged 1 commit into
mainfrom
11-13-use_stepid_instead_of_symbol.for_step_function_name_symbol_for_annotating_step_functions
Nov 15, 2025
Merged

Use "stepId" instead of Symbol.for("STEP_FUNCTION_NAME_SYMBOL") for annotating step functions#341
TooTallNate merged 1 commit into
mainfrom
11-13-use_stepid_instead_of_symbol.for_step_function_name_symbol_for_annotating_step_functions

Conversation

@TooTallNate
Copy link
Copy Markdown
Member

@TooTallNate TooTallNate commented Nov 14, 2025

Replace Symbol.for("WORKFLOW_STEP_FUNCTION_NAME") with a standard stepId property for step function annotation.

What changed?

  • Replaced the use of STEP_FUNCTION_NAME_SYMBOL (a Symbol) with a regular stepId property on step functions
  • Updated the serialization logic to check for the stepId property instead of the Symbol
  • Removed the STEP_FUNCTION_NAME_SYMBOL constant from symbols.ts
  • Updated tests to reflect this change in implementation

Why make this change?

This more closely resembles how Workflow functions are annotated with a workflowId property.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 14, 2025

🦋 Changeset detected

Latest commit: 2288833

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

This PR includes changesets to release 11 packages
Name Type
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/web-shared Patch
workflow Patch
@workflow/sveltekit Patch
@workflow/world-testing Patch
@workflow/nuxt Patch
@workflow/ai Patch

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

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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Nov 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Comment Nov 15, 2025 7:09am
example-nextjs-workflow-webpack Ready Ready Preview Comment Nov 15, 2025 7:09am
example-workflow Ready Ready Preview Comment Nov 15, 2025 7:09am
workbench-hono-workflow Ready Ready Preview Comment Nov 15, 2025 7:09am
workbench-nitro-workflow Ready Ready Preview Comment Nov 15, 2025 7:09am
workbench-nuxt-workflow Ready Ready Preview Comment Nov 15, 2025 7:09am
workbench-sveltekit-workflow Ready Ready Preview Comment Nov 15, 2025 7:09am
workbench-vite-workflow Ready Ready Preview Comment Nov 15, 2025 7:09am
workflow-docs Ready Ready Preview Comment Nov 15, 2025 7:09am

Comment thread packages/core/src/step.ts
configurable: false,
}
);
Object.defineProperty(stepFunction, 'stepId', {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Curious why this isn't also a symbol, e.g. Symbol.for('WORKFLOW_STEP_FUNCTION_STEP_ID') or similar. I guess it's unlikely people will patch this property onto their functions manually so totally fine

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's for consistency with how we annotate workflow functions with workflowId. This PR is more of a cosmetic change.

@TooTallNate TooTallNate force-pushed the 11-13-remove_step_function_identifier_transform_out_of_swc-plugin_and_into_usestep_runtime_function branch from 6786aac to e8fe109 Compare November 15, 2025 06:12
@TooTallNate TooTallNate force-pushed the 11-13-use_stepid_instead_of_symbol.for_step_function_name_symbol_for_annotating_step_functions branch from 8e9a498 to 75e95ad Compare November 15, 2025 06:12
This was referenced Nov 15, 2025
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