mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Make external hooks type-safe, and add tests (#12893)
This commit is contained in:
committed by
GitHub
parent
3d27a14987
commit
05b5f95331
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user