Shopify Automation: From Flow Recipes to a Cross-System Agent

Where Shopify Flow fits, when an AI agent on the Admin API earns its place, and how to build a governable low-stock reorder agent.

Jose Giron
Major and Shopify lockup: a low-stock reorder agent built on the Shopify Admin API.

Shopify automation means running store tasks without hands-on work. The default form is Shopify Flow, a free rule-based engine that fires in-store actions when an event happens. The next step up is an AI agent on the Shopify Admin API that reads across Shopify, your payment processor, and your ops tools, then drafts a decision a person approves. This guide covers where Flow fits, where an agent earns its place, and how to build one, with a worked low-stock reorder example.

Key takeaways

  • Shopify Flow handles in-store, rule-based automation for free across the Basic, Grow, Advanced, and Plus plans, and it is the right tool for any "when X, always do Y" workflow.
  • Flow and iPaaS tools run rules, not judgment, and they stay inside Shopify's world. They cannot weigh sell-through against supplier lead time or read a payment risk score to decide.
  • An AI agent on the Shopify Admin GraphQL API reasons across Shopify, Stripe, and Slack to draft cross-system decisions a human approves.
  • Money-moving actions stay behind human approval. The agent drafts reorders and refunds; a person commits them.
  • The Admin API uses a calculated query cost on a leaky bucket, so you size each call and pace against throttleStatus.

What is Shopify automation, and where does it stop?

Shopify automation usually means one of two things. Inside the store, it means Shopify Flow: a free, visual, rule-based engine that fires when something happens and runs an action in response. Tag a customer who spends over $500. Hold an order that trips a fraud signal. Notify a Slack channel when inventory drops below a threshold. Flow ships with hundreds of templates and connects out to Slack, Google Sheets, Klaviyo, Asana, and Trello. It runs on Basic, Grow, Advanced, and Plus, not Plus-only, and for in-store rules it is the right tool. If a workflow is "when X, always do Y," build it in Flow and move on.

The second meaning is marketing automation: abandoned-cart emails, welcome flows, win-back sequences, usually run through Klaviyo or an email platform. Useful, and worth keeping.

Both share one boundary. They run rules, not judgment, and they run inside Shopify's own world. The iPaaS vendor MESA names the ceiling plainly: Flow is built to work within Shopify's ecosystem. A rule cannot weigh 30-day sell-through against a supplier's lead time and decide how many units to reorder. It cannot read a payment risk score, cross-check an order against past chargebacks, and decide whether to hold or ship. The moment a decision has to reason across Shopify, your payment processor, and your ops channel, a rule engine and a data-sync tool both run out of room. That gap is where operational AI agents for ecommerce start to earn their keep.

Here is the honest split between the three ways to automate a Shopify store.

  • Shopify Flow. Scope: In-store events and actions. Reasons across systems: No, Shopify-scoped. Handles judgment: No, fixed rules. Human in the loop: Optional, by rule.
  • iPaaS (Zapier, Make, MESA). Scope: Shopify plus other apps. Reasons across systems: Moves data between them. Handles judgment: No, still rule-based steps. Human in the loop: Optional, by step.
  • Shopify agent. Scope: Shopify + Stripe + Slack + email. Reasons across systems: Yes, reads and correlates. Handles judgment: Yes, drafts a decision. Human in the loop: Built in, approves before it acts.

When does an AI agent over Shopify actually help?

Not everywhere. An agent pays for itself on the cross-system, judgment-heavy work you still do by hand, not on the in-store rules Flow already covers. Three patterns are worth building.

Low-stock reorder drafting

The input is your live catalog and recent sales. The output is a per-SKU reorder proposal a buyer can approve. The agent reads current inventory levels and the last 30 days of orders, computes sell-through and days-of-cover per SKU, subtracts what is already on the way, and proposes an order quantity that clears the supplier's lead time with a safety buffer. Flow can tell you a SKU crossed a threshold. It cannot tell you how many to buy given that one supplier ships in three days and another in six weeks. That arithmetic against real constraints is the judgment.

