Shopify Flows? Async and Query a product?

Hey,

I had two questions?

  1. Are shopify flows run async?
  2. Can you query a variant inventory level (not related to an order) and return available quantity?

Hi @ChrisBradley

  1. Shopify flow is executed asynchronously
  2. The following two APIs can obtain the inventory of products

inventoryLevel - GraphQL Admin

product - GraphQL Admin

Thanks @kyle_liu

I am doing on orderCreated Flow, so dont have access to inventory of product (due to the nature of the call), so just whipping up a webhook to manage inventory depreciation.

dont happen to know if it times out? my server is returning in 1second from the call (was not build for this purpose)

  1. Yes, Shopify Flows run asynchronously by default
  2. query a variant inventory level (not related to an order) you could use admin graqhlql to do this
1 Like

you create create two actions , and that one you can use get product variant data.

in this response , you can get inventoryQuantity field

1 Like

As Eric said, you can retrieve inventory data through the flow. If it still doesn’t meet your logic requirements, you can handle the idempotency logic yourself. Shopify webhooks have a retry mechanism.

hey @Eric_Han

Updated as I have figure it out, so its an advanced query, IE:

sku:XYZ

then the following step allows you to see the specific keys

If you are using order created, then you should not need a query. Instead look at:
order / lineItems / variant / inventoryItem / inventoryLevels

@paul_n

Thanks, the variant isnt related to the order so I need to query it seperately (its a gift with purchase, so adding to order but need to make sure there is stock first)