Skip to content
Data & Databases

Merge Pairing Coverage Balance with Tagged Orphan Padding

8 nodes 51 2 Manual trigger
Download

Loading workflow…

Workflow Description

A self-contained template that measures pairing coverage after a Merge(append). A Code node emits tagged demo data (branch A with five rows, branch B with three) simulating the merge output. A classifier Code node splits the branches, aligns rows by index and labels each row as paired or orphaned on one side, while flagging missing identifiers and amount mismatches. An IF node separates paired from orphan rows, a Set node injects a tagged missing-side padding marker without dropping original data, Merge(append) recombines both report paths, and a final Code node emits one report with branch counts, orphan counts and coverage percentage.

How it works

  1. 1.Manual Trigger starts the batch with no external setup.
  2. 2.Code "Emit Tagged Merge Append Output" emits 8 tagged items (5 for branch A, 3 for branch B including one record with a missing id).
  3. 3.Code "Classify Pairing Coverage" splits branches, sorts by seq and classifies each row as paired, orphan_branch_a or orphan_branch_b.
  4. 4.IF "Is Row Paired?" routes paired rows to output 0 and orphan rows to output 1.
  5. 5.NoOp passes paired rows through and keeps the path valid even when empty.
  6. 6.Set adds padding_injected and missing_side_label to orphan rows with includeOtherFields:true.
  7. 7.Merge in append mode joins both paths on separate inputs.
  8. 8.Final Code node (runOnceForAllItems) emits exactly one coverage report item.

Use cases

  • Detecting partial Merge results in multi-run batch flows
  • Reconciling orders against payments with unequal branch lengths
  • Documenting orphan rows before a seemingly complete report is forwarded
  • Batch quality audit: missing identifiers and amount mismatches

Requirements

  • n8n 2.45.7 or newer
  • No credentials and no outbound calls required
  • For real data: tag each item with branch, seq and record before the classifier node

Setup and testing in n8n

  1. Import the JSON and click Execute Workflow.
  2. Confirm the final report returns paired_count=3, orphan_branch_a_count=2 and coverage_percent=60.
  3. Extend branch B to five rows in the sample node and confirm coverage_percent=100 with no orphan rows.
  4. Empty both sample arrays and confirm coverage_status=EMPTY_BATCH.
  5. Add an item with an unknown branch tag and confirm it is counted in ignored_untagged without errors.

Service Value

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

Apps Used

Manual Trigger Code If No Op Set Merge

Details

Trigger Manual trigger
Nodes 8
Apps 6
Views 51
Downloads 2

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

Emit Tagged Merge Append Output

Code

#2

Classify Pairing Coverage

Code

#3

Is Row Paired?

If

#4

Paired Rows Pass-Through

No Op

#5

Inject Missing Side Padding

Set

#6

Merge Classification Reports

Merge

#7

Build Coverage Balance Report

Code

#8

Sticky Stage Overview

Sticky Note

#9

Sticky Replace Sample

Sticky Note

#10

Sticky Coverage Metric

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