High-risk order triage

The input is a new order plus its payment signals. Stripe Radar scores each payment for fraud risk in real time and can flag a charge as elevated or highest, or route it to manual review. An agent reads that signal, pulls the order's shipping-versus-billing mismatch, the customer's order history, and any prior chargebacks, then posts a short recommendation: ship, hold for review, or cancel. It assembles the context a human would otherwise gather across three tabs and hands over a decision, not a raw alert.

Abandoned-cart personalization

A canned abandoned-cart email is a Flow or Klaviyo job, and it works. The agent version reads what was actually in the cart, whether the shopper is a repeat customer, and current stock, then drafts a message that reflects those facts: a low-stock nudge on the exact item, a first-order incentive for a new visitor, nothing at all for a customer who bought the same thing yesterday. The draft goes to a marketer, not straight to the customer. The value is the read across cart, customer, and inventory that a template does not make.

What you need to build one

The Shopify Admin API in about 200 words

The Admin GraphQL API is how you read and write store data. You authenticate with an access token: a custom app in the Shopify admin issues one directly, or a public app obtains one through OAuth, and every request carries it in the X-Shopify-Access-Token header. The objects you will touch most are Product and its variants, InventoryLevel (quantities per location), Order and its line items, and Customer. You pin an API version in the request path, for example 2025-07, and Shopify supports each version for a fixed window, so version upkeep is part of owning the integration. For event triggers, register webhooks (orders/create, inventory_levels/update) so the agent reacts to changes instead of polling. Rate limiting is the part that surprises people: the GraphQL API uses a calculated query cost on a leaky-bucket of points, not a simple request count. Every field has a cost, each response returns a throttleStatus with maximumAvailable, currentlyAvailable, and restoreRate, and a single query is capped at 1,000 points. You request only the fields you need and read throttleStatus to pace calls. For large pulls, bulk operations sidestep the per-query cap.

# Read low-stock variants and watch the cost budget
query LowStock($first: Int!) {
productVariants(first: $first, query: "inventory_quantity:<10") {
edges {
node {
sku
inventoryQuantity
product { title }
}
}
}
}

# Every response includes:
# "extensions": { "cost": { "throttleStatus": {
# "maximumAvailable": 2000, "currentlyAvailable": 1980, "restoreRate": 100 } } }

Pros and cons of the Shopify Admin API

On the plus side, the GraphQL schema is well documented, the object model maps cleanly to how a merchant thinks (products, inventory, orders, customers), webhooks are first-class, and bulk operations exist for genuinely large reads. It is a mature API to build against.

The gotchas are specific. The calculated query cost means a query that looks small can be expensive if it fans out through connections, so a naive nightly job that requests every field on every order will throttle itself. You size each call and back off on throttleStatus. Version pinning means an integration left alone will eventually hit an unsupported version and break, so you schedule upgrades. And you build against a development store, not production, because test orders and inventory writes are not something you want to rehearse on a live catalog. None of these are dealbreakers. They are just work you plan for rather than discover in production.

A worked example: the Low-Stock Reorder-Drafter

What it does

Every night, store-local, the agent finds SKUs below their reorder point, works out how much to buy, and posts a reorder card to the buying team in Slack. A buyer approves or edits with one click. On approval, the agent writes a draft purchase order and, optionally, emails the supplier through Gmail. Nothing is ordered and no money moves without that click.

How the steps wire together

  1. Trigger: a nightly schedule in the store's timezone.
  2. Read: query Shopify for Products, current InventoryLevels, and the last 30 days of Orders, paced against throttleStatus.
  3. Compute: for each SKU, sell-through rate over 30 days and days-of-cover at the current quantity. Flag any SKU whose days-of-cover is below its supplier lead time plus a safety buffer.
  4. Draft: propose a reorder quantity per flagged SKU, netting out stock already inbound.
  5. Approve: post the list to Slack #buying with approve and edit actions.
  6. Act on approval: write a draft PO and, if configured, send the supplier a Gmail message, then log the decision and who approved it.

What governance the agent needs

Human stays in the loop: the reorder card is a proposal, and a buyer approves or edits it before any PO is drafted or any supplier is emailed.

The Shopify access token is scoped to read inventory and orders and nothing more. Reorder thresholds, supplier lead times, and every approval live in the agent's own database, so the numbers are consistent from night to night and the audit trail answers who approved what and when. The agent drafts money-moving actions. It does not place orders or issue refunds unattended. The same discipline covers the triage and cart patterns: they draft holds and messages, and a person commits them. If you want the payments side to go further, the reconciliation and payments workflows an agent can own on Stripe follow the same draft-then-approve shape.

What this guide does not cover

This is a build guide for cross-system automation, not a Flow tutorial or a storefront theme guide. It does not walk through Liquid templates, checkout UI extensions, or the Storefront API for headless builds. It assumes you keep marketing sends in Klaviyo or your email tool rather than rebuilding them in an agent. And it stops short of fully autonomous ordering: every money-moving step here is drafted for a human to approve, by design.

Build this in Major

On Major, the Reorder-Drafter is a predictable agent that builds a governable app for the reorder logic. It runs on a nightly schedule and connects to Shopify (read Products, InventoryLevels, and 30-day Orders through the Admin GraphQL API), Slack (post the reorder card for buyer approval), and optionally Gmail (email the supplier once approved). The data flow is the one above: query SKUs below their reorder point, compute sell-through and days-of-cover, draft a quantity per SKU, post to #buying with approve or edit, and on approval write a draft PO or send the supplier email and log the decision.

The app holds its own state: reorder thresholds, supplier lead times, and every approval sit in its database with an audit trail. Shopify credentials are scoped to read inventory and orders, it cannot place orders or move money on its own, and it respects the API's calculated-cost rate limit. Major is the enterprise platform where agents build the software they run on, so the controls sit at the point where the agent acts, backed by enterprise-grade governance. The reorder logic is reasoned once and then runs forever as a deterministic app. Reason once. Run forever. Each night the model reads live inventory and applies the rule. It does not re-derive the workflow. That is the difference between a Shopify agent and a rule engine, and it is a specific case of the broader agentic workflow patterns that suit cross-system judgment. If you are new to the idea, start with what an AI agent is.

Keep Flow for your in-store rules, it is free and good at them. When the decision spans Shopify, Stripe, and your ops channel and needs a judgment call, that is the agent's job. Get started on Major and build your Shopify low-stock reorder agent.

Related articles

Frequently asked questions

What is Shopify automation?
Shopify automation is running store tasks without manual work. Its default form is Shopify Flow, a free rule-based engine that fires in-store actions like tagging orders, sending notifications, and routing fulfillment. The next step up is an AI agent on the Shopify Admin API that reasons across Shopify and other systems to draft decisions a human approves.
Is Shopify Flow free, and is it only on Plus?
Shopify Flow is a free app, and it is not Plus-only. It runs on the Basic, Grow, Advanced, and Plus plans. A few actions, such as sending an HTTP request, need Grow or higher, and custom partner-app tasks need Plus, but the core automation engine is available across paid plans.
What can Shopify Flow not do?
Flow runs fixed rules inside Shopify. It cannot make judgment calls that weigh several variables, such as how much of a SKU to reorder given sell-through and supplier lead time, and it does not reason across outside systems like Stripe or roll up data across multiple stores. Those need an agent or custom code on the Admin API.
How do you automate Shopify orders across systems?
Use the Shopify Admin GraphQL API to read Orders and Inventory and register webhooks like orders/create so your logic reacts to events. To cross into payments or ops, add an agent that reads a Stripe Radar risk score alongside the order and posts a recommendation to Slack. Keep any money-moving step behind human approval.
Can an agent handle reorders or refunds automatically?
An agent can draft them. It can compute a reorder quantity or prepare a refund and route it for one-click approval, with the reasoning and audit trail attached. Keep the money-moving action itself human-approved. Drafting is where the agent saves time, and committing the order or the refund stays a person's decision.