Flow Automation: Finding Subscription Plans via Action
In Flow Automation, you can use the Find subscription plans action to retrieve multiple subscription plans in your store based on criteria such as their names and creation dates, and pass the results to subsequent workflow steps for further processing. For example, you can identify subscription plans that are no longer associated with any products and send email reminders to your operations team to determine whether these plans should be removed.
Subscription plans are purchase plans you configure for subscription products in the Subscription app. Each subscription plan can include multiple delivery frequency options, such as "Deliver every month" or "Deliver every two months." For details on setting up subscription plans, see "Subscriptions: Setting Up Recurring Purchases."
This guide explains when to use this action, its field definitions, compatible workflows, how to test the workflow, and its usage limitations. It also provides a practical use case.
| Note: This action only retrieves subscription plan information and does not modify any subscription plans. |
When to Use the Find Subscription Plans Action
The Find subscription plans action is useful in the following scenarios:
- You want to regularly review your store's subscription plans and identify those that are no longer associated with any products.
- When a subscription plan is created, updated, or deleted, you want to review other similar subscription plans in your store.
- You need to retrieve a list of subscription plans for a subsequent For each loop (iterate) action to process individually.
Field Definitions
The Find subscription plans action allows you to specify query conditions to retrieve matching subscription plans.
| Field | Description |
| Query conditions | Used to filter the subscription plans to retrieve. Click + Add condition, select the desired conditions, and click Sure. If no conditions are specified, the action queries all subscription plans in your store and returns up to 50 plans per execution by default. The available query conditions are listed below.
|
| Note: All query conditions are optional. If no conditions are specified, the action returns up to 50 subscription plans in your store by default. |
After adding the conditions, enter a value for each condition or click + Add variable to use a variable from a previous workflow step.
Each subscription plan returned in the query results includes the following information:
- [Selling plan name]: The subscription plan name displayed to customers.
- [Admin display name]: The subscription plan name displayed in the SHOPLINE Admin.
- [Selling plan description]: The subscription plan description displayed to customers.
- [Selling plan options]: The delivery frequency options included in the subscription plan, such as "Deliver every month."
- [Associated Product count]: The number of products associated with the subscription plan.
Applicable Workflows
The Find subscription plans action is primarily used in workflows initiated by the following triggers:
- [General] Scheduled time
- [Subscription] Updated selling plan
- [Subscription] Deleted selling plan
- [Subscription] New selling plan
Testing the Workflow
To verify that your workflow successfully retrieves subscription plans, follow these steps:
In Flow Automation, configure a workflow using the Scheduled time trigger and the Find subscription plans action, then click Publish.
Tip: For testing purposes, set First trigger time to a few minutes from now and Repeat or not to Not repeating so you can review the execution results shortly. Open the Subscription app from your SHOPLINE Admin and ensure that your store has at least one subscription plan that meets the specified query conditions.
Note: For details on creating subscription plans, see "Subscriptions: Setting Up Recurring Purchases." Once the scheduled trigger time has passed, go to Flow Automation to review the workflow execution results.
Note: For details on reviewing workflow execution results, refer to the "How to View the Running of a Flow" section in the "Introduction to Flow Automation" guide. - Review the subscription plans returned in the execution results and verify that they match the plans in the Subscription app that meet your query conditions.
Examples Use Case
The following example demonstrates how to use the Find subscription plans action to conduct a monthly review of inactive subscription plans.
Scenario: On the first day of each month, identify subscription plans that are no longer associated with any products and send email reminders to your operations team to determine whether these plans should be removed. This helps prevent unused subscription plans from accumulating in the admin and reduces the risk of staff selecting the wrong plan when configuring products.
Configure the workflow as follows:
- Trigger: Scheduled time
- First trigger time: 10:00 AM on the first day of the following month
- Repeat or not: Repeat monthly
- End repeat: Never end
- Action: Find subscription plans
- Query limit: 250
- Action: For each loop (iterate) (processes each retrieved subscription plan individually)
- Loop object: The list of selling plan groups returned by the Find subscription plans action
- Condition: [Associated Product count] is equal to 0
- Action: Send email
- Subject: Inactive Selling Plan Reminder: [Selling plan name]
- Content: The selling plan "[Selling plan name]" is currently not associated with any products. Please confirm whether it should be retained.
- Recipient: The email address of the operations team
Result: Each month, the operations team receives an email reminder for each inactive subscription plan identified. This allows them to review and remove unused plans as needed, reducing the risk of staff selecting the wrong plan when configuring products.
| Note: To insert information shown in square brackets (such as the selling plan name), click + Add variable and select the corresponding parameter. |
Usage Limitations and Considerations
- Query result limit: Each execution returns up to 250 subscription plans (50 by default). If your store has a large number of subscription plans, consider narrowing the query scope by name or creation date.
- Read-only action: This action retrieves subscription plan information without modifying any plans. To make changes to subscription plans, go to the Subscription app.
- No matching results: If no subscription plans meet the specified query conditions, subsequent workflow steps receive an empty list. We recommend adding a condition after the query to check whether the number of results is greater than 0 before proceeding with subsequent steps.