Add executionId workflow.postExecute external hook (#2569)

Co-authored-by: Jan Oberhauser <janober@users.noreply.github.com>
This commit is contained in:
Vahid Sebto 2021-12-25 16:12:17 +03:30 committed by GitHub
parent 522de66583
commit 8f9dbb7163
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -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); void InternalHooksManager.getInstance().onWorkflowPostExecute(executionId, workflowData, data);
if (data.finished === true) { if (data.finished === true) {

View file

@ -186,7 +186,7 @@ export class WorkflowRunner {
if (externalHooks.exists('workflow.postExecute')) { if (externalHooks.exists('workflow.postExecute')) {
postExecutePromise postExecutePromise
.then(async (executionData) => { .then(async (executionData) => {
await externalHooks.run('workflow.postExecute', [executionData, data.workflowData]); await externalHooks.run('workflow.postExecute', [executionData, data.workflowData, executionId]);
}) })
.catch((error) => { .catch((error) => {
console.error('There was a problem running hook "workflow.postExecute"', error); console.error('There was a problem running hook "workflow.postExecute"', error);

View file

@ -268,7 +268,7 @@ export class WorkflowRunnerProcess {
this.childExecutions[executionId] = executeWorkflowFunctionOutput; this.childExecutions[executionId] = executeWorkflowFunctionOutput;
const { workflow } = executeWorkflowFunctionOutput; const { workflow } = executeWorkflowFunctionOutput;
result = await workflowExecute.processRunExecutionData(workflow); result = await workflowExecute.processRunExecutionData(workflow);
await externalHooks.run('workflow.postExecute', [result, workflowData]); await externalHooks.run('workflow.postExecute', [result, workflowData, executionId]);
void InternalHooksManager.getInstance().onWorkflowPostExecute( void InternalHooksManager.getInstance().onWorkflowPostExecute(
executionId, executionId,
workflowData, workflowData,