Files
vercel__workflow/.changeset/warn-external-workflow-packages.md
Nathan Rajlich 0c997ce571 Auto-remove workflow packages from serverExternalPackages (#1481)
* Warn when serverExternalPackages hides workflow-enabled packages

Add a build-time warning when packages in serverExternalPackages contain
workflow code ('use step', 'use workflow', or serialization classes).
These packages are completely invisible to the workflow compiler when
externalized, causing silent runtime failures.

The warning detects workflow patterns via two methods:
- Fast path: check package.json dependencies for @workflow/serde
- Thorough path: read the package entry file and run pattern detection

Also adds documentation in the serialization guide about the
externalization footgun for 3rd-party packages.

* Auto-remove workflow packages from serverExternalPackages

When workflow-enabled dependencies are externalized in Next.js, compiler transforms are skipped and runtime failures follow. Detect those packages in withWorkflow, remove them from serverExternalPackages for the current build, and keep a generalized externalPackages warning fallback for non-Next builders.

* Address review feedback: add entry-point limitation comment and missing test case
2026-05-05 09:10:30 +00:00

249 B

@workflow/builders, @workflow/next
@workflow/builders @workflow/next
patch patch

Auto-remove workflow-enabled packages from Next.js serverExternalPackages so they can be transformed, and retain a best-effort externalPackages warning fallback for non-Next builders.