> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# queue()

> `protected` **queue**(`method`, `payload?`, `opts?`): `Promise`\<`string`>

Schedule a persistent task to run as soon as possible — identical to
`schedule(0, method, payload, opts)`.

The canonical "think in the background" move: append to history in the
inbound method, `queue()` the slow work, return immediately. Same
dispatch, retry, and idempotency semantics as
[`schedule`](/docs/agent-sdk/interface/schedule).

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| `method` | `string` | Name of the method to invoke. |
| `payload?` | `unknown` | Value passed to the method. |
| `opts?` | [`ScheduleOptions`](/docs/agent-sdk/interface/schedule#scheduleoptions) | Stable id and retry policy — see [ScheduleOptions](/docs/agent-sdk/interface/schedule#scheduleoptions). |

**Returns**

`Promise`\<`string`>

The task id.
