Skip to main content

Celonis Product Documentation

Flow Control
Repeater

Repeater is used in cases where you wish to repeat a task a given number of times. Let us assume you would like to send five emails with subjects "Hello 1", "Hello 2", ... "Hello 5". This could be accomplished with connecting Email > Send me an email module after the Repeater module:

61d5a3b515cbb.png

With modules configured as follows:

61d5a3b67bdb3.png
61d5a3b7e0c4b.png

You can imagine the Repeater module as a generator of bundles outputting one bundle after another. Each bundle contains one item named i of type Number. The initial value of the i item is specified in the Initial value field. The number of repetitions (= number of outputted bundles) is specified in the Repeats field. The value of the i item is increased in each repetition by the value specified in the Step field, which is 1 by default (tick the Show advanced settings checkbox to reveal it).

Iterator

Iterator is a special type of module that converts an array into a series of bundles. Each array item will be outputted as a separate bundle. See Iterator for further details.

Array aggregator

Array aggregator is an aggregator module, which allows to merge several bundles into one single bundle. The following image shows a typical setup of the Array aggregator module.

61d5a3b98d337.png

Source Module

The module from which the bundle aggregation will start. The source module is usually an iterator or a searchmodule that outputs a series of bundles. Once you setup the aggregator's Source Module (and close the aggregator's setup), the route between the source module and the aggregator will be wrapped in a grey area to visualize the start and the end of the aggregation.

Target structure type

The target structure into which the data shall be aggregated. The default option is Custom that enables you to choose items that should be aggregated into the Array aggregator's output bundle's Array item:

mceclip4.png

Once you connect more modules after the Array aggregator module and get back to the module's setup, the Target structure type dropdown will contain all the following modules and their fields that are of type Array of Collections, like e.g. Attachments field of the Slack > Create a Message module:

61d5a3bb2f653.png

Group by

The aggregator's output can be split into several groups with the help of the Group by field. The Group by field can contain a formula that is evaluated for each aggregator's input bundle. The aggregator then outputs one bundle per each distinct formula's value. Each bundle contains two items:

  • Key contains the distinct value.

  • Array contains the aggregated data from the bundles for which the formula evaluated to the Key value.

Stop processing after an empty aggregation

By default, the aggregator outputs the result of the aggregation even in case no bundles reached the aggregator (e.g. because they have been all filtered out on their way). If the Stop processing after an empty aggregation option is enabled, the aggregator will not produce any output bundle in this case and the flow will stop.

Note

Bundles outputted from the source module and any other modules between the source module and the aggregator moduleare not outputted by the aggregatorand thus items in these bundles are not accessible by the modules in the flow after the aggregator.

If you need to access items from bundles outputted from the source module and any other modules between the source module and the aggregator module, make sure to include them in the Aggregated fields field in the setup of the Array aggregator module.

If items are nested (i.e. contained in a collection item) they currently cannot be easily selected in the Array aggregator's Aggregated fields field. For example, if bundles contain collection item User with two items Name and Email:

Then only the User collection item can be selected:

This setup will produce the following output:

61d5a3bcedf74.png
Customizing the output

If you wish to fully customize the Array aggregator's output structure, proceed as follows:

  1. Insert the JSON > Create JSON module after the Array aggregator module:

    mceclip15.png
  2. Open the JSON > Create JSON module's setup.

  3. Setup a Data structure for the items you want to be outputted from the Array aggregator. The Data structure should be an array of collections and the collections should contain the items you want to include in the output. Here is a sample Data structure with two text items Name and Email:

    mceclip3.png
  4. Open the Array aggregator module's setup.

  5. In the Target structure type field, choose the JSON > Create JSON module's array field:

    mceclip4.png
  6. Fields corresponding to the Data structure created in step 3 will appear in the setup of the Array aggregator module. Map any items into the fields as you see fit. You can now easily map nested items using the mapping panel and even use formulas:

    mceclip9.png
  7. The Array aggregator module's output will now look like this:

    mceclip14.png

If you wish to save the operation performed by the dummy JSON > Create JSON module, just put it on a disabled route after a Router:

61d5a3be5fcd8.png

