Build a Shopify blog post generator from your products with n8n

A Shopify blog post generator from products in n8n turns your live catalog into a ready to review buying guide on a schedule, with no manual copy paste. Once a week the workflow pulls a collection, hands the product data to Google Gemini, and writes a clean HTML article straight into your Shopify blog as an unpublished draft. You skim it, tweak a line, and hit publish. This guide builds the whole thing, node by node, and explains where it beats the default of writing every post by hand.

What it does

The workflow runs on a weekly schedule and does five things in order. It reads the products in one Shopify collection through the Admin API, condenses them into a short product list, sends that list to Gemini with a copywriting prompt, saves the returned HTML as a draft article on your Shopify blog, and pings you on Telegram that a draft is waiting. Nothing goes live automatically. The article is created with published: false, so a human always approves the final wording before customers see it.

The output is a real blog post: a short intro, grouped product blurbs pulled from your actual titles, prices, and descriptions, and a closing line. It is the kind of “best of this collection” or seasonal gift guide that ranks for long tail queries and gives your email and social posts something to link to.

Why it beats the default

The default is a blank editor and a store owner who never quite finds an hour to fill it. Most Shopify blogs sit empty for months because writing product roundups by hand is slow and repetitive. This workflow removes the blank page. Gemini starts from your own catalog data, so the draft is specific to what you actually sell this week, not generic filler.

It also stays safe. Because every article lands as a draft, you keep full editorial control. The AI does the first 80 percent, you do the last 20 percent that matters: fact checks, brand voice, and the call to action. Compared with a paid content app, the running cost is close to zero on Gemini’s free tier, and you own the workflow instead of renting a black box.

What you need

  • A running n8n instance, either n8n cloud or self hosted.
  • A Shopify custom app access token with read_products and write_content scopes. Set this up once using the 2026 Shopify Dev Dashboard method, which replaced the old admin custom app screen.
  • A Google Gemini API key. The free tier of gemini-2.5-flash is enough for one post a week with room to spare.
  • A Telegram bot token and your chat ID for the review ping. You can swap this for Gmail or Slack if you prefer.
  • The numeric ID of the Shopify collection you want to feature and the ID of your blog. Both are visible in the Admin API or the store admin URL.

This pattern is part of the wider set of Shopify automations you can run in n8n. If you have connected Shopify to n8n before, you already have most of the prerequisites.

Node-by-node list

  • Weekly Schedule (Schedule Trigger): fires every Monday at 06:00.
  • Get Collection Products (HTTP Request): GET to /admin/api/2026-04/products.json?collection_id=...&limit=12 with the Shopify access token credential.
  • Build Product List (Edit Fields): maps the products array into a single readable string of title, price, and a trimmed description for each item.
  • Write Article with Gemini (HTTP Request): POST to the Gemini generateContent endpoint with a prompt that asks for clean HTML using only h2, p, ul, and li tags.
  • Extract Article (Edit Fields): pulls the generated text out of the Gemini response, strips any stray code fences, and sets a dated title.
  • Create Draft Article (HTTP Request): POST to /admin/api/2026-04/blogs/BLOG_ID/articles.json with published: false.
  • Notify on Telegram: sends a short message that a draft is ready to review.

Step-by-step build

  1. Add a Schedule Trigger node. Set the interval to weeks, trigger day Monday, hour 06. This is your publishing cadence, so adjust it to how often you want new drafts.
  2. Add an HTTP Request node named Get Collection Products. Method GET. URL https://YOUR_STORE.myshopify.com/admin/api/2026-04/products.json?collection_id=YOUR_COLLECTION_ID&limit=12. Under Authentication choose Predefined Credential Type, then Shopify Access Token API, and select your credential.
  3. Add an Edit Fields node named Build Product List. Add one string field called product_list and paste this expression: {{ $json.products.map(p => p.title + ' (' + p.variants[0].price + ' USD): ' + (p.body_html ? p.body_html.replace(/<[^>]+>/g, '').trim().slice(0, 140) : 'no description')).join('n') }}. This flattens the catalog into one clean block of text for the prompt.
  4. Add an HTTP Request node named Write Article with Gemini. Method POST. URL https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent. Authentication Predefined Credential Type, then Google Gemini (PaLM) API. Turn on Send Body, set Body Content Type to JSON, and in JSON put an expression that wraps your prompt: ask for a friendly buying guide in clean HTML with only h2, p, ul, and li tags, then append + $json.product_list.
  5. Add an Edit Fields node named Extract Article. Add a string field article_html set to {{ $json.candidates[0].content.parts[0].text.replace(/```html/g, '').replace(/```/g, '').trim() }}, and a second field article_title set to {{ 'Buying Guide — ' + $now.format('LLLL yyyy') }}.
  6. Add an HTTP Request node named Create Draft Article. Method POST. URL https://YOUR_STORE.myshopify.com/admin/api/2026-04/blogs/YOUR_BLOG_ID/articles.json, same Shopify credential. Send Body on, JSON, with an expression that builds { "article": { "title": ..., "body_html": ..., "published": false } } from the two fields above.
  7. Add a Telegram node named Notify on Telegram. Operation Send Message, set your chat ID, and write a short text that includes {{ $json.article.title }} so you know which draft landed.
  8. Wire the nodes in a single line from the trigger to Telegram, then run once manually to confirm a draft appears under Online Store, Blog posts in Shopify. When it looks right, activate the workflow.

Common mistakes

Setting published to true. Keep it false so nothing goes live without a human read. AI copy needs a quick fact check on prices and claims before it faces customers.

Using the wrong access scopes. Reading products needs read_products, and creating an article needs write_content. A token missing either scope returns a 403 and the run fails at the offending node.

Forgetting the collection ID or blog ID. The URLs use numeric IDs, not handles. Pull them from the Admin API or from the store admin URL, and paste the exact number.

Letting Gemini return markdown. Some responses wrap the HTML in a fenced code block. The Extract Article node strips ```html and ``` for that reason. Keep those replacements in place.

Cost at realistic volume

At one post a week the workflow is effectively free. A weekly run makes one Gemini call of a few thousand tokens, which sits comfortably inside the free tier of gemini-2.5-flash. The two Shopify Admin API calls and the Telegram message cost nothing. Even at a daily cadence, roughly 30 short generations a month, you stay within free limits for most stores. Your only real cost is the minute you spend approving each draft, and that is the point: you trade an hour of writing for a minute of editing.

Ready-to-import template

The guide above is free to follow end to end. If you would rather skip the build, the ready to import template is the same workflow, validated and wired, with placeholder credentials you swap for your own.

Download the template ($19) →

Want it installed and tuned to your store, collections, and brand voice? Our done-for-you setup service builds and hands it over running.

FAQ

Does this publish blog posts automatically?

No. Every article is created as a draft with published: false. The workflow writes the copy and files it in your Shopify blog, but a human opens it, checks the prices and claims, edits the voice if needed, and clicks publish. That keeps AI copy from reaching customers unreviewed.

Which AI model does it use?

Google Gemini, specifically gemini-2.5-flash on the free tier. One post a week is a single small call, well inside free limits. You can point the HTTP Request node at another model, but Gemini flash keeps the cost at zero for typical volumes without sacrificing quality.

Can I feature a specific collection each week?

Yes. The Get Collection Products node filters by a numeric collection_id, so it only pulls the products in that collection. Change the ID to feature a seasonal collection, new arrivals, or a clearance group. You can also duplicate the branch to cover several collections.

Do I need to connect Shopify to n8n first?

Yes. You need a Shopify access token with read_products and write_content scopes, created through the 2026 Dev Dashboard method. Follow the connect Shopify to n8n guide once, then reuse the same credential in both HTTP Request nodes here and in any other Shopify workflow.

What if I do not use Telegram?

Swap the final node for a Gmail or Slack node. The review ping just tells you a draft is ready, so any channel works. Point it at whichever inbox you actually watch, and include the article title so you know which draft to open in Shopify admin.

Related guides









Shopify webhooks in n8n explained (with a live order alert)







Shopify webhooks in n8n explained, without the jargon: a webhook is a message your store fires to a URL the instant something happens, like a new order landing or a product selling out. Instead of your automation nagging Shopify every few minutes to ask what changed, Shopify pushes the event to you the moment it occurs. This guide shows what webhooks are, why they beat scheduled polling for a Shopify store, and how to build a validated three node workflow that pings your phone on Telegram the second an order comes in.

What it does

The demo workflow watches a single Shopify event, the orders/create topic, and turns every new order into an instant Telegram message. When a customer checks out, Shopify delivers the full order payload to n8n, a Set node formats it into a short human readable summary, and a Telegram node sends it to your chat. You get a ping like this within a second of the sale:

🛒 New order #1042
Customer: Emily Rodriguez
Total: 128.40 USD
Items: 3
  

No dashboard refreshing, no email digest that arrives an hour late. The order alert reaches you while the customer is still on the thank you page. Once you understand this pattern, the same webhook plumbing drives every other real time Shopify automation you will ever build in n8n.

Why it beats the default

The common alternative is polling: a Schedule trigger that asks Shopify for recent orders every few minutes. Polling works, but it has three real costs. It is slow, because your alert is only as fresh as the interval, so a five minute schedule means a five minute delay. It is wasteful, because most of those requests return nothing new yet still count against your Shopify API rate limit. And it is fragile, because you have to track which orders you already saw to avoid sending duplicate alerts.

A webhook flips all three. Shopify only contacts you when the event genuinely happens, so the alert is near instant, you spend zero API calls waiting for nothing, and every delivery is a distinct event so there is no de-duplication logic to maintain. For anything that should feel live, a webhook is the correct tool.

Concern Polling on a schedule Shopify webhook
Latency As slow as the interval Under a second
API usage Constant, mostly empty checks Only on real events
Duplicate handling You track seen order IDs Each delivery is one event
Setup in n8n Schedule + list orders + filter One Shopify Trigger node

What you need

  • An n8n instance, either n8n Cloud or self hosted, version 1.0 or newer.
  • A Shopify store where you can create a custom app for API access. Follow our 2026 guide to connecting Shopify to n8n first, since the Shopify Trigger needs an access token credential.
  • A Telegram account and a bot token from BotFather, plus your numeric chat ID for the destination.
  • About 15 minutes to build from scratch, or 2 minutes with the ready made template.
📌

Note: the Shopify Trigger node only registers its webhook when the workflow is active. While you build and test in the editor, n8n uses a temporary test webhook. The permanent subscription is created the moment you toggle the workflow on.

Node-by-node list

