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 Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    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 Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraphpregel_algoapply_writes
    Functionā—Since v0.6

    apply_writes

    Copy
    apply_writes(
      checkpoint: Checkpoint,
      channels: Mapping[str, BaseChannel],
      tasks: Iterable
    View source on GitHub
    [
    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]
    get_next_version*GetNextVersion | None
    trigger_to_nodes*Mapping[str, Sequence[str]]

    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.

    The tasks to apply writes from.

    Optional function to determine the next version of a channel.

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