Skip to content

Graphorin API reference v0.7.0


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 (WF-12) - 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 (WF-14) - 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 (D1 / workflow-03). 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 (D1) 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 (WF-10) - 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 (W-121): 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 (D1) - 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 (D1 / workflow-14) - 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.