Three nodes, one straight line. Here is what each one is and why it exists.

  • Shopify order webhook — a Shopify Trigger node set to the orders/create topic. This is the webhook. It registers the subscription with Shopify and fires once per new order, handing the full order object to the next node.
  • Build alert message — a Set (Edit Fields) node that reads the order fields and composes one tidy string. This keeps the message logic separate from the sending, so you can restyle the alert without touching Telegram.
  • Send Telegram alert — a Telegram node that posts the composed message to your chat. Swap it for a Gmail node later if you prefer email; the first two nodes stay identical.
┌──────────────────────────────────────────────────────────────┐
│  SHOPIFY WEBHOOK → TELEGRAM ORDER ALERT                        │
│                                                                │
│  [Shopify order webhook] → [Build alert message] → [Telegram]  │
│    orders/create             Set / Edit Fields       send      │
└──────────────────────────────────────────────────────────────┘
  

Step-by-step build

  1. Create a new workflow in n8n and add a Shopify Trigger node. In its settings, set Authentication to Access Token and pick the Shopify credential you created in the connection guide.
  2. In the same node, set the Topic to orders/create. That single choice tells Shopify to notify n8n every time an order is placed. Leave everything else at its default.
  3. Add a Set node (also called Edit Fields) and connect the trigger to it. Add one assignment named message of type String.
  4. Paste this expression as the value of message, using the expression editor so the {{ }} parts resolve against the order:
    🛒 New order {{ $json.name }}
    Customer: {{ $json.customer.first_name }} {{ $json.customer.last_name }}
    Total: {{ $json.total_price }} {{ $json.currency }}
    Items: {{ $json.line_items.length }}
  5. Add a Telegram node and connect the Set node to it. Choose your Telegram credential, set Resource to Message and Operation to Send Message.
  6. In the Telegram node, set Chat ID to your numeric chat ID, and set Text to the expression {{ $json.message }} so it sends the string the Set node built.
  7. Click Save, then toggle the workflow Active. Activating it is what registers the real webhook with Shopify. Place a test order, or use Shopify’s webhook test button, and watch the alert arrive in Telegram.
💡

Tip: to see the raw data before you format it, open the Shopify Trigger node and use “Listen for test event”, then place a test order. n8n captures one real payload so you can browse every available field like financial_status, shipping_address, or each line item’s title.

Common mistakes

  • Building the whole thing but never toggling the workflow Active. In test mode the webhook is temporary, so live orders never reach it. The permanent subscription exists only while the workflow is on.
  • Referencing a customer field on a guest checkout that has none. If some orders come in without a customer object, guard the expression, for example {{ $json.customer?.first_name || "Guest" }}, so the Set node never errors.
  • Using the wrong topic. orders/create fires on new orders; orders/paid fires only after payment clears. Pick the one that matches the moment you actually care about.
  • Expecting duplicate protection from n8n. Webhooks are one event per delivery, so if you also keep an old polling workflow running you will get two alerts. Retire the poller once the webhook works.

Cost at realistic volume

This workflow is close to free at any small store volume. Shopify does not charge for webhook deliveries. Telegram bot messages are free. On n8n Cloud, each order alert is a single execution, so a store doing 40 orders a day uses about 1,200 executions a month, which sits inside the entry paid tier. Self hosted n8n has no per execution cost at all.

Volume n8n executions / month Shopify + Telegram cost
10 orders / day ~300 $0
40 orders / day ~1,200 $0
150 orders / day ~4,500 $0

The only line item to watch is your n8n Cloud plan’s execution allowance. If order volume climbs into the thousands per day, self hosting removes that ceiling entirely.

Ready-to-import template

The guide above is free to follow, node for node. If you would rather skip the build, the downloadable template is the exact validated workflow from this post, ready to import in one click. Attach your Shopify and Telegram credentials and you are live in about two minutes. Want it built and connected for you end to end? See our done for you automation service.

Download the template ($9) →

Instant download · Works on n8n Cloud and self-hosted

Frequently asked questions

What is a Shopify webhook?

A Shopify webhook is a message your store sends to a URL the moment a specific event happens, such as an order being created or a product being updated. Instead of you asking Shopify for changes, Shopify pushes the event data to your automation the instant it occurs.

Do I need code to use Shopify webhooks in n8n?

No. The n8n Shopify Trigger node registers and manages the webhook for you when you pick a topic and activate the workflow. You never touch the Shopify admin webhook settings or write any listener code yourself, so a store owner with no backend can wire this up.

How many webhook topics can one workflow listen to?

Each Shopify Trigger node listens to exactly one topic, like orders/create or products/update. To react to several events, add one Shopify Trigger node per topic, or run separate workflows. Keeping one topic per trigger keeps your logic and your alerts clean and easy to debug.

Why use a webhook instead of polling Shopify on a schedule?

Polling means asking Shopify for new data every few minutes, which adds delay and burns API calls even when nothing changed. A webhook fires only when the event actually happens, so the alert is near instant and you stay well under Shopify API rate limits at any order volume.

Will the webhook still fire if my n8n instance is offline?

Shopify retries a failed webhook delivery several times over roughly two days, so a brief outage usually recovers on its own. If your instance stays down past the retry window, Shopify removes the subscription. Reactivating the workflow re-registers a fresh webhook automatically.

Related guides

n8n Shopify node guide: read and write your store data







This n8n Shopify node guide shows you exactly what the built-in Shopify node can do for a store owner, and how to wire it into a workflow that reads and writes real order data. Instead of hand-building Admin API calls, you pick a resource and an operation and fill in a few fields. To make it concrete, you will build a small workflow that checks for high-value orders every hour, tags them as VIP, and emails you a digest, all with the native node.

What it does

The Shopify node is n8n’s official connector for a Shopify store. It talks to the Shopify Admin API on your behalf, so you never write a raw request. You choose a resource (Order, Product, Customer) and an operation (Get, Get Many, Create, Update, Delete), and the node builds and sends the call.

The demo in this guide uses two of those operations back to back. First it reads recent orders with Order, Get Many. Then, for any order over a threshold, it writes a tag back with Order, Update. A short Code node formats a summary and Gmail sends it to you. It is a compact tour of the node’s two most common jobs, reading store data and pushing a change back.

Before any of this works, your Shopify credential has to be connected. If you have not done that yet, follow how to connect Shopify to n8n in 2026 first, which walks through the current Dev Dashboard method and the access token the node needs.

Why it beats the default

The manual alternative is an HTTP Request node pointed at https://your-store.myshopify.com/admin/api/2026-04/orders.json, with headers, query strings, and pagination you maintain by hand. That works, but every field is yours to get right, and a version bump or a typo in the header breaks it silently.

The built-in Shopify node removes most of that surface area:

  • Authentication is handled by the stored credential, so no access token sits in a header field.
  • Pagination is automatic when you turn on Return All, so you are not writing a loop over page_info cursors.
  • Operations are named in plain language, so Update an order is a dropdown choice, not a PUT you assemble.
  • Filters like Created At Min are labelled fields, not query parameters you have to remember.

You reach for a raw HTTP Request node only when you need an endpoint the node does not expose. For everyday order, product, and customer work, the node is faster to build and far easier to hand to someone else later.

What you need

  • An n8n instance (Cloud or self-hosted).
  • A Shopify store with a custom app / access token connected as an n8n credential. See the 2026 connection guide.
  • A Gmail account connected to n8n for the digest (or swap in Slack, Telegram, or plain SMTP).
  • About 20 minutes to build from scratch, or two minutes with the ready-to-import template below.

This pattern is one of many in our n8n Shopify automation hub; the node covered here is the building block behind most of them.

Node-by-node list

# Node Type Job
1 Every hour Schedule Trigger Runs the workflow once per hour.
2 Shopify – Get recent orders Shopify node (Order, Get Many) Reads orders created in the last hour.
3 Order total >= $200 Filter Keeps only orders at or above the VIP threshold.
4 Shopify – Add VIP tag Shopify node (Order, Update) Appends a “VIP” tag to each qualifying order.
5 Build digest Code Formats the tagged orders into an HTML list.
6 Email the digest Gmail Sends you the summary of what was tagged.
  [Every hour]
       |
  [Shopify: Get Many Orders]  --- reads recent orders
       |
  [Filter: total >= $200]
       |
  [Shopify: Update Order + VIP tag]  --- writes a change back
       |
  [Build digest] --> [Gmail: email you]

Step-by-step build

  1. Add a Schedule Trigger. Set the rule to run every 1 hour. This is the entry point; polling on a schedule means the workflow runs even on Shopify plans without webhook access.
  2. Add the Shopify node to read orders. Set Resource to Order and Operation to Get Many. Turn on Return All. Under options, set Created At Min to the expression ={{ $now.minus({ hours: 1 }).toISO() }} and Status to any. This pulls only orders from the last hour, which keeps the call small.
  3. Add a Filter node. Create one condition: left value ={{ $json.total_price }}, operator number is greater than or equal to, right value 200. Orders below the threshold stop here.
  4. Add the Shopify node to write the tag. Set Resource to Order, Operation to Update, and Order ID to ={{ $json.id }}. In Update Fields, add Tags with the expression ={{ $json.tags ? $json.tags + ', VIP' : 'VIP' }}. That appends VIP to whatever tags the order already had.
  5. Add a Code node. Set it to Run Once for All Items and paste the digest script (included in the template) that turns the tagged orders into an HTML list with order numbers and totals.
  6. Add a Gmail node. Set To to your address, Subject to ={{ $json.count }} new VIP orders tagged, and Message to ={{ $json.html }}.
  7. Attach credentials and save. Point both Shopify nodes at your store credential and the Gmail node at your Gmail credential, then toggle the workflow Active.
💡

Tip: The demo emails only when at least one order qualifies. If the Filter passes nothing, the branch after it never runs, so you are not spammed with empty “0 orders” messages.

Common mistakes

Overwriting tags instead of appending

Shopify stores tags as a single comma-separated string, and Update replaces the whole field. If you set Tags to just VIP, you erase every other tag on the order. Always read $json.tags first and append, as the expression above does.

Fetching the whole store every run

Turning on Return All with no date filter pulls your entire order history each hour. On a busy store that is thousands of records and needless API load. The Created At Min filter keeps each run to just the new orders.

Comparing price as text

Shopify returns total_price as a string like "249.00". Use a number comparison in the Filter so "90.00" is not treated as greater than "200.00" by alphabetical order. n8n’s loose type validation handles the conversion when the operator type is number.

Skipping the connection step

A red error on the Shopify node almost always means no credential is attached or the access token lacks a scope. Confirm the token has read_orders and write_orders using the connection guide before debugging anything else.

Cost at realistic volume

The node itself is free; you pay only for the tools around it. On n8n Cloud, one hourly run is 24 executions a day, about 720 a month, comfortably inside the Starter plan’s allowance. Self-hosted n8n is unlimited on your own server.

