Hold pre-orders automatically
Shopify Flow can put orders on hold as they come in, which saves holding pre-orders by hand. The workflow on this page gives each pre-order product in an order its own hold, so that when a product arrives you can release its orders as one group on the On hold tab, while orders that are still waiting for another product stay on hold. See Orders on hold for how holds and groups work.
Flow’s own Hold fulfillment order action puts an order on hold only once: if the order is already on hold, Flow skips it. That’s enough when an order can only contain one pre-order product, but an order with two pre-order products would wait for just one of them. This workflow uses Flow’s Send Admin API request action instead, which can add more than one hold to an order.
Tag your pre-order products
Before you create the workflow, give each pre-order product a tag that ends in -preorder, for example matcha-collection-preorder. The part before -preorder becomes the hold’s note, so this tag puts orders on hold with the note “Matcha collection”.
Products that arrive together can share one tag, and their orders are then held and released as one group. Give each product only one tag ending in -preorder, and remove it when the product is no longer sold as a pre-order, so new orders for it aren’t held.
Create the workflow
To hold orders for each pre-order tag they contain:
- In Shopify Flow, click Create workflow and choose the Order created trigger.
- Add the For each loop (iterate) action, and choose the order’s Line items as the items to repeat for.
- Under Repeat for each item, add a condition. Choose the variable
lineItemsForeachitem>product>tags, choose Ends with, and enter-preorder. - Under True, add the Send Admin API request action and choose the
fulfillmentOrderHoldmutation. -
Replace the text under Mutation inputs with the following:
{ "id": "{% for fo in order.fulfillmentOrders %}{% for foli in fo.lineItems %}{% if foli.lineItem.id == lineItemsForeachitem.id %}{{ fo.id }}{% endif %}{% endfor %}{% endfor %}", "fulfillmentHold": { "reason": "INVENTORY_OUT_OF_STOCK", "reasonNotes": "{% for tag in lineItemsForeachitem.product.tags %}{% if tag contains '-preorder' %}{{ tag | remove: '-preorder' | replace: '-', ' ' | capitalize }}{% endif %}{% endfor %}", "notifyMerchant": false, "handle": "preorder-{% for tag in lineItemsForeachitem.product.tags %}{% if tag contains '-preorder' %}{{ tag | remove: '-preorder' }}{% endif %}{% endfor %}" } } - Click Turn on workflow.
Each pre-order tag in a new order now gets its own hold, with Inventory out of stock as the reason and the tag’s name as the note. The orders waiting for each tag form one group on the On hold tab, and an order with products from two tags appears in both groups. The handle is what lets Shopify accept more than one hold on the same order, because each tag’s hold has a different one.
The workflow only holds orders placed after you turn it on, so put the orders that are already waiting on hold from the Pending tab, with the same note.
Release the holds
Release these holds from the On hold tab when the products arrive. Flow also has a Release fulfillment order holds action, but it releases every hold on the order, including holds for products that haven’t arrived yet.
If Flow shows an error
When an order contains two products with the same tag, the workflow tries to add that tag’s hold twice. Shopify refuses the second one, so Flow’s Recent runs shows the run with an error saying the handle is already in use. The order still has its hold, and you can ignore the error.
Related documentation
- Orders on hold — put orders on hold by hand, and release them in groups