(Draft) Order created has no fulfillments

I’m wondering if this is a bug or if there’s a logical reason why the Order created flow trigger returns an Order object with fulfillments: [] when completing draft orders.

To test this, I activated and logged both the Order created and Fulfillment order ready to fulfill triggers simultaneously. Then, I followed these steps:

  1. Created a new draft order
  2. Added products to the order
  3. Sent an invoice
  4. Opened the invoice and completed payment via Checkout

At this point, both triggers ran at the same time. However, the Order created flow contained no fulfillments (fulfillments: []), while the Fulfillment order ready to fulfill flow did include fulfillment data.

Is this expected behavior, or am I missing something?

Just to clarify, on normal orders through Online Store, the Order created flow returns fulfillments as expected. The above issue only happens through creating draft orders.

Both triggers do not run at the same time. An order typically does not have fulfillment orders by the time it runs. And you need fulfillment orders for fulfillments.

Order ready to fulfill only runs once those fulfillment orders have been added and the order is removed from it’s initial hold. If you need fulfillment data, that’s the trigger to use. Or add a wait step after Order created

1 Like

Okay, that makes sense - and what I was initially thinking… So the thing currently running on Order created where normal Online Store orders actually seem to work and have fulfillment data, is maybe more a coincidence and shouldnt always work?

Thanks for the clarification anyways, we can use the other trigger for both cases anyways, so I’ll just do that :pray:

When running tests they seem to always run at the exactly same time, and Order created have had the data on all my tests :man_shrugging: Might be some cases I’m missing.

It’s a race condition, so I would expect it to intermittently work/fail. if Flow runs a bit slow, or Shopify computes the fulfillment orders faster then it will work.

1 Like

Thanks for the clarification