Explore how Shopify Flow automations streamline operations with examples like adding free products, canceling test orders, and integrating with an ESP.
Shopify Flow has been a game-changer in simplifying operations, reducing manual tasks, and ensuring a seamless shopping experience for customers. Over time, I’ve had the opportunity to work on a variety of flows, ranging from simple automations to intricate solutions requiring custom logic. This blog highlights some of the key Shopify Flows I’ve developed, diving into the use cases, challenges, and outcomes.
We wanted to offer a free product whenever a customer purchased a specific type of item. The challenge lay in dynamically determining the quantity of the free product based on the purchased quantity of the qualifying item.
Using Shopify Flow, I created an automation that evaluated each order's line items. The logic to calculate the quantity required a custom Liquid code snippet:
{% assign totalQuantity = 0 %}
{% for lineItems_item in order.lineItems %}
{% if lineItems_item.sku contains "AAA_" %}
{% assign totalQuantity = totalQuantity | plus: lineItems_item.currentQuantity %}
{% endif %}
{% endfor %}
{% if totalQuantity > 0 %}
{{ totalQuantity }}
{% endif %}
This snippet ensured that the correct number of free products was added to the order, matching the total quantity of qualifying products.
The automation eliminated the need for manual intervention in identifying eligible orders and adding free products, enhancing operational efficiency and improving the customer experience.
Our team frequently ran test orders during development and QA processes. Identifying and canceling these manually was cumbersome, so I automated the process based on a specific discount code used for testing.
I created a Shopify Flow that triggers when a new order is created. If the order contains the predefined discount code for testing, the flow automatically cancels the order.
This simple yet effective flow saved time and ensured that test orders didn’t clutter our sales data.
We wanted to send data from a Shopify form submission directly to our email service provider (ESP), Iterable, to personalize email marketing. The challenge was integrating Shopify’s customer metafields with an HTTP request to the ESP.
Shopify Flow’s ability to trigger automations based on customer updates was key here. Whenever a customer submitted a form, a tag was added to their profile. The flow used this tag as a trigger, checked the customer metafield updated by the form, and sent a POST request to Iterable with the relevant data.
This flow streamlined the data transfer process, enabling real-time updates to our ESP and making our marketing campaigns more effective and targeted.
Identifying orders containing final sale products was crucial for downstream processes, such as reporting and customer service. Products with a "Final Sale" designation were marked via a Shopify metafield, and we needed an automation to tag orders accordingly.
I designed a flow triggered by order creation. It looped through each line item in the order and checked the product metafield. If a product was marked as "Final Sale" and wasn’t an always-final-sale item like paper bags, the flow added a corresponding tag using this Liquid code:
liquid
Copy code
{% for line_item in order.lineItems %}
{% if line_item.product.returnRules.value == 'Final Sale' and line_item.product.title != 'Paper bags' %}
Final - {{ line_item.product.title }}
{% endif %}
{% endfor %}
This automation simplified order management by providing clear visibility into orders with final sale items, ensuring compliance with return policies and reducing errors.
Automating workflows with Shopify Flow has been a rewarding experience, blending creativity with technical problem-solving. Whether it’s calculating quantities dynamically, integrating with external systems, or simplifying order tagging, Flow has been a reliable tool in streamlining operations.
If you're exploring Shopify Flow for your business, my advice is to start with clear goals, break down the logic into manageable steps, and don’t hesitate to dive into custom Liquid code for advanced functionality. The possibilities are endless, and the benefits are tangible.