Most things people call "agents" are actually workflows. A workflow is a fixed sequence of steps that an LLM helps with. An agent is a loop where the LLM picks the next step. The distinction matters because agents are slower, pricier, and less reliable. Use an agent when you need one. Use a workflow when you can. Most production systems are workflows with a tiny agent in the middle for the parts that actually need exploration.
A workflow is a script. You wrote the steps. The order is fixed. An LLM runs inside some steps (classify this email, summarize this doc), but you decide what happens next.
An agent is a decision-maker. It reads the current state, picks the next action, runs it, reads the result, picks again. The order is emergent, not authored.
If you can draw the flowchart in advance, it's a workflow. If the flowchart has a box that says "the LLM figures it out," it's an agent.
Your company ingests 500 invoices a week. Flag fraudulent ones. Route the rest to accounting. Workflow or agent?
Mostly workflow. 98% of invoices are normal: extract fields, validate the math, match to a PO, approve. Fixed flow. Runs fast, costs cents.
Agent for the weird ones. When validation fails (missing PO, amount mismatch, unknown vendor) the workflow hands off to an agent. The agent can look up the vendor, check recent emails with that vendor, ask a human, escalate, or reject. The agent handles 2% of volume but 80% of the interesting decisions.
That hybrid is the shape of most good production AI systems: a workflow with a tiny bounded agent at the decision points that actually need it.
You built an "agent" and its trace always looks like this: call tool A, call tool B, answer. Every time. That's not an agent, it's a workflow with extra steps. You're paying for the LLM to re-decide a decision you already know. Refactor it into a workflow and save 60% on cost and latency.
You hard-coded a flow and now every new edge case means a new branch. The code turns into a 400-line if/else tree. The LLM would pick the right path trivially if you gave it the choice. Signal: your flowchart keeps growing and you're scared to touch it.
Andrej Karpathy - Intro to Large Language Models (1 hour)