mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
9513a8160c
* 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
6 lines
92 B
Markdown
6 lines
92 B
Markdown
---
|
|
"@workflow/core": minor
|
|
---
|
|
|
|
Add serialization support for workflow function references
|