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

The Router module allows you to branch your flow into several routes and process the data within each route differently. Once a Router receives a bundle, it forwards it to each connected route in the order the routes were attached to the Router.

Tip

To verify the order of the routes, you can click the auto-align icon auto_align_icon.png, which will arrange the routes according to the order from top to bottom.

To change the order, just remove the Router module and re-connect the routes in the desired order.

Note

Routes are processed sequentially, not in parallel. A bundle is not sent to the next route until it has been completely processed by the previous route.

Template

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

Adding a router to a Action Flow

A Router can be added to a Action Flow in one of the following ways:

  1. If you wish to connect the Router after a module, click on the module's right "ear" and choose Flow Control - Router from the list of modules.

    Adding_a_router_1.png
    Adding_a_router_2.png
  2. If you wish to insert the Router between two modules, click on the wrench icon below the route connecting the two modules (or right-click the route) and choose "Add a router" from the menu.

    Adding_a_router_3.png
  3. A Router can also be inserted automatically in the case when you try to connect module A to module B to which another module is already connected. Just drag the left "ear" of the module A and drop it on to module B.

    Adding_a_router_4.png
Filters

You can place a filter on a route after the Router to filter bundles as on any other route: just click on the route, add conditions and click on the "OK" button to save the filter setup:

Adding_filter_to_router.png
The fallback route

The filter setup on a route after a Router contains a special option: The fallback route:

Fallback_router.png

When enabled, this route is used in the case when a bundle cannot continue on from the Router via any other route because the filters on the other routes filtered it out. The Fallback route is distinguished with a different arrow sign inside the Router module:

Router_carat.png
If/Else

A typical use case of the fallback route is to continue the flow with route A if the condition is met and with route B if it is not. This can be achieved with the following steps:

  1. Insert a Router in your Action Flow.

  2. Connect both routes (A and B) to the Router.

  3. Click on the route A and specify a condition:

    If_else.png
  4. Click on the route B and enable The fallback route option:

    Fallback_router.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