Backward Compatibility

Status: ACTIVE (pulled from docs.langchain.com) Source: https://docs.langchain.com/oss/python/langgraph/backward-compatibility Timestamp: 2026-05-11

Update LangGraph graph code in production without breaking in-flight runs. LangGraph applies the latest graph immediately to every thread -- both new and resuming.

Three Categories of Compatibility Issues

1. Technical Compatibility

Equivalent to API breaking changes. Common breakages:

Recommended Patterns

class State(TypedDict):
    messages: list
    summary: NotRequired[str]  # NEW - old checkpoints still valid

Detecting In-Flight Threads

2. Business Compatibility

When behavior changes should NOT apply to threads started under old logic. Solution: record behavioral version on state at thread start:

class State(TypedDict):
    request: str
    flow_version: NotRequired[int]
    response: NotRequired[str]

def intake(state: State) -> dict:
    # New threads get current version; existing threads keep saved value
    return {"flow_version": state.get("flow_version", 2)}

def after_triage(state: State) -> str:
    if state.get("flow_version", 1) >= 2:
        return "policy_check"  # New path
    return "respond"  # Old path

3. Non-Determinism (Functional API only)

Functional API replays entrypoint body on resume. Two kinds of changes break this:

Safe options: let in-flight runs drain before deploying, wrap new logic in @task, or register new entrypoint under new graph name.

Graph Migrations Summary