惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
N
Netflix TechBlog - Medium
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
Recent Announcements
Recent Announcements
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More

Workflow SDK Documentation

Patterns for Defining Tools Human-in-the-Loop Building Durable AI Agents Queueing User Messages Resumable Streams Sleep, Suspense, and Scheduling Streaming Updates from Tools API Reference Workflow Globals Changelog Resilient run start Cookbook Building a World Deploying Astro Express Fastify Hono Getting Started NestJS Next.js Nitro Nuxt Python SvelteKit Vite corrupted-event-log fetch-in-workflow hook-conflict Errors
WORKFLOW_DESERIALIZE
2026-05-31 · via Workflow SDK Documentation

A symbol used to define custom deserialization for user-defined class instances. The static method should accept serialized data and return a new class instance.

import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from "@workflow/serde";

class Point {
  constructor(public x: number, public y: number) {}

  static [WORKFLOW_SERIALIZE](instance: Point) {
    return { x: instance.x, y: instance.y };
  }

  static [WORKFLOW_DESERIALIZE](data: { x: number; y: number }) {
    return new Point(data.x, data.y);
  }
}
static [WORKFLOW_DESERIALIZE](data: SerializableData): T

Parameters

NameTypeDescription
dataSerializableDataThe serialized data to reconstruct into a class instance. This is the same data that was returned by WORKFLOW_SERIALIZE.

Returns

The method should return a new instance of the class, reconstructed from the serialized data.

The method must be implemented as a static method on the class. Instance methods are not supported.

  • Both WORKFLOW_SERIALIZE and WORKFLOW_DESERIALIZE must be implemented together
  • The method receives the exact data that was returned by WORKFLOW_SERIALIZE
  • If WORKFLOW_SERIALIZE returns complex types (like Map or Date), they will be properly deserialized before being passed to this method

This method runs inside the workflow context and is subject to the same constraints as "use workflow" functions:

  • No Node.js-specific APIs (like fs, path, crypto, etc.)
  • No non-deterministic operations (like Math.random() or Date.now())
  • No external network calls

Keep this method simple and focused on reconstructing the instance from the provided data.