HomeShopifyShopify New Customer Welcome Email with…
Shopify

Shopify New Customer Welcome Email with Gmail and n8n (Full Template)








TL;DR

Set up a shopify new customer welcome gmail n8n workflow that catches every first-time buyer, looks up their order count through the Shopify Admin API, and sends a personalised welcome email from Gmail within seconds of checkout. No Klaviyo subscription, no monthly send limits, and the template is yours to edit forever. Runs for free on your own n8n instance and takes about 20 minutes to wire up end to end.

What this workflow does

When a buyer completes checkout on your Shopify store, Shopify fires an orders/create webhook. The workflow listens on that webhook, pulls the customer record, checks whether this is their first order, and if it is, sends a welcome email through your Gmail account. Repeat buyers are quietly skipped so they never see the same greeting twice.

The email itself is rendered from a template inside n8n. You pass in the customer name, the product they just bought, and a discount code if you want to include one. Because it goes out through Gmail, it arrives from your actual business address with a normal inbox reputation instead of a shared ESP sending domain.

Why this beats the default Shopify welcome flow

Shopify’s built-in notification for a new customer is thin. It cannot easily branch on “is this their first order”, cannot pull extra data from the Admin API mid-send, and cannot be extended to post the same event to Slack or Google Sheets later. Most stores end up installing Klaviyo or Omnisend, which start at around $20 a month and lock your template behind their builder.

An n8n workflow self-hosted on a small VPS costs a few dollars a month total and gives you full control over timing, copy, segmentation and logging. You can add a Google Sheets step tomorrow to track which welcome variant converted best, or route high-value first orders to Slack, without migrating to a bigger plan.

What you need before you start

You will need an active Shopify store on any plan that allows custom apps or webhook access, a Gmail account with an app password or OAuth2 set up in n8n, and an n8n instance you can reach from the public internet so Shopify can POST to its webhook URL. If you are still running n8n on localhost, either use a tunnel or move it to a server first, because Shopify will not retry indefinitely if the endpoint is unreachable.

You also want a Shopify custom app with read access to orders and customers. The Admin API token from that app is what n8n uses to look up the customer’s order count, which is the deciding signal for “first order yes or no”.

Nodes used in the workflow

The finished graph has eight nodes. The Webhook node receives the Shopify event. A Set node normalises the payload into clean fields. An HTTP Request node calls the Shopify Admin API to fetch the customer’s order history. An IF node branches on whether orders_count equals one. The Gmail node sends the welcome. A second Set node builds a row for logging. A Google Sheets node appends that row so you have an audit trail. A final Respond to Webhook node closes the loop cleanly so Shopify marks the delivery as successful.

Step-by-step build

  1. Create a new workflow in n8n and name it Shopify Welcome Email. Add a Webhook node, set the HTTP method to POST, and copy the test URL. You will swap to the production URL later.
  2. In Shopify admin, go to Settings, Notifications, Webhooks, and create a webhook for the event Order creation with format JSON, pasting the n8n webhook URL. Save it and send a test notification to confirm the payload lands in n8n.
  3. Add a Set node right after the webhook. Pull out the fields you actually need: customer.email, customer.first_name, customer.id, line_items[0].title, and order_number. This keeps later expressions short and readable.
  4. Add an HTTP Request node. Method GET, URL https://YOURSTORE.myshopify.com/admin/api/2024-10/customers/{{ $json.customer_id }}.json, and pass the Admin API access token in the header X-Shopify-Access-Token. This returns the full customer object including orders_count.
  5. Add an IF node. Condition: {{ $json.customer.orders_count }} equals 1. The true branch fires the welcome email. The false branch goes to the logging step and exits without emailing.
  6. On the true branch, add a Gmail node. Set the credential, the To address to the customer email, the Subject to something like Welcome to Acme, your first order is in, and the Message body to HTML with expressions for the customer first name, order number, and first product title. Keep it short, human, and signed with a real name.
  7. After the Gmail node, add a Set node that builds one row with the order number, email, product, and a status field of welcome_sent. On the false branch, build the same row with status skipped_repeat_buyer.
  8. Connect both branches into a single Google Sheets node that appends the row to a sheet called Welcome Log. End with a Respond to Webhook node returning a 200 status so Shopify treats the call as delivered.

Once all eight nodes light up green in a test run, switch the Webhook node to production mode and trigger a real test order in Shopify. You should see the email land in your inbox inside 10 seconds and the row appear in the sheet.

Common mistakes to avoid

The most frequent failure is sending the welcome email on every order instead of just the first one. The fix is to never trust customer.orders_count from the webhook payload alone, because Shopify sometimes sends that count before incrementing. Always re-fetch the customer through the Admin API, which returns the canonical value.

Second, people forget to verify the HMAC signature on the webhook. In production, add an extra Function node at the top that rejects any request whose X-Shopify-Hmac-Sha256 header does not match. Without it, anyone who guesses the URL can fire fake orders and mail your customers.

Third, Gmail rate limits. A single Gmail account can send about 500 messages a day on a personal plan and 2,000 on Workspace. If your store does more than that, route high volume days through a transactional provider and keep Gmail only for the first 100 welcomes.

Cost at realistic volume

For a store doing 30 first orders a day, the total cost is your n8n hosting. A $5 VPS on Hetzner or DigitalOcean handles thousands of executions a day with room to spare. Gmail is free on a personal account or $7 a month on Workspace if you already pay for it. Google Sheets for logging is free. Compared to Klaviyo’s entry plan, which starts at $20 a month for 500 contacts and climbs fast, this setup pays for itself in the first month and scales without the bill following.

If you run the same flow on 300 orders a day, you are still well inside Workspace limits and n8n is barely working. The only thing that changes is the size of the log sheet, which you can archive quarterly.

Get the ready-to-import template

Grab the full JSON template from our downloads page, import it into your n8n instance, plug in your Shopify and Gmail credentials, and activate. The whole setup takes about 20 minutes if your n8n is already running.

If you would rather skip the setup entirely, our n8n installation service wires this workflow into your Shopify store for a fixed fee, including HMAC verification, DNS records for Gmail sender reputation, and a tested welcome copy template. Delivery in 48 hours.

Related guides

For the broader picture of how these workflows fit together, read the pillar at n8n Shopify automation and browse every post in the Shopify category. A natural next step is the daily sales report to Telegram build, which reuses the same Shopify Admin API connection you just set up here.

FAQ

Does this work on Shopify Basic plan?

Yes. The orders/create webhook and the Admin API with read access to orders and customers are both available on every Shopify plan, including Basic. You only need a paid plan if you want to use Shopify Flow as an alternative, and this workflow replaces the need for that entirely.

Will Gmail flag these welcome emails as spam?

Not if your sending domain has SPF, DKIM and DMARC records set up. Because the email goes out through your actual Gmail account, it inherits your normal sender reputation. Avoid aggressive subject lines and stick to plain text or light HTML for the first few weeks to build trust.

Can I send the welcome from a shared inbox like hello@acme.com?

Yes. Set the Gmail credential to use the shared inbox as the authenticated account, or use the “send as” alias feature in Gmail. The workflow does not care which address sends the message, as long as the credential can authenticate against Google.

What happens if the webhook fails or n8n is down?

Shopify retries the webhook up to 19 times over 48 hours. If n8n is back online within that window, the welcome still goes out, possibly a few minutes late. For stricter reliability, queue the Shopify event to a Google Sheet first and have a second workflow process the queue every five minutes.

How is this different from Shopify Flow?

Shopify Flow is tied to Shopify, cannot make arbitrary HTTP calls without connector apps, and has no native Gmail node. n8n runs on your infrastructure, connects to any API you need, and lets you log, branch and enrich with nodes that Flow simply does not expose. It is also free once self-hosted.