FatalError

Throw to mark a step as permanently failed without retrying.

When a FatalError is thrown in a step, the step fails without retrying and the error bubbles back to the workflow logic.

Use FatalError when a failure is intentional or unrecoverable and retrying would be wasteful or harmful.

import { FatalError } from "workflow"

async function fallibleWorkflow() {
    "use workflow"
    await fallibleStep();
}

async function fallibleStep() {
    "use step"
    throw new FatalError("Fallible!") 
}

API Signature

Constructor

new FatalError(message: string)
ParameterTypeDescription
messagestringThe error message

Instance Properties

PropertyTypeDescription
fatalbooleanAlways initialized to true. Marks the error as non-retryable.

Static Methods

FatalError.is(value)

FatalError.is(value: unknown): value is FatalError

Returns true if value is a FatalError instance. Useful for checking caught errors without instanceof.

On this page

GitHubEdit this page on GitHub