How to Use Shopify Flow and Metafields for Product Expiration Alerts?

Topic summary

A user wants to create a Shopify Flow workflow that monitors product expiration dates stored in metafields and sends email alerts (e.g., 10 days before expiration) for over 6,000 products.

Current Limitation:

  • A recent API update allows querying products by metafield values, but date-based queries are not yet supported
  • Direct date comparison in Flow workflows is not possible with the current metafield system

Suggested Workaround:

  • Convert the date metafield to a single-line text format instead of using the date type
  • Use a scheduled trigger combined with “Get product data” action to identify products expiring on specific dates
  • This approach could work for same-day expiration checks

Scalability Concern:

  • Scanning all 6,000 products daily would be necessary with date metafields, but there’s no straightforward way to implement this efficiently in Flow
  • The workaround with text-based dates offers better feasibility for large product catalogs

Status: The discussion remains open with no complete solution for date-based metafield queries.

Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

Hi,

Can I set up a workflow in Shopify Flow using metafields to send email alerts before a product’s expiration date? I want the workflow to fetch product data, check if a specified metafield date (e.g., expiration or notification date) matches a pre-defined date (e.g., 10 days before the expiration date), and send an email alert. I have over 6000 products—can this workflow efficiently handle such a large dataset?

A recent API change made querying products by metafield value possible, but you cannot yet query by dates. https://shopify.dev/docs/apps/build/custom-data/metafields/query-by-metafield-value

If the field was a string you might be able to use a scheduled time trigger + Get product data to find products that expire today.
You could convert the date metafield into a single line text metafield and then do this approach.

If it’s a date, you would have to periodically scan all 6000 but there is no straight-forward way to do that on a daily basis.