Skip to main content

Aggregate

An Aggregate node combines every data item it receives in a run into one data item. Use it to write one report from the rows a Transform node produced, to send one summary email for a run instead of one email per item, or to collect the results of many Agent Compute commands into one data item.

Aggregate accepts only data items, because it combines JSON objects into one object. To aggregate the contents of files, place a Transform node before it, which parses each file and passes its contents on as data.

Settings

The node has no settings of its own beyond Error Handling and Return From Automation.

What the Next Node Receives

The next node receives one data item whose items field is a list of every object the node received, in the order it received them. A Transform node after it reads the list as payload.items, so payload.items map (r) -> { order: r.order_id, total: r.amount } reshapes every row, and the same Transform node with a destination and an output csv directive writes the combined rows as one CSV file. A Send Email node after Aggregate sends one email for the run, because it receives one item.

Errors

Connecting a node that produces file items to Aggregate fails at save rather than at run time, because the node accepts only data items. Error Handling rules on the node determine what happens to an item that fails.

Join and Zip also combine many items into one.

Aggregate vs. Join

Join matches the items from two paths by key and passes on one item per matched pair. Aggregate combines the items of one path into one item without matching. Use Join to pair items that belong together. Use Aggregate to combine every item on a path into one object.

Aggregate vs. Zip

Zip combines the files in a run into one archive and passes on the archive as a file. Aggregate combines data items into one data item. Use Zip to deliver many files as one attachment or download. Use Aggregate to build one report from many data items, and follow it with a Transform node with a destination to write that report as a file.