diff --git a/apps/webapp/app/services/analytics.server.ts b/apps/webapp/app/services/analytics.server.ts index 92a7da25913..3ab8c14784f 100644 --- a/apps/webapp/app/services/analytics.server.ts +++ b/apps/webapp/app/services/analytics.server.ts @@ -151,12 +151,14 @@ class BehaviouralAnalytics { organizationId, workflowId, workflowRun, + environmentType, runCount, }: { userId: string; organizationId: string; workflowId: string; workflowRun: WorkflowRun; + environmentType: string; runCount: number; }) => { if (this.client === undefined) return; @@ -167,6 +169,7 @@ class BehaviouralAnalytics { id: workflowRun.id, workflowId: workflowRun.workflowId, environmentId: workflowRun.environmentId, + environmentType, eventRuleId: workflowRun.eventRuleId, eventId: workflowRun.eventId, error: workflowRun.error, diff --git a/apps/webapp/app/services/analyticsEvents/workflowRunCreated.server.ts b/apps/webapp/app/services/analyticsEvents/workflowRunCreated.server.ts index ff4ce200dc1..1e34f27fd8d 100644 --- a/apps/webapp/app/services/analyticsEvents/workflowRunCreated.server.ts +++ b/apps/webapp/app/services/analyticsEvents/workflowRunCreated.server.ts @@ -13,6 +13,9 @@ export class WorkflowRunCreatedEvent { const workflowRun = await this.#prismaClient.workflowRun.findUnique({ where: { id }, include: { + environment: { + select: { slug: true }, + }, workflow: { select: { id: true, @@ -62,6 +65,7 @@ export class WorkflowRunCreatedEvent { userId: user.id, organizationId: workflowRun.workflow.organization.id, workflowId: workflowRun.workflow.id, + environmentType: workflowRun.environment.slug, runCount, }); });