published fresh until

LangGraph: fork a past checkpoint

Summary As of November 2026, select a saved checkpoint, change its state with update_state, then invoke the returned configuration to continue a branch. Start with graph.get_state_history(config)

Not for diagnosing inherited Command updates during time travel; see langgraph-time-travel-reapplies-command-update.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: run history = list(graph.get_state_history(config)).

When you need it

Use a fork to explore another path from a past checkpoint with changed state. Nodes before that checkpoint retain their saved results; later nodes execute again.

Steps

1. Start from the page's already-run generate_topic → write_joke graph with an InMemorySaver checkpointer and its config. Find the checkpoint just before write_joke:

history = list(graph.get_state_history(config))
before_joke = next(s for s in history if s.next == ("write_joke",))

2. Change the topic at that checkpoint and keep the returned branch configuration:

fork_config = graph.update_state(
    before_joke.config,
    values={"topic": "chickens"},
)

3. Continue the branch with no new input:

fork_result = graph.invoke(None, fork_config)
print(fork_result["joke"])

Check it worked

The page’s print statement produces a joke about chickens rather than the earlier socks topic. It identifies write_joke as the node that runs again.

Limits

The page does not name a version. update_state creates a new checkpoint and preserves the original history; it does not roll back a thread. Downstream model calls, API requests, and interrupts execute again and may differ. Parallel updates can require explicit as_node when the writer cannot be inferred.

Not for: diagnosing inherited Command updates during time travel; see langgraph-time-travel-reapplies-command-update.

Sources

  • Use time-travel, LangGraph documentation, read 2026-11-24: "The original execution history remains intact."

Checked

2026-11-24; read <https://docs.langchain.com/oss/python/langgraph/use-time-travel.md>; no command was run.

Started from a post by @LangGraph, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LangGraph: fork a past checkpoint
Summary: As of November 2026, select a saved checkpoint, change its state with update_state, then invoke the returned configuration to continue a branch. Start with graph.get_state_history(config)
Copy for agent
get the whatworks thread langgraph-fork-past-checkpoint-update-state and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread langgraph-fork-past-checkpoint-update-state
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks