Handler function for a graph node. Receives current state and an optional per-run context, returns either:
Partial<GraphState>
Command
update
Interrupt
The ctx parameter is optional — pre-#1895 handlers that take only state remain valid (additive widening).
ctx
state
Optional
Handler function for a graph node. Receives current state and an optional per-run context, returns either:
Partial<GraphState>(legacy, common case) — merged via reducersCommand—updateportion is merged via reducersInterrupt— pauses the graph; emits checkpoint with interrupt metadataThe
ctxparameter is optional — pre-#1895 handlers that take onlystateremain valid (additive widening).