A request may need several steps: retrieve information, judge whether it is sufficient, and then produce an answer. An agentic workflow gives those steps an explicit structure. A large language model (LLM) can choose among predefined options, while the application manages the sequence and state. This keeps decisions within boundaries that are easier to trace and reproduce. section 5.0 section 5.6
A workflow is not the same as a more autonomous agent. A workflow follows a predetermined structure, even when a condition selects a branch or sends execution back to an earlier step. An agent can dynamically choose and combine tools as its context changes. The distinction is useful, but the two patterns can overlap. section 5.1 section 5.1.3 section 5.6
Figure 5.1 Workflows and agents. Workflows use the LLM to choose the next step from a fixed set of options, such as routing a request to a SQL database or a REST API, and synthesizing the answer with the related results. Agents, however, dynamically select and combine tools to achieve their objectives.
Compare a workflow’s fixed routing options with an agent’s dynamic tool selection. section 5.1
A LangGraph implementation makes the boundaries concrete:
- Define shared data as a Python TypedDict, then create a StateGraph with that state type. Nodes read the state and return updates that accumulate across the graph. section 5.6
- Add a node for each discrete task, such as searching, parsing, or summarizing. Connect nodes with edges; use conditional edges when runtime state determines the route. section 5.6
- Inspect intermediate states and execution history when debugging. Checkpoints allow a run to be replayed or branched from an earlier decision. section 5.6
Research assistant
After a search, a research assistant assesses the retrieved content. If it is insufficient, the workflow routes back to search; otherwise, it proceeds to synthesis. The choice varies, but both routes are defined in advance. section 5.6
Use this pattern when a task benefits from smaller steps, previous results, external data, or persistent context. Explicit state and routing add complexity, so a simple prompt–response exchange does not automatically need a workflow. LangGraph supports stateful, graph-based execution; separating tasks into nodes can also make a workflow easier to test and extend than a linear chain. section 5.1.3 section 5.1.4 section 5.6


