Schedule Product Collection Changes by Metafield Date

19 min setup
No coding required
Runs automatically

Automatically update products based on a scheduled date using a custom metafield. This workflow runs daily, checks each product for a specific date metafield, and when that date matches today, it performs a series of updates—such as clearing the metafield, removing the product from one collection (like “Coming Soon”), and adding it to another (like “New Arrivals”).

schedule icon
Schedule
Get List of Collections' Products (Coming Soon)
Check Products Exist In Collection
Loop Over Products in Collection
Retrieve Product Metafield
Check Product Metafield Is Today
Clear Product Metafield
Get List of Custom Collections
Get List of Collects
Remove Product from Custom Collection
Shopify logo icon
Add Product to Custom Collection (New Arrivals)

You're in good company

"MESA has been a game changer for us. And, if you ever get stuck, their support team is always super helpful."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
PetFriendly

"It's like Zapier but exactly designed for Shopify. I have been able to complete all the workflows that I've needed."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Zailys

"The MESA team has been amazing at helping us set up our automations. We would highly recommend this app!"

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Rothy's

How it works

11 steps to automatically move products between collections based on metafield dates

schedule icon

Schedule

App connector: Schedule • Time to complete: 0 minutes (Auto-configured)
Why this matters: This trigger runs the collection check daily at midnight, ensuring products launch on their scheduled dates without requiring you to remember to manually move them between collections.

This scheduled trigger runs once per day at midnight. It initiates the workflow that checks all products in your "Coming Soon" collection for publish dates matching the current date. The daily timing ensures products launch at the start of their scheduled day. The schedule is pre-configured but can be adjusted if you prefer a different time (like early morning before your store opens).

Get List of Collections' Products (Coming Soon)

App connector: Shopify • Time to complete: 3 minutes
Why this matters: Retrieves all products from your "Coming Soon" collection so the workflow can check each one's publish date metafield and identify which products should launch today.

This step retrieves products from a Shopify collection, limited to 100 products per run. You need to configure the collection_id during setup—this should be the ID of your "Coming Soon" collection (or whatever collection holds your pre-launch products).

To find your collection ID, go to Products > Collections in Shopify admin, click on your "Coming Soon" collection, and look at the URL which will show a number like "123456789012"—that's your collection ID.

Check Products Exist In Collection

App connector: Filter • Time to complete: 0 minutes (Auto-configured)
Why this matters: Prevents workflow errors by confirming the collection actually contains products before attempting to loop through them, ensuring the workflow stops gracefully if the "Coming Soon" collection is empty.

This filter checks if {{shopify.0.id}} is not empty, meaning at least one product exists in the collection. If products exist, the workflow proceeds to loop through them. If the collection is empty, the workflow stops here without error. This safety check prevents the loop from attempting to iterate over an empty array.

Loop Over Products in Collection

App connector: Loop • Time to complete: 0 minutes (Auto-configured)
Why this matters: Processes each product in the "Coming Soon" collection individually, checking each one's publish date metafield to determine if it should be moved today.

This loop step iterates through each product in the {{shopify}} array returned from the collection. For every product, the loop executes the subsequent metafield retrieval, date checking, and collection movement steps using {{loop.id}} as the product identifier. The loop continues until all products in the collection have been checked.

Retrieve Product Metafield

App connector: Shopify • Time to complete: 5 minutes
Why this matters: Fetches the custom "publish_date" metafield from each product to determine if today is the scheduled launch date for moving the product between collections.

This step retrieves a specific metafield from each product using {{loop.id}} as the product identifier. The metafield is configured with namespace "custom" and key "publish_date"—this is the standard metafield created when you add a custom date field to products in Shopify admin. The metafield value (the date) is returned as {{shopify_1.value}} in format "YYYY-MM-DD".

Setup requirement: You must create this metafield definition in your Shopify store first (Settings > Custom Data > Products > Add definition) with type "Date" before using this workflow.

Check Product Metafield Is Today

App connector: Filter • Time to complete: 0 minutes (Auto-configured)
Why this matters: Acts as the decision point that only allows products with today's publish date to proceed, ensuring only scheduled launches happen and preventing premature or late collection moves.

This filter checks two conditions:
(1) {{shopify_1.value}} is not empty (the product has a publish date set), AND
(2) {{shopify_1.value}} equals today's date ({{now | date: "%Y-%m-%d"}}).

Both conditions must be true for the workflow to proceed with moving the product. If the publish date is in the future, past, or missing, the workflow skips that product and moves to the next one in the loop.

Clear Product Metafield

