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.
On this page
Data provided
The following data is provided to workflows that start with the Product variant inventory quantity changed trigger.
Data | Description |
---|---|
product | The product which had its inventory quantity changed. |
productVariant | The product variant which had its inventory quantity changed. |
inventoryQuantityPrior | The 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
- The Product variant inventory quantity changed trigger will start a workflow, even if the product has Track quantity unchecked.
- 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 don't 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.
- Add product tags
- Add product to collections
- Create redirect URL
- Delete redirect URLs
- Hide product
- Publish product
- Remove product from collections
- Remove product metafield
- Remove product tags
- Remove product variant metafield
- Remove shop metafield
- Send HTTP request
- Send internal email
- Update product metafield
- Update product variant metafield
- Update shop metafield
- Wait
API details
The Product variant inventory quantity changed trigger allows actions to be taken with the Product Graphql API object.