LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
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
WebChannelsPregelPrebuiltRemoteStream
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/langgraphwebcreateSubgraphDiscoveryTransformer
Functionā—Since v0.3

createSubgraphDiscoveryTransformer

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

Parameters

NameTypeDescription
mux*StreamMux
options*SubgraphDiscoveryTransformerOptions<TStream>

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).

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

Factory and related wiring.