Flow Automation: Finding Product Variants with an Action
You can use the Find product variants action in Flow Automation to retrieve all variants of a product or query specific variant details based on conditions such as variant ID.
After retrieving the variant data, you can connect additional actions to automatically update product tags, activate or deactivate products, add products to collections, archive products, or update variant information. This helps you manage products and variants more efficiently while reducing manual work.
This guide explains the action's query fields, common use cases, and testing steps, with a practical example showing how to use it in a workflow.
| Note: The Find product variants action only retrieves variant data. It does not modify variant prices, inventory, or option settings. To perform additional operations based on the query results, add the corresponding actions to your workflow. |
When to Use the Find Product Variants Action
You can use this action in the following scenarios:
- Manage products based on variant information: When product information is updated, automatically retrieve its variant details and use the results to add product tags or remove products from specific promotional collections.
- Automatically categorize new products: When a new product is created, retrieve its variant information and use the results to add the product to a corresponding manual collection or activate it.
- Perform actions based on ordered variants: When a customer places an order, retrieve the variants of the purchased products and use the results to update product tags or variant information.
Field Descriptions
The Find product variants action lets you filter the variant data to retrieve by configuring query conditions.
| Field | Description |
| Query conditions |
Specify which product variants to retrieve. Click + Add condition, select one or more conditions, and click Sure. Then enter the corresponding values or click + Add variable to reference parameters from previous workflow steps. The following query conditions are supported:
|
Applicable Workflows
The Find product variants action can be used in workflows started by the following triggers:
- [Order] Product ordered
- [Product] Collection deleted
- [Product] Create a product
- [Product] Product update
| Note: For detailed instructions on configuring these triggers, refer to the corresponding Flow Automation guides. |
Testing the Workflow
To verify that your workflow successfully retrieves product variant information, follow these steps:
- In Flow Automation, create a workflow using the Create a product trigger and the Find product variants action. Then click Publish.
-
In your SHOPLINE Admin, go to Products and click Create product.
- Enter the product details, add at least one variant, and click Create. We recommend using an easily identifiable name for your test product so you can delete it afterward without affecting your live product catalog.
-
After creating the product, return to Flow Automation and check the workflow execution results.
Note: For more information on monitoring workflow executions, refer to the "How to View the Running of a Flow" section in the "Introduction to Flow Automation" guide. - In the execution results, verify that the Find product variants action successfully returned the variant information for your test product.
Example Use Case
The following example demonstrates how to use the Find product variants action to increase the visibility of best-selling products.
Scenario: When a customer orders a specific variant of a popular product, the workflow queries the variant information and automatically adds the associated product to a manual collection named "Best Sellers."
Configure the workflow as follows:
- Trigger: Product ordered (starts the workflow when a customer orders a product)
-
Action: Find product variants
- since_id: [Variant ID] (the variants purchased in the order)
- limit: 10
- Action: Count function (counts the number of variants found)
- Condition: Count is greater than 0
-
Action: Add product to collection
- Product ID: [Product ID] (the product associated with the retrieved variant)
- Category id: The ID of the "Best Sellers" collection
Outcome: Products with purchased variants are automatically added to the "Best Sellers" collection, increasing their visibility on your storefront without requiring manual updates.
| Note: To insert the information shown in square brackets, such as [Variant ID] and [Product ID], click + Add variable and select the corresponding parameter. |