How to filter out archived orders in a flow with emails about unfulfilled orders?

Topic summary

A user is building a Shopify Flow to email their customer care team about orders unfulfilled after 3 days, but needs to exclude archived orders from notifications.

The Problem:
Adding AND NOT status:archived to the query didn’t work because “archived” isn’t a valid status value in Shopify’s order query system.

The Solution:
Archived orders are classified as status:closed in Shopify’s API. The valid status values are:

  • open
  • closed
  • cancelled
  • not_closed

Corrected Query:

created_at:<='{{ scheduledAt | date_minus: "3 days" }}' 
AND fulfillment_status:unfulfilled 
AND NOT status:cancelled 
AND NOT status:closed

This filters out both archived (closed) and cancelled orders, ensuring only open unfulfilled orders trigger the notification email. The discussion reached resolution with two community members confirming this approach.

Summarized with AI on October 23. AI used: claude-sonnet-4-5-20250929.

Hi everyone,

I’m new to Shopify Flows and am trying to set up a flow that sends email notifications to our customer care team about orders that haven’t been fulfilled after 3 days so they can follow up with our warehouse on any issues.

However, I need to exclude archived orders as well from these notifications.

My Current Setup, based on a template:

Trigger: Scheduled (Daily)

  1. Get Order Data query:
created_at:<='{{ scheduledAt | date_minus: "3 days" }}' AND fulfillment_status:unfulfilled AND NOT status:cancelled

I tried adding simply “AND NOT status: archived” here after cancelled, but that did not work as the auto email still included archived orders.

  1. Count:
    Count items in getOrderData

  2. Sum:
    Calculate the sum of getOrderData-currentTotalPriceSet-shopMoney.amount

  3. Condition:
    Count is greater than 0

  4. Send internal email

What I’ve Tried:

Reached out to Shopify Plus Support and got the below answer, but it does not help me as I unfortunately don’t understand how to incorporate this in my flow and the valid values does not contain “Archived”.

I have it checked with our dedicated team and I was advised that archived is apparently one of the supported queries by the orders query, following the guide here:

• orders

In this case, they recommended to try filtering them out by chaining a condition step that checks if the order is archived, provided:”

status
string

Filter by the order's status to manage workflows or analyze the order lifecycle.


Valid values:
open
closed
cancelled
not_closed
Example:
status:open

My Question:

How do I filter out archived orders from this flow?

Any help would be greatly appreciated! Thanks in advance!

What they are saying is that in your query you can only specify one of those 4 – open/closed/cancelled/not_closed.

However, closed is what you need, so your query should be

created_at:<='{{ scheduledAt | date_minus: "3 days" }}' AND 
fulfillment_status:unfulfilled AND
NOT status:cancelled AND
NOT status:closed
1 Like

Hi @tim_1,

You’re absolutely on the right track this is a great question and a common challenge when working with Shopify Flow’s order queries.

To clarify, in Shopify’s API and Flow query logic, the archived state isn’t a separate “status” value. Orders that are archived are actually classified as closed in the system. That’s why the query field for status only accepts:

  • open

  • closed

  • cancelled

  • not_closed

So if your goal is to exclude archived orders from the flow, you can safely treat them as status:closed.

Your corrected query should look like this:

created_at:<='{{ scheduledAt | date_minus: "3 days" }}' 
AND fulfillment_status:unfulfilled 
AND NOT status:cancelled 
AND NOT status:closed

That will ensure that orders which are either archived (closed) or cancelled are ignored by your “unfulfilled after 3 days” check.

If you want to be extra sure the logic works as intended, you can test it by:

  1. Creating a test flow with this query.

  2. Logging a few recent test orders — some open, some archived.

  3. Running the flow manually (or waiting for the next scheduled run).

You should see only the open/unfulfilled orders trigger the internal email.

Hope this clears things up and helps streamline your notification flow!

Best,
Sulyman
Shopify Specialist

2 Likes