LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmithrun_treesRunTree
Class●Since v0.5

RunTree

A run can represent either a trace (root run) or a child run (~span).

Copy
class RunTree

Used in Docs

  • Custom instrumentation
  • Implement distributed tracing
  • Log LLM calls
  • Log traces to a specific project
  • Trace LangChain applications (Python and JS/TS)

Constructors

Properties

Methods

View source on GitHub
constructor
constructor→ RunTree
property
address: string | string | string | string
property
attachments: Attachments
property
child_execution_order: number
property
child_runs: RunTree[]
property
client: Client
property
distributedParentId: string
property
dotted_order: string
property
end_time: number
property
error: string
property
events: KVMap[]
property
execution_order: number
property
extra: KVMap
property
id: string
property
inputs: KVMap
property
name: string
property
outputs: KVMap
property
parent_run: RunTree
property
parent_run_id: string
property
project_name: string
property
reference_example_id: string
property
replicas: WriteReplica[]
property
run_type: string
property
serialized: object
property
start_time: number
property
tags: string[]
property
trace_id: string
property
tracingEnabled: boolean
property
metadata: KVMap
method
addEvent
method
createChild→ RunTree
method
end→ Promise<void>
method
patchRun→ Promise<void>
method
postRun→ Promise<void>
method
toHeaders→ __type
method
toJSON→ RunCreate & __type
method
fromDottedOrder→ RunTree | undefined
method
fromHeaders→ RunTree | undefined
method
fromRunnableConfig→ RunTree
method
getSharedClient→ Client

(beta) Set instead of project_name for an addressed run.

Attachments associated with the run. Each entry is a tuple of [mime_type, bytes]

The dotted order for the run.

This is a string composed of {time}{run-uuid}.* so that a trace can be sorted in the order it was executed.

Example:

  • Parent: 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8
  • Children:
    • 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155649Z809ed3a2-0172-4f4d-8a02-a64e9b7a0f8a
    • 20230915T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155650Zc8d9f4c5-6c5a-4b2d-9b1c-3d9d7a7c5c7c

The epoch time at which the run ended, if applicable.

Error message, captured if the run faces any issues.

Events like 'start', 'end' linked to the run.

Any additional metadata or settings for the run.

Optionally, a unique identifier for the run.

Inputs that were used to initiate the run.

A human-readable name for the run.

Outputs produced by the run, if any.

ID of a parent run, if this run is part of a larger operation.

Unset for a run sent to an address.

ID of an example that might be related to this run.

Projects to replicate this run to with optional updates.

Specifies the type of run (tool, chain, llm, etc.).

Serialized state of the run for potential future use.

The epoch time at which the run started, if available.

Tags for further categorizing or annotating the run.

Unique ID assigned to every run within this nested trace. *

Add an event to the run tree.

Patch the run tree to the API.