Skip to content

Commit 4c2bc76

Browse files
committed
adds deduplication key clarification
1 parent 24b92d3 commit 4c2bc76

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/tasks/scheduled.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ These are the options when creating a schedule:
176176
| Cron pattern | The schedule in cron format. |
177177
| Timezone | The timezone the schedule will run in. Defaults to "UTC" |
178178
| External id | An optional external id, usually you'd use a userId. |
179-
| Deduplication key | An optional deduplication key. If you pass the same value, it will update rather than create. |
179+
| Deduplication key | An optional deduplication key. If you pass the same value, it will update rather than create. Scoped per project, not per environment. |
180180
| Environments | The environments this schedule will run in. |
181181

182182
</Step>
@@ -202,6 +202,10 @@ const createdSchedule = await schedules.create({
202202

203203
You can create many schedules with the same `task`, `cron`, and `externalId` but only one with the same `deduplicationKey`.
204204

205+
<Note>
206+
The deduplication key is **per project**, not per environment. Using the same key in Production and Staging creates a single schedule; the last create/update decides which environment it appears in. For fixed schedules, prefer **declarative** (cron on the task). If using imperative across environments, use a different deduplication key per environment (e.g. include the env name in the key).
207+
</Note>
208+
205209
This means you can have thousands of schedules attached to a single task, but only one schedule per `deduplicationKey`. Here's an example with all the options:
206210

207211
```ts

0 commit comments

Comments
 (0)