Skip to content

Commit 5ab883f

Browse files
committed
feat(core): add defaultWorkerGroupId to AuthenticatedEnvironment
Optional per-environment default region, mapped from the Prisma row in toAuthenticated(). Read in the trigger path to route runs.
1 parent fa2a9f7 commit 5ab883f

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
Add an optional `defaultWorkerGroupId` to the authenticated environment shape, enabling per-environment default region selection (falls back to the project, then global, default).

apps/webapp/app/models/runtimeEnvironment.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export function toAuthenticated(
6161
builtInEnvironmentVariableOverrides: env.builtInEnvironmentVariableOverrides,
6262
createdAt: env.createdAt,
6363
updatedAt: env.updatedAt,
64+
defaultWorkerGroupId: env.defaultWorkerGroupId,
6465
project: {
6566
id: env.project.id,
6667
slug: env.project.slug,

packages/core/src/v3/auth/environment.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ export type AuthenticatedEnvironment = {
5757
createdAt: Date;
5858
updatedAt: Date;
5959

60+
// Per-environment default region. Optional so plugins that don't set
61+
// it fall back to the project/global default. Read in the trigger hot
62+
// path (getWorkerQueue) to route runs.
63+
defaultWorkerGroupId?: string | null;
64+
6065
project: {
6166
id: string;
6267
slug: string;

0 commit comments

Comments
 (0)