Skip to content
Data & Databases

Merge Contract Validator: Row Append vs Unified Record

10 nodes 49 4 Manual trigger
Download

Loading workflow…

Workflow Description

A fully local workflow that checks whether Merge in append mode satisfies the declared contract. A Manual Trigger fans out to two Code nodes producing fictional branch data (customer profiles and billing rows, one with a missing id). Two Set nodes add a source tag while keeping original fields, then Merge appends both inputs. A final Code node counts per-branch items, actual versus expected totals, detects each branch's exclusive fields and how many items actually combine them, and emits one JSON verdict report. An IF node routes the report to a suitable or not-suitable NoOp endpoint.

How it works

  1. 1.Run Manual Start, which fans out to both sample branches.
  2. 2.Code nodes emit test data: branch A has 2 customer rows, branch B has 3 billing rows including one without local_id and an empty region.
  3. 3.Set v3.4 adds source_branch with includeOtherFields:true so no field is dropped.
  4. 4.Merge (mode=append, numberInputs=2) outputs 5 independent items.
  5. 5.Verify Append Contract computes counts, exclusive field sets, combined-item count and records missing an id.
  6. 6.Contract 'row append' passes when actual count equals the sum of branches; contract 'unified record' is judged unsuitable while items stay separate.
  7. 7.IF routes the verdict to the 'Append Suitable' or 'Append Not Suitable' NoOp.

Use cases

  • Reviewing n8n flows before release to confirm the Merge mode matches design intent
  • Diagnosing 'fields lost after Merge' reports as a mode choice, not a bug
  • Teaching the difference between append and field combination
  • Regression-checking output item counts against branch totals

Requirements

  • n8n 2.48.7 with Merge 3.2, Code 2, Set 3.4, If 2.2
  • No credentials or network access needed
  • For real data, replace the two generator Code nodes with your sources using the same schema (local_id, branch fields, required_contract)
  • Merge configured as mode=append, numberInputs=2 with each branch on its own input

Setup and testing in n8n

  1. Import the JSON and click Execute Workflow.
  2. Open Verify Append Contract: actual count 5, expected append 5, shape 'independent items'.
  3. With the default 'unified record' contract the report reaches the 'Append Not Suitable' NoOp.
  4. Change required_contract to 'row append' in branch A data and rerun: verdict becomes suitable and reaches 'Append Suitable'.
  5. Edge case: empty one sample array; counts stay consistent and missing-id count still reported.
  6. Edge case: set an unknown contract value; the verdict is unsuitable with an explicit reason.

Service Value

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

Apps Used

Manual Trigger Code Set Merge If No Op

Details

Trigger Manual trigger
Nodes 10
Apps 6
Views 49
Downloads 4

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

/

Manual Start

Manual Trigger

#1

Generate Branch A Samples

Code

#2

Tag Branch A

Set

#3

Generate Branch B Samples

Code

#4

Tag Branch B

Set

#5

Merge Branches (Append)

Merge

#6

Verify Append Contract

Code

#7

Route Verdict

If

#8

Append Suitable

No Op

#9

Append Not Suitable

No Op

#10

Note Stages

Sticky Note

#11

Note Append vs Combine

Sticky Note

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