---
url: 'https://adk.nht.io/api/@nhtio/adk/dispatch_runner/classes/DispatchRunner.md'
---

# Class: DispatchRunner

Defined in: [lib/dispatch\_runner.ts:127](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/dispatch_runner.ts#L127)

## Constructors

### Constructor

```ts
new DispatchRunner(
   token: typeof CONSTRUCT_TOKEN,
   sourceCtx: TurnContext | undefined,
   turnInputPipeline: DispatchPipelineMiddlewareFn[],
   turnOutputPipeline: DispatchPipelineMiddlewareFn[],
   hooks:
  | DispatchRunnerFunctionalHookRegistrations
  | undefined,
   observers:
  | DispatchRunnerObservabilityHookRegistrations
  | undefined): DispatchRunner;
```

Defined in: [lib/dispatch\_runner.ts:142](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/dispatch_runner.ts#L142)

#### Parameters

| Parameter            | Type                                                                                                                                |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `token`              | *typeof* `CONSTRUCT_TOKEN`                                                                                                          |
| `sourceCtx`          | [`TurnContext`](../../types/interfaces/TurnContext.md) | `undefined`                                                               |
| `turnInputPipeline`  | [`DispatchPipelineMiddlewareFn`](../type-aliases/DispatchPipelineMiddlewareFn.md)\[]                                                 |
| `turnOutputPipeline` | [`DispatchPipelineMiddlewareFn`](../type-aliases/DispatchPipelineMiddlewareFn.md)\[]                                                 |
| `hooks`              | | [`DispatchRunnerFunctionalHookRegistrations`](../type-aliases/DispatchRunnerFunctionalHookRegistrations.md) | `undefined`       |
| `observers`          | | [`DispatchRunnerObservabilityHookRegistrations`](../type-aliases/DispatchRunnerObservabilityHookRegistrations.md) | `undefined` |

#### Returns

`DispatchRunner`

## Methods

### dispatch()

```ts
static dispatch(input: RawDispatchRunnerInput): Promise<void>;
```

Defined in: [lib/dispatch\_runner.ts:221](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/dispatch_runner.ts#L221)

Dispatches a single LLM execution.

#### Parameters

| Parameter | Type                                                                | Description                                                                       |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `input`   | [`RawDispatchRunnerInput`](../interfaces/RawDispatchRunnerInput.md) | The dispatch input. Provide either `source` (derived path) or `raw` (standalone). |

#### Returns

`Promise`<`void`>

#### Remarks

Constructs an [@nhtio/adk!DispatchContext](../../types/interfaces/DispatchContext.md) (derived from `source` or from `raw`), runs the
iteration loop, and resolves when middleware/executor signals completion via `ctx.ack()` or
the abort signal fires. Rejects with the nack error when middleware/executor calls
`ctx.nack(err)`. Pipeline and executor errors are wrapped, surfaced on the observability
`error` hook, and re-thrown.

#### Throws

[@nhtio/adk!E\_INVALID\_LLM\_DISPATCH\_INPUT](../../exceptions/variables/E_INVALID_LLM_DISPATCH_INPUT.md) when the input does not satisfy validation, or
when neither `source` nor `raw` is provided, or when both are provided.

***

### isDispatchRunner()

```ts
static isDispatchRunner(value: unknown): value is DispatchRunner;
```

Defined in: [lib/dispatch\_runner.ts:203](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/dispatch_runner.ts#L203)

Returns `true` if `value` is a DispatchRunner instance.

#### Parameters

| Parameter | Type      | Description        |
| --------- | --------- | ------------------ |
| `value`   | `unknown` | The value to test. |

#### Returns

`value is DispatchRunner`

`true` when `value` is a DispatchRunner instance.

#### Remarks

Uses [@nhtio/adk!isInstanceOf](../../guards/functions/isInstanceOf.md) for cross-realm safety.
