Fetch query: choose exactly which items your workflow processes
Fetch query: choose exactly which items your workflow processes
In this article:
- Why the query matters
- Where to write the query
- Query syntax basics
- Product query examples
- Filter products by metafields
- Use dynamic dates with Liquid
- Order query examples
- Queries for other Fetch resources
Every Fetch step (Fetch products, orders, customers, collections, draft orders, metaobjects) has a query. The query decides which items the workflow gets from your store. This article explains how to write one, with examples you can copy.
Why the query matters
The query is the most important setting of a Fetch step:
- It decides what your actions change. Every fetched item goes through the steps under for each. A wrong or empty query means your actions (add tags, update prices, send emails) run on items you didn't plan to change.
- It decides how many runs you use. Each fetched item counts as a separate workflow run. A query that returns 30 products uses 30 runs. Without a query, the step fetches all products in the store.
- It makes scheduled workflows dynamic. With a date in the query, a daily workflow processes only that day's items, for example products that launch today.
Where to write the query
- Open a Fetch step (a Fetch resource in a One-Shot workflow, or a Fetch action in an Automated workflow).
- Under Select a query option to filter data, choose a ready-made filter, such as Products by tag, or choose Advanced to write your own query.
- Change or type the query in Edit query.
- Check the Runs counter at the top of the panel. It shows how many items match the query, for example "The selected query will fetch 2 products".

Query syntax basics
The query uses the Shopify API search syntax: filter:value.
tag:summermatches items with the tag "summer".- Use quotes for values with spaces or special characters:
vendor:'Snow Peak'. - Combine filters with
ANDandOR:status:active AND tag:summer. - Exclude with
-orNOT:-tag:archived. - Compare numbers and dates with
>,<,>=and<=:price:>100. - Use
*to match any value:metafields.custom.launch_date:*matches products where the metafield is filled in. - Text values are case-sensitive.
metafields.custom.swatch_enabled:'yes'doesn't find products where the value isYes.
The filters you can use depend on the resource. The full list for each one is on shopify.dev (see the links in the sections below).
Product query examples
The full list of product filters: Shopify Admin API: products query arguments.
Goal | Query |
|---|---|
Products with a tag |
|
Products without a tag |
|
Active products only |
|
Products of a type |
|
Products from one of two vendors |
|
Products with a variant priced over 500 |
|
Products with no stock |
|
Products created after a date |
|
Active products with the tag "sale" |
|
available_for_sale or variants.price) don't work in a Fetch step. With them, the Runs counter can't calculate a number.Filter products by metafields
You can filter by any product metafield with metafields.{namespace}.{key}:{value}. Examples:
metafields.custom.swatch_enabled:'Yes': products where the "Swatch Enabled" choice list is set to Yes.metafields.custom.launch_date:'2026-11-01': products that launch on November 1.metafields.custom.launch_date:<='2026-11-01': products that launched on or before November 1.-metafields.custom.swatch_enabled:'Yes': all products where swatches aren't enabled.
To turn on filtering:
- In your Shopify admin, go to Settings > Metafields and metaobjects > Products.
- Open the metafield definition, for example Swatch Enabled. The text under Name (for example
custom.swatch_enabled) is thenamespace.keyto use in the query. - Under Options, turn on Filter on the product list and in the Admin API.
- Click Save.

The option's name depends on the metafield type. For a Date metafield, such as Launch Date, it's called Filter products in the Admin API.

After you turn on filtering, open the Fetch step again and check the Runs counter. It should now show only the matching products.
Use dynamic dates with Liquid
A fixed date like '2026-11-01' works only once. To get "today" every time the workflow runs, put Liquid in the query. React Flow replaces it with the real date before it fetches the items.
Products whose Launch Date is today:
metafields.custom.launch_date:'{{ "now" | date: "%Y-%m-%d" }}'

Put this query in a Fetch products action after a daily Scheduled time trigger. Each day, the workflow then processes only the products that launch that day, for example to publish them or add a "new-arrival" tag.
More examples:
- Products that have already launched:
metafields.custom.launch_date:<='{{ "now" | date: "%Y-%m-%d" }}' - Products created in the last 7 days:
created_at:>='{{ "now" | date: "%Y-%m-%dT%H:%M:%SZ", 0 | dateSubtract: 7, "day" }}'
The ready-made "Created in the last..." filters use the same Liquid. Choose one of them to see an example you can change.
Order query examples
The full list of order filters: Shopify Admin API: orders query arguments.
Ready-made filters for Fetch orders include Created in the last day, Unfulfilled orders, Partially fulfilled orders, Unfulfilled orders older than two days, Chargebacks, Paid orders from the last week and Pending orders from the last week.

Goal | Query |
|---|---|
Paid orders that aren't shipped yet |
|
Open unfulfilled orders |
|
Orders over 500 |
|
Orders with a tag |
|
Orders without a tag |
|
Orders that used a discount code |
|
Orders with a high fraud risk |
|
Orders with dynamic dates:
- Orders from the last 30 days:
created_at:>='{{ "now" | date: "%Y-%m-%dT%H:%M:%SZ", 0 | dateSubtract: 30, "day" }}' - Unfulfilled orders older than 2 days that aren't cancelled:
created_at:<='{{ "now" | date: "%Y-%m-%dT%H:%M:%SZ", 0 | dateSubtract: 2, "day" }}' AND fulfillment_status:unshipped AND NOT status:cancelled
Orders also support metafield filters, for example metafields.custom.gift_wrap:true. As with products, turn on filtering for the order metafield definition first (Settings > Metafields and metaobjects > Orders).
Queries for other Fetch resources
All Fetch resources in React Flow support a query, ready-made filters and the Advanced option. The filters you can use for each one are listed on shopify.dev:
- Fetch products: products query arguments
- Fetch orders: orders query arguments
- Fetch customers: customers query arguments. Example:
tag:VIP. In Segments mode, use the Shopify customer segmentation syntax instead, for examplenumber_of_orders >= 1 AND last_order_date < -90d. - Fetch collections: collections query arguments. Example:
collection_type:smart. - Fetch draft orders: draft orders query arguments. Example:
status:open AND tag:wholesale. - Fetch metaobjects: metaobjects query arguments. Filter by a field with
fields.{key}:{value}, for examplefields.on_sale:true.
✔️ Next step
Check our articles to learn more about the app's functionality:
- Fetch: process orders, products and customers in bulk
- Scheduled triggers in React Flow
- How runs are counted in React Flow
- React Flow recipes: Liquid in emails, HTTP request bodies, tags from metafields and win-back
Updated on: 20/10/2026
Thank you!
