1
1
---
2
2
title : " Scheduled tasks (cron)"
3
- description : " A task that is triggered on a recurring schedule using CRON syntax."
3
+ description : " A task that is triggered on a recurring schedule using cron syntax."
4
4
---
5
5
6
6
## Defining a scheduled task
@@ -120,7 +120,7 @@ To use imperative schedules you need to do two things:
120
120
1 . Define a task in your code using ` schedules.task() ` .
121
121
2 . Attach 1+ schedules to the task either using the dashboard or the SDK.
122
122
123
- ## Supported CRON syntax
123
+ ## Supported cron syntax
124
124
125
125
```
126
126
* * * * *
@@ -135,7 +135,7 @@ To use imperative schedules you need to do two things:
135
135
136
136
"L" means the last. In the "day of week" field, 1L means the last Monday of the month. In the "day of month" field, L means the last day of the month.
137
137
138
- We do not support seconds in the CRON syntax.
138
+ We do not support seconds in the cron syntax.
139
139
140
140
## When schedules won't trigger
141
141
@@ -165,7 +165,7 @@ These are the options when creating a schedule:
165
165
| Name | Description |
166
166
| ----------------- | --------------------------------------------------------------------------------------------- |
167
167
| Task | The id of the task you want to attach to. |
168
- | CRON pattern | The schedule in CRON format. |
168
+ | Cron pattern | The schedule in cron format. |
169
169
| Timezone | The timezone the schedule will run in. Defaults to "UTC" |
170
170
| External id | An optional external id, usually you'd use a userId. |
171
171
| Deduplication key | An optional deduplication key. If you pass the same value, it will update rather than create. |
@@ -183,7 +183,7 @@ You call `schedules.create()` to create a schedule from your code. Here's the si
183
183
const createdSchedule = await schedules .create ({
184
184
// The id of the scheduled task you want to attach to.
185
185
task: firstScheduledTask .id ,
186
- // The schedule in CRON format.
186
+ // The schedule in cron format.
187
187
cron: " 0 0 * * *" ,
188
188
// this is required, it prevents you from creating duplicate schedules. It will update the schedule if it already exists.
189
189
deduplicationKey: " my-deduplication-key" ,
@@ -200,14 +200,14 @@ This means you can have thousands of schedules attached to a single task, but on
200
200
const createdSchedule = await schedules .create ({
201
201
// The id of the scheduled task you want to attach to.
202
202
task: firstScheduledTask .id ,
203
- // The schedule in CRON format.
203
+ // The schedule in cron format.
204
204
cron: " 0 0 * * *" ,
205
205
// Optional, it defaults to "UTC". In IANA format, e.g. "America/New_York".
206
206
// In this case, the task will run at midnight every day in New York time.
207
207
// If you specify a timezone it will automatically work with daylight saving time.
208
208
timezone: " America/New_York" ,
209
209
// Optionally, you can specify your own IDs (like a user ID) and then use it inside the run function of your task.
210
- // This allows you to have per-user CRON tasks.
210
+ // This allows you to have per-user cron tasks.
211
211
externalId: " user_123456" ,
212
212
// You can only create one schedule with this key.
213
213
// If you use it twice, the second call will update the schedule.
0 commit comments