Create a Flow to Count Order Line Items at Designated Fulfillment Locations

How can I create a flow that will count the line items ready to be fulfilled at two specific warehouses, and then add a tag that lists the item count on this order at these two warehouses. So it would first need to check the order to confirm that line items are being fulfilled at one or both of these two designated warehouses (warehouse A and B), and if so, it would then add the actual # of line items counted as a tag. So if there were 2 items counted on an particular order ready to be fulfilled at one or both of these warehouses, a tag with the number “2” would be added.

I’d recommend you contact Kalen at (flow-helper.com), he’s really good at Flow and I bet he’ll be able to help you out.

Thanks Paul! Yeah sounds doable.

If the case is still unresolved and you don’t mind using third-party applications, please let me know. In that case, I will help describe a working solution here. The item count calculation can be done using the Execute GraphQL request action from the Flow Companion app to select the necessary data, then using the Run Code action to determine the tag name, and finally, using the Execute GraphQL request action again to add the tag whose name was determined earlier.

Hey @solidthreads,

I did some digging and the good news is - yes, you can totally do this with Shopify Flow. It just works a bit differently than you might expect.

Here’s how:

Use “Fulfillment order ready to fulfill” as your trigger instead of “Order paid.” This is key because fulfillment orders are where Shopify assigns line items to specific locations.

The flow would look like:

  1. Trigger: Fulfillment order ready to fulfill

  2. Condition: Check if Fulfillment order > Assigned location > Name equals “Warehouse A” or “Warehouse B”

  3. Action: Count the line items in that fulfillment order and add a tag

Here’s the thing - this trigger fires once per fulfillment order, not once per order. So if you have an order with items going to both warehouses, you’ll get two separate flows running (one for each warehouse). That might actually be better for your tracking since you’ll know exactly how many items are at each location.

Simple Setup:

Trigger: Fulfillment order ready to fulfill
Condition: Assigned location name is one of ["Warehouse A", "Warehouse B"]
For each: Fulfillment order line items (to count them)
Action: Add order tag "Warehouse-A-Count-2" (or whatever the count is)

I would recommend

You could set up two separate flows - one for each warehouse - so you get tags like “WarehouseA-3” and “WarehouseB-1” on the same order if it splits between locations.

One Small Catch:

The location assignment happens after the order is created, so you can’t use “Order paid” as your trigger. You need to wait for Shopify to assign the fulfillment locations, which is exactly what “Fulfillment order ready to fulfill” does.

This should work perfectly for what you’re trying to achieve! Let me know if you want me to walk through any specific part of the setup.

Cheers,
Shubham | Untechnickle

P.S. - If you run into any issues with the conditions or want to get fancy with the counting logic, the “Send HTTP request” action is always there as a backup plan.