Piece Cost at this volume
Shopify Admin API Free (within standard rate limits)
n8n executions (~720/mo) Free self-hosted; within paid Cloud tiers
Gmail sends (a few/day) Free
Total $0 beyond your n8n plan

Even if you raise the schedule to every 15 minutes, you are still well under typical plan limits, because each run touches only the last window of orders.

Ready-to-import template

This guide is free to follow, top to bottom. If you would rather skip the wiring, the ready-to-import template drops the whole workflow into n8n in about two minutes, with both Shopify operations, the Filter, the digest Code node, and the Gmail step already built and set to inactive so you can add credentials safely.

Download the template ($13) →

Instant download · Works on n8n Cloud and self-hosted · Prefer it done for you? See our done-for-you automation service.

Frequently asked questions

Do I need code to use the n8n Shopify node?

No. The Shopify node is point and click: pick a resource like Order or Product, pick an operation like Get Many or Update, and fill in fields. The demo adds one small Code node only to format an email digest, and you can swap that for a plain notification if you want zero JavaScript.

What is the difference between the Shopify node and the Shopify Trigger?

The Shopify node performs actions on demand: get orders, update a product, create a customer. The Shopify Trigger starts a workflow when an event fires, such as an order being created. This guide polls with a Schedule Trigger, then uses the regular node to read and write, so it runs on plans without webhook access.

Which Admin API version should the Shopify node use?

Use a current stable version such as 2026-04. n8n manages the version for the built-in node, but if you ever call the Admin API through an HTTP Request node, put the version in the path and refresh it a few times a year, because Shopify retires old versions on a rolling schedule.

Why are order tags a single string and not a list?

Shopify stores tags as one comma-separated string. When you update tags you overwrite the whole field, so to add a tag you must read the existing tags and append. The demo does exactly that with an expression, which preserves any tags the order already had instead of wiping them.

Will the Shopify node hit rate limits on a big catalog?

It can if you fetch thousands of records with Return All. n8n paginates and generally respects Shopify limits, but for large pulls add a date filter so you only fetch recent records, and space heavy jobs out on a schedule rather than running them every minute.

Related guides

Shopify order validation agent in n8n: auto-flag risky orders

A Shopify order validation agent in n8n checks every new order against your own risk rules the moment it lands, then tags the risky ones and pings you on Telegram so you can hold them before they ship. This guide builds a rule-based validator that watches for incomplete addresses, billing and shipping country mismatches, unusually large quantities, and high-value first orders. No machine learning, no paid fraud app, just clear rules you control and can read at a glance.

What it does

The workflow listens for the Shopify orders/create event. For each new order it runs four checks and collects a list of reasons the order might need a human look:

  • The shipping address is missing a street, city, postal code, or country.
  • The billing country does not match the shipping country.
  • The order contains more total units than your normal ceiling (default 10).
  • It is the customer’s first order and the value is at or above your threshold (default 300 in the store currency).

If at least one rule fires, the order gets a review tag in Shopify and you receive a Telegram message listing exactly which rules tripped. If nothing fires, the workflow ends quietly and the order flows through untouched. You keep fulfilling clean orders at full speed and only slow down on the handful that actually warrant a second look.

Why it beats the default

Out of the box, Shopify shows a fraud risk indicator on the order page, but it is a black box: you see low, medium, or high with no way to add your own logic, and you only see it if you open each order. Store owners keep telling the same story in the Shopify community: an order looked fine, shipped same day, and turned into a chargeback a week later because the billing address was in one country and the parcel went to another.

A rule-based agent fixes three things. First, the rules are yours: if your average order is two items, you set the quantity ceiling to what is normal for your catalog, not a generic model’s idea of normal. Second, it is proactive: the flag reaches you on Telegram in seconds, before the order is picked and packed, instead of waiting for you to notice. Third, it is transparent: every flag comes with a plain-English reason, so a team member can act without guessing what the algorithm meant.

This is also different from an AI risk-scoring model. There is no probability, no training data, no cost per call. It runs on four if statements you can read and adjust in under a minute, which is exactly what most stores want for a first line of defense.

What you need

  • A running n8n instance (self-hosted or n8n Cloud).
  • A Shopify custom app with an Admin API access token. Follow connect Shopify to n8n in 2026 for the current Dev Dashboard method; the old admin custom-app screen no longer exists.
  • Admin API scopes read_orders and write_orders (the tag update needs write access).
  • A Telegram bot token from BotFather and your chat ID. Message your bot once, then read the chat ID from the getUpdates response.

The workflow uses only the built-in Shopify, Code, IF, and Telegram nodes, so there is nothing extra to install.

Node-by-node list

  • Shopify Trigger: fires on the orders/create topic and hands the full order object to the next node.
  • Check validation rules (Code node): runs the four checks, builds a reasons list, and computes the new tag string that appends review without dropping existing tags.
  • Flagged? (IF node): routes on the boolean flagged field. True goes to the tagging branch, false goes to a dead end.
  • Add review tag (Shopify node, order / update): writes the recalculated tags back to the order.
  • Send Telegram alert (Telegram node): sends the order number, customer email, total, and the numbered list of reasons.
  • No action needed (NoOp node): a clean end for orders that pass every rule.

Step-by-step build

  1. Add a Shopify Trigger node. Select your Shopify credential, set Topic to orders/create, and save. n8n registers the webhook with Shopify automatically when you activate the workflow.
  2. Add a Code node named “Check validation rules” and connect the trigger to it. Set Mode to “Run Once for Each Item” and paste the validation script (included in the template). The two limits, QTY_LIMIT and VALUE_LIMIT, sit at the top so you can tune them without reading the rest.
  3. Add an IF node named “Flagged?” and connect the Code node to it. Add one condition: left value {{ $json.flagged }}, operator “is true”. The true output is branch one, the false output is branch two.
  4. From the true output, add a Shopify node named “Add review tag”. Set Resource to Order, Operation to Update, Order ID to {{ $json.order_id }}, then under Update Fields add Tags with the value {{ $json.new_tags }}. Because the Code node already merged the existing tags with review, this update never erases tags a customer or another app set.
  5. Connect “Add review tag” to a Telegram node named “Send Telegram alert”. Choose your Telegram credential, set the chat ID, and paste the message body. Reference the Code node explicitly with {{ $('Check validation rules').item.json.reasons_text }} so the Shopify update response does not overwrite the values you want to show.
  6. From the false output of the IF node, add a NoOp node named “No action needed”. It documents the “order is clean” path so the canvas reads clearly.
  7. Place a test order in your store, or use Shopify’s order creation, and confirm the flagged path tags the order and delivers the Telegram message. When it looks right, toggle the workflow to Active.

Common mistakes

Overwriting existing tags

The Shopify order update replaces the entire tag string, it does not append. If you send only review, every other tag on the order disappears. The Code node avoids this by reading order.tags, splitting it, adding review, and joining it back. Keep that logic.

Reading order fields after the Shopify update

The Shopify node’s output is the updated order, so once it runs, {{ $json }} no longer points at your Code node’s data. Always reference the Code node by name in the Telegram message, as shown, or you will send blank fields.

Setting the quantity ceiling too low

A default of 10 is fine for stores that sell single items, but if you sell packs or wholesale, a normal order can be 30 units. Set QTY_LIMIT to something your real orders rarely cross, or every order gets flagged and the alert becomes noise you ignore.

Missing write scope

If the tag update returns a 403, your access token is missing write_orders. Read scope alone lets you fetch the order but not tag it.

Cost at realistic volume

Every tool in this workflow sits in a free tier at normal store volume. n8n self-hosted has no per-execution charge. On n8n Cloud, one order runs one execution, so 1,000 orders a month is 1,000 executions, well inside the Starter plan. The Shopify Admin API is free within its rate limits. Telegram bot messages are free. There is no AI model call and no fraud-app subscription, so the running cost of the validation itself is effectively zero. The only spend is your existing n8n plan.

Ready-to-import template

The guide above is free to follow end to end. If you would rather skip the build, the ready-to-import template drops the whole workflow into n8n in one click, with the four rules and the Telegram alert already wired. Swap in your credentials and set your two limits.

Download the template ($14) →

Want it built and tuned to your catalog for you? Our done-for-you automation service installs it, sets the thresholds around your real order data, and hands you a working agent.

FAQ

Does this replace Shopify’s built-in fraud analysis?

No, it complements it. Shopify’s risk indicator uses signals you cannot edit and only shows on the order page. This agent adds your own rules on top and pushes an alert to Telegram in real time, so you catch issues Shopify’s generic model does not weigh, like a country mismatch that matters for your shipping.

Can I add more validation rules?

Yes. The Code node is plain JavaScript, so you can push new reasons for anything in the order object: a mismatched email domain, a specific high-risk country, a discount stacked above a limit, or a gift card over a threshold. Add an if block that pushes a reason and the rest of the flow handles it.

Will it slow down my order fulfillment?

No. Clean orders take the NoOp path and are never touched, so they fulfill exactly as before. Only orders that trip a rule get tagged and alerted, and even those are still fulfillable; the tag and message are a heads-up, not a hold. You decide what to do next.

What if I do not use Telegram?

Swap the Telegram node for a Gmail or Slack node and keep everything else. The Code node already builds a reasons_text string, so any channel that accepts text works. Point the new node at the same field and you are done.

How do I stop false flags on legitimate large orders?

Raise QTY_LIMIT and VALUE_LIMIT to match your real order patterns, both set at the top of the Code node. You can also whitelist known wholesale customers by checking their email or tags and skipping the quantity rule for them.

Related guides







Shopify Product Catalog Sync to Notion with n8n








A Shopify product catalog sync to Notion keeps a Notion database mirrored to your live store, so your team plans merchandising, content, and pricing against real product data instead of a stale copy-paste. This guide builds the n8n workflow that pulls every product from Shopify on a schedule and upserts it into Notion, creating new pages and refreshing changed ones automatically. It is free to follow start to finish, and a ready-to-import template is linked below if you would rather skip the build.

Prefer to skip the setup? Grab the ready-made template and be running in under ten minutes.

What it does

This is a one-way, scheduled sync from Shopify to a Notion database. On a fixed interval, n8n asks the Shopify Admin API for your products, breaks the response into one item per product, and normalizes each one into a flat set of fields: title, SKU, price, total inventory, status, vendor, and a storefront link. For every product it then checks whether a matching page already lives in your Notion catalog, keyed on the Shopify product ID.

If a page exists, the workflow updates its price, inventory, and status. If it does not, the workflow creates a new page. The result is a Notion database that stays a faithful mirror of your catalog without anyone exporting a CSV. Notion becomes the planning surface your marketing, content, and ops people already live in, backed by live store data. This is one of the building blocks in our wider n8n Shopify automation library.

