Files
vercel__workflow/.changeset/workflow-function-serialization.md
Nathan Rajlich 9513a8160c feat(core): add serialization support for workflow function references (#1677)
* feat(core): add serialization support for workflow function references

Add a WorkflowFunction reducer/reviver pair so that workflow function
references (functions with a .workflowId property, as produced by the
SWC compiler) can cross the step serialization boundary.

Reducer: detects functions with a .workflowId string property, serializes
as { workflowId }. Only matches functions (not plain objects) to prevent
infinite recursion since the reduced form is a plain object.

Reviver: deserializes as a plain { workflowId } metadata object, which
start() already accepts via its WorkflowFunction | WorkflowMetadata
parameter type.

Also adds an observability reviver that renders as '<workflow:workflowId>'.

* fix: address review feedback - fix error assertion, add o11y reviver test
2026-04-09 23:04:16 -07:00

6 lines
92 B
Markdown

---
"@workflow/core": minor
---
Add serialization support for workflow function references