Merge Manifest Smuggler: Branch Count Reconciliation in n8n
Loading workflow…
Workflow Description
A self-contained template that protects multi-branch merges from silent emptiness. A Code node validates each record (id, customer, numeric amount), rejects invalid ones, routes valid records into two branches by an amount threshold and builds one manifest item per branch holding the expected count. Both manifests travel inside branch A, so that merge input is never empty. After an append Merge, a Code node separates manifests from data, reconciles expected versus arrived counts per branch, verifies the _branch tag and returns a single reconciliation report. An IF node forwards compliant reports and quarantines any difference in a NoOp path.
How it works
- 1.Manual Trigger starts the run with an empty item.
- 2.Load Sample Records (Code) emits one item with a fictional record batch and the threshold.
- 3.Build Branches And Manifests validates records, rejects invalid ones, routes amount >= threshold to branch A and the rest to branch B, and creates two manifest items tagged _branch=A.
- 4.Route Branch A vs B (IF) sends A items to output 0 and the rest to output 1.
- 5.Tag Branch A / Tag Branch B (Set, includeOtherFields) add _tag_branch and _merge_input without losing fields.
- 6.Merge Branches (Append) joins both branches through separate merge inputs.
- 7.Reconcile Counts (runOnceForAllItems) splits manifests from data, reconciles counts and returns exactly one report.
- 8.Counts Match? (IF) routes compliant=true to Emit Reconciliation Report, everything else to Quarantine Mismatch.
Use cases
- Prove no items are lost when merging IF branches in n8n
- Per-branch item counts before and after the merge
- Keeping partial results out of the final report
- Threshold-based routing with validation of incoming records
Requirements
- n8n whose node types match 2.46.4
- No credentials and no external calls needed
- Replace Load Sample Records with your real source using {records:[{record_id,customer,amount}]}
- Keep one dedicated Merge input per branch
Setup and testing in n8n
- Import the JSON and click Execute Workflow.
- Check Emit Reconciliation Report returns one item with report_status=RECONCILED, 4 data records and 2 rejected.
- Edge case: set all amounts below the threshold so branch A carries no data; the run still completes and is_empty=true is reported.
- Failure case: drop an item or change _tag_branch in one Set branch; the run is routed to Quarantine Mismatch.
- Try an empty records array to confirm the report stays consistent.
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 (11)
Manual Trigger
Manual Trigger
Load Sample Records
Code
Build Branches And Manifests
Code
Route Branch A vs B
If
Tag Branch A
Set
Tag Branch B
Set
Merge Branches (Append)
Merge
Reconcile Counts
Code
Counts Match?
If
Emit Reconciliation Report
Set
Quarantine Mismatch
No Op
Note Stage 1
Sticky Note
Note Stage 2
Sticky Note
Note Stage 3
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