Skip to content

Commit b8ce693

Browse files
authored
docs: adds deduplication key clarification (#3151)
1 parent 54d22e9 commit b8ce693

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
@@ -188,7 +188,7 @@ These are the options when creating a schedule:
188188
| Cron pattern | The schedule in cron format. |
189189
| Timezone | The timezone the schedule will run in. Defaults to "UTC" |
190190
| External id | An optional external id, usually you'd use a userId. |
191-
| Deduplication key | An optional deduplication key. If you pass the same value, it will update rather than create. |
191+
| Deduplication key | An optional deduplication key. If you pass the same value, it will update rather than create. Scoped per project, not per environment. |
192192
| Environments | The environments this schedule will run in. |
193193

194194
</Step>
@@ -214,6 +214,10 @@ const createdSchedule = await schedules.create({
214214

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

217+
<Note>
218+
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).
219+
</Note>
220+
217221
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:
218222

219223
```ts

0 commit comments

Comments
 (0)