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

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
UniversalHubNodeLoadSerializableEncoder BackedFile SystemIn Memory
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsLlmsProfileLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingHashJson PatchJson SchemaMathSsrfStreamTestingTiktokenTypesVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/corecallbacksmanagerCallbackManagerForChainRun
Classā—Since v1.0

CallbackManagerForChainRun

Base class for run manager in LangChain.

Copy
class CallbackManagerForChainRun

Bases

BaseRunManager

Constructors

constructor
constructor

Properties

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

Methods

method
getChild→ CallbackManager
method
handleAgentAction→ void | Promise<void>

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

method
handleAgentEnd→ void | Promise<void>

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

method
handleChainEnd→ any

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

method
handleChainError→ any

Called if a Chain run encounters an error

method
handleCustomEvent→ any
method
handleText→ void | Promise<void>

Inherited fromBaseRunManager

Properties

P_parentRunId: stringPhandlers: BaseCallbackHandler[]PinheritableHandlers: BaseCallbackHandler[]PinheritableMetadata: Record<string, unknown>PinheritableTags: string[]Pmetadata: Record<string, unknown>PrunId: stringPtags: string[]PparentRunId: string | undefined

Methods

MhandleCustomEvent→ anyMhandleText→ void | Promise<void>
View source on GitHub