A Shopify Flow automation that sends daily emails about out-of-stock (OOS) products stopped working correctly. Initially, the user believed it was only reading from the default location instead of all locations, but later clarified the flow was returning zero items daily.
Root Issue Identified:
The query syntax in the “Get product data” action was invalid. The original query used date_minus:"one day" incorrectly.
Solution:
Changed query from tag:Retail OOS AND date_minus:"one day" to tag:"Retail OOS" AND created_at:>{{ scheduledAt | date_minus:"24 hours"}}
The date_minus filter only accepts plural time units (seconds, minutes, hours, days, weeks, months, years), not singular “one day”
Using “24 hours” instead of “one day” resolved the Liquid error
Current Status:
The flow now returns results (1 item on test run). User is monitoring for 24 hours to verify consistent functionality. A related issue with another flow not properly adding/removing OOS tags by location was also mentioned, which may affect overall results.
Summarized with AI on October 27.
AI used: claude-sonnet-4-5-20250929.
We have been using the flow template to send us daily e-mails in regards to out of stock products. For some reason, sometime within the last week, it has started only e-mailing us products from our default location, not both locations that we currently use.
We haven’t changed anything about the flow, so I’m confused on why it would suddenly stop including our POS items from our daily e-mail blast.
→ Scheduled every day at 9 a.m CST
Then do this: Query: updated_at:<=‘{{ scheduledAt }}’ AND updated_at:>‘{{ scheduledAt | date_minus: “1 day” }}’
inventory_total:<=0 (sort by created in ascending order)
Then do this: Count (getProductData)
Then Send internal e-mail:
Items out of stock:
{% for getProductData_item in getProductData %}
{{getProductData_item.title}}
{% for variant_item in getProductData_item.variants %}
Am I missing something that would make it suddenly disregard our POS Location, or is there a specific Shopify setting that may have affected this recently?
Usually when behavior changes someone in your shop changed something (either in Flow or a setting like inventory tracking). It’s also possible the API changed somehow (I’m not aware of anything). Flow also recently updated to use the 2024-07 API, (from 2024-04), but I’m not aware of any changes to the Product query as part of that. But the timeline doesn’t align with your timeline.
If you think there is an issue it would help to show the current inventory for a product and the output of the above code for that product
I’m looking around to find the data you’re looking for, but I guess I’m just either misunderstanding or just not capable of finding it. I’m going to keep looking into it and hopefully I can find it, but any other info you can provide to hep me provide you with that answer would be helpful!