FlowStep
← All walkthroughs
Full libraryGoogle SheetsPostgres

Keep a spreadsheet and a database in step, automatically

Mirror rows between Google Sheets and Postgres in both directions, so the team that lives in a spreadsheet and the systems that live in a database never quietly drift apart.

45 minAdvanced13 steps

What this looks like

One step on screen at a time. Read it, do it, tap Next.

Keep a spreadsheet and a database in step, automatically

Step 1 of 13

01 / 13Schedule Trigger

Start with a schedule, not a live trigger

Create a workflow and add a Schedule Trigger running every 15 minutes. Polling on a schedule is simpler and safer than trying to react instantly to spreadsheet edits.

Checkpoint

A Schedule Trigger sits on the canvas, currently disabled.

Back
Next

Before you begin

Tick these off as you sort them. Stopping halfway to create an account is how a fifteen-minute build becomes an hour.

0 of 9 ready

Ticks are saved on this device, so you can come back to them.

  • Have ready

    Same column names as the spreadsheet plus an id primary key and an updated_at timestamp column, which this workflow relies on to detect changes.

  • Credential

    Host, port, database name, user and password, with network access from n8n — check firewall rules if your database is on a private network.

  • Have ready

    Row order in a spreadsheet is not a reliable identifier. Add an explicit ID column if the sheet doesn't already have one, and never let people delete it.

  • Account

    Used both to read changes and to write updates back when the database side changes first.

  • Know-how

    Decide now, on paper, whether the sheet or the database is the source of truth when both change the same row before a sync runs. This walkthrough assumes most recent updated_at wins.

  • Time

    Two-way sync is the trickiest pattern in this library. Build and test one direction fully before adding the other.

The basics — ticked once, remembered everywhere

  • Account

    Either the hosted version or a self-hosted install. Everything here works the same on both — the only visible difference is the shape of your webhook URLs.

    Create a workspace
  • Know-how

    Adding a node, connecting two of them, and pressing Execute. If any of that is new, the free primer covers it in about ten minutes.

  • Credential

    You will paste at least one secret during setup. A password manager beats a notes app, and it stops you pasting a live key into a chat window by accident.

The shape of the workflow

The nodes you will end up with, left to right, in the order you add them.

Schedule TriggerGoogle SheetsPostgresMergeCodePostgresGoogle SheetsPostgresGoogle Sheets
The finished Keep a spreadsheet and a database in step, automatically workflow on the n8n canvas4 things to set here
  1. 1Schedule Triggerthe trigger — everything starts here
  2. 2Google SheetsRead every row currently in the sheet
  3. 3PostgresRead every row currently in Postgres
  4. 4MergeMerge the two sources by ID
The finished workflow on the n8n canvasTap to enlarge

Skip the node hunting

Import a starter file with every node for this build already on the canvas, named after its step and wired in order, each one carrying a sticky note with the values to enter. You still connect your own accounts and fill the fields — that is what the walkthrough takes you through — but you never start at a blank canvas.

In n8n: Workflows → Import from file.

Included with the library

What you will build

Jump straight to any step, or print the list and tick it off beside your n8n tab.

If something goes wrong

Everything ready?

Start walkthrough