Text decision tree
Adapted from Appendix V of Decision Trees: Frameworks for Technology Choices. Sources reviewed 2026-11-07.
START: Choose execution behavior before choosing a framework.
Q1. The steps and routes are predictable?
Yes -> Use an explicit workflow. Keep decisions and handoffs visible. [Q2]
No -> Otherwise use an agent loop for model-selected steps, with clear tool and iteration limits. [Q2]
Q2. Need checkpointed branching or review?
Yes -> Evaluate a state graph. LangGraph is one candidate. [Q3]
No -> Otherwise keep the orchestration simple and test the failure paths. [Q3]
Q3. Must wait or recover across failures?
Yes -> Evaluate durable execution. Temporal can wrap agent operations. [Q4]
No -> Otherwise a bounded run may be sufficient if its recovery behavior is acceptable. [Q4]
Q4. Tools can change external systems?
Yes -> Design safe retries and approvals. Use operation IDs and explicit controls. [END]
No -> Otherwise validate the state and replay behavior for the read-only workload. [END]
END: Persist the state that must survive. Test replay, approval, retries and duplicate side effects before production.
AI-generated chapter illustration
Conceptual illustration for Choose an agent state model
The illustration compares three execution styles as assembly lines. This is not the graph's complete branching logic. Persistence and recovery do not by themselves make an external tool action safe to repeat; the graph keeps retry and approval controls explicit.
The illustration was generated in BookWriter. Its visual arrangement is interpretive; use the explicit nodes and routes in the graph and text tree for the decision.