refactor(core): Make external hooks type-safe, and add tests (#12893)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-01-29 10:33:39 +01:00
committed by GitHub
parent 3d27a14987
commit 05b5f95331
17 changed files with 289 additions and 150 deletions

View File

@@ -182,9 +182,6 @@ async function startExecution(
runData: IWorkflowExecutionDataProcess,
workflowData: IWorkflowBase,
): Promise<ExecuteWorkflowData> {
const externalHooks = Container.get(ExternalHooks);
await externalHooks.init();
const nodeTypes = Container.get(NodeTypes);
const activeExecutions = Container.get(ActiveExecutions);
const executionRepository = Container.get(ExecutionRepository);
@@ -306,6 +303,7 @@ async function startExecution(
);
}
const externalHooks = Container.get(ExternalHooks);
await externalHooks.run('workflow.postExecute', [data, workflowData, executionId]);
// subworkflow either finished, or is in status waiting due to a wait node, both cases are considered successes here