Flow Automation: Triggering Workflows When Product Inventory Updates
You can use the Inventory object updates trigger in Flow Automation to initiate workflows whenever the inventory level of a product variant is modified. This trigger is ideal for managing overall stock buffers, automating pre-order settings, or centralizing inventory notifications across all locations.
This guide explains the actions supported by this trigger, how to test it end to end, and provides a practical example for automating inventory alerts.
Supported Actions
The following actions are primarily used in workflows initiated by the Inventory object updates trigger:
- [General] Send email
- [General] Update counter
- [General] For each loop
- [General] Query metafields
- [Product] Remove product tags
- [Product] Add product tags
| Note: If you need to trigger a workflow based on inventory changes at a specific warehouse or retail location rather than the total variant level, please refer to "Flow Automation: Triggering Workflows When Inventory Levels Change at a Location." |
Testing the Workflow
To test whether the workflow is successfully initiated when the product inventory is updated, follow these steps:
- In Flow Automation, set up a workflow using the Inventory object updates trigger.
-
From your SHOPLINE admin panel, go to Products > Inventory, and find a product, and update its inventory quantity in the Available column.
Note: In SHOPLINE, updating either the Available or On-hand quantity will automatically adjust the other and initiate the workflow. For more detailed instructions on managing product variants, please refer to the "Adding and Managing Product Variants" guide. -
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 the "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 object updates trigger to automate internal stock alerts.
Scenario: Send low-stock email alerts to staff when the total inventory of a product variant drops below a certain threshold.
- Trigger: Product inventory updates
- Condition: Check if the variant's available inventory is less than or equal to the assigned number (i.e., 20).
-
Action: Send email notification
- Recipient: Manually enter the email addresses of the staff members who should receive the notification.
- Subject: Global Low Stock Alert [Product variant name] (${variant.title})
-
Email Content: The total inventory for [Product variant name] (${variant.title}) has dropped to [Available quantity] (${variant.inventory_quantity}) across all locations. To restock or make further adjustments, please log in to the SHOPLINE admin panel to view detailed inventory status.
Note: To insert the variables shown in parentheses (e.g., ${variant.title}), click Add variables and select the corresponding parameters.
- Outcome: Whenever the total stock of a variant falls below the defined threshold (e.g., 20 units), the system automatically sends an email notification. This ensures the operations team can manage global stock levels and prevent overselling.