Multi-Level Airtable Record Hierarchy Builder and Converter - n8n Workflow

Fetch deeply nested Airtable records (Level 1, 2, and 3) into a unified JSON structure using this powerful n8n workflow. Includes rich text Markdown to HTML conversion.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers needing to ingest complex relational Airtable data into an application.
Data analysts requiring structured, de-normalized records for reporting.
Users looking for advanced n8n templates to handle nested API logic.
Anyone automating data syncs between Airtable and other systems using a powerful n8n workflow.

Overview

This is an advanced n8n workflow designed to overcome the limitations of standard Airtable API calls when dealing with deep data relationships. Traditional methods only return record IDs for linked fields. This specialized n8n node sequence automatically resolves those links up to three levels deep, fetching the actual child and grandchild records. By using optimized HTTP requests and dynamic field mapping, this n8n workflow generates a clean, nested JSON output, optionally converting Airtable's rich text (pseudo-markdown) fields into usable HTML using a custom code n8n node. This makes it a crucial tool for sophisticated data fetching automation. This n8n workflow demonstrates complex logic and efficient data handling.

How it Works


  1. Trigger & Input Setup: The process starts via the Execute Workflow Trigger n8n node, which receives parameters including the baseid, tableid, recordid, and the optional array of level3 field IDs. The Set n8n node prepares these inputs.

  2. Level 1 Data & Schema Fetch: The n8n workflow retrieves the full Airtable Base Schema and the primary (Level 1) target record using dedicated Airtable n8n nodes.

  3. Identify Level 2 Links: The schema is filtered to identify the target table and subsequently uses Filter and Split Out Fields n8n nodes to isolate all fields linking to other records (Level 2 connections).

  4. Fetch Level 2 Records (HTTP Trick): The workflow executes a high-performance HTTP Request n8n node, utilizing an Airtable API trick (a filterByFormula based on the linked record IDs) to efficiently retrieve Level 2 child records. It selectively excludes further linked fields in L2 unless they are required for Level 3 fetching (specified in the level3 input).

  5. Conditional Level 3 Processing: An If n8n node checks if any Level 2 records contain fields designated for Level 3 expansion. If required, the workflow enters a dedicated set of loops (Split In Batches n8n node).

  6. Looping and Fetching Level 3: The inner loops dynamically prepare and execute further HTTP Request n8n node calls to fetch Level 3 records, cleaning and aggregating this data using Code n8n nodes and Set n8n nodes to correctly nest it within the respective Level 2 parent.

  7. Final Assembly & Comments: All processed Level 2 data (now containing embedded Level 3 children) is merged back into the original Level 1 record using the Insert linked records Code n8n node. Separately, Airtable comments are fetched and merged.

  8. Rich Text Conversion: If the tohtml flag is true, the n8n workflow identifies all Rich Text fields using the schema and passes the data through a custom Code n8n node that converts the Markdown content to HTML using the marked library, completing the data enrichment pipeline of this powerful n8n workflow.

Installation Guide

To use this n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON data and import it into your n8n instance as a new workflow.

  2. Credentials: This n8n workflow requires a connected Airtable credential (API token access). Ensure the 'AirtableTokenApi' credential, referenced in the Airtable and HTTP Request n8n nodes, is properly configured with read access to your base.

  3. Code Node Dependency: If you plan to use the 'Markdown to Html' feature (tohtml: true), you must install the marked NPM package in your n8n environment. This is necessary for the Code n8n node to function.

  4. Testing: Execute the workflow manually using the Execute Workflow Trigger n8n node, providing the required baseid, tableid, and recordid for testing.

Node Details

Execute Workflow Trigger (n8n trigger): The starting point. It accepts structured JSON input defining the target Airtable record and the desired level 3 fields.
Airtable (n8n node): Used to retrieve both the full Base Schema definition (essential for identifying link fields) and the initial Level 1 Target Record.
HTTP Request (n8n node): Performs the heavy lifting for efficient retrieval of Level 2 and Level 3 records using Airtable's custom filtering API endpoint, a key element of this advanced n8n workflow.
Set (n8n node): Used extensively throughout the n8n workflow to define dynamic variables, prepare parameters for HTTP calls (like field lists), and map inverse field names.
Filter (n8n node): Filters the base schema to locate link-to-another-record fields, determining the scope of Level 2 fetching.
SplitInBatches/Split Out (n8n node): Manages the complex looping and iteration required for processing arrays of Level 2 records and their nested Level 3 link fields.


  • Code (n8n node): Contains critical custom logic. The 'Insert linked records' node structures the final hierarchy, and the 'Markdown to Html' node (if enabled) converts rich text fields using external NPM dependency, providing rich functionality to this n8n node sequence.

Related n8n Workflows

Free

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by

Featured*