A merchant selling barista workshops as product variants (each variant representing a specific date/time) wants to automatically delete past workshop dates so customers cannot purchase expired sessions.
Current Setup:
Workshops are products with type “workshop”
Each variant represents a different date/time (e.g., “January 1, 2024 08:30”)
Variants include custom metafield date values
Attempted Solution:
The user tried creating a Shopify Flow to:
Run nightly checks on workshop products
Compare variant metafield dates against today’s date
Delete variants where the date has passed
Key Issues Identified:
Cannot use Liquid syntax in Flow conditions (major blocker)
Metafield values cannot be queried directly in “Get product variant data” queries
Date comparison logic consistently returns false
In Liquid, use {{"now"}} instead of {{"today"}} for current date
Workarounds Suggested:
Manually run workflow by bulk-selecting products in Admin
Use metafield values to construct queries with available filters
Match date format exactly in variant titles for string-based filtering
Status: Unresolved. The user struggles with Flow’s limitations and documentation clarity. Shopify is reportedly working on expanded code capabilities (timing TBD).
Summarized with AI on November 14.
AI used: claude-sonnet-4-5-20250929.
besides coffee we are selling barista workshops. Every workshop (like barista basic workshop) is a product (product type “workshop”). The product has different variants based on the workshop dates like 1. January 2024 08:30, 13. January 14:30 etc. each variant has a custom meta date field too.
I’m trying to create a flow which checks every night the all products with product_type: workshop and delete those variants which are <= today date (or the date of the schedule) so people cannot buy workshops which have already passed.
I think the action of “Get product variant data” should help here, but I’m unsure about the query. Something like product_type:“Kurs” AND product_title starts with {{scheduledAt}} or something
Any ideas?
Definitely do not make up the syntax for the query…it will likely return all results on failure (because the API works that way). To test if something works, I heartily recommend using the free app GraphiQL (to test queries), as documented here: https://help.shopify.com/en/manual/shopify-flow/reference/data
You guessed “product_type” correctly but it’s just “title”.
The hard part of this is the date…because it’s just a string. I think you could run this every day and delete yesterday’s variants pretty easily. Something like
when I receive the email, it looks like this: and in the first email it says that it’s the same but it doesn’t trigger my mail I’m sending when my flow argument is true.
OMG, ok. I think flows would be much better if you just could code stuff. Haha.
Hum, and I assume metafield values cannot be accessed in the get product variant data query, right?
Will try this. btw: the documentation of the query paramaters and syntex isn’t really clear. Glad there are third party documentation which are clearer and simpler.
Trying to get a product variant data without the if afterwards by using this query via sku:
sku:Kurs-BaristaBasis-{{ “today” | date: “%Y%m%d” }}*
the skus have this format Kurs-BaristaBasis-20231201-1730