Goal: Use Shopify Flow to hide products only after they’ve been out of stock for more than 90 days, allowing preorder before that.
Key constraints:
Shopify doesn’t record the date a product/variant goes out of stock; updated_at isn’t suitable for this.
Flow currently can’t query by metafields.
Suggested approach:
On out-of-stock event, store the date:
Prefer tags (e.g., “nostock_MM_DD_YY”) since they’re queryable.
Alternatively, define a product metafield (e.g., out_of_stock_date) via Admin, but note it can’t be queried in Flow yet.
Use a Flow step like “Get product data” with a tag query (e.g., tag:nostock_12_28_23) to find products whose out-of-stock tag date is 90+ days old.
Generate the correct date/tag using Liquid so the query targets the 90-day threshold.
Status: A feasible tagging-based workflow is outlined; implementation details (tagging automation and Liquid date logic) remain to be completed. Discussion remains open.
Hi, i’m trying to customize standard automation of shopify flow to hide out of stock products.
I need to autohide not all products but only the ones that are out of stock after over 90 days, so customers can eventually preorder meanwhile the products is restocked.
I think that a variabile that i can consider is updated_at, but i don’t know how to use it.
Shopify doesn’t store the dates when a product or variant goes out of stock. You could do that by setting a product metafield (you would need to define that metafield first through the Admin, something like a out_of_stock_date). The problem after that is that you cannot yet query by metafields. So you might need to use tags instead (which you can use in a query), setting it to something like “nostock_02_28_24”). Then you can use a “Get product data” query to get products that were expired 90 days ago (using tag:nostock_12_28_23). You’ll need to write some liquid to get the write tag/date.