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.

LangChain exampleLangGraph exampleTemporal example
SEE HOW THE SYSTEM FITS TOGETHERSELECT A COMPONENT
fixed pathvariable pathscope splitbenchmarkbenchmarkselectDescribe the taskDefine successKnown fixed stages?Choose a workflowVariable next action?Choose one agentSeparate permissions?Consider specialistsCompare candidatesUse the same casesKeep the simplest fitOwn the final result
  1. Write the observable result and identify which operations require model reasoning.

  2. Encode a predictable sequence and validate each uncertain model-produced value.

  3. Use a bounded observe–decide–act loop when evidence determines the next operation.

  4. Independent contexts or permission scopes can justify separate agents.

  5. Measure completion, authorization, latency, and total cost on identical tasks.

  6. Ship the smallest design that satisfies the acceptance criteria.

    Result or stopping point
Known fixed stages?

Encode a predictable sequence and validate each uncertain model-produced value.

Follow the arrows, then select a component to inspect its responsibility. On mobile, downward arrows connect the next step; bent arrows identify branches and return paths. Select a destination to jump to that component.

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.
Run a single agentResume a workflowCoordinate specialistsBuild the comparison suite

Keep exploring

Specialists with a clear contractAn agent that can pause and resumeBuild an explicit agent loop with LangGraph