In one line: A workflow turns an AI app into a graph of nodes — each node is one operation (LLM call, tool, condition, DB write), connected by edges. The flow shape, the step count, the prompt at each step are defined by humans in advance; the model only "performs" inside individual nodes.
What it is#
The opposite of "let the model decide the next step":
[receive question] → [intent classifier] → [branch]
├─ FAQ → [RAG] → [generate]
├─ Support → [order API] → [write reply]
└─ Chitchat → [direct answer]
Every node and every edge is pinned at design time. At runtime data flows through the graph.
Analogy#
Agent = freelancer — say "handle this" and they pick their own steps.
Workflow = factory line — every station's job and the handoff between them are fixed by the operator. Predictable, reliable yield.
Key concepts#
How it works#
Every edge is pinned at design time — the model can't skip nodes or invent new branches.
Practical notes#
- If you can draw the flow, use a workflow. B2B business processes, support, approvals — places where the flow is clear, workflow is a thousand times more stable than agent.
- Small, single-purpose nodes. When a prompt grows out of control, split into two nodes — far easier to debug than one mega-prompt.
- Human-in-the-loop. For critical nodes (orders, refunds, emails) checkpoint and wait for human approval before continuing.
- Draw failure branches too. Each node needs retry / fallback / human escalation. Don't let a flow silently die at one bad call.
- Workflow + Agent hybrid. Lock the main flow with workflow, let an agent handle a flexible sub-task inside one node. The most common production pattern.
Easy confusions#
Observable, replayable, SLA-able.
Flexible, hard to guarantee 99.9% reliability.
Further reading#
- Agent — Workflow's opposite-twin
- Multi-Agent — run an agent team inside a workflow node
- LangGraph — the de-facto standard for code-defined workflows
- Dify / Coze — GUI platforms for drawing workflows