[KongchangAI]
· 1 min read· 934 words

Agent Skills in Practice: 17 Sessions of Workflow Orchestration, Plus OpenClaw, FDE, and Local Models

Agent Skills in Practice: 17 Sessions of Workflow Orchestration, Plus OpenClaw, FDE, and Local Models

Workflows are orchestrated by programmers, agents decide autonomously; complex business should prioritize workflows.

Based on Bilibili creator Lao Xiao's sharing, the article clarifies the boundary between workflows and agents. A workflow is a graph in which LLMs and tools are orchestrated through predefined code paths; nodes can be functions, tools, or agents, and edges determine transitions. An agent lets the LLM dynamically decide which tools to call and how many times, with no programmer-preset orchestration inside. The two are not opposites: an agent can be a node in a workflow, and a workflow can replace some agent functionality by adding LLM nodes—but the author judges that workflows can replace agents, not vice versa. The choice depends on business complexity—single tasks can use agents, while complex scenarios with more than 30 similar tools should use workflows to avoid decision hallucinations. On implementation, the article introduces how LangGraph builds state graphs with state, nodes, and edges, following the process of defining state, adding nodes and edges, and compiling and running.

Workflows and agents are the two core components for building complex LLM applications, but many developers misunderstand their boundaries and appropriate use cases. Based on a分享 from Bilibili creator Lao Xiao, this article systematically covers the core concepts of workflows, their fundamental differences from agents, and hands-on implementation with LangGraph.

What Is a Workflow: A Graph Orchestrated by Programmers

In the video, Lao Xiao gives a clear definition: a workflow is a system in which large language models and tools are orchestrated through predefined code paths. The key is "orchestration"—programmers organize LLMs, tools, and business logic into a graph according to requirements.

It depends on your actual future business

Nodes here can be Python functions, tool calls, or agents. Nodes are connected by edges, where the output of one node becomes the input of the next, forming an explicit flow path. This explicit orchestration gives developers complete control over system behavior.

Agent vs Workflow: Autonomous Decision-Making vs Preset Flows

The fundamental difference lies in "who decides the flow." An agent lets the LLM dynamically decide—based on contextual semantics—when to call tools, how many times, and where to pass results; the flow is not preset by programmers. A workflow is the opposite: transitions between nodes are fixed by edges and conditional branches in code.

This is one situation

Lao Xiao emphasizes that there is actually no "orchestration" inside an agent—the order of tool calls is determined by the model itself. Workflows, by contrast, inherently possess orchestration capabilities, supporting conditional branches, loops, and dynamic routing. The two are not opposites: an agent can serve as a node within a workflow (especially in multi-agent scenarios, where using a workflow to organize multiple agents is common practice); conversely, a workflow can replace some agent functionality by adding LLM nodes.

His judgment is direct: workflows can replace agents, but agents cannot replace workflows.

The ReAct paradigm is key background for understanding how agents make autonomous decisions. ReAct (Reasoning + Acting), proposed by Shunyu Yao et al. in 2022, centers on having the LLM alternately produce "reasoning traces" and "actions": the model first outputs a thought, then decides which tool to call (Action), observes the tool's return result (Observation), and continues to the next round of thinking. When the loop terminates and which tool is called each round are entirely determined by the model based on contextual semantics, not hardcoded by external code. This is the technical root of why agents have "no orchestration"—the flow is implicit in the model's round-by-round generation. The cost of ReAct is that behavior is not fully predictable: as the number of tools grows and functions become similar, the model easily picks the wrong tool or falls into loops—which is why the article later emphasizes that complex business should return to workflow orchestration.

When to Use Which: Business Complexity Decides

The key to choosing is business complexity. A single task—such as a simple vehicle dispatch business—only needs an agent. But for requirements like a complex government office assistant, involving many tools and business branches, agents are prone to decision hallucinations—especially when there are more than 30 tools with similar functions.

Implement stateful, scalable task orchestration

This is where workflows shine: programmer-controlled orchestration mechanisms can flexibly handle complex business flows, preventing the model from "getting lost" among numerous tools. Multi-agent collaboration also requires workflows to define execution order; otherwise, there is no way to determine who goes first.

The Three Elements of LangGraph: State, Nodes, Edges

LangGraph combines agents and workflows through state graphs, with three core components:

State is a snapshot of the application's current state—essentially a shared data structure, similar to context. All nodes receive state as input, and the data returned after execution is written back to state, which can be overwritten, updated, or deleted.

Node is a unit that handles a single function—it can be a Python function, a tool, or an agent. Each node is responsible for specific business logic.

Edge determines which node executes next, making conditional judgments based on data in state, or performing fixed jumps.

When you are doing orchestration

An analogy helps: state stores data, nodes handle business logic, and edges control flow. Building a graph means defining state, adding nodes and edges, and compiling and running.

The StateGraph in LangGraph draws on ideas from finite state machines and dataflow graphs, but unlike traditional state machines, its state is a readable/writable shared dictionary (or a structure defined by TypedDict), and nodes do not consume state but incrementally update it. LangGraph uses a "reducer" mechanism to decide how multiple writes to the same field are merged—by default overwriting, but it can also be declared as appending to a list, which is crucial for accumulating messages over multiple rounds and aggregating multi-agent outputs. In addition, after compilation the graph generates an executable Runnable that supports streaming output, checkpoint-based resumption, and human-in-the-loop intervention. These capabilities make state graphs not just an orchestration tool but also responsible for persistence and session memory—the core value that distinguishes them from ordinary function call chains.

Implementation Advice

For teams building complex AI applications, Lao Xiao's experience is worth referencing: first break the business into nodes, clarify each node's input/output and state changes, then use edges to define transition rules. Don't reject agents—treat them as a special node in the graph. LangGraph's building-block design makes this hybrid orchestration possible, preserving flexibility while ensuring reliable operation of large-scale systems through state management.

Workflows are not a replacement for agents, but a necessary complement in complex business scenarios. Understanding the boundary between the two is essential for making the right architectural choices.

#workflow orchestration#AI agents#LangGraph#StateGraph#ReAct#LLM application architecture
Share:

Related articles