# ActionRunner
Source: https://docs.maelstrom-ai.co/dev/reference/client/type-aliases/actionrunner/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **ActionRunner**<`V`\> = `string` _extends_ [`ActionNames`](https://docs.maelstrom-ai.co/dev/reference/client/type-aliases/actionnames/)<`V`\> ? `{ [Name in ActionNames<V>]?: ActionHandlerFor<V, Name> }` : `Simplify`<`{ [Name in HandlerRequiredActionNames<V>]: ActionHandlerFor<V, Name> }` &amp; `{ [Name in HandlerOptionalActionNames<V>]?: ActionHandlerFor<V, Name> }`\>

Defined in: [packages/client/src/lib/command-processor/action-runner.types.ts:171](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/client/src/lib/command-processor/action-runner.types.ts#L171)

Typed action runner map keyed by action name, inferred from the Vessel definition.

A handler is required for every Action that is not declared `effect: 'none'`, because such an Action without a handler is skipped and changes no Variant. A handler is optional for an Action declared `effect: 'none'`: the framework applies its transition on its own. When the same Action name appears on several Variants, its handler is required if any of those declarations is not `'none'`.

A widened definition typed as plain `VesselDefinition`, whose Action names are not literal, makes every handler optional.

## Type Parameters

### V

`V` _extends_ `VesselDefinition` = `VesselDefinition`

## Example

```typescript
import { ok } from '@maelstrom-co/protocol';

const runner: ActionRunner<typeof myVessel> = {
  selectOrder: (params) => {
    // params is fully typed based on vessel definition
    console.log(params.orderId);
    return ok(undefined);
  },
  // `showList` is declared `effect: 'none'`, so it may be left out.
};
```
