Start free

Zero to FDE / Blog / AI agent vs workflow: which one does your problem need?

Blog

AI agent vs workflow: which one does your problem need?

In a workflow, your code decides the steps and the model fills them in. In an agent, the model decides the steps. That one choice sets how predictable, how costly and how testable the system is.

The definitions

Anthropic’s guide to building agents draws the line this way: workflows are systems where models and tools are orchestrated through predefined code paths, and agents are systems where the model directs its own process and tool use.1

Five workflow patterns

PatternHow it worksExample
Prompt chainingThe output of one call is the input of the nextDraft, then check, then translate
RoutingClassify the input, then send it to a specialised promptBilling question or technical question
ParallelizationRun several calls at once and combine themThree reviewers on one document
Orchestrator-workersOne call splits the task, others do the partsA report with sections
Evaluator-optimizerOne call writes, another critiques, repeatImproving a draft to a rubric

These five are the patterns named in that guide.1

Compared

WorkflowAgent
Who chooses the next stepYour codeThe model
PredictabilityHighLower
Cost and latencyKnown in advanceVaries with the number of steps
TestingEach step on its ownEnd to end, with step and cost limits
Best forTasks you can draw as a flowchartOpen-ended tasks where the steps cannot be listed

A test for choosing

Try to draw the task as a flowchart. If you can, build the flowchart: it is a workflow. If the number or order of steps depends on what is found along the way, such as debugging or research, an agent may earn its cost.

The same guide advises starting with the simplest thing that works: “we recommend finding the simplest solution possible, and only increasing complexity when needed.” It also notes that for many applications a single well-built model call with retrieval is enough.1

If you do build an agent

  • Set a step limit and a spending limit.
  • Give it few tools with clear descriptions.
  • Put approval in front of risky actions.
  • Trace every step, and evaluate on real tasks.

Related: what an AI agent is, tool calling, evals and observability. Agents built by hand and then with a framework are Weeks 4 and 5 of the Zero to FDE roadmap.

Zero to FDE is a self-paced 16-week course, ₹2,999 once, with a 7-day full refund. Week 1 is free, and one Week 4 lesson is free if you already write backend code. It has no live classes, no mentors and no accredited certificate.

Sources

  1. Anthropic, “Building effective agents” (19 December 2024)

Zero to FDE is a 16-week path, for working engineers and AIML graduates, to the work Forward Deployed Engineers do: backend basics, LLMs, RAG, agents, evaluation and deployment, with a shipped deliverable every week. Week 1 is free and complete, no card needed.

Start Week 1 free

More from the blog