Deduplicate leads
Normalize email addresses and keep the first record for each address.
Original starter · no credentials · manual execution
The sample transformation is tested against the output below. Import and execution in your specific n8n version still need verification.
When to use it
Start with a small lead list before connecting a CRM or form source.
What is in the workflow?
- Manual Trigger: start a test deliberately.
- Sample data: synthetic rows in a Code node.
- Deduplicate leads: a Code node with the transformation.
- Read first: a Sticky Note with setup and limitations.
Sample input
[
{
"email": " ALEX@example.com ",
"name": "Alex"
},
{
"email": "alex@example.com",
"name": "Alex duplicate"
},
{
"email": "sam@example.com",
"name": "Sam"
}
]Expected output
Two unique leads, with trimmed lowercase email addresses.
[
{
"email": "alex@example.com",
"name": "Alex"
},
{
"email": "sam@example.com",
"name": "Sam"
}
]Import and adapt
- Download the JSON and use Import from File in your n8n editor.
- Review the Code nodes, then execute manually with the included sample.
- Compare the final output to the example above.
- Replace Sample data with your own source only after reviewing the input contract.
Before using real data
The first row wins. This does not validate email ownership or merge conflicting customer fields.
This template does not send messages or contact external services. Adding a source or destination changes its behavior; test the complete workflow in your instance.