@langchain/langgraph
1.7.5 · 17 Nov 2026MIT5.2M / weekRepositoryHomepagenpmAtom feed
1.7.5 is the newest release of 1.x.
In short
6 new3 faster2 fixed1 internal
Release note
Minor Changes
Add cooperative, between-superstep graph draining via
RunControl.A new
RunControl(exported from@langchain/langgraph) exposesrequestDrain(reason)plus read-onlydrainRequested/drainReason. Pass it
through the newcontroloption oninvoke/stream/streamEvents(and the
functional API). It is surfaced onruntime.control, so nodes can read it or callrequestDrain()themselves, and it is propagated into subgraphs.When a drain is requested, the Pregel loop checks the flag at the top of each
superstep (after the previous step's writes are applied and checkpointed): if more
tasks remain it saves the checkpoint and throws the newGraphDrainederror (also
underdurability: "exit"), so the run can be resumed later from the same config.
If the graph naturally finishes on that tick it returns normally and the caller can
inspectcontrol.drainRequested. A drain requested inside a subgraph bubbles up and
stops the parent at its next boundary. Draining never cancels work that is already
running — pair it with anAbortSignalif you need a hard upper bound.Add
DeltaChanneland the writes-history saver API (beta).DeltaChannelis a reducer channel that stores only a sentinel in checkpoint
blobs instead of the full accumulated value, reconstructing state on read by
replaying ancestor writes through a batch reducer. This avoids re-serializing
the entire accumulated value at every step (e.g. long message histories).DeltaChannel(reducer, { snapshotFrequency })in@langchain/langgraph
count-based snapshot cadence (defaultsnapshotFrequency=1000) plus a
system boundDELTA_MAX_SUPERSTEPS_SINCE_SNAPSHOT(default 5000, envLANGGRAPH_DELTA_MAX_SUPERSTEPS_SINCE_SNAPSHOT).messagesDeltaReducer— a batching-invariant messages reducer that coerces
raw object/string writes, for use withDeltaChannel.BaseCheckpointSaver.getDeltaChannelHistory({ config, channels })(beta)
walks the parent chain returning per-channel{ writes, seed? }, with a
direct-storage override inMemorySaver.counters_since_delta_snapshotadded toCheckpointMetadata;DeltaSnapshot
serialization support in the JSON+ serializer.
Reconstruction is wired through the Pregel read/execution paths (initialization,
getState,updateState, local reads) andexitdurability accumulates and
anchors delta writes so threads remain reconstructible without forcing
snapshots.langgraph: Add node-level error handlers
StateGraph.addNode(name, fn, { errorHandler })now accepts a first-class
node-level error handler. The handler runs ONLY after the failing node'sretryPolicyis exhausted, so retry and handling stay decoupled. It receives a
typedNodeError { node, error }and the typed node input state, can return a
state update, and can route to a recovery branch vianew Command({ goto })
(saga / compensation flows).Failure provenance is checkpointed (via a reserved
ERROR_SOURCE_NODEwrite) so
handlers observe the same context after a checkpoint resume. Uncaught node
errors without a handler still abort the run as before, andGraphBubbleUp
errors (such asinterrupt()) are never swallowed by a handler.StateGraph.setNodeDefaults({ errorHandler })now also accepts a graph-wide
default handler. It is materialized atcompile()as a single shared handler
and invoked for every regular node that does not set its ownerrorHandler. A
per-node handler always takes precedence, the default never catches a failure
raised by an error-handler node itself (handler failures fail the run), and the
default is not inherited by subgraphs.Ports the Python feature from langchain-ai/langgraph#7233.
Add node-level timeouts.
A
timeoutoption is now supported onStateGraph.addNode, the functional API
(task/entrypoint), and theSendconstructor. Pass a number of milliseconds
for a hard wall-clock cap, or aTimeoutPolicyfor finer control:import { TimeoutPolicy } from "@langchain/langgraph"; // hard wall-clock cap on each attempt builder.addNode("agent", agentFn, { timeout: 60_000 }); // full control builder.addNode("agent", agentFn, { timeout: { runTimeout: 60_000, // hard wall-clock cap, never refreshed idleTimeout: 10_000, // cap on time without observable progress refreshOn: "auto", // "auto" | "heartbeat" }, }); // per-task override new Send("agent", state, { timeout: { idleTimeout: 5_000 } });When a timeout fires, a
NodeTimeoutError(carryingnode,kind
("run"/"idle"),timeout,elapsed,runTimeout,idleTimeout) is raised,
the attempt's buffered writes are dropped, and the node'sAbortSignalis
aborted.idleTimeoutis refreshed by observable progress (writes, custom
stream-writer calls, child-task scheduling, callback events) or an explicitruntime.heartbeat()call. The timer resets per retry attempt, andNodeTimeoutErroris retryable under the default retry policy.Ports langchain-ai/langgraph#7599, #7646, and #7659.
Add
StateGraph.setNodeDefaults()for setting graph-wide node policy defaults (retryPolicy,cachePolicy). Per-node values passed toaddNodealways take precedence, and defaults are resolved atcompile()time so call order does not matter. Defaults are not inherited by subgraphs. Ports Python'sset_node_defaults()(langchain-ai/langgraph#7747).
Patch Changes
core: Time travel replay/fork for graphs with interrupts and subgraphs
Ports Python fixes for stale RESUME writes during replay, wrong subgraph checkpoint loading during time travel, missing fork checkpoints on replay, and direct-to-subgraph time travel.
schema: Expose StateSchema JSON schemas for Studio introspection
Route StateSchema runtime definitions through getJsonSchema() and
getInputJsonSchema() so LangGraph Studio receives state, input, and
context schemas when graphs use the StateSchema primitive.Fixes #2466
core: Skip debug checkpoint snapshots when not streaming them
Avoid building full-state
mapDebugCheckpointpayloads on every tick when
no consumer subscribed tocheckpointsordebugstream modes. v3
companion checkpoint envelopes are unchanged (they come from values metadata).core: Index pending writes for O(1) task-prep lookups
Build a PendingWritesIndex once per _prepareNextTasks call so resume and
skip-done-task checks avoid repeated linear scans over checkpointPendingWrites.core: Optimize applyWrites, interrupt seen, and channel errors
Reduce allocations in _applyWrites, fix O(N²) interrupt versions_seen updates,
skip stack traces on EmptyChannelError control flow, and cache task lists in
the pregel loop and runner.remote: Add RemoteGraph v3 streaming support
Expose the v3
streamEventssurface forRemoteGraphby adapting remote SDK thread streams to the localGraphRunStreamshape.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.