Plan-and-Execute (ReWOO)
Generate a complete plan up front, then execute steps, rather than deciding the next action after each observation.
This page is the complete instruction page for one pattern called "Plan-and-Execute (ReWOO)." It explains the problem this pattern solves, the idea behind the solution, when you should (and should not) use it, and what happens afterward — both the good effects and the costs.
This matters because building AI agents is not just about making them clever. It is also about making them safe and predictable. Following a well-tested pattern like this one helps avoid common mistakes, and shows you exactly which safety rules and regulations it connects to, listed under "Standards Mesh" on this page.
Context
ReAct is wasteful when the task is predictable and the cost of re-planning each step dominates. Planning up front lets execution be cheaper and parallelisable.
Problem
Purely reactive agents repeat themselves, burn tokens on re-deciding, and sometimes loop.
Forces
- Plan rigidity vs adaptation to observations
- Up-front cost vs per-step cost
Solution
Use a Planner LLM to decompose the goal into a dependency graph of steps. A Worker executes each step (possibly in parallel). A Solver synthesises results. Observations update state but the plan is revised only when it genuinely breaks.
Applicability
- Tasks with predictable structure
- Research and analysis pipelines
- Multi-step automation with low novelty
Anti-Patterns
- Using Plan-and-Execute for highly exploratory tasks where the plan must change at every step
- Ignoring observations that should trigger re-plan
Consequences
- +Cheaper per-task token cost
- +Parallelisable execution
- −Less adaptive to surprises
- −Bad plans produce wrong-but-efficient failure