LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsnodeAsyncSubAgent
Interface●Since v1.10

AsyncSubAgent

Specification for an async subagent running on a remote Agent Protocol server.

Async subagents connect to any Agent Protocol-compliant server via the LangGraph SDK. They run as background tasks that the main agent can monitor and update.

Compatible with LangGraph Platform (managed) and self-hosted servers. Authentication for LangGraph Platform is handled automatically by the SDK via environment variables (LANGGRAPH_API_KEY, LANGSMITH_API_KEY, or LANGCHAIN_API_KEY). For self-hosted servers, pass custom auth via headers.

Subagents on this deployment (no url) nest under the parent's trace when tracing is on. Each task's thread has parent_thread_id metadata naming the parent's thread, so an app can list a parent's subagent threads with the LangGraph SDK: client.threads.search({ metadata: { parent_thread_id } }).

Copy
interface AsyncSubAgent

Properties

property
description: string

What this subagent does. The main agent uses this to decide when to delegate.

property
graphId: string

The graph name or assistant ID on the Agent Protocol server.

property
headers: Record<string, string>

Additional headers to include in requests to the server (e.g. for custom auth).

property
mode: "fork" | "isolated"

What the subagent starts with. Defaults to "isolated".

  • "isolated": only the delegated task description.
  • "fork": a snapshot of the parent's conversation at launch, followed by the task description, for background work.

Fork mode copies conversation history, not the parent's model, prompt, tools or middleware; match them on the remote agent for prompt-cache reuse.

Media the parent offloaded with offloadBinaryContent is forked as references: the subagent must be a deep agent, and shares the parent's backend to see it.

mode: "fork" may change in a future release.

property
name: string

Unique identifier for the async subagent.

property
notifyParent: boolean

Whether this subagent may wake this agent when it finishes while this agent is idle. Defaults to true.

Set it to false when the application delivers results itself, for example through webhook. This agent still sees the subagent's updates while it runs.

notifyParent may change along with how subagents wake their parent.

property
updateStrategy: UpdateStrategy

How update_async_task sends a follow-up while a run is active. Defaults to "interrupt".

  • "interrupt": stop the current run and start the follow-up.
  • "enqueue": queue the follow-up behind the current run. The task is pending until the follow-up starts. If the current run stops to ask its user for approval or input, the follow-up still starts, and that request is dropped.

updateStrategy may change along with how queued follow-ups are tracked.

property
url: string

URL of the Agent Protocol server. Omit for a subagent on the same Agent Server deployment, which gives running graphs its address; elsewhere, defaults to the LangGraph SDK's default endpoint.

property
webhook: string

URL the Agent Server calls whenever a run of this subagent finishes.

View source on GitHub