Scheduled time
TheScheduled time触发starts a workflow at a time and date that you specify, with options to do the following:
- 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, theScheduled time触发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 theScheduled time触发:
- to create a workflow thatstarts at a specific date and time and occurs once
- to create a workflow thatstarts at a specific date and time and repeats on a schedule
- to create a workflow thatstarts at a specific date and time and repeats on a schedule until specific criteria are met
You can create multiple schedules and use any combination of these approaches.
On this page
- Considerations for using the Scheduled time trigger
- Create a workflow that runs at a specific date and time
- Create a workflow that runs repeatedly on a schedule
- Create a workflow that stops repeating when specific criteria are met
- Get actions
- Scheduled time variables
- Actions
- Example
- Testing the Scheduled time trigger
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, you can't activate the workflow.
- For repeating workflows, the longest interval possible between occurrences is one year. The smallest possible interval is one day.
Create a workflow that runs at a specific date and time
- Create a new workflow, and then select theScheduled time触发.
- Optional: Select the time zone to use. By default, this is set to yourstore's time zone.
- Enter aStart dateand aStart time.
- Optional: To add an additional schedule for the workflow, clickAdd schedule.
Create a workflow that runs repeatedly on a schedule
- Create a workflow that starts with theScheduled time触发.
- After you set the start time and date, clickAdd repeat rule.
- 选择的时间before the workflow is run again. This amount must be a whole number. Decimals are not supported.
- Set the time period from the optionsDays,Weeks, orMonths.
- If you selectWeeks, then click the day of the week that the workflow to run.
- If you selectMonths, then select the day of the month for the workflow to run.
- Optional: To set criteria that will stop the workflow from repeating, clickAdd end rule.
Create a workflow that stops repeating when specific criteria are met
- Create a workflow that starts with theScheduled time触发and aRepeat rule.
- ClickAdd end rule.
- Do one of the following:
- To stop the workflow after it has run a set amount of times, selectAfter number of occurrences, and then enter the number in theCount部分。
- To stop the workflow at a specific time, selectOn a date and time, and then enter anEnd dateand anEnd 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 theOrder created触发, 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 theScheduled time触发, 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 theScheduled time触发, conditions and actions in that workflow that accept liquid variables have an additional variable available. TheScheduled atvariable returns the time and date when the workflow is scheduled to run.
Actions
The following actions can be used in workflows that start with theScheduled time触发.
- Create redirect URL
- Delete redirect URLs
- Get collection data
- Get draft order data
- Get draft order data
- Get order data
- Get product data
- Remove shop metafield
- Send email
- Send HTTP request
- Update shop metafield
- Wait
Example
In this example workflow, an email is sent at 9:00 am on the last weekday every month.
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.