Skip to content

Commit b6bc4c7

Browse files
docs(site): document all schedule expression types in schedule-syntax guide (#717)
1 parent 68f3fd6 commit b6bc4c7

1 file changed

Lines changed: 102 additions & 15 deletions

File tree

site/src/content/docs/guides/schedule-syntax.mdx

Lines changed: 102 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,116 @@ on:
1818
1919
This says: run every day at roughly 2 PM.
2020
21-
## Use fuzzy human-readable expressions
21+
## Daily schedules
2222
23-
Here are common patterns you can use.
23+
```yaml
24+
on:
25+
schedule: daily # Any time of day (fully scattered)
26+
```
2427
25-
### Daily
28+
```yaml
29+
on:
30+
schedule: daily around 14:00 # Within ~60 minutes of 2 PM
31+
```
2632
2733
```yaml
2834
on:
29-
schedule: daily around 14:00
35+
schedule: daily around midnight # Keywords: midnight, noon
3036
```
3137
3238
```yaml
3339
on:
34-
schedule: daily between 09:00 and 17:00
40+
schedule: daily between 09:00 and 17:00 # Any time in a business-hours window
3541
```
3642
37-
### Weekly
43+
Time values accept 24-hour (`14:00`), 12-hour (`3pm`, `11am`), or keywords (`midnight`, `noon`).
44+
45+
## Weekly schedules
3846

3947
```yaml
4048
on:
41-
schedule: weekly on monday
49+
schedule: weekly # Any day, scattered time
4250
```
4351

4452
```yaml
4553
on:
46-
schedule: weekly on friday around 17:00
54+
schedule: weekly on monday # Monday, scattered time
4755
```
4856

49-
### Hour-based intervals
57+
```yaml
58+
on:
59+
schedule: weekly on friday around 17:00 # Friday, within ~60 min of 5 PM
60+
```
5061

5162
```yaml
5263
on:
53-
schedule: every 6 hours
64+
schedule: weekly on wednesday between 09:00 and 12:00
5465
```
5566

56-
Other supported interval-style schedules include forms like `every 2h` and `every 30m`.
67+
Valid weekdays: `sunday`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`.
68+
69+
## Hourly schedules
70+
71+
```yaml
72+
on:
73+
schedule: hourly # Every hour at a scattered minute
74+
```
75+
76+
```yaml
77+
on:
78+
schedule: every 2h # Every 2 hours at scattered minute
79+
```
80+
81+
```yaml
82+
on:
83+
schedule: every 6 hours # Short and long forms both accepted
84+
```
85+
86+
Valid hour intervals: **1, 2, 3, 4, 6, 8, 12** (factors of 24 for even distribution).
87+
The minute within each hour is scattered per agent.
88+
89+
## Minute intervals
90+
91+
Minute intervals are scheduled at **fixed minutes** — they are not scattered like hour and day schedules.
92+
93+
```yaml
94+
on:
95+
schedule: every 5 minutes # Minimum supported interval
96+
```
97+
98+
```yaml
99+
on:
100+
schedule: every 15 minutes
101+
```
102+
103+
```yaml
104+
on:
105+
schedule: every 30m # Short form supported
106+
```
107+
108+
The minimum interval is 5 minutes (an Azure DevOps / GitHub Actions constraint).
109+
110+
## Multi-day and bi-weekly schedules
111+
112+
```yaml
113+
on:
114+
schedule: every 2 days # Every N days at scattered time
115+
```
116+
117+
```yaml
118+
on:
119+
schedule: every 2 weeks # Every N weeks (converted to N×7 days)
120+
```
121+
122+
```yaml
123+
on:
124+
schedule: bi-weekly # Every 14 days at scattered time
125+
```
126+
127+
```yaml
128+
on:
129+
schedule: tri-weekly # Every 21 days at scattered time
130+
```
57131

58132
## Add a timezone
59133

@@ -69,13 +143,15 @@ on:
69143
schedule: daily between 09:00 utc-5 and 17:00 utc-5
70144
```
71145

146+
Supported offset formats: `utc+9`, `utc-5`, `utc+05:30`, `utc-08:00`.
147+
72148
Use this when you want the schedule to reflect a team's local business hours without manually converting everything to UTC.
73149

74150
## Understand scattering
75151

76152
`ado-aw` does not always compile a fuzzy schedule to the exact same wall-clock minute you typed.
77153

78-
Instead, it applies **scattering**: a deterministic offset that spreads runs out to avoid a thundering herd effect.
154+
Instead, it applies **scattering**: a deterministic offset based on the agent name that spreads runs out to avoid thundering-herd effects.
79155

80156
For example:
81157

@@ -87,10 +163,10 @@ on:
87163
means:
88164

89165
- stay near 14:00
90-
- pick a stable offset for this agent
166+
- pick a stable offset for this specific agent
91167
- avoid scheduling every agent at the exact same minute
92168

93-
This helps when many teams use convenient schedule times like midnight, 9 AM, or the top of the hour.
169+
This helps when many teams use convenient schedule times like midnight, 9 AM, or the top of the hour. Scattering applies to all schedule types **except** minute intervals, which always run at fixed intervals.
94170

95171
## Know what happens at compile time
96172

@@ -107,7 +183,7 @@ You write the friendly expression; the compiler emits the precise schedule.
107183

108184
## Schedule specific branches
109185

110-
If you want more than the default branch behavior, use the object form:
186+
By default, scheduled runs fire on the `main` branch only. To specify different branches, use the object form:
111187

112188
```yaml
113189
on:
@@ -149,10 +225,21 @@ on:
149225

150226
Use this when you need a repeated check throughout the day.
151227

228+
### Frequent monitoring
229+
230+
```yaml
231+
on:
232+
schedule: every 15 minutes
233+
```
234+
235+
Use this for lightweight checks that need to run often. Remember: minute intervals are fixed, not scattered.
236+
152237
## Tips for choosing a schedule
153238

154239
- Use `daily around ...` for routine maintenance jobs.
155240
- Use `weekly on ...` for lower-frequency cleanup or reporting.
156241
- Use `every N hours` for repeated monitoring or polling.
242+
- Use `every N minutes` for high-frequency, latency-sensitive checks.
157243
- Add a timezone when the schedule should track local working hours.
158244
- Let scattering do its job instead of trying to force an exact shared minute across many agents.
245+
- Prefer hour-based schedules over minute intervals when sub-hourly frequency is not truly required.

0 commit comments

Comments
 (0)