Order Created Shopify Flow return empty metafield in response

I am using Shopify Flow, in my case, when creating an order, I will update the customer metafield, but I don’t know why, in some order, the metafield has a value of empty array, expected metafield should be an array with 4 metafield objects, many other orders have correct metafield, does anyone know why?

hi @nhtbao101

Thanks for sharing. here is what you can try.

Possible Causes:
Race condition or timing issue
If your Flow is triggered immediately on order creation and tries to update the customer metafield before certain data is available, it might write an incomplete or empty value. Try adding a brief delay or using a different trigger (like “Order paid” instead of “Order created”) to see if it stabilizes.

Logic error in Flow conditions
Double-check the logic that builds or updates the metafield. If there’s any conditional step that skips parts of the array or clears it when a value is missing, it could result in an empty array.

Overwriting instead of appending
If your Flow updates the metafield instead of appending to an existing array, and the data being passed is empty for some reason, it could be replacing a full array with an empty one.

Inconsistent data in order properties
Make sure the input data you’re using to build the metafield (like line item properties or tags) is always present. Missing or unexpected structure in some orders could lead to an empty array being built.

Metafield definition mismatch
If the metafield expects an array of objects, but you’re passing an incorrect format (even slightly), it may default to . Check the metafield’s definition in your Shopify admin to make sure the structure matches exactly what Flow is writing.