mirror of
https://github.com/langchain-ai/langgraph-builder.git
synced 2026-07-16 09:34:30 -04:00
Chainging one Conditional edge changes the other #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mayukhpankaj on GitHub (Mar 19, 2025).
https://github.com/user-attachments/assets/f4343ddf-d93e-4495-911b-0b2bb650e7aa
I want to name one edge pass and the other as fail for semantic routing. but It changes the name of all edges connected to the same parent.
@2016bgeyer commented on GitHub (Mar 24, 2025):
Feature not a bug
I think the issue is that conditional edges are a single function which then routes to the different next nodes in the workflow. This means it isn't a bug but is "intended" behavior
Alternative Idea - Conditional Edges as Nodes
However, I think it might be better to visualize conditional edges as a single node since it is a single function with a decision. Then the edges coming out of the Conditional Edge Node don't really "mean" anything (similar to other workflow tools like Dify or Flowise).
We could have an edge label to edit that is just a descriptor of what that edge represents coming out of the previous node. This would help encapsulate the logic of the workflow within a node and describe the decision using the edge label coming out.
Examples
The example in your case would be a "Conditional Edge" Node that is named something like "Detect Failures" with edges coming out that you could label as "Pass" or "Fail".
This actually helps understand "conditional edge" decision points a little better visually. You can have a name for the condition and then you have the possible outcomes of the decision.
"Need More Context" for RAG pointing to a "Perform RAG" Node or "User Rejected Tool Call" edge pointing to some LLM node to handle the feedback, etc.
Conditional Edges in LangGraph vs LangGraph Builder
This also means that you can reuse decision points at various parts of your workflow. This is actually how LangGraph really works. You can define a function to use as a conditional edge and then actually use that in multiple places within the workflow.
How conditional edges are defined in LangGraph Builder as of now is that they are completely unique every single time since they are just edges coming out of a single node.