Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

AI Agents · Class

RunnableConfig

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.

How it works

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.

Syntax

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; }

Parameters

NameTypeDescription
callbacksCallbacksCallbacks for this call and any sub-calls.
configurableContextTypeRuntime values for configurable attributes on this runnable or sub-runnables.
contextContextTypeUser-provided context.
interrupt(value: unknown) => unknownFunction that pauses a graph node and supports resumption through Command.
maxConcurrencynumberMaximum number of parallel calls.
metadataRecord<string, unknown>Metadata for this call and sub-calls; keys are strings and values must be JSON-serializable.
recursionLimitnumberMaximum number of recursive calls; defaults to 25.
runIdstringUnique tracer run identifier; a UUID is generated if omitted.
runNamestringTracer run name; defaults to the class name.
signalAbortSignalAbort signal for the call.
storeBaseStoreStore used by the call.
tagsstring[]Tags for this call and sub-calls.

Key points

  • callbacks apply to the current call and nested sub-calls, allowing instrumentation to follow a runnable hierarchy.
  • tags propagate to callbacks, whereas metadata is supplied to start handlers for tracing and observability.
  • configurable supplies runtime overrides for configurable attributes on the runnable and its children.
  • interrupt can pause a graph node and return a resume value when the graph is invoked again with Command.
  • maxConcurrency controls how many calls may run in parallel.
  • runId lets callers assign a tracer run identifier; without one, a UUID is generated.
  • timeout defines the per-call time limit in milliseconds.

Common mistakes

  • recursionLimit is finite by default; raise it explicitly when a workflow legitimately needs more recursive calls.
  • Metadata must use string keys and JSON-serializable values.

Example: Invoke an entrypoint with runtime configuration

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.

When to use it

Trace nested executions

Attach tracing and observability data to graph or runnable calls.

Control runtime execution

Limit parallelism, recursion, execution time, or cancellation behavior.

Provide runtime configuration

Pass tenant, user, or other per-request values into configurable workflows.

Coordinate streaming and interrupts

Emit custom chunks or pause and resume graph-node execution.

Interview questions

QWhat is RunnableConfig used for?

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.

QHow do configurable values and entrypoints relate?

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.

QWhich execution limits can RunnableConfig apply?

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.

  • LangGraphRunnableConfig
  • entrypoint
  • Command
  • BaseStore
  • Callbacks

Source: Interface LangGraphRunnableConfig<ContextType>. Checked 2026-10-15.