Tags active products whose total inventory is at or below a threshold (default 5) but above zero with 'low-stock', and removes the tag when stock recovers or hits zero.
async def run(ctx): threshold = ctx.params.get("threshold", 5) products = await ctx.shopify.query(ACTIVE_PRODUCTS) for product in products:
How do you tag low-stock products on Shopify automatically?
To tag low-stock products on Shopify automatically, this template sums inventory across all variants of every active product and applies the low-stock tag when the total sits between one and your threshold, five units by default. When stock recovers or hits zero, the same run takes the tag off. The tag then works anywhere tags reach: hide low-stock items from campaigns, surface them in a purchasing collection, or let the theme show an honest scarcity banner.
Doing this by hand means exporting inventory, filtering a spreadsheet and re-tagging week after week, and the native bulk editor caps out long before a large catalog ends. Collaudo runs the check as real code on the schedule you choose. Each run opens with a report of every tag it would add or remove; you read it, approve it, and only then does the catalog change.
Last updated August 24, 2026
If you run a sharper version of this template, or something it inspired, send it in. We review every application and publish the good ones, credited to you or your agency.
AI writes real Python or TypeScript, a dry run rehearses it, you approve, it deploys.
Free plan · no card · 🇪🇺 EU data residency