What is an agent, really?
"Agent" is one of the most abused words in tech right now. Let's fix that.
Workflow vs. agent — the one distinction that matters
Anthropic drew the clearest line, so we'll use it:
- Workflow — a system where LLMs and code follow predefined steps. You know the flow chart in advance.
- Agent — a system where the LLM decides its own steps, using tools and feedback loops, until the goal is met.
Both are useful. Workflows are cheaper, more predictable, easier to debug. Agents are more flexible but slower and more expensive. Start with a workflow. Move to an agent only when the steps genuinely can't be predicted.
Building an agent when a three-step workflow would do. Symptoms: unpredictable output, high API bills, hours of debugging "why did it loop." If you can draw the flowchart, build the workflow.
The six canonical patterns
Straight from Anthropic's "Building effective agents" — the industry reference. Five workflows, one agent.
1. Prompt chaining
Step A → step B → step C. Each step's output is the next step's input. Example: draft a customer email → translate to Spanish → strip jargon.
2. Routing
Classify the input, then send it to the specialized prompt. Example: inbound email → NEW_LEAD path vs. EXISTING_CLIENT path vs. SPAM.
3. Parallelization
Run multiple LLM calls at once, aggregate. Example: score a proposal on clarity, tone, compliance, and pricing — in parallel — then combine.
4. Orchestrator-workers
A lead model splits the task, dispatches to worker models, synthesizes results. Example: research 12 competitor sites — orchestrator plans the pass, workers browse each site.
5. Evaluator-optimizer
One model drafts, another critiques, first revises. Loop until good. Example: proposal draft → QA reviewer flags weak sections → rewrite.
6. Agent
Given a goal, the model picks its own steps and tools, checks its work, and iterates until done. Example: "Find the top 5 competitors in my city, extract their pricing pages, draft a positioning summary."
Pattern 1: Prompt chaining, illustrated
Pattern 6: The agent loop
Every real agent boils down to this loop:
Pseudocodewhile not done:
action = llm.plan(goal, history, available_tools)
if action.kind == "tool_call":
result = execute(action.tool, action.args)
history.append({tool: action.tool, result: result})
elif action.kind == "answer":
done = True
return action.answer
Perplexity Computer, Claude Code, Cursor, and every "agent framework" you've seen is a variation of this. The interesting engineering is in the details: how do you keep the model from looping? How do you handle a failed tool call? When do you give up?
When to use which — a decision table
| Question | Answer | Use |
|---|---|---|
| Can you draw the flowchart in advance? | Yes | Workflow (chain / route / parallel) |
| Same task, only inputs differ? | Yes | Workflow |
| Need consistent output shape every run? | Yes | Workflow |
| Cost or latency sensitive? | Yes | Workflow |
| Number of steps depends on what the model finds? | Yes | Agent |
| You want the system to explore or plan on its own? | Yes | Agent |
| Task is genuinely open-ended (research, coding)? | Yes | Agent |
Classify five of your workflows
Grab your current project list. For each recurring task, decide: workflow or agent?
- Weekly project status roll-up → ?
- New client intake → SOW → ?
- Accessibility audit of a random new site → ?
- "Research 8 competitors and summarize" → ?
- "Draft an SEO description for this new page" → ?
Answers, in my opinion: workflow, workflow, agent (site content is unknown), agent (open-ended research), workflow.