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
    Pythonlanggraphstreamrun_streamGraphRunStream
    Classā—Since v1.2

    GraphRunStream

    Copy
    GraphRunStream(
      self,
      graph_iter: Iterator[Any] | None,
      mux: StreamMux,
      *,

    Constructors

    Attributes

    Methods

    View source on GitHub
    wire_pump
    :
    bool
    =
    True
    )

    Parameters

    NameTypeDescription
    graph_iter*Iterator[Any] | None
    mux*StreamMux
    wire_pumpbool
    Default:True
    constructor
    __init__
    NameType
    graph_iterIterator[Any] | None
    muxStreamMux
    wire_pumpbool
    attribute
    extensions: Mapping[str, Any]
    attribute
    output: dict[str, Any] | None
    attribute
    interrupted: bool
    attribute
    interrupts: list[Any]
    method
    abort
    method
    interleave

    Sync run stream with caller-driven pumping.

    The caller's iteration on any projection (values, messages, raw events, or output) drives the graph forward. No background thread is used — the caller's for loop is the pump.

    Projections are single-consumer — iterating run.values twice raises. Use projection.tee(n) if you genuinely need fan-out.

    All transformer projections live in extensions. Native transformer projections (those with _native = True) are also set as direct attributes on this instance (e.g. run.values, run.messages).

    Warning

    Returned by Pregel.stream_events(version="v3"), which is experimental and may change.

    Pull-based iterator over the graph's stream, or None for nested run streams whose pump is driven by an outer run (e.g. SubgraphRunStream).

    The StreamMux owning projections and the main log.

    When True (default), bind _pump_next as the mux's pump callable. Subclasses that inherit a parent pump via StreamMux._make_child should pass False to preserve the parent binding.

    Drive the run to completion and return the final state.

    Drive the run to completion, then return whether it was interrupted.

    Drive the run to completion, then return interrupt payloads.

    Stop the run early.

    Closes the mux and marks the stream exhausted. The graph iterator is dropped; any in-flight nodes see the closure on their next yield point. Idempotent.

    Iterate multiple projections in arrival order, yielding (name, item).

    Items are ordered by a monotonic push stamp assigned when each transformer pushes into its StreamChannel. This gives strict arrival ordering across projections, unlike round-robin.