Welcome to Workflows! Workflows is a tool that is designed to automate subscription changes. It is triggered by orders created in Shopify, looks at the order criteria, and once met, makes the changes that you have set up. Once you create a workflow, you can set it and forget it. Maintaining a workflow simply requires making sure the information in workflows are up-to-date, e.g. product and variant IDs are up-to-date.
Below, we will go through how to create a workflow, including how to create them around common use-cases, and manage them.
Before you get started, it is important to have answers to the following:
What are the order conditions that are required to qualify for the action? Remember: workflows are triggered only by orders.
For example, the order condition would be that it's a checkout order with a trial kit.
What needs to happen to the subscription?
For example, swapping the trial kit for the standard kit.
It will also help to have handy the Variant IDs of the product/product variants that are affected. How can I find a Variant ID?
Once you have everything, find Tools in the left-hand navigation menu, and open the dropdown. Click into Workflows, and click "Add New Workflow."
Setting Up the Trigger
1. Select your trigger—"A subscription order is created" or "A checkout order is created". Once you've made your selection, click Next to set up the Conditions.
2. "Stop all following workflows if this workflow executes at least one action": Selecting the checkbox means if one action from this workflow makes changes to a subscription, no other workflows will act on that subscription even if it meets the conditions you’ve set.
Use-case: If subscriptions are meant to cycle through products based on month/season, you likely do not want the product swap happening more than once at a given time. Selecting the checkbox will ensure that once the first product swap executes, no other actions from that workflow or other workflows take places.
Identifying the Trigger Conditions
Once you've set up your trigger, you need to set up the conditions around the trigger. The trigger itself only looks for the order type—checkout or recurring. The conditions look further at the order’s contents.
1. Select what the order contains, at the product, variant, or subscription contract level.
If identifying conditions at the subscription contract level, you'll be able to select a Discount Code to segment out impacted subscriptions. The created workflow will only trigger based on contracts that contain that specific Shopify Discount Code.
If identifying conditions at the product or variant level, use the magnifying glass to search for the product or variant by the product title. Select the product/variant. You should then see your selection materialize the product or variant ID in a JSON format (e.g. gid://Shopify/Product/PRODUCT_ID or gid://Shopify/ProductVariant/VARIANT_ID - You can also manually enter values in this format).
2. Select your comparison type—Price, Quantity, Cycle Number, Line item property.
Price - Price of the line item
Quantity - Quantity of the line item
Cycle Number - Order cycle number of the subscription (e.g. the order has to be the third order in the subscription)
Line item property - A specific property/attribute of the line item in the order
This would need to be set up by your dev team to include custom properties on the line items in the orders.
For "Order Contains Subscription Contract", the Comparison Type will be Discount Code - The Shopify Discount Code that is currently active on a subscription contract.
3. Once you've set up your first condition, you have the option to add another as an "AND" condition or as an "OR" condition.
Setting the Actions
Once you've successfully set up the trigger and conditions, you're ready to set up the workflow action. Please note that all line-item/product-related actions will require the variant ID.
1. Select your action type from the dropdown list. Below is a breakdown of the action definitions, call-outs, and use-cases.
Swap Item - This action swaps one line item in the subscription to another. Both the 'old' line item and the 'new' line item must be identified by their variant ID. It is recommended that you use the magnifying glass to search for and select the correct product variants.
Use-cases: Swap the trial kit to the full-sized product, or swap the starter kit/jar variant to the refill variant.
Price Change - This action changes the price of the targeted product variant. The line item that you want to change the price for also needs to be identified by its variant ID.
Use-case: Price increase on the third order, after super deep discounts on the first two orders.
Change Billing Interval - This action changes the billing interval (aka frequency) of the subscription.
Use-case: Subscription starts on a free 14-day trial product and thus, the subscription is created on a 14-day frequency. After the first renewal order, the subscription's frequency/billing interval needs to change to 30 days.
Change quantity - This action changes the quantity of the targeted product variant.
Remove item - This action removes the targeted product variant from the subscription.
Add item - This action adds the targeted product variant from the subscription.
Set Shipping Price - This action sets/changes the shipping price on the subscription. Note: The shipping preservation flag must be enabled on your store to use this action. Please reach out to your CSM, if you're not sure or do not have it enabled.
Use-case: The free trial checkout order charged the customer for shipping, so a shipping cost is now on the subscription. However, all full-sized subscription orders receive free shipping, so you need to set the shipping price to free.
Update Subscription Status - This action changes the status of the subscription to active or canceled.
Use-case: Influencer subscriptions need to be canceled after five subscription orders.
Apply Discount Code - This action will add the applicable Shopify Discount Code to any subscription contracts applicable to the workflow conditions. Note: The discount will look to the logic set within Shopify to determine if the discount is recurring, one time, etc.
Remove Discount Code - This action will remove the applicable Shopify Discount Code from any subscription contracts applicable to the workflow conditions.
2. Once you set up your first action, you have the option to add additional actions as "AND" actions to the first one.
Most workflows are meant for you to set it and forget it. However, life happens and unforeseen circumstances may impact the products and variants you have targeted in your workflows. Below, we discuss the various use-cases in which you will need to maintain your workflow to keep it functional.
1. A product or variant you have subscriptions swapping to is out-of-stock
If a product or variant that you have targeted in your workflow for a product swap action is out-of-stock, you will need to edit your workflow to replace the out-of-stock item with a replacement you'd like subscriptions swapping to instead.
If you'd like to stop the swap altogether, simply pause your workflow in the Edit mode of the workflow.
2. The product and/or variant IDs have changed
It should be very rare that product and variant IDs change in your Shopify store, as that means the original product/variant has been deleted. In any case, make sure the IDs in the workflows are updated to the new values in Shopify.
3. The Shopify Discount Code is no longer active
In this case, it is best to de-activate the workflow to avoid any downstream issues.
If any logic in Shopify is updated for the discount, that will automatically be consumed for any subscriptions where the discount is applied.