# Custom Class Serialization in Workflow SDK

DevFeed: [Custom Class Serialization in Workflow SDK](<https://devfeed.tech/articles/custom-class-serialization-in-workflow-sdk-1200.md>)

Original publisher: [Read original article](<https://vercel.com/changelog/workflow-custom-class-serialization>)

Author: John Lindquist

Published: 2026-04-02T23:23:00Z

Content type: release

Language: en

Sources: [Vercel News](<https://devfeed.tech/sources/vercel-news.md>)

Topics: [SDKs](<https://devfeed.tech/topics/sdks.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Vercel](<https://devfeed.tech/topics/vercel.md>)

Tags: [documentation](<https://devfeed.tech/tags/documentation.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [serialization](<https://devfeed.tech/tags/serialization.md>)

## AI overview

Workflow SDK now supports custom class serialization, allowing developers to pass class instances between workflow and step functions. The @workflow/serde package enables custom serialization and deserialization through static methods, with automatic handling for arguments and return values.

## Source excerpt

Workflow SDK now supports custom class serialization, letting you pass your own class instances between workflow and step functions. Workflow SDK serializes standard JavaScript types like primitives, objects, arrays, Date, Map, Set, and more. Custom class instances were previously not supported because the serialization system didn't know how to reconstruct them. With the new @workflow/serde package, you can define how your classes are serialized and deserialized by implementing two static methods using WORKFLOW_SERIALIZE and WORKFLOW_DESERIALIZE. Here's an example of how we used custom serialization in @vercel/sandbox to greatly improve DX: Once implemented, instances of your class can be passed as arguments and return values between workflow and step functions, with the serialization system handling conversion automatically. See the full example application utilizing @vercel/sandbox and Workflow SDK. Read the serialization documentation to learn more. Read more