HomeShopify & E-commerceShopify customer win-back email with n8n…

Shopify customer win-back email with n8n (Gmail + Google Sheets)

TL;DR: This guide shows how to build a Shopify customer win-back email with n8n using Google Sheets and Gmail. n8n scans your Shopify orders on a schedule, finds customers who have not bought in 60 days, and emails each one a personal come-back offer from your own address. A Google Sheet remembers who was already contacted so nobody gets the same email twice. No retention app, no per-contact fee, full control over the timing and the copy.

What it does

Every store has a quiet group of customers who bought once, liked it, and then drifted away. They are not angry and they did not unsubscribe. They simply forgot you exist. Winning one of them back costs far less than finding a brand new buyer, yet most stores never send that nudge because doing it by hand is tedious and the apps that do it automatically charge by the contact.

This workflow handles the whole thing inside n8n. On a schedule you choose, it reads your recent Shopify orders, works out the last time each customer placed an order, and flags anyone whose last purchase was more than 60 days ago. For each lapsed customer it sends a short, personal Gmail message with a reason to come back, then writes that person into a Google Sheet so the next run knows to leave them alone.

The result is a steady win-back program that runs on an n8n instance you already own, with messaging you write yourself instead of a template you rent from a retention app.

Why it beats the default

The usual route for a Shopify store is a retention or email platform that prices on list size. Those tools work, but the bill climbs every month as your customer list grows, and you are paying for a templated email that you could write better yourself. You also hand your customer data to another vendor and accept their sending domain, their design limits, and their idea of when a customer counts as lapsed.

Running it in n8n turns that around. Gmail sends from your own address, so the email arrives with your name and your reply-to, and a customer who responds reaches a real inbox. You decide the lapse window, so a fashion store can treat 45 days as cold while a furniture store waits 180. You can branch the logic later, for example offering a bigger discount to customers who spent more in the past, without filing a feature request with an app vendor. Because the contacted list lives in a plain Google Sheet, your team can read it, sort it, and export it whenever they want.

For a wider view of where this sits among store automations, the n8n Shopify automation hub maps out the other flows that pair well with a win-back campaign.

What you need

You need a running n8n instance, either cloud or self-hosted. You need a Shopify store with Admin API access, which means a custom app with the read_orders and read_customers scopes, both read-only. You need a Google account for the tracking sheet and a Gmail account to send from. That is the whole stack, and every part of it sits on the free or near-free end.

On the Shopify side, create a custom app under Settings, then Apps and sales channels, then Develop apps. Give it the two read scopes above and install it to generate an Admin API access token. On the Google side, one sheet with a handful of columns is enough to begin, and you can grow it later as you add fields like last order value or product category.

Node by node

The workflow uses seven nodes. The Schedule Trigger fires the run on your chosen interval, usually once a day in the early morning. The Shopify node, or an HTTP Request node hitting the Admin API, pulls recent orders along with the customer attached to each one. The Code node groups those orders by customer, finds each customer’s most recent order date, and keeps only the people whose last order is older than your lapse window. The Google Sheets read node loads the list of customers you have already contacted. The IF node compares the lapsed list against the contacted list and passes through only the people who have not been emailed yet. The Gmail node sends the win-back message to each remaining customer. The final Google Sheets append node records that customer’s email and the send date so future runs skip them.

Step by step build

  1. Create a new workflow in n8n and add a Schedule Trigger. Set it to run once a day at a quiet hour, for example 6am in your store’s timezone, so emails land before the morning rush.
  2. Add a Shopify node, or an HTTP Request node calling GET /admin/api/2024-04/orders.json?status=any&limit=250 with your Admin token. Pull enough order history to cover your lapse window plus a margin, for example the last 200 days of orders.
  3. Add a Code node. Loop through the orders, build a map of customer email to their latest order date, then output only the customers whose latest order is more than 60 days before today. Attach each customer’s first name and email to the output so the email step has them.
  4. Add a Google Sheets read node that loads your Contacted sheet. This sheet holds every customer you have already sent a win-back email to, which is how the workflow avoids repeating itself.
  5. Add an IF node, or a Code filter, that checks whether each lapsed customer’s email already appears in the contacted list. Send only the new ones forward and let the rest end quietly.
  6. Add a Gmail node on the passing branch. Write a short subject like “We saved your spot, James” and a friendly body that references the time since their last order and gives one clear reason to return, such as a small discount or a new arrival.
  7. Finish with a Google Sheets append node that writes the customer’s email, first name, and today’s date to the Contacted sheet. Save, activate, and run it once by hand against a small order history to confirm the right people are selected.

