In 2026 every LLM library calls everything an "agent". The terminology is muddy. The distinction that matters when you're building:
Workflow
Predetermined sequence of LLM calls and tool invocations. You write the flow; the LLM fills in the gaps.
Example: a content pipeline.
1. LLM call: generate outline from topic.
2. LLM call: write each section from outline.
3. Tool: spell-check.
4. LLM call: assemble final article.
The order is fixed. The LLM never decides "I need to skip a step" or "I need a different tool here".
When to use: tasks with known structure. Most production LLM apps are workflows, not agents.
Chain (LangChain terminology)
A composable sequence of LLM calls, tool invocations, and data transformations. Conceptually similar to a workflow but with more structure for composition.
# LCEL example
chain = prompt | llm | parser | tool | another_prompt | llm
Chains are linear. Output of step N becomes input to step N+1.
Modern LangChain heavily uses LCEL (LangChain Expression Language) — pipe-based composition. We'll cover it next lesson.
Agent
An LLM that decides what to do next based on its current state and available tools. The control flow is determined at runtime, by the model.
while not done:
decision = llm.decide(state, tools)
if decision.is_tool_call:
result = execute(decision.tool, decision.args)
state.update(result)
elif decision.is_final:
return decision.answer
The LLM is in charge of the loop. It might call tools, change strategy, ask clarifying questions, or stop. You don't pre-specify the steps.
When does each fit
| Need | Use |
|---|---|
| Translate a document | Workflow (single call) |
| Extract structured data from text | Workflow (prompt → JSON → validate) |
| Question-answering over docs | Chain (retrieve → generate) |
| Multi-step research, can't predict steps | Agent |
| Customer support where user request varies | Agent |
| Background data pipeline | Workflow |
| Coding assistant that uses many tools | Agent |
Rule of thumb:
- Known flow → workflow / chain.
- Unknown flow, LLM must decide → agent.
Most "agentic" apps are actually workflows in disguise. That's fine. Workflows are easier to debug, cheaper to run, more predictable. Use agents only when needed.
The cost difference
Workflow:
- 2-5 LLM calls per request.
- Predictable cost.
- Predictable latency.
Agent:
- 3-20+ LLM calls per request.
- Variable cost.
- Variable latency.
A poorly-designed agent that loops can spend $1+ per request. Same task as a workflow might cost $0.05.
The debugging difference
Workflow: trace is linear. Step 1 failed → fix step 1.
Agent: trace is a tree. Why did the model call tool X at step 7? Because of what the tool returned at step 5? Because of how the prompt at step 4 set up state? Debugging requires LangSmith or equivalent observability.
The reliability difference
Workflow: deterministic structure. Same input usually produces similar output.
Agent: non-deterministic by design. The model decides differently each run (especially at higher temperature). Two users with the same question get different paths.
Production-grade agents need more guardrails than workflows.
"Agent" framework comparison (2026)
- LangChain — chains via LCEL; agents via deprecated AgentExecutor or current LangGraph.
- LangGraph — state-machine framework (LangChain ecosystem). Industry-leading for production agents.
- LlamaIndex — strong for RAG, has agent primitives.
- CrewAI — multi-agent orchestration framework.
- AutoGen (Microsoft) — multi-agent conversation framework.
- Custom — many production systems use raw OpenAI/Anthropic APIs with custom orchestration.
This course focuses on LangChain + LangGraph because:
- LangChain remains the most-used framework (2026).
- LangGraph is the current production-grade agent framework (replaced AgentExecutor).
- Both share an ecosystem (LangSmith observability, LangChain Hub for prompts).
- The patterns translate to other frameworks.
Common misconceptions
- "Agents are smarter than workflows." They're more flexible, not smarter. The underlying LLM is the same.
- "More tools = better agent." More tools = more decision noise. Curate tools tightly.
- "Agents replace workflows." They complement. Use the simpler abstraction when possible.
- "Multi-agent is always better than single-agent." Multi-agent adds coordination overhead. Single-agent often suffices.
What you'll build in this course
By the end:
- Chains via LCEL (Module 1).
- Single-agent state machines in LangGraph (Module 2).
- Multi-agent systems (Module 3).
- Six end-to-end production builds (Module 4).
The skill is knowing which abstraction fits which problem.
Takeaway
Workflow = you control the flow. Agent = the LLM controls the flow. Both have legitimate use cases. Most production "agentic" apps are workflows; reserve true agents for problems where you genuinely can't predict the steps. LangChain handles chains; LangGraph handles state-machine agents. We'll use both.