Skip to content

Flows Add-on

The Flows add-on for i-doit is a powerful tool for automating processes within the CMDB system. It enables the creation of automated flows based on triggers and defined conditions. With flows, users can automate repetitive tasks and manual steps by defining rules that are triggered by certain events or conditions (e.g. a change in the CMDB). The add-on helps to make workflows more efficient, reduce errors and simplify the management of complex IT environments by handling routine processes without user interaction.

Download and installation#

This add-on can be installed at a later date. Detailed descriptions regarding download, installation, updates etc. can be found in the articlei-doit Add-ons.


CLI Commands#

If the command is to be executed for a Tenant other than the first Tenant, the corresponding Tenant ID must be passed.

The Flows Add-on comes with two CLI commands. Both commands are needed to make the Flows Add-on work completely. There are two option to set up the CLI Commands. The Commands can be executed by a Crontab. We also have created a Service installation Script called create-daemon.sh, which can be found in the Flows Add-on folder i-doit/src/classes/modules/synetics_flows/.

Using system service installer script#

This Service will run the Flows Add-on CLI commands every few seconds. First we need to set execute rights for the file. Use the command inside the i-doit folder:

1
sudo chmod +x src/classes/modules/synetics_flows/create-daemon.sh

Now the file can be executed to create a system service. This needs to be done for every Tenant

  • -u needs a i-doit admin-user
  • -p needs a i-doit admin-user-password
  • -i needs a tenant ID, can be viewed via console command tenant-list
1
src/classes/modules/synetics_flows/./create-daemon.sh -u admin-user -p admin-user-password -i 1

Creating a Crontab#

The Crontab will run the CLI commands every minute. Create a Crontab for the Apache user. Example for Debian:

1
sudo crontab -u www-data -e

Add the following lines at the end of the file, after replacing the i-doit login information. You may also need to replace the tenant ID.

1
2
* * * * * /usr/bin/php /var/www/html/i-doit/console.php flows:perform ---user admin-user --password admin-user-password --tenantId 1
* * * * * /usr/bin/php /var/www/html/i-doit/console.php flows:time-trigger --user admin-user --password admin-user-password --tenantId 1

CLI console commands and options#

Command Interne Beschreibung
flows:perform Perform executions
flows:time-trigger Trigger execution of time automations

These commands are only available if the Flows add-on is installed

flows:perform#

Perform executions.

Options:

Parameter (short version) Parameter (long version) Description
-u --user=USERNAME Username of a user who is authorized to execute
-p --password=PASSWORD Password for authentication of the previously specified user
-i --tenant=TENANTID Tenant ID of the tenant to be used (default: 1)
-c --config=CONFIG Config File
-h --help Help message for displaying further information
-q --quiet Quiet-Mode to deactivate output
-V --version Output of the i-doit Console version
--ansi
--no-ansi
Force (or disable --no-ansi) ANSI output
-n --no-interaction Disables all interaction questions of the i-doit Console
-v / -vv / -vvv --verbose Increase the command output (1 = normal output, 2 = detailed output, 3 = debug level)

Example of use

1
sudo -u www-data php console.php flows:perform --user admin-user --password admin-user-password --tenantId 1

flows:time-trigger#

Trigger execution of time automations.

Options:

Parameter (short version) Parameter (long version) Description
-u --user=USERNAME Username of a user who is authorized to execute
-p --password=PASSWORD Password for authentication of the previously specified user
-i --tenant=TENANTID Tenant ID of the tenant to be used (default: 1)
-c --config=CONFIG Config File
-h --help Help message for displaying further information
-q --quiet Quiet-Mode to deactivate output
-V --version Output of the i-doit Console version
--ansi
--no-ansi
Force (or disable --no-ansi) ANSI output
-n --no-interaction Disables all interaction questions of the i-doit Console
-v / -vv / -vvv --verbose Increase the command output (1 = normal output, 2 = detailed output, 3 = debug level)

Example of use

1
sudo -u www-data php console.php flows:time-trigger --user admin-user --password admin-user-password --tenantId 1

Rights assignment#

At Administration → User permissions → Flows you can change Rights for Persons and Person groups.

Recht Beschreibung
Create Allows access to the Flows Overview
View Allows editing, activation/deactivation and implies the viewing right
Edit Allows creating, duplicating and implies the viewing right
Delete Allows the deletion of flows and implies the viewing right
Supervisor Allows everything

Overview#

Flows can be created or deleted via the action bar. If a flow has been created, it can also be opened, activated or deactivated via the Actions column. In addition, further actions are possible via the “3 dots” (More) button, such as editing and duplicating,


Flow creation#

To create a flow, the Flows add-on is called up via Add-ons → Flows. A new flow is then created using the Add button. A flow must have a name, a trigger and one or more actions defined in order to be complete. Finally, the flow must be activated using the button.

Trigger types#

Triggers determine when a flow is executed. Only one trigger per flow is possible.

The action is executed as soon as the date and time are reached. It can be repeated regularly.

The action is executed as soon as the button is clicked. The button is displayed in the action bar of the object if the conditions are met.

The action is executed when a specific CMDB status is set. It can also be filtered according to specific object types.

The action is executed when categories or entries are edited. It can also be set so that it is only executed when certain categories or attributes are edited.

Conditions types#

No condition needs to be selected. In addition, conditions can be linked and nested with AND and OR.

Several logical conditions can be added to link or nest conditions.

The action is only triggered for objects that fulfill the defined attribute-based conditions.

The action is only triggered at or within a defined time period.

The action is only triggered if it is triggered by selected persons or members of person groups.

Action types#

At least one action must be defined.

The action executes a defined API call. The API call requires a URL, a method and authorization details. Twig can be used as a template engine for this action type.

The action sends an e-mail to specific recipients. A subject is required. Twig can be used as a template engine for this action type.

The action creates a new object. It is possible to store attributes for categories.

The action updates attributes for existing objects.

Logs#

The logs are visible for all flows or for the flow that is currently open. Important information about the executions is saved in the logs.


Use cases#

To be continued.


Releases#

Version Datum Changelog
1.0 10.10.2024 Initiales Release