Conditional edge
A conditional edge is a graph or workflow transition whose destination is selected by evaluating a condition at runtime.
AI Agents and Applications
A conditional edge is a workflow transition whose destination is selected at runtime according to state or other conditions.
- How it is used
- Routes stateful research workflows and tool-using agents according to intermediate results or tool calls.
- How deep it goes
- Defines state-based routing, gives a routing-function example, and follows a tool-call decision through debugging.
- Examples
- Uses a search-result count, a relevance-gated research report, and an agent deciding between tools and END.
- What you can do after
- Build it from scratch with a state-reading routing function, then debug its destination using intermediate messages.
Read how AI Agents and Applications explains conditional edge →
Build Python Web Apps with Streamlit
A conditional edge is a graph transition whose next node is selected by evaluating a specified condition.
- How it is used
- Routes an agent graph between tool execution and conversation completion according to the assistant's latest response.
- How deep it goes
- Explains branching, built-in routing, and the tool loop, but stops short of detailing the condition function's internal implementation.
- Examples
- Uses an agent graph that tracks or cancels orders through tool calls.
- What you can do after
- Apply it via LangGraph to route tool-enabled assistant workflows and return tool results for further reasoning.
Read how Build Python Web Apps with Streamlit explains conditional edge →
Related concepts
- edgekind of · An edge is a graph connection between two vertices that represents a relationship and may be directed, labeled, or weighted.
- graph-based workflowused by · A graph-based workflow represents processing steps as nodes and their execution order, data flow, or branching as edges.
- routingused by · Routing is the selection of a path, destination, or processing component to direct an item, request, or flow toward an intended endpoint.
- stateuses · State is information or a configuration describing the condition of a system, entity, or computation at a particular time and potentially influencing subsequent behavior or decisions.
- tools_conditionconfigured by · tools_condition is a LangGraph routing utility that directs execution according to whether the latest language-model message contains tool calls.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

