Lesson 2: Baseline Email Assistant. ## Put it all together Conditional edges

In the section ## Put it all together of this lesson: we have a subagent or subgraph defined as “agent” and as node “response_agent”, the call to this node is conditional. Why shouldn’t we define a conditional edge in the “email_agent” graph definition? is it because “agent” is defined with langraph.prebuilt?

I tried to add it as conditional edges, but it ends up creating double edges :laughing:

What’s the reason, in this case, we don’t need to add the subgraph with conditional edges?

I asked ChatGPT and it said that it’s because we’re using the Command output in the definition
def triage_router(state: State) → Command[
Literal[“response_agent”, “end”]
]:

I’d just like someone to confirm this. The problem is that I have used ChatGPT for other questions about langgraph, and it sometimes hallucinates a bit :sweat_smile: