Get product data by collection id is returning items in incorrect collections

Topic summary

A user encountered an issue where Shopify Flow’s “Get product data” action with the advanced query collection_id:492177981753 was returning products from incorrect collections. The query returned a mix of products, with only some belonging to the specified collection ID.

Root Cause:
The problem stemmed from Flow using API version 2024-07, which does not support the collection_id filter. This filter only became available in version 2024-10.

Workaround:
While waiting for the update, a third-party solution was suggested: using the “Flow Companion” app’s “Start custom workflow for list of products” action, which runs on API version 2025-04 and supports collection_id filtering without item limits.

Resolution:
Flow has since been updated to support API version 2024-10, resolving the issue. The update also includes access to order.statusPageUrl, which benefits users integrating with platforms like Klaviyo.

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

I have a flow that is doing “Get product data” with advanced query

collection_id:492177981753

iterates through that product data, and logs the item handle and the collections that that item exists in. Upon running the flow, I am getting products back with items not belonging in the collection I’m trying to request from.

Not sure if something is wrong with my query or flow design or if this is a bug. Any help or insight would be appreciated. Thank you!

1 Like

Is it a Smart collection or Manual collection? If it is a Smart collection, what are the conditions of your collection? And is there a specific condition that is disqualifying the product from the collection but is consistently being ignored by your advanced query? For example, in the past I have tried to set up a Flow querying off of a “Free” collection with condition equals $0 but it didn’t work, so I switched to a more complex Flow advanced query.

*edit: wait, I do know what the difference is, just had a brainfart. It is a manual collection. Also the condition being ignored is the collection id(s).

I’m unsure what the difference between Smart or Manual collection is. This is a screenshot of the action.

This is from a flow that triggered this morning. I have the screenshot for the whole flow itself.

where advanced query is

collection_id:492177981753

The info for the triggered flow is below.

Input:

{
  "field_name": "products",
  "api_version": "2024-07",
  "query_args": {
    "sortKey": "CREATED_AT",
    "reverse": false,
    "query": "collection_id:492177981753"
  },
  "max_root_records": 10
}

Output:

[
  {
    "handle": "zambian-emerald-halo-engagement-ring",
    "collections": [
      {
        "id": "gid://shopify/Collection/492177981753"
      }
    ]
  },
  {
    "handle": "african-ruby-halo-engagement-ring",
    "collections": [
      {
        "id": "gid://shopify/Collection/492177981753"
      }
    ]
  },
  {
    "handle": "gold-pendant-set-with-birthstone-birth-month-constellation-sign",
    "collections": [
      {
        "id": "gid://shopify/Collection/492177916217"
      },
      {
        "id": "gid://shopify/Collection/492337758521"
      }
    ]
  },
  {
    "handle": "modern-yellow-gold-diamond-cross-pendant",
    "collections": [
      {
        "id": "gid://shopify/Collection/492177916217"
      },
      {
        "id": "gid://shopify/Collection/492337430841"
      }
    ]
  },
  {
    "handle": "deco-inspired-18k-white-gold-diamond-filigree-dangle-earrings",
    "collections": [
      {
        "id": "gid://shopify/Collection/492177719609"
      }
    ]
  },
  {
    "handle": "angular-18k-two-tone-gold-diamond-stud-earrings",
    "collections": [
      {
        "id": "gid://shopify/Collection/492177719609"
      },
      {
        "id": "gid://shopify/Collection/492337365305"
      }
    ]
  },
  {
    "handle": "chunky-gold-ring-with-raspberry-red-rhodolite",
    "collections": [
      {
        "id": "gid://shopify/Collection/492177981753"
      },
      {
        "id": "gid://shopify/Collection/492178047289"
      },
      {
        "id": "gid://shopify/Collection/492337594681"
      },
      {
        "id": "gid://shopify/Collection/501488386361"
      }
    ]
  },
  {
    "handle": "impressive-natural-round-diamond-stud-earrings-1-41ctw",
    "collections": [
      {
        "id": "gid://shopify/Collection/501488386361"
      }
    ]
  },
  {
    "handle": "two-tone-green-tourmaline-diamond-pendant",
    "collections": [
      {
        "id": "gid://shopify/Collection/492177916217"
      },
      {
        "id": "gid://shopify/Collection/492337758521"
      }
    ]
  },
  {
    "handle": "estate-diamond-pendant-with-natural-pink-white-diamonds",
    "collections": [
      {
        "id": "gid://shopify/Collection/501488386361"
      }
    ]
  }
]

Only a few of the items output actually have the correct collection.

Flow is using 2024-07 and collection_id is not a support filter on that version. It became available in 2024-10, which Flow is working to adopt.

https://shopify.dev/docs/api/admin-graphql/2024-07/queries/products#argument-query-filter-default

2 Likes

Ahh, that makes sense. Thank you for your help!

When is the earliest you reckon this will be available in Flow?

I can’t give an exact date because it’s still in progress and we might discover more issues. Ideally, it’s very soon.

What exactly do you want to do with the selected products?

If you want to perform an action on each selected product individually, you can use the action “Start custom workflow for list of products”. This is an action from a third-party Flow Companion app. It is based on the 2025-04 API version, which supports filtering by collection_id. It also doesn’t have a limit on the number of selected items.

To implement the workflow described in your message, you need to create two workflows:

  1. The first workflow gets the products based on your selection and starts a custom workflow for each product. You pass a custom Specifier, which is used to apply a condition in the next workflow.

  1. The second workflow starts with the trigger “Product: custom trigger triggered”, checks the Specifier condition, and then performs the necessary actions.

Flow now supports 2024-10 https://changelog.shopify.com/posts/flow-now-uses-version-2024-10-of-the-graphql-admin-api

1 Like

THANK YOU, THANK YOU!

We also needed that order.statusPageUrl so we can pass it on to Klaviyo so thanks for including that in the update as well.