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/langgraphindexcreateSubgraphDiscoveryTransformer
Function●Since v0.3

createSubgraphDiscoveryTransformer

Create the subgraph discovery transformer.

Registering this transformer against a mux replaces the legacy inline behavior that previously lived in StreamMux.push. The mux no longer knows about the subgraph factory: instead, this transformer is the single component that materializes stream handles and announces them on _discoveries.

Marked as a NativeStreamTransformer so the projection is treated as internal wiring (not merged into run.extensions and not auto-forwarded via StreamMux.wireChannels).

Copy
createSubgraphDiscoveryTransformer<
  TStream extends StreamHandle = StreamHandle
>(
  mux: StreamMux,
  options: SubgraphDiscoveryTransformerOptions<TStream>
): NativeStreamTransformer<SubgraphDiscoveryProjection<TStream>>

Parameters

NameTypeDescription
mux*StreamMux

The mux whose _discoveries log should receive discovery entries and whose register will be called for each new stream handle.

options*SubgraphDiscoveryTransformerOptions<TStream>

Factory and related wiring.

View source on GitHub