App connector: Transform • Time to complete: 0 minutes (Auto-configured)
Why this matters: Prepares the metafield deletion by organizing the product ID, namespace, and key into the format required by the Shopify GraphQL mutation, enabling clean metafield removal to prevent reprocessing.

This transform step maps the data needed to delete the metafield into a structured format:
product_id ({{loop.id}}),
namespace ("custom"), and
key ("publish_date").

This output is passed to a custom code step that uses Shopify's GraphQL API to delete the metafield. Clearing the metafield after moving the product ensures the workflow won't try to move the same product again on subsequent daily runs.

Custom code:
const Mesa = require('vendor/Mesa.js');
const Transform = require('vendor/Transform.js');
const ShopifyGraphql = require('vendor/ShopifyGraphql.js');
module.exports = new class {
script = (payload, context) => {
const output = Transform.convert(context, payload);

const mutation = `mutation MetafieldsDelete($metafields: [MetafieldIdentifierInput!]!) {
metafieldsDelete(metafields: $metafields) {
deletedMetafields {
key
namespace
ownerId
}
userErrors {
field
message
}
}
}`;

const response = ShopifyGraphql.send(
mutation,
{
metafields: [
{
ownerId: `gid://shopify/Product/${output.product_id}`,
namespace: `${output.namespace}`,
key: `${output.key}`,
},
],
},
null
);

Mesa.output.next(response);
}
}

Get List of Custom Collections

App connector: Shopify • Time to complete: 1 minute
Why this matters: Finds your "Coming Soon" collection ID by name so the workflow can identify which collection membership needs to be removed when moving products to "New Arrivals."

This step searches for a custom collection with the title "Coming Soon" and returns the first match (limit 1). The collection ID is stored as {{shopify_2.0.id}} for use in the next step.

If your pre-launch collection has a different name, update the query.title field to match your actual collection name.

Get List of Collects

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: Retrieves the specific "collect" record that links the product to the "Coming Soon" collection, which is necessary to delete that relationship and remove the product from the collection.

This step finds the collect (the Shopify term for collection membership) that connects {{loop.id}} (the product) to {{shopify_2.0.id}} (the "Coming Soon" collection). The collect ID is returned as {{shopify_3.0.id}}.

In Shopify's system, products aren't directly "in" collections—instead, "collect" records create the relationship between products and collections, so you must delete the collect to remove a product from a collection.

Remove Product from Custom Collection

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: Deletes the collect record that links the product to the "Coming Soon" collection, effectively removing it from that collection as part of the launch process.

This step deletes the collect using {{shopify_3.0.id}}, which removes the product ({{loop.id}}) from the "Coming Soon" collection. After this step executes, the product no longer appears in the "Coming Soon" collection on your storefront. The product itself isn't deleted—only its membership in that specific collection is removed.

Shopify logo icon

Add Product to Custom Collection (New Arrivals)

App connector: Shopify • Time to complete: 3 minutes
Why this matters: Creates a new collect record that adds the product to your "New Arrivals" collection, completing the launch by making the product visible in the destination collection.

This step creates a collect that links {{loop.id}} (the product) to a destination collection.

Critical setup: You need to configure the collection_id in the body to specify which collection receives the product. Find your "New Arrivals" (or equivalent) collection ID using the same method as step 2—go to Products > Collections, click on "New Arrivals," and get the ID from the URL. Enter this ID in the step configuration. After this step, the product appears in your "New Arrivals" collection.

Ready to set this up? It only takes 19 minutes.

Our support team will even help you personalize this workflow for free.

Get started →

Make it your own!

Customize this workflow even further:

Add multiple destination collections based on product type
Add conditional logic after the date check that examines product type, vendor, or tags and routes products to different collections (like "New Apparel" vs "New Accessories") based on those attributes.
Send notifications when products launch
Add a Slack or email step after products are moved to notify your marketing team which products launched today, including product titles and links for social media posting.
Update product status or tags
Add steps after the collection move to update product status to "active," add a "New" tag, or modify other product properties to signal that the product has officially launched.
Handle products without metafields gracefully
Add an alternative path in the filter that logs or tags products in the "Coming Soon" collection that don't have publish dates set, helping you identify which pre-launch products need dates assigned.

Common questions

What if I have more than 100 products in my "Coming Soon" collection?

Do I need to create the custom metafield first?

What happens if a product has a publish date but that date has already passed?

Ready to automatically move products between collections based on metafield dates?

7-day free trial • 19 min setup • Cancel anytime

Need help? Our automation experts will help you personalize this workflow for free. Contact support