Passing State to the next node in a conditional edge #1788
-
Hey guys, I wanted to ask if it is possible to change state value and keep the value to the next node. Here's an example of what I'm looking for, here's my conditinal edge function:
in this function, i set state["input"] value to "Updating the input" and then the graph goes to "agent" node. but when i print state["input"] at the top of my agent node, it seems it is not updated. I wanted to ask how state values pass between nodes and why this happens? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, you can only update state from inside nodes, not from edges. Inside a node you update state by returning an update to one or more state keys, that is return a dictionary containing the keys you want to update and their new values. |
Beta Was this translation helpful? Give feedback.
Hi, you can only update state from inside nodes, not from edges. Inside a node you update state by returning an update to one or more state keys, that is return a dictionary containing the keys you want to update and their new values.