Automate Low Stock Email Notifications on Shopify

December 10, 2024 3 min read
Back to Blog

Running out of stock unexpectedly can cost you sales and frustrate customers. By the end of this tutorial, you will have a fully automated email notification system that triggers whenever your Shopify products run low on stock or sell out completely.

We will be using Shopify Flow to build this automation. Follow the steps below to get started.

Step 1: Create the Workflow Trigger

First, navigate to the Shopify Flow app within your store admin.

  1. Click Create workflow.
  2. Click Select a trigger.
  3. In the search bar, type "quantity".
  4. Select Product variant inventory quantity changed from the list.

This ensures the automation runs every time inventory levels are adjusted.

Step 2: Define the Logic Condition

Next, we need to tell Shopify exactly when to alert us. We don't want an email for every change—only when stock is critically low.

  1. Click the Then button to add a step.
  2. Select Condition.
  3. Click Add variable and navigate to Product variant > Inventory quantity.
  4. Set the logic operator to Less than or equal to.
  5. Enter your threshold value. For this example, we will use 5.

Note: You can adjust this number based on your specific inventory needs.

Step 3: Configure the Email Action

Now that the logic is set, we need to configure the notification itself.

  1. Click Then after your condition.
  2. Select Action.
  3. Choose Flow > Send internal email.
  4. Enter the email address where you want to receive these alerts.

The Liquid Code Templates

To make the email useful, we need to dynamically pull in the product data using Liquid variables.

Email Subject:

Low Stock Alert: {{productVariant.product.title}}

Email Message: Copy and paste the following code to include the variant name, current count, and a direct link to the product in your Shopify Admin:

The following product is running low on stock:

Variant: {{productVariant.displayName}}
Current Stock: {{productVariant.inventoryQuantity}}

Manage Inventory here:
https://admin.shopify.com/store/YOUR_STORE_NAME/products/{{productVariant.product.id}}/variants/{{productVariant.id}}

Make sure to replace YOUR_STORE_NAME with your actual Shopify store handle.

Step 4: Test Your Automation

Before relying on this workflow, it is important to test it.

  1. Click Turn on workflow in the top right corner.
  2. Navigate to your Shopify Products section.
  3. Find a product with stock currently above your threshold (e.g., 10).
  4. Manually adjust the inventory to 0 or a number below your threshold (e.g., 3).

Verifying the Result

Return to Shopify Flow and open your specific workflow run history. You should see that the condition evaluated as True and the email action was executed.

Check your inbox. You should see an email containing the product details and a direct link to the Shopify admin to restock or manage the item.

Will Misback

About Will Misback

I build the systems that turn traffic into profit. As a Shopify development consultant, I eliminate bottlenecks and engineer systems tied to your bottom line: reducing costs, raising LTV, and maximizing AOV. I combine full-stack development, conversion rate optimization, and strategic analytics to deliver results that pay for themselves.

Ready to Grow Your Business?

Let's discuss how we can help grow your e-commerce business.

Get in Touch