Time-based scheduling
When workflows need to run on a recurring basis -- such as nightly data syncs, periodic health checks, or monthly report generation -- manually triggering each execution is impractical. Time-based scheduling in CloudFlow automates workflow execution at fixed intervals or specific times using cron expressions, with EventBridge handling the trigger infrastructure.
Prerequisites
Before you begin, make sure that you have:
Activated EventBridge and granted the required permissions to a Resource Access Management (RAM) user. For details, see Activate EventBridge and grant permissions to a RAM user
Created a workflow in CloudFlow. For details, see Create a workflow
Create a time-based schedule
Log on to the CloudFlow console. In the top navigation bar, select a region.
On the Workflows page, click the target workflow.
On the Workflow Details page, click the Workflow Scheduling tab, and then click Create Workflow Scheduling.
In the Create Workflow Scheduling panel, select Scheduled Trigger from the Scheduling Type drop-down list, configure the following parameters, and then click OK.
Parameter
Description
Example
Name
A name for the schedule.
schedule-test
Description
A brief description of the schedule.
test schedule
Trigger Cycle
The scheduling mode. See Fixed Cycle vs. Custom Cron for details.
Select Fixed Cycle, set Cycle Type to Second and Cycle to 30. The workflow runs every 30 seconds.
Trigger Message
A custom JSON payload passed to the workflow at each trigger.
{"key": "value"}
NoteThe first time you create a schedule, attach the AliyunEventBridgeFullAccess policy to the CloudFlow scheduling role and activate EventBridge.
After the schedule is created, manage it from the Workflow Scheduling tab. Available actions: view, edit, delete, enable, and disable.
Fixed Cycle vs. Custom Cron
CloudFlow supports two scheduling modes through the Trigger Cycle parameter:
Mode | When to use | How it works |
Fixed Cycle | Simple recurring intervals (every N seconds, minutes, or hours) | Select a Cycle Type (Second, Minute, or Hour) and a Cycle value. No cron knowledge required. |
Custom Cron | Specific times, weekday-only schedules, or complex patterns | Write a cron expression for precise control. See Cron expression reference. |
Scheduling parameters
Each time-based schedule consists of three parameters:
{
"UserData": "payload",
"Schedule": "cronExpression",
"TimeZone": "GMT+0:00"
}Parameter | Description |
UserData | Input payload for the workflow, specified as a JSON object. |
Schedule | Cron expression that defines when the workflow runs. |
TimeZone | Time zone for schedule evaluation. Default: |
Cron expression reference
A cron expression uses six space-separated fields:
Seconds Minutes Hours Day-of-month Month Day-of-weekField definitions
Field | Valid values | Allowed special characters |
Seconds | 0-59 | , - * / |
Minutes | 0-59 | , - * / |
Hours | 0-23 | , - * / |
Day-of-month | 1-31 | , - * ? / L W |
Month | 1-12 or JAN-DEC | , - * / |
Day-of-week | 1-7 or SUN-SAT | , - * ? / L # |
Special characters
Character | Meaning | Example |
| Every value in the field. |
|
| A list of values. |
|
| A range of values. |
|
| No specific value. Use in Day-of-month or Day-of-week when the other field is specified. |
|
| An increment. |
|
| Last. In Day-of-month, the last day of the month. In Day-of-week, prefix with a day number for the last occurrence. |
|
| Nearest weekday (Monday through Friday). |
|
| The nth weekday of the month. |
|
Common examples
All examples below use the GMT+8:00 time zone.
Schedule | Cron expression | Time zone |
Every day at 12:00 |
| GMT+8:00 |
Every day at 12:30 |
| GMT+8:00 |
At the 26th, 29th, and 33rd minute of every hour |
| GMT+8:00 |
Weekdays at 12:30 |
| GMT+8:00 |
Every 5 minutes from 12:00 to 14:00 on weekdays |
| GMT+8:00 |
Every day at 12:00, January through April |
| GMT+8:00 |
Every Wednesday in March at 14:10 and 14:44 |
| GMT+8:00 |
Last day of each month at 23:00 |
| GMT+8:00 |
Last Friday of each month at 10:15 |
| GMT+8:00 |
Third Friday of each month at 10:15 |
| GMT+8:00 |
Example: To run a workflow at 12:00 Beijing time every day, set the cron expression to 0 0 12 * * ? and the time zone to GMT+8:00.
Input format
When a schedule triggers a workflow, CloudFlow passes a CloudEvents-compliant JSON payload as input:
{
"datacontenttype": "application/json;charset=utf-8",
"aliyunaccountid": "143998900779****",
"aliyunpublishtime": "2022-09-21T05:00:00.035Z",
"data": {
"TimeZone": "GMT+0:00",
"Schedule": "0/30 * * * * ?",
"UserData": {
"key": "value"
}
},
"specversion": "1.0",
"aliyuneventbusname": "Housekeeping-Bus",
"id": "d100262d-90c7-4caf-a3b5-813f3526a1f7-****",
"source": "housekeeping.scheduledevent",
"time": "2022-09-21T05:00:00Z",
"aliyunregionid": "cn-beijing",
"type": "eventbridge:Events:ScheduledEvent"
}The following table describes the fields in the data object. The remaining fields are standard CloudEvents envelope fields populated by EventBridge.
Field | Description |
UserData | Custom input specified in the schedule configuration. Access this value in a flow definition with |
Schedule | Cron expression that triggered the execution. |
TimeZone | Time zone configured for the schedule. Default: |
Limits
Time-based scheduling relies on EventBridge custom event buses and event rules. If either resource reaches its quota within your Alibaba Cloud account and region, new schedules cannot be created. For quota details, see Limits.