refactor(core): Refactor execution post-execute promises (no-changelog) (#10809)

Co-authored-by: Danny Martini <danny@n8n.io>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-09-23 12:08:57 +02:00
committed by GitHub
parent 521bbfeee5
commit 67fb6d6fdd
7 changed files with 65 additions and 94 deletions

View File

@@ -879,8 +879,7 @@ async function executeWorkflow(
fullExecutionData.workflowId = workflowData.id;
}
// remove execution from active executions
activeExecutions.remove(executionId, fullRunData);
activeExecutions.finalizeExecution(executionId, fullRunData);
await executionRepository.updateExistingExecution(executionId, fullExecutionData);
throw objectToError(
@@ -906,11 +905,11 @@ async function executeWorkflow(
if (data.finished === true || data.status === 'waiting') {
// Workflow did finish successfully
activeExecutions.remove(executionId, data);
activeExecutions.finalizeExecution(executionId, data);
const returnData = WorkflowHelpers.getDataLastExecutedNodeData(data);
return returnData!.data!.main;
}
activeExecutions.remove(executionId, data);
activeExecutions.finalizeExecution(executionId, data);
// Workflow did fail
const { error } = data.data.resultData;