How it works

Follow these 10 simple steps to automate this task automatically.

schedule icon

Trigger daily ranking

The workflow starts automatically every day at midnight to refresh sales data.
Time to complete: 1 minute

Define ranking inputs

Sets dynamic variables like how many days of sales to review, how many products to rank, and which collection to update.
Time to complete: 1 minute

Query best-selling products

Runs a SQL query to calculate the top-selling products by quantity sold.
Time to complete: 1 minute

Fetch current collection products

Retrieves all products currently in the selected collection so their ranking can be reset.
Time to complete: 1 minute

Loop through current collection

This step goes through each product in the existing collection.
Time to complete: 1 minute

Reset product rank to zero

Clears any previous ranking by setting the best_sellers_index metafield to 0.
Time to complete: 1 minute

Loop through new top-sellers

Begins a new loop over the freshly ranked best-selling products.
Time to complete: 1 minute

Get product info

Looks up each product from the top sellers to prepare it for re-ranking.
Time to complete: 1 minute

Assign new best-seller rank

Updates the product's metafield to reflect its current best-seller index.
Time to complete: 1 minute
code icon

Sort products in best sellers collection

Uses a custom script to reorder the collection based on updated rankings.
Time to complete: 1 minute

Make it your own

Customize this workflow even further:

Set custom delays
Schedule actions to trigger after a set time period, such as sending follow-up emails 3 days after an event.
Chain multiple actions
Connect several steps together in one workflow, like tagging data, updating records, and notifying your team simultaneously.
Store data in tables
Save order details, customer preferences, or custom metrics in your own database for reference and reporting.
Deploy AI agents for smart decisions
Let AI agents evaluate complex scenarios and choose the right action path based on your defined rules.

Frequently asked questions

What is a template?
Templates are pre-made workflows by our team of experts. Instead of building a workflow from scratch, these have all the steps needed to complete the task.
Can I personalize a template?
Yes! Every step can be customized to meet your exact requirements. Additionally, you can even add more steps and make it more sophisticated.
Are templates free?
Yes! Our entire library containing hundreds of templates are free to use and customize to your exact needs.

Ready to automate this task automatically?

Join thousands who've automated their work and saved an average of 3.5 hours every week.

Use this template — It's free
7-day free trial • 10 min setup • Cancel anytime