┌───────────────────────────────────────────────────────────────┐
│  SHOPIFY  ->  NOTION CATALOG SYNC                              │
│                                                               │
│  [Every 6 hours] -> [Get products] -> [Split] -> [Map fields] │
│                                                     │         │
│                                          [Find page in Notion]│
│                                                     │         │
│                                              [Page exists?]   │
│                                              /               │
│                                    [Update page]   [Create page]
└───────────────────────────────────────────────────────────────┘
  

Why it beats the default

The default way teams keep a product list in Notion is a manual export. You download a CSV from Shopify, paste it into a Notion table, and it is already out of date by the time you finish. Prices change, stock drops, a product gets archived, and the Notion copy quietly drifts from reality until nobody trusts it.

Notion has no native Shopify integration, so the usual alternative is a per-task automation platform. Those work, but they bill per operation. A catalog of a few hundred products checked several times a day burns through task quotas fast, and the cost climbs with your catalog. This n8n version runs on a flat plan or on your own server, upserts instead of blindly appending, so it never leaves duplicate rows, and it costs the same whether you sync 50 products or 5,000.

What you need

  • An n8n instance, either n8n Cloud or self-hosted. Any recent version works.
  • A Shopify store with an Admin API access token that has read_products scope. Create it through the 2026 Shopify Developer Dashboard and connect it to n8n as described in connect Shopify to n8n (2026). This workflow calls Admin API version 2026-04.
  • A Notion internal integration token, and a Notion database shared with that integration.

Your Notion database needs these properties, with these exact names and types, so the workflow can write to them:

Property Type Holds
Name Title Product title, for example Cedar Camp Mug
Shopify ID Text The Shopify product ID, the match key for upserts
Price Number First variant price, for example 24.00
Inventory Number Sum of variant inventory quantities
Status Select active, draft, or archived
SKU Text First variant SKU
Vendor Text Product vendor
Storefront URL Public product page link

Node-by-node list

  1. Every 6 hours (Schedule Trigger): fires the sync on a fixed interval.
  2. Get Shopify products (HTTP Request): GET /admin/api/2026-04/products.json?limit=250.
  3. Split into products (Split Out): turns the products array into one item per product.
  4. Map product fields (Edit Fields): normalizes each product into flat fields for Notion.
  5. Find existing page (Notion, Get Many database pages): searches Notion for a page whose Shopify ID matches.
  6. Page exists? (IF): routes on whether a matching page was found.
  7. Update Notion page (Notion, Update): refreshes price, inventory, and status on the existing page.
  8. Create Notion page (Notion, Create): adds a new catalog page for products not yet in Notion.

Step-by-step build

  1. Add a Schedule Trigger. Set it to run every 6 hours. This is the only trigger in the workflow.
  2. Add an HTTP Request node named Get Shopify products. Method GET, URL https://YOUR_STORE.myshopify.com/admin/api/2026-04/products.json?limit=250. Under Authentication choose Generic Credential Type, then Header Auth, and attach your Shopify token credential (header X-Shopify-Access-Token).
  3. Add a Split Out node named Split into products. Set Field To Split Out to products. The Shopify response is one object with a products array, so this hands the rest of the flow one item per product.
  4. Add an Edit Fields node named Map product fields. Create string and number assignments that pull from each product:
    • product_id = {{ $json.id.toString() }}
    • product_title = {{ $json.title }}
    • sku = first variant SKU
    • price = first variant price, as a number
    • inventory = sum of variant inventory quantities
    • status, vendor, and a storefront_url built from the handle
  5. Add a Notion node named Find existing page. Resource Database Page, operation Get Many. Pick your database, set Return All off with Limit 1, and add a filter: your Shopify ID property equals {{ $json.product_id }}. In the node Settings tab, turn on Always Output Data so the node still emits an item when no page is found.
  6. Add an IF node named Page exists?. Condition: {{ $json.id }} is not empty. When Notion returned a page it carries an id; when it found nothing the item is empty, so the true branch means update and the false branch means create.
  7. On the true branch, add a Notion node named Update Notion page. Operation Update, Page ID {{ $json.id }}. Map Price, Inventory, Status, SKU, and Storefront from the earlier node with {{ $('Map product fields').item.json.price }} and the like.
  8. On the false branch, add a Notion node named Create Notion page. Operation Create, pick the same database. Set the title to the product title and map Shopify ID, Price, Inventory, Status, SKU, Vendor, and Storefront from Map product fields.
  9. Wire it up: Schedule Trigger to Get Shopify products to Split into products to Map product fields to Find existing page to Page exists?, then the two branches to Update and Create.
  10. Save, run once manually, and check your Notion database. Run it a second time to confirm existing pages update rather than duplicate.
💡

Tip: Referencing $('Map product fields').item.json on both branches is what lets you drop the Notion search result and still write your product fields. There is no Merge node to configure, which keeps the two write branches clean.

Common mistakes

  • Forgetting Always Output Data on the search node. Without it, a product with no existing Notion page produces zero items, the IF never fires, and new products silently never get created. This is the single most common reason the sync appears to work but never adds anything.
  • Catalogs over 250 products. One request returns at most 250. Shopify paginates with a Link header cursor. Add a loop that follows page_info until the header is empty, or move to the GraphQL Admin API with cursor pagination.
  • Notion property name or type drift. n8n writes by property name. If Notion has Stock but the node writes Inventory, that column stays blank with no error. Keep names and types aligned with the table above.
  • Status Select options missing. If your Status property does not already contain the option being written, Notion may reject it. Pre-create active, draft, and archived, or allow n8n to add options.
  • Rate limits on large catalogs. The per-product loop calls Notion for every item. Notion allows roughly three requests per second. For big catalogs, add a small Loop Over Items batch or a short Wait so you stay under the limit.

Cost at realistic volume

All three services carry this workflow for free or close to it. The Shopify Admin API and the Notion API are both free to call at this scale. n8n Cloud counts workflow executions, not nodes or items, so a run every six hours is about 120 executions a month regardless of catalog size, which sits comfortably inside the Starter plan. Self-hosted n8n is free outright.

Component At 500 products, synced every 6 hours Cost
n8n executions ~120 per month (4 runs a day) Free tier / flat plan
Shopify Admin API ~120 product pulls per month $0
Notion API writes Up to ~60,000 upserts per month $0

Because n8n bills per execution rather than per operation, the cost does not grow with your catalog. The same run that syncs 500 products syncs 5,000 for the same execution count.

Download the ready-to-import template

The guide above is free to follow and gives you the whole workflow. If you would rather not wire eight nodes and map every Notion property by hand, the template imports the exact workflow from this post in one step. You attach your Shopify and Notion credentials, point it at your database, and the sync is live. Need it built and hosted for you instead? See our done-for-you automation service.

Download the template ($19) →

Instant download · Works on n8n Cloud and self-hosted · Matches this guide node for node

Frequently asked questions

Does this workflow create duplicate pages in Notion?

No. Before writing anything, the workflow searches your Notion database for a page whose Shopify ID matches the current product. If it finds one, it updates that page. If it does not, it creates a fresh page. That match-then-branch pattern is what makes it an upsert rather than a blind append.

How often should the catalog sync run?

Every six hours is a sensible default for a store that edits products a few times a day. If pricing or inventory changes constantly, drop it to hourly. For a small, stable catalog, once a day is plenty. You change this in the Schedule Trigger node in one click.

What if my store has more than 250 products?

The single HTTP Request returns up to 250 products. For larger catalogs, Shopify paginates with a Link header cursor. Add a loop that follows page_info until the header is empty, or switch to the GraphQL Admin API with cursor pagination. The Common mistakes section covers the fix.

Do the Notion property names have to match exactly?

Yes. n8n writes to Notion properties by name, so Price, Inventory, Status, SKU, and Storefront must exist and use the exact types the workflow expects. If you rename a property in Notion, update the matching field in the Create and Update nodes or the write silently misses that column.

Can I sync to Airtable or Google Sheets instead of Notion?

Yes. The Shopify pull and the field mapping stay identical. Swap the two Notion nodes for an Airtable upsert or a Google Sheets append-or-update on a key column. The logic is the same: match on Shopify ID, then update or create. Only the destination node changes.

Related guides

n8n
Shopify
Notion
catalog sync
automation

Shopify new product announcement email and Telegram automation with n8n











A Shopify new product announcement should go out the moment a product goes live, not whenever you next remember to write an email. This n8n workflow watches your store for new products and, the instant one is created, drafts a short launch blurb with Google Gemini, emails your subscriber list through Gmail, and posts the same news to a Telegram channel. No copy-paste, no scheduling, no missed launches. Below is the full build, the exact node setup, and a ready-to-import template.

What it does

The workflow connects three moving parts around one event: a product being created in Shopify. When that happens, it pulls the product title, price, image, vendor, and URL, sends that data to Gemini for a two-sentence announcement, then fans the finished message out to two channels at once.

  • You publish a new product in Shopify as you normally would.
  • n8n catches the products/create event automatically.
  • Gemini writes a short, upbeat launch line from the product details.
  • Your email list receives a clean HTML announcement through Gmail.
  • Your Telegram channel gets the same news posted at the same moment.

For a first look at how Shopify data reaches n8n, the pillar guide on n8n Shopify automation covers the connection basics that this workflow builds on.

Why it beats the default

Shopify has no built-in “announce this product everywhere” button. The manual routine is familiar: add the product, switch to your email tool, write a subject line, paste the product link, find the image, hit send, then repeat the whole thing in your Telegram community. Every step is a chance to delay, to forget, or to send a broken link.

Shopify Flow can react to product events, but it lives inside Shopify and cannot post to an arbitrary Telegram channel or call Gemini for copy. Zapier can, but you pay per task and stitching two destinations plus an AI step onto one trigger adds up fast. With n8n you own the logic, run it on the free tier or your own server, and pay nothing per announcement. One event, two channels, AI-written copy, zero recurring task fees.

What you need

  • An n8n instance (cloud or self-hosted). New to it? Start with the pillar on n8n Shopify automation.
  • A Shopify custom app access token. Follow connect Shopify to n8n (2026 method) for the current Dev Dashboard flow.
  • A Gmail account for the broadcast (free tier sends up to 500 messages per day).
  • A Google Gemini API key (free tier, gemini-2.5-flash).
  • A Telegram bot token and a channel where the bot is an admin.

Build time: about 30 minutes from scratch, or under 10 minutes with the template at the end of this guide.

Node-by-node list

Six nodes, in a straight line that splits into two at the end. Here is the full map before we configure anything.

  SHOPIFY NEW PRODUCT ANNOUNCEMENT

  [New product created]        Shopify Trigger  (products/create)
          |
  [Extract product fields]     Set              (title, price, image, url)
          |
  [Write blurb with Gemini]    HTTP Request     (Gemini generateContent)
          |
  [Build email and message]    Set              (email HTML + Telegram text)
          |
     +----+----+
     |         |
 [Email the  [Post to Telegram
  list]        channel]
 Gmail         Telegram
