Building Custom Shopify Flow Automations: A Complete Guide to Workflow Creation

I just finished setting up several Shopify Flow automations for my store, and honestly, it’s been a game-changer for managing high-value orders and fraud prevention. If you’re still manually checking every order above a certain threshold or constantly switching between apps to monitor your store, you’re missing out on some serious time savings.

In this guide, I’ll walk you through everything you need to know about Shopify Flow, including the latest updates that let you add custom JavaScript code to your workflows. We’ll build a real fraud prevention automation that I actually use in my own business.

Key Insights You’ll Learn

  • How Shopify Flow’s three building blocks (triggers, conditions, actions) work together
  • Step-by-step creation of a high-value order monitoring system
  • Using the new “Run Code” action to implement complex business logic
  • Practical automation ideas across inventory, fulfillment, and fraud prevention
  • Real Slack integration that keeps your team instantly informed

What Is Shopify Flow?

Shopify Flow is a free, low-code automation platform built directly into your Shopify admin. Instead of writing complex code, you connect different building blocks using a visual interface to create custom workflows.

Every flow consists of three types of building blocks:

Triggers start your workflow when something specific happens in your store or connected apps (like when an order is created).

Conditions determine whether to proceed based on criteria you define (like checking if an order amount exceeds $5,000).

Actions execute the actual changes or notifications you want (like sending a Slack message or adding tags to orders).

Common Automation Categories

Browse the pre-built templates in Shopify Flow to get ideas, but here are the most practical categories I’ve seen work well:

Inventory Management

  • Tag products when stock runs low
  • Send team notifications for inventory alerts
  • Automatically reorder popular items

Order Management & Fulfillment

  • Prioritize high-value or VIP customer orders
  • Get notifications when specific products are included
  • Automate fulfillment status updates

Fraud Prevention

  • Hold orders above certain amounts for review
  • Flag customers making multiple orders in one day
  • Monitor unusual shipping patterns

Customer Experience

  • Send automated thank-you emails for positive reviews
  • Create VIP customer workflows
  • Trigger personalized follow-up sequences

Building a High-Value Order Monitoring Flow

Let me show you how to build the fraud prevention automation I use. This flow triggers when orders exceed $5,000 and sends detailed Slack notifications with customer history data.

Step 1: Install and Set Up Shopify Flow

First, install the free Shopify Flow app from the Shopify App Store. Once installed, you’ll see a dashboard with templates and your existing workflows.

Step 2: Create the Trigger

Click “Create workflow” and search for “order” in the trigger selection. Choose “Order created” as your starting trigger. This fires every time a new order comes in.

Give your workflow a descriptive name like “High Value Order Review Slack Notification” to stay organized.

Step 3: Add the Condition

Click the plus icon next to “then” and add a condition. Here’s where we check if the order meets our criteria:

  1. Select “Order” as the object
  2. Choose “Current total price set” → “Shop money” → “Amount”
  3. Set the condition to “greater than or equal to”
  4. Enter your threshold (I use 5000)

Step 4: Configure the Slack Action

For orders above your threshold, add a “Send a Slack message” action. You’ll need to authenticate with your Slack account first.

Create a dedicated channel for these notifications and make sure to add the Shopify Flow bot to that channel.

Here’s the message template I use:

💰 **New High Value Order**
📧 Order: [Dynamic Order Link]
📅 Date: [Dynamic Date]
👤 Customer History:
🟢 Paid Orders: [Dynamic Count]
🟡 Partially Refunded: [Dynamic Count] 
🔴 Fully Refunded: [Dynamic Count]

Step 5: Make It Dynamic with Variables

Replace the static elements with Shopify Flow variables:

  • For the date: Insert “Order” → “Created at”
  • For the order link: Use the Order ID with liquid filters to extract just the numeric ID

The order ID comes in a format like gid://shopify/Order/123456, but we only need the number at the end. Use this liquid code to extract it:

{{ order.id | split: 'Order/' | last }}

This creates a direct link to the order in your admin for quick review.

Using the New Run Code Action

Here’s where the latest Shopify Flow update gets exciting. The new “Run Code” action lets you implement custom JavaScript logic right in your workflows.

When to Use Run Code

The standard flow blocks work great for simple conditions, but you need custom code when you want to:

  • Count specific types of historical orders
  • Perform complex calculations
  • Work with advanced metafields
  • Iterate over arrays of data

