Skip to content
AI Agents

Merge Rewritten Field Back Into Originals With Drift Detection

9 nodes 47 3 Manual trigger
Download

Read the execution path horizontally, with supporting AI nodes below. Layout changes affect this preview only; the download stays unchanged.

Loading workflow…

Workflow Description

Takes originals and rewritten arrays and matches them by an id field using a Map. Copies only the target field into each original, then compares other fields present in the rewrite with the original and flags differences as drift. Flags originals without a rewrite, rewrites without an original, and missing or duplicate ids. An IF node separates clean records from issues, and one final report lists counts, merged records including drifted ones, and a reason per case. Empty batches yield a zero-count report.

How it works

  1. 1.Emit Sample Batch outputs a fictional batch
  2. 2.Configure Field Names sets id_field and target_field
  3. 3.Match And Merge Target Field matches by id, copies the target field, detects drift and always emits a batch_info item
  4. 4.Has Issue? routes items by has_issue
  5. 5.Combine Routes appends both branches
  6. 6.Build Final Report returns one report with counts, clean_records, merged_records and issues

Use cases

  • Restoring AI-rewritten product descriptions into full records
  • Auditing rewrite outputs for unrequested changes

Requirements

  • One JSON item with originals and rewritten arrays
  • Id field and target field names set in the Set node
  • No credentials needed

Setup and testing in n8n

  1. Import the workflow and run it manually
  2. Check A1 is clean, A2 is drift on price with its merged record, A3 and X9 are unmatched, and the id-less rewrite is invalid
  3. Empty both arrays and confirm a zero-count report
  4. Duplicate an id or remove the target field from a rewrite and confirm it is invalid

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 47
Downloads 3

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

Emit Sample Batch

Code

#2

Configure Field Names

Set

#3

Match And Merge Target Field

Code

#4

Has Issue?

If

#5

Tag Issue Route

Set

#6

Tag Clean Route

Set

#7

Combine Routes

Merge

#8

Build Final Report

Code

#9

Note Setup

Sticky Note

#10

Note Logic

Sticky Note

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