From 25e4248e5cb72b17194283a3b995cd0dcbb1866b Mon Sep 17 00:00:00 2001 From: isshaddad Date: Wed, 4 Feb 2026 07:42:23 -0500 Subject: [PATCH 1/2] env variables loading order --- docs/deploy-environment-variables.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/deploy-environment-variables.mdx b/docs/deploy-environment-variables.mdx index e123f34170..72fed3e221 100644 --- a/docs/deploy-environment-variables.mdx +++ b/docs/deploy-environment-variables.mdx @@ -66,6 +66,18 @@ You can edit an environment variable's values. You cannot edit the key name, you +## Local development + +When running `npx trigger.dev dev`, the CLI automatically loads environment variables from these files in order (later files override any duplicate keys from earlier ones): + +- `.env` +- `.env.development` +- `.env.local` +- `.env.development.local` +- `dev.vars` + +These variables are available to your tasks via `process.env`. You don't need to use the `--env-file` flag for this automatic loading. + ## In your code You can use our SDK to get and manipulate environment variables. You can also easily sync environment variables from another service into Trigger.dev. From 481f256a43cc891503b60cc118bc958471045fea Mon Sep 17 00:00:00 2001 From: isshaddad Date: Wed, 4 Feb 2026 08:44:11 -0500 Subject: [PATCH 2/2] idempotency reset scope for backend-triggered tasks --- docs/idempotency.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/idempotency.mdx b/docs/idempotency.mdx index 9ed3933d56..034246eafb 100644 --- a/docs/idempotency.mdx +++ b/docs/idempotency.mdx @@ -428,18 +428,22 @@ export const parentTask = task({ }); ``` -When resetting from outside a task (e.g., from your backend code), you must provide the `parentRunId`: +When resetting from outside a task, you must provide the `parentRunId` if the key was created within a task context: ```ts import { idempotencyKeys } from "@trigger.dev/sdk"; -// From your backend code - you need to know the parent run ID +// If the key was created within a task, you need the parent run ID await idempotencyKeys.reset("my-task", "my-key", { scope: "run", parentRunId: "run_abc123" }); ``` + +If you triggered the task from backend code, all scopes behave as global (see [Triggering from backend code](#triggering-from-backend-code)). Use `scope: "global"` when resetting. + + ### Resetting attempt-scoped keys Keys created with `"attempt"` scope include both the parent run ID and attempt number. When resetting from outside a task, you must provide both: