Skip to content
AI Agents

Dry-Run Duplicate Removal Preview Keeping the Most Complete Record

8 nodes 66 8 Manual trigger
Download

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. 1.Run Manual Trigger
  2. 2.Emit six fictional records, or one _empty_batch marker item if the list is empty
  3. 3.Add _keyField and _importantFields to each item
  4. 4.Score, group and assign keep/drop/invalid_key with reasons
  5. 5.Split keep vs others with IF
  6. 6.Append both branches with Merge
  7. 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

  1. Import the JSON into n8n
  2. Run manually and inspect the last node output
  3. Confirm C-100 keeps index 1 and drops index 0
  4. Confirm C-200 keeps index 2 and drops index 3 on a tie at score 3
  5. Confirm index 4 with an empty key is invalid_key with score 3
  6. 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

Manual Trigger Code Set If Merge No Op

Details

Trigger Manual trigger
Nodes 8
Apps 6
Views 66
Downloads 8

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (8)

Manual Trigger

Manual Trigger

#1

Sample Customer Records

Code

#2

Set Key and Important Fields

Set

#3

Score Groups and Decide

Code

#4

Is Keep Decision?

If

#5

Merge Kept and Candidates

Merge

#6

Build Dry-Run Report

Code

#7

Report Ready (No Deletion)

No Op

#8

Note: Setup

Sticky Note

#9

Note: Selection Rule

Sticky Note

#10
Stay in the loop

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

Be first to discover what is new

Your name, your email, and one confirmation.

Email confirmation · Unsubscribe anytime