Marketing · n8n

Pause Meta Ad Sets Automatically When a Shopify Product Sells Out

The fastest way to burn ad budget is paying for clicks to a sold-out product. This workflow watches Shopify inventory and, the moment a product hits zero, pauses the exact Meta ad sets promoting it — then re-enables them when stock returns.

difficulty Advancedsetup 45 minresult Zero wasted ad spend on out-of-stock products — ad sets pause within minutes of selling out
  1. 1

    Watch inventory every 15 minutes

    Add a Schedule Trigger and a Shopify node to pull products with their variant inventory levels.

  2. 2

    Find newly out-of-stock SKUs

    A Code node compares current stock to a threshold and outputs only products that just crossed zero, with their mapped Meta ad-set id from a lookup table.

  3. 3

    Pause the matching ad sets

    An HTTP Request node calls the Meta Marketing API to set status: PAUSED on each affected ad set — you stop paying instantly.

  4. 4

    Notify the team

    A Slack node posts which products sold out and which ad sets were paused, so nobody re-launches them by accident.

  5. 5

    Auto-resume on restock

    Extend the same flow to flip ad sets back to ACTIVE when inventory returns above the threshold.

Frequently asked questions

How does it know which ad set promotes which product?

You keep a simple SKU to ad-set-id map (a small Google Sheet or a constant in the Code node). The workflow looks up the id when a product sells out. Ten minutes of setup that pays for itself the first time a bestseller runs dry.

Will it fight my ad manager's automated rules?

No — it only pauses on true zero-stock and resumes on restock. Keep your bid and budget rules as they are; this just prevents spend when the product literally cannot be bought.

About this recipe. Recipes on FlowRecipesHub are written for business owners, not developers, and are tested before publishing — how recipes get made. Some ingredient links are affiliate links that cost you nothing — full disclosure.