Skip to content
Data & Databases

Merge Index Integrity Stamp: Self-Verifying Branch Tags Before Append Merge

12 nodes 77 11 Manual trigger
Download

Loading workflow…

Workflow Description

A fully local template that generates six demo records, routes them through an If node into two branches, and stamps every item with an explicit branch_tag and source_index via Set so the index evidence travels inside the data before it reaches the Merge node. After an append merge on two independent inputs, a Code node verifies each item: known tag, present and non-duplicated source index, and tag matching its origin branch. An If node splits clean from flawed items into two NoOp paths, which are rejoined and aggregated by a final Code node into exactly one integrity report balancing per-branch counts before and after the merge.

How it works

  1. 1.Manual Trigger fires with one empty item
  2. 2.Generate Sample Records emits 6 fictional records including a duplicate seq and an unknown branch X
  3. 3.Route Branch A vs B sends branch='A' to true, everything else to false
  4. 4.Stamp Branch A / Stamp Branch B add branch_tag and source_index with includeOtherFields:true
  5. 5.Merge Stamped Branches appends both branches on separate inputs
  6. 6.Verify Index Integrity checks tags, duplicate indexes and tag/origin mismatch
  7. 7.Index OK? routes clean items to Verified Items, flawed ones to Quarantined Items
  8. 8.Merge Verification Paths rejoins both NoOp paths on distinct inputs
  9. 9.Build Integrity Report returns a single aggregated report item

Use cases

  • Prove each merged item belongs to its real branch without relying on input order
  • Detect both If outputs wired into the same merge input
  • Catch duplicate index keys before writing to a target system
  • Quarantine malformed records instead of letting them leak downstream

Requirements

  • n8n 2.47.x with manualTrigger, code, set, if, merge, noOp, stickyNote node types
  • No credentials needed — fully local execution
  • Each branch wired to its own Merge input index
  • Replace the sample Code node with your real source using the same schema

Setup and testing in n8n

  1. Import the JSON and click Execute Workflow
  2. Inspect Build Integrity Report: one item with total_merged=6 and integrity_ok=false
  3. Check quarantined: R2,R3 for duplicate A-2; R4,R6 for duplicate B-1 plus origin mismatch
  4. Happy path: make every seq unique and remove record X; integrity_ok becomes true
  5. Miswiring test: connect both If outputs to the same merge input and watch by_branch_tag and branch_count_match break
  6. Edge case: return an empty array from the sample node and confirm the empty_merge_input path

Service Value

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

Apps Used

Manual Trigger Code If Set Merge No Op

Details

Trigger Manual trigger
Nodes 12
Apps 6
Views 77
Downloads 11

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

/

Manual Trigger

Manual Trigger

#1

Generate Sample Records

Code

#2

Route Branch A vs B

If

#3

Stamp Branch A

Set

#4

Stamp Branch B

Set

#5

Merge Stamped Branches

Merge

#6

Verify Index Integrity

Code

#7

Index OK?

If

#8

Verified Items

No Op

#9

Quarantined Items

No Op

#10

Merge Verification Paths

Merge

#11

Build Integrity Report

Code

#12

Note Stages

Sticky Note

#13

Note Verification

Sticky Note

#14

Note Report & Setup

Sticky Note

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