Trace nested executions
Attach tracing and observability data to graph or runnable calls.
AI Agents · Class
RunnableConfig is the per-call configuration object for LangGraph runnables. It carries execution limits, tracing data, cancellation, runtime values, persistence, and custom-stream output settings.
RunnableConfig carries per-call execution controls and tracing data into a runnable and its sub-runs. It can also expose runtime configurable values, context, interruption, persistence, and custom streaming through optional properties.
interface LangGraphRunnableConfig<ContextType extends Record<string, any> = Record<string, any>> { callbacks?: Callbacks; configurable?: ContextType; context?: ContextType; interrupt?: (value: unknown) => unknown; maxConcurrency?: number; metadata?: Record<string, unknown>; recursionLimit?: number; runId?: string; runName?: string; signal?: AbortSignal; store?: BaseStore; tags?: string[]; timeout?: number; writer?: (chunk: unknown) => void; }| Name | Type | Description |
|---|---|---|
callbacks | Callbacks | Callbacks for this call and any sub-calls. |
configurable | ContextType | Runtime values for configurable attributes on this runnable or sub-runnables. |
context | ContextType | User-provided context. |
interrupt | (value: unknown) => unknown | Function that pauses a graph node and supports resumption through Command. |
maxConcurrency | number | Maximum number of parallel calls. |
metadata | Record<string, unknown> | Metadata for this call and sub-calls; keys are strings and values must be JSON-serializable. |
recursionLimit | number | Maximum number of recursive calls; defaults to 25. |
runId | string | Unique tracer run identifier; a UUID is generated if omitted. |
runName | string | Tracer run name; defaults to the class name. |
signal | AbortSignal | Abort signal for the call. |
store | BaseStore | Store used by the call. |
tags | string[] | Tags for this call and sub-calls. |
import { entrypoint } from "@langchain/langgraph";
const workflow = entrypoint(
{ name: "config-demo" },
async (input: string, config) => {
config.writer?.({ input });
return config.configurable?.tenant ?? "default";
}
);
const result = await workflow.invoke("hello", {
configurable: { tenant: "acme" },
tags: ["demo"],
timeout: 5000,
});
console.log(result);Pass runtime controls and application-specific configurable values as the second argument when invoking an entrypoint.
Attach tracing and observability data to graph or runnable calls.
Limit parallelism, recursion, execution time, or cancellation behavior.
Pass tenant, user, or other per-request values into configurable workflows.
Emit custom chunks or pause and resume graph-node execution.
RunnableConfig is the optional per-invocation configuration object passed to a runnable. It can carry callbacks, tags, metadata, concurrency limits, tracing identifiers, cancellation, timeouts, and runtime values.
Follow-up: How would you propagate application-specific runtime data? Use the configurable or context properties, typing the context when appropriate and reading it inside the runnable.
configurable stores runtime values for attributes made configurable on a runnable or its sub-runnables. In LangGraph entrypoints, the configuration is the second argument after the workflow input.
Follow-up: How can a workflow emit custom stream data? Use the writer callback supplied in the configuration, or the entrypoint getWriter facility.
maxConcurrency limits the number of parallel calls, while recursionLimit limits recursive calls and defaults to 25. timeout is expressed in milliseconds, and signal allows cancellation when its AbortSignal is aborted.
Follow-up: What happens if a timeout or abort signal is triggered? The call is stopped according to the supplied timeout or abort signal rather than continuing normally.
LangGraphRunnableConfigentrypointCommandBaseStoreCallbacks