LangGraph 1 · Building graphs

Update state and route in one step

Return a Command from a node to change the state and choose the next node together.

from langgraph.types import Command

def review(state: State) -> Command:
    return Command(update={"approved": True}, goto="publish")

Official LangGraph 1 documentation

More building graphs commands

All building graphs commands · LangGraph 1 cheatsheet

Was this page helpful?