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 search module 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 module are not outputted by the aggregator and 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.

Example

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

The scenario 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 aggregator accumulates 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.

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

Popular use cases from our blog

automated-data-collection-crm-illustration

How to Automate Data Collection - Part 5: CRM Systems

automated-data-collection-chatbot-marketing-illustration

How to Automate Data Collection - Part 4: Chatbot Marketing

automated-data-collection-paid-ads-illustration

How to Automate Data Collection - Part 3: Paid Ads

automated-data-collection-email-illustration

How to Automate Data Collection - Part 2: Email Marketing Segmentation

personalized-customer-experience-illustration-integromat

5 Automated Solutions to Personalize Customer Experience

data-collection-automation-forms-pt-1

How to Automate Data Collection - Part 1: Online Forms

Didn’t find what you were looking for?

Expert

Find an expert

We feature a network of 450+ certified partners across the globe who are ready to help

Find an expert

Automate any workflow in your business

Sign up for a free account today. No credit card required, no time limits on free plan.