From 8f9dbb7163420eadcce77b2b4e14d6321898b1db Mon Sep 17 00:00:00 2001 From: Vahid Sebto Date: Sat, 25 Dec 2021 16:12:17 +0330 Subject: [PATCH] :zap: Add executionId workflow.postExecute external hook (#2569) Co-authored-by: Jan Oberhauser --- packages/cli/src/WorkflowExecuteAdditionalData.ts | 2 +- packages/cli/src/WorkflowRunner.ts | 2 +- packages/cli/src/WorkflowRunnerProcess.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index 4a0b88594d..0faada56f1 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -918,7 +918,7 @@ export async function executeWorkflow( }; } - await externalHooks.run('workflow.postExecute', [data, workflowData]); + await externalHooks.run('workflow.postExecute', [data, workflowData, executionId]); void InternalHooksManager.getInstance().onWorkflowPostExecute(executionId, workflowData, data); if (data.finished === true) { diff --git a/packages/cli/src/WorkflowRunner.ts b/packages/cli/src/WorkflowRunner.ts index 5e8f29442a..629acc70fa 100644 --- a/packages/cli/src/WorkflowRunner.ts +++ b/packages/cli/src/WorkflowRunner.ts @@ -186,7 +186,7 @@ export class WorkflowRunner { if (externalHooks.exists('workflow.postExecute')) { postExecutePromise .then(async (executionData) => { - await externalHooks.run('workflow.postExecute', [executionData, data.workflowData]); + await externalHooks.run('workflow.postExecute', [executionData, data.workflowData, executionId]); }) .catch((error) => { console.error('There was a problem running hook "workflow.postExecute"', error); diff --git a/packages/cli/src/WorkflowRunnerProcess.ts b/packages/cli/src/WorkflowRunnerProcess.ts index 698bc4a3f4..7e70b28e66 100644 --- a/packages/cli/src/WorkflowRunnerProcess.ts +++ b/packages/cli/src/WorkflowRunnerProcess.ts @@ -268,7 +268,7 @@ export class WorkflowRunnerProcess { this.childExecutions[executionId] = executeWorkflowFunctionOutput; const { workflow } = executeWorkflowFunctionOutput; result = await workflowExecute.processRunExecutionData(workflow); - await externalHooks.run('workflow.postExecute', [result, workflowData]); + await externalHooks.run('workflow.postExecute', [result, workflowData, executionId]); void InternalHooksManager.getInstance().onWorkflowPostExecute( executionId, workflowData,