If you wish to conditionally omit an item from the module's output, use a formula that evaluates to ignore keyword:

61d5a3c01df68.png

If the 4. User: Email is empty then the Email item will be completely omitted from the output:

61d5a3c18029a.png
Iterator

Iterator is a special type of module that converts an array into a series of bundles. Each array item will be outputted as a separate bundle.

Setting up an Iterator
61d59f8450299.jpg

Setting up an iterator is done in the same way as setting any other module. The Array field contains the array to be converted/split into separate bundles.

Examples:
Save email attachments to Dropbox

The below Action Flow shows how to retrieve emails with attachments and save the attachments as single files in a selected Dropbox folder.

Emails can contain an array of attachments. The Iterator module inserted after the first module will enable you to handle each attachment separately. The Iterator will split the array of attachments into single bundles, each bundle with one attachment will then be saved one at a time in a selected Dropbox folder. The Iterator module set up is shown above - the Array field should contain the Attachments[] array.

61d59f85c0d6f.jpg
Specialized iterators

For your convenience, many Celonis apps offer specialized iterator modules with a simplified setup. For example, the Email app contains the special iterator Email > Iterate attachments that will produce the same results as the general Iterator without having to specify the array, just the source module.

61d59f875435e.jpg
Troubleshooting: Mapping panel does not display mappable items under the Iterator module

When an Iterator does not have information about the structure of the array's items, the mapping panel in the modules following the Iterator will display only two items under the Iterator: Total number of bundles and Bundle order position:

61d59f88ddbed.png

The reason for this is that in Integromat each module is responsible for providing information about items it outputs so these items can be properly displayed in the mapping panel in the following modules. However, there are several modules that might be unable to provide this information in some cases, e.g. JSON > Parse JSON or Webhooks > Custom Webhook modules with missing Data structure.

The solution is to manually execute the scenario to make the module learn about the items it outputs so it can provide the information to the following modules.

For example, if you have a JSON > Parse JSON module without a Data structure as below:

61d59f8a8c06f.png

And then if you connect an Iterator module to it, you will not be able to map the output of the module to the Array field in the setup panel of the Iterator:

61d59f8c6f197.png

To resolve this, just manually start the scenario in the scenario editor. You can un-link the modules after the JSON > Parse JSON module to prevent the flow from proceeding further or right-click the JSON > Parse JSON module and choose "Run this module only" from the context menu to execute only the JSON > Parse JSON module.

Once the JSON > Parse JSON has been executed, it learns about the items it outputs and provides this information to all the following modules including the Iterator. The mapping panel in the Iterator's setup will then display the items:

61d59f8e3858b.png

Moreover, the mapping panel in the modules connected after the Iterator will display the items contained in the array's items:

61d59f901212a.png

To make the long story short: if you cannot see some items in a module's mapping panel, simply run the scenario once so all the modules can learn about the items they output and provide this information to the following modules.

Router

A router allows you to branch the scenario flow into several chains of modules. Each route processes the data differently according to the condition you set. Filters help you to determine conditions via different operators such as less than, greater than, and so on.

Order routes in the sequence you want and set up a fallback route that will process data that doesn't fit other routes.

Tip

See our Action Flow template for the Controlled distribution of data flow.

Adding a router to a Action Flow

You can add a router in two different ways:

  • Connect a router to a module:

    1. Click Add another module.

      add_another_module.png
    2. In the search box, type Flow controls and click it.

      flow_control_search.png
    3. Select Router.

  • Insert a router between two modules:

    1. Right-click the bridge between two modules, and select Add a router.

      add_router_bridge.png
Order routes

You can set the order of routes in which Celonis platform processes them in the Action Flow.

This example shows the router that determines which hint to send you on Slack according to tomorrow's weather.

  1. Click the router that contains the routes you want to order.

  2. Right-click and select Order routes. A window appears.

    order_route_window.png
  3. Click arrows and move routes according to your needs.

    Note

    The fallback route always runs last, no matter which position it takes in the Order routes window.

  4. Optional. Select Auto-align arranges with set order to visually arrange modules on the scenario canvas according to the set order.

  5. Click Apply.

