Skip to content

WooCommerce Low Stock Alerts with n8n: A Step-by-Step Workflow

2026-03-31 · AutCode · , , ,

Workflow automation with n8n and WooCommerce for stock alerts

A product that sells out unnoticed costs you orders. A product that stays in stock on the site but is gone from the shelf costs you refunds and trust. WooCommerce can email you about low stock, but it sends one message per product and little else. With n8n you can turn stock levels into a proper alert: grouped, routed to the right person and logged.

This guide shows a simple, reliable low-stock workflow built with n8n and the WooCommerce REST API. It is the same pattern we use as a building block in larger n8n automation projects.

What the workflow does

  1. Runs on a schedule, for example every hour.
  2. Reads products that manage stock from WooCommerce.
  3. Keeps only the products at or below a threshold.
  4. Sends one summary message to Slack or email instead of dozens of separate ones.
  5. Remembers what it already reported, so the same product is not announced every hour.

Before you build: prerequisites

  • An n8n instance (cloud or self-hosted) that can reach your store over HTTPS.
  • WooCommerce REST API keys with read access to products. Create them in WooCommerce, Settings, Advanced, REST API.
  • Stock management enabled on the products you want to track (the product must have “Manage stock” ticked, otherwise it has no quantity to read).
  • A place to send alerts: a Slack channel or an SMTP account.

Step 1: schedule and fetch products

Start with a Schedule Trigger node set to every hour. Add the WooCommerce node, choose the Product resource and the Get Many operation, and enable returning all results. If the catalog is large, filter in the request instead of downloading everything, for example with the stock_status parameter, or fetch only products that changed recently.

Step 2: keep only low-stock products

Add an IF node (or a Filter node) with two conditions: the product manages stock, and its stock quantity is at or below your threshold. A fixed number such as 5 is a fine start. Better thresholds depend on the product: fast sellers need a higher floor than slow ones. A common upgrade is to store a per-product threshold in a custom field and compare against that.

Remember that variable products keep stock per variation. Fetch variations as well, or your alert will miss the sizes and colours that actually sell out.

Step 3: avoid alert fatigue

If the workflow runs hourly and a product stays low for a week, you do not want 168 identical messages. Two simple approaches work well:

  • Remember what was reported. Use n8n static data, a Google Sheet or a small database table with the product ID and the date last alerted. Skip products reported in the last 24 hours.
  • Alert on change, not on level. Report a product only when it crosses the threshold, and report it again only after it was restocked and dropped again.

Step 4: group and send

Use an Aggregate or Code node to merge the remaining items into one list, then send a single message through the Slack or Send Email node. Include the product name, SKU, current stock and a link to the edit screen so the buyer can act in one click.

Step 5: handle failures

Add an Error Trigger workflow that notifies you when the stock check itself fails, for example because the API keys expired or the store was down. A silent failure is worse than no automation, because you assume the alerts are running.

Common mistakes

  • Alerting on products without stock management. They have no quantity, so comparisons are meaningless.
  • Ignoring variations. Variable products often hide the real problem.
  • One message per product. It trains people to ignore the channel.
  • No test with real data. Run the workflow manually against a copy of the catalog before switching it on.

Where this fits in a bigger system

A stock alert is the smallest piece of inventory automation. When stock lives in an ERP or warehouse system, the same data should flow both ways, with a clear rule about which system owns the number. See our guide to WooCommerce ERP integration data mapping, and how we built real-time stock sync in the B2B wholesale platform case study.

Frequently asked questions

Does WooCommerce already send low stock emails?

Yes, it can email the store admin when a product reaches a low stock threshold. It sends one email per product and cannot group, route or remember alerts, which is where n8n helps.

How often should the workflow run?

Hourly is enough for most stores. Very busy shops may check more often or react to order events instead of polling.

Can I alert different people for different products?

Yes. Add a Switch node that routes by category or supplier and sends each group to the right channel or inbox.

Do I need to write code?

No. The workflow uses standard nodes. A Code node is optional for grouping or custom thresholds.

Need this built for your store?

We build inventory alerts, ERP sync and order pipelines for WooCommerce stores. See our WooCommerce system integrations, or send us a brief and we will reply within 48 hours.