Skip to content
Data & Databases

Key Alias Unifier: Recursive Resolver with Canonical Field

8 nodes 41 5 Manual trigger
Download

Loading workflow…

Workflow Description

A self-contained workflow starting from a manual trigger with three fictional records whose key names and nesting depths differ. A Code node runs a recursive depth-first search for the first match from an editable alias constant (amount_2023, amount_2024, total_amount), returning the value and full path. A Set node creates canonical_amount while keeping all other fields; an IF node separates resolved records from missing ones, where the misleading null canonical is removed and status set to missing_alias; a Merge node returns every record, count matching input, each with a status label.

How it works

  1. 1.Run the manual trigger to emit the three fictional sample records
  2. 2.Recursive search finds the first alias at any depth, returning value, matched_alias, found_path and resolved
  3. 3.A Set node creates canonical_amount with includeOtherFields enabled
  4. 4.An IF node routes records by the resolved flag
  5. 5.Resolved records tagged 'resolved'; missing records have the misleading canonical removed and tagged 'missing_alias'
  6. 6.Merge append recombines both branches so output count equals input count with per-record status

Use cases

  • Unifying amount fields that change names across yearly exports
  • Extracting a value nested in arrays and objects at any depth
  • Isolating records missing every alias for review without misleading values

Requirements

  • No credentials; fully self-contained
  • To change aliases: edit only the ALIASES constant in the Code node
  • For real input: replace the sample node with a source of the same shape

Setup and testing in n8n

  1. Import the JSON into n8n and open the workflow
  2. Run 'Manual Trigger' and verify exactly three output records
  3. Check R-001 and R-002 carry canonical_amount, found_path and status=resolved
  4. Check R-003 has no canonical_amount and status=missing_alias
  5. Add a new alias such as price to ALIASES and rerun to confirm R-003 resolves

Service Value

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

Apps Used

Manual Trigger Code Set If Merge

Details

Trigger Manual trigger
Nodes 8
Apps 5
Views 41
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 (8)

Manual Trigger

Manual Trigger

#1

Sample Records (Fictional)

Code

#2

Resolve Aliases (Recursive DFS)

Code

#3

Build Canonical Field

Set

#4

Resolved?

If

#5

Tag Resolved

Set

#6

Tag Missing (Drop Canonical)

Code

#7

Merge All Records

Merge

#8

Aliases & Setup Guide

Sticky Note

#9

Pipeline Stages

Sticky Note

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