Skip to main content

Namespace: 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: workflow


workflowStreamPollUpdate

Const workflowStreamPollUpdate: common


workflowStreamPublishSignal

Const workflowStreamPublishSignal: workflow

Functions

decodeBase64

decodeBase64(data): Uint8Array

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

Parameters

NameType
datastring

Returns

Uint8Array


decodePayloadProto

decodePayloadProto(bytes): Payload

Decode protobuf binary bytes to a Payload.

Parameters

NameType
bytesUint8Array

Returns

Payload


decodePayloadWire

decodePayloadWire(wire): Payload

Convenience: decode the base64 wire format to a Payload.

Parameters

NameType
wirestring

Returns

Payload


encodeBase64

encodeBase64(data): string

Encode bytes to standard base64 (padded).

Parameters

NameType
dataUint8Array

Returns

string


encodePayloadProto

encodePayloadProto(payload): Uint8Array

Encode a Payload to its protobuf binary representation.

Parameters

NameType
payloadIPayload

Returns

Uint8Array


encodePayloadWire

encodePayloadWire(payload): string

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

Parameters

NameType
payloadIPayload

Returns

string