The outcome
Operate an event-driven flow whose state transitions, side effects, retries, and recovery are deterministic and observable.
Step by step
A workflow you can repeat.
- 01
Map start events, state schema, listeners, routes, crew calls, side effects, pause points, terminal states, and idempotency keys.
- 02
Implement typed state and small start, listen, and router methods, keeping external actions behind validated interfaces and approval checks.
- 03
Persist only necessary state, encrypt sensitive fields, correlate every run, and checkpoint before and after any non-reversible action.
- 04
Test duplicate triggers, process restarts, timeouts, invalid routes, tool failures, human rejection, resumed runs, and partial external success.
- 05
Add tracing and alerts, bound retries and concurrency, version state migrations, and deploy gradually with a tested rollback and replay policy.
Working standard
What good use looks like.
- Model state transitions explicitly.
- Checkpoint around side effects.
- Make triggers and retries idempotent.
Official references