Scheduled time

The Scheduled time trigger starts a workflow at a time and date that you specify, with options to:

  • repeat the workflow on a specific schedule
  • stop repeating the workflow when certain criteria are met

Unlike most other triggers that are available for Shopify Flow, the Scheduled time trigger starts a workflow based on criteria that you set when you create the workflow, rather than based on an event that occurs in your store or in an app.

There are three different ways to use the Scheduled time trigger:

You can create multiple schedules and use any combination of these approaches.

Considerations for using the Scheduled time trigger

  • A workflow must have at least one occurrence in the future. If a workflow is created that both starts and ends in the past, then you can't activate the workflow.
  • For repeating workflows, the longest interval possible between occurrences is one year. The smallest possible interval is 10 minutes. For small time intervals, if a workflow takes longer to run than the interval, then you might get inconsistent results, depending upon the query used and the actions in the workflow.

Create a workflow that runs at a specific date and time

  1. Create a new workflow, and then select the Scheduled time trigger.
  2. Optional: Select the time zone to use. By default, this is set to your store's time zone.
  3. Enter a Start date and a Start time.
  4. Optional: To add an additional schedule for the workflow, click Add schedule.

Create a workflow that runs repeatedly on a schedule

  1. Create a workflow that starts with the Scheduled time trigger.
  2. After you set the start time and date, click Add repeat rule.
    1. Select the amount of time to pass before the workflow is run again. This amount must be a whole number. Decimals are not supported.
    2. Set the time period from the options Days, Weeks, or Months.
      • If you select Weeks, then click the day of the week that the workflow to run.
      • If you select Months, then select the day of the month for the workflow to run.
  3. Optional: To set criteria that will stop the workflow from repeating, click Add end rule.

Create a workflow that stops repeating when specific criteria are met

  1. Create a workflow that starts with the Scheduled time trigger and a Repeat rule.
  2. Click Add end rule.
  3. Do one of the following:
    • To stop the workflow after it has run a set amount of times, select After number of occurrences, and then enter the number in the Count section.
    • To stop the workflow at a specific time, select On a date and time, and then enter an End date and an End time.

Get actions

Most workflows start due to an event, and automatically include data that is related to that event. For example, when a workflow is started by the Order created trigger, the workflow starts when a new order is placed. The workflow automatically has the information on the order that caused the workflow to run, and performs actions on that workflow.

In a workflow that uses the Scheduled time trigger, the workflow starts at a time that you've specified, rather than as a result of an event. Because there is no specific event in your store or from an app that starts the workflow, there is no data automatically included. To create a workflow that takes actions on orders or products, you can use the following actions to bring that data into your workflow:

Scheduled time variables

When you start a workflow with the Scheduled time trigger, conditions and actions in that workflow that accept liquid variables have an additional variable available. The Scheduled at variable returns the time and date when the workflow is scheduled to run, called scheduledAt.

Testing the Scheduled time trigger

To test a workflow that starts with this trigger, set the first workflow to run shortly after you turn on the workflow. After you're confident your workflow works as intended, edit your workflow to update the start date and time.

Templates

Add products with a tag to a collection in the future

At a time in the future, get all products with a certain tag and then add them to a collection. View template

Convert a customer metafield into tags for all customers

This workflow will backfill tags onto all of your customers based on a metafield value. It runs every hour and fetches up to 100 customers that do not have a "processed" tag. For each customer, it looks at the value of a custom.test metafield and adds it as a tag. The workflow also adds a "processed" tag so that it isn't returned in the next scheduled run of the workflow. To use the workflow, you will need to change the metafield namespace and key to match a metafield in your shop. View template

Create and initialize shop metafields

Use shop metafields with Flow by creating definitions and initializing the metafield with the value(s) you need. View template

Delete inactive customers

Delete customers over 5 years old that have never placed an order. View template

Delete inactive products

Delete products with no inventory that have not been updated in a year. View template

Email weekly summary of active discounts that use a code

Emails a summary of active discounts that use a code. The workflow runs on a schedule every monday at 9am. The workflow can be customized to change the timing, how you receive the summary, the type of discounts you want to include, and mode. View template

Once a week, generate and send reports with Tresl Segments

Generates one or more reports using the Tresl Segments app. It sends the reports to the email addresses specified and uses the Schedule time trigger to run once a week. View template

Publish products with a certain tag in the future

On a date in the future, get products with a certain tag and publish them. Used Scheduled time trigger and Get product data action. View template

Remove new product tag 90 days after the product was created

Every day, gets up to 100 products that were created more than 90 days ago and which still have the "new" tag. The workflow then removes those tags for each product. View template

Schedule products to be removed from Online Store at the specified date and time

At a single date in the future, remove products from online store by tag, id, or sku. Makes use of Scheduled time trigger, Get Product Data action, For Each loop. View template

Send a notification when Order volume is less than 10 in last hour

Sends an order heartbeat notification. Every hour, get up to 10 orders that were created, and count them. If less than 10, send a notification via Email. Uses the Schedule time, Get order data, and Count steps. View template

Send daily email summary with list of fulfillment orders that are on hold

Every day, this workflow will query for all fulfillment orders that are on hold (up to 100 at a time). It will send an email summary with the order name and assigned fulfillment location. View template

Send daily email summary with out of stock products

Every day, gets all the products that have 0 inventory and sends an email summary. Uses Get product data, Scheduled time trigger. View template

Send daily notification with all open Draft Orders

Every day, get open draft orders, count them, and send a Slack message. Uses the Scheduled time trigger, Get draft orders, and Count actions. View template

Send email summary of all orders to Online Store in the last day

Every day, gets orders for the last day, and sends an email summary with those that were placed on the online store. View template

Send email summary with all unfulfilled orders older than 2 days

Get a daily summary of all of your unfulfilled orders that are older than 2 days, making use of schedules, get order data, count, and sum. View template

Send weekly email summary with list of low stock variants

This workflows runs on a schedule (like once per week). It gets a list of product variants that are low stock, counts the results, and sends an email summary with the variant titles and a link to the Admin page for the variant. View template

Tag and send a daily summary of late fulfillments

Every day, tag and send a daily email summary that counts the total number and dollar value of all orders that miss a 2 day shipping guarantee. View template

Tag customers that have a chargeback

Every hour, this workflows gets orders with chargebacks and adds a tag to the customer for the order. Makes use of scheduled time trigger, get order data, and for each loop. View template

Tag unfulfilled orders older than 2 days

Every day, the workflow gets all unfulfilled orders older than 2 days and it adds a tag to the order. View template

Track product variants that are on sale using a product metafield

Sets a metafield on a product if at least one of its variants is on sale. This can be useful for tracking which products are currently on sale. View template

Can’t find the answers you’re looking for? We’re here to help.