agent_dispatch
Send tasks to OpenClaw agents using async, sync, or spawn modes: fire-and-forget, wait for a reply, or track delegated sub-agent runs.
Instructions
Send a task or message to an OpenClaw agent. Three modes:
"async" (default): fire-and-forget via webhook. Returns immediately with accepted status. Supports delivery to Telegram.
"sync": wait for agent reply via chat completions. Blocks until response.
"spawn": tracked sub-agent delegation via /sessions_spawn. Returns runId + childSessionKey for observation. Routes to Tani (main), Alan (coding), or Rachel (rachel). Only call when the user has explicitly requested execution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | [async] Recipient ID for delivery. | |
| mode | No | Dispatch mode. "async" = fire-and-forget, "sync" = wait for reply, "spawn" = tracked delegation. Default: async. | |
| name | No | [async] Name for log traceability. | |
| model | No | Override the agent's default model. | |
| agentId | No | Target agent. main=Tani (orchestrator), coding=Alan (code), rachel=Rachel (documents). Default: main. | |
| channel | No | [async] Delivery channel (e.g., "telegram"). | |
| deliver | No | [async] Whether to deliver the response to a channel. | |
| message | Yes | The task, plan, or message to send. | |
| wakeMode | No | [async] When to wake the agent. Default: now. | |
| maxTokens | No | [sync] Max tokens for the reply. Default: 1000. | |
| timeoutMs | No | [sync] Client-side abort timeout in ms. Default: 300000. | |
| sessionKey | No | [async] Session key to target a specific session. | |
| timeoutSeconds | No | [async] Timeout in seconds for processing. | |
| runTimeoutSeconds | No | [spawn] Timeout for the sub-agent run in seconds. |