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
| Class | Description |
|---|---|
| CheckpointNotFoundError | Thrown when Workflow.fork cannot find the named checkpoint. |
| CheckpointVersionConflictError | Thrown when a checkpoint write detects that another writer advanced the thread concurrently (WF-12) - the loser must not fork the timeline. |
| ConcurrentResumeError | Thrown when a second concurrent resume is attempted for the same thread. |
| DeadEndError | Thrown 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. |
| InvalidChannelWriteError | Thrown when a node writes a key not declared in stateSchema. |
| InvalidWorkflowConfigError | Thrown by createWorkflow on configuration validation failure. |
| MultiWriteError | Thrown when more than one writer in a single execution step writes a LatestValue. |
| NodeExecutionError | Thrown when a node throws and the failure is propagated through the engine. |
| NodeTimeoutError | Thrown 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). |
| PauseNotFoundError | Thrown by resolveAwakeable / approve (D1) when no pending pause carries the requested name. |
| ReducerError | Thrown when a Reducer channel's reduce(...) callback throws. |
| ResumeWithoutSuspensionError | Thrown by Workflow.resume when the named thread is not in a suspended state. |
| StateNotSerializableError | Thrown 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. |
| ThreadNotFoundError | Thrown when Workflow.resume cannot find the named thread. |
| UnknownNodeError | Thrown by createWorkflow when an edge references a node that is not registered. |
| WorkflowAbortedError | Thrown when a workflow run is cancelled via AbortSignal. |
| WorkflowDivergenceError | Thrown 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. |
| WorkflowError | Base error class for all @graphorin/workflow failures. |
| WorkflowVersionMismatchError | Thrown 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 Alias | Description |
|---|---|
| WorkflowErrorCode | Stable code discriminator on every WorkflowError subclass. Treat as a string literal union for switch (err.code) style code. |