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

    prepare_next_tasks

    Copy
    prepare_next_tasks(
      checkpoint: Checkpoint,
      pending_writes: list[PendingWrite],
      processes:
    View source on GitHub
    Mapping
    [
    str
    ,
    PregelNode
    ]
    ,
    channels
    :
    Mapping
    [
    str
    ,
    BaseChannel
    ]
    ,
    managed
    :
    ManagedValueMapping
    ,
    config
    :
    RunnableConfig
    ,
    step
    :
    int
    ,
    stop
    :
    int
    ,
    *
    ,
    for_execution
    :
    bool
    ,
    store
    :
    BaseStore
    |
    None
    =
    None
    ,
    checkpointer
    :
    BaseCheckpointSaver
    |
    None
    =
    None
    ,
    manager
    :
    None
    |
    ParentRunManager
    |
    AsyncParentRunManager
    =
    None
    ,
    trigger_to_nodes
    :
    Mapping
    [
    str
    ,
    Sequence
    [
    str
    ]
    ]
    |
    None
    =
    None
    ,
    updated_channels
    :
    set
    [
    str
    ]
    |
    None
    =
    None
    ,
    retry_policy
    :
    Sequence
    [
    RetryPolicy
    ]
    =
    (
    )
    ,
    cache_policy
    :
    CachePolicy
    |
    None
    =
    None
    )
    ->
    dict
    [
    str
    ,
    PregelTask
    ]
    |
    dict
    [
    str
    ,
    PregelExecutableTask
    ]

    Parameters

    NameTypeDescription
    checkpoint*Checkpoint

    The current checkpoint.

    pending_writes*list[PendingWrite]

    The list of pending writes.

    processes*Mapping[str, PregelNode]
    channels*Mapping[str, BaseChannel]
    managed*ManagedValueMapping
    config*RunnableConfig
    step*int
    for_execution*bool
    storeBaseStore | None
    Default:None
    checkpointerBaseCheckpointSaver | None
    Default:None
    managerNone | ParentRunManager | AsyncParentRunManager
    Default:None
    trigger_to_nodesMapping[str, Sequence[str]] | None
    Default:None
    updated_channelsset[str] | None
    Default:None

    Prepare the set of tasks that will make up the next Pregel step.

    The mapping of process names to PregelNode instances.

    The mapping of channel names to BaseChannel instances.

    The mapping of managed value names to functions.

    The Runnable configuration.

    The current step.

    Whether the tasks are being prepared for execution.

    An instance of BaseStore to make it available for usage within tasks.

    Checkpointer instance used for saving checkpoints.

    The parent run manager to use for the tasks.

    Optional: Mapping of channel names to the set of nodes that are can be triggered by that channel.

    Optional. Set of channel names that have been updated during the previous step. Using in conjunction with trigger_to_nodes to speed up the process of determining which nodes should be triggered in the next step.