LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Server
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
LangGraph SDK
ClientAuthReactLoggingReact UiServer
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/langgraphprebuiltToolExecutor
Class●Since v0.3Deprecated

ToolExecutor

Copy
class ToolExecutor

Bases

RunnableBinding<ToolExecutorInputType, ToolExecutorOutputType>

Constructors

Properties

Methods

Inherited fromRunnableBinding(langchain_core)

Methods

MbindMwith_configMwith_listenersMwith_types
View source on GitHub
M
with_retry

Inherited fromRunnableBindingBase(langchain_core)

Attributes

Aconfig_factoriesAcustom_input_typeAcustom_output_typeAmodel_configAInputTypeAOutputTypeAconfig_specs

Methods

Mget_nameMget_input_schemaMget_output_schemaMget_graphMis_lc_serializable

Inherited fromRunnableSerializable(langchain_core)

Attributes

Amodel_config

Methods

Mto_jsonMconfigurable_fieldsMconfigurable_alternatives

Inherited fromSerializable(langchain_core)

Attributes

Amodel_config

Methods

Mis_lc_serializableMget_lc_namespaceMto_jsonMto_json_not_implemented

Inherited fromRunnable(langchain_core)

Attributes

AInputTypeAOutputTypeAinput_schemaAoutput_schemaAconfig_specs

Methods

Mget_nameMget_input_schemaMget_input_jsonschemaMget_output_schemaMget_output_jsonschema
constructor
constructor
property
bound: Runnable<any, any, RunnableConfig<Record<string, any>>>
property
config: RunnableConfig

The default configuration for graph execution, can be overridden on a per-invocation basis

property
configFactories: (config: RunnableConfig) => RunnableConfig<Record<string, any>> | Promise<RunnableConfig<Record<string, any>>>[]
property
invalidToolMsgTemplate: string
property
kwargs: Partial<RunnableConfig<Record<string, any>>>
property
lc_graph_name: string

The name of the channel.

property
lc_kwargs: SerializedFields
property
lc_namespace: string[]

A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.

property
lc_runnable: boolean
property
lc_serializable: boolean
property
name: string

The name of the task, analogous to the node name in StateGraph.

property
toolMap: Record<string, StructuredToolInterface | RunnableToolLike>
property
tools: StructuredToolInterface<ToolInputSchemaBase, any, any> | RunnableToolLike<InteropZodType, unknown>[]
property
lc_aliases
property
lc_attributes
property
lc_id
property
lc_secrets
property
lc_serializable_keys
method
_batchWithConfig
method
_callWithConfig
method
_execute→ Promise<any>

Execute a tool invocation

method
_getOptionsList
method
_mergeConfig
method
_separateRunnableConfigFromCallOptions
method
_streamIterator→ AsyncGenerator<any>

Default streaming implementation. Subclasses should override this method if they support streaming output.

method
_streamLog
method
_transformStreamWithConfig
method
assign
method
asTool
method
batch→ Promise<OperationResults<Op>>

Execute multiple operations in a single batch. This is more efficient than executing operations individually.

method
getName
method
invoke→ Promise<ExtractStateType<O, O>>

Run the graph with a single input and config.

method
pick
method
pipe→ PregelNode<RunInput, Exclude<NewRunOutput, Error>>

Create a new runnable sequence that runs each individual runnable in series, piping the output of one runnable into another runnable or runnable-like.

method
stream→ Promise<IterableReadableStream<StreamOutputMap<TStreamMode, TSubgraphs, ExtractUpdateType<I, ExtractStateType<I, I>>, ExtractStateType<O, O>, "__start__" | N, NodeReturnType, InferWriterType<WriterType>, TEncoding>>>

Streams the execution of the graph, emitting state updates as they occur. This is the primary method for observing graph execution in real-time.

Stream modes:

  • "values": Emits complete state after each step
  • "updates": Emits only state changes after each step
  • "debug": Emits detailed debug information
  • "messages": Emits messages from within nodes
  • "custom": Emits custom events from within nodes
  • "checkpoints": Emits checkpoints from within nodes
  • "tasks": Emits tasks from within nodes
method
streamEvents→ IterableReadableStream<StreamEvent>
method
streamLog
method
toJSON→ __type
method
toJSONNotImplemented
method
transform
method
withConfig→ CompiledStateGraph<S, U, N, I, O, C, NodeReturnType, InterruptType, WriterType>

Creates a new instance of the Pregel graph with updated configuration. This method follows the immutable pattern - instead of modifying the current instance, it returns a new instance with the merged configuration.

method
withFallbacks
method
withListeners
method
withRetry
method
isRunnable
method
isRunnableBinding
method
lc_name→ string

The name of the serializable. Override to provide an alias or to preserve the serialized module name in minified environments.

Implemented as a static method to support loading logic.

deprecatedmethod
getGraph→ Graph

Returns a drawable representation of the computation graph.

M
get_lc_namespace
Mainvoke
Mabatch
Mbatch_as_completed
Mabatch_as_completed
Mastream
Mastream_events
Matransform
M
config_schema
Mget_config_jsonschema
Mget_graph
Mget_prompts
Mainvoke
Mbatch_as_completed
Mabatch
Mabatch_as_completed
Mastream
Mastream_log
Mastream_events
Matransform
Mbind
Mwith_config
Mwith_listeners
Mwith_alisteners
Mwith_types
Mwith_retry
Mmap
Mwith_fallbacks
Mas_tool