Remove Duplicates
Description
Section titled “Description”The Remove Duplicates node walks through an array and discards repeated items, keeping the first occurrence of each. The comparison can be done on the whole item or on one or more specific keys.
It is equivalent to n8n’s Remove Duplicates node.
If no source is provided, the node operates on the array received in the previous node’s data. When data is not an array but contains an items or data property that is one, the node uses it automatically. If the key field is left empty, whole items are compared (serialized); if several comma-separated keys are given, two items are considered duplicates only when they match on all of them.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| source | text | No | Dot-notation path to the array within data. Empty = uses data directly. Example: items, result.rows |
| key | text | No | Field(s) to detect duplicates by (dot-notation, comma-separated). Empty = compares the whole item. Example: email, id |
Output
Section titled “Output”The node returns the deduplicated array directly (compatible with other nodes that expect an array):
[ { "id": 1, "email": "ana@example.com" }, { "id": 2, "email": "luis@example.com" }]The first occurrence of each value is always kept. If the input is not an array (and has no items/data array), the node returns an error asking you to set source or connect a node that returns an array.
Usage Examples
Section titled “Usage Examples”Remove records with a repeated email
Section titled “Remove records with a repeated email”{ "label": "Unique emails", "key": "email"}Keeps a single record per email value.
Duplicates by a combination of keys
Section titled “Duplicates by a combination of keys”{ "label": "Unique by email + country", "key": "email, country"}Two items are considered equal only if they match on both email and country.
Deduplicate an array of simple values
Section titled “Deduplicate an array of simple values”{ "label": "Unique tags", "source": "tags"}Without a key, it compares each whole item; useful for arrays of repeated strings or numbers.
- The original order is preserved: the first occurrence of each value is kept
- Keys support dot-notation to reach nested fields (e.g.
user.email) - The
sourcefield supports dynamic and cross-node variables:{{@NodeName.field}},{{#N.field}} - Does not require credentials