LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
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
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
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/langgraphindexfilterSubgraphHandles
Function●Since v0.3

filterSubgraphHandles

Filter a SubgraphDiscovery channel to only the direct children of a given namespace.

Returns an AsyncIterable whose iterator yields stream handles for discoveries whose namespace is exactly one segment deeper than path and shares it as a prefix. Iteration begins at startAt (so each caller picks up only discoveries added after its construction) and terminates when the underlying log closes or fails.

Copy
filterSubgraphHandles<
  TStream extends StreamHandle = StreamHandle
>(
  log: EventLog<SubgraphDiscovery>,
  path: Namespace,
  startAt: number = 0
): AsyncIterable<TStream>

Parameters

NameTypeDescription
log*EventLog<SubgraphDiscovery>

The shared discovery channel (mux._discoveries).

path*Namespace

Parent namespace whose direct children should be yielded.

startAtnumber
Default:0

Zero-based index into the discovery log to begin from.

View source on GitHub