> ## 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.

# onTask()

> `protected` **onTask**(`_name`, `_payload`, `_ctx`): `Promise`\<`void`>

Hook: fallback for a due task whose `name` is not a method on the
subclass. The common path dispatches straight to the named method; this
fires only when that lookup misses. The default implementation does
nothing (the task is treated as delivered).

**Parameters**

| Parameter | Type | Description |
| - | - | - |
| `_name` | `string` | The task's method name that failed to resolve. |
| `_payload` | `unknown` | The task's payload. |
| `_ctx` | \{ `attempt`: `number`; } | Delivery context; `attempt` is the number of consecutive failed deliveries so far. |
| `_ctx.attempt` | `number` | - |

**Returns**

`Promise`\<`void`>
