Skip to main content

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

ShapeWho decides the stepsExample
WorkflowYour code, always the same orderCompute history → trim log → one triage call → validate
Single agentThe model, using toolsTestPilot from module 4: fetches what it needs per failure
Coordinator with specialistsA coordinating agent hands parts to other agentsA whole red pipeline split between a flaky analyst, a root-cause investigator and a bug writer

Three shapes side by side: a fixed workflow, a single agent with tools, and a coordinator with specialist agents; cost grows from left to right

Questions that decide it

  1. Are the steps predictable? If every failure needs the same three pieces of evidence, use a workflow and fetch them in code.
  2. Does the work split into independent parts? Forty failures from three different causes can be investigated in parallel by separate agents.
  3. 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.
  4. 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:

  1. Every night, summarise the five slowest tests in a fixed format.
  2. A developer asks “why is this test red?” for one test.
  3. After a big merge, 40 tests fail with at least three different causes, and some may need bug reports.
Show suggested answers
  1. 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.
  2. 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.
  3. 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.