> For the complete documentation index, see [llms.txt](https://docs.widgelix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.widgelix.com/actions-formerly-rule-engine/action-types-and-placeholders.md).

# Action Types & Placeholders

The **THEN** section of an action defines what happens when its conditions are met. One action can contain several THEN actions, e.g. an email and a downlink at the same time.

<figure><img src="https://2494440469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fggsr9Xlsze5cwVr4WMof%2Fuploads%2F3Ww7PEjCPLwrEJQTEOsR%2Fselect-action-type.png?alt=media&amp;token=a472ae9a-7c68-4d2b-b083-e789842ae34a" alt="Select Action Type dialog"><figcaption><p>Select Action Type</p></figcaption></figure>

## Action types

| Type           | Fields                       | What it does                                                                                                                                                                                        |
| -------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Email**      | Recipients, Subject, Message | Sends an email to one or more addresses. Type an address and press Enter to add it.                                                                                                                 |
| **Slack**      | Webhook URL, Message         | Posts the message to a Slack channel through an incoming webhook. See [Slack](https://docs.widgelix.com/notifications/types/slack.md).                                                              |
| **Discord**    | Webhook URL, Message         | Posts the message to a Discord channel through a webhook. See [Discord](https://docs.widgelix.com/notifications/types/discord.md).                                                                  |
| **Webhook**    | URL, JSON Payload, Headers   | Sends an HTTP request with your JSON payload to any external system. Add custom headers (e.g. authorization) with **+ Add Header**. The JSON editor has a **Format** button.                        |
| **SMS**        | Phone Numbers, Message       | Sends a text message to one or more phone numbers. See [SMS](https://docs.widgelix.com/notifications/types/sms.md).                                                                                 |
| **Signl4**     | Webhook URL, Title, Message  | Raises an alert in the SIGNL4 mobile alerting app.                                                                                                                                                  |
| **Downlink**   | Asset Name, Downlink Name    | Sends a predefined downlink command to an asset, e.g. to switch a relay or valve. The downlink must exist on the asset (see [Downlinks](https://docs.widgelix.com/assets/asset-page/downlinks.md)). |
| **Event Only** | none                         | Only logs the event in Widgelix (Events page and notifications in the app). This is the default THEN action.                                                                                        |

{% hint style="warning" %}
Webhook URLs, Slack/Discord/SIGNL4 webhook URLs and header values are secrets. Treat them like passwords and do not share screenshots that show them.
{% endhint %}

## Placeholders

Messages can include live data from the asset that triggered the action. Above the **Message** field the editor lists the placeholders available for the selected asset template (for example `Placeholders (generic-node)`). Click a placeholder chip to insert it at the cursor position. Inserted placeholders appear as blue tags in the message.

<figure><img src="https://2494440469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fggsr9Xlsze5cwVr4WMof%2Fuploads%2FkN3FA67nrjl6sAxBluE4%2Faction-email.png?alt=media&amp;token=4b76e525-a90a-45a2-966b-a7ef74d6915e" alt="Email action with placeholders"><figcaption><p>Message: "Asset [Device_Name] reported [Value] °C"</p></figcaption></figure>

Built-in placeholders:

| Placeholder   | Inserts                                     |
| ------------- | ------------------------------------------- |
| `Device_Name` | Name of the asset that triggered the action |
| `ID`          | ID (e.g. DevEUI) of that asset              |
| `Value`       | The value that caused the trigger           |
| `Value_Name`  | The data field that caused the trigger      |

In addition, every **tag** defined on the asset template (such as `floor`, `room` or `address`) is available as a placeholder, so you can tell the recipient exactly where the asset is installed.

When actions are created through the API or the Widgelix MCP server, placeholders are written with double square brackets, for example `[[Operated_Device.Device_Name]]` or `[[Operated_Device.Value]]`.

{% hint style="info" %}
Placeholders work in the **Message** field of a THEN action only. They are not replaced in the email **Subject**, the SIGNL4 **Title** or the action's **Custom Message**.
{% endhint %}

### Example

Message: `Asset [[Operated_Device.Device_Name]] in room [[Operated_Device.room]] reported [[Operated_Device.Value]] °C`

Result: `Asset Greenhouse sensor 1 in room B2 reported 31.4 °C`
