How to create an automation Flow for inventory quantity not changed in last xx days

How to create an automation Flow for inventory quantity not changed in last xx days

Azzurra_Peghin
Tourist
7 0 0

Hello Shopify Community,

I am in the process of creating a new Flow within the Shopify app. My goal is to have an email sent to me for each product whose inventory quantity has not changed in the last 120 days.

I have attempted to draft a Flow, but I am struggling and unsure of how to proceed to complete it. I've managed to set up an initial trigger based on inventory change, but configuring the condition to check for "no changes" over a 120 day period has proven difficult.

FLUSSO.jpg

 

 

I'm seeking your assistance in getting this sorted out. Does anyone have experience with this type of Flow or could guide me through the steps necessary to achieve this functionality?

I would really appreciate any help on this matter. Thank you in advance!

Best regards. 
Azzurra

Replies 3 (3)

paul_n
Shopify Staff
1314 148 300

First, wait steps cannot be more than 30 days. That limit it because data and your needs can become stale after a long period of time.

 

You might be able to instead use a schedule time trigger and "get product data" to fetch products based on a set of filters. You could then send a summary email (like once per day) that includes all products matching your criteria.

 

One issue will be how to know that inventory hasn't changed. You cannot query by that. So one idea is that you use a separate workflow to set a product tag or a product or variant metafield that saves the last inventory change. (something like inventory qty changed -> if  amount decreased -> add tag).

 

The advantage of tags is that you can query by them. You might use a tag like `last_sale_Sep_2023` and then use that in your query:

 

tag:last_sale_{% "now": "%b_%Y" %}

 

 

You can also query by updated date, but the downside of that is you don't know what was updated (could be qty or something else). 

 

Also, this assumes you want notifications per product. There isn't currently a get variant query and tags only work for products. 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.

Digico
Shopify Partner
47 1 5

If you want to exceed the 30 days limit, you can also create a public or private Shopify app. Both requires you to store your data into your own database for the app. (SQLite won't work).

Kalen_Jordan
Shopify Partner
693 28 116

Our automation platform MESA has support for delay steps of 120 days if you want to check that out as an option. But another thought I had is that it might be easier to sync your inventory to airtable because airtable can give you a modification timestamp on the inventory field right out of the box and that might be an easier way to track this.

 

I can imagine troubleshooting/debugging any issues in a workflow with a 120 day delay is going to be painful!