跪拜 Guibai
← All articles
Agent · Workflow

Workflow vs. Agent: The Skeleton-and-Brain Architecture Behind Production AI

By YIAN ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Teams that treat Workflow and Agent as an either-or choice ship brittle systems. The durable pattern is a hybrid where the Workflow enforces compliance and cost ceilings, and the Agent handles the one or two nodes where the problem space is too open to hard-code.

Summary

A Workflow is a deterministic production line where every node, branch, and jump condition is hard-coded by a developer. The LLM only handles local tasks at each station and cannot alter the route. An Agent, by contrast, receives a goal and autonomously decides what to do next, using a perceive-plan-act loop to adapt when tools fail or results surprise it.

Pure Workflows become unmaintainable when branch logic explodes; pure Agents drift, hallucinate, and violate business rules. The standard production pattern embeds an Agent brain inside a Workflow skeleton. The outer Workflow enforces compliance, identity checks, and fixed handoffs, while the inner Agent handles the open-ended node — such as problem resolution in a customer-service system or information gathering in a research pipeline.

Three common misconceptions trip up teams: tool-calling alone does not make an Agent (the difference is who decides the call sequence), Agent is not inherently superior to Workflow, and LangGraph is a general orchestration framework that can implement either pattern depending on whether routing is hard-coded or LLM-driven.

Takeaways
Workflows are pre-defined execution pipelines where developers hard-code every node, branch, and transition; the LLM only performs local tasks at each station.
Agents are goal-driven executors that dynamically plan their own steps, re-plan on failure, and decide which tools to call next without a preset script.
Workflows deliver determinism, reproducibility, easy debugging, and predictable token costs; their weakness is rigidity and branch explosion in open-ended scenarios.
Agents deliver flexibility for unstructured problems but carry risks of hallucination, path deviation, and unpredictable compute costs.
Production systems almost never run pure Agent architectures; the standard pattern is a Workflow skeleton with an Agent embedded at the one or two nodes that require open-ended reasoning.
In an enterprise customer-service system, the outer Workflow handles identity verification, intent classification, and compliance, while the inner Agent autonomously resolves the user's issue using knowledge bases, order lookups, and ticket creation.
Tool-calling is not the defining trait of an Agent; the distinction is who decides the call sequence — the developer (Workflow) or the LLM at runtime (Agent).
LangGraph is a general orchestration framework, not an Agent framework; hard-coded transitions produce a Workflow, LLM-driven routing produces an Agent.
Conclusions

The industry's instinct to frame Workflow and Agent as a maturity ladder — where Agent is 'more advanced' — is backwards. For most business processes, a Workflow is cheaper, faster, and safer; Agent is only the right call when the branch space is genuinely unenumerable.

The hybrid pattern described here mirrors how human organizations actually work: standard operating procedures form the skeleton, and human judgement sits at the few nodes where the playbook runs out. AI engineering is converging on the same structure.

Calling LangGraph an 'Agent framework' is a category error that leads teams to over-engineer. It is an orchestration tool; whether you get a Workflow or an Agent depends entirely on where the routing logic lives.

Concepts & terms
ReAct pattern
A reasoning-and-acting loop where an LLM alternates between Thought (deciding what to do), Action (calling a tool), and Observation (interpreting the result) until it judges the goal is met.
Branch explosion
The exponential growth in the number of hard-coded branches when trying to predefine every possible path in a complex, open-ended workflow, making the system unmaintainable.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