# Node Type Job
1 New product created Shopify Trigger Fires on the products/create event
2 Extract product fields Set Pulls title, price, image, vendor, URL from the payload
3 Write blurb with Gemini HTTP Request Sends product data to Gemini, gets a launch line back
4 Build email and message Set Assembles the HTML email body and the Telegram text
5 Email the list Gmail Sends the announcement to your list address
6 Post to Telegram channel Telegram Posts the same announcement to your channel

Step-by-step build

1. New product created (Shopify Trigger)

Add a Shopify Trigger node. Set Authentication to Access Token and attach your Shopify credential. Under Topic, choose products/create. n8n registers the webhook with Shopify for you, so nothing needs configuring inside the Shopify admin. When you save and activate the workflow, every newly created product will push its full payload here.

💡

Tip: Use the “Listen for test event” button, then create a draft product in Shopify to capture a real payload. Working against live data makes the next steps much easier.

2. Extract product fields (Set)

Add a Set (Edit Fields) node. The raw Shopify payload is large, so pull out only what the announcement needs. Create these assignments:

title   = {{ $json.title }}
handle  = {{ $json.handle }}
price   = {{ $json.variants[0].price }}
image   = {{ $json.image.src }}
vendor  = {{ $json.vendor }}
url     = https://YOUR_STORE.myshopify.com/products/{{ $json.handle }}

Replace YOUR_STORE with your store subdomain, or use your primary domain if you have one attached. After this node the data is small and predictable:

{
  "title": "Cedar & Sage Travel Candle",
  "handle": "cedar-sage-travel-candle",
  "price": "24.00",
  "image": "https://cdn.shopify.com/s/files/1/candle.jpg",
  "vendor": "Northwind Goods",
  "url": "https://yourstore.myshopify.com/products/cedar-sage-travel-candle"
}

3. Write blurb with Gemini (HTTP Request)

Add an HTTP Request node. Set the method to POST and the URL to the Gemini endpoint:

https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent

Set Authentication to Generic Credential Type, then Header Auth, and attach a header credential holding x-goog-api-key with your Gemini key as the value. Under Body, choose JSON and paste:

{
  "contents": [
    { "parts": [
      { "text": "Write a short launch announcement for a new online store product. Two sentences, under 40 words, upbeat but not salesy, no emojis, no hashtags. Product name: {{ $json.title }}. Price: {{ $json.price }}. Brand: {{ $json.vendor }}." }
    ] }
  ],
  "generationConfig": { "temperature": 0.7, "maxOutputTokens": 120 }
}

Gemini returns the copy at candidates[0].content.parts[0].text, which the next node reads.

📌

Note: Keep the Gemini key in a Header Auth credential, not typed into the URL. Putting an API key in a query string leaks it into logs and execution history.

4. Build email and message (Set)

Add a second Set node to assemble both outputs. Reference the earlier node by name so the product data and the Gemini blurb combine cleanly.

blurb        = {{ $json.candidates[0].content.parts[0].text.trim() }}

emailHtml    = <h2>Just launched: {{ $('Extract product fields').item.json.title }}</h2>
               <p>{{ $json.candidates[0].content.parts[0].text.trim() }}</p>
               <p><strong>Price:</strong> {{ $('Extract product fields').item.json.price }}</p>
               <p><a href="{{ $('Extract product fields').item.json.url }}">Shop it now</a></p>

telegramText = New product: {{ $('Extract product fields').item.json.title }}
               {{ blurb }}
               Price: {{ $('Extract product fields').item.json.price }}
               {{ $('Extract product fields').item.json.url }}

5. Email the list (Gmail)

Add a Gmail node set to Send. Put your list or Google Group address in To (for example announcements@yourstore.com). Set Subject to New arrival: {{ $('Extract product fields').item.json.title }}, choose HTML as the email type, and set the message to {{ $json.emailHtml }}. Attach your Gmail OAuth2 credential.

💡

Tip: Send to a Google Group or a single broadcast address and put real subscribers in BCC-managed groups. Gmail is fine for small lists; move to a dedicated email service once you pass a few hundred recipients.

6. Post to Telegram channel (Telegram)

Add a Telegram node set to Send Message. In Chat ID, enter your channel username such as @yourstore_news. Set the text to {{ $json.telegramText }} and attach your Telegram bot credential. Connect both this node and the Gmail node to the output of Build email and message so they run in parallel.

📌

Note: The bot must be an admin of the channel before it can post. Add it as an administrator in your Telegram channel settings first, otherwise the node returns a 403 error.

Common mistakes

  • Announcing a bulk import. The products/create topic fires once per product. Deactivate the workflow before importing a catalog, then turn it back on.
  • Putting the Gemini key in the URL. Use a Header Auth credential with x-goog-api-key so the key stays out of logs.
  • Bot not an admin. A Telegram bot cannot post to a channel it does not administer. Add it as an admin first.
  • Wrong price field. Price lives at variants[0].price, not on the product root. Products with no variant will error, so guard the expression if you sell single-variant and multi-variant items.
  • Draft products triggering. Depending on how you publish, unfinished drafts can fire the event. Add a Filter node checking status is active if that is a problem.

Cost at realistic volume

Assume a store that launches 20 new products a month, each announced to an email list and a Telegram channel.

Service Usage Monthly cost
n8n (self-hosted or free cloud runs) 20 executions $0
Google Gemini (gemini-2.5-flash) 20 short generations $0 on the free tier
Gmail 20 broadcast sends $0 (well under 500/day)
Telegram Bot API 20 channel posts $0

At this volume the entire pipeline runs for nothing. The only point where cost enters is email scale: once your list grows past a few hundred recipients, Gmail is the wrong tool and you would route the send through a dedicated email service, which is a one-node swap.

🚀 Get the new product announcement template

The full guide above is free to follow. If you would rather skip the build, the ready-to-import template drops the exact six-node workflow into n8n so you only add your credentials and go live.

Download the template ($19) →

Instant download · Works on n8n Cloud and self-hosted · Prefer it done for you? See our done-for-you service.

Frequently asked questions

Does this fire automatically when I add a product in Shopify?

Yes. The workflow starts from a Shopify trigger listening to the products/create topic, so every time you publish a new product the announcement runs on its own. You never open n8n to send it, and there is no schedule to manage or forget.

Can I skip the AI blurb and write my own copy?

Absolutely. Delete the Gemini HTTP Request node and reconnect Extract product fields straight to Build email and message. Then hardcode your announcement text in the Set node instead of referencing the Gemini output. The email and Telegram steps work exactly the same.

Will this spam my list if I bulk-import a catalog?

It can. The products/create topic fires once per product, so a 200-item import means 200 emails. Before a bulk upload, deactivate the workflow, import, then reactivate. For ongoing control, add a Filter node that only announces products carrying a specific tag such as launch.

Do I need a paid Gmail or Gemini account?

No. Gmail free tier sends up to 500 emails a day, which covers a single broadcast address or Google Group. Google Gemini has a free tier for gemini-2.5-flash that easily handles one short blurb per product. For large subscriber counts, swap Gmail for a dedicated email service.

Can I post to a Telegram group instead of a channel?

Yes. Set the chatId in the Telegram node to your group ID or channel username. For a public channel use the @handle; for a private group use the numeric chat ID. The bot must be a member of the group or an admin of the channel to post.

Related guides

Shopify API authentication in n8n: custom app token vs OAuth2











Shopify API authentication in n8n is the step that stalls most store owners before a single workflow runs, usually with a blunt 401 Unauthorized and no clue why. This guide clears it up: the difference between a custom app access token and OAuth2, which one your store actually needs, how to attach the credential to both the Shopify node and a plain HTTP Request, the scopes that matter, and a repeatable way to catch a broken connection before your automations quietly fail.

New to connecting Shopify and n8n at all? Start with the 2026 Shopify to n8n connection walkthrough first, then come back here for the auth mechanics and error fixes.

What it does

This guide gives you two things. First, a clear model of how Shopify authenticates API calls and how n8n plugs into that model, so you stop guessing. Second, a small, importable workflow that puts the theory to work: it calls the Shopify shop.json endpoint on a schedule using your credential, checks the response, and pings Telegram the moment authentication breaks. That last part matters because a revoked token or an expired API version fails silently, and you often only notice when a day of orders never synced.

Shopify offers two authentication methods for the Admin API, and n8n supports both as native credential types:

  • Custom app access token — a single permanent token you create inside your own store’s admin. This is the right choice for automating one store you control.
  • OAuth2 — the standard install flow used when an app connects to stores owned by other people. n8n runs the OAuth handshake and stores the resulting token for you.

Why it beats the default

The instinct is to paste an API key straight into an HTTP Request node and move on. That works until it does not, and when it fails the error is always the same unhelpful 401. The approach here is better for three reasons.

You create the credential once and reuse it everywhere. Both the Shopify node and any HTTP Request node point at the same stored credential, so rotating a token is a one-place change instead of a hunt through every workflow. n8n injects the X-Shopify-Access-Token header for you, so the token never sits in plain text inside a node parameter or an exported JSON file. And because the same credential drives the raw HTTP calls, you can reach endpoints the Shopify node does not expose, like shop.json, without a second set of keys.

The health-check pattern on top of that turns authentication from a thing you hope still works into a thing you get told about. Six times a day it proves the token is valid, and if it is not, you hear about it in Telegram in seconds rather than in a customer complaint next week.

What you need

  • An n8n instance, cloud or self-hosted, version 1.0 or newer.
  • A Shopify store where you are staff with permission to create a custom app. Custom apps are created through the store admin at Settings → Apps and sales channels → Develop apps, which Shopify surfaces via the modern Dev Dashboard flow. See the connection walkthrough for the click-by-click on generating the token.
  • A Telegram bot token and your chat ID, for the failure alert. Swap in Gmail if you prefer email.
  • Roughly 20 minutes to build from scratch, or a couple of minutes with the template below.

Node-by-node list

The workflow is six nodes and one clean path with a single branch at the end.

[Every 6 Hours]      Schedule trigger
      |
[Store Config]       your myshopify domain + API version
      |
[Call Shop Endpoint] HTTP Request -> GET /admin/api/2026-04/shop.json
      |               (Shopify Access Token credential, neverError on)
[Auth OK?]           IF statusCode == 200
      |------ true  --> [Healthy Summary]   Set node, records the shop name
      |------ false --> [Send Auth Alert]   Telegram warning with the status code
  
