diff --git a/README.md b/README.md
index daeb3fa21..9f12e449f 100644
--- a/README.md
+++ b/README.md
@@ -94,6 +94,7 @@ That's it. `chat.messages()` is an Angular Signal. Bind it directly in your temp
| Tool call progress | `toolProgress()` | `toolProgress` |
| Tool calls with results | `toolCalls()` | `toolCalls` |
| Branch / history | `branch()` / `history()` | `branch` / `history` |
+| Pending run queue | `queue()` | `queue` |
| Subagent streaming | `subagents()` / `activeSubagents()` | `subagents` / `activeSubagents` |
| Reactive thread switching | `Signal` input | prop |
| Submit | `submit(values, opts?)` | `submit(values, opts?)` |
@@ -116,7 +117,7 @@ That's it. `chat.messages()` is an Angular Signal. Bind it directly in your temp
/>
-`agent()` creates 12 `BehaviorSubject`s at injection-context time — once, at component construction. The `StreamManager` bridge (the only file that touches `@langchain/langgraph-sdk` internals) pushes stream events into those subjects. `toSignal()` converts each subject to an Angular Signal, also at construction time. Dynamic actions (`submit`, `stop`, `switchThread`) push into the existing subjects — no new subjects are ever created after construction. This architecture is required because `toSignal()` must be called in an injection context and cannot be called again later.
+`agent()` creates its internal `BehaviorSubject`s at injection-context time — once, at component construction. The `StreamManager` bridge (the only file that touches `@langchain/langgraph-sdk` internals) pushes stream events into those subjects. `toSignal()` converts each subject to an Angular Signal, also at construction time. Dynamic actions (`submit`, `stop`, `switchThread`) push into the existing subjects — no new subjects are ever created after construction. This architecture is required because `toSignal()` must be called in an injection context and cannot be called again later.
---
diff --git a/apps/website/content/docs/agent/api/api-docs.json b/apps/website/content/docs/agent/api/api-docs.json
index 094889408..5d51691b3 100644
--- a/apps/website/content/docs/agent/api/api-docs.json
+++ b/apps/website/content/docs/agent/api/api-docs.json
@@ -22,6 +22,62 @@
],
"properties": [],
"methods": [
+ {
+ "name": "cancelRun",
+ "signature": "cancelRun(threadId: string, runId: string, signal: AbortSignal)",
+ "description": "Cancel a server-side run.",
+ "params": [
+ {
+ "name": "threadId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "runId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "signal",
+ "type": "AbortSignal",
+ "description": "",
+ "optional": false
+ }
+ ]
+ },
+ {
+ "name": "createQueuedRun",
+ "signature": "createQueuedRun(assistantId: string, threadId: string, payload: unknown, signal: AbortSignal)",
+ "description": "Create a pending server-side run using LangGraph's enqueue strategy.",
+ "params": [
+ {
+ "name": "assistantId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "threadId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "payload",
+ "type": "unknown",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "signal",
+ "type": "AbortSignal",
+ "description": "",
+ "optional": false
+ }
+ ]
+ },
{
"name": "joinStream",
"signature": "joinStream(threadId: string, runId: string, lastEventId: string | undefined, signal: AbortSignal)",
@@ -101,14 +157,89 @@
"examples": [
"```typescript\nconst transport = new MockAgentTransport([\n [{ type: 'values', data: { messages: [aiMsg('Hello')] } }],\n [{ type: 'values', data: { status: 'done' } }],\n]);\n```"
],
- "properties": [],
+ "properties": [
+ {
+ "name": "cancelledRuns",
+ "type": "object[]",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "createdQueuedRuns",
+ "type": "AgentQueueEntry[]",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "joinedRuns",
+ "type": "object[]",
+ "description": "",
+ "optional": false
+ }
+ ],
"methods": [
+ {
+ "name": "cancelRun",
+ "signature": "cancelRun(threadId: string, runId: string, signal: AbortSignal)",
+ "description": "Optional: cancel a server-side run.",
+ "params": [
+ {
+ "name": "threadId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "runId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "signal",
+ "type": "AbortSignal",
+ "description": "",
+ "optional": false
+ }
+ ]
+ },
{
"name": "close",
"signature": "close()",
"description": "Close the stream. Remaining queued events are drained before completion.",
"params": []
},
+ {
+ "name": "createQueuedRun",
+ "signature": "createQueuedRun(_assistantId: string, threadId: string, payload: unknown, signal: AbortSignal)",
+ "description": "Optional: create a server-side queued run without joining it immediately.",
+ "params": [
+ {
+ "name": "_assistantId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "threadId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "payload",
+ "type": "unknown",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "signal",
+ "type": "AbortSignal",
+ "description": "",
+ "optional": false
+ }
+ ]
+ },
{
"name": "emit",
"signature": "emit(events: StreamEvent[])",
@@ -141,6 +272,37 @@
"description": "Returns true if a stream is currently active.",
"params": []
},
+ {
+ "name": "joinStream",
+ "signature": "joinStream(threadId: string, runId: string, lastEventId: string | undefined, signal: AbortSignal)",
+ "description": "Optional: join an already-started run without creating a new one.",
+ "params": [
+ {
+ "name": "threadId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "runId",
+ "type": "string",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "lastEventId",
+ "type": "string | undefined",
+ "description": "",
+ "optional": false
+ },
+ {
+ "name": "signal",
+ "type": "AbortSignal",
+ "description": "",
+ "optional": false
+ }
+ ]
+ },
{
"name": "nextBatch",
"signature": "nextBatch()",
@@ -292,11 +454,93 @@
],
"examples": []
},
+ {
+ "name": "AgentQueue",
+ "kind": "interface",
+ "description": "Public queue surface for pending server-side LangGraph runs.",
+ "properties": [
+ {
+ "name": "cancel",
+ "type": "object",
+ "description": "Cancel a specific pending run by server run ID.",
+ "optional": false
+ },
+ {
+ "name": "clear",
+ "type": "object",
+ "description": "Cancel all pending runs and clear the queue.",
+ "optional": false
+ },
+ {
+ "name": "entries",
+ "type": "readonly AgentQueueEntry[]",
+ "description": "Read-only pending queue entries.",
+ "optional": false
+ },
+ {
+ "name": "size",
+ "type": "number",
+ "description": "Number of pending queue entries.",
+ "optional": false
+ }
+ ],
+ "examples": []
+ },
+ {
+ "name": "AgentQueueEntry",
+ "kind": "interface",
+ "description": "A queued server-side LangGraph run.",
+ "properties": [
+ {
+ "name": "createdAt",
+ "type": "Date",
+ "description": "Timestamp when the queued run was registered locally.",
+ "optional": false
+ },
+ {
+ "name": "id",
+ "type": "string",
+ "description": "Server-side run ID.",
+ "optional": false
+ },
+ {
+ "name": "options",
+ "type": "LangGraphSubmitOptions",
+ "description": "Submit options used when the queued run was created.",
+ "optional": true
+ },
+ {
+ "name": "threadId",
+ "type": "string",
+ "description": "Thread that owns the queued run.",
+ "optional": false
+ },
+ {
+ "name": "values",
+ "type": "T | null | undefined",
+ "description": "Values submitted for the queued run.",
+ "optional": false
+ }
+ ],
+ "examples": []
+ },
{
"name": "AgentTransport",
"kind": "interface",
"description": "Transport interface for connecting to a LangGraph agent.",
"properties": [
+ {
+ "name": "cancelRun",
+ "type": "unknown",
+ "description": "",
+ "optional": true
+ },
+ {
+ "name": "createQueuedRun",
+ "type": "unknown",
+ "description": "",
+ "optional": true
+ },
{
"name": "joinStream",
"type": "unknown",
@@ -483,6 +727,12 @@
"description": "",
"optional": false
},
+ {
+ "name": "queue",
+ "type": "Signal>",
+ "description": "Pending server-side runs created via `multitaskStrategy: 'enqueue'`.",
+ "optional": false
+ },
{
"name": "reload",
"type": "object",
@@ -552,6 +802,26 @@
],
"examples": []
},
+ {
+ "name": "LangGraphSubmitOptions",
+ "kind": "interface",
+ "description": "Options accepted by LangGraph-backed submit calls.",
+ "properties": [
+ {
+ "name": "multitaskStrategy",
+ "type": "LangGraphMultitaskStrategy",
+ "description": "Strategy for handling concurrent runs on the same thread.",
+ "optional": true
+ },
+ {
+ "name": "signal",
+ "type": "AbortSignal",
+ "description": "",
+ "optional": true
+ }
+ ],
+ "examples": []
+ },
{
"name": "MockLangGraphAgent",
"kind": "interface",
@@ -665,6 +935,12 @@
"description": "",
"optional": false
},
+ {
+ "name": "queue",
+ "type": "WritableSignal>",
+ "description": "Pending server-side runs created via `multitaskStrategy: 'enqueue'`.",
+ "optional": false
+ },
{
"name": "reload",
"type": "object",
@@ -759,7 +1035,7 @@
},
{
"name": "type",
- "type": "\"error\" | \"values\" | `values|${string}` | \"messages\" | `messages|${string}` | `messages/${string}` | `messages/${string}|${string}` | \"updates\" | `updates|${string}` | \"tools\" | `tools|${string}` | \"custom\" | `custom|${string}` | `error|${string}` | \"metadata\" | \"checkpoints\" | `checkpoints|${string}` | \"tasks\" | `tasks|${string}` | \"debug\" | `debug|${string}` | \"events\" | `events|${string}` | \"interrupt\" | \"interrupts\"",
+ "type": "\"error\" | \"interrupt\" | \"values\" | `values|${string}` | \"messages\" | `messages|${string}` | `messages/${string}` | `messages/${string}|${string}` | \"updates\" | `updates|${string}` | \"tools\" | `tools|${string}` | \"custom\" | `custom|${string}` | `error|${string}` | \"metadata\" | \"checkpoints\" | `checkpoints|${string}` | \"tasks\" | `tasks|${string}` | \"debug\" | `debug|${string}` | \"events\" | `events|${string}` | \"interrupts\"",
"description": "Event type identifier (e.g., 'values', 'messages', 'error', 'interrupt').",
"optional": false
}
@@ -990,6 +1266,13 @@
"signature": "T extends { ~agentTypes: unknown } ? BagTemplate : B",
"examples": []
},
+ {
+ "name": "LangGraphMultitaskStrategy",
+ "kind": "type",
+ "description": "Strategy for handling concurrent LangGraph runs on the same thread.",
+ "signature": "\"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\"",
+ "examples": []
+ },
{
"name": "ResourceStatus",
"kind": "type",
diff --git a/apps/website/content/docs/agent/concepts/langgraph-basics.mdx b/apps/website/content/docs/agent/concepts/langgraph-basics.mdx
index d92d62195..2e7bd5bc2 100644
--- a/apps/website/content/docs/agent/concepts/langgraph-basics.mdx
+++ b/apps/website/content/docs/agent/concepts/langgraph-basics.mdx
@@ -324,6 +324,7 @@ agent.branch() // Signal — time-travel branch
agent.toolCalls() // Signal — tool results
agent.toolProgress() // Signal — active tool execution
+agent.queue() // Signal — pending enqueue runs
agent.subagents() // Signal