temporalgraph / graph-based orchestration
temporalgraph lets you design Temporal workflows as explicit directed acyclic graphs (DAGs) in Go. Define nodes (activities/subgraphs), wire them with edges, and compile into a deterministic runner that executes on Temporal with your ActivityOptions
and retry policies. This gives you an ergonomic, type-safe way to orchestrate complex pipelines with parallelism, branching, and merges—without hand-writing workflow control flow.
What problems it solves#
- Structured orchestration: Model complex workflows as a DAG instead of ad-hoc code paths.
- Parallelism and merging: Fan-out/fan-in patterns are first-class citizens.
- Conditional routing: Branch nodes choose downstream paths at runtime.
- Type-safety: Strongly-typed node inputs/outputs and field mapping reduce brittle casting.
- Error handling: Centralized propagation and node-aware errors to aid troubleshooting.
- Reuse and composability: Encapsulate subgraphs and reuse them across workflows.
Key features#
- DAG composition for Temporal:
AddNode
,AddEdge
,Compile
, thenInvoke
. - Branching and conditional execution with validated end-node targets.
- Typed field mapping between steps to avoid glue code.
- Deterministic, activity-based execution using
go.temporal.io/sdk/workflow
andActivityOptions
(including retries/timeouts). - Parallel task submission and completion loop in the workflow for high throughput.
- Extensible hooks for pre-node, edge, and pre-branch handling where applicable.
- Clear START/END semantics and automatic merge of upstream results.
How it works (high level)#
Graph compilation creates a deterministic runner that manages channels, dependencies, and execution order across nodes.
Workflow loop submits ready nodes as activities in parallel, waits for completion, propagates outputs, and calculates next tasks until END.
Branching evaluates branch conditions at runtime and routes to validated end nodes; skipped nodes are tracked for correctness.
Who is it for#
Temporal users who prefer declarative, graph-based orchestration in Go.
Teams building ML/data pipelines, microservice orchestrations, ETL, or multi-step business processes with clear parallel and conditional flows.