π 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
- Trigger options β Run the sync manually, on schedule, or as part of another workflow.
- Get data from Excel β Reads rows from an Excel or Google Sheet table.
- Sanitize data β Cleans up formats (e.g., converting Excel serial dates into proper date strings).
- 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.
- (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
- Import the workflow JSON into your n8n instance.
- Connect your credentials:
- Microsoft Excel / Google Sheets OAuth2
- Postgres database
- Point the Excel node to the right workbook, worksheet, and table.
- Make sure column names match between the Excel sheet and DB table (or map manually if they differ).
- Run manually or configure the schedule trigger for automated syncs.
Requirements
- n8n self-hosted or cloud account.
- Either Microsoft Excel Online or Google Sheets access.
- Postgres database (or replace with MySQL, MariaDB, or any supported DB).
How to customize the workflow
- Replace Excel with Google Sheets by swapping the node.
- Replace Postgres with any preferred database node.
- Add validation steps (e.g., check for missing emails, duplicate IDs).
- Extend with reporting workflows (e.g., sync DB data to BI dashboards).
- Use this as a stepping stone to migrate from spreadsheets into software-driven processes.
π Nodes Used
Postgres, Microsoft Excel 365, Execute Workflow Trigger, Schedule Trigger
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File