New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@workflow/errors

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@workflow/errors

A package for standardizing errors in Workflow SDK

beta
Source
npmnpm
Version
5.0.0-beta.24
Version published
Weekly downloads
1.4M
52.12%
Maintainers
2
Weekly downloads
 
Created
Source

@workflow/errors

Centralized errors package for Workflow SDK.

Use captureInvocationOutcome and unwrapInvocationOutcome from @workflow/errors/invocation to transport a handler's return value or error. Both use the InvocationOutcome type from @workflow/world.

Error outcomes preserve known Workflow error classes, messages, stacks, causes, and diagnostic fields. Unrecognized classes become Error instances with their original names and fields. The module also exports serializeWorkflowError and deserializeWorkflowError for converting individual errors.

Diagnostic serialization omits object accessors and bounds circular or deeply nested values. The transport must preserve Uint8Array and Date values in diagnostic fields.

Wrap the handler call with captureInvocationOutcome, then store or deliver the outcome separately. Storage and transport failures leave the caller uncertain whether processing succeeded. By default, the helper captures every thrown error. Pass isTerminalInvocationError as its second argument to rethrow transient or unrecognized failures for the delivery layer to retry. The Postgres World uses this retry policy.

FAQs

Package last updated on 25 Sep 2026

Related posts