Building Workflows
For developers importing Dwarf and building workflows with it. Read Getting Started, Concepts and How Dwarf Works first; everything here assumes that vocabulary.
A workflow is a graph of tasks. You define the graph with workflow.Graph, implement each task as a function that reads and writes a workflow.Flow, and drive executions through the engine. These guides cover each part in the order you meet it:
- Building Graphs — the
workflow.GraphAPI: tasks, transitions, conditions, fan-out, error handling, and reducers. - Writing Tasks — the
workflow.Flowcarrier: reading and writing state, the control signals (retry, sleep, goto, interrupt, subgraph), baggage, and handling transient failures. - Building a Host — a production host: an authenticated front door with quotas, the caller’s claims as baggage, ownership checks and tenant-scoped listing.
- Tasks in Other Languages — tasks in Python, TypeScript or any other language, over JSON.
- Fan-Out & Subgraphs — running work in parallel and calling sub-workflows.
- Driving Flows — every method on the engine: creating, running, inspecting and listing, pausing and resuming, terminating, forking, continuing a flow, retention and expiration.
- Detecting Completion — the ways to learn a flow’s outcome (
Await,Pollor orchestration) and how to make follow-up delivery reliable. - Scheduling — priority, fairness, time budgets and workers. Developers set the policy; operators read its effects.
- Testing —
NewEngineUnderTestandhosts.Muxpatterns. - Patterns — recipes for agent loops, human approval, compensation, deferred and recurring work, deadlines and rate limits.
The full API reference is on pkg.go.dev.
Next: Building Graphs.