Actions
Actions are sets of steps that can be executed manually or as a consequence of configured events.
Once an action starts, all associated steps are executed one after another in the established order until the sequence is completed.

Actions and scripting
To begin creating actions on the platform, use the Actions and scripting menu to activate the action management module.

This module allows creating new actions, their steps, triggers, and also editing them.

Details
Description: This field allows entering a description that will be used to identify the new action in the system. This field is required.
Maximum number of instances: This numeric value indicates how many instances of the action can run simultaneously.
This can occur when any of the triggers fires (or the action is started manually, or in any other way) while the action is already running. The default value for this attribute is 1, indicating that if the action is already running, it cannot be started again.
Enable triggers: Determines whether all triggers for the action are enabled or disabled.
Steps
The step types allowed in actions are the following:
- Set value: Allows changing the value of a variable to a given value.
- Add value: Allows incrementing the value of a variable.
- Subtract value: Allows decrementing a variable by a given value.
- Turn On: Allows changing the state of a sensor to on.
- Turn Off: Allows changing the state of a sensor to off.
- Toggle: Allows changing the state of a sensor from ON to OFF or vice versa.
- Email notifications: Allows sending messages via email to an address or list of addresses.
- SMS notifications: Allows sending messages via SMS to a phone number or list of phone numbers.
- Voice notifications: Allows sending voice calls to a phone number or list of phone numbers.
- Scripting: Allows writing a code fragment in an interpreted language (Javascript) that is easy to understand, expanding the range of possibilities when processing a specific business logic. Scripts also:
- Can be related to each other to leverage code reuse.
- Can access all devices of the client in which they are running.
- Can be tested to verify correct operation before deployment.
For more information about step configuration, continue reading Steps
Triggers
Triggers allow defining events that are used to fire the action. An action can have multiple triggers. When any one of them fires, the action begins executing. Any trigger that can be modeled as an event is supported, including calendar events.
Actions do not need to have associated triggers. However, actions without triggers can only be executed manually or when alerts are triggered.
For more information, continue reading Triggers
Execution queue
When a trigger associated with an action fires, or when started manually, or as a consequence of any other condition, a record will be created in the action queue (table "ActionInstances"). This table contains all action instances currently running.
A scheduled job (implemented as an external executable) will be responsible for periodically reviewing this table, updating the action's status, and executing the action's steps, using a separate thread for each action.