mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 21:07:28 -08:00
fix(core): Fix telemetry execution status for manual workflows executions (#5712)
fix telemetry execution status
This commit is contained in:
parent
f59b591c93
commit
a28396ee91
|
@ -284,6 +284,15 @@ export class InternalHooks implements IInternalHooksClass {
|
||||||
properties.user_id = userId;
|
properties.user_id = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let executionStatus: ExecutionStatus;
|
||||||
|
if (runData?.status === 'crashed') {
|
||||||
|
executionStatus = 'crashed';
|
||||||
|
} else if (runData?.status === 'waiting' || runData?.data?.waitTill) {
|
||||||
|
executionStatus = 'waiting';
|
||||||
|
} else {
|
||||||
|
executionStatus = properties.success ? 'success' : 'failed';
|
||||||
|
}
|
||||||
|
|
||||||
if (runData !== undefined) {
|
if (runData !== undefined) {
|
||||||
properties.execution_mode = runData.mode;
|
properties.execution_mode = runData.mode;
|
||||||
properties.success = !!runData.finished;
|
properties.success = !!runData.finished;
|
||||||
|
@ -342,7 +351,7 @@ export class InternalHooks implements IInternalHooksClass {
|
||||||
const manualExecEventProperties: ITelemetryTrackProperties = {
|
const manualExecEventProperties: ITelemetryTrackProperties = {
|
||||||
user_id: userId,
|
user_id: userId,
|
||||||
workflow_id: workflow.id,
|
workflow_id: workflow.id,
|
||||||
status: properties.success ? 'success' : 'failed',
|
status: executionStatus,
|
||||||
executionStatus: runData?.status ?? 'unknown',
|
executionStatus: runData?.status ?? 'unknown',
|
||||||
error_message: properties.error_message as string,
|
error_message: properties.error_message as string,
|
||||||
error_node_type: properties.error_node_type,
|
error_node_type: properties.error_node_type,
|
||||||
|
@ -392,15 +401,6 @@ export class InternalHooks implements IInternalHooksClass {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let executionStatus: ExecutionStatus;
|
|
||||||
if (runData?.status === 'crashed') {
|
|
||||||
executionStatus = 'crashed';
|
|
||||||
} else if (runData?.status === 'waiting' || runData?.data?.waitTill) {
|
|
||||||
executionStatus = 'waiting';
|
|
||||||
} else {
|
|
||||||
executionStatus = properties.success ? 'success' : 'failed';
|
|
||||||
}
|
|
||||||
|
|
||||||
promises.push(
|
promises.push(
|
||||||
Db.collections.Execution.update(executionId, {
|
Db.collections.Execution.update(executionId, {
|
||||||
status: executionStatus,
|
status: executionStatus,
|
||||||
|
|
Loading…
Reference in a new issue