Daily Email on OOS Products Flow Suddenly Stopped Reading From a Location?

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 %}
  • {{ variant_item.sku }} - {{ variant_item.title }} - {{ variant_item.inventoryQuantity }}
    {% endfor %}
    {% endfor %}

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

Sorry for the delayed response! It looks like I was wrong.

The issue isn’t the locations, the issue is that it’s reporting items that have been out of stock for a while, not the most recent.

How would I adjust it so it only includes the most recent OOS items?

Hi Paul - I have attached screenshots of our actual flow. Is there anything you can see which might cause our issue? It’s returning 0 items every day.

Your query is not a valid query in Get product data.

You have:
tag:Retail OOS AND date_minus:"one day" }}

Try something like this:
tag:"Retail OOS" AND created_at:>{{ scheduledAt | date_minus:"one day"}}

The one day is based on going OOS over the last 24 hours - wouldn’t the query you suggested take everything that was created in the last 24 hours?

Yes, you cannot check for tags added in the last day.

I will adjust the flow to your suggestion and reach back out tomorrow to see if anything has changed - thank you!

When it was supposed to run this morning it returned the error: Liquid error: invalid duration provided to date_minus

need to see your liquid.

What part of it? Can I consolidate it at all and attach?

The code that has date_minus in it

While looking through liquid - what section would it be under?

Your workflow is custom to you. I don’t know what it contains or where you might have put the code that led to that message.

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!

Your workflow run, which presumably told you the error, should’ve happened on the step that had that text/code.

The only place I saw the error was just on the Flow page. So I don’t know where to find the actual code you’re requesting to find the resolution.

It’s on the “Get product data” action. So what’s in that configuration?

Oh I’m sorry, I thought I already attached that screenshot to you. I’ve attached it here!

One thing…I think you need quotes around that date so:

created_at:>“{{ scheduledAt | date_minus:“one day”}}”

If that doesn’t work DM me a link to the workflow so I can check it out in more detail