Skip to content

Errors

Every error Reflow throws extends ReflowError, so one instanceof ReflowError check catches them all. Subclasses carry structured context — no message parsing needed. See Error Handling for usage patterns.

typescript
import { ReflowError, WorkflowNotFoundError, ValidationError, StepTimeoutError } from 'reflow-ts'
ErrorThrown whenProperties
ReflowErrorBase class for all Reflow errors
ConfigErrorInvalid engine, retry, schedule, or stream config
WorkflowNotFoundErrorenqueue() / schedule() with an unknown nameworkflowName
DuplicateWorkflowErrorSame workflow name registered twice in one engineworkflowName
DuplicateStepError.step() / .parallel() reuses a nameworkflowName, stepName
ParallelCompleteErrorcomplete() called inside a parallel branchstepName
ValidationErrorInput fails schema validationissues
IdempotencyConflictErrorSame idempotency key with different inputworkflowName, idempotencyKey
SerializationErrorA step output / input contains non-persistable datapath
StepTimeoutErrorA step attempt exceeds timeoutMstimeoutMs
RunCancelledErrorA run is cancelled via engine.cancel()runId
LeaseExpiredErrorA worker loses its lease on a runrunId

ValidationError.issues

An array of { message: string; path?: ... } describing each schema violation, surfaced directly from your Standard Schema library.

Control-flow errors

RunCancelledError and LeaseExpiredError are control-flow signals, not failures — they do not reach onRunFailed or onFailure, and they leave a run reclaimable rather than marking it failed. StepTimeoutError, by contrast, is a real failure and reaches the failure paths.

Released under the MIT License.