How to Schedule Collection Updates with Metafield Dates
Launching new products or prepping for a seasonal sale often means shuffling items between collections on Shopify. Timing these moves with precision can get tricky, especially if you’re trying to keep up with marketing plans or keep things fresh for shoppers. Manual updates take time, and the risk of missing a date can throw things off.
Plenty of store owners want a way to automate these collection changes so products show up in the right place at just the right moment. Using a scheduled date in a product’s metafield unlocks a hands-off way to move items between collections. This makes your shop look polished and keeps things running smoothly behind the scenes.
By the end of this article, you’ll have a clear plan for setting up an automated workflow that moves products based on dates set in their metafields. In this guide, you’ll learn how to handle each step, avoid common mistakes, and get tips for making your product launches and seasonal changes feel effortless.
TL;DR: Don’t want to build your own? Use our ready-made template for scheduled product collection changes and get started in seconds.
MESA Template ID
scheduled-metafield-date-product-updates
Topics:
Step-by-step: Schedule product collection changes by metafield date
Time needed: 5 minutes
This workflow automatically moves products between collections based on a scheduled date stored in a metafield. When the date matches today’s date, it removes the product from one collection (e.g., “Coming Soon”) and adds it to another (e.g., “New Arrivals”).
- Configure Schedule trigger
Set up a daily schedule trigger to check products for their scheduled move date.
- Get products from source collection
Use the Shopify Collection Products step to retrieve products from your source collection (e.g., “Coming Soon”). Set the limit to control how many products to retrieve—by default, it’s 50, but you can increase it up to 8,000 to fetch more products in a single request.
If your collection has more than 8,000 products, you’ll need to implement pagination to get the full list. - Filter valid products
Add a Filter step to check that the collection has at least one product in the source collection by checking that product IDs are not empty.
- Loop through products
Set up a Loop to process each product from the filtered collection list.
- Check product metafield
Configure a Shopify Product Metafield step to retrieve the “publish_date” metafield from each product’s “custom” namespace.
- Filter products by date
Add a Filter to only process products where:
– The metafield value is not empty
– The metafield date matches today’s date (format: YYYY-MM-DD)
First, add the MESA “Date” variable, then use the formatting options to achieve the required YYYY-MM-DD format. - Clear product metafield
Add a Transform step with the following JavaScript code to remove the publish_date metafield:
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 source Collection ID
Retrieve the source Collection ID (e.g., “Coming Soon”) using the Shopify Custom Collections endpoint.
- Get collection relationship
Get the Collection ID that links the product to the source collection using the Shopify Collects endpoint.
- Remove from source collection
Delete the Shopify Collects relationship to remove the product from the source collection.
- Add to destination collection
Create a new Shopify Collect relationship to add the product to the destination collection (e.g., “New Arrivals”).
- Turn workflow “On”
Turn the workflow on and run it once to ensure everything is configured correctly before letting it run automatically on the daily schedule.
Save yourself the setup. Use this template instead:
MESA Template ID
scheduled-metafield-date-product-updates
Why Schedule collection updates with metafield dates?
Automating collection updates by metafield date gives you a ton of flexibility:
Prepare for product launches: Set your release date once, and products jump from “Coming Soon” to “New Arrivals” without lifting a finger. This keeps your launch on schedule and creates a sense of anticipation for shoppers.
Manage seasonal collections: Move summer products into the spotlight or tuck away holiday items automatically when the date hits. You don’t need to remember to make the switch in the middle of a busy week.
Control product visibility: Keep items hidden until their release date, or shift them out of a featured spot when a sale ends. You set the date, and the system handles the rest.
Automate collection management: By using scheduled metafield updates, you can let the store handle these changes, which frees up your team for other priorities.
Enhance marketing strategies: By syncing product collection changes with your marketing push, everything appears seamless when the promotion goes live.
Tips on scheduling collection updates with metafield dates
Use a consistent date format
Pick a date format like YYYY-MM-DD and stick to it for all your metafield dates. This keeps things clear and prevents any mixups when the automation checks which items need to be moved.
Plan ahead
Set up your dates before the start of each season or a big launch. This will give you peace of mind that products will appear in the right collections at the right time.
Leverage metafields effectively
Metafields can do much more than just store a date. Try using them for sale end dates, limited edition releases, or collection-specific notes. For more ideas, check out our Shopify metafields guide.
Combine with other automation
Mix scheduled collection changes with automations like product tagging or inventory updates. You’ll build a smoother workflow and save yourself from repetitive tasks. Learn more ways to automate metafields for extra flexibility.
Frequently asked questions
Yes. You can assign different metafield dates to move a product between collections at various times.
Products without a metafield date won’t move automatically. They’ll stay in their current collection until you add a date or move them yourself.
Yes. Using a metafield date, you can set up a workflow that removes a product from its collection without adding it to a new one.
Go with something standard—YYYY-MM-DD works well. It’s easy to read and works for both you and any automated system checking the dates.