节点 / builtin / datatransformation
Aggregate
Fold many items into a single item
此内容尚不支持你的语言。
Fold many items into a single item, so the next step runs once for the whole list.
What it does
Section titled “What it does”Aggregate waits for the whole list of incoming items and returns one item. It is the opposite of Split Out: splitting a field out and aggregating it back gives you the original list.
It has two modes:
- Individual fields collects one or more fields from every item into lists. Items
[{ price: 3 }, { price: 5 }]aggregated onpricegive the single item{ price: [3, 5] }. - All item data puts every incoming item, whole, into one list under a field you name (
databy default).
Only a field that is truly absent counts as missing. A field that is present but null is collected as a real value.
When to use it
Section titled “When to use it”- Send one summary message about a scraped list instead of one message per row.
- Give a full set of results to an AI model in a single prompt.
- Turn “many rows with one value” back into “one row with many values” after a Split Out or a Loop.
- To join two separate branches on matching keys, use Merge instead. Aggregate folds a single input down.
Inputs and settings
Section titled “Inputs and settings”| 设置项 | 类型 | 作用 |
|---|---|---|
| Mode | Choice | Collect chosen fields into arrays, or wrap every item into one field. Options: Individual fields, All item data. 默认值:Individual fields |
| Fields To Aggregate | List of entries | Fields to collect into arrays. |
| Fields To Aggregate (each entry) › Field (必填) | Text | Field to collect. Use dots for nested fields, e.g. user.profile.name. |
| Fields To Aggregate (each entry) › Output field name | Text | Name for the resulting array. Defaults to the field being collected. |
| Put Output In Field | Text | Name of the field holding every input item. 默认值:data |
| Keep Missing Values | Toggle | Include an empty entry for items that lack the field. 默认值:Off |
- Fields To Aggregate and Keep Missing Values apply to Individual fields. Put Output In Field applies to All item data.
- When you leave Output field name empty for a nested field, the list is named after the last part of the path:
user.profile.namebecomesname. - With Keep Missing Values off, items without the field are skipped, so that list is shorter. Turn it on to add
nullfor them, which keeps the lists of several fields lined up position by position.
Outputs
Section titled “Outputs”-
Output
Always one item. In Individual fields mode it has one list per collected field, for example { titles: [...], urls: [...] }. In All item data mode it has one field holding the list of every input item. Read a list downstream with an expression such as {{ $input.titles }}.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”- HTML Extract returns one item per article on a news page, each with
titleandurl. - Aggregate, in Individual fields mode, collects
title(output nametitles) andurl(output nameurls). - A Text Formatter or a Slack node uses
{{ $input.titles }}to post all headlines in a single message.
Common issues
Section titled “Common issues”- “No fields to aggregate. Add at least one field, or use “All item data”.“ Individual fields mode has no field filled in. Add a field, or switch Mode.
- “No source node is connected to this node.” Connect a node that produces items to the input.
- One list is shorter than the others. Some items lack that field and were skipped. Turn on Keep Missing Values.
- The output looks like the input, wrapped once. The previous node sent a single object, not a list. Aggregate has nothing to fold; check that the earlier node returns several items.
Related nodes
Section titled “Related nodes”- Split Out: the opposite, one item per list entry.
- Merge: join two branches on matching keys.
- Remove Duplicates: clean the list before folding it.
- Sort: order items before you collect them.