Node Type Job
Every 6 Hours Schedule Trigger Runs the check four times a day.
Store Config Set Holds your shopDomain and apiVersion so the URL stays readable.
Call Shop Endpoint HTTP Request Authenticated GET to shop.json, configured to never throw so a 401 is captured, not crashed on.
Auth OK? IF Passes when the HTTP status code is exactly 200.
Healthy Summary Set On success, writes a one-line status with the store name and plan.
Send Auth Alert Telegram On failure, sends the status code and a snippet of the error body.

Step-by-step build

  1. Create the Shopify credential. In n8n go to Credentials, click New, and search for Shopify Access Token API. Enter your store’s subdomain (the part before .myshopify.com), the API key and secret from your custom app, and the access token. Save it. This is the custom app token method. For OAuth2, pick Shopify OAuth2 API instead and complete the Connect flow in the browser.
  2. Add the Schedule Trigger. Drop a Schedule Trigger node and set the interval to every 6 hours. This is your entry point.
  3. Add a Set node named Store Config. Create two string fields: shopDomain set to your-store.myshopify.com and apiVersion set to 2026-04. Keeping these in one place means you never hunt through a URL to change the version.
  4. Add the HTTP Request node. Set method to GET and the URL to =https://{{ $json.shopDomain }}/admin/api/{{ $json.apiVersion }}/shop.json. Under Authentication choose Predefined Credential Type, then set the credential type to Shopify Access Token API and select the credential you made in step 1. This is the key move: the HTTP node reuses the Shopify credential and adds the auth header for you.
  5. Make the request forgiving. In the HTTP node’s Options, add Response and turn on Full Response and Never Error. Full Response exposes the status code; Never Error stops a 401 from halting the run so your IF node can react to it.
  6. Add the IF node named Auth OK? Set the condition to Number, left value ={{ $json.statusCode }}, operation equals, right value 200.
  7. Wire the true branch to a Set node. Name it Healthy Summary and write one string field, for example =Shopify API OK — {{ $json.body.shop.name }} (plan: {{ $json.body.shop.plan_name }}). Send this to a log, a sheet, or nowhere; the point is a clean success record.
  8. Wire the false branch to Telegram. Set the chat ID to your own and the text to something like =Shopify API auth failed — HTTP {{ $json.statusCode }}. Check the token, scopes, and API version. Save the workflow and toggle it Active.
💡

Tip: Want to test the connection right now instead of waiting six hours? Add a Manual Trigger node next to the schedule and wire it into Store Config too. Click Test workflow and you get an instant pass or fail.

Common mistakes

  • Using a custom domain in the URL. The Admin API only answers on your-store.myshopify.com, never on your storefront domain. A request to the pretty domain returns 401 or 404.
  • Missing scopes. A token is valid but scoped. If a workflow reads orders, the custom app needs read_orders; for products, read_products. The shop.json check works with a minimal token, so a health check can pass while a real workflow still 401s on a resource whose scope you forgot to grant.
  • Confusing OAuth2 with the token method. Picking Shopify OAuth2 API for a store you own means running an install flow you do not need. For your own store, the access token credential is simpler and never expires.
  • Leaving the API version stale. An old version in the URL keeps working until Shopify retires it, then every call fails at once. Pin a recent version like 2026-04 and bump it on a calendar reminder.
  • Copying the token with a trailing space. A stray space or newline pasted into the credential is a classic silent 401. Retype the last character if a fresh token still fails.
  • Not turning on Never Error. Without it, a 401 throws and the IF branch never runs, so your alert never fires and the failure stays invisible.

Cost at realistic volume

This one is close to free. The health check makes four API calls a day, about 120 a month, which is nothing against Shopify’s rate limit of two requests per second on the standard REST bucket. Telegram messaging is free. On self-hosted n8n your only cost is the server you already run. On n8n Cloud, four scheduled executions a day sit comfortably inside the Starter plan’s monthly execution allowance, so the marginal cost of running this is effectively zero. The token and the Shopify Admin API themselves cost nothing on any Shopify plan.

Item Volume Cost
Shopify Admin API calls ~120 / month $0
Telegram alerts only on failure $0
n8n executions 4 / day $0 self-hosted, within Starter on Cloud

Get the Shopify API Auth Health Check template

The guide above is free to follow. If you would rather skip the build, the ready-to-import template is the exact six-node workflow, credentials pre-slotted, so you drop in your token and switch it on in a couple of minutes.

Download the template ($12) →

Instant download · Works on n8n Cloud and self-hosted · Prefer it fully set up for you? See our done-for-you service.

Frequently asked questions

Do I use a custom app access token or OAuth2 for Shopify in n8n?

For a single store you own, use a custom app access token. It is one credential, never expires, and is the fastest path. Use OAuth2 only when you build an app that connects to stores you do not own and need each merchant to grant access through the standard install flow.

Why does my Shopify request return 401 in n8n?

A 401 almost always means the access token is wrong, was regenerated, or is missing the scope the endpoint needs. Confirm the token in your credential matches the custom app, check the app has the read scope for that resource, and make sure the URL uses your myshopify.com domain, not a custom domain.

Which Shopify API version should I put in n8n?

Use a current stable version such as 2026-04 in the URL path, for example /admin/api/2026-04/shop.json. Shopify supports each version for about a year, so pin a recent one and update it a couple of times a year rather than leaving an old version that will eventually be retired.

Does the Shopify node in n8n handle authentication for me?

Yes. The built-in Shopify node uses the same Shopify Access Token or OAuth2 credential and injects the auth header automatically. For endpoints the node does not expose, such as shop.json, use an HTTP Request node with the Predefined Credential Type set to Shopify Access Token so it reuses that same credential.

Is it safe to store my Shopify access token in n8n?

Yes. n8n stores credentials encrypted and never exposes the token in execution logs or exported workflows. Keep your custom app scoped to only the permissions the workflow needs, and rotate the token if you ever share a workflow export, since a leaked token grants API access to your store.

Related guides

n8n
Shopify
API authentication
OAuth2
automation

Ecommerce Automation With n8n: 12 Workflows Worth Building First











Ecommerce automation with n8n lets you wire your store to the tools you already use, such as Google Sheets, Telegram, Gmail, and your CRM, without paying for a stack of single-purpose apps. This guide maps the workflows worth building first, explains why n8n beats the default app-per-task approach, and walks you through a working starter automation that logs every new order to a spreadsheet and pings you on Telegram the moment it lands.

What ecommerce automation with n8n actually covers

n8n is an open-source automation tool. You build workflows on a visual canvas by connecting nodes: something triggers the flow (a new order, a schedule, a low-stock event), the data gets shaped, and one or more actions fire (a row appended, an email sent, a channel pinged). For an online store, that maps onto a handful of jobs you run over and over. Here are the ones most stores automate first, each with a full how-to if you want to go deep on that one.

Orders and fulfillment

Inventory and catalog

Customers and retention

That is the roundup. If you run Shopify specifically, the n8n Shopify automation hub is the deeper index of every Shopify build on this site. This page is the broader ecommerce view, and every workflow above works just as well on WooCommerce through its own node. New to connecting a store at all? Start with connecting Shopify to n8n, or the WooCommerce setup guide.

Why it beats the default

The default path is one app per task. An app for order alerts, another for spreadsheet exports, another for review requests, each with its own monthly fee and its own dashboard. Three or four of those and you are paying more every month than a whole automation platform costs, with data scattered across tools that do not talk to each other.

n8n flips that. One instance owns all of it, and the workflows share data. The same order that gets logged to a sheet can trigger the low-stock check and the customer tag in the same run. A few concrete advantages:

  • Flat cost. Self-hosted n8n runs unlimited executions on a 5-dollar VPS. You are not billed per task or per contact.
  • No platform lock-in. The Shopify node and the WooCommerce node live in the same tool, so switching or running both stores is a node swap, not a rebuild.
  • You own the logic. Export any workflow as JSON, back it up, share it, or move it to another server. Nothing is trapped behind a vendor account.
  • Composable. Every workflow can call the next. That is impossible when each task lives in a separate closed app.

What you need

To build the starter workflow below (a new order that logs to a sheet and alerts you on Telegram) you need four things:

  • An n8n instance, cloud or self-hosted. The workflow imports the same on either.
  • A Shopify store connected to n8n with an Admin API access token. Follow the 2026 connection guide first if you have not done this. (On WooCommerce, swap the trigger for the WooCommerce Trigger node; the rest is identical.)
  • A Google account with a blank spreadsheet to receive the order rows.
  • A Telegram bot token and your chat ID for the alert. Message @BotFather to create a bot, and @userinfobot to read your chat ID.

Build time: about 20 minutes from scratch, or under 5 minutes if you import the ready-made template below.

Node-by-node list

The starter is four nodes. Data flows from the trigger, gets shaped once, then fans out to both actions in parallel.

  New Shopify Order  -->  Build Order Summary  -->  Log to Google Sheets
     (trigger)             (Set fields)          
                                                   -->  Send Telegram Alert
  
# Node Type Job
1 New Shopify Order shopifyTrigger Fires on orders/create and hands over the raw order.
2 Build Order Summary set (Edit Fields) Pulls five clean fields out of the order payload.
3 Log to Google Sheets googleSheets Appends one row to your Orders sheet.
4 Send Telegram Alert telegram Sends the summary to your chat.

Step-by-step build

  1. Add the trigger. Drop in a Shopify Trigger node, set Authentication to Access Token, attach your Shopify credential, and set the topic to orders/create. n8n registers the webhook with Shopify for you.
  2. Shape the data. Add an Edit Fields (Set) node. Create five string fields so the rest of the flow works with clean values instead of the deep order object:
    order_number   = {{ $json.order_number }}
    customer_name  = {{ $json.customer.first_name }} {{ $json.customer.last_name }}
    total          = {{ $json.total_price }}
    currency       = {{ $json.currency }}
    placed_at      = {{ $json.created_at }}
  3. Log to the sheet. Add a Google Sheets node, operation Append Row. Pick your spreadsheet and the Orders tab, then map the columns to the five fields above (Order, Customer, Total, Currency, Placed at).
  4. Send the alert. Add a Telegram node, operation Send Message. Paste your chat ID and set the text to an expression:
    New order {{ $json.order_number }}
    Customer: {{ $json.customer_name }}
    Total: {{ $json.total }} {{ $json.currency }}
  5. Fan out in parallel. Wire the Set node to both the Google Sheets node and the Telegram node. One output can feed two nodes, so a single order is logged and alerted in the same run.
  6. Save and activate. Save the workflow, toggle it Active, and place a test order (or use a Shopify test payment). A row appears in your sheet and a message hits Telegram within seconds.
💡

Tip: Keep the Set node even for tiny flows. Shaping the order once, up front, means every downstream node reads the same five fields. When you add a third action later (an email, a CRM push), it just reuses them.

