Narrative
Flow Like Water grew out of a Kubernetes provisioning project where
a dozen shell commands had to run in strict order, with guardrails
and retries. The official instructions were clear, but brittle:
miss a step, and you re-run everything from scratch.
The library reframes that situation as a state machine. Each command
becomes a task that knows when it can run and where it should
transition next. Tasks can be grouped, replayed, and observed with
lifecycle events, which turns procedural scripts into a workflow you
can reason about.
Core idea
Treat every step as a state. Transitions are explicit. Retries are
built into the model rather than bolted on afterwards.
Example: provisioning flow
This example shows the typical pattern: declare tasks, define
conditions, group them, and let the controller run the workflow.
More examples
1. Progress events
Subscribe to lifecycle events to drive logs, dashboards, or
notifications.
2. State snapshots
Persist workflow state and resume where you left off after an
interruption.
3. Retry with backoff
Encapsulate retry logic inside the task definition instead of
writing wrapper loops.