docs: adds deduplication key clarification (#3151)

This commit is contained in:
Iss
2026-04-14 10:10:04 -04:00
committed by GitHub
parent 54d22e9ee1
commit b8ce6939b6
+5 -1
View File
@@ -188,7 +188,7 @@ These are the options when creating a schedule:
| Cron pattern | The schedule in cron format. |
| Timezone | The timezone the schedule will run in. Defaults to "UTC" |
| External id | An optional external id, usually you'd use a userId. |
| Deduplication key | An optional deduplication key. If you pass the same value, it will update rather than create. |
| Deduplication key | An optional deduplication key. If you pass the same value, it will update rather than create. Scoped per project, not per environment. |
| Environments | The environments this schedule will run in. |
</Step>
@@ -214,6 +214,10 @@ const createdSchedule = await schedules.create({
You can create many schedules with the same `task`, `cron`, and `externalId` but only one with the same `deduplicationKey`.
<Note>
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).
</Note>
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:
```ts