A workflow follows code paths you define, with LLM calls at fixed steps. An agent lets the model decide the sequence: it chooses a tool, sees the result, decides what to do next, and repeats until it judges the task done or hits a limit.
Agents suit open-ended tasks where the steps can't be known in advance (research, debugging, multi-system operations). They cost more, are slower and less predictable. Start with the simplest thing (a single call, then a workflow) and move to an agent only when needed.
Core pieces: a model, tools, instructions, memory/state, and guardrails: step limits, cost ceilings, approval gates.
Going deeper
Anthropic's distinction is the cleanest: workflows orchestrate LLMs through predefined code paths; agents dynamically direct their own process and tool use. Their advice is to find the simplest solution and add agency only when it demonstrably improves outcomes.
Chip Huyen frames agents by their tools (read-only knowledge tools vs write actions), planning capability and failure modes, a useful structure for design reviews.
Best resources for this lesson
- ArticleBuilding effective agents (Anthropic) · the most-cited practical guide
- ArticleAgents (Chip Huyen)
- ArticleLLM-powered autonomous agents (Lilian Weng)
- CourseHugging Face Agents Course
Where this comes back
- Week 33Workflows are the simpler alternative to reach for first.