Creating a Shopify Flow trigger based off of a specific location's inventory

Creating a Shopify Flow trigger based off of a specific location's inventory

BBPT
Tourist
6 0 2

Hello,

We have a flow set up to send notifications to our team when inventory for a product reaches a certain threshold so we can have a better idea when to restock. Recently though we have added other locations in order to use Shopify POS. We do not share these stocks with the website, but I have been unable to find a way for the flow to look at a specific location's inventory level rather than the total inventory level of all locations. We were able to get the flow to check for our main location on the product but cannot figure out how to make it look at just the inventory level of our specified location.

For reference, the flow now checks the inventory level and the inventory quantity prior, and then sends the notification if it meets those inventory levels. It splits a few times to account for different thresholds and products with various tags, but is consistent with how it checks inventory across the board.

 

If anyone has experience here or any ideas on how we could make this work it would be much appreciated.

 

Thanks!

Replies 5 (5)

SomeUsernameHe
Shopify Partner
495 55 100

Shopify's "Product variant inventory quantity changed" trigger in Shopify Flow can be utilized for monitoring inventory changes. This trigger initiates a workflow when there's a change in the inventory of a specific product variant. The change can be due to an order, manual adjustment, or an app-modified inventory quantity. To specifically monitor inventory at a single location, you can use the productVariant / inventoryItem / inventoryLevels / available variable within the workflow. This allows you to track the inventory level of a product variant at a designated location. Additionally, you can check the location using the productVariant / inventoryItem / inventoryLevels / location / name or id variables. This functionality should assist in setting up a workflow based on the inventory levels of specific locations.

Documentation: https://help.shopify.com/en/manual/shopify-flow/reference/triggers/product-variant-inventory-quantit...

Have I helped? Consider putting coffee in my mouth!
Buy Me a Coffee
BBPT
Tourist
6 0 2

@SomeUsernameHe I am a bit confused on the inventoryLevels_item.available variable that you referenced for tracking inventory at a specific location. When I try and use it, it is calling for a number rather than the name of the location... Any chance you can show me an example of how you would point that variable to a desired location?

BBPT_0-1705007917811.png

 

SomeUsernameHe
Shopify Partner
495 55 100

Can you give me a small snippet of your code so I can have a better understanding code-wise? 

Have I helped? Consider putting coffee in my mouth!
Buy Me a Coffee
BBPT
Tourist
6 0 2

This is essentially the entire flow. It repeats and breaks off a few times with things slightly changed to account for different thresholds and tags etc. When I tried adding the inventoryLevels_item.available variable, it did list the different inventory levels at the separate locations in the results of the flow but they were still grouped together and there was no connection of the number to a location (that I could see).

BBPT_0-1705009673728.png

 

Kalen_Jordan
Shopify Partner
526 18 78

It appears that the variant inventory quantity changed flow trigger doesn't include the location_id even though that does get sent to the inventory_levels/update webhook. We have a workflow template for this with our app:

https://www.getmesa.com/blog/warehouse-specific-low-stock-variant-slack-notifications/