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

    PregelNode

    Copy
    PregelNode(
      self,
      *,
      channels: str | list[str],

    Constructors

    Attributes

    Methods

    View source on GitHub
    triggers
    :
    Sequence
    [
    str
    ]
    ,
    mapper
    :
    Callable
    [
    [
    Any
    ]
    ,
    Any
    ]
    |
    None
    =
    None
    ,
    writers
    :
    list
    [
    Runnable
    ]
    |
    None
    =
    None
    ,
    tags
    :
    list
    [
    str
    ]
    |
    None
    =
    None
    ,
    metadata
    :
    Mapping
    [
    str
    ,
    Any
    ]
    |
    None
    =
    None
    ,
    bound
    :
    Runnable
    [
    Any
    ,
    Any
    ]
    |
    None
    =
    None
    ,
    retry_policy
    :
    RetryPolicy
    |
    Sequence
    [
    RetryPolicy
    ]
    |
    None
    =
    None
    ,
    cache_policy
    :
    CachePolicy
    |
    None
    =
    None
    ,
    is_error_handler
    :
    bool
    =
    False
    ,
    error_handler_node
    :
    str
    |
    None
    =
    None
    ,
    subgraphs
    :
    Sequence
    [
    PregelProtocol
    ]
    |
    None
    =
    None
    ,
    timeout
    :
    float
    |
    timedelta
    |
    TimeoutPolicy
    |
    None
    =
    None
    )
    constructor
    __init__
    NameType
    channelsstr | list[str]
    triggersSequence[str]
    mapperCallable[[Any], Any] | None
    writerslist[Runnable] | None
    tagslist[str] | None
    metadataMapping[str, Any] | None
    boundRunnable[Any, Any] | None
    retry_policyRetryPolicy | Sequence[RetryPolicy] | None
    cache_policyCachePolicy | None
    is_error_handlerbool
    error_handler_nodestr | None
    subgraphsSequence[PregelProtocol] | None
    timeoutfloat | timedelta | TimeoutPolicy | None
    attribute
    channels: str | list[str]

    The channels that will be passed as input to bound. If a str, the node will be invoked with its value if it isn't empty. If a list, the node will be invoked with a dict of those channels' values.

    attribute
    triggers: list[str]

    If any of these channels is written to, this node will be triggered in the next step.

    attribute
    mapper: Callable[[Any], Any] | None

    A function to transform the input before passing it to bound.

    attribute
    writers: list[Runnable]

    A list of writers that will be executed after bound, responsible for taking the output of bound and writing it to the appropriate channels.

    attribute
    bound: Runnable[Any, Any]

    The main logic of the node. This will be invoked with the input from channels.

    attribute
    retry_policy: Sequence[RetryPolicy] | None

    The retry policies to use when invoking the node.

    attribute
    cache_policy: CachePolicy | None

    The cache policy to use when invoking the node.

    attribute
    timeout: TimeoutPolicy | None

    Timeout policy for a single invocation.

    If exceeded, NodeTimeoutError is raised and the retry policy (if any) decides whether to retry. Supported only for async nodes.

    attribute
    tags: Sequence[str] | None

    Tags to attach to the node for tracing.

    attribute
    metadata: Mapping[str, Any] | None

    Metadata to attach to the node for tracing.

    attribute
    is_error_handler: bool

    Whether this node is registered as an error handler node.

    attribute
    error_handler_node: str | None

    Optional handler node name for failures from this node.

    attribute
    subgraphs: Sequence[PregelProtocol]

    Subgraphs used by the node.

    attribute
    flat_writers: list[Runnable]

    Get writers with optimizations applied. Dedupes consecutive ChannelWrites.

    attribute
    node: Runnable[Any, Any] | None

    Get a runnable that combines bound and writers.

    attribute
    input_cache_key: INPUT_CACHE_KEY_TYPE

    Get a cache key for the input to the node. This is used to avoid calculating the same input multiple times.

    method
    copy
    method
    invoke
    method
    ainvoke
    method
    stream
    method
    astream

    A node in a Pregel graph. This won't be invoked as a runnable by the graph itself, but instead acts as a container for the components necessary to make a PregelExecutableTask for a node.