graph
Graph workflow engine supporting directed execution graphs with conditional routing, parallel branches, and configurable join strategies (all, any, N-of-M, vote). Each node can be a step, parallel block, or route.
Used by cmd/graph-worker, cmd/graph-run.
Usage
import "cruvero/internal/graph"
Key Types / Interfaces
| Type | Source | Description |
|---|---|---|
Graph | types.go | Serializable directed graph definition with name and ordered nodes |
Node | types.go | Union type: step, parallel, or route node |
StepNode | types.go | Activity execution node with conditional execution and approval |
ParallelNode | types.go | Parallel branch execution with join strategy |
RouteNode | types.go | Conditional routing with cases and conditions |
GraphRunInput | types.go | Workflow input: run ID, graph, initial state, config |
GraphRunResult | types.go | Workflow output: final execution state |
RunConfig | types.go | Execution config: step timeout, approval timeout, conditions |
State | types.go | Type alias for map[string]any — mutable execution state |
ConditionFunc | types.go | Predicate function evaluated against execution state |
Key Files
| File | Purpose |
|---|---|
types.go | All graph types: Graph, Node, State, input/output |
workflow.go | Graph workflow execution engine |