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

推荐订阅源

P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
C
Check Point Blog
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
Recent Announcements
Recent Announcements
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
J
Java Code Geeks
博客园_首页
Jina AI
Jina AI
美团技术团队
H
Help Net Security
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
S
SegmentFault 最新的问题

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 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
Cookbook
2026-05-31 · via Workflow SDK Documentation

Best-practice workflow patterns with copy-paste code examples.

A curated collection of workflow patterns with clean, copy-paste code examples for real use cases.

  • Durable Agent — Replace a stateless AI agent with one that survives crashes and retries tool calls
  • Human-in-the-Loop — Pause an agent for human approval, then resume based on the decision
  • Agent Cancellation — Stop a running agent immediately via run.cancel() or gracefully via a hook + Promise.race
  • Sequential & Parallel Execution — Compose steps with await, Promise.all, and Promise.race against durable sleeps and webhooks
  • Workflow Composition — Call workflows from other workflows by direct await or background spawn via start()
  • Saga — Coordinate multi-step transactions with automatic rollback when a step fails
  • Batching — Process large collections in parallel batches with failure isolation
  • Rate Limiting — Handle 429 responses and transient failures with RetryableError and backoff
  • Scheduling — Use durable sleep to schedule actions minutes, hours, or weeks ahead
  • Timeouts — Add deadlines to slow steps, hooks, and webhooks by racing them against a durable sleep
  • Idempotency — Ensure side effects happen exactly once, even when steps retry
  • Webhooks — Receive HTTP callbacks from external services and process them durably
  • AI SDK — Use streamText() directly inside a workflow for lower-level control over model calls and tool execution
  • Chat SDK — Build durable chat sessions with workflow persistence and AI SDK chat primitives
  • Sandbox — Orchestrate Vercel Sandbox lifecycle inside durable workflows
  • Child Workflows — Spawn and orchestrate child workflows from a parent
  • Distributed Abort Controller — Build a cross-process abort controller using workflow streams and hooks
  • Upgrading Workflows — Identify a clean upgrade point in a long-running workflow and spawn a fresh run on the latest deployment carrying state forward
  • Serializable Steps — Wrap non-serializable third-party objects so they cross the workflow boundary
  • Publishing Libraries — Ship npm packages that export reusable workflow functions