A conditional edge chooses the next graph node by evaluating a condition. In an agent workflow, it lets an assistant either call tools or finish the conversation. section 10.6.4
Build the routing around the assistant and tool nodes:
- Define a condition function that returns the name of the next node for each branch. section 10.6.4
- Use LangGraph's tools_condition to route an assistant response containing tool calls to ToolNode, or route directly to END. section 10.6.4
- Connect the tools node back to the assistant so it can inspect the ToolMessage and decide whether another tool call is needed. section 10.6.4
Tool-enabled support agent
An assistant receives a customer request and decides whether to call a tracking or cancellation tool. A tool call sends execution to ToolNode; its result returns to the assistant. When no further tool call is present, the conditional edge ends the run.

