← All workflowsData transformation · Free template

Normalize and deduplicate leads in n8n

Clean a batch of leads, normalize email addresses, remove duplicates, and report invalid records using built-in n8n nodes.

Explore the workflow

Scroll to pan. Select a node to inspect its configuration.

100%
Run ManuallymanualTriggerExample Lead InputsetNormalize and Dedupli…code
Download workflow JSON

Import into n8n, configure your own services, and test before activation.

Version
1.0.0
Services
n8n built-in nodes
Credentials
None required
n8n version tested
Version not recorded; see validation notes

Clean a supplied list of lead records before handing it to another workflow. This template trims names and companies, lowercases email addresses, keeps the first record for each email, and reports records with missing or invalid email formats.

Workflow

Manual trigger → Example Lead Input → Normalize and Deduplicate.

The example uses fictional contacts. This workflow processes data inside n8n; it does not send messages, call a CRM, or save leads to an external service.

Requirements

  • Built-in n8n Manual Trigger, Edit Fields, and Code nodes.
  • No credentials, paid services, or community nodes required.
  • n8n version: the source and cleaned graph were executed on the owner's instance; its exact version was not recorded.

Setup

  1. Import workflow.json into n8n.
  2. Run the manual trigger with the included example.
  3. Inspect leads, summary, and rejected in the final node's output.
  4. Replace Example Lead Input with your own source when ready. The preceding node must supply a leads array on one input item. For multiple incoming n8n items, aggregate them into that array first.
  5. Connect the final output to your own next step. This starter template contains no external write step.

Input and output

Each lead may contain name, email, and company. Email is required for acceptance. Names and companies are optional; missing values become empty strings. Extra input fields are dropped intentionally.

{"leads":[{"name":" Ada Example ","email":" ADA@example.com ","company":" Example Co "},{"name":"Ada Duplicate","email":"ada@example.com"},{"name":"Ben Example","email":"ben@example.org"},{"email":"not-an-email"}]}

The included four-record example produces two accepted leads, one removed duplicate, and one rejected record. Accepted email addresses are ada@example.com and ben@example.org. Rejections contain the zero-based input index and reason.

Limits and failure behavior

  • Email checks validate a basic format; they do not verify deliverability or ownership.
  • Duplicate detection is case-insensitive after trimming and applies to this input batch only.
  • The first record wins. Later records do not enrich or overwrite it.
  • A missing or non-array leads field fails with Expected a leads array.
  • An empty array returns an empty result and zero counts.
  • Use manageable input batches; this template performs in-memory processing.

Validation record

  • n8n node and SDK graph validation: passed.
  • Source execution in n8n with the included synthetic example: passed.
  • Clean JSON parsed, stripped of instance metadata, and reviewed: passed; examples are fictional and no credentials are assigned.
  • Clean JSON graph recreated through the SDK in a temporary n8n workflow: passed; node parameters, versions, names, and connections matched the source.
  • Execution of that recreated graph in n8n: passed with the same synthetic result. The temporary check was archived.
  • Local behavior checks for empty input, invalid records, and missing input: passed.
  • Native editor import by an independent user: not separately tested. Exact n8n version compatibility is unrecorded.

See it in action