Common mistakes

  • Referencing the raw order everywhere. Without the Set node, each action digs into $json.customer.first_name and friends on its own. One payload change and you fix it in five places. Shape once, reference the clean field.
  • Chaining actions instead of fanning out. If you wire Sheets, then Telegram after it, a Sheets error blocks the alert. Branch both off the Set node so they run independently.
  • Wrong Shopify auth. The removed legacy custom-app flow no longer applies. Use an Admin API access token via the 2026 Dev Dashboard method, or the trigger throws a 401.
  • Header row mismatch. The Google Sheets append maps by column name. If your sheet header says Order # but the mapping says Order, the value lands in the wrong place or a new column.
  • Testing with the workflow inactive. The Shopify Trigger only receives live webhooks when the workflow is Active. In the editor, use Execute Node with a sample, but confirm end to end with the workflow switched on.

Cost at realistic volume

Say you take 1,000 orders a month. Every order runs this workflow once, so that is 1,000 executions. Here is what that actually costs across the pieces:

Component Cost at 1,000 orders/month
n8n (self-hosted on a small VPS) ~$5/month, unlimited executions
n8n Cloud (if you prefer managed) From ~$20/month, well within starter execution limits
Google Sheets API $0 (free, far under quota)
Telegram Bot API $0 (free)
Total $5 to $20/month for the whole thing

Compare that to a dedicated order-alert app plus a separate spreadsheet-sync app, each billed monthly and often per order or per contact. The n8n version replaces both for a flat fee, and it does not get more expensive as you add the next workflow to the same instance.

Get the Ecommerce Order Starter template

The full guide above is free to follow. If you would rather skip the build, download the ready-to-import n8n workflow, add your credentials, and be live in under five minutes. Import it on n8n Cloud or self-hosted.

Download the template ($12) →

Prefer it built and running for you? See our done-for-you automation service.

Frequently asked questions

Do I need to know how to code to automate my store with n8n?

No. Most ecommerce workflows use pre-built nodes you connect on a canvas: a trigger, a transform, and one or two actions. You only touch code for edge cases, and even then a Code node accepts short JavaScript snippets. The starter workflow in this guide has zero custom code.

Does n8n work with both Shopify and WooCommerce?

Yes. n8n ships dedicated Shopify and WooCommerce nodes, and anything not covered by a node you can reach through the HTTP Request node against the store REST API. Many merchants run one n8n instance across both platforms, which is one reason it beats platform-locked apps.

How much does it cost to run ecommerce automations on n8n?

Self-hosted n8n is free and runs on a small VPS for about 5 dollars a month with unlimited executions. n8n Cloud starts near 20 dollars a month. Either way you avoid stacking monthly fees for a separate app per task, which is where the real savings come from.

Will automating orders slow down my store checkout?

No. Order webhooks fire after checkout completes, so your automations run in the background on n8n and never sit in the shopper path. The customer sees the normal thank-you page while your logging and alerting happen a second or two later, out of view.

Can one workflow log an order and send a notification at the same time?

Yes. A single node can branch to two actions at once. In the starter template, the order-summary node feeds both a Google Sheets append and a Telegram message in parallel, so each new order is logged and alerted from one run without duplicating the trigger.

Related guides

How to auto-hide out-of-stock WooCommerce products with n8n









Auto-hide out-of-stock WooCommerce products with n8n and you stop losing sales to dead-end product pages. This guide builds a small workflow that scans your catalog on a schedule, moves any sold-out product to draft so it disappears from the storefront, and then quietly re-publishes it the moment stock comes back. No plugin subscription, no manual list to maintain, and a safety flag so it never touches drafts you created yourself.

What it does

A shopper who lands on a permanently sold-out product is a shopper who leaves. The default WooCommerce behavior keeps that page live, indexed, and clickable, showing an “out of stock” notice that reads like a closed door. This workflow closes the loop automatically.

On a schedule you control, it asks WooCommerce two questions: which published products are out of stock, and which of the products I previously hid are back in stock. Sold-out products get set to draft so they vanish from collections, search, and Google’s next crawl. Restocked products that the workflow hid earlier get flipped back to publish. Everything else is left alone.

The result is a storefront that only ever shows things a customer can actually buy, kept in sync without anyone remembering to check.

Why it beats the default

WooCommerce can show a “sold out” badge, but it will not remove the product from the catalog for you, and the free core has no built-in “hide when out of stock, show when restocked” toggle. The common alternatives each have a catch:

  • Manually setting products to draft works until you have more than a handful of SKUs, then it becomes a chore you forget.
  • A dedicated hide-out-of-stock plugin adds another paid subscription and another thing to keep updated, for one narrow job.
  • Catalog visibility filters hide products from some views but often leave the direct URL live and indexable.

An n8n workflow owns the whole rule in one place: hide on sell-out, restore on restock, and never re-publish a product you deliberately left as a draft. You can read every step, change the schedule, or extend it later. If you run Shopify instead of WooCommerce, the same pattern is covered in our Shopify auto-hide out-of-stock guide, and the broader n8n Shopify automation hub lists the rest of the store workflows you can wire up the same way.

What you need

  • A running n8n instance (self-hosted free edition or any n8n Cloud plan).
  • A WooCommerce store on WordPress with the REST API enabled (it is on by default).
  • A WooCommerce API key pair (Consumer Key and Consumer Secret) with Read/Write access. If you have not connected WooCommerce to n8n before, our WooCommerce to n8n guide walks through generating that key.
  • About 20 minutes to build from scratch, or a couple of minutes if you import the template below.

Node-by-node list

The whole thing is five core nodes, no AI and no paid add-ons:

  1. Every hour — Schedule Trigger. Fires the scan on an interval you set.
  2. Get out-of-stock live products — HTTP Request (GET). Pulls published products whose stock_status is outofstock.
  3. Get hidden back-in-stock products — HTTP Request (GET). Pulls draft products that are back instock.
  4. Decide hide or restore — Code node. Tags each product with the action to take and builds the update body, using a meta flag as a safety gate.
  5. Update product visibility — HTTP Request (PUT). Writes the new status back to WooCommerce, one product per item.
┌───────────────────────────────────────────────────────────────┐
│  AUTO-HIDE OUT-OF-STOCK WOOCOMMERCE PRODUCTS                   │
│                                                               │
│  [Every hour]                                                 │
│      ├──> [Get out-of-stock live products] ─┐                 │
│      └──> [Get hidden back-in-stock prods] ─┤                 │
│                                             v                 │
│                                [Decide hide or restore]       │
│                                             v                 │
│                                [Update product visibility]    │
└───────────────────────────────────────────────────────────────┘
  

Step-by-step build

  1. Add a Schedule Trigger node, name it Every hour, and set the rule to an interval of hours with a value of 1.
  2. Add an HTTP Request node named Get out-of-stock live products. Set method to GET and URL to https://YOUR_STORE.com/wp-json/wc/v3/products. Under Authentication choose Predefined Credential Type and pick WooCommerce API. Turn on Send Query Parameters and add three: status=publish, stock_status=outofstock, and per_page=100.
  3. Duplicate that node, name the copy Get hidden back-in-stock products, and change the query parameters to status=draft, stock_status=instock, and per_page=100.
  4. Wire the Schedule Trigger to both HTTP GET nodes so they run in parallel on every fire.
  5. Add a Code node named Decide hide or restore and connect both GET nodes into it. Paste the logic below. It reads every incoming product, decides whether to hide or restore it, and builds the exact body WooCommerce needs.
const out = [];
for (const item of $input.all()) {
  const p = item.json;
  const meta = Array.isArray(p.meta_data) ? p.meta_data : [];
  const flag = meta.find((m) => m.key === '_auto_hidden_oos');

  if (p.status === 'publish' && p.stock_status === 'outofstock') {
    out.push({ json: { id: p.id, name: p.name, action: 'hide',
      body: { status: 'draft',
        meta_data: [{ key: '_auto_hidden_oos', value: 'yes' }] } } });
  } else if (p.status === 'draft' && p.stock_status === 'instock'
             && flag && flag.value === 'yes') {
    out.push({ json: { id: p.id, name: p.name, action: 'restore',
      body: { status: 'publish',
        meta_data: [{ key: '_auto_hidden_oos', value: '' }] } } });
  }
}
return out;
  1. Add a final HTTP Request node named Update product visibility. Set method to PUT and URL to https://YOUR_STORE.com/wp-json/wc/v3/products/{{ $json.id }}. Use the same WooCommerce API credential. Turn on Send Body, set Body Content Type to JSON, and set the JSON body to the expression {{ JSON.stringify($json.body) }}.
  2. Connect Decide hide or restore into it. Because the Code node emits one item per product, this node runs once per product and updates each independently.
  3. Save, then click Execute Workflow to run a manual test. Check a sold-out product in wp-admin: its status should now read Draft. Restock it, run again, and confirm it flips back to Published.
  4. When it behaves, toggle the workflow Active so the schedule takes over.
💡

Tip: The _auto_hidden_oos meta flag is the whole safety story. Only products the workflow itself hid carry it, so a product you left as a draft on purpose is never auto-published when it happens to be in stock.

Common mistakes

  • Read-only API keys. The PUT step needs Read/Write. A key created with Read access returns a 401 on update while the GET steps still work, which makes the failure look mysterious. Regenerate the key with Read/Write.
  • A trailing slash or wrong protocol in the store URL. Use https://yourstore.com/wp-json/wc/v3/products with no trailing slash and make sure the site is on HTTPS, or WooCommerce rejects the signed request.
  • Forgetting pagination on large catalogs. per_page=100 handles one page. If you routinely have more than 100 out-of-stock products at once, add a loop that increments the page parameter until the response comes back empty.
  • Restoring by stock alone. If you drop the meta-flag check and re-publish every in-stock draft, you will push half-finished products live. Keep the flag.value === 'yes' condition.
  • Running the scan too often. Every minute is wasteful and hammers your store. Hourly is plenty for almost everyone.

Cost at realistic volume

This workflow is effectively free to run. It uses only core n8n nodes, so there is no AI token spend and no premium node requirement.

Component Plan Cost
n8n (self-hosted) Community edition $0
n8n Cloud (optional) Starter From about $24/mo, covers this and dozens of other flows
WooCommerce REST API Included with your store $0
Executions Hourly scan = ~720/mo Well inside free/starter limits

An hourly run is roughly 720 executions a month, each a couple of quick API calls. On self-hosted n8n that is zero marginal cost; on Cloud it is a rounding error against your plan’s included executions.

🚀 Ready-to-import template

The guide above is free to follow. If you would rather skip the build, download the validated workflow JSON, import it into n8n, add your WooCommerce key, and go live in a couple of minutes. Prefer it done for you end to end? Our done-for-you service installs and tests it on your instance.

Download the template ($14) →

