Dry-Run Duplicate Removal Preview Keeping the Most Complete Record
Loading workflow…
Workflow Description
A preview workflow that deletes nothing. A Set node defines the key field and important fields. A Code node groups records by key and scores each by its count of non-empty important fields. It keeps the highest score (earliest on ties) and marks the others drop with original index, score and reason. Records missing the key become invalid_key and are never grouped. An IF splits keep from the rest, Merge appends both, and a final Code node builds one reconciled report. Empty batches yield a zero report.
How it works
- 1.Run Manual Trigger
- 2.Emit six fictional records, or one _empty_batch marker item if the list is empty
- 3.Add _keyField and _importantFields to each item
- 4.Score, group and assign keep/drop/invalid_key with reasons
- 5.Split keep vs others with IF
- 6.Append both branches with Merge
- 7.Build one report sorted by original index
Use cases
- Review customer lists before real deletion
- Clean asset records while preserving the fullest copy
Requirements
- No credentials needed
- Edit key field and important fields in the Set node
Setup and testing in n8n
- Import the JSON into n8n
- Run manually and inspect the last node output
- Confirm C-100 keeps index 1 and drops index 0
- Confirm C-200 keeps index 2 and drops index 3 on a tie at score 3
- Confirm index 4 with an empty key is invalid_key with score 3
- Set records = [] in the sample node and run: expect one report with empty_batch=true, all counts 0 and reconciled=true
Service Value
Ready-made workflow template for automation delivery and service execution.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (8)
Manual Trigger
Manual Trigger
Sample Customer Records
Code
Set Key and Important Fields
Set
Score Groups and Decide
Code
Is Keep Decision?
If
Merge Kept and Candidates
Merge
Build Dry-Run Report
Code
Report Ready (No Deletion)
No Op
Note: Setup
Sticky Note
Note: Selection Rule
Sticky Note
Fresh workflows, straight to your inbox
Get newly published DROPIDEA workflows, a clear overview of what they do, and a link to explore them.
- New workflows
- Clear overviews
- Setup guides