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
Pythonlanggraphpregel_loopPregelLoop
Class●Since v0.6

PregelLoop

Copy
PregelLoop(
  self,
  input: Any | None,
  *,
  stream: StreamProtocol | None,
  config: RunnableConfig,
  store: BaseStore | None,
  cache: BaseCache | None,
  checkpointer: BaseCheckpointSaver | None,
  nodes: Mapping[str, PregelNode],
  specs: Mapping[str, BaseChannel | ManagedValueSpec],
  input_keys: str | Sequence[str],
  output_keys: str | Sequence[str],
  stream_keys: str | Sequence[str],
  trigger_to_nodes: Mapping[str, Sequence[str]],
  durability: Durability,
  interrupt_after: All | Sequence[str] = EMPTY_SEQ,
  interrupt_before: All | Sequence[str] = EMPTY_SEQ,
  manager: None | AsyncParentRunManager | ParentRunManager = None,
  migrate_checkpoint: Callable[[Checkpoint], None] | None = None,
  retry_policy: Sequence[RetryPolicy] = (),
  cache_policy: CachePolicy | None = None
)

Constructors

constructor
__init__
NameType
inputAny | None
streamStreamProtocol | None
configRunnableConfig
storeBaseStore | None
cacheBaseCache | None
checkpointerBaseCheckpointSaver | None
nodesMapping[str, PregelNode]
specsMapping[str, BaseChannel | ManagedValueSpec]
input_keysstr | Sequence[str]
output_keysstr | Sequence[str]
stream_keysstr | Sequence[str]
trigger_to_nodesMapping[str, Sequence[str]]
durabilityDurability
interrupt_afterAll | Sequence[str]
interrupt_beforeAll | Sequence[str]
managerNone | AsyncParentRunManager | ParentRunManager
migrate_checkpointCallable[[Checkpoint], None] | None
retry_policySequence[RetryPolicy]
cache_policyCachePolicy | None

Attributes

attribute
config: RunnableConfig
attribute
store: BaseStore | None
attribute
stream: StreamProtocol | None
attribute
step: int
attribute
stop: int
attribute
input: Any | None
attribute
cache: BaseCache[WritesT] | None
attribute
checkpointer: BaseCheckpointSaver | None
attribute
nodes: Mapping[str, PregelNode]
attribute
specs: Mapping[str, BaseChannel | ManagedValueSpec]
attribute
input_keys: str | Sequence[str]
attribute
output_keys: str | Sequence[str]
attribute
stream_keys: str | Sequence[str]
attribute
skip_done_tasks: bool
attribute
is_nested: bool
attribute
manager: None | AsyncParentRunManager | ParentRunManager
attribute
interrupt_after: All | Sequence[str]
attribute
interrupt_before: All | Sequence[str]
attribute
durability: Durability
attribute
retry_policy: Sequence[RetryPolicy]
attribute
cache_policy: CachePolicy | None
attribute
checkpointer_get_next_version: GetNextVersion
attribute
checkpointer_put_writes: Callable[[RunnableConfig, WritesT, str], Any] | None
attribute
checkpointer_put_writes_accepts_task_path: bool
attribute
submit: Submit
attribute
channels: Mapping[str, BaseChannel]
attribute
managed: ManagedValueMapping
attribute
checkpoint: Checkpoint
attribute
checkpoint_id_saved: str
attribute
checkpoint_ns: tuple[str, ...]
attribute
checkpoint_config: RunnableConfig
attribute
checkpoint_metadata: CheckpointMetadata
attribute
checkpoint_pending_writes: list[PendingWrite]
attribute
checkpoint_previous_versions: dict[str, str | float | int]
attribute
prev_checkpoint_config: RunnableConfig | None
attribute
status: Literal['input', 'pending', 'done', 'interrupt_before', 'interrupt_after', 'out_of_steps']
attribute
tasks: dict[str, PregelExecutableTask]
attribute
output: None | dict[str, Any] | Any
attribute
updated_channels: set[str] | None
attribute
trigger_to_nodes: trigger_to_nodes

Methods

method
put_writes

Put writes for a task, to be read by the next tick.

method
accept_push

Accept a PUSH from a task, potentially returning a new task to start.

method
tick

Execute a single iteration of the Pregel loop.

method
after_tick
method
match_cached_writes
method
amatch_cached_writes
method
output_writes
View source on GitHub