docs: update command how-to (#3280)

This commit is contained in:
Vadym Barda
2025-02-03 09:29:45 -05:00
committed by GitHub
parent 8c192414a2
commit 45ef425d85
2 changed files with 40 additions and 9 deletions
+4
View File
@@ -372,6 +372,10 @@ def my_node(state: State) -> Command[Literal["my_other_node"]]:
Setting `graph` to `Command.PARENT` will navigate to the closest parent graph.
!!! important "State updates with `Command.PARENT`"
When you send updates from a subgraph node to a parent graph node for a key that's shared by both parent and subgraph [state schemas](#schema), you **must** define a [reducer](#reducers) for the key you're updating in the parent graph state. See this [example](../how-tos/command.ipynb#navigating-to-a-node-in-a-parent-graph).
This is particularly useful when implementing [multi-agent handoffs](./multi_agent.md#handoffs).
### Using inside tools