Skip to content

Remove Duplicates

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.

ParameterTypeRequiredDescription
sourcetextNoDot-notation path to the array within data. Empty = uses data directly. Example: items, result.rows
keytextNoField(s) to detect duplicates by (dot-notation, comma-separated). Empty = compares the whole item. Example: email, id

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.

{
"label": "Unique emails",
"key": "email"
}

Keeps a single record per email value.

{
"label": "Unique by email + country",
"key": "email, country"
}

Two items are considered equal only if they match on both email and country.

{
"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 source field supports dynamic and cross-node variables: {{@NodeName.field}}, {{#N.field}}
  • Does not require credentials