The contacted sheet

The Google Sheet is the memory of the whole workflow. Keep it simple at first and add columns only when you need them.

Column Type Example Description
email Text james.carter@gmail.com The customer’s email, used to match against future runs
first_name Text James Pulled from the order, used to personalize the subject and body
last_order_date Date March 14, 2026 The most recent order date the workflow found for this customer
contacted_date Date June 15, 2026 The day the win-back email was sent, so you can re-target much later if you want

Common mistakes

The most common mistake is skipping the contacted sheet, which turns a thoughtful win-back into a daily nag that emails the same lapsed customer every morning until they unsubscribe. The append step at the end is not optional, and you should test it once before going live. A second mistake is sloppy date math. Make sure your Code node compares dates in the same timezone, because an off-by-one-day error near the edge of your window will either skip people or email them too early.

People also pull too few orders. If you only read the last 30 days of orders but your lapse window is 60 days, a customer whose last purchase was 90 days ago never appears in the data, so they are never selected. Always pull more history than your window. Finally, watch your Gmail sending limits. A free Gmail account caps around 500 messages a day, so a large first run against years of lapsed customers should batch across several days or move to a Google Workspace account with a higher limit.

Cost at realistic volume

Assume a store with a few thousand past customers that emails 300 lapsed buyers a month once the initial backlog is cleared. Self-hosted n8n on a small VPS runs about 5 to 7 dollars a month and carries this workflow without noticing. Google Sheets is free at this scale. Gmail is free up to its daily limit, or 6 dollars a month on Workspace if you want a higher cap and your own domain on the sending address. So the realistic monthly cost sits between roughly 5 and 13 dollars, flat, no matter how large your customer list grows. A retention app priced per contact would commonly run 30 to 150 dollars a month at the same list size, and that number only climbs as you add customers, while this one stays put.

Ready to import template

You can build this from the steps above, or skip straight to a working version. The ready-to-import JSON template, plus a setup guide and a credentials guide, is available on the downloads page. Import it, paste in your Shopify token and Google credentials, set your lapse window, and you are live in a few minutes.

If you would rather have it installed and tested for you on your own n8n instance, the done-for-you setup service handles the Shopify app, the credentials, and the go-live so you can stay focused on selling.

FAQ

How do I decide the right lapse window?

Look at your typical reorder gap. If most repeat buyers come back within 30 days, then 60 days of silence is a real signal they have drifted. Slower categories like furniture or electronics need a longer window, sometimes 120 to 180 days. Start with 60 and adjust once you see who the workflow selects.

Will a customer get the same win-back email twice?

Not if you keep the final append node. After an email sends, that customer’s address is written to the Contacted sheet, and the IF node filters them out on every future run. Duplicates only happen when the append step is removed or the sheet match is misconfigured, so test it once before going live.

Can I use Outlook or SMTP instead of Gmail?

Yes. n8n has native nodes for Outlook and generic SMTP, so you can swap the Gmail node for either one and map the same fields. The rest of the workflow stays identical. Pick whichever account gives you the sending limit and deliverability that match your volume.

Does this write anything to my Shopify store?

No. The workflow only reads orders and customers, using read-only scopes. It never changes an order, a customer record, or inventory. Everything it tracks lives in your Google Sheet, so there is no risk of the automation altering your store data.

How do I add a discount code to the email?

Two options. You can create a single reusable code in Shopify and drop it into the Gmail body, which is the simplest path. Or you can add a step that generates a unique code per customer through the Shopify Admin API before the email sends, which prevents code sharing but adds a node and a little setup.

Related guides

Pair this with the Shopify new customer welcome email so first-time buyers get a warm start, and the Shopify abandoned checkout email sequence to recover sales before they slip away. Browse the full Shopify automation category for more store-ready templates.