Versions in this module Expand all Collapse all v0 v0.1.1 Aug 25, 2026 v0.1.0 Aug 14, 2026 Changes in this version + const ArtifactInputBootstrap + const ArtifactInputParent + const DefaultRunPageSize + const MaxArtifactReferences + const MaxDocumentBytes + const MaxDocumentDepth + const MaxDocumentProperties + const MaxInputBytes + const MaxRunPageSize + const MaxRunRecordBytes + const MaxSchemaBytes + const MaxSchemaDepth + const MaxSchemaProperties + const MaxStatusSummaryBytes + const SupervisorResourceName + var ErrActivityValidation = errors.New("workflow activity validation failed") + var ErrAdoption = errors.New("workflow adoption failed") + var ErrConflict = errors.New("workflow record conflict") + var ErrCorruptRecord = errors.New("corrupt workflow record") + var ErrDuplicateDefinition = errors.New("duplicate workflow definition") + var ErrInvalidInput = errors.New("invalid workflow input") + var ErrInvalidSchema = errors.New("invalid workflow schema") + var ErrNotFound = errors.New("workflow record not found") + var ErrReconciliation = errors.New("workflow activity reconciliation failed") + var ErrSessionOwned = errors.New("workflow session already owned") + var ErrShutdownTimeout = errors.New("workflow supervisor shutdown timed out") + var ErrSupervisorActive = errors.New("workflow supervisor already active") + var ErrSupervisorClosed = errors.New("workflow supervisor closed") + var ErrUnknownDefinition = errors.New("unknown workflow definition") + func StrictJSONDecoder[S any](raw json.RawMessage) (S, error) + type ActivityHistoryPage struct + NextEventID *uuid.UUID + NextRevision *uint64 + Records []ActivityHistoryRecord + type ActivityHistoryRecord struct + Metadata tool.WorkflowActivityMetadata + Revision uint64 + type ActivityValidationError struct + Field string + Rule string + func (e *ActivityValidationError) Error() string + func (e *ActivityValidationError) Unwrap() error + type AdoptionError struct + Err error + Op string + RunID uuid.UUID + func (e *AdoptionError) Error() string + func (e *AdoptionError) Unwrap() error + type ArtifactReference struct + Digest string + ID string + Kind string + Size int64 + type Catalog struct + func NewCatalog() *Catalog + func (c *Catalog) List() []Metadata + func (c *Catalog) Register(definition Definition) error + func (c *Catalog) Resolve(name, version string) (Definition, error) + type ConflictError struct + Actual uint64 + Expected uint64 + Reason string + RunID uuid.UUID + SessionID uuid.UUID + func (e *ConflictError) Error() string + func (e *ConflictError) Unwrap() error + type CorruptRecordError struct + Err error + Key string + func (e *CorruptRecordError) Error() string + func (e *CorruptRecordError) Unwrap() error + type Definition interface + Cancel func(context.Context, flow.GraphRunID, string, ...flow.RunOption) error + Get func(context.Context, flow.GraphRunID) (*Result, error) + History func(context.Context, flow.GraphRunID) ([]flow.GraphRunState, error) + Metadata func() Metadata + Resume func(context.Context, flow.GraphRunID, ValidatedResume, ...flow.RunOption) (*Result, error) + Start func(context.Context, ValidatedInput, ...flow.RunOption) (*Result, error) + ValidateInput func(json.RawMessage) (ValidatedInput, error) + ValidateResume func(json.RawMessage) (ValidatedResume, error) + type DuplicateDefinitionError struct + Name string + Version string + func (e *DuplicateDefinitionError) Error() string + func (e *DuplicateDefinitionError) Unwrap() error + type InputReference struct + Digest string + Key string + Size int64 + type InputStore struct + func NewInputStore(blobs storage.Blobs) (*InputStore, error) + func (s *InputStore) Get(ctx context.Context, sessionID uuid.UUID, ref InputReference) ([]byte, error) + func (s *InputStore) Put(ctx context.Context, sessionID uuid.UUID, canonicalJSON []byte) (InputReference, error) + type InvalidInputError struct + Err error + Field string + func (e *InvalidInputError) Error() string + func (e *InvalidInputError) Unwrap() error + type InvalidSchemaError struct + Err error + Field string + func (e *InvalidSchemaError) Error() string + func (e *InvalidSchemaError) Unwrap() error + type ListRunsRequest struct + After string + Limit int + type Metadata struct + func NewMetadata(name, version, description string, inputSchema, resumeSchema json.RawMessage, ...) (Metadata, error) + func (m Metadata) Description() string + func (m Metadata) InputSchema() json.RawMessage + func (m Metadata) MarshalJSON() ([]byte, error) + func (m Metadata) Name() string + func (m Metadata) ResumeSchema() json.RawMessage + func (m Metadata) Version() string + func (m Metadata) Vertices() []VertexMetadata + type NotFoundError struct + Digest string + Kind string + RunID uuid.UUID + SessionID uuid.UUID + func (e *NotFoundError) Error() string + func (e *NotFoundError) Unwrap() error + type ReconciliationError struct + Err error + Op string + RunID uuid.UUID + func (e *ReconciliationError) Error() string + func (e *ReconciliationError) Unwrap() error + type Result struct + Halt *flow.Halt + Interrupts []flow.Interruption + Run flow.GraphRunState + State json.RawMessage + Summary string + type ResumeDecoder func(json.RawMessage) (any, error) + func TypedResumeDecoder[R any](decoder StateDecoder[R]) ResumeDecoder + type Run struct + ActivityCursor uint64 + ArtifactInputKind string + ArtifactInputRunID uuid.UUID + ArtifactInputSessionID uuid.UUID + ArtifactRunID uuid.UUID + ArtifactSessionID uuid.UUID + Artifacts []ArtifactReference + CancelRequested bool + CheckpointRevision uint64 + CreatedAt time.Time + DefinitionName string + DefinitionVersion string + GraphRunID flow.GraphRunID + ID uuid.UUID + Input InputReference + LedgerLocator string + ParentRunID uuid.UUID + Revision uint64 + SessionID uuid.UUID + Status RunStatus + StatusSummary string + ToolExecutionID uuid.UUID + UpdatedAt time.Time + type RunPage struct + Next string + Runs []Run + type RunRegistry struct + func NewRunRegistry(kv storage.KV) (*RunRegistry, error) + func (r *RunRegistry) CompareAndSwap(ctx context.Context, expectedRevision uint64, next Run) (*Run, error) + func (r *RunRegistry) Create(ctx context.Context, run Run) (*Run, error) + func (r *RunRegistry) Get(ctx context.Context, sessionID, runID uuid.UUID) (*Run, error) + func (r *RunRegistry) List(ctx context.Context, sessionID uuid.UUID, request ListRunsRequest) (RunPage, error) + type RunStatus string + const RunCancelled + const RunCompleted + const RunFailed + const RunInterrupted + const RunPending + const RunRunning + type SessionOwnedError struct + HolderEpoch uint64 + SessionID uuid.UUID + func (e *SessionOwnedError) Error() string + func (e *SessionOwnedError) Unwrap() error + type StateDecoder func(json.RawMessage) (S, error) + type StatusSummarizer func(S) string + type Supervisor struct + func NewSupervisor(config SupervisorConfig) (*Supervisor, error) + func (s *Supervisor) Activate(ctx context.Context, services tool.SessionResourceServices) error + func (s *Supervisor) Cancel(ctx context.Context, runID uuid.UUID, reason string) error + func (s *Supervisor) History(ctx context.Context, runID uuid.UUID, afterRevision uint64, ...) (ActivityHistoryPage, error) + func (s *Supervisor) LastError() error + func (s *Supervisor) Resume(ctx context.Context, runID uuid.UUID, payload json.RawMessage) error + func (s *Supervisor) SessionID() uuid.UUID + func (s *Supervisor) Shutdown(ctx context.Context) error + func (s *Supervisor) Start(ctx context.Context, runID uuid.UUID) (<-chan struct{}, <-chan error, error) + func (s *Supervisor) WaitIdle(ctx context.Context) error + type SupervisorConfig struct + Catalog *Catalog + Inputs *InputStore + Leaser storage.Leaser + MaxWorkers int + Now func() time.Time + Registry *RunRegistry + SessionID uuid.UUID + ShutdownTimeout time.Duration + type TypedDefinition struct + func NewTypedDefinition[S any](metadata Metadata, runner *flow.Runner[S], store flow.CheckpointStore, ...) (*TypedDefinition[S], error) + func (d *TypedDefinition[S]) Adopt(ctx context.Context, id flow.GraphRunID, opts ...flow.RunOption) (*Result, error) + func (d *TypedDefinition[S]) Cancel(ctx context.Context, id flow.GraphRunID, reason string, opts ...flow.RunOption) error + func (d *TypedDefinition[S]) Get(ctx context.Context, id flow.GraphRunID) (*Result, error) + func (d *TypedDefinition[S]) History(ctx context.Context, id flow.GraphRunID) ([]flow.GraphRunState, error) + func (d *TypedDefinition[S]) Metadata() Metadata + func (d *TypedDefinition[S]) Resume(ctx context.Context, id flow.GraphRunID, resume ValidatedResume, ...) (*Result, error) + func (d *TypedDefinition[S]) Start(ctx context.Context, input ValidatedInput, opts ...flow.RunOption) (*Result, error) + func (d *TypedDefinition[S]) ValidateInput(raw json.RawMessage) (ValidatedInput, error) + func (d *TypedDefinition[S]) ValidateResume(raw json.RawMessage) (ValidatedResume, error) + type UnknownDefinitionError struct + Name string + Version string + func (e *UnknownDefinitionError) Error() string + func (e *UnknownDefinitionError) Unwrap() error + type ValidatedInput struct + type ValidatedResume struct + type VertexMetadata struct + func NewVertexMetadata(label string) VertexMetadata + func NewVertexMetadataForID(id flow.VertexID, label string) VertexMetadata + func (m VertexMetadata) ID() flow.VertexID + func (m VertexMetadata) Label() string + func (m VertexMetadata) MarshalJSON() ([]byte, error)