Skip to content

Graphorin API reference v0.15.1


Graphorin API reference / @graphorin/workflow / errors

errors ​

Typed error surface for @graphorin/workflow. Every workflow-level failure lands as a subclass of WorkflowError carrying the stable string code discriminator so consumers can pattern-match without inspecting messages.

Classes ​

ClassDescription
CheckpointNotFoundErrorThrown when Workflow.fork cannot find the named checkpoint.
CheckpointVersionConflictErrorThrown when a checkpoint write detects that another writer advanced the thread concurrently - the loser must not fork the timeline.
ConcurrentResumeErrorThrown when a second concurrent resume is attempted for the same thread.
DeadEndErrorThrown when planning stalls with no runnable tasks and no satisfied END edge - an all-false conditional fan is an error, not a silent completion.
InvalidChannelWriteErrorThrown when a node writes a key not declared in stateSchema.
InvalidWorkflowConfigErrorThrown by createWorkflow on configuration validation failure.
MultiWriteErrorThrown when more than one writer in a single execution step writes a LatestValue.
NodeExecutionErrorThrown when a node throws and the failure is propagated through the engine.
NodeTimeoutErrorThrown when a node body exceeds its wall-clock budget. The task's ctx.signal is aborted first so a well-behaved body can stop; bodies that ignore the signal keep running in the background (same contract as cancellation).
PauseNotFoundErrorThrown by resolveAwakeable / approve when no pending pause carries the requested name.
ReducerErrorThrown when a Reducer channel's reduce(...) callback throws.
ResumeWithoutSuspensionErrorThrown by Workflow.resume when the named thread is not in a suspended state.
StateNotSerializableErrorThrown when a value that rides the checkpoint would not survive a JSON round-trip - Map/Set/Date/class instances silently degrade with the SQLite store, so every store rejects them eagerly. Covers EVERYTHING that round-trips through the checkpoint: channel state, pause values and approval payloads, dispatchArgs, satisfied resume values, and operator directives (validated at resume entry, before the node body runs). The pseudo-channels <pause:node> / <dispatch:node> / <task:node> / <directive> name the offending surface.
ThreadNotFoundErrorThrown when Workflow.resume cannot find the named thread.
UnknownNodeErrorThrown by createWorkflow when an edge references a node that is not registered.
WorkflowAbortedErrorThrown when a workflow run is cancelled via AbortSignal.
WorkflowDivergenceErrorThrown on resume when the persisted frontier references nodes that no longer exist in the workflow definition - the definition changed mid-flight and a silent re-plan would diverge from the journal.
WorkflowErrorBase error class for all @graphorin/workflow failures.
WorkflowVersionMismatchErrorThrown on resume when the stored frontier was written by a different WorkflowConfig.version - replaying persisted state through changed code must fail loudly, not silently diverge. Opt out per call via allowVersionMismatch.

Type Aliases ​

Type AliasDescription
WorkflowErrorCodeStable code discriminator on every WorkflowError subclass. Treat as a string literal union for switch (err.code) style code.