Flow Automation: Triggering Workflows When an Inventory Item is Created
You can use the Inventory item created trigger in Flow Automation to start a workflow when a new inventory record is generated. Each product variant has a corresponding inventory record containing information such as the variant’s SKU, product cost, and whether its inventory is tracked. When a product variant is created, the system automatically generates its inventory record. You can use this trigger to standardize inventory settings for new variants or track the number of SKUs in your store.
This guide explains the actions supported by this trigger, how to test it end to end, and provides a practical example.
| Note: If you need to trigger a workflow based on changes in inventory quantity (such as stock increases or decreases) rather than the creation of a new variant, please refer to "Flow Automation: Triggering Workflows When Product Inventory Changes" or "Flow Automation: Triggering Workflows When Product Inventory Updates." |
Supported Actions
The following actions are primarily used in workflows initiated by the Inventory item created trigger:
- [General] Update counter
- [General] For each loop
- [General] Query metafields
- [Product] Update variant
- [Product] Delete variant
- [Product] Update inventory
Testing the Workflow
To test whether the workflow is successfully triggered when an inventory item is created, follow these steps:
- In Flow Automation, set up a workflow using the Inventory item created trigger, then click Publish to activate it.
-
From your SHOPLINE admin panel, go to Products, click a test product, and scroll down to the Variants section. Then, click Add variant.
-
After saving the changes, go to Flow Automation to check the execution results.
Note: For more information on how to monitor the execution of your workflows, please refer to "How to View the Running of a Flow" section in the "Introduction to Flow Automation" guide.
Example Use Case
Here is a practical example of using the Inventory item created trigger to standardize inventory settings for new variants.
Scenario: Your store requires inventory tracking for all physical products. When a new variant is added without inventory tracking enabled, the workflow automatically turns it on and updates your store’s SKU count.
- Trigger: Inventory item created
-
Action 1: Update counter
- Counter name: Store SKU count
- Counter value: Add 1
- Condition: [Track the inventory levels of this item or not] equal to [False]
-
Action 2: Update variant
- Track inventory, default is not tracking or not: True
- Outcome: Every new variant has inventory tracking enabled automatically, eliminating the need to check each variant’s settings. The counter also helps you keep track of new SKUs added to your store.
| Note: To insert the information shown in square brackets (such as Track the inventory levels of this item or not), click + Add variable and select the corresponding parameters. |