LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangChain
  • Browser
  • Universal
  • Hub
  • Node
  • Load
  • Serializable
  • Encoder Backed
  • File System
  • In Memory
  • Tools
LangChain Core
  • Agents
  • Caches
  • Base
  • Dispatch
  • Web
  • Manager
  • Promises
  • Chat History
  • Context
  • Base
  • Langsmith
  • Documents
  • Embeddings
  • Errors
  • Example Selectors
  • Indexing
  • Base
  • Chat Models
  • Compat
  • Event
  • Llms
  • Openai Completions Stream
  • Profile
  • Stream
  • Structured Output
  • Load
  • Serializable
  • Memory
  • Messages
  • Tool
  • Output Parsers
  • Openai Functions
  • Openai Tools
  • Outputs
  • Prompt Values
  • Prompts
  • Retrievers
  • Document Compressors
  • Runnables
  • Graph
  • Singletons
  • Stores
  • Structured Query
  • Testing
  • Tools
  • Base
  • Console
  • Log Stream
  • Run Collector
  • Tracer Langchain
  • Stream
  • Async Caller
  • Chunk Array
  • Context
  • Env
  • Event Source Parse
  • Format
  • Function Calling
  • Gateway
  • Hash
  • Json Patch
  • Json Schema
  • Math
  • Ssrf
  • Standard Schema
  • Stream
  • Testing
  • Tiktoken
  • Types
  • Uuid
  • Vectorstores
Text Splitters
MCP Adapters
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
BrowserUniversalHubNodeLoadSerializableEncoder BackedFile SystemIn MemoryTools
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsCompatEventLlmsOpenai Completions StreamProfileStreamStructured OutputLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryTestingToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingGatewayHashJson PatchJson SchemaMathSsrfStandard SchemaStreamTestingTiktokenTypesUuidVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/corecallbacksmanagerCallbackManagerForChainRun
Class●Since v1.0

CallbackManagerForChainRun

Copy
class CallbackManagerForChainRun

Bases

BaseRunManager

Constructors

Properties

Methods

Inherited fromBaseRunManager

Properties

P_parentRunId: stringPhandlers: BaseCallbackHandler[]PinheritableHandlers: BaseCallbackHandler[]PinheritableMetadata: Record<string, unknown>
View source on GitHub
PinheritableTags: string[]
Pmetadata: Record<string, unknown>
PrunId: string
Ptags: string[]
PparentRunId: string | undefined

Methods

MhandleCustomEvent→ Promise<void>MhandleText→ Promise<void>
constructor
constructor→ CallbackManagerForChainRun
property
_parentRunId: string
property
handlers: BaseCallbackHandler[]
property
inheritableHandlers: BaseCallbackHandler[]
property
inheritableMetadata: Record<string, unknown>
property
inheritableTags: string[]
property
metadata: Record<string, unknown>
property
runId: string
property
tags: string[]
property
parentRunId: string | undefined
method
getChild→ CallbackManager
method
handleAgentAction→ Promise<void>
method
handleAgentEnd→ Promise<void>
method
handleChainEnd→ Promise<void>
method
handleChainError→ Promise<void>
method
handleCustomEvent→ Promise<void>
method
handleText→ Promise<void>

Base class for run manager in LangChain.

Called when an agent is about to execute an action, with the action and the run ID.

Called when an agent finishes execution, before it exits. with the final output and the run ID.

Called at the end of a Chain run, with the outputs and the run ID.

Called if a Chain run encounters an error