Skip to main content
This page documents configuration types and utilities used to access runtime information and resources within LangGraph nodes and tasks.

get_config

function
Get the current runnable configuration from within a graph node or task.This function retrieves the RunnableConfig for the currently executing node or task. The config contains metadata, callbacks, tags, and other runtime information.Important: Must be called from within a runnable context (inside a node or task). Raises RuntimeError if called outside of a runnable context.Python version requirement: Python 3.11 or later is required to use this in an async context.Defined in: langgraph/config.py:17

Returns

RunnableConfig
The configuration for the current runnable context.

Raises

exception
Raised when called outside of a runnable context, or when using Python < 3.11 in an async context.

Usage Example

get_store

function
Access LangGraph store from inside a graph node or entrypoint task at runtime.Can be called from inside any StateGraph node or functional API task, as long as the StateGraph or the entrypoint was initialized with a store.Python version requirement: Python 3.11 or later is required to use this in an async context (uses contextvar propagation).Defined in: langgraph/config.py:32

Returns

BaseStore
The store instance configured for the current graph.

Raises

exception
Raised when called outside of a runnable context.

Usage with StateGraph

Usage with Functional API

get_stream_writer

function
Access LangGraph StreamWriter from inside a graph node or entrypoint task at runtime.Can be called from inside any StateGraph node or functional API task. The StreamWriter allows you to emit custom data during graph execution when using stream_mode="custom".Python version requirement: Python 3.11 or later is required to use this in an async context (uses contextvar propagation).Defined in: langgraph/config.py:126

Returns

StreamWriter
A callable that accepts a single argument and writes it to the output stream. This is a no-op when not using stream_mode="custom".

Raises

exception
Raised when called outside of a runnable context.

Usage with StateGraph

Usage with Functional API

RunnableConfig

TypedDict
Configuration for a runnable execution. This type is imported from langchain_core.runnables.The RunnableConfig contains various runtime settings and metadata that control how a runnable (node, task, or graph) executes.

Common Fields

dict[str, Any]
Configurable parameters that can be set at runtime. Common keys include:
  • thread_id: Identifier for the execution thread (required for checkpointing)
  • checkpoint_id: Specific checkpoint to resume from
  • checkpoint_ns: Namespace for checkpoints
list[str]
Tags to attach to this run for filtering and organization.
dict[str, Any]
Arbitrary metadata to attach to this run.
list[BaseCallbackHandler]
Callback handlers to invoke during execution.
int
Maximum number of steps the graph can execute before raising a GraphRecursionError. Defaults to 25.
int
Maximum number of concurrent operations.

Usage Example

Thread Management

The configurable.thread_id field in RunnableConfig is particularly important for stateful applications:

Thread ID

Checkpoint Navigation

Advanced Configuration

Recursion Limit

Control how many steps a graph can execute:

Callbacks

Combining Multiple Settings

Best Practices

1. Always Use Thread IDs for Stateful Apps

2. Access Config Inside Nodes

3. Use Metadata for Observability

4. Set Appropriate Recursion Limits