Partial Updates
Return only changes.
A node doesn't return the whole state. It returns only the keys it wants to change. LangGraph merges that update into the state, and keeps everything else as it was.

- Return only changes
- LangGraph merges
- Everything else stays
Watching the merge
The first node sets the total. The second sets only the delivery fee. Each node prints the state it receives. Run it. The second node sees the total written by the first, and the final state has every key, even though no node returned them all.
from typing import TypedDict
from langgraph.graph import StateGraph, START, END
class State(TypedDict):
title: str
total: float
delivery: float
def set_total(state):
print("set_total sees:", state)
return {"total": 19.98}
def set_delivery(state):
print("set_delivery sees:", state)
return {"delivery": 2.99}
b = StateGraph(State)
b.add_sequence([set_total, set_delivery])
b.add_edge(START, "set_total"); b.add_edge("set_delivery", END)
print("final:", b.compile().invoke({"title": "Dune"}))set_total sees: {'title': 'Dune'}
set_delivery sees: {'title': 'Dune', 'total': 19.98}
final: {'title': 'Dune', 'total': 19.98, 'delivery': 2.99}Careful with keys
By default, a new value replaces the old one. If a node returns a key that isn't in the state, it's ignored. So a typo like totl instead of total is silently lost. Keep key names consistent, and test your nodes.
| key | value |
|---|---|
| Default | new value replaces old |
| Unknown keys | ignored |
| Typos | silently lost |
| So | test your nodes |
Summary
Nodes return partial updates, which LangGraph merges into the state. New values replace old ones by default. Next, a quiz on the basics.
Key takeaways- Return only changes
- Merged into state
- Watch for typos