1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-28 19:06:12 +01:00
unleash.unleash/website/docs/reference/actions.md
Nuno Góis 95ebe25ada
docs: update feature availability (#6971)
Updates feature availability. 

Banners is a feature that is already GA'd since Unleash 5.7, so beta
availability seems irrelevant now.

We removed the mention of planning to GA Signals & Actions in 5.12,
since that's not happening and we would prefer not to include these
mentions in the future.
2024-05-02 11:19:44 +01:00

82 lines
4.3 KiB
Markdown

---
title: Actions
---
:::info Availability
Actions were introduced as a beta feature in **Unleash 5.11** and are only available in Unleash Enterprise.
:::
## Overview
Actions allow you to configure automated actions to be executed based on signals received from an external system.
![Actions executed by Unleash.](/img/actions/action-execution.png)
## Creating actions
:::info Permissions
Creating actions requires the `ADMIN` permission.
:::
Actions are scoped to a project. To be able to create actions, you need to navigate to the project settings and find the **Actions** tab.
![Actions tab.](/img/actions/actions-tab.png)
### Name and description
When creating a new action you first need to specify a name and a description. This will help you identify your action and give it a meaningful description.
![Create actions - Name and description](/img/actions/create-actions-name-and-description.png)
### Source and filters
Then you need to select a source. If you haven't created a signal endpoint yet, you can do so by using the **Create new signal endpoint** link (more information on this in the [Signals](./signals.md) section).
If the source you selected already received at least one signal, you'll be able to see a preview of the latest signal received. This can help you define the different filters that need to match for the action to be executed.
Filters work similarly to [feature flag strategy constraints](./strategy-constraints.md), where the signal payload acts as the context for the constraint evaluation.
Filters are completely optional, so if you don't configure any filter your action will always be executed whenever you receive a new signal on the selected source.
![Create actions - Source and filters](/img/actions/create-actions-source-and-filters.png)
### Actions
When these actions are triggered, they will execute under the identity of a [service account](./service-accounts.md). This means that when you later check the [event log](./event-log) you will see this service account as the actor for those events. In order to execute the configured actions successfully, this service account needs to have the necessary permissions. This service account doesn't need an API token, so when creating it you can skip the token generation step and simply make sure it has the necessary permissions.
The actions are executed in the same order that they are defined. If a previous action fails, the following actions will not be started. You can add multiple actions to an action set and you can add multiple action sets to a project. Depending on the action you want to execute you will have to provide different parameters.
![Create actions - Actions](/img/actions/create-actions-actions.png)
## Viewing action executions
Once the action is configured and you start receiving signals that match the filters you configured, you can see the action executions in the **Actions** tab.
![Action executions option.](/img/actions/view-events.png)
Using the **View events** option will show you the details of the action executions (what was the payload, did they execute successfully or not, what was the error in case of an error, etc).
To view the action events as they are executed, select the **View events** option in the respective action row. This will show you more information about each action execution: The signal payload, whether the actions executed successfully, the error details in case of an error, and other details.
![Event details.](/img/actions/action-execution-log.png)
## Limits that apply
There are some constraints on the actions feature as a measure to protect the stability of Unleash. These values can be overridden for self-hosted installations.
Unprocessed signals are processed in a "first in, first out" fashion, once every minute. If the number of pending signals to process exceeds the limit, it may take longer for the latest signals to be processed.
The limits are as follows:
- **Max action sets per project**: 5.
- **Max filters per action set**: 5.
- **Max distinct values in a filter**: 25.
- **Max actions per action set**: 10.
- **Max signals to process per cycle**: 10.
Ref: [Unleash Config](https://github.com/Unleash/unleash/blob/859fe098fedc261d646833012d9d408039491075/src/lib/create-config.ts#L577-L604)
## Sending signals to Unleash
See [Signals](./signals.md)