Workflow examples

Learn about the types of workflows that you can create by reviewing some great examples.

In addition to the examples on this page, you can also find workflows in the following ways:

  • Explore templates to find automations that you can use right away or that you can customize for your store.
  • View examples on our Connectors page.
  • Import and export workflows and share them with other merchants or partners.
  • Visit our blog to learn about interesting use cases.

Workflows that run when an order is created

  • Tag customers based on whether their order includes discounts:

Workflow example

Download example

  • Add loyalty tags to customers based on their order amount:
    Workflow example

    Download example

  • Easily implement loyalty and retention initiatives by segmenting customers with customer tags based on their lifetime spend amount:
    Workflow example

    Download example

Workflows that run when an order's risk is analyzed by Shopify

Receive an email when an order's risk level is high and tag the order. If the risk level is medium or low, then capture the payment:

Workflow example
For the above workflow to work, your store must be set up to manually capture payments.

Download example

Workflows that run when an order is paid

  • Reward your top customers when they create a large order. If a paid order totals more than $500, then add a customer tag and send a Slack message to your customer service team to send a personal thank you to your customer:
    Workflow example

    Download example

Workflows that run when an order is fulfilled

  • Prompt your localized corporate sales representative to initiate an onboarding call when a wholesale order is fulfilled in their region:
    Workflow example

    Download example

Workflows that run when an order is refunded

Workflows that run when the inventory for a product changes

  • When a product is almost sold out, send a reorder email to the vendor. This type of workflow requires that you check both the amounts before and after the inventory changes. If you check the amount only after the inventory changes, then the reorder email could be sent each time the product is ordered until the product is restocked.

    Workflow example
    In the above example, there are 6 T-shirts in the store. John orders 1 T-shirt. The inventory is now 5, so a reorder email is sent. Later, Karim orders 1 T-shirt. The inventory is now 4, but no reorder email is sent. If you omitted the Product variant inventory quantity prior condition, then another email would be sent after Karim's order.

    Download example

  • If a product is out of stock and it has a discontinue tag, then hide the product from the online store and remove it from your manual collections:

    Workflow example

    Download example

  • Inform your customers when a product is out of stock that it has been reordered. Tag the out of stock product with a coming-soon tag. Edit your theme to display a message in the store that the product will soon be available:

    Workflow example

    Download example

Workflows that run when a product is added

Automatically add tags to newly created products based on the product title. If a product's title contains the word T-shirt, then add a t-shirt product tag and add it to a manual collection:

Workflow example

Download example

Workflows that run when a customer is created

Tag customers based on their email addresses. If a customer is created and their email includes .edu, then add your educational discount tag:

Workflow example

Download example

The following list contains examples of messages and notes that use template and Liquid variables.

Template variables and Liquid examples

Examples of workflow actions that use template and Liquid variables.

  • For example, you have a workflow that sends an email when a customer spends more than $500 on an order.
To Joe@mycompany.com

Please send a personal thank you note to {{order.customer.firstName}} {{order.customer.lastName}}({{order.customer.email}}) for placing an order for  {{order.totalPriceSet.shopMoney.amount}}

When a customer, Jeanne Dupont, creates an order for $1000, the following message is sent by the workflow:

Joe@mycompany.com

Please send a personal thank you note to Jeanne Dupont (jeanne@jeanneemail.com) for placing an order for $1000.00
  • In the following example, the title of the discontinued product appears in the message:
Discontinued product {{product.title}} has just hit an inventory level of 0.
  • In the following example, the title of variant appears in the message:
Please pause all ad campaigns involving {{product_variant.title}}.
  • In the following example, the customer's name and email address along with the total of their last order appears in the message:
Please send a personal thank you note to {{order.customer.firstName}}({{order.customer.email}}) for placing a recent order for  {{order.totalPriceSet.shopMoney.amount}}
  • In the following example, the title of the product appears in the message:
Please reorder {{product.title}}. Email owner@store.com to verify that they've received the purchase order.
  • In the following example, the order ID appears in the message:
{{order.id}} has been cancelled due to high risk.
  • In the following example, the order number and the customer's name and email address appears in the message:
Our Shopify store has received an order with a high risk of fraud. We would like to cancel this order right away, before it is sent to production:

      {{order.name}}
      {{order.billingAddress.lastName}} {{order.billingAddress.firstName}}
      {{order.email}}

Please confirm the new order status. Thanks!
  • In the following example, the name of the customer, their email address, and the total price of their last order appears in the message along with a link to the order in your Shopify admin:
Please send a personal thank you note to
{{order.customer.firstName}} ({{order.customer.email}}) for placing a recent order for $ {{order.totalPriceSet.shopMoney.amount}}

View order: https://store.myshopify.com/admin/orders/{{order.id}}

For Loop examples

When an offer is received, it can be useful to send a message that contains the products ordered. You can do this by using for loops and the lineItems template variable.

Text fields that support template variables also support for loops and the forloop object.

Here's an example that uses a for loop to list the SKUs and quantities in all the lineitems:

Order summary:
{% for a in order.lineItems %}
  SKU: {{a.sku}} ( {{a.quantity}} ), 
{% endfor %}

When the message is sent, the for loop code is replaced with the list of SKUs:

Order summary:
  8987097979 (50)
  8877778887 (3)
  888998898B (1)

In this example, the for loop is used to list all the lineitems:

Order summary: <br />
{% for a in order.lineItems %}
Title: {{a.title}}, <br/>
SKU: {{a.sku}}, <br/>
Price (per unit): $ {{a.originalUnitPriceSet.shopMoney.amount}}, <br/>
Quantity: {{a.quantity}} <br/>
{% endfor %} 
Ship to: <br/>
{{order.shippingAddress.name}}  <br/>
{{order.shippingAddress.address1}}  <br/>
{{order.shippingAddress.address2}}  <br/>
{{order.shippingAddress.city}}  <br/>
{{order.shippingAddress.province}}  <br/>
{{order.shippingAddress.zip}}  <br/>
{{order.shippingAddress.country}}  <br/>

In this example, an if is used inside the for loop to list lineitems from a specific vendor:

{% for x in order.lineItems %}
{% if x.vendor == 'acme-vendor' %}
  Title is {{x.title}}<br/>
  SKU is {{x.sku}}</br>
{% endif %}
{% endfor %}

Ready to start selling with Shopify?

Try it free