Graph execution goes back to a previous node

I’m running a graph with the architecture below, by which it should only execute the node get_product_id until a tool_condition calls it out of the React flow, and then it should go on with route_decision.

But I’m getting an error:

InvalidUpdateError("At key ‘route’: Can receive only one value per step. Use an Annotated key to handle multiple values.\nFor troubleshooting, visit: INVALID_CONCURRENT_GRAPH_UPDATE ")Traceback (most recent call last):

When I look at the tracing (copied also below) I see that the get_product_id node gets executed again, later, causing the key issue (that’s my guess…). Any ideas what might be happening?

I’m using a custom state that inherits from MessageState and adds other keys.

Hi @ignacio

could you share some more code? I have an idea why this might happen, but I need more details about how you have coded your agent.

Solved! There was a double edge going from get_product_id to route_deceision, the conditional and a fixed one. I removed the fixed edge and now it works.

That was something in my head too :slight_smile:
Great you have fixed that - good job! :slight_smile:

1 Like