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

@@ -187,7 +187,6 @@ async function startExecution(
const nodeTypes = Container.get(NodeTypes);
const activeExecutions = Container.get(ActiveExecutions);
const eventService = Container.get(EventService);
const executionRepository = Container.get(ExecutionRepository);
const workflowName = workflowData ? workflowData.name : undefined;
@@ -209,8 +208,6 @@ async function startExecution(
*/
await executionRepository.setRunning(executionId);
Container.get(EventService).emit('workflow-pre-execute', { executionId, data: runData });
let data;
try {
await Container.get(PermissionChecker).check(workflowData.id, workflowData.nodes);
@@ -228,6 +225,7 @@ async function startExecution(
runData.executionMode,
executionId,
workflowData,
additionalData.userId,
);
additionalDataIntegrated.executionId = executionId;
additionalDataIntegrated.parentCallbackManager = options.parentCallbackManager;
@@ -310,13 +308,6 @@ async function startExecution(
await externalHooks.run('workflow.postExecute', [data, workflowData, executionId]);
eventService.emit('workflow-post-execute', {
workflow: workflowData,
executionId,
userId: additionalData.userId,
runData: data,
});
// subworkflow either finished, or is in status waiting due to a wait node, both cases are considered successes here
if (data.finished === true || data.status === 'waiting') {
// Workflow did finish successfully