FOUNDATIONS · 4 MIN READ
Workflow, single agent, or multiple agents?
Choose the shape of the system from the shape of the task.
Jump to a section 6 sections
EXAMPLE USE CASE
Choose a design for three different business tasks
A fixed invoice pipeline, a support assistant and parallel specialist review need different execution structures.
- Input
- The task, its known steps, possible tool choices, permission boundaries and measurable acceptance criteria.
- Expected output
- A workflow, one bounded agent, or scoped specialists with one owner for the final result.
- Success check: You can explain why the chosen design is needed and compare it against a simpler candidate on the same cases.
- Try a failure: If separate role names do not require independent context or permissions, test a single agent before adding workers.
Example scope: A decision guide with concrete scenarios and links to runnable implementations. A function that prints a chosen architecture is not an implementation.
Write the observable result and identify which operations require model reasoning.
fixed pathTo 02 · Known fixed stages?variable pathTo 03 · Variable next action?Encode a predictable sequence and validate each uncertain model-produced value.
benchmarkTo 05 · Compare candidatesUse a bounded observe–decide–act loop when evidence determines the next operation.
scope splitTo 04 · Separate permissions?Independent contexts or permission scopes can justify separate agents.
benchmarkTo 05 · Compare candidatesMeasure completion, authorization, latency, and total cost on identical tasks.
Ship the smallest design that satisfies the acceptance criteria.
Result or stopping point
Encode a predictable sequence and validate each uncertain model-produced value.
Worked decision: invoice extraction
- Task: extract supplier, invoice number and total; validate the fields; request approval; then save.
- Choose a workflow: the stages are known. Use Pydantic or Zod for the output contract and Temporal or Inngest when the work must survive a restart.
- Acceptance: malformed totals fail validation; an unapproved invoice is not posted; retrying a saved invoice creates one record.
Worked decision: order support
- Task: answer a question that may require order lookup, policy lookup, a clarification, or no tool at all.
- Choose one bounded agent: evidence changes the next action. Start with LangChain or OpenAI Agents SDK; use LangGraph when you need to specify the transitions.
- Acceptance: the correct tool and record are used; missing evidence produces not_found or a clarification; the turn budget stops loops.
Worked decision: independent specialist review
- Task: combine stock availability and return-policy evidence from workers with different scopes.
- Consider multiple workers when independent context or permissions are useful. One coordinator validates typed artifacts and owns the final result.
- Acceptance: unavailable stock is an explicit partial failure; a policy worker never gains purchasing authority; maximum fan-out and deadlines are enforced.
Compare before choosing
- Use the same representative tasks and acceptance checks for each candidate. Record correct completion, critical permission failures, total latency and cost.
- Separate fixed stages from model-selected actions. One application can contain both a workflow and an agent step.
- Choose the smallest design that satisfies the acceptance criteria, then keep failed cases for the next comparison.