diff --git a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java index f40a32297..77d5ec1b3 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java @@ -630,7 +630,6 @@ public WorkflowModel terminateWorkflow( String workflowId = workflow.getWorkflowId(); workflow.setReasonForIncompletion(reason); executionDAOFacade.updateWorkflow(workflow); - workflowStatusListener.onWorkflowTerminatedIfEnabled(workflow); Monitors.recordWorkflowTermination( workflow.getWorkflowName(), workflow.getStatus(), workflow.getOwnerApp()); LOGGER.info("Workflow {} is terminated because of {}", workflowId, reason); @@ -697,6 +696,7 @@ public WorkflowModel terminateWorkflow( workflow.getWorkflowName(), workflow.getWorkflowId()); List erroredTasks = cancelNonTerminalTasks(workflow); + workflowStatusListener.onWorkflowTerminatedIfEnabled(workflow); if (!erroredTasks.isEmpty()) { throw new NonTransientException( String.format(