πŸ“ Synchronize Excel or Google Sheets with Postgres (bi-directional)

⚑ 720 views Β· πŸ“ File Management

Description

Synchronize Excel or Google Sheets with Postgres (bi-directional)

Who’s it for

This workflow is perfect for companies that have always managed their operations in Excel or Google Sheets and want to gradually transition to using a database or custom software. It ensures business continuity while modernizing data management.

How it works / What it does

  1. Trigger options β†’ Run the sync manually, on schedule, or as part of another workflow.
  2. Get data from Excel β†’ Reads rows from an Excel or Google Sheet table.
  3. Sanitize data β†’ Cleans up formats (e.g., converting Excel serial dates into proper date strings).
  4. Upsert into Postgres β†’ Inserts or updates rows in the database, ensuring no duplicates.
    • For auto-mapping to work, the column names in Excel/Sheets and the DB must match exactly.
    • If you want different names, you can manually map columns in the Postgres node.
  5. (Optional) β†’ Can be extended to push DB updates back to Excel, creating a true two-way sync.

This way, your team can continue working in Excel/Sheets while data is safely persisted in a databaseβ€”ideal for scaling into dashboards, SaaS, or ERP systems later.

How to set up

  1. Import the workflow JSON into your n8n instance.
  2. Connect your credentials:
    • Microsoft Excel / Google Sheets OAuth2
    • Postgres database
  3. Point the Excel node to the right workbook, worksheet, and table.
  4. Make sure column names match between the Excel sheet and DB table (or map manually if they differ).
  5. Run manually or configure the schedule trigger for automated syncs.

Requirements

How to customize the workflow

πŸ”— Nodes Used

Postgres, Microsoft Excel 365, Execute Workflow Trigger, Schedule Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup