Skip to content
Data & Databases

Split Append Output Into Homogeneous Schema Families

11 nodes 22 2 Manual trigger
Download

Loading workflow…

Workflow Description

A self-contained template showing that Merge in append mode keeps branch items separate without unifying their schemas. Two Code branches emit fixed tagged sample items, then a Code node computes a deterministic signature per item from sorted field names plus a refined value type that distinguishes null, array and object from string, number and boolean. Items are grouped into families with size, contributing branches and item indexes, and the template verifies that family sizes sum to the merged item count. An If node routes to homogeneous for one signature or multi-schema for more, a final Code node emits one JSON report and NoOp ends the path.

How it works

  1. 1.Manual Trigger fires two Code branches that emit fixed sample items and add _branch and _sourceIndex tags.
  2. 2.Merge 3.2 in append mode collects both branches through separate inputs without merging fields.
  3. 3.Analyze Schema Families computes each item signature from sorted fields and types and groups them into families.
  4. 4.If compares signatureCount to 1 and routes to homogeneous or multi-schema.
  5. 5.Two Set nodes with includeOtherFields add classification and isHomogeneous while keeping the report payload.
  6. 6.A second Merge joins both routes, then a runOnceForAllItems Code node emits a single report item to NoOp.

Use cases

  • Detect schema heterogeneity before sending append output to a node expecting fixed fields
  • Inventory which branches contribute each data shape in one execution
  • Diagnose missing-field or null-value errors in downstream stages
  • Review data quality of multi-source inputs

Requirements

  • n8n 2.48.7 or compatible with Merge 3.2 and Code 2
  • No credentials needed: execution is fully local
  • Replace the two demo Code nodes with your sources, keeping the _branch tag and a separate Merge input per branch
  • Local decision: keep the EXCLUDE_TRACKING=true constant in the analyzer or set it to false

Setup and testing in n8n

  1. Import the JSON into n8n and click Execute Workflow.
  2. Verify Report Ready shows totalItems=4, signatureCount=3, multi-schema classification and countsPreserved=true.
  3. Change Branch B to emit the same fields and types as Branch A and confirm a homogeneous single-signature result.
  4. Remove _branch from one record and confirm unknown appears in branchesSeen without failure.
  5. Add two records with identical fields but different _sourceIndex and confirm they land in the same family.

Service Value

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

Apps Used

Manual Trigger Code Merge If Set No Op

Details

Trigger Manual trigger
Nodes 11
Apps 6
Views 22
Downloads 2

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

Branch A Items

Code

#2

Branch B Items

Code

#3

Merge Append Branches

Merge

#4

Analyze Schema Families

Code

#5

If Single Signature

If

#6

Tag Homogeneous

Set

#7

Tag Multi Schema

Set

#8

Merge Report Branches

Merge

#9

Build Final Report

Code

#10

Report Ready

No Op

#11

Note Inputs

Sticky Note

#12

Note Analysis

Sticky Note

#13

Note Routing

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