LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphpregelremoteRemoteGraphget_state_history
    Method●Since v0.2

    get_state_history

    Get the state history of a thread.

    This method calls POST /threads/{thread_id}/history.

    Copy
    get_state_history(
      self,
      config: RunnableConfig,
      *,
      filter: dict[str, Any] | None = None,
      before: RunnableConfig | None = None,
      limit: int | None = None,
      headers: dict[str, str] | None = None,
      params: QueryParamTypes | None = None
    ) -> Iterator[StateSnapshot]

    Parameters

    NameTypeDescription
    config*RunnableConfig

    A RunnableConfig that includes thread_id in the configurable field.

    filterdict[str, Any] | None
    Default:None

    Metadata to filter on.

    beforeRunnableConfig | None
    Default:None

    A RunnableConfig that includes checkpoint metadata.

    limitint | None
    Default:None

    Max number of states to return.

    View source on GitHub