Interface: PayloadConverter
common.PayloadConverter
Used by the framework to serialize/deserialize data like parameters and return values.
This is called inside the Workflow isolate. To write async code or use Node APIs (or use packages that use Node APIs), use a PayloadCodec.
Implemented by
Methods
fromPayload
▸ fromPayload<T
>(payload
): T
Converts a Payload back to a value.
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
payload | IPayload |
Returns
T
toPayload
▸ toPayload<T
>(value
): IPayload
Converts a value to a Payload.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
value | T | The value to convert. Example values include the Workflow args sent from the Client and the values returned by a Workflow or Activity. |
Returns
The Payload.
Should throw ValueError if unable to convert.