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

@@ -179,18 +179,13 @@ export class WorkflowRunner {
const postExecutePromise = this.activeExecutions.getPostExecutePromise(executionId);
postExecutePromise
.then(async (executionData) => {
if (this.externalHooks.exists('workflow.postExecute')) {
try {
await this.externalHooks.run('workflow.postExecute', [
executionData,
data.workflowData,
executionId,
]);
} catch (error) {
this.errorReporter.error(error);
this.logger.error('There was a problem running hook "workflow.postExecute"', error);
}
}
try {
await this.externalHooks.run('workflow.postExecute', [
executionData,
data.workflowData,
executionId,
]);
} catch {}
})
.catch((error) => {
if (error instanceof ExecutionCancelledError) return;