Remove products from website - out of stock flow

Topic summary

Goal: automate hiding sold‑out items and republishing on restock without affecting scheduled product releases (all products are marked active in sales channels). The requester also wants this handled in a single flow and shared a screenshot of their current attempt.

Key constraint: inventory change triggers fire per variant, so you cannot infer full product stock status from a single variant event without extra state.

Recommended approach:

  • Use product tags or metafields to track state.
  • Trigger: Inventory quantity changed.
  • If all variants are out of stock and product is not tagged “no-stock”: add “no-stock” tag and unpublish from Online Store.
  • Else (some stock exists) and product not tagged “in-stock”: add “in-stock” tag and publish to Online Store.

Caveats: Be careful if some products are intentionally unpublished despite having inventory—avoid automatic republishing on every stock change. Clarify whether the goal is variant-level removal vs full product unpublish to prevent unintended removals.

Status: Guidance provided (template suggested); no confirmed implementation or resolution yet.

Summarized with AI on December 26. AI used: gpt-5.

Hi,

We have a website that we use scheduled products to upload when they are released. We also use the sales channels - active, as our way of showing what items need to be on the website (so all products including non–live products are technically active in the backend)

We need an out of stock flow that won’t impact the scheduled products, or incorrectly remove items.

This is the current idea we are working with, to remove variants that are active + included in online store, no variants have stock.

We also sometimes have the issue where items come back into stock in a restock, can we do this all in one flow?

Is there a way to make this work?

It’s a bit unclear what you are looking to achieve. I think you are trying to publish or unpublish the product all changes when it’s back in stock or out of stock, respectively. It’s also not clear if sometimes you might remove a product from the store even if it has inventory (if so you need to be careful about doing something on ever stock change).

Making some assumptions, one problem is that you won’t know if the product was already out of stock (or already in stock), because the trigger only tells you for a single variant. So I think you likely want to use tags or metafields here to flag something as out of stock or in stock. The workflow would look something like:

  • Inv qty changed trigger
  • Condition: if all variants are out of stock
    • True:
      • Condition: If none of tags is equal to “no-stock”
        - Add “no-stock” product tag
        - Unpublish from store
    • False:
      • If none of tags = “in-stock”
        - Add “in-stock” product tag
        - Publish product

This template is pretty close: