Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/deploy-environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ You can edit an environment variable's values. You cannot edit the key name, you

</Steps>

## 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.
Expand Down
8 changes: 6 additions & 2 deletions docs/idempotency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
});
```

<Note>
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.
</Note>

### 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:
Expand Down