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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
D
DataBreaches.Net
C
Check Point Blog
雷峰网
雷峰网
小众软件
小众软件
GbyAI
GbyAI
美团技术团队
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
Jina AI
Jina AI
爱范儿
爱范儿
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美

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
WorkflowError
2026-06-12 · via Workflow SDK Documentation

Base class for all workflow error types.

WorkflowError is the base class that all Workflow SDK error types extend, such as WorkflowRunFailedError and HookNotFoundError. It extends Error with an optional cause and, for some subclasses, a link to the relevant error documentation appended to the message.

import { WorkflowError } from "workflow/errors"

const error = new WorkflowError("something went wrong", {
  cause: new Error("underlying cause"),
});

Properties

NameTypeDescription
messagestringThe error message.
causeunknownThe underlying cause, when provided.

Static Methods

WorkflowError.is(value)

Type-safe check for WorkflowError instances. Preferred over instanceof because it works across module boundaries and VM contexts.

WorkflowError.is() matches only direct WorkflowError instances — not subclasses, which override the error name it checks. To handle a specific error type, use that subclass's own .is() method (e.g. WorkflowRunFailedError.is(error)).

import { WorkflowError } from "workflow/errors"
declare const error: unknown; // @setup

if (WorkflowError.is(error)) {
  // error is typed as WorkflowError
}