WorkflowRuntimeError

Thrown when the workflow runtime encounters an execution error, such as serialization failures or timeouts.

WorkflowRuntimeError is thrown when the workflow runtime encounters an error executing a workflow. Common causes include:

  • Values crossing the workflow/step boundary that cannot be serialized
  • Workflow execution timeouts
  • Invalid runtime state, such as misconfigured streams
import { WorkflowRuntimeError } from "workflow/errors"
declare function runWorkflowOperation(): Promise<void>; // @setup

try {
  await runWorkflowOperation();
} catch (error) {
  if (WorkflowRuntimeError.is(error)) {
    console.error("Workflow runtime error:", error.message);
  }
}

API Signature

Properties

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

Static Methods

WorkflowRuntimeError.is(value)

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

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

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