API reference@siftline/actionsFunctions
dispatch
function dispatch<Actions>(
decision,
actions,
recipe,
options?
): Promise<
| Dispatched<ActionId<Actions>>
| null>;Sends a routed Decision to the Action it selected: builds with that Action's Adapter, then
performs once. No retries, no timeout of its own: both belong to the caller, as with
perform. A send that fails throws perform's ActionFailedError, retryable intact.
Type Parameters
| Type Parameter |
|---|
Actions extends ActionSet |
Parameters
| Parameter | Type | Description |
|---|---|---|
decision | Decision | - |
actions | Actions | The result of defineActions. |
recipe | Recipe | - |
options | PerformOptions | - |
Returns
Promise<
| Dispatched<ActionId<Actions>>
| null>
null, sending nothing, when the Decision went to Review or selected no Action.
Throws
ActionBuildError when the Decision names an Action id not in actions.