LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • 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
PythonlanggraphpregelremoteRemoteGraphaget_state_history
Method●Since v0.2

aget_state_history

Get the state history of a thread.

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

Copy
aget_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
) -> AsyncIterator[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.

headersdict[str, str] | None
Default:None

Optional custom headers to include with the request.

paramsQueryParamTypes | None
Default:None

Optional query parameters to include with the request.

View source on GitHub