AI Briefing
KO

Custom class serialization in Workflow SDK

·2026.04.03 08:23

Key point

Workflow SDK now supports passing custom class instances.

Details

Workflow SDK now supports custom class serialization, making it possible to pass instances of your own classes between workflows and step functions.

Previously, only standard JavaScript types such as primitives, objects, arrays, Date, Map, and Set could be handled, and custom classes were not supported since there was no way to restore them. Now, by implementing WORKFLOW_SERIALIZE and WORKFLOW_DESERIALIZE static methods on each class using the @workflow/serde package, this becomes possible.

With this approach, class instances can be passed directly as arguments and return values, and the serialization system automatically handles the conversion and restoration. As an example, a case was introduced where @vercel/sandbox leveraged this feature to significantly improve DX, and a full example along with documentation is also provided.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.