Note

Routes are processed sequentially, not in parallel. Celonis platform won't process the second route unless it finishes processing the first one.

The fallback route

A fallback route processes data that doesn't fit the condition of all other routes. You can mark a route as a fallback if you want it to be executed last.

Note

You can set up a filter for a fallback route same as for other routes.

To set up a fallback route, follow the steps:

  1. Click the route you want to mark as a fallback. A filter window appears.

    filter_fallback.png
  2. Select Yes.

  3. Click Save.

You can recognize the fallback route by the special arrow icon on the router module:

Router_carat.png
Select a whole branch

You can manage all modules in the branch at once.

Click the route menu, then click Select whole branch. It selects all the following modules.

select_whole.png

You can copy or delete all selected modules at once.

Example 1. Example of a router with a fallback route

You need to receive a message on Slack depending on tomorrow's weather:

  • if the weather is hot, the message is wear shorts.

  • if the weather is cold, the message is wear a jacket.

  • if the weather is neither hot nor cold, the message is better stay at home.

The scenario looks like that:

scenario_routes_example.png

The scenario flow is:

  1. The Weather module gets data about tomorrow's weather.

  2. Data goes to the router that processes routes in the determined order:

    order_route.png
    1. The Hot weather route sends the message to Slack, if data fits the filter condition:

      hot_weather.png
    2. The Cold weather route sends the message to Slack, if data fist the filter condition:

      cold_weather.png
    3. The Fallback route sends the message to Slack, if data doesn't fit previous routes.

      fallback.png


Aggregator

Aggregator is a type of module designed to merge several bundles of data into a single bundle.

When an aggregator is executed, it:

  1. accumulates all the bundles it receives (during a single source module's operation)

  2. outputs a single bundle with an array containing one item per each accumulated bundle. The content of the array's items depends on particular aggregator module and its setup.

A typical example of an aggregator module is the Array aggregator module. Aggregators usually feature the following fields:

Source Module

The module from which the bundle aggregation will start. The source module is usually an iterator or a searchmodule that outputs a series of bundles. Once you setup the aggregator's Source Module (and close the aggregator's setup), the route between the source module and the aggregator will be wrapped in a grey area to visualize the start and the end of the aggregation.

Group by

The aggregator's output can be split into several groups with the help of the Group by field. The Group by field can contain a formula that is evaluated for each aggregator's input bundle. The aggregator then outputs one bundle per each distinct formula's value. Each bundle contains two items:

  • Key contains the distinct value.

  • Array contains the aggregated data from the bundles for which the formula evaluated to the Key value.

Stop processing after an empty aggregation

By default, the aggregator outputs the result of the aggregation even in case no bundles reached the aggregator (e.g. because they have been all filtered out on their way). If the Stop processing after an empty aggregation option is enabled, the aggregator will not produce any output bundle in this case and the flow will stop.

Bundles outputted from the source module and any other modules between the source module and the aggregator moduleare not outputted by the aggregatorand thus items in these bundles are not accessible by the modules in the flow after the aggregator.

If you need to access items from bundles outputted from the source module and any other modules between the source module and the aggregator module, make sure to include them in the aggregator's setup, e.g. in the Aggregated fields field in the setup of the Array aggregator module.

Use Case: Zipping all email attachments and uploading the ZIP to Dropbox

The Action Flow below shows how to:

  1. Watch a mailbox for incoming emails: Email > Watch emails trigger will output a bundle with item Attachments[], which is an array containing all the email's attachments.

  2. Iterate the email's attachments: Email > Iterate attachments iterator takes the items from the Attachments[] array one by one and sends them further as separate bundles.

  3. Aggregate the bundles outputted by the Email > Iterate attachments module: Archive > Create an archive aggregatoraccumulates all the bundles it receives and outputs a single bundle containing the ZIP file.

  4. Upload the resulting ZIP file to Dropbox: Dropbox > Upload a file obtains the ZIP file from the Archive > Create an archive module and uploads it to Dropbox.

61d59f9217027.png

Below is a sample setup of the Archive > Create an archive aggregator:

61d59f9399911.png