Skip to main content

Interface: PayloadCodec

common.PayloadCodec

PayloadCodec is an optional step that happens between the wire and the PayloadConverter:

Temporal Server <--> Wire <--> PayloadCodec <--> PayloadConverter <--> User code

Implement this to transform an array of Payloads to/from the format sent over the wire and stored by Temporal Server. Common transformations are encryption and compression.

Methods​

decode​

▸ decode(payloads, context?): Promise<IPayload[]>

Decode an array of Payloads received from the wire.

Parameters​

NameType
payloadsIPayload[]
context?SerializationContext

Returns​

Promise<IPayload[]>


encode​

▸ encode(payloads, context?): Promise<IPayload[]>

Encode an array of Payloads for sending over the wire.

Parameters​

NameTypeDescription
payloadsIPayload[]May have length 0.
context?SerializationContext-

Returns​

Promise<IPayload[]>