Skip to main content

Automated Airtable to Postgres migration with n8n

Workflow preview

Workflow preview
100%
Automated Airtable to Postgres migration with n8n preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Overview This ETL system automates the process of migrating data from Airtable to PostgreSQL with a single API request. It maps your Airtable schema into a Postgres compatible structure. Automatica...

Best for

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

Tools used

n8n-nodes-base.splitinbatches, n8n-nodes-base.stickynote, n8n-nodes-base.code, n8n-nodes-base.set, n8n-nodes-base.limit, n8n-nodes-base.if, n8n-nodes-base.httprequest, n8n-nodes-base.splitout

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Zacharia Kimotho.

Original n8n.io source

1.1 Workflow description

Title
Automated Airtable to Postgres migration with n8n
Workflow name
Automated Airtable to Postgres migration with n8n

Overview

This ETL system automates the process of migrating data from Airtable to PostgreSQL with a single API request.

  • It maps your Airtable schema into a Postgres-compatible structure.
  • Automatically creates new tables in your Postgres database.
  • Migrates all the data while preserving formats and relationships.

> ⚙️ Originally built in-house to help us migrate off Airtable after exceeding usage limits.


🔧 How It Works

  1. Accepts Airtable and Postgres credentials via HTTP requests.
  2. Authenticates both services and validates schema compatibility.
  3. Fetches data from Airtable and maps each table and field to PostgreSQL equivalents.
  4. Creates the necessary tables in your Postgres database.
  5. Inserts all records in batches.
  6. Returns a success response with summary stats.

> Bonus operations: You can list or delete created tables using API endpoints.


Setup Instructions (n8n Workflow)

Step 1: Airtable Configuration

Step 2: PostgreSQL Configuration

  • Gather your PostgreSQL connection details:

    • Host
    • Port
    • Database name
    • Username
    • Password

Step 3: Deploy in n8n

  • Import the workflow into your n8n instance.
  • Use a simple HTTP request tool like curl or Postman to trigger migration actions.

API Endpoints & Payloads

Here are the available HTTP endpoints and how to use them.


1. Test Airtable Credentials

curl -X POST "https://n8n.com/webhook/123/validate-airtable" \
  -H "Content-Type: application/json" \
  -d '{
    "airtable": {
      "airtableId": "app12345",
      "airtableToken": "pjhy.iyhhs"
    }
  }'

2. Test PostgreSQL Credentials

curl -X POST "https://n8n.com/webhook/123/validate-postgres" \
  -H "Content-Type: application/json" \
  -d '{
    "postgres": {
      "host": "aws-0-us-west-1.pooler.supabase.com",
      "port": "6543",
      "user": "postgres.username",
      "password": "gamjgnrkxetb",
      "database": "postgres"
    }
  }'

3. Sync Airtable Data to Postgres

curl -X POST "https://n8n.com/webhook/123/sync" \
  -H "Content-Type: application/json" \
  -d '{
    "host": "aws-0-us-west-1.pooler.supabase.com",
    "port": "6543",
    "user": "postgres.username",
    "password": "gamjgnrkxetb",
    "database": "postgres",
    "airtableId": "app73PqALbM3AM0xN",
    "airtableToken": "patNCueRkrLI98fEq.9ae7f9786e9ad73ac21ca26d8046f08ad77e135ae950a6e2ff3760d85aca3db4",
    "action": "Move"
  }'
Expected Response:
[
  {
    "statusCode": 200,
    "statusMessage": "Data migration successful",
    "recordsProcessed": 152,
    "tablesProcessed": 3
  }
]

4.List All Created Tables

curl -X POST "https://n8n.com/webhook/123/list-tables" \
  -H "Content-Type: application/json" \
  -d '{
    "postgres": {
      "host": "aws-0-us-west-1.pooler.supabase.com",
      "port": "6543",
      "user": "postgres.username",
      "password": "gamjgnrkxetb",
      "database": "postgres"
    }
  }'

5. Delete Migrated Tables

curl -X POST "https://n8n.com/webhook/123/delete-tables" \
  -H "Content-Type: application/json" \
  -d '{
    "postgres": {
      "host": "aws-0-us-west-1.pooler.supabase.com",
      "port": "6543",
      "user": "postgres.username",
      "password": "gamjgnrkxetb",
      "database": "postgres"
    }
  }'

Technical Notes

  • Schema Mapping: Field types from Airtable are mapped to PostgreSQL equivalents (e.g. singleLineText → VARCHAR, number → INTEGER, checkbox → BOOLEAN, etc.).
  • Linked Records: Relationships in Airtable bases are resolved and converted into foreign key-friendly formats.
  • Batch Inserts: Records are inserted in optimized chunks to improve performance and avoid payload limits.
  • Error Handling: Invalid credentials, schema mismatches, or connection issues will return proper HTTP status codes and error messages.

Usage Scenarios

  • Airtable to Postgres migration during scale-up.
  • Backup or sync Airtable records to a SQL environment.
  • Use Postgres-powered dashboards while editing in Airtable.

Requirements

  • Airtable Pro/Developer Account
  • PostgreSQL database (e.g. Supabase, Render, or local instance)
  • n8n instance with webhook exposure
  • Basic familiarity with HTTP requests (curl, Postman, or integrations)

Need Help?

Feel free to reach out via LinkedIn or Email if you need help adapting this workflow for your organization or extending it with extra transformations.

Happy productivity!

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 - Loop Over Items

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

Block 2 - Sticky Note5

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

Block 3 - Create database

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

Block 4 - Ser user data

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

Block 5 - set error

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

Block 6 - Limit1

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

Block 7 - Loop Over Items1

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

Block 8 - Ser user data1

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

Block 9 - Edit Fields

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

Block 10 - Upsert records

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

Block 11 - Set columns

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

Block 12 - Limit3

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

Block 13 - Fields

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

Block 14 - Loop Over Items2

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

Block 15 - Ser user data2

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

Block 16 - Edit Fields1

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

Block 17 - Sticky Note

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

Block 18 - Sticky Note1

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

Block 19 - If1

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

Block 20 - get schema

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

Block 21 - Split Out

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

Block 22 - set globals

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

Block 23 - Split Out2

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

Block 24 - Upsert records2

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

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

3. Summary Table

Workflow Automated Airtable to Postgres migration with n8n
Complexity advanced
Nodes 66
Categories Engineering
Author Zacharia Kimotho
Published 08 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4772/4772.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 Automated Airtable to Postgres migration with n8n do?

Overview This ETL system automates the process of migrating data from Airtable to PostgreSQL with a single API request. It maps your Airtable schema into a Postgres compatible structure. Automatica...

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.