Skip to main content

Fetch hierarchical data records from Airtable with multi-level relationships

Workflow preview

Workflow preview
100%
Fetch hierarchical data records from Airtable with multi-level relationships preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Airtable Hierarchical Record Fetcher Description This n8n workflow retrieves an Airtable record along with its related child records in a hierarchical structure. It can fetch up to 3 levels of link...

Best for

  • Engineering automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.set, n8n-nodes-base.splitout, n8n-nodes-base.filter, n8n-nodes-base.airtable, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.if

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by digi-stud.io.

Original n8n.io source

1.1 Workflow description

Title
Fetch hierarchical data records from Airtable with multi-level relationships
Workflow name
Fetch hierarchical data records from Airtable with multi-level relationships

Airtable Hierarchical Record Fetcher

Description

This n8n workflow retrieves an Airtable record along with its related child records in a hierarchical structure. It can fetch up to 3 levels of linked records and assembles them into a comprehensive JSON object, making it ideal for complex data relationships and nested record structures.

Features

  • Multi-level Record Fetching: Retrieves parent record, linked child records (level 2), and optionally grandchild records (level 3)
  • API Call Optimization: Uses Airtable's filterByFormula to minimize API calls by fetching multiple related records in single requests
  • Selective Level 3 Fetching: Only fetches level 3 records for specified linked fields to optimize performance
  • Rich Text Processing: Converts Airtable's pseudo-markdown rich text fields to HTML format
  • Hierarchical JSON Output: Organizes all data in a structured, nested JSON format
  • Flexible Configuration: Customizable depth and field selection per execution

Input Parameters

The workflow accepts a JSON array with the following structure:

[
  {
    "base_id": "appN8nPMGoLNuzUbY",
    "table_id": "tblLVOwpYIe0fGQ52", 
    "record_id": "reczMh1Pp5l94HdYf",
    "level_3": [
      "fldRaFra1rLta66cD",
      "fld3FxCaYk8AVaEHt"
    ],
    "to_html": true
  }
]

Parameter Details

Parameter Type Required Description
base_id string Yes Airtable base identifier
table_id string Yes Airtable table identifier for the main record
record_id string Yes Airtable record identifier to fetch
level_3 array No Array of field IDs from level 2 records for which to fetch level 3 children
to_html boolean No Convert rich text fields from pseudo-markdown to HTML (default: false). This requires marked npm package.

Output Structure

The workflow returns a hierarchical JSON object with the following structure:

{
   "id": "recXXXXXXX",
   "field_1": ...,
   "field_2": ...,
   "level2_child": [
      {
         "id": "recXXXXXXX",
         "field_a": ...,
         "field_b": ...,
         "level3_child": [
            {
               "id": "recXXXXXXX",
               "field_y": ...,
               "field_z": ...,
            },
            ...
         ]
      },
      ...
   ]
}

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Execute Workflow Trigger

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1

Block 2 - Inputs

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Split Out Fields

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 4 - Add Inverse LinkTo Field name

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Add origin LinkTo

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - Filter Link To fields

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 7 - Airtable Schema

Type / Role
n8n-nodes-base.airtable - airtable
Config choices
Version 2.1

Block 8 - Airtable - Get Target Record

Type / Role
n8n-nodes-base.airtable - airtable
Config choices
Version 2.1

Block 9 - Insert linked records to originRecord & Clean Field Name

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Filter Main Table

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 11 - Get Linked records without Link To fields Except for Level 3

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 12 - If Has Level 3

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 13 - Get L3 Linked records without reverse Link To fields

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Level 2 records

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 15 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 16 - Merge1

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 17 - Repeat L3 links of current L2 table

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Aggregate1

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 19 - Split Out L3 Potential Links

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 20 - Prepare HTTP Call

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 21 - Preparing aggregation

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 22 - Code to single field property

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 23 - Merge with original field property

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 24 - Aggregate to record list

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Showing the first 24 of 38 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Fetch hierarchical data records from Airtable with multi-level relationships
Complexity advanced
Nodes 38
Categories Engineering
Author digi-stud.io
Published 07 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5750/5750.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Fetch hierarchical data records from Airtable with multi-level relationships do?

Airtable Hierarchical Record Fetcher Description This n8n workflow retrieves an Airtable record along with its related child records in a hierarchical structure. It can fetch up to 3 levels of link...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering use case.