flowable/flowable-engine · error · FlowableException

Cannot complete case task. Parent process instance ${executi

Error message

Cannot complete case task. Parent process instance ${executionEntity} is suspended

What it means

CaseTaskActivityBehavior.triggerCaseTask runs when a case task completes and control returns to the process. Before mutating the execution it checks that neither the execution nor its process definition is suspended; otherwise it throws this FlowableException because a suspended process instance must not be driven forward by case completion.

Source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/CaseTaskActivityBehavior.java:165

        // not used
    }
    
    @Override
    public void completed(DelegateExecution execution) throws Exception {
        // not used
    }
    
    public void triggerCaseTaskAndLeave(DelegateExecution execution, Map<String, Object> variables) {
        triggerCaseTask(execution, variables);
        leave(execution);
    }

    public void triggerCaseTask(DelegateExecution execution, Map<String, Object> variables) {
        execution.setVariables(variables);
        ExecutionEntity executionEntity = (ExecutionEntity) execution;

        if (executionEntity.isSuspended() || ProcessDefinitionUtil.isProcessDefinitionSuspended(execution.getProcessDefinitionId())) {
            throw new FlowableException("Cannot complete case task. Parent process instance " + executionEntity + " is suspended");
        }

        // Set the reference id and type to null since the execution could be reused
        executionEntity.setReferenceId(null);
        executionEntity.setReferenceType(null);
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Reactivate the process instance: managementService.activateProcessInstanceById(processInstanceId) and re-trigger.
  2. Reactivate the definition with instances: managementService.activateProcessDefinitionById(definitionId, true, null).
  3. Avoid suspending definitions that have running case tasks; drain or complete linked cases first.
  4. Check suspension state before completing the case: ProcessDefinitionQuery(...).singleResult().isSuspended().

Example fix

// before: parent suspended, case completion fails
managementService.suspendProcessDefinitionById("proc:1:1", false, null);
// after
managementService.activateProcessDefinitionById("proc:1:1", true, null); // then complete the case task
Defensive patterns

Strategy: try-catch

Validate before calling

ProcessInstance pi = managementService.createProcessInstanceQuery().processInstanceId(parentId).singleResult();
if (pi != null && pi.isSuspended()) managementService.activateProcessInstanceById(parentId);

Try / catch

try { caseTask.complete(); }
catch (FlowableException e) { if (e.getMessage().contains("Parent process instance") && e.getMessage().contains("suspended")) { activateParentThenComplete(); } else { throw e; } }

Prevention

When it happens

Trigger: The case linked via a case service task finishes and triggerCaseTask is invoked while executionEntity.isSuspended() or the parent process definition is suspended (ProcessDefinitionUtil.isProcessDefinitionSuspended).

Common situations: Admin suspended the parent process definition (without activating instances) while its case instances were still running; the case completes during the suspension window and tries to trigger the waiting process execution.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/fd0fd5f480438059. Report an issue: GitHub.