Do You Need a Team? Workflow, Single Agent or Several
Why This Matters
The cheapest agent is the one you do not build. If the steps are always the same, a fixed workflow in code is faster, cheaper and easier to test than any agent. A team of agents is the most powerful shape and the most expensive one; it has to earn its place.
Three shapes
| Shape | Who decides the steps | Example |
|---|---|---|
| Workflow | Your code, always the same order | Compute history → trim log → one triage call → validate |
| Single agent | The model, using tools | TestPilot from module 4: fetches what it needs per failure |
| Coordinator with specialists | A coordinating agent hands parts to other agents | A whole red pipeline split between a flaky analyst, a root-cause investigator and a bug writer |
Questions that decide it
- Are the steps predictable? If every failure needs the same three pieces of evidence, use a workflow and fetch them in code.
- Does the work split into independent parts? Forty failures from three different causes can be investigated in parallel by separate agents.
- Does each part need a different context or toolbox? A flaky analyst needs history and timing, not the issue tracker. A bug writer needs the tracker, not raw logs.
- Is one context getting too big? A single agent that has read forty logs has a crowded context. Specialists each start fresh.
If the answer to 2–4 is “no”, you do not need a team.
What a team costs
- Tokens: every agent has its own system prompt, tools and context. Teams often use several times the tokens of a single agent.
- Latency: coordination adds round trips.
- New failure modes: hand-offs that lose information, agents that disagree, a coordinator that forgets a failure.
- Harder debugging: you need traces across agents (lesson 60).
TestPilot’s answer
- One failure: a single agent with tools (module 4), or even a workflow if the evidence is always the same.
- A whole red pipeline with many failures and mixed causes: a coordinator with specialists. That is what you build in this module.
Exercise
For each scenario, choose a shape and write two sentences on why:
- Every night, summarise the five slowest tests in a fixed format.
- A developer asks “why is this test red?” for one test.
- After a big merge, 40 tests fail with at least three different causes, and some may need bug reports.
Show suggested answers
- Workflow. The steps are fixed and known: query the five slowest tests (code), format them (code or one model call). No decisions for an agent to make.
- Single agent with tools. One test, but you don’t know in advance which evidence is needed: history, log, commit diff. Let the agent fetch what it needs.
- Coordinator with specialists. The work splits into independent groups that can be investigated in parallel, and bug reports are a separate job with separate (write) permissions.