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_algoapply_writes
Function●Since v0.6

apply_writes

Apply writes from a set of tasks (usually the tasks from a Pregel step) to the checkpoint and channels, and return managed values writes to be applied externally.

Copy
apply_writes(
  checkpoint: Checkpoint,
  channels: Mapping[str, BaseChannel],
  tasks: Iterable[WritesProtocol],
  get_next_version: GetNextVersion | None,
  trigger_to_nodes: Mapping[str, Sequence[str]]
) -> set[str]

Parameters

NameTypeDescription
checkpoint*Checkpoint

The checkpoint to update.

channels*Mapping[str, BaseChannel]

The channels to update.

tasks*Iterable[WritesProtocol]

The tasks to apply writes from.

get_next_version*GetNextVersion | None

Optional function to determine the next version of a channel.

trigger_to_nodes*Mapping[str, Sequence[str]]

Mapping of channel names to the set of nodes that can be triggered by updates to that channel.

View source on GitHub