Scheduled tasks trigger a scaling rule at a specific time, automatically adjusting the number of instances in a scaling group. Use scheduled tasks to match compute capacity with predictable traffic patterns—scaling out before a peak period and scaling in during off-hours to minimize cost.
For example:
Scale out 30 minutes before a daily batch job starts at 09:00.
Scale in over the weekend when user traffic drops.
Run a one-time capacity adjustment on a product launch day.
When to use one-time vs. recurring tasks
| Task type | When to use | Recurrence setting |
|---|---|---|
| One-time | Capacity adjustment for a specific event (product launch, planned maintenance) | Not Set |
| Recurring | Predictable daily, weekly, or monthly traffic patterns | By Day, By Week, By Month, or Cron Expression |
After you create a scheduled task, you cannot change its Recurrence setting back to Not Set.
Configuration parameters
| Parameter | Description |
|---|---|
| Executed At | The date and time when the task runs. Without a Recurrence setting, the task runs once at this time. With a Recurrence setting, the task runs at this time and then repeats on the specified cycle. Do not set a time more than 90 days from the task's creation or last modification date—the task will not take effect. |
| Scaling group | The scaling group the task applies to. Select an existing scaling group. |
| Scaling method | How the task adjusts capacity. See Scaling method options. |
| Simple scaling rule | Available when Scaling method is set to Select existing scaling rule. Select an existing simple scaling rule. Scheduled tasks support simple scaling rules only. |
| Retry interval (seconds) | The interval at which Auto Scaling retries the task if execution fails. This prevents a single failure from permanently blocking the task. If multiple tasks are scheduled within the same minute, Auto Scaling runs the most recently created task. |
| Recurrence | The repeat cycle for the task. Options: Not Set, By Day, By Week, By Month, Cron Expression. |
Scaling method options
Select existing scaling rule — Choose an existing simple scaling rule. The task executes that rule at the scheduled time.
Configure number of instances in scaling group — Directly set the maximum, minimum, or expected number of instances. These values overwrite the numbers defined on the scaling group and take effect only at the scheduled time.
Constraints when using this option:
If the scaling group was created without an Expected number of instances value: configure Maximum instances and Minimum instances only.
If the scaling group was created with an Expected number of instances value: configure Maximum instances, Minimum instances, and Expected instances together. If any of the three values is missing, Auto Scaling rejects the scaling request.
Cron expressions
When By Day, By Week, and By Month do not match your schedule, use a cron expression for full control.
A cron expression is a five-field string in the format X X X X X, where each field represents minutes, hours, day of month, month, and day of week, in that order.
All cron expressions use UTC+0. Convert your local time before setting an expression. For example, to run a task at 20:00 CST (UTC+8), subtract 8 hours and set the expression to 0 12 * * ?.
Additional constraints:
A scheduled task with a cron expression runs at most once every five minutes.
The first execution time must fall before the expiration of the Recurrence cycle. If it does not, Auto Scaling reports an error.
Field reference
| Field | Required | Value range | Supported special characters |
|---|---|---|---|
| Minute | Yes | 0–59 | , - / * |
| Hour | Yes | 0–23 | , - / * |
| Day | Yes | 1–31 | , - / * ? L W |
| Month | Yes | 1–12 | , - / * |
| Week | Yes | 1–7 (Sunday = 7) | , - * ? / L # |
Special characters
| Character | Meaning | Example |
|---|---|---|
* | All valid values in the field | * in Month: every month. * in Week: every day of the week. |
, | List of specific values | 5,20 in Minute: runs at minute 5 and minute 20. |
- | Inclusive range | 5-20 in Minute: runs at every minute from 5 through 20. |
/ | Step increment, starting from the left value | 0/15 in Minute: runs at minutes 0, 15, 30, and 45. 3/20 in Minute: runs at minutes 3, 23, and 43. |
? | Unspecified (Day and Week fields only). Use ? in whichever of Day or Week you are not constraining—leaving both unset causes a conflict. | 15 10 15 * ?: runs at 10:15 on the 15th of each month, regardless of day of week. |
L | Last day of the period (Day and Week fields only). Do not combine L with a list or range. | L in Day: last day of the month. 6L in Week: last Saturday of the month. |
W | Nearest weekday to the specified day of month, within the same month. LW means the last weekday of the month. | 5W in Day: if the 5th is Saturday, triggers on Friday the 4th; if Sunday, triggers on Monday the 6th; if a weekday, triggers on the 5th. |
# | Specific occurrence of a weekday within the month (Week field only). Valid position values: 1–5. | 4#2 in Week: second Thursday of the month. |
Cron expression examples (UTC+0)
| Expression | Schedule |
|---|---|
15 10 ? * * | 10:15 every day |
15 9 * * * | 09:15 every day |
0 12 * * ? | 12:00 every day |
0 10,14,16 * * ? | 10:00, 14:00, and 16:00 every day |
15 10 15 * ? | 10:15 on the 15th of every month |
15 10 L * ? | 10:15 on the last day of every month |
15 10 ? * 6L | 10:15 on the last Saturday of every month |
15 10 ? * 6#3 | 10:15 on the third Saturday of every month |
Table 4. Value examples
The following table provides examples of cron expressions and their meanings in the UTC+0 time zone. When you set a cron expression, you must convert your local time to UTC+0.
Example | Description |
| Runs the task at 10:15 every day. |
| Runs the task at 9:15 every day. |
| Runs the task at 12:00 every day. |
| Runs the task at 10:00, 14:00, and 16:00 every day. |
| Runs the task at 10:15 on the 15th of every month. |
| Runs the task at 10:15 on the last day of every month. |
| Runs the task at 10:15 on the last Saturday of every month. |
| Runs the task at 10:15 on the third Saturday of every month. |
Manage scheduled tasks
| Operation | User guide | API |
|---|---|---|
| Create | Create scheduled tasks | CreateScheduledTask |
| Modify | — | ModifyScheduledTask |
| Enable | — | — |
| Disable | — | — |
| Delete | — | DeleteScheduledTask |
| Query details | — | DescribeScheduledTasks |
What's next
Scaling group overview — Learn about scaling groups, which scheduled tasks target.
Scaling rules overview — Learn about scaling rules, including simple scaling rules supported by scheduled tasks.
Manage scaling rules — Create and manage scaling rules that scheduled tasks can reference.