Help with Shopify Flow - Tag orders with out of stock inventory or change fulfilment to hold status

linzal
Explorer
70 0 16

Hi,

 

We currently have products that we have marked as 'continue selling when out of stock'. We would like a workflow to do one of two things or both:

 

1. When an order is created, if a line item is a negative inventory then tag the order as hold

2. When an order is crated, if a line item is a negative inventory then change the fulfilment status to on hold - when inventory is added change the status to unfulfilled.

 

Can anyone help?

Replies 3 (3)

paul_n
Shopify Staff
1063 136 250

Assuming you mean out of stock for the variant on the order and that you want to put it on hold if any variant on the order is out of stock, you could check:

if at least one of order / lineItems / variant / inventoryQuantity <= 0

 The workflow would look like:
Order created
Condition (see above)
If true:
Hold Fulfillment Order

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.
bushelandpeck
New Member
5 0 0

Hi Paul, thanks for answering Linzal's question. This works great for us. The trouble we're having now is, how to we release orders on hold when products come back in stock? Is there a way to have the system check each order at midnight and release the ones that have all items in stock, or review orders when inventory numbers change? I'm a little stuck here. Thanks for your help!

paul_n
Shopify Staff
1063 136 250

The might depend on how back in stock works for you, like how you mark products that were not in stock, and what items might be on hold. In the "get order data" action, you can query by sku and fulfillment_status, so you could use that combined with "inventory quantity changed". The workflow would look something like:

  • Inventory qty changed
  • If prior qty <= 0  and new qty > 0 and product / tags = "auto-release-back-in-stock" 
  • get order data (sku = variant.sku, fulfillment_status = HOLD)
  • for each loop (over list of orders)
  • Release hold

This might not be exactly right (e.g., I'm not sure the value to query by is "hold" or not). I'm also not sure how you would want to handle if there were multiple items that aren't in stock for that order (you could probably check that all have an inventory > 0 before releasing the hold). 

 

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.