Inventory level triggers
Workflow Companion can start a Shopify Flow workflow when a product variant is stocked at a location: from then on, the location holds the variant's inventory and can sell it. It can also start one when a variant is unstocked from a location, which then no longer holds the variant's inventory.
Available triggers
- Product variant stocked at location — starts when a product variant is stocked at a location, once for each location. A variant stocked at three locations starts three runs.
- Product variant unstocked from location — starts when a product variant is unstocked from a location, once for each location.
How to turn them on
- In
Settings→Triggers, select Manage in the Resource lifecycle row, turn on Inventory levels, and allow access to inventory when Shopify asks. - In Shopify Flow, build a workflow that starts with the trigger.
When the triggers start
Product variant stocked at location starts each time a variant becomes stocked at a location, whatever stocks it: the Shopify admin, a CSV import, an app or the Admin API. A new variant counts: Shopify stocks it at its locations as it's created.
Product variant unstocked from location starts each time a variant stops being stocked at a location, a location's deactivation included.
Neither starts when only quantities change, on orders, fulfillments or returns, or on edits to a product or a variant. Deleting a variant or a product starts neither. To start a workflow on a deletion, use Shopify Flow's own Product variant deleted or Product deleted trigger.
Deactivating a location
Deactivating a location that N variants are stocked at, and moving its inventory to another location, starts:
- N runs of Product variant unstocked from location, one for each variant;
- one run of Product variant stocked at location for each variant that wasn't stocked at the other location yet.
For example, deactivating a location that 500 variants are stocked at, into a location where 200 of them aren't stocked yet, starts 500 unstocking runs and 200 stocking runs.
Workflow payload details
Both triggers send:
product— the product the variant belongs to, with everything Shopify Flow reads of a product, such as its tags.Product variant— the variant:id— its ID, for examplegid://shopify/ProductVariant/123456789.legacyResourceId— its numeric ID, for example123456789.title— its title, for exampleSmall / Blue, orDefault Titlefor a product with no options.sku— its SKU. Empty when it has none.
Inventory item— the variant's inventory item:id— its ID, for examplegid://shopify/InventoryItem/123456789.legacyResourceId— its numeric ID, for example123456789.
Location— the location:id— its ID, for examplegid://shopify/Location/123456789.legacyResourceId— its numeric ID, for example123456789.name— its name, for exampleMain warehouse.
Occurred at— when Shopify says the variant was stocked or unstocked, in ISO 8601 UTC. For example,2026-09-23T14:05:06.123Z.Event ID— Shopify's ID of the event, for example98880550-7158-44d4-b7cd-2c97c8a091b5. See Event ID.
Product variant stocked at location also sends:
Inventory level— the inventory level of the variant's inventory item at the location:id— its ID, for examplegid://shopify/InventoryLevel/123456789?inventory_item_id=987654321.
Inventory item's id and Location's id are the two IDs the inventoryBulkToggleActivation mutation takes, so a
workflow can unstock the variant from that location, or stock it there again, in Shopify Flow's Send Admin API
request action. Shopify refuses to unstock a variant from the only location it's stocked at, with the error
CANNOT_DEACTIVATE_FROM_ONLY_LOCATION.
The payload names no default location. To tell one location from another, compare its name or its id.
Event ID
Event ID is Shopify's ID of the event that started the run. Use it as an idempotency key:
- Pass it to
@idempotent(key: …)in a mutation that takes an idempotency key, such asinventoryActivate, in the Execute GraphQL request action or Shopify Flow's Send Admin API request action. If the workflow runs more than one such mutation, give each its own key, for exampleEvent IDfollowed by the step's name. - Send it in a Send HTTP request action, so that the system the workflow calls can ignore a request it has already handled.
Important considerations
- Runs aren't guaranteed to start in the order the stockings and unstockings happened.
Occurred atsays when each one did.