Using flow to tag restocked items when the inventory count increases

Topic summary

A user seeks to automatically tag products as “restocked” when inventory increases, enabling automatic collection sorting for newly replenished popular items.

Proposed Solution:

  • Trigger: “Product variant inventory changed”
  • Condition: Check if “Inventory quantity prior” is less than current quantity
  • Action: Add “restocked” tag to product

Implementation Notes:

  • Initial guidance provided exact workflow steps, though some terminology didn’t match Flow’s actual interface
  • A bonus workflow was suggested to auto-remove tags after a set period (e.g., 7 days)

Issue Encountered:
The tag was being applied too liberally—triggering on any inventory increase rather than only significant restocks.

Advanced Solution:
To filter by minimum increase threshold (e.g., only tag if inventory increases by 3+ units), a “Run code” step with basic JavaScript is required to calculate the difference between prior and current inventory, then use that output in a conditional check.

Resolution:
The user marked the thread as answered after understanding the JavaScript requirement, though acknowledged it exceeds their current skill level. The workflow runs monitoring feature helped diagnose the over-tagging behavior.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Thanks Paul. It’s helpful to see the runs. I think it is working as intended, but without further conditions the tag is being applied too liberally.

Do you know if it’s possible to set an “AND” condition to the “Check if: Inventory quantity prior is less than product variant inventory quantity” so it only tags increases more than f. ex. 3?

I tried searching for terms like “increase”, and tested what I found, but couldn’t get what I tried to work.