You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/deploy-environment-variables.mdx
+52-1Lines changed: 52 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -360,4 +360,55 @@ This will read your .env.production file using dotenvx and sync the variables to
360
360
361
361
- Trigger.dev does not automatically detect .env.production or dotenvx files
362
362
- You can paste them manually into the dashboard
363
-
- Or sync them automatically using a build extension
363
+
- Or sync them automatically using a build extension
364
+
365
+
## Multi-tenant applications
366
+
367
+
If you're building a multi-tenant application where each tenant needs different environment variables (like tenant-specific API keys or database credentials), you don't need a separate project for each tenant. Instead, use a single project and load tenant-specific secrets at runtime.
368
+
369
+
<Note>
370
+
This is different from [syncing environment variables at deploy time](#sync-env-vars-from-another-service).
371
+
Here, secrets are loaded dynamically during task execution, not synced to Trigger.dev's environment variables.
372
+
</Note>
373
+
374
+
### Recommended approach
375
+
376
+
Use a secrets service (Infisical, AWS Secrets Manager, HashiCorp Vault, etc.) to store tenant-specific secrets, then retrieve them at the start of each task run based on the tenant identifier in your payload or context.
377
+
378
+
**Important:** Never pass secrets in the task payload, as payloads are logged and visible in the dashboard.
// Your task logic using the tenant-specific secret
400
+
// ...
401
+
},
402
+
});
403
+
```
404
+
405
+
You can use any secrets service - see the [sync env vars section](#sync-env-vars-from-another-service) for an example with Infisical.
406
+
407
+
### Benefits
408
+
409
+
-**Single codebase** - Deploy once, works for all tenants
410
+
-**Secure** - Secrets never appear in payloads or logs
411
+
-**Scalable** - No project limit constraints
412
+
-**Flexible** - Easy to add new tenants without redeploying
413
+
414
+
This approach allows you to support unlimited tenants with a single Trigger.dev project, avoiding the [project limit](/limits#projects) while maintaining security and separation of tenant data.
Copy file name to clipboardExpand all lines: docs/limits.mdx
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,14 @@ If you add them [dynamically using code](/management/schedules/create) make sure
55
55
56
56
If you're creating schedules for your user you will definitely need to request more schedules from us.
57
57
58
+
## Projects
59
+
60
+
| Pricing tier | Limit |
61
+
| :----------- | :----------------- |
62
+
| All tiers | 10 per organization |
63
+
64
+
Each project receives its own concurrency allocation. If you need to support multiple tenants with the same codebase but different environment variables, see the [Multi-tenant applications](/deploy-environment-variables#multi-tenant-applications) section for a recommended workaround.
Copy file name to clipboardExpand all lines: docs/troubleshooting.mdx
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,6 +211,16 @@ export const myTask = task({
211
211
212
212
View the [rate limits](/limits) page for more information.
213
213
214
+
### Runs waiting in queue due to concurrency limits
215
+
216
+
If runs are staying in the `QUEUED` state for extended periods, check your concurrency usage in the dashboard. Review how many runs are `EXECUTING` or `DEQUEUED` (these count against limits) and check if any runs are stuck in `EXECUTING` state, as they may be blocking new runs.
217
+
218
+
**Solutions:**
219
+
220
+
-**Increase concurrency limits** - If you're on a paid plan, increase your environment concurrency limit via the dashboard
221
+
-**Review queue concurrency limits** - Check if individual queues have restrictive `concurrencyLimit` settings
222
+
-**Check for stuck runs** - See if stalled runs are blocking new executions
223
+
214
224
### `Crypto is not defined`
215
225
216
226
This can happen in different situations, for example when using plain strings as idempotency keys. Support for `Crypto` without a special flag was added in Node `v19.0.0`. You will have to upgrade Node - we recommend even-numbered major releases, e.g. `v20` or `v22`. Alternatively, you can switch from plain strings to the `idempotencyKeys.create` SDK function. [Read the guide](/idempotency).
0 commit comments