LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Server
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemoteStream
LangGraph SDK
ClientAuthReactLoggingReact UiServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraphpregelPregelOptions
Interface●Since v1.0

PregelOptions

Copy
interface PregelOptions

Bases

RunnableConfig

Properties

Inherited fromRunnableConfig(langchain_core)

Attributes

Arun_nameAmax_concurrencyArecursion_limitArun_id
View source on GitHub
property
cache: BaseCache<unknown>

Optional cache for the graph, useful for caching tasks.

property
callbacks: Callbacks
property
configurable: Record<string, any>
property
context: ContextType

Static context for the graph run, like userId, dbConnection etc.

property
control: RunControl

Optional run control used to request cooperative drain. When RunControl#requestDrain is called (e.g. from a SIGTERM handler or a node), the graph stops at the next superstep boundary, persists its checkpoint, and throws GraphDrained. The run can then be resumed later from the saved checkpoint.

property
debug: boolean

Enables detailed debug logging during graph execution. When enabled, prints information about:

  • Task execution
  • Channel updates
  • Checkpoint writes
property
durability: Durability

Whether to checkpoint during the run (or only at the end/interruption).

  • "async": Save checkpoint asynchronously while the next step executes (default).
  • "sync": Save checkpoint synchronously before the next step starts.
  • "exit": Save checkpoint only when the graph exits.
property
encoding: TEncoding

The encoding to use for the stream.

  • undefined: Use the default format.
  • "text/event-stream": Use the Server-Sent Events format.
property
inputKeys: keyof Channels | keyof Channels[]

Specifies which channel keys to retrieve from the checkpoint when resuming execution. This is an advanced option that you generally don't need to set manually. The graph will automatically determine the appropriate input keys based on its configuration.

property
interruptAfter: "*" | keyof Nodes[]

List of nodes where execution should be interrupted AFTER the node runs. Similar to interruptBefore, but interrupts after node completion. Useful when the node's output needs to be reviewed before proceeding.

Copy
// Interrupt after specific nodes
interruptAfter: ["generateContent", "analyze"]

// Interrupt after all nodes
interruptAfter: "all"
property
interruptBefore: "*" | keyof Nodes[]

List of nodes where execution should be interrupted BEFORE the node runs. Can be used for debugging and advanced state manipulation use cases. For human-in-the-loop workflows, developers should prefer the

Copy
// Interrupt before specific nodes
interruptBefore: ["humanReview", "qualityCheck"]

// Interrupt before all nodes
interruptBefore: "all"
property
maxConcurrency: number
property
metadata: Record<string, unknown>
property
outputKeys: keyof Channels | keyof Channels[]

Specifies which channel keys to include in the output stream and final result. Use this to filter which parts of the graph state you want to observe.

Copy
// Stream only the 'result' channel
outputKeys: "result"

// Stream multiple channels
outputKeys: ["result", "intermediateState"]
property
recursionLimit: number
property
runId: string

The run ID for the current execution. Undefined when runId is not provided in the config.

property
runName: string
property
signal: AbortSignal
property
store: BaseStore

A shared value store that allows you to store and retrieve state across threads. Useful for implementing long-term memory patterns.

property
streamMode: TStreamMode

Controls what information is streamed during graph execution. Multiple modes can be enabled simultaneously.

Supported modes:

  • "values": Streams complete state after each step
  • "updates": Streams only state changes after each step
  • "messages": Streams messages from within nodes
  • "custom": Streams custom events from within nodes
  • "debug": Streams detailed execution events for tracing & debugging
Copy
// Stream only values
streamMode: "values"

// Stream both values and debug info
streamMode: ["values", "debug"]
property
subgraphs: TSubgraphs

Whether to include subgraph execution details in the stream. When true, state updates from nested graphs will also be streamed.

property
tags: string[]
property
timeout: number

The value (ms) of the timeout that fired (runTimeout or idleTimeout).

deprecatedproperty
checkpointDuring: boolean

Whether to checkpoint intermediate steps, defaults to true. If false, only the final checkpoint is saved.

Configuration options for executing a Pregel graph. These options control how the graph executes, what data is streamed, and how interrupts are handled.