Product variant inventory quantity changed

The Product variant inventory quantity changed trigger starts a workflow when inventory is changed for a specific product variant. The source of the inventory change can be an order, a manual change to inventory, or an app that changes inventory quantities.

Data provided

The following data is provided to workflows that start with the Product variant inventory quantity changed trigger.

Data that is provided to workflows with the Product variant inventory quantity changed trigger.
DataDescription
productThe product which had its inventory quantity changed.
productVariantThe product variant which had its inventory quantity changed.
inventoryQuantityPriorThe previous inventory quantity for the product variant.

Testing the Product variant inventory quantity changed trigger

To test a workflow that starts with this trigger, change a product's inventory.

Considerations

  • To start a workflow with the Product variant inventory quantity changed trigger, products must have Track quantity checked.

  • This trigger allows the use of actions that affect products and variants. For workflows that affect inventory items, use the Inventory item created trigger instead.

  • Draft orders do not affect available inventory until the draft orders are converted to orders.

Examples

The Flow template library has many examples that make use of the Product variant inventory quantity changed trigger. These examples show how to make use of inventory for products, variants, and per location.

To check the inventory quantity at a single location, you can find the quantity information using the productVariant / inventoryItem / inventoryLevels / available variable. The location name or ID can be checked using the productVariant / inventoryItem / inventoryLevels / location / name or productVariant / inventoryItem / inventoryLevels / location / id variables.

Actions

The following actions can be used in workflows that start with the Product variant inventory quantity changed trigger.

API details

The Product variant inventory quantity changed trigger allows actions to be taken with the Product Graphql API object.

Ready to start selling with Shopify?Try it free