Flow Automation: Deleting SKU via Action
You can use the Delete SKU action in Flow Automation to automatically remove specific product variants when predefined conditions are met (e.g., when inventory falls to zero). This helps you maintain a clean product catalog by automatically clearing out discontinued or exhausted items.
This guide explains the field descriptions for this action, the supported triggers, and how to test it end to end.
Field Description
The Delete SKU action requires the following parameter to identify the target:
| Field | Description |
| Product ID | The ID of the product from which you wish to delete a variant. It can be obtained from the product details page URL, or you can select the Product ID variable from the trigger. |
|
Tip: How to find the Product ID
|
Supported Triggers
The Delete SKU action is supported by the following triggers:
- [Product] Create inventory item
- [Product] Inventory level updates
| Note: To learn more about monitoring stock levels at specific locations, please refer to "Flow Automation: Triggering Workflows When Inventory Levels Change at a Location." |
Testing the Workflow
To test whether the workflow successfully deletes a variant when all specified conditions are met, follow these steps:
- In Flow Automation, set up a workflow using the Inventory level updates trigger, the specified conditions (e.g., Status = Deactivated, Stock = 0, Allow overselling = Deny), and the Delete SKU action.
- From your SHOPLINE admin panel, go to Products > Inventory.
-
Locate a variant with multiple stock units, and manually adjust its inventory to 0 for the specific location being monitored.
Note: Since inventory is managed by location, ensure you are adjusting the stock at the correct location to successfully meet the trigger condition. For more details on location-based tracking, please refer to the "Tracking and Managing Your SHOPLINE Product Inventory" 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 Delete SKU action to automate the cleanup of discontinued products.
Scenario: Automatically clean up variant data for products that have been taken down and are completely out of stock.
When a product is marked as "Deactivated" and all its variants are sold out (with no backordering allowed), the system will automatically delete those SKUs to keep your inventory data clean.
- Trigger: Inventory level updates
-
Conditions:
- Product Status: The product is currently Deactivated.
- Inventory Level: The SKU stock is 0.
- Tracking Policy: Track inventory is enabled (Yes).
- Overselling Policy: Allow overselling is disabled (Deny).
- Action: Delete SKU
- Outcome: When an unpublished product's variants are completely sold out and not set to allow overselling, the system automatically deletes those SKUs. This ensures your store backend remains organized by removing redundant variant data for products that are no longer for sale.