Auto-tagging products when price is lower than compare-at price

Hi everyone,
I’d like to create a workflow in Shopify Flow that automatically checks my entire inventory and adds the tag ONSALE to products when their price is lower than the compare-at price.

I’ve already tried following several other posts and guides, but none of them worked for my setup.

I’ve attached a screenshot of my current workflow. In the image, you can see the part where I use Get product data to retrieve products. I tried filtering products with queries like is_price_reduced:true to only get items where the price is lower than the compare-at price, but I’m still not getting the results I expect.

Has anyone built something like this? What’s the best way to set up the flow so it scans all products and applies the tag correctly?

Thanks a lot!

In my experience, is_price_reduced is not very reliable.

IS_PRICE_REDUCED

An attribute evaluated based on the compare_at_price attribute of the product’s variants. With is_set relation, the rule matches products with at least one variant with compare_at_price set. With is_not_set relation, the rule matches matches products with at least one variant with compare_at_price not set.

For example, in my test store, first item returned does not even have “Compare At” price:

Then it depends on whether you have more than 100 products…

i have more than 1000 products, and every one of them has a compare price and a price. is it something i could do directly in the flow without the custom quiery?

Unfortunately, there is no nice solution in Flow (in my opinion).
The IS_PRICE_REDUCED attribute is not reliable, and Flow does not have triggers like “product updated” or “price changed”.
Given that you have more than 100 products, you’d need to implement some extra tagging to loop over all of your products.

In this case it may make sense to use an app designed for product tagging from the App Store (like this one, probably Leap Auto Tags | All‑in‑1 Tags - A smart way to automatically tag orders, customers & products | Shopify App Store)…
Or use another automation app, like Mechanic, which already has required automation (https://tasks.mechanic.dev/auto-tag-products-that-have-a-compare-at-price)

exactly as i did. i used Mechanic pre build template with another task andit went perfectly.

This can also be solved in Shopify Flow using triggers from the Flow Companion app, which extends Flow’s capabilities.

Here’s how it can be done:

In the Flow Companion app settings, enable tracking of changes to the product variant fields Compare-at price and Price.

After that, create a workflow that starts with the Product variant field changed trigger. Then check whether either the Compare-at price or Price field has changed

and if so, update the presence of the ONSALE tag depending on the minimum Compare-at price and Price values.

This workflow will automatically keep the ONSALE tag up to date whenever product prices change.

You can also run these actions once for all products in the shop without any limitations on the total product number. If that’s relevant, let me know and I’ll describe how to do it.

This is a good breakdown of what’s possible with Shopify Flow + companion apps :+1:

One thing we’ve seen with setups like this is that they tend to become quite complex to maintain over time, especially once you factor in bulk price updates, imports, or switching between sale campaigns.

For merchants who want a simpler approach, we built AutoTag Pro specifically around price-based tagging rules. It listens for product and variant price changes directly via Shopify events and applies/removes tags automatically, with the option to re-run rules on existing products using backfill.

It’s not a replacement for Flow in general, but for ongoing sale / compare-at price tagging it can be a lot easier to manage than chaining multiple Flow triggers and companion apps.

Just sharing an alternative for anyone who wants to keep this kind of logic simpler over time.