Instant download · Works on n8n Cloud and self-hosted

FAQ

Does this delete my out-of-stock WooCommerce products?

No. It changes a product’s status from publish to draft, which removes it from the storefront but keeps every field, image, review, and URL intact. When stock returns, the workflow flips the same product back to publish. Nothing is ever deleted.

How does it avoid re-publishing a draft I created on purpose?

When the workflow hides a product it writes a meta flag named _auto_hidden_oos = yes. The restore branch only re-publishes drafts that carry that flag and are back in stock, so half-finished products you left as drafts are never touched.

How often should the scan run?

Hourly is a good default for most stores and stays well inside free-tier limits. High-velocity stores can drop the Schedule Trigger to every 15 minutes; slow-moving catalogs can run it once or twice a day. Change the interval on the single trigger node.

Will this work on WooCommerce with variable products?

The workflow acts on the parent product’s stock_status. If you manage stock at the variation level, a parent shows outofstock only when every variation is sold out, which is usually the behavior you want. To hide individual variations you would extend the workflow to loop through the variations endpoint.

Do I need a paid n8n plan for this?

No. The workflow uses only core nodes (Schedule Trigger, HTTP Request, Code) that run on the free self-hosted edition and on the lowest n8n Cloud tier. The only external cost is your existing WooCommerce store, so at realistic volume this runs at zero added cost.

Related guides

Build a Shopify Storefront FAQ RAG Chatbot with n8n, Gemini and Supabase











A Shopify storefront FAQ RAG chatbot built with n8n, Gemini and Supabase answers shopper questions using your own catalog and policy pages instead of a generic script. Shoppers ask “does this ship to Texas?” or “what is your return window?” and get a grounded answer pulled from your real store data. This guide builds the whole thing with Google Gemini and a Supabase vector store, so it stays free to run at small volume and never sends a shopper an invented policy.

What it does

Most storefront chat widgets either forward every message to a human or run on a static decision tree that breaks the moment a shopper phrases a question differently. Retrieval augmented generation (RAG) fixes that. You embed your store’s real content once, and the chatbot retrieves the most relevant pieces to answer each question in the shopper’s own words.

There are two flows in this template. The first is an ingestion flow: it pulls your Shopify products and your shop policies, turns them into clean text, and stores them as vectors in Supabase. The second is a chat flow: a hosted chat widget takes a shopper question, searches Supabase for the closest matching content, and lets Gemini write a short, grounded reply.

INGESTION (run on demand or nightly)
  Manual/Schedule -> Get Products (Shopify) --.
                  -> Get Policies (HTTP) ------> Merge -> Build Documents -> Supabase (Insert)
                                                                              ^  Gemini Embeddings
                                                                              ^  Data Loader + Splitter

CHAT (always on)
  Chat widget -> Storefront AI Agent -> reply
                    |-- Gemini Chat Model
                    |-- Store Knowledge tool -> Supabase (retrieve) -> Gemini Embeddings
  

If you have already built a general document chatbot, this is the store-specific cousin of our Drive and Supabase document chatbot. The difference here is the knowledge source: your live product catalog and policies, not files in a folder.

Why it beats the default

A canned FAQ widget only knows the answers you hard-coded. Add a product, change your return window, or run a sale, and the widget is instantly wrong. This RAG setup reads from the same catalog your storefront shows, so it is right by construction as long as you re-run ingestion when things change.

It also beats a plain large language model with no retrieval. Ask a bare model about your shipping policy and it will happily guess. Because this agent is told to answer only from the store_knowledge tool and to defer to support when unsure, it does not fabricate prices or policies, which is exactly the failure mode that gets stores in trouble. For open-ended support tickets and order lookups, pair it with our Shopify AI customer support chatbot; this template focuses on pre-sale storefront questions.

What you need

  • An n8n instance (Cloud or self-hosted, community edition is fine).
  • A Shopify store and a custom app token. Follow our 2026 guide to connect Shopify to n8n using the Dev Dashboard method, with the read_products and read_content scopes.
  • A Google Gemini API key (free tier) for embeddings and chat.
  • A Supabase project (free tier) with the pgvector extension enabled and a documents table plus a match_documents function.
📌

Enable pgvector in Supabase and create the vector table before your first run. In the Supabase SQL editor, run the standard n8n vector setup, but set the embedding column to vector(768) because Gemini’s text-embedding-004 returns 768 dimensions, not 1536.

Node-by-node list

Ingestion flow

  1. When clicking Test workflow — Manual Trigger. Kicks off ingestion (swap for Schedule Trigger later).
  2. Get Products (Shopify) — Shopify node, product / Get All, returns your whole catalog.
  3. Get Policies (HTTP) — HTTP Request to the Admin API policies.json endpoint for shipping, refund and privacy text.
  4. Merge Sources — Merge node in append mode, combining products and policies into one stream.
  5. Build Documents — Code node that strips HTML and formats each product and policy into a clean text block.
  6. Supabase (Insert) — Supabase Vector Store in insert mode, writing embeddings to the documents table.
  7. Gemini Embeddings (Ingest) — embeddings sub-node feeding the insert step.
  8. Data Loader — Default Data Loader that reads the text field and attaches metadata.
  9. Text Splitter — Recursive Character Text Splitter, 1000-character chunks with 100 overlap.

Chat flow

  1. When chat message received — Chat Trigger, the hosted storefront widget.
  2. Storefront AI Agent — AI Agent that must call the knowledge tool before answering.
  3. Gemini Chat Modelgemini-2.5-flash, the language model behind the agent.
  4. Store Knowledge (Supabase) — Supabase Vector Store in retrieve-as-tool mode, top 5 matches.
  5. Gemini Embeddings (Query) — embeds the shopper’s question so it can be matched.

Step-by-step build

  1. Prepare Supabase. In your Supabase project, enable the vector extension, then create a documents table and a match_documents function using the n8n template SQL, with the embedding column set to vector(768).
  2. Add the Manual Trigger. Drop in When clicking Test workflow as the ingestion entry point.
  3. Pull products. Add the Shopify node, choose resource Product and operation Get All, enable Return All, and attach your Shopify credential.
  4. Pull policies. Add an HTTP Request node, method GET, URL https://YOUR_STORE.myshopify.com/admin/api/2026-04/policies.json, authentication set to Predefined Credential Type, Shopify API. Connect the Manual Trigger to both this and the Shopify node.
  5. Merge the two sources. Add the Merge node in append mode. Wire Shopify into input 1 and the HTTP node into input 2.
  6. Build clean documents. Add the Code node. It loops the merged items, detects the policies array versus product fields, strips HTML tags, and outputs one item per document with a text field and source/title metadata.
  7. Wire the vector store (insert). Add the Supabase Vector Store node in Insert mode, table documents. Attach the Gemini Embeddings sub-node, a Default Data Loader reading {{ $json.text }}, and a Recursive Character Text Splitter under the loader.
  8. Run ingestion once. Click Test workflow. Confirm rows appear in the Supabase documents table.
  9. Add the chat flow. Drop in the Chat Trigger and an AI Agent. Set the agent system message so it answers only from the store_knowledge tool and defers to support when unsure.
  10. Attach the model and tool. Connect a Gemini Chat Model (gemini-2.5-flash) and a second Supabase Vector Store in retrieve-as-tool mode named store_knowledge, with its own Gemini Embeddings sub-node.
  11. Test the chat. Open the chat URL and ask a real question like “what is your return policy?” Confirm the agent retrieves and answers from your data.
💡

Tip: To keep answers fresh automatically, replace the Manual Trigger with a Schedule Trigger set to run nightly, or fire ingestion from a Shopify products/create webhook so new listings are searchable within minutes.

Common mistakes

  • Wrong vector size. Creating the Supabase column as vector(1536) (the OpenAI default) breaks inserts. Gemini text-embedding-004 is 768 dimensions.
  • Different embedding models per flow. The ingest and query embeddings must use the same model. Both nodes here use text-embedding-004 on purpose; do not change one without the other.
  • Skipping the “answer only from the tool” instruction. Without it the agent will invent shipping times and prices. The system message is the guardrail.
  • Missing scopes. If policies come back empty, your Shopify token is missing read_content. Products need read_products.
  • Never re-ingesting. RAG is only as current as your last ingestion run. Schedule it or trigger it on catalog changes.

Cost at realistic volume

For a store with a few hundred products and a handful of policy pages, this runs at or near zero. Gemini’s free tier covers the embeddings and the chat volume of a small storefront, and Supabase’s free tier holds the vectors comfortably.

Component Free tier covers Cost at small volume
Gemini embeddings (text-embedding-004) Re-embedding a few hundred products nightly $0
Gemini chat (gemini-2.5-flash) Hundreds of shopper questions per day $0
Supabase (pgvector) 500 MB database, easily thousands of chunks $0
n8n (community, self-hosted) Unlimited executions on your own server $0

At larger volume you would move Gemini to pay-as-you-go, where flash pricing keeps a busy storefront in the low single digits of dollars per month, and optionally upgrade Supabase for more storage. The architecture does not change.

🚀 Ready-to-import template

The guide above is free to follow end to end. If you would rather skip the wiring, the downloadable template is the exact validated workflow from this post, pre-built with both flows and every node connected, so you only add your credentials and the Supabase SQL. Prefer it fully done for you? Our done-for-you service installs and configures it on your instance.

Download the template ($19) →

Instant download · Works on n8n Cloud and self-hosted

FAQ

Do I need OpenAI for this Shopify RAG chatbot?

No. This build uses Google Gemini for both embeddings (text-embedding-004) and chat (gemini-2.5-flash), which have a free tier generous enough for most small stores. You never touch OpenAI, so there is no separate paid key to manage and the running cost at low volume is effectively zero.

How does the chatbot stay up to date when I add products?

Re-run the ingestion flow whenever your catalog changes. Swap the manual trigger for a Schedule Trigger set to run nightly, or trigger it from a Shopify products/create webhook. Each run re-embeds your products and policies into Supabase so the chatbot answers from current data.

Where does the chatbot get its answers from?

Only from your own store. The ingestion flow pulls your Shopify product catalog and shop policies (shipping, returns, refunds), embeds them, and stores them in Supabase. The agent is instructed to answer only from that knowledge and to suggest contacting support when it is unsure.

Can I embed this chatbot on my Shopify storefront?

Yes. The Chat Trigger exposes a hosted chat URL and an embeddable widget snippet you can paste into your theme. You can also point a custom front-end at the trigger webhook if you prefer to match your brand styling exactly.

Is Supabase free for this?

The Supabase free tier includes a Postgres database with the pgvector extension, which is all this workflow needs. A catalog of a few hundred products and your policy pages fits comfortably inside the free storage limit, so most stores run the whole stack at no cost.

Related guides