Skip to main content
Restate sends data over the network for storing state, journaling actions, awakeables, etc. Therefore, Restate needs to serialize and deserialize the journal entries.

Default serialization

By default, Typescript SDK uses the built-in JSON support to perform (de)serialization.

Standard Schema & Zod

You can use any Standard schema compliant library for your handler input/output schemas, such as Zod:
If you’re using Zod versions earlier than 4.2, you should use the ad-hoc Zod integration instead: @restatedev/restate-sdk-zod.Then do the following:

Custom serialization

It is possible to implement customized serialization using the Serde interface. For example, to implement custom serializers for the handler input and output:
When sending a request to a handler configured with custom serde(s) you always need to manually specify them, because the client does not automatically infer what serde(s) should be used. To customize the serde to use on requests:
To customize the serde for other actions on the context: