Moves a Google Sheet that has become your database into Postgres, every hour. Each row is cleaned and checked first: missing or duplicate ids, bad emails, non-numeric amounts and unknown statuses are reported to Slack instead of being loaded.
What it does
- Every hour: runs on a schedule
- Read sheet: reads the Records tab
- Validate and clean: one rule per line, easy to change
- Valid? → Upsert into Postgres: inserts new rows and updates existing ones, matched on external_id
- Summarize rejects → Slack: lists the rows that were not loaded, with the sheet row number and reason
What you need
- An n8n instance
- A Postgres database (Supabase, Neon, RDS or your own)
- A Google account for Sheets
- A Slack incoming webhook URL
Setup
- Run
schema.sqlin your database. - Import
workflow.jsoninto n8n. - Paste your sheet URL into Read sheet, add your Google credential, and set the tab name. The sheet needs columns id, name, email, status and amount (or change the mapping in Validate and clean).
- Add your Postgres credential to Upsert into Postgres and set the Slack URL in Config.
- Run it once by hand, check the table and the rejects message, then activate.
Make it yours
- Add your own columns to
schema.sqland Validate and clean. - Once the database is trusted, build forms or an internal tool on it and make the sheet a read-only export.
- Airtable users can swap the Postgres step for the Airtable node.
Notes
- No credentials are included. Every value marked
REPLACE_MEorREPLACE_WITH_...must be set before you activate the workflow. - Test with sample data first. Check each step's output in n8n before you point real traffic at it.
Importing it
In n8n, open a new workflow, choose the … menu at the top right, then Import from file and pick the downloaded workflow.json. You can also open the file, copy everything and paste it onto an empty canvas. New to n8n? Start with what n8n is and how templates work.
Background reading: Spreadsheet vs database app.
Want it set up and running in your own n8n? Send us a short brief.
Pushbuild · Automate your business with Pushbuild: pushbuild.com/