refactor(core): Move all execution lifecycle telemetry events to lifecycle hooks (no-changelog) (#12816)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-01-28 13:45:30 +01:00
committed by GitHub
parent 49b8693d7c
commit 69a97bd32d
4 changed files with 273 additions and 245 deletions

View File

@@ -21,7 +21,6 @@ import { ActiveExecutions } from '@/active-executions';
import config from '@/config';
import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { ExecutionNotFoundError } from '@/errors/execution-not-found-error';
import { EventService } from '@/events/event.service';
import {
getWorkflowHooksMain,
getWorkflowHooksWorkerExecuter,
@@ -54,7 +53,6 @@ export class WorkflowRunner {
private readonly workflowStaticDataService: WorkflowStaticDataService,
private readonly nodeTypes: NodeTypes,
private readonly permissionChecker: PermissionChecker,
private readonly eventService: EventService,
private readonly instanceSettings: InstanceSettings,
private readonly manualExecutionService: ManualExecutionService,
) {}
@@ -169,7 +167,6 @@ export class WorkflowRunner {
await this.enqueueExecution(executionId, data, loadStaticData, realtime);
} else {
await this.runMainProcess(executionId, data, loadStaticData, restartExecutionId);
this.eventService.emit('workflow-pre-execute', { executionId, data });
}
// only run these when not in queue mode or when the execution is manual,
@@ -182,12 +179,6 @@ export class WorkflowRunner {
const postExecutePromise = this.activeExecutions.getPostExecutePromise(executionId);
postExecutePromise
.then(async (executionData) => {
this.eventService.emit('workflow-post-execute', {
workflow: data.workflowData,
executionId,
userId: data.userId,
runData: executionData,
});
if (this.externalHooks.exists('workflow.postExecute')) {
try {
await this.externalHooks.run('workflow.postExecute', [