Skip to content
Data & Databases

Merge Manifest Smuggler: Branch Count Reconciliation in n8n

11 nodes 42 5 Manual trigger
Download

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. 1.Manual Trigger starts the run with an empty item.
  2. 2.Load Sample Records (Code) emits one item with a fictional record batch and the threshold.
  3. 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. 4.Route Branch A vs B (IF) sends A items to output 0 and the rest to output 1.
  5. 5.Tag Branch A / Tag Branch B (Set, includeOtherFields) add _tag_branch and _merge_input without losing fields.
  6. 6.Merge Branches (Append) joins both branches through separate merge inputs.
  7. 7.Reconcile Counts (runOnceForAllItems) splits manifests from data, reconciles counts and returns exactly one report.
  8. 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

  1. Import the JSON and click Execute Workflow.
  2. Check Emit Reconciliation Report returns one item with report_status=RECONCILED, 4 data records and 2 rejected.
  3. Edge case: set all amounts below the threshold so branch A carries no data; the run still completes and is_empty=true is reported.
  4. Failure case: drop an item or change _tag_branch in one Set branch; the run is routed to Quarantine Mismatch.
  5. 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

Manual Trigger Code If Set Merge No Op

Details

Trigger Manual trigger
Nodes 11
Apps 6
Views 42
Downloads 5

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 (11)

/

Manual Trigger

Manual Trigger

#1

Load Sample Records

Code

#2

Build Branches And Manifests

Code

#3

Route Branch A vs B

If

#4

Tag Branch A

Set

#5

Tag Branch B

Set

#6

Merge Branches (Append)

Merge

#7

Reconcile Counts

Code

#8

Counts Match?

If

#9

Emit Reconciliation Report

Set

#10

Quarantine Mismatch

No Op

#11

Note Stage 1

Sticky Note

#12

Note Stage 2

Sticky Note

#13

Note Stage 3

Sticky Note

#14
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