From d628958905bccf85ef1c510315d38ab23f1613fc Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Wed, 19 Feb 2025 13:58:32 +0100 Subject: [PATCH] Remove status check when ending workflow (#10299) Should be possible to end workflow, not matter what the current status is. On failure before the workflow was started, this error prevent the workflow to be marked as failed with the right error message. --- .../workflow-run/workflow-run.workspace-service.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/twenty-server/src/modules/workflow/workflow-runner/workflow-run/workflow-run.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-runner/workflow-run/workflow-run.workspace-service.ts index f1eb0791c..0845db6be 100644 --- a/packages/twenty-server/src/modules/workflow/workflow-runner/workflow-run/workflow-run.workspace-service.ts +++ b/packages/twenty-server/src/modules/workflow/workflow-runner/workflow-run/workflow-run.workspace-service.ts @@ -113,13 +113,6 @@ export class WorkflowRunWorkspaceService { ); } - if (workflowRunToUpdate.status !== WorkflowRunStatus.RUNNING) { - throw new WorkflowRunException( - 'Workflow cannot be ended as it is not running', - WorkflowRunExceptionCode.INVALID_OPERATION, - ); - } - return workflowRunRepository.update(workflowRunToUpdate.id, { status, endedAt: new Date().toISOString(),