Skip to content
AI Agents

Filter Previously Processed Items with a Supplied ID Ledger and Output the Updated Ledger

9 nodes 112 0 Manual trigger

Loading workflow…

Get this workflow

Workflow price
1.00 USD
PayPal surcharge · 7.5%
0.08 USD
Total
1.08 USD

One-time payment. Download and copy become available after payment is confirmed.

Diagram preview only; executable configuration is available after purchase.

Workflow Description

The workflow reads an items batch and a processed_ids ledger from input, normalizes IDs by trimming and lowercasing, and classifies each item as new, seen_before, duplicate_in_batch, or invalid_id. An IF node separates new from excluded items, a Merge combines both routes, and a Code node builds one report with counts per reason, new and excluded lists, and an updated ledger trimmed to the last N IDs. Nothing is persisted; you store the ledger yourself.

How it works

  1. 1.Manual Trigger starts the run
  2. 2.Code node emits a fictional batch and ledger
  3. 3.Set node defines id_field and max_ledger_size
  4. 4.Classify node normalizes IDs and tags each item
  5. 5.IF routes new items to accepted, others to excluded
  6. 6.Merge appends both routes
  7. 7.Code node builds one report and the trimmed processed_ids

Use cases

  • Prevent duplicate messages across repeated runs
  • Clean overlapping order batches before processing
  • Inspect and bound the dedup history size

Requirements

  • JSON input containing items and processed_ids
  • Set id_field and max_ledger_size in Dedup Settings
  • Persist the output ledger between runs outside this workflow

Setup and testing in n8n

  1. Import the JSON into n8n
  2. Run manually and verify new_count=3 and excluded_count=3
  3. Check processed_ids holds only 5 IDs
  4. Set items to an empty array and confirm zero counts with the old ledger
  5. Change max_ledger_size to 2 and verify trimming

Service Value

Ready-made workflow template for automation delivery and service execution.

Apps Used

Manual Trigger Code Set If Merge

Details

Trigger Manual trigger
Nodes 9
Apps 5
Views 112
Downloads 0

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 (9)

/

Manual Trigger

Manual Trigger

#1

Sample Batch and Ledger

Code

#2

Dedup Settings

Set

#3

Classify Items

Code

#4

Is New Item?

If

#5

Tag Accepted

Set

#6

Tag Excluded

Set

#7

Combine Routes

Merge

#8

Build Report and Ledger

Code

#9

Note Input

Sticky Note

#10

Note Classify

Sticky Note

#11

Note Output

Sticky Note

#12
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