Files
vercel__workflow/.changeset/allow-sync-step-functions.md
Nathan Rajlich d040182932 Allow synchronous functions to use "use step" directive (#1633)
Lift the async function restriction from "use step" in both the SWC
compiler plugin and the TypeScript language service plugin. This enables
using "use step" as a mechanism to strip Node.js-dependent code from
the workflow VM bundle without requiring the function to be async.

The async restriction is preserved for "use workflow" functions.

- SWC plugin: removed async guards from all step function code paths,
  updated should_transform_function, updated InvalidExport validation
- TypeScript plugin: removed error 9002 for sync step functions
- Added sync-step fixture test, cleaned up error test fixtures
- Updated spec.md error documentation
2026-04-09 00:34:42 +00:00

286 B

@workflow/swc-plugin, @workflow/typescript-plugin
@workflow/swc-plugin @workflow/typescript-plugin
minor minor

Allow synchronous functions to use "use step" directive. This enables using "use step" as a mechanism to strip Node.js-dependent code from the workflow VM bundle without requiring the function to be async.