Skip to main content

workflowStreams

Workflow-side entrypoint for @temporalio/workflow-streams.

Instantiate WorkflowStream once at the start of your workflow function; the constructor registers the workflow stream signal, update, and query handlers on the current workflow via setHandler.

For workflows that support continue-as-new, include a WorkflowStreamState | undefined field on the workflow input and pass it as priorState — it is undefined on fresh starts and carries accumulated state on continue-as-new.

Both workflow-side WorkflowStream.publish and client-side WorkflowStreamClient.publish use the default payload converter for per-item Payload construction. The codec chain (encryption, PII-redaction, compression) is NOT applied per item on either side — it runs once at the envelope level when Temporal's SDK encodes the signal/update that carries the batch.

This entrypoint exports only the workflow-safe surface so that it can be pulled into a workflow bundle. The client-side surface lives at @temporalio/workflow-streams/client and pulls in crypto, @temporalio/activity, and @temporalio/client — none of which can be resolved in the workflow sandbox.

Classes​

Interfaces​

Variables​

workflowStreamOffsetQuery​

const workflowStreamOffsetQuery: QueryDefinition


workflowStreamPollUpdate​

const workflowStreamPollUpdate: UpdateDefinition


workflowStreamPublishSignal​

const workflowStreamPublishSignal: SignalDefinition

Functions​

decodeBase64()​

decodeBase64(data): Uint8Array

Decode standard base64 to bytes. Throws TypeError on malformed input.

Parameters​

data​

string

Returns​

Uint8Array


decodePayloadProto()​

decodePayloadProto(bytes): IPayload

Decode protobuf binary bytes to a Payload.

Parameters​

bytes​

Uint8Array

Returns​

IPayload


decodePayloadWire()​

decodePayloadWire(wire): IPayload

Convenience: decode the base64 wire format to a Payload.

Parameters​

wire​

string

Returns​

IPayload


encodeBase64()​

encodeBase64(data): string

Encode bytes to standard base64 (padded).

Parameters​

data​

Uint8Array

Returns​

string


encodePayloadProto()​

encodePayloadProto(payload): Uint8Array

Encode a Payload to its protobuf binary representation.

Parameters​

payload​

IPayload

Returns​

Uint8Array


encodePayloadWire()​

encodePayloadWire(payload): string

Convenience: encode a Payload to the base64 wire format used by stream.

Parameters​

payload​

IPayload

Returns​

string