From b879755f0b53183e65001c727f93a390db8a44b2 Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Thu, 18 Mar 2021 23:24:57 +0100 Subject: [PATCH] :bug: Fix issues with subworkflows not finishing (#1553) --- packages/cli/src/WorkflowRunnerProcess.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/WorkflowRunnerProcess.ts b/packages/cli/src/WorkflowRunnerProcess.ts index f5305e29e8..70c140a7e3 100644 --- a/packages/cli/src/WorkflowRunnerProcess.ts +++ b/packages/cli/src/WorkflowRunnerProcess.ts @@ -121,7 +121,15 @@ export class WorkflowRunnerProcess { resolve(executionId); }; }); - const result: IRun = await executeWorkflowFunction(workflowInfo, additionalData, inputData, executionId, workflowData, runData); + let result: IRun; + try { + result = await executeWorkflowFunction(workflowInfo, additionalData, inputData, executionId, workflowData, runData); + } catch (e) { + await sendToParentProcess('finishExecution', { executionId }); + // Throw same error we had + throw e; + } + await sendToParentProcess('finishExecution', { executionId, result }); const returnData = WorkflowHelpers.getDataLastExecutedNodeData(result);