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

推荐订阅源

Jina AI
Jina AI
C
Check Point Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Know Your Adversary
Know Your Adversary
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tor Project blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
Latest news
Latest news
Project Zero
Project Zero
T
Threat Research - Cisco Blogs
P
Palo Alto Networks Blog
雷峰网
雷峰网
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
P
Privacy International News Feed
Vercel News
Vercel News
T
The Exploit Database - CXSecurity.com
S
Secure Thoughts
Application and Cybersecurity Blog
Application and Cybersecurity Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Full Disclosure
T
Tenable Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Forbes - Security
Forbes - Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
Security Affairs
The GitHub Blog
The GitHub Blog
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
O
OpenAI News
Google DeepMind News
Google DeepMind News
V
Vulnerabilities – Threatpost
Engineering at Meta
Engineering at Meta
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News and Events Feed by Topic
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
Schneier on Security
Schneier on Security
W
WeLiveSecurity
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 三生石上(FineUI控件)

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 node-js-module-in-workflow start-invalid-workflow-function step-not-registered timeout-in-workflow webhook-invalid-respond-with-value webhook-response-not-sent workflow-not-registered Errors & Retrying Hooks & Webhooks Idempotency Foundations Serialization Starting Workflows Streaming Versioning Workflows and Steps How the Directives Work Encryption Event Sourcing Framework Integrations Understanding Directives Migration Guides Migrating from AWS Step Functions Migrating from Inngest Migrating from Temporal Observability Testing Server-Based Testing createHook createWebhook defineHook FatalError fetch getStepMetadata getWorkflowMetadata getWritable workflow RetryableError sleep @workflow/vitest DurableAgent @workflow/ai WorkflowChatTransport getHookByToken getRun getWorld workflow/api resumeHook resumeWebhook Chat Session Modeling runtime-decryption-failed Upgrading Workflows abort-signal-timeout-in-workflow Cancellation How Cancellation Works Internal Serializable AbortController and AbortSignal Eager Processing of Steps & Incremental Event Replay TanStack Start Agent Cancellation Sequential & Parallel Execution Workflow Composition Local World | Workflow SDK Postgres World | Workflow SDK Vercel World | Workflow SDK Migrating from trigger.dev Secure Credential Handling Local World | Workflow SDK Postgres World | Workflow SDK Vercel World | Workflow SDK
serialization-failed
2026-05-31 · via Workflow SDK Documentation

Ensure all data passed between workflow and step functions is serializable.

This error occurs when you try to pass non-serializable data between execution boundaries in your workflow. All data passed between workflow functions, step functions, and the workflow runtime must be serializable to persist in the event log.

Failed to serialize workflow arguments. Ensure you're passing serializable types
(plain objects, arrays, primitives, Date, RegExp, Map, Set).

This error can appear when:

  • Serializing workflow arguments when calling start()
  • Serializing workflow return values
  • Serializing step arguments
  • Serializing step return values

Workflows persist their state using an event log. Every value that crosses execution boundaries must be:

  1. Serialized to be stored in the event log
  2. Deserialized when the workflow resumes

Functions, class instances, symbols, and other non-serializable types cannot be properly reconstructed after serialization, which would break workflow replay.

Passing Functions

// Error - functions cannot be serialized
export async function processWorkflow() {
  "use workflow";

  const callback = () => console.log("done"); 
  await processStep(callback); // Error!
}

Solution: Pass data instead, then define the function logic in the step.

// Fixed - pass configuration data instead
export async function processWorkflow() {
  "use workflow";

  await processStep({ shouldLog: true }); 
}

async function processStep(config: { shouldLog: boolean }) {
  "use step";

  if (config.shouldLog) { 
    console.log("done"); 
  } 
}

Class Instances

class User {
  constructor(public name: string) {}
  greet() { return `Hello ${this.name}`; }
}

// Error - class instances lose methods after serialization
export async function greetWorkflow() {
  "use workflow";

  await greetStep(new User("Alice")); // Error!
}

Solution: Pass plain objects and reconstruct the class in the step.

class User {
  constructor(public name: string) {}
  greet() { return `Hello ${this.name}`; }
}

// Fixed - pass plain object, reconstruct in step
export async function greetWorkflow() {
  "use workflow";

  await greetStep({ name: "Alice" }); 
}

async function greetStep(userData: { name: string }) {
  "use step";

  const user = new User(userData.name); 
  console.log(user.greet());
}

Workflow SDK supports these types across execution boundaries:

Standard JSON Types

  • string, number, boolean, null
  • Arrays of serializable values
  • Plain objects with serializable values

To learn more about supported types, see the Serialization section.

To identify what's causing serialization to fail:

  1. Check the error stack trace - it often shows which property failed
  2. Simplify your data - temporarily pass smaller objects to isolate the issue
  3. Ensure you are using supported data types - see the Serialization section for more details