Deterministic Harnesses, State Machines & Crash Recovery
LLMs are probabilistic, while production business workflows demand deterministic guarantees. Wrap reasoning inside explicit state machines, dry-runs, durable checkpoints, and human-in-the-loop gates for high-impact mutations.
Letting an unconstrained autonomous loop improvise an entire multi-minute workflow invites trajectory drift and lost work on crashes. A deterministic harness enforces exact invariants, survives restarts, and restricts the model strictly to dynamic reasoning nodes.
Mental Model
A train follows steel tracks (Deterministic Harness & State Machine), hands specialized reasoning to focused crews, and saves every station stop (Durable Checkpoints).
What Breaks Without This
A server restart 3 minutes into a workflow wipes all progress—or a probabilistic loop skips a mandatory compliance check before mutating production records.
Key Concepts
- Deterministic Workflows: Using fixed step-by-step code for predictable tasks instead of making the AI improvise. Using explicit state machines or DAGs for predictable steps, reserving autonomous LLM loops only for dynamic reasoning.
- Workflow Orchestration: Coordinating a supervisor and specialist sub-agents working together on shared state. Coordinating multi-agent handoffs, supervisor-worker routing, and shared state across specialized sub-agents.
- Queues & Durable Execution: Background workers and saved checkpoints so multi-minute tasks survive server restarts. Background workers and durable engines (e.g., Temporal) so multi-minute agent runs survive server restarts.
Key Takeaway
Use deterministic code for predictable steps, specialist sub-agents for reasoning, and durable queues to survive crashes.