HomeShopify & E-commerceShopify customer loyalty tiers automation with…

Shopify customer loyalty tiers automation with n8n

Shopify customer loyalty tiers automation with n8n









Shopify customer loyalty tiers automation with n8n lets you sort every buyer into Bronze, Silver or Gold based on how much they have spent over their lifetime, with no loyalty app subscription. A weekly workflow reads each customer total spend, decides the right tier, and writes it back as a customer tag you can segment, filter and email against. This guide is free to follow, and a ready-to-import template is available if you would rather skip the build.

What it does

The workflow runs on a schedule, pulls your customer list from the Shopify Admin API, and looks at the total_spent field that Shopify already keeps for every customer. A Code node compares that number against thresholds you choose and decides one of three tiers. It then writes the tier back to the customer record as a tag, so Gold, Silver and Bronze become real, filterable segments inside Shopify.

Two details make it safe to run on a live store. First, it only rewrites the tier tag and leaves every other tag untouched, so a customer tagged VIP or wholesale keeps those. Second, it only pushes an update for customers whose tier actually changed since last run, so you are not hammering the API to write the same value week after week. Customers who move up a tier can optionally receive a short congratulations email.

Why it beats the default

Shopify has no native concept of a spend-based loyalty tier. Out of the box you get a single flat customer list and a manual tag field. Merchants usually solve this in one of two ways, and both have costs.

The first is a dedicated loyalty app. Those work, but they charge a monthly fee that scales with your customer count, they own your tier logic, and they lock the segment data inside their dashboard rather than in your Shopify tags. The second is doing it by hand: exporting customers to a spreadsheet, sorting by spend, and re-tagging in bulk. That is fine once, but it goes stale the moment new orders land.

This workflow keeps the logic in your own n8n instance and the result in your own Shopify tags. You decide the thresholds, you own the data, and the tiers refresh themselves on a cron. It is the difference between renting a segmentation feature and owning a small piece of infrastructure that costs you nothing per customer.

It also pairs cleanly with automations you may already run. Once tiers live as tags you can trigger a repeat-customer reward email off a Gold tag, or route a high-value customer Slack alert when a big order arrives. This tier job is the layer underneath all of that: it decides who is who. It is deliberately different from per-order tagging, which labels individual orders rather than scoring a customer over their whole history.

What you need

  • A running n8n instance, either cloud or self-hosted.
  • A Shopify custom app with Admin API access, created in the Shopify Dev Dashboard. If you have not connected Shopify to n8n yet, follow connect Shopify to n8n in 2026 first. You need the read_customers and write_customers scopes.
  • The Admin API access token stored in n8n as a Header Auth credential, using the header X-Shopify-Access-Token.
  • Optional: a Gmail credential if you want the promotion email. Swap in any SMTP or Outlook node if you do not use Gmail.

This build is part of the wider n8n Shopify automation stack, so if you already run other store workflows the credential is likely in place.

Node-by-node list

  • Schedule Trigger, weekly on Monday at 6am. Sets when the tier refresh runs.
  • HTTP Request, GET /admin/api/2026-04/customers.json with a limit of 250. Pulls the customer list with the total_spent field included.
  • Code node, Assign tier. Loops the customers, computes a tier from lifetime spend, rebuilds the tag string, and flags whether the tier changed and whether the customer was promoted.
  • Filter, Tier changed. Passes only customers whose tier is different from what is already on their record, so unchanged customers are skipped.
  • HTTP Request, PUT /admin/api/2026-04/customers/{id}.json. Writes the new tag string back to each customer.
  • IF, Newly promoted. Splits off customers who moved up a tier for the optional email.
  • Gmail, Send reward email. Sends a short note to promoted customers. Optional, delete it if you only want the tags.