Setting Up Customer Order History

To add customer order history to our Slack notification, insert a “Run Code” action between your condition and Slack message.

Input Query (GraphQL):

order {
  customer {
    orders(first: 250) {
      edges {
        node {
          financialStatus
        }
      }
    }
  }
}

Output Variables:

  • paidOrders (Integer)
  • partiallyRefundedOrders (Integer)
  • refundedOrders (Integer)

JavaScript Implementation:

const orders = input.order.customer.orders.edges;

let paidCounter = 0;
let partiallyRefundedCounter = 0; 
let refundedCounter = 0;

orders.forEach(edge => {
  switch(edge.node.financialStatus) {
    case 'PAID':
      paidCounter++;
      break;
    case 'PARTIALLY_REFUNDED':
      partiallyRefundedCounter++;
      break;
    case 'REFUNDED':
      refundedCounter++;
      break;
  }
});

return {
  paidOrders: paidCounter,
  partiallyRefundedOrders: partiallyRefundedCounter,
  refundedOrders: refundedCounter
};

Now you can use these output variables in your Slack message to show real customer order history data.

Order Status Description Business Value
Paid Orders Successfully completed transactions Indicates customer reliability
Partially Refunded Orders with some refunded items Shows potential issues but not complete problems
Fully Refunded Complete order refunds Red flag for potential fraud or quality issues

Testing Your Flow

Before going live, test your automation thoroughly:

  1. Turn on your flow
  2. Create a test order above your threshold
  3. Check that your Slack notification arrives with correct data
  4. Verify all dynamic elements populate properly
  5. Test the order link functionality

The notification should arrive within seconds of order creation, giving your team immediate visibility into high-value transactions.

Practical Tips for Flow Success

Start Simple: Build basic flows first, then add complexity with Run Code actions as needed.

Use Descriptive Names: You’ll thank yourself later when managing multiple workflows.

Test Thoroughly: Always test with real scenarios before activating flows for live orders.

Monitor Performance: Check your flow dashboard regularly to ensure automations are working as expected.

Document Your Logic: Keep notes on complex JavaScript implementations for future reference.

Pro Tip: Install the Shopify GraphQL app to practice writing queries and understand the data structure before building complex Run Code actions.

Advanced Automation Ideas

Once you master the basics, consider these advanced workflows:

Inventory Restocking: Automatically create purchase orders when products hit reorder points.

VIP Customer Treatment: Identify high-value customers and trigger special handling processes.

Geographic Fraud Detection: Flag orders with shipping/billing address mismatches.

Seasonal Promotions: Automatically apply tags or discounts based on customer purchase history.

Quality Control: Monitor refund patterns and alert teams to potential product issues.

Why This Matters for Your Business

These automations aren’t just convenient—they’re essential for scaling efficiently. Manual order review takes time away from growing your business, and human oversight of every transaction becomes impossible as order volume increases.

The Slack integration keeps your entire team informed without requiring constant admin monitoring. Team members can quickly review flagged orders, make decisions, and tag colleagues when questions arise.

Conclusion

Shopify Flow transforms time-consuming manual processes into automated workflows that run 24/7. The combination of visual flow building and custom JavaScript capabilities gives you the flexibility to automate almost any business process.

Start with simple automations like the high-value order monitoring we built here, then gradually add more complex logic as you get comfortable with the platform. Your future self will thank you for the time saved and the peace of mind that comes with automated monitoring.

The best part? This entire system costs nothing beyond your existing Shopify subscription and takes less than an hour to set up.

FAQ

How much does Shopify Flow cost?
Shopify Flow is completely free and included with all Shopify plans. There are no usage limits or additional charges.

Can I use Shopify Flow with third-party apps?
Yes, many apps integrate with Shopify Flow as trigger sources or action destinations. Popular integrations include Slack, email marketing platforms, inventory management tools, and accounting software.

What happens if my JavaScript code has errors?
Shopify Flow will show error messages in the flow dashboard, and the workflow will stop at the failed step. Always test your Run Code actions thoroughly before activating flows.

Can I modify flows after they’re active?
Yes, you can edit active flows at any time. Changes take effect immediately, so be careful when modifying live workflows that handle important business processes.

Are there limits on how many flows I can create?
Shopify doesn’t publish specific limits, but in practice, you can create as many flows as needed for your business operations.