Add Line Item to Order - Shopify Flow Error

Add Line Item to Order - Shopify Flow Error

scottydwalsh
Visitor
2 0 0

Hi,

 

I set up a flow to add a line item to an order if two conditions are met. I've had several occurrences so far where both conditions were met but the line item couldn't be added to the order, and flow doesn't show me why the error occurred.

The logic is as follows:

  1. Start when order has been created
  2. Check if order contains line item with sku
  3. check if customer has tag
  4. add line item to order (The line item is a $0.00 product that contains two digital downloads via the app Sky Pilot)

scottydwalsh_0-1744896022220.png

Here's an example of when the flow failed:

scottydwalsh_1-1744896052250.png


My only two thoughts is that maybe the order is being archived before the line item is added? Or possibly that because the free product is tied to the app Sky Pilot?

Let me know what you think

Thanks in advance,
Scott

Replies 3 (3)

tim
Shopify Partner
4455 530 1629

Are there any successful runs or all of them fail?

 

Add logging:

Screenshot 2025-04-17 at 11.52.05 PM.png

https://shopify.dev/docs/api/admin-graphql/2024-07/objects/Order#field-merchantEditable 

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
scottydwalsh
Visitor
2 0 0

I should've said, all of them failed.

I also added the log output action after add line item. I'll wait to see what its output says next time it runs (I don't really know how to debug shopify flow within the shopify browser - I'm somewhat versed in coding in languages like C and Java, but not in webdev stuff).

tim
Shopify Partner
4455 530 1629

You should log before possible error -- Flow will stop processing if it encounters error.

Or put it in both places 🙂 

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com