Title: docs: idempotency keys deduplicate triggers, not side effects inside run() by matt-aitken · Pull Request #4952 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: docs: idempotency keys deduplicate triggers, not side effects inside run() by matt-aitken · Pull Request #4952 · triggerdotdev/trigger.dev
X Title: docs: idempotency keys deduplicate triggers, not side effects inside run() by matt-aitken · Pull Request #4952 · triggerdotdev/trigger.dev
Description: Summary Idempotency keys deduplicate task triggers (trigger(), triggerAndWait(), batchTrigger()). They do not make the code inside a task's run() idempotent: when a run retries, run() executes again from the top, and any API call inside it happens again unless that call is itself idempotent. The idempotency page listed "avoiding double-charging customers" as a use case, but every example on the page only ever deduplicated a child trigger, so a reader could reasonably assume a payment call made directly inside a retryable run() was protected. It is not, and no Trigger.dev-side mechanism can protect it: only the payment provider can deduplicate its own API call, so the provider's idempotency key has to be passed too. This is a docs-only change. No SDK changes. What changed The intro now states the boundary up front: the key applies to the trigger call and nothing else. The use-case bullets say "trigger the X task once" rather than implying the side effect itself is deduplicated, and the payments bullet points at the new section. A new "Side effects inside run()" section explains why moving the call into a child task does not close the gap either, and shows a Stripe refund passing Stripe's idempotencyKey alongside a Trigger.dev key for the follow-up email trigger. Addresses the documentation side of #4627. Supersedes #4650, which was auto-closed by the vouch gate.
Open Graph Description: Summary Idempotency keys deduplicate task triggers (trigger(), triggerAndWait(), batchTrigger()). They do not make the code inside a task's run() idempotent: when a run retries, run() executes ...
X Description: Summary Idempotency keys deduplicate task triggers (trigger(), triggerAndWait(), batchTrigger()). They do not make the code inside a task's run() idempotent: when a run retries, run() execu...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4952
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:567eafac-9bac-f115-a3d4-8f3dde9efaba |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9B32:6BECA:88309E:C252FB:6AFAE0F1 |
| html-safe-nonce | fa7233240261152a8495a0fe09efcc55d2b6907569d5e6b2267323bc4eaac7cb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjMyOjZCRUNBOjg4MzA5RTpDMjUyRkI6NkFGQUUwRjEiLCJ2aXNpdG9yX2lkIjoiNDE2NzM0NjY5NTM5NjA1NzMyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3f9f07bd5901ca5ec8546c2cae6d37a40e431777a818c7263d08198cc339b3f8 |
| hovercard-subject-tag | pull_request:4567559209 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4952/files |
| twitter:image | https://avatars.githubusercontent.com/u/10635986?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/10635986?s=400&v=4 |
| og:image:alt | Summary Idempotency keys deduplicate task triggers (trigger(), triggerAndWait(), batchTrigger()). They do not make the code inside a task's run() idempotent: when a run retries, run() executes ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d9bd51a568909a83d1abb9d6f74d68f0c87ca85fe3a56d3f5d70d8b89add9f2 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a7ae932999cc6d511008dbf980ff9efad2a31f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width