6 Shopify Flow + AI recipes for fast-growing DTC stores
Six battle-tested Shopify Flow + AI patterns: order screening, smart segmentation, product launch automation, review triage, restock intelligence, and helpdesk handoff.
Shopify Flow is great at if-this-then-that. AI is great at judgment calls. Stitching them together is where serious automation lives — workflows that handle the messy middle between hard rules and human review.
These are six recipes we install in seven- and eight-figure DTC stores. Pick the one that hurts most this week.
For each recipe: the trigger, the AI prompt, the action. The orchestration always runs through n8n (or Make, or Zapier) sitting between Flow and the AI API. Don’t try to call AI directly from Flow — Flow doesn’t natively support API auth headers and you’ll fight the platform.
Recipe 1 — Order risk screening
Trigger: order/paid where total > $500 and customer is first-time
Pull context: customer history, billing/shipping address match, country, IP if your store captures it, product mix
Prompt:
Risk-detection on a Shopify order. Output ONLY JSON.
Order:
- Total: ${{total}}
- First-time buyer: true
- Country: {{country}}
- Items: {{items}}
- Billing/shipping match: {{address_match}}
- Hours since account created: {{account_age_h}}
History:
- Previous orders: 0
- Email domain seen before: {{email_domain_seen}}
Output:
{
"risk": "low|medium|high",
"reason": "max 80 chars"
}
Action: Tag order ai_risk_<level>. If medium or high, post to Slack #orders-review with the reason.
Why it works: AI sees patterns across multiple weak signals (new email domain + non-matching addresses + high-value first order) better than any single Flow rule.
Recipe 2 — Smart customer segmentation
Trigger: Daily Flow at 02:00, scheduled
Pull context: for each customer, their last 90 days of orders, total lifetime value, days since last order
Prompt:
Classify this customer into one of: new, core, vip, dormant, at_risk.
Customer signals:
- Total orders (90d): {{orders_90d}}
- Total revenue (90d): ${{revenue_90d}}
- Lifetime orders: {{lifetime_orders}}
- Lifetime revenue: ${{lifetime_revenue}}
- Days since last order: {{days_since_last}}
- Avg days between orders: {{avg_gap}}
Definitions:
- new: 1 order, < 30 days
- core: 2-5 orders, regular cadence
- vip: 6+ orders OR lifetime revenue > $1000
- dormant: 90+ days since last order, was previously active
- at_risk: gap > 1.5x average, prior repeat customer
Output ONLY JSON: { "segment": "...", "confidence": "low|medium|high" }
Action: Update customer tag seg_<segment>. Klaviyo segments pick up new tags automatically.
Why it works: rule-based segmentation breaks on edge cases (a $2000 single order from a new customer). AI handles the gradient.
Recipe 3 — Product launch automation
Trigger: product/created where tag includes launch
Pull context: product title, type, specs from metafields, target customer (from tag or metafield)
Prompt set (3 calls in sequence):
- Generate product description (using your standard product-description prompt)
- Generate meta title and meta description
- Generate a 100-word email teaser for Klaviyo
Action: Update product description and SEO fields via Admin API. Save the email teaser as a private note on the product. Slack ping to marketing.
Why it works: a new product launch typically eats 2-3 hours per SKU between description, SEO, and email. AI does it in 30 seconds with a measurement plan baked in.
Recipe 4 — Review triage
Trigger: webhook from your review app (Judge.me, Loox, Yotpo) on new review
Prompt:
Classify this Shopify product review.
Review: "{{review_text}}"
Star rating: {{stars}}
Output ONLY JSON:
{
"sentiment": "positive|neutral|negative",
"topic": "product|delivery|service|pricing|other",
"actionable": true|false,
"summary": "max 15 words"
}
Action:
positive+actionable→ marketing channel (good for ads/copy)negative→ support channel + tag the product_review_complaintneutral→ archive
Why it works: someone has to read 200 reviews a week anyway. AI sorts them so humans only see the 30 that need action.
Recipe 5 — Restock intelligence
Trigger: Daily Flow at 03:00 over inventory rows under threshold
Pull context: sales velocity (last 30 days), seasonality flag, current stock, lead time from supplier
Prompt:
Recommend a restock quantity for a Shopify SKU.
Data:
- Current stock: {{stock}}
- Sales last 30d: {{velocity_30d}}
- Sales last 7d: {{velocity_7d}}
- Lead time (days): {{lead_time}}
- Seasonal: {{is_seasonal}}
- Last reorder qty: {{last_reorder}}
Goal: avoid stock-out for the next {{lead_time}} + 14 days.
Output ONLY JSON:
{
"recommended_qty": <int>,
"rationale": "max 100 chars",
"risk_of_stockout": "low|medium|high"
}
Action: Slack alert in #inventory with the recommendation. Inventory team reviews and orders.
Why it works: simple “below threshold → reorder” rules over-order seasonal items in the off-season and under-order sudden velocity spikes. AI handles the context.
Recipe 6 — Helpdesk handoff signal
Trigger: Webhook from Gorgias / Re:amaze / Help Scout on incoming ticket
Prompt:
Classify this customer support ticket.
Ticket: "{{ticket_body}}"
Customer history: {{ticket_count}} previous tickets
Last order status: {{last_order_status}}
Output ONLY JSON:
{
"category": "shipping|returns|product|billing|general",
"urgency": 1-5,
"ai_drafted_reply_safe": true|false,
"needs_human_immediately": true|false,
"summary": "max 20 words"
}
Action:
ai_drafted_reply_safe: true→ AI also drafts a reply in the helpdeskneeds_human_immediately: true→ Slack alert + escalate priority- Tag ticket with
categoryfor reporting
Why it works: standard helpdesk routing is keyword-based and brittle. AI reads context and routes correctly even when the customer doesn’t use the exact word.
Production rules for all six
Three things we never skip:
-
JSON-only output with explicit schema in the prompt. If the model returns prose, parsing breaks, automation halts.
-
Failure logging. Every recipe has a
try/catchthat logs failures to a dedicated Slack channel. Silent failures rot data over weeks. -
Test mode for one week. Every new recipe runs in “log only, don’t act” mode for the first week. We compare AI decisions to what a human would have done. Promote to live only when the agreement rate is above ~85%.
Cost reality check
Six recipes running in a mid-size DTC store typically cost:
- n8n self-hosted: $7-20/m
- OpenAI API: $30-80/m
- Slack workspace: probably already paying
Total: ~$40-100/m for automation that recovers 10-20 hours of operator time per week.
Want help shipping the first recipe in your store? Book a free Shopify AI audit — we’ll pick the highest-leverage one and sketch the architecture for your specific Flow setup.