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

推荐订阅源

J
Java Code Geeks
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
B
Blog RSS Feed
I
InfoQ
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
H
Help Net Security
L
LangChain Blog
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
aimingoo的专栏
aimingoo的专栏

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

Thrown when awaiting the return value of a cancelled workflow run.

WorkflowRunCancelledError is thrown when awaiting run.returnValue on a workflow run that was explicitly cancelled via run.cancel(). Cancelled runs do not produce a return value.

You can check for cancellation before awaiting by inspecting run.status.

import { WorkflowRunCancelledError } from "workflow/errors"
declare const run: { status: Promise<string>; returnValue: Promise<any> }; // @setup

try {
  const result = await run.returnValue;
} catch (error) {
  if (WorkflowRunCancelledError.is(error)) { 
    console.log(`Run ${error.runId} was cancelled`);
  }
}

Properties

NameTypeDescription
runIdstringThe ID of the cancelled run.
messagestringThe error message.

Static Methods

WorkflowRunCancelledError.is(value)

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

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

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