Merge Pairing Coverage Balance with Tagged Orphan Padding
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.Manual Trigger starts the batch with no external setup.
- 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.Code "Classify Pairing Coverage" splits branches, sorts by seq and classifies each row as paired, orphan_branch_a or orphan_branch_b.
- 4.IF "Is Row Paired?" routes paired rows to output 0 and orphan rows to output 1.
- 5.NoOp passes paired rows through and keeps the path valid even when empty.
- 6.Set adds padding_injected and missing_side_label to orphan rows with includeOtherFields:true.
- 7.Merge in append mode joins both paths on separate inputs.
- 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
- Import the JSON and click Execute Workflow.
- Confirm the final report returns paired_count=3, orphan_branch_a_count=2 and coverage_percent=60.
- Extend branch B to five rows in the sample node and confirm coverage_percent=100 with no orphan rows.
- Empty both sample arrays and confirm coverage_status=EMPTY_BATCH.
- 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
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 (8)
Manual Trigger
Manual Trigger
Emit Tagged Merge Append Output
Code
Classify Pairing Coverage
Code
Is Row Paired?
If
Paired Rows Pass-Through
No Op
Inject Missing Side Padding
Set
Merge Classification Reports
Merge
Build Coverage Balance Report
Code
Sticky Stage Overview
Sticky Note
Sticky Replace Sample
Sticky Note
Sticky Coverage Metric
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