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);