Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
I have created a flow that I want to use to tag an order depending on the stock level of the variant at the time of the order. We allow customers to order when we have no stock but I want the order to be tagged so that we know if the item is in stock or requires to be made.
I have set up the flow but I just had an order and it tagged the order incorrectly.
Im not sure how to troubleshoot this but if someone can help that would be great.
Attached is a screenshot of the flow for info.
Can't test it as we don't sell out of stock but this should be closer to what you need as your not telling the flow to check every item in the order:-
thanks Bob,
will give this a try but within the step there is a “for each line item” option selected. But maybe it does something else
Tried this and retried my original run with 1 item in stock and both had the same result.
I think the flow is running after the inventory has been taken from the shop and thats what the issue is
Open the workflow run where it didn't do what you expected. Look at the condition especially. What do you see?
It looks like it sees the inventory stock at 0 for the item when it should have been 1. Could it be that its checking the stock after the order goes through?
Do I need to check the on hand stock instead?
It runs after an order is created. I'd expect that part of an order being created it removing the stock from the store, so that the next order see's a more accurate count.
Yeah it's after the order is created. So ive adjusted the calculation to trigger when stock drops below 0 of any item on the order. Hopefully that picks it up.
Thanks.
Did adjusting when the calculation triggers help this work for you? Can you please explain how/where you made that adjustment if it did work?
Our store is running into a similar issue, where we want to confirm that there is enough available inventory to cover the ordered quantity of each line item. As you found, it's clear that stock is being checked after the necessary quantity has been allocated for the order, which is not particularly helpful in this situation.
This is what our condition looks like – it's using product instead of variant, but I think we're essentially looking for the same kind of result:
I had the idea to add the quantities for each of those variables (lineItems_item.quantity and lineItems_item.product.totalInventory) and then compare that to lineItems_item.quantity – if the sum of the two is greater than or equal to the value of lineItems_item.quantity then inventory at the time of the order should have been adequate – but I'm pretty sure that would require javascript in a Run Code action, which is a bit beyond my abilities.
Thanks!
Ah, got it. Unfortunately I don't know if that will help with our situation, but I appreciate the info nonetheless. Maybe I can adapt the idea to the issue we're trying to work around.
Thanks!
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025