Classification Index Tally Reconciliation Across Merge Branches
Loading workflow…
Workflow Description
A self-contained workflow that explodes sub-arrays in one code branch (promoting each array key to a classification column), computes a per-value source tally in a second branch, appends both branches in a merge node with an independent input per branch, then builds an inverted index and reconciles each category's post-merge count against its source count. An IF node separates balanced from deviated categories, a NoOp marks the drift checkpoint, and a final code node emits one report with the index sorted descending by size.
How it works
- 1.Run the manual trigger to emit fictional records with two sub-arrays plus one invalid record
- 2.Branch A cross-product explodes arrays, promoting each key to a column, and drops one row to simulate silent loss
- 3.Branch B counts, per category value, how many source records contain it as the reference tally
- 4.An append merge collects both branches, each on its own input
- 5.A code node builds the inverted index and balances each value count against the reference
- 6.IF routes drift=0 items to the report and deviated items through the NoOp drift checkpoint
- 7.Report branches are joined and one final item is emitted: sorted index, reconciliation, drift report, overall status
Use cases
- Auditing silent row loss when exploding arrays across multiple merged branches
- Building a trustworthy sortable classification index before committing results
- Screening invalid records before decomposition
Requirements
- n8n 2.44.6 with code, merge, if, noOp, stickyNote and manualTrigger nodes
- No credentials needed; fictional test payload is embedded
- To use real data, replace the sample Code node with a real source using schema {record_id, <categoryKey>: string[]}
Setup and testing in n8n
- Import the JSON into n8n and execute 'Run Demo'
- Verify the final report shows channel/phone with drift -1 (R-003 row lost)
- Test the healthy path by removing the simulation line in Branch A so status becomes balanced
- Test edge cases with empty records or missing record_id; they appear in invalid_records
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 (10)
Run Demo
Manual Trigger
Emit Sample Records
Code
Explode Subarrays (Branch A)
Code
Tally Source Counts (Branch B)
Code
Append Branches
Merge
Reconcile Index vs Source
Code
Balanced?
If
Drift Report Checkpoint
No Op
Join Report Branches
Merge
Final Sorted Index Report
Code
Note: Setup
Sticky Note
Note: Reconciliation Rule
Sticky Note
Note: Outputs
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