By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
When an agent 'plans', most implementations produce a paragraph of intentions and then immediately forget it. A plan you can validate, execute, resume and test has to be data.
{
"goal": "Answer: are mid-market retailers adopting AI support?",
"steps": [
{"id": "s1", "action": "search", "args": {"query": "mid-market retail AI support"}, "needs": []},
{"id": "s2", "action": "search", "args": {"query": "retail AI support cost per ticket"}, "needs": []},
{"id": "s3", "action": "read", "args": {"from": "s1"}, "needs": ["s1"]},
{"id": "s4", "action": "extract", "args": {"from": "s3"}, "needs": ["s3"]},
{"id": "s5", "action": "draft", "args": {}, "needs": ["s2", "s4"]}
]
}Now the plan can be checked before a single call: are all actions known, do the dependencies exist, is there a cycle, is the step count within budget?
| Property | Why | Failure if unchecked |
|---|---|---|
| Known actions | A step calling a non-existent tool | Crash mid-run |
| Dependencies exist | A step needs s9 which was never defined | Deadlock or crash |
| No cycles | s1 needs s2, s2 needs s1 | Infinite planning loop |
| Step budget | Plans grow unboundedly | Cost and latency blowout |
| Side-effect steps are last | Draft before approval is written | Irreversible action on bad data |
Key takeaways
A plan is JSON: goal, steps, actions, args and dependencies.
Validate actions, dependencies, cycles, budget and side-effect order before running.
Execution is a deterministic topological sort.
Determinism is what makes a plan testable.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.