Skip to content

Commit da247bf

Browse files
committed
capture and pass the planType through to triggering
1 parent 1610766 commit da247bf

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

apps/webapp/app/runEngine/services/createBatch.server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ export class CreateBatchService extends WithRunEngine {
7171
throw entitlementValidation.error;
7272
}
7373

74+
// Extract plan type from entitlement validation for billing tracking
75+
const planType = entitlementValidation.plan?.type;
76+
7477
// Get batch limits for this organization
7578
const { config, rateLimiter } = await getBatchLimits(environment.organization);
7679

@@ -148,6 +151,7 @@ export class CreateBatchService extends WithRunEngine {
148151
realtimeStreamsVersion: options.realtimeStreamsVersion,
149152
idempotencyKey: body.idempotencyKey,
150153
processingConcurrency: config.processingConcurrency,
154+
planType,
151155
};
152156

153157
await this._engine.initializeBatch(initOptions);

apps/webapp/app/v3/runEngineHandlers.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ export function setupBatchQueueCallbacks() {
697697
batchIndex: itemIndex,
698698
skipChecks: true, // Already validated at batch level
699699
realtimeStreamsVersion: meta.realtimeStreamsVersion,
700+
planType: meta.planType,
700701
},
701702
"V2"
702703
);

internal-packages/run-engine/src/batch-queue/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ export const BatchMeta = z.object({
7676
idempotencyKey: z.string().optional(),
7777
/** Processing concurrency limit for this batch's environment */
7878
processingConcurrency: z.number().optional(),
79+
/** Plan type for billing (e.g., "free", "paid") - used when skipChecks is enabled */
80+
planType: z.string().optional(),
7981
});
8082
export type BatchMeta = z.infer<typeof BatchMeta>;
8183

@@ -161,6 +163,8 @@ export type InitializeBatchOptions = {
161163
idempotencyKey?: string;
162164
/** Processing concurrency limit for this batch's environment */
163165
processingConcurrency?: number;
166+
/** Plan type for billing (e.g., "free", "paid") - used when skipChecks is enabled */
167+
planType?: string;
164168
};
165169

166170
/**

0 commit comments

Comments
 (0)