Step-by-step build

  1. Create a new workflow in n8n and add a Schedule Trigger. Set it to weeks, Monday, hour 6. This is your refresh cadence.
  2. Add an HTTP Request node named Get customers. Method GET, URL https://YOUR_STORE.myshopify.com/admin/api/2026-04/customers.json. Under authentication choose Generic Credential Type, then Header Auth, and select the credential holding your X-Shopify-Access-Token. Add a query parameter limit with value 250.
  3. Add a Code node named Assign tier. Paste the tier logic from the template. It reads total_spent, compares it against your thresholds (the template uses 500 for Silver and 1000 for Gold), removes any old tier tag, keeps the rest, and outputs one item per customer with a tier_changed and promoted flag.
  4. Add a Filter node named Tier changed. Set the condition to boolean, {{ $json.tier_changed }} is true. This stops the workflow from re-writing customers whose tier has not moved.
  5. Add an HTTP Request node named Update customer tags. Method PUT, URL https://YOUR_STORE.myshopify.com/admin/api/2026-04/customers/{{ $json.id }}.json, same Header Auth credential. Set the body to JSON and send the customer object with the new tags built by the Code node.
  6. Optional email path: add an IF node named Newly promoted, condition boolean {{ $json.promoted }} is true. Wire its true output to a Gmail node that sends to {{ $json.email }} with a short congratulations message. Delete this branch if you only want tags.
  7. Adjust the thresholds in the Code node to match your currency and margins, run the workflow once manually, and confirm the tags appear on a few customers in Shopify admin. Then turn the schedule on.

Common mistakes

Overwriting good tags

The single biggest risk when writing tags through the API is sending only the tier and wiping everything else. The Code node in this template rebuilds the full tag string first, removing just the three tier tags it manages, so VIP, newsletter and the rest survive. If you rewrite the logic, keep that behaviour.

Forgetting the write scope

A custom app created with only read_customers will fetch the list fine, then fail silently on the PUT. Grant write_customers as well and reinstall the app if you added the scope after the fact.

Ignoring pagination on large lists

The template pulls one page of up to 250 customers to keep it simple. If you have more customers than that, add cursor-based pagination on the GET request or filter the query to customers updated since the last run. The tier logic itself does not change.

Running it too often on a demoted customer

Refunds can drop total_spent and move a customer down a tier. That is correct behaviour, but if you send a promotion email, gate it on the promoted flag as the template does so a demotion never triggers a congratulations note.

Cost at realistic volume

Every tool in this workflow sits on a free tier for the volumes most stores hit. n8n self-hosted is free, and n8n Cloud counts one workflow execution per weekly run regardless of how many customers it processes. The Shopify Admin API is included with your plan. Gmail sends are free within normal daily limits.

A store with 5,000 customers runs this once a week: that is roughly 52 executions a year, each making one GET and then one PUT only for the customers whose tier moved. On a stable customer base that is a few dozen writes per week, not thousands. Even on the busiest tiers of n8n Cloud you are looking at a rounding error, and self-hosted it is genuinely zero. There is no per-customer fee, which is the whole point compared to a loyalty app that bills by contact count.

Ready-to-import template

Skip the build. The guide above is free to follow by hand. If you would rather import a working workflow in two minutes, download the ready-to-import n8n template. It ships with the tier logic, the safe tag-rebuild, the changed-only filter and the optional email branch already wired, with credential placeholders you swap for your own.

Download the template ($17) →

Want it built, tested and connected to your store for you? Our done-for-you service installs it on your n8n and tunes the thresholds to your margins.

FAQ

Does Shopify have built-in loyalty tiers?

Shopify core does not assign spend-based tiers on its own. You either pay for a loyalty app or you compute tiers yourself. This n8n workflow reads each customer total_spent field, decides Bronze, Silver or Gold, and writes the result back as a customer tag you can segment and filter on.

How does the workflow decide a customer tier?

A Code node compares the customer lifetime spend against thresholds you set, for example 500 and 1000 in your store currency. It picks the highest tier the customer qualifies for, strips any old tier tag, keeps every other tag, and writes the new tier tag back through the Shopify Admin API.

Will it overwrite my existing customer tags?

No. The Code node only removes the three tier tags it manages, Bronze, Silver and Gold, and preserves everything else such as VIP, newsletter or wholesale. It rebuilds the full tag string before the update, so unrelated tags survive every run.

How often should the loyalty tiers run?

A weekly schedule is enough for most stores because lifetime spend moves slowly. The template ships with a Monday 6am cron. High-volume stores can run it daily. Because the workflow only updates customers whose tier actually changed, running more often costs almost nothing extra.

Do I need a paid Shopify plan or app for this?

No extra app is required. You need a custom app created in the Shopify Dev Dashboard with read and write access to customers, plus a running n8n instance. The workflow uses the standard Admin API, so it works on any Shopify plan that allows custom apps.

Related guides