# Action (/docs/nodes/action)



The **Action** node **describes** a side effect; it never performs it. The runtime stores the description with the execution and delivers it afterwards, so a slow receiver cannot hold up the response and a decision stays replayable.

## When to use it [#when-to-use-it]

* Notify another system: a webhook, an event on Kafka or SQS, an alert.
* Hand a case to a person with `enqueueReview`.
* Record an observation for the feature store with `recordObservation`.

## How it works [#how-it-works]

<Diagram node="action" kind="anatomy" />

1. The **payload** is built field by field from expressions, and the **target** (a URL, a topic, a queue name) is built from its template.
2. For HTTP targets (`sendWebhook`, `callApi`, `executeDecision`) the address is checked and blocked ones are refused.
3. The action is queued on the execution. Nothing is sent yet, and the flow continues through **Next**.
4. After the execution is stored, the runtime delivers it. `sendWebhook`, `callApi` and `publishEvent` go through an **outbox** written in the same transaction and are delivered by a worker with retries.

## Ports [#ports]

| Port   | Taken when                         |
| ------ | ---------------------------------- |
| `Next` | Always, once the action is queued. |

## Configuration [#configuration]

| Field          | What it does                                                                                                                                           |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Name           | Label shown on the canvas and in the trace.                                                                                                            |
| Action         | `return`, `createAlert`, `sendWebhook`, `publishEvent`, `notify`, `enqueueReview`, `storeResult`, `recordObservation`, `callApi` or `executeDecision`. |
| Label          | Free text shown in the trace and the deliveries view.                                                                                                  |
| Target         | Webhook URL, topic, queue URL or review queue name. Supports `{{placeholders}}`.                                                                       |
| Connection     | For `publishEvent`: a Kafka or SQS connection.                                                                                                         |
| Authentication | For `sendWebhook` and `callApi`: a stored credential, sent with the delivery.                                                                          |
| Payload        | Each field and the expression that fills it.                                                                                                           |

## What it writes [#what-it-writes]

No variables. The queued action is added to the execution (visible in the actions list and deliveries) and the trace says `Action queued`, with the target redacted.

## In a real flow [#in-a-real-flow]

<Diagram node="action" kind="example" />

When the amount is large, a webhook is queued for the risk team. The response is returned immediately; the worker delivers the webhook from the outbox afterwards. Simulations never enqueue anything.

## When it fails [#when-it-fails]

* A payload field cannot be built: `ACTION_FAILED`.
* The target is a blocked address: `BLOCKED_URL`.
* A webhook without a target, or an event with a connection but no topic, are errors in Checks.

## Good to know [#good-to-know]

* Because delivery happens after the run, an Action cannot feed its result back into the flow. To use an answer, call an [API call](/docs/nodes/api-call).
* `createAlert` and `enqueueReview` are the internal pair: they open a case in the project's inbox instead of calling out, and members are told through [Notifications](/docs/guides/notifications). Like the inbox, they act only on live traffic.

## Related [#related]

* [Webhooks](/docs/integrate/webhooks)
* [Deliveries](/docs/operate/deliveries)
* [Notifications](/docs/guides/notifications)

## Credentials and the auth header [#credentials-and-the-auth-header]

`sendWebhook` and `callApi` deliveries authenticate with the stored credential, resolved when the
delivery is attempted (so a rotated secret is picked up by retries). The header depends on the
credential type: `Authorization: Bearer …`, `Authorization: Basic …`, or `X-API-Key: …`. Set
**Header name** when the backend uses its own (for example `api-key`): only the name changes, the
value keeps the type's format. A credential that no longer exists fails the delivery permanently.
