Stepthrough Start free

What is an upsert?

Quick answer

An upsert, short for update or insert, is a single action that looks for a matching record and updates it if found, or adds a new record if not. The match is made on a field you choose, such as an email or an order number. In n8n's Google Sheets node it is called Append or Update Row.

Last updated

Take the free module →Module 12 of the free n8n Jump Start course, about 12 minutes. No account needed.

Updated · By Robert Breen

Why it matters for a small business

Plain "add row" steps create duplicates as soon as the same person shows up twice, which happens with repeat form submissions, retries and re-runs. Plain "update" steps fail for anyone new. An upsert handles both cases in one step, so the sheet or CRM always holds one up-to-date record per person.

It is the easiest way to make a write step safe to repeat, the idea called idempotency. The only decision is the matching field: it must be unique and consistent, so an email works well and a name does not.

Where you'll use it: in n8n's Google Sheets node choose Append or Update Row and set Column to match on. Many CRM and database apps in n8n, Make and Zapier offer the same thing as Create or Update, or Find or Create, actions.

In a real lesson: n8n: Read, Add and Update Google Sheets Rows with an AI Step

In the free n8n Read, Add and Update Google Sheets lesson, Northgate Content Studio's request sheet has the columns Name, Email, Topic, Submitted and Description. You open Append or Update Row and pick Email as the column to match on.

The lesson spells out what that does: n8n looks for the email first. If it finds it, it updates that row; if not, it adds a new one, so running twice can never duplicate Jordan Lee. Later the AI step's sentences are written back into each matching row.

Try this lesson free or read the step-by-step guide.

Common confusions

Upsert vs append row

Append row always adds a new line at the bottom. An upsert checks first and only adds when there is no match.

Upsert vs remove duplicates

Removing duplicates drops repeated items before a step. An upsert makes the write step itself avoid doubles.

Tips

  • Match on a field that never changes, such as an email or an ID.
  • Keep the matching column's values clean, without stray spaces.
  • Run the workflow twice in testing and check the row count.

More Data, Sheets and Gmail terms

Where you use it: free lessons

Frequently asked questions

What does upsert stand for?
It joins update and insert: update the record if it exists, insert it if it does not.
What if two rows have the same email?
The tool usually updates the first match it finds, so remove existing duplicates before relying on an upsert.

All AI glossary terms, A to Z · Free prompt templates