Report the environment type on a workflow run event (live or development)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user