The serialization system ensures that all data persists correctly across workflow suspensions and resumptions, enabling durable execution.
Supported Serializable Types
The following types can be serialized and passed through workflow functions: Standard JSON Types:stringnumberbooleannull- Arrays of serializable values
- Objects with string keys and serializable values
undefinedbigintArrayBufferBigInt64Array,BigUint64ArrayDateFloat32Array,Float64ArrayInt8Array,Int16Array,Int32ArrayMap<Serializable, Serializable>RegExpSet<Serializable>URLURLSearchParamsUint8Array,Uint8ClampedArray,Uint16Array,Uint32Array
These types have special handling and are explained in detail in the sections below.
HeadersRequestResponseReadableStream<Serializable>WritableStream<Serializable>
Streaming
ReadableStream and WritableStream are supported as serializable types with special handling. These streams can be passed between workflow and step functions while maintaining their streaming capabilities.
For complete information about using streams in workflows, including patterns for AI streaming, file processing, and progress updates, see the Streaming Guide.
Request & Response
The Web APIRequest and Response APIs are supported by the serialization system, and can be passed around between workflow and step functions similarly to other data types.
As a convenience, these two APIs are treated slightly differently when used within a workflow function: calling the text() / json() / arrayBuffer() instance methods is automatically treated as a step function invocation. This allows you to consume the body directly in the workflow context while maintaining proper serialization and caching.
For example, consider how receiving a webhook request provides the entire Request instance into the workflow context. You may consume the body of that request directly in the workflow, which will be cached as a step result for future resumptions of the workflow:
Using fetch in Workflows
Because Request and Response are serializable, Workflow DevKit provides a fetch function that can be used directly in workflow functions:
fetch from workflow is a step function that wraps the standard fetch: