Versions in this module Expand all Collapse all v0 v0.4.5 Oct 16, 2026 v0.4.4 Sep 29, 2026 v0.4.3 Sep 24, 2026 v0.4.2 Sep 17, 2026 v0.4.1 Aug 24, 2026 v0.4.0 Aug 14, 2026 Changes in this version + func AddVertex[I, O, S any](g *Graph[S], id VertexID, task Task[I, O], selector Selector[S, I], ...) error + func Interrupt(ctx context.Context, info any) error + func InterruptState[T any](ctx context.Context) (T, bool) + func ResumePayload[T any](ctx context.Context) (T, bool) + func Serve(ctx context.Context, reg Resolver, cp ControlPlane) error + func StatefulInterrupt(ctx context.Context, info, continuation any) error + type AmbiguousRoutingError struct + VertexID VertexID + func (e *AmbiguousRoutingError) Error() string + type BuildError struct + Detail string + Op string + func (e *BuildError) Error() string + type Checkpoint struct + Frontier []VertexID + Halt *HaltRecord + Interrupts []InterruptRecord + Phase StepPhase + Routes []RouteRecord + Run GraphRunState + State json.RawMessage + StepBase json.RawMessage + Vertices []VertexState + type CheckpointDecodeError struct + Err error + Field string + func (e *CheckpointDecodeError) Error() string + func (e *CheckpointDecodeError) Unwrap() error + type CheckpointGranularity int + const PerStep + const PerVertex + type CheckpointNotFoundError struct + GraphRunID GraphRunID + func (e *CheckpointNotFoundError) Error() string + type CheckpointStore interface + Append func(ctx context.Context, cp *Checkpoint) error + History func(ctx context.Context, id GraphRunID) ([]*Checkpoint, error) + Latest func(ctx context.Context, id GraphRunID) (*Checkpoint, error) + type CompileOption func(*compileConfig) + func WithStore(s CheckpointStore) CompileOption + type Condition struct + Pick func(ctx context.Context, s S) ([]VertexID, error) + Targets []VertexID + type ConditionError struct + Err error + From VertexID + func (e *ConditionError) Error() string + func (e *ConditionError) Unwrap() error + type ControlPlane interface + Consume func(ctx context.Context, serves []GraphVersionKey) (<-chan Delivery, error) + Submit func(ctx context.Context, w Work) error + type DeadEndError struct + Step StepID + func (e *DeadEndError) Error() string + type Delivery struct + Ack func() error + Nack func() error + Work Work + type DuplicateConditionalEdgeError struct + From VertexID + func (e *DuplicateConditionalEdgeError) Error() string + type DuplicateVertexError struct + VertexID VertexID + func (e *DuplicateVertexError) Error() string + type FuncTask struct + func NewFuncTask[I, O any](fn TaskFunc[I, O]) *FuncTask[I, O] + func (t *FuncTask[I, O]) Execute(ctx context.Context, in I) (O, error) + type Graph struct + func NewGraph[S any](id GraphID, opts ...GraphOption) *Graph[S] + func (g *Graph[S]) AddConditionalEdge(from VertexID, c Condition[S]) error + func (g *Graph[S]) AddEdge(from, to VertexID) error + func (g *Graph[S]) Compile(entry, finish VertexID, opts ...CompileOption) (*Runner[S], error) + type GraphID uuid.UUID + func (id *GraphID) UnmarshalText(b []byte) error + func (id GraphID) MarshalText() ([]byte, error) + func (id GraphID) String() string + type GraphMismatchError struct + Actual GraphID + Expected GraphID + func (e *GraphMismatchError) Error() string + type GraphOption func(*graphConfig) + func WithVersion(n uint64) GraphOption + type GraphRunExistsError struct + GraphRunID GraphRunID + func (e *GraphRunExistsError) Error() string + type GraphRunID uuid.UUID + func NewGraphRunID() (GraphRunID, error) + func (id *GraphRunID) UnmarshalText(b []byte) error + func (id GraphRunID) MarshalText() ([]byte, error) + func (id GraphRunID) String() string + type GraphRunMismatchError struct + Actual GraphRunID + Requested GraphRunID + func (e *GraphRunMismatchError) Error() string + type GraphRunState struct + CancelReason string + CancelledAt time.Time + CompletedAt time.Time + CreatedAt time.Time + GraphID GraphID + GraphRunID GraphRunID + GraphVersion string + InterruptedAt time.Time + Revision uint64 + StartedAt time.Time + Status RunStatus + Step StepID + UpdatedAt time.Time + type GraphVersionKey struct + GraphID GraphID + GraphVersion string + type GraphVersionMismatchError struct + Actual string + Expected string + func (e *GraphVersionMismatchError) Error() string + type Halt struct + Cause error + GraphRunID GraphRunID + Kind HaltKind + Step StepID + type HaltKind int + const HaltCondition + const HaltDeadEnd + const HaltMaxSteps + const HaltUndeclaredTarget + type HaltRecord struct + Cause string + Kind HaltKind + Step StepID + type Hooks struct + OnCheckpoint func(ctx context.Context, id GraphRunID, rev uint64, step StepID) + OnEdge func(ctx context.Context, from, to VertexID, run GraphRunState) + OnHalt func(ctx context.Context, h Halt) + OnInterrupt func(ctx context.Context, iv Interruption) + OnRunFinish func(ctx context.Context, ev GraphRunState) + OnRunStart func(ctx context.Context, ev GraphRunState) + OnStep func(ctx context.Context, run GraphRunState, activated int) + OnVertexFinish func(ctx context.Context, ev VertexState) + OnVertexStart func(ctx context.Context, ev VertexState) + type IdempotencyKey string + type InterruptKind int + const Awaiting + const Errored + type InterruptRecord struct + Cause string + Continuation json.RawMessage + Info json.RawMessage + Kind InterruptKind + Vertex VertexID + type Interruption struct + Cause error + GraphRunID GraphRunID + Info any + Kind InterruptKind + Vertex VertexID + type MaxStepsExceededError struct + Max int + Step StepID + func (e *MaxStepsExceededError) Error() string + type MemStore struct + func NewMemStore() *MemStore + func (s *MemStore) Append(ctx context.Context, cp *Checkpoint) error + func (s *MemStore) History(ctx context.Context, id GraphRunID) ([]*Checkpoint, error) + func (s *MemStore) Latest(ctx context.Context, id GraphRunID) (*Checkpoint, error) + type MissingEntryError struct + Role string + VertexID VertexID + func (e *MissingEntryError) Error() string + type Reducer func(s *S, out O) error + type Resolver interface + Keys func() []GraphVersionKey + Resolve func(id GraphID, version string) (RunnerHandle, bool) + type Result struct + Halt *Halt + Interrupts []Interruption + Run GraphRunState + State S + type ResumeTerminalError struct + Status RunStatus + func (e *ResumeTerminalError) Error() string + type RetryPolicy struct + Backoff func(attempt int) time.Duration + MaxAttempts int + Retryable func(err error) bool + type RevisionConflictError struct + Actual uint64 + Expected uint64 + GraphRunID GraphRunID + func (e *RevisionConflictError) Error() string + type RouteRecord struct + Conditional bool + From VertexID + To []VertexID + type RunInfo struct + GraphID GraphID + GraphRunID GraphRunID + Step StepID + VertexID VertexID + VertexRunID VertexRunID + func Info(ctx context.Context) (RunInfo, bool) + func (i RunInfo) IdempotencyKey() IdempotencyKey + type RunOption func(*runConfig) + func WithCheckpointEvery(g CheckpointGranularity) RunOption + func WithConcurrency(n int) RunOption + func WithGraphRunID(id GraphRunID) RunOption + func WithHooks(h Hooks) RunOption + func WithMaxSteps(n int) RunOption + type RunResult struct + Halt *Halt + Interrupts []Interruption + Run GraphRunState + State json.RawMessage + type RunStatus int + const RunCancelled + const RunCompleted + const RunInterrupted + const RunRunning + func (s RunStatus) String() string + type Runner struct + func (r *Runner[S]) Cancel(ctx context.Context, id GraphRunID, reason string, opts ...RunOption) error + func (r *Runner[S]) Get(ctx context.Context, id GraphRunID) (*Result[S], error) + func (r *Runner[S]) GraphID() GraphID + func (r *Runner[S]) GraphVersion() string + func (r *Runner[S]) Resume(ctx context.Context, id GraphRunID, payload any, opts ...RunOption) (*Result[S], error) + func (r *Runner[S]) Run(ctx context.Context, in S, opts ...RunOption) (*Result[S], error) + func (r *Runner[S]) Status(ctx context.Context, id GraphRunID) (GraphRunState, error) + type RunnerHandle interface + Cancel func(ctx context.Context, id GraphRunID, reason string, opts ...RunOption) error + Get func(ctx context.Context, id GraphRunID) (*RunResult, error) + GraphID func() GraphID + GraphVersion func() string + Resume func(ctx context.Context, id GraphRunID, payloadJSON json.RawMessage, ...) (*RunResult, error) + Run func(ctx context.Context, stateJSON json.RawMessage, opts ...RunOption) (*RunResult, error) + Status func(ctx context.Context, id GraphRunID) (GraphRunState, error) + func NewRunnerHandle[S any](r *Runner[S]) RunnerHandle + type Selector func(s S) I + type StepID int + func (s StepID) String() string + type StepPhase int + const StepHalted + const StepPaused + const StepRouted + const StepRunning + type StoreError struct + Err error + Op string + func (e *StoreError) Error() string + func (e *StoreError) Unwrap() error + type Task interface + Execute func(ctx context.Context, in I) (O, error) + type TaskFunc func(ctx context.Context, in I) (O, error) + type UndeclaredTargetError struct + From VertexID + Target VertexID + func (e *UndeclaredTargetError) Error() string + type UnknownVertexError struct + VertexID VertexID + func (e *UnknownVertexError) Error() string + type UnknownWorkOpError struct + Op WorkOp + func (e *UnknownWorkOpError) Error() string + type UnreachableVertexError struct + VertexID VertexID + func (e *UnreachableVertexError) Error() string + type VertexError struct + Attempt int + Err error + VertexID VertexID + VertexRunID VertexRunID + func (e *VertexError) Error() string + func (e *VertexError) Unwrap() error + type VertexID uuid.UUID + func (id *VertexID) UnmarshalText(b []byte) error + func (id VertexID) MarshalText() ([]byte, error) + func (id VertexID) String() string + type VertexOption func(*vertexConfig[S]) + func WithErrorPause[S any]() VertexOption[S] + func WithErrorRoute[S any](handler VertexID, record Reducer[S, error]) VertexOption[S] + func WithRetry[S any](p RetryPolicy) VertexOption[S] + func WithTimeout[S any](d time.Duration) VertexOption[S] + type VertexRunID uuid.UUID + func NewVertexRunID() (VertexRunID, error) + func (id *VertexRunID) UnmarshalText(b []byte) error + func (id VertexRunID) MarshalText() ([]byte, error) + func (id VertexRunID) String() string + type VertexState struct + Attempt int + CompletedAt time.Time + CreatedAt time.Time + Err string + FailedAt time.Time + InterruptedAt time.Time + StartedAt time.Time + Status VertexStatus + Step StepID + VertexID VertexID + VertexRunID VertexRunID + func Self(ctx context.Context) (VertexState, bool) + type VertexStatus int + const VertexDone + const VertexFailed + const VertexInterrupted + const VertexPending + const VertexRunning + func (s VertexStatus) String() string + type Work struct + GraphRunID GraphRunID + Input json.RawMessage + Key GraphVersionKey + Op WorkOp + type WorkOp uint8 + const OpResume + const OpRun + func (o WorkOp) String() string v0.3.0 Aug 11, 2026 v0.2.0 Jul 23, 2026 v0.1.0 Jul 4, 2026