From cf2b70aee9f110cdf626809f38be8fbafc44d9af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 1 Dec 2023 10:13:53 +0100 Subject: [PATCH] fix(core): Allow grace period for binary data deletion after manual execution (#7889) https://linear.app/n8n/issue/PAY-1079 --- packages/cli/src/WorkflowExecuteAdditionalData.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index 66cba7918f860..1eb95bfcf9191 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -430,10 +430,16 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks { const saveSettings = toSaveSettings(this.workflowData.settings); if (isManualMode && !saveSettings.manual && !fullRunData.waitTill) { - await Container.get(ExecutionRepository).hardDelete({ - workflowId: this.workflowData.id as string, - executionId: this.executionId, - }); + /** + * When manual executions are not being saved, we only soft-delete + * the execution so that the user can access its binary data + * while building their workflow. + * + * The manual execution and its binary data will be hard-deleted + * on the next pruning cycle after the grace period set by + * `EXECUTIONS_DATA_HARD_DELETE_BUFFER`. + */ + await Container.get(ExecutionRepository).softDelete(this.executionId); return; }