Pattern [06]

Planning

Workflow Orchestration / Saga Pattern / Finite State Machine (FSM)

> Agentic Definition

Planning is the capability of an agent to break down a high-level, ambiguous user goal into a sequence of executable steps (a plan), and then execute them, maintaining the state of progress. It allows agents to tackle tasks that are too complex to be solved in a single turn.

> Description

The capability of an agent to break down a high-level, ambiguous user goal into a sequence of executable steps (a plan), and then execute them while maintaining the state of progress.

Frequently Asked Questions

When should I use the Planning pattern?

Planning is the capability of an agent to break down a high-level, ambiguous user goal into a sequence of executable steps (a plan), and then execute them, maintaining the state of progress. It allows agents to tackle tasks that are too complex to be solved in a single turn.

How does Planning relate to Workflow Orchestration / Saga Pattern / Finite State Machine (FSM)?

Both involve managing a sequence of dependent tasks to achieve a complex goal. Both must manage state (which step are we on?) and dependencies (Step B requires Step A). However, there is a key divergence: Standard workflows (e.g., Airflow DAGs, AWS Step Functions) are static and defined at compile-time by the engineer. Agentic plans are dynamic and generated at run-time by the model. The agent builds its own DAG (Directed Acyclic Graph) based on the specific request, allowing it to handle novel situations that the programmer did not foresee.

What are the production trade-offs of Planning?

Agents often get stuck in loops or generate invalid plans (e.g., skipping a prerequisite). Reliability requires careful guardrails. Evaluating planners is difficult. You must verify not just the final output, but the validity of the generated plan logic. Is the plan optimal? Is it safe? Planning takes time upfront ("Time to First Token" is high). Latency-sensitive applications need to balance planning depth with responsiveness.