Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
It seems that when using Flow, there are two ways to fetch a specific metafield:
1. Doing a liquid loop through all the resource's metafields and checking each one's key and namespace
2. Using the "run code" functionality, request the resource's metafields and then use .find() in Javascript on the returned array. It seems you can't filter metafields within the GraphQL query.
My questions are, am I missing any other options? And secondly, are there performance issues to be worried about in the case the resource has a large amount of large metafields?
Option 2 has been working fine for me, but my concern is that I store potentially large JSON files (the maximum size is 2 million characters so why not?) as metafields on variants and I'm wondering if this could cause Flow to timeout or fail even if I'm just trying to access a smaller metafield.
This is a Flow question not a general API question.
Those are both about the same performance as they will fetch all of the fields that you use in your code/liquid
We have an update for metafields coming very soon that will allow fetching each metafields one-by-one, which we prioritized because of the performance issues in looping and the growing size of metafields.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025