HomeShopifyShopify Inventory Low Stock Alert with…
Shopify

Shopify Inventory Low Stock Alert with n8n (Automated, Real-Time)

TL;DR: Running a Shopify store without inventory alerts is how you end up overselling a product at 2 a.m. This guide shows you how to build a Shopify inventory low stock alert with n8n — a free, self-hosted automation that polls your store every hour, compares stock levels to a threshold you set, and fires an instant notification to Telegram, Slack, or Gmail. No monthly app fees, no flaky third-party integrations, full control over your thresholds.


What this workflow does

The automation runs on a schedule — every 1–4 hours, your choice. It calls the Shopify Admin REST API to pull current inventory levels for every tracked product variant. Then it compares each level to a threshold you define — say, 5 units — and filters out anything that’s still well-stocked. For any product that drops below the line, n8n sends a formatted alert with the product name, SKU, variant title, current quantity, and a direct link to that product’s Shopify admin page so you can act immediately.

You decide where alerts go: a Telegram message to your phone, a Slack notification to your ops team, or a Gmail alert with a subject line that’s hard to miss. Want all three destinations? Add three output nodes. Want to also log every triggered alert to a Google Sheet for trend analysis? Add one more node. The workflow stays on a single canvas — no sub-workflows, no complex branching.

The result is a silent guardian running in the background. You stop finding out about stockouts from frustrated customers. You start restocking before the problem becomes visible.

Why it beats Shopify’s default low-stock notifications

Shopify’s built-in inventory notifications email you when a product hits zero — meaning you’ve already oversold. Third-party apps like Stocky or Out-of-Stock Police cost $15–30 per month and still don’t give you the flexibility to set different thresholds per product, route alerts to different channels, or log every triggered event for reporting.

With n8n, the threshold logic is yours. You can set 5 units as the alert line for a $200 item and 50 units for a $10 consumable — in the same workflow, with a config sheet in Google Sheets driving the per-product values. You can log every alert to a sheet so you can spot which products regularly tank before your next buying cycle. You can add a branch that creates a reorder task in Notion, or emails a supplier template automatically. No app marketplace approval process, no recurring subscription beyond whatever you’re already paying for n8n hosting.

For more Shopify automations built on n8n, the n8n Shopify Automation guide covers the full picture of what’s possible.

What you need before building

Make sure you have these in place before opening n8n:

  • An n8n instance — self-hosted on a VPS or via n8n Cloud. If you don’t have one running yet, the n8n setup service gets you live in under 30 minutes.
  • A Shopify custom app (or private app) with the read_inventory and read_products API scopes enabled. You’ll need the Admin API access token from the app’s credentials page.
  • A notification destination: a Telegram bot token and chat ID, a Slack incoming webhook URL, or Gmail configured via OAuth2 in n8n’s credential manager.
  • Basic comfort with n8n’s canvas interface. No coding is required — the one optional Code node uses roughly 10 lines of straightforward JavaScript.

Node-by-node walkthrough

Here’s every node in the workflow and what it does:

Schedule Trigger — starts the workflow on your chosen interval. Set to every 1 hour in production; drop to every 5 minutes during testing.

HTTP Request — Get Products — calls GET /admin/api/2024-01/products.json?limit=250&fields=id,title,variants with your Shopify store URL and API token in the X-Shopify-Access-Token header. Returns all product variants with their IDs and SKUs.

HTTP Request — Get Inventory Levels — calls GET /admin/api/2024-01/inventory_levels.json?inventory_item_ids=... with batched inventory item IDs. Shopify lets you pass up to 50 IDs as a comma-separated string in a single call, which keeps API usage efficient.

Code node — merges the product data (titles, SKUs) with the inventory response (quantities). About 10 lines of JavaScript. Also attaches your threshold value to each item — either a hard-coded default or a per-product value fetched from a Google Sheet config.

IF node — filters on available < threshold. Items below the threshold go down the true branch (alert). Everything else goes to a no-op false branch or simply ends.

Telegram / Slack / Gmail node — sends the formatted alert message for each low-stock item. If multiple items are below threshold, the node fires once per item (n8n processes them as individual items automatically).

Google Sheets node (optional) — appends each triggered alert to a log sheet with columns: Timestamp, Product Name, SKU, Current Quantity, Threshold. Useful for spotting patterns over time.

Step-by-step build

  1. Open n8n and create a new workflow. Name it “Shopify Low Stock Alert.”

  2. Add a Schedule Trigger node. Set interval to every 1 hour. During testing, switch it to every 5 minutes so you don’t have to wait.

  3. Add an HTTP Request node. Method: GET. URL: https://YOUR-STORE.myshopify.com/admin/api/2024-01/products.json?limit=250&fields=id,title,variants. Under Headers, add X-Shopify-Access-Token with your token value. Enable “Split into items” so downstream nodes process each product separately.

  4. Add a Code node after the products call. Use it to extract the variant list and prepare batches of inventory_item_ids in groups of up to 50, ready for the next API call.

  5. Add a second HTTP Request node. URL: https://YOUR-STORE.myshopify.com/admin/api/2024-01/inventory_levels.json?inventory_item_ids={{ $json.batch_ids }}. Same auth header. This returns the current available quantity for each variant.

  6. Add another Code node to join product titles and SKUs from step 3 with the inventory quantities from step 5. Attach your threshold value here — either a static number or a lookup from a Google Sheet. Output one item per variant with fields: product_title, sku, available, threshold, product_id.

  7. Add an IF node. Condition: Number — {{ $json.available }} is less than {{ $json.threshold }}. This creates the true (low stock) and false (fine) branches.

  8. On the true branch, add a Telegram node (or Slack/Gmail). Format the message body as:

    ⚠️ Low Stock Alert
    Product: {{ $json.product_title }}
    SKU: {{ $json.sku }}
    In stock: {{ $json.available }} units (threshold: {{ $json.threshold }})
    Reorder: https://YOUR-STORE.myshopify.com/admin/products/{{ $json.product_id }}
  9. Optionally, add a Google Sheets — Append Row node on the same true branch to log every alert. Columns: Timestamp ({{ $now }}), Product, SKU, Available, Threshold.

  10. Test the workflow. Temporarily set a threshold higher than one of your current stock levels so the IF node fires. Confirm the alert arrives in Telegram/Slack/Gmail and the sheet row appears. Then restore real thresholds and flip the Schedule Trigger back to hourly.

  11. Toggle the workflow Active in the top-right corner. It now runs every hour without any manual intervention.

Common mistakes to avoid

The most common issue is pagination. Shopify’s API returns a maximum of 250 products per call. If your store has more, you need to follow the cursor-based pagination using the page_info value from the Link response header. n8n’s HTTP Request node doesn’t handle pagination automatically, so you’ll need a loop using a While node or a Code node that accumulates pages until there’s no “next” link in the header. Stores with fewer than 250 products can skip this entirely.

The second common issue is calling inventory_levels one variant at a time. With 500 variants, that’s 500 API calls per hour — you’ll burn through Shopify’s rate limit quickly. Always batch your inventory_item_ids into comma-separated groups of 50 in a single HTTP call. One Code node handles the batching in 5 lines of JavaScript.

Timezone handling catches people off guard when logging to Google Sheets. Shopify returns timestamps in UTC. If you want local time in your logs, add a new Date().toLocaleString('en-US', {timeZone: 'America/New_York'}) conversion in the Code node before the Sheets append. Swap in your own timezone string.

Finally, don’t forget to deactivate the workflow if you’re doing a planned full stockout (like a pre-order launch). A flood of low-stock alerts on a product that’s intentionally empty is just noise that trains you to ignore the real ones.

Cost at realistic volume

A 250-product store running this workflow hourly makes roughly 24 API calls to Shopify per day, well within the free REST API rate limits. Larger stores that batch properly stay under 100 API calls per day even with 1,000+ variants. There are no Shopify charges for reading inventory data.

On the n8n side: each workflow run counts as one execution. Running hourly means 720 executions per month. The n8n Cloud starter plan covers 2,500 executions per month from around $20. If you’re self-hosting on a VPS you already run, the added cost is zero.

Telegram, Slack free tier, and Gmail are all free. Google Sheets is free. Compare that to a $19–$29/month inventory alert app and the math is straightforward — this workflow pays for itself before the first month is up.

Ready to import this workflow?

The ready-to-import JSON template for this Shopify low stock alert is in the downloads section. Download, import into n8n, add your Shopify API token and Telegram (or Slack/Gmail) credentials, set your thresholds, and activate. Setup takes under 15 minutes on an existing n8n instance.

If you’d prefer someone else handle the setup — Shopify API permissions, n8n credential config, threshold customization, testing — the n8n automation service covers end-to-end workflow installation. You get a working alert system without touching a single node yourself.


FAQ

Does this Shopify low stock alert work with Shopify Plus?

Yes. The Admin REST API used here is available on all Shopify plans, including Shopify Plus. Plus accounts actually have higher API rate limits, so the workflow performs better on larger Plus stores. No plan-specific adjustments needed.

Can I set different thresholds for different products?

Yes. The cleanest approach is a Google Sheet with two columns — SKU and threshold. The workflow fetches that sheet at the start of each run, then joins the data with the inventory response before the IF filter. You get full per-product control without touching the workflow logic when you update thresholds.

What if my products have inventory across multiple locations?

Shopify’s inventory_levels endpoint returns one record per inventory item per location. You can filter by a specific location_id in the API call to check one warehouse, or sum quantities across all locations in the Code node before comparing to your threshold. Both approaches work; pick based on how your store manages stock.

Can the workflow automatically create a purchase order when stock is low?

Not in a single step, but extending it is straightforward. Add a branch that appends low-stock items to a Google Sheet reorder queue. A second n8n workflow monitors that sheet and either emails your supplier a pre-built order template or creates a draft order directly in Shopify. The two workflows hand off cleanly through the shared sheet.

How often should I run this workflow?

Hourly works well for most stores. High-volume operations selling fast-moving items should consider every 15–30 minutes. Very low-volume stores can run every 4 hours without missing anything actionable. Adjust the Schedule Trigger interval based on how fast your bestselling products move on a typical day.


Related guides

For more Shopify automation templates built with n8n, browse the Shopify automation category or start with the full overview: n8n Shopify Automation — The Complete Guide.