thread = {"configurable": {"thread_id": "checkpoint-demo"}} original = graph.invoke({}, thread) history = list(graph.get_state_history(thread)) before_joke = next( snapshot for snapshot in history if snapshot.next == ("write_joke",) ) replayed = graph.invoke(None, before_joke.config)