Shopify Flow / New action

"Get analytics data"
A Flow action that fetches analytics data via ShopifyQL

Run ShopifyQL from inside a workflow to retrieve sales, sessions, and inventory. The returned values become variables you can pass into downstream conditions and actions.

What's on this page
  1. What actually changes (understand it in 30 seconds)
  2. How it works: the workflow execution flow
  3. Four official use case examples
  4. Old approach vs. the new action
  5. What ShopifyQL looks like
  6. Five points developers should know
  7. Three use cases you can put to work
  8. A one-line summary for your pitch

1What actually changes

Shopify Flow has gained a new action called "Get analytics data".
Partway through a workflow, run ShopifyQL → capture the result as a variable → then use it directly in conditions or the next action.

Before: Flow was "event-driven" only

It could only react to triggers like new orders or inventory changes, which made it hard to make decisions based on "store-wide aggregate values."

Now: Flow can "go and fetch" analytics

Turn ShopifyQL query results into variables. You can wire up threshold checks → Slack notifications / tagging / admin alerts end to end.

2How it works: the workflow execution flow

Trigger Scheduled / Event Get analytics data FROM sales SELECT... Issue ShopifyQL Hold as a variable result.totalSales result.sessions result.inventory Condition if sales < threshold YES NO Slack notification Add tag Send email
Key point : Flow has evolved from a tool that just "does something when an event fires" into an engine that judges based on your store's overallstate. Combined with a Scheduled trigger, you can build a daily or weekly recurring reporting bot with no code.

3Four official use case examples

1. Scheduled reports to Slack

Automatically deliver reports containing analytics data to Slack.

2. Alert when sales fall below a threshold

Get notified the moment sales drop below a specified amount.

TAG

3. Tag products when a milestone is reached

Automatic tagging based on sales performance, such as "Best Seller."

4. Detect and notify on session increases or decreases

Instantly spot storefront traffic anomalies.

4Old vs. new action comparison

ItemTraditional FlowAfter adding Get analytics data
Data retrieval method Event-driven Only deltas such as order and inventory changes Query-driven Actively retrieve aggregated values with ShopifyQL
Available data Information attached to that event's object Analytics data such as sales, sessions, and inventory levels
Use in downstream processing Event variables only Query results as variables Usable in conditions and actions
Scheduled reports Built separately with external tools (BigQuery, Looker, etc.) Handled entirely within Flow Combined with a Scheduled trigger
Threshold alerts Hard to implement with Shopify alone Just pass the query result to a Condition

5ShopifyQL example

* The original article does not detail the query syntax. ShopifyQL is a SQL-like query language specific to Shopify; the following is a general illustration.

-- Retrieve total sales for the last 7 days (illustrative) FROM sales SHOW total_sales SINCE -7d UNTIL today
↓ Flow holds this result in a variable and references it in later steps
// Condition step if result.total_sales < 1000000 { sendSlackMessage("⚠️ Sales have dropped below the threshold") }
For the specific query format, the list of retrievable fields, and limitations, see the official documentation the original article clearly states. Always check the documentation before use.

65 key points developers should know

ShopifyQL

1. ShopifyQL fires within a workflow

Queries that previously could only be run in Shopify QL Notebooks or the Admin UI can now be executed as a Flow step. Query results can be reused as variables in later steps can be done.

2. Combining it with a Scheduled trigger is where it really shines

Things like "run a sales query at 9 AM every day → Slack" or "aggregate sessions every Monday → email"—Scheduled execution × analytics data × notifications this three-tier setup comes together with no code.

limits ?

3. Be sure to read the docs on limitations

The original article only states "refer to the documentation, including limitations." Constraints such as execution frequency, query complexity, and the number of returned rows are not documented = checking the docs before you design is a must.

4. Potential to replace external BI / ETL

Use cases where you were "running BigQuery/Looker solely for threshold alerts" can likely be folded into Flow.Redefining the role of your BI stackcould be the catalyst for that.

FROM products SHOW units_sold

5. "Tagging at milestones" is quietly powerful

The official example of "tag a product when it hits a sales target"automatic collection curation, automatic badge display, and automatic price drops and serves as a starting point for chaining with other Flows. If you assign tags best-seller-100 on a per-milestone basis like this, you can also reference them from the Liquid / Online Store editor.

7Three use cases you can put to work

📊 Sales ¥1,234,567 👥 Sessions 12,345 📦 Inventory 42 SKUs left
USE CASE 1

Build a "Shopify daily summary bot" for standups with a single Flow

Challenge
Before the internal meeting each morning, someone manually screenshots and shares sales/sessions/inventory. On days the responsible person is out, it gets missed.
Solution
Scheduled trigger (8:50 every day) → Get analytics data (fetch the previous day's sales, sessions, and low-stock SKU count) → post to #commerce-daily on Slack.
Impact
Zero work time for the responsible person, no more missed updates, and everyone sees the same numbers in the morning.
Technical notes
Slack notifications work as-is with the existing Flow action. Inserting query results is handled with template variables.
USE CASE 2

Detect a "sales plunge" during a sale within an hour

Challenge
During a big sale, you only notice a sales plunge caused by payment errors, shipping misconfigurations, or out-of-stock products in the next morning's internal report—by which point it's too late.
Solution
Scheduled trigger (every hour) → use Get analytics data to fetch the last 1h of sales → compare against the historical average for the same weekday and time → if it falls below a set percentage, send a Slack alert plus a phone alert to the responsible person (via an external Webhook).
Impact
Minimized lost opportunities, shorter MTTD for incident detection, and far greater peace of mind during sales.
Technical notes
If comparing against historical averages is difficult within Flow, a design that makes the determination via an external Webhook integration is also an option. Be sure to check the docs for the cap on query execution frequency.
BEST SELLER 100
USE CASE 3

Auto-styling product pages with "sales milestones"

Problem
Manually adding and removing social-proof badges like "100 sold to date" or "1,000 sold to date" on a per-product basis has become unmanageable.
Solution
Scheduled trigger (daily) → Get analytics data to pull each product's cumulative sales → for each threshold, milestone-100/milestone-1000 automatically apply a tag → then use Liquid on the Online Store to swap badges/copy based on the tag.
Impact
Zero ongoing copywriting effort for marketing / the page always reflects the latest sales numbers / reusable for A/B testing hypotheses to lift conversion.
Technical notes
Per-product iteration is required = it depends on Flow's loop/conditional design. The safe order is to define the tag naming convention first, then lock down the reference logic on the Liquid side.

8One-line summary for pitches

"Shopify Flow has evolved into an engine that can run ShopifyQL .
Sales, sessions, and inventory — scheduled runs → threshold checks → notifications/tagging — all end-to-end with no code.
The "threshold alerts" and "scheduled report bots" you used to rely on BI tools for can now be pulled in-house within Shopify."