Key Alias Unifier: Recursive Resolver with Canonical Field
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.Run the manual trigger to emit the three fictional sample records
- 2.Recursive search finds the first alias at any depth, returning value, matched_alias, found_path and resolved
- 3.A Set node creates canonical_amount with includeOtherFields enabled
- 4.An IF node routes records by the resolved flag
- 5.Resolved records tagged 'resolved'; missing records have the misleading canonical removed and tagged 'missing_alias'
- 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
- Import the JSON into n8n and open the workflow
- Run 'Manual Trigger' and verify exactly three output records
- Check R-001 and R-002 carry canonical_amount, found_path and status=resolved
- Check R-003 has no canonical_amount and status=missing_alias
- 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
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 (8)
Manual Trigger
Manual Trigger
Sample Records (Fictional)
Code
Resolve Aliases (Recursive DFS)
Code
Build Canonical Field
Set
Resolved?
If
Tag Resolved
Set
Tag Missing (Drop Canonical)
Code
Merge All Records
Merge
Aliases & Setup Guide
Sticky Note
Pipeline Stages
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