Merge Index Integrity Stamp: Self-Verifying Branch Tags Before Append Merge
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.Manual Trigger fires with one empty item
- 2.Generate Sample Records emits 6 fictional records including a duplicate seq and an unknown branch X
- 3.Route Branch A vs B sends branch='A' to true, everything else to false
- 4.Stamp Branch A / Stamp Branch B add branch_tag and source_index with includeOtherFields:true
- 5.Merge Stamped Branches appends both branches on separate inputs
- 6.Verify Index Integrity checks tags, duplicate indexes and tag/origin mismatch
- 7.Index OK? routes clean items to Verified Items, flawed ones to Quarantined Items
- 8.Merge Verification Paths rejoins both NoOp paths on distinct inputs
- 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
- Import the JSON and click Execute Workflow
- Inspect Build Integrity Report: one item with total_merged=6 and integrity_ok=false
- Check quarantined: R2,R3 for duplicate A-2; R4,R6 for duplicate B-1 plus origin mismatch
- Happy path: make every seq unique and remove record X; integrity_ok becomes true
- Miswiring test: connect both If outputs to the same merge input and watch by_branch_tag and branch_count_match break
- 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
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 (12)
Manual Trigger
Manual Trigger
Generate Sample Records
Code
Route Branch A vs B
If
Stamp Branch A
Set
Stamp Branch B
Set
Merge Stamped Branches
Merge
Verify Index Integrity
Code
Index OK?
If
Verified Items
No Op
Quarantined Items
No Op
Merge Verification Paths
Merge
Build Integrity Report
Code
Note Stages
Sticky Note
Note Verification
Sticky Note
Note Report & Setup
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