{"record":{"id":"8c2550d0ab6edef7","repo":"flowable/flowable-engine","slug":"cannot-complete-process-instance-parent-process-i","errorCode":null,"errorMessage":"Cannot complete process instance. Parent process instance ${executionEntity} is suspended","messagePattern":"Cannot complete process instance\\. Parent process instance (.+?) is suspended","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/CallActivityBehavior.java","lineNumber":281,"sourceCode":"            BiConsumer<String, Object> variableConsumer = (variableName, value) -> {\n                if (callActivity.isUseLocalScopeForOutParameters()) {\n                    executionEntity.setVariableLocal(variableName, value);\n                } else {\n                    executionEntity.setVariable(variableName, value);\n                }\n            };\n\n            IOParameterUtil.processOutParameters(outParameters, subProcessInstance, variableConsumer, variableConsumer, expressionManager);\n        }\n    }\n\n    @Override\n    public void completed(DelegateExecution execution) throws Exception {\n        // only control flow. no sub process instance data available\n\n        ExecutionEntity executionEntity = (ExecutionEntity) execution;\n        if (executionEntity.isSuspended() || ProcessDefinitionUtil.isProcessDefinitionSuspended(execution.getProcessDefinitionId())) {\n            throw new FlowableException(\"Cannot complete process instance. Parent process instance \" + executionEntity + \" is suspended\");\n        }\n\n        leave(execution);\n    }\n\n    protected ProcessDefinition getProcessDefinitionById(DelegateExecution execution, ProcessEngineConfigurationImpl processEngineConfiguration) {\n        return CommandContextUtil.getProcessEngineConfiguration().getDeploymentManager()\n            .findDeployedProcessDefinitionById(getCalledElementValue(execution, processEngineConfiguration));\n    }\n\n    protected ProcessDefinition getProcessDefinitionByKey(DelegateExecution execution, boolean isSameDeployment, ProcessEngineConfigurationImpl processEngineConfiguration) {\n        String processDefinitionKey = getCalledElementValue(execution, processEngineConfiguration);\n        String tenantId = execution.getTenantId();\n\n        ProcessDefinitionEntityManager processDefinitionEntityManager = Context.getProcessEngineConfiguration().getProcessDefinitionEntityManager();\n        ProcessDefinitionEntity processDefinition;\n\n        if (isSameDeployment) {","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/CallActivityBehavior.java#L263-L299","documentation":"When the sub process instance started by a call activity finishes, CallActivityBehavior.completed resumes the parent execution — but only if the parent process instance and its process definition are not suspended. If either is suspended, control flow cannot continue and this FlowableException is thrown.","triggerScenarios":"A sub process instance completes while its parent execution (executionEntity.isSuspended()) or the parent's process definition (ProcessDefinitionUtil.isProcessDefinitionSuspended) is in suspended state.","commonSituations":"Administrator suspended the parent process definition (suspendProcessDefinitionById without activateProcessInstances) while child sub instances were still running; those children finish during the suspension window and try to return control.","solutions":["Reactivate the parent: managementService.activateProcessDefinitionById(parentDefinitionId, true, null) so suspended parent instances resume.","Reactivate the specific suspended execution: managementService.activateProcessInstanceById(parentInstanceId).","Avoid suspending definitions with live call-activity children; drain sub instances before suspending or use activateProcessInstances=true consistently.","Monitor for stuck child instances before ending a maintenance window."],"exampleFix":"// before: parent definition suspended while child still running\nmanagementService.suspendProcessDefinitionById(\"parent:1:1\", false, null);\n// after: keep instances activatable or reactivate before children complete\nmanagementService.activateProcessDefinitionById(\"parent:1:1\", true, null);","handlingStrategy":"try-catch","validationCode":"if (managementService.createProcessInstanceQuery().processInstanceId(parentId).singleResult().isSuspended()) {\n    managementService.activateProcessInstanceById(parentId);\n}","typeGuard":null,"tryCatchPattern":"try { caseOrSubComplete(); }\ncatch (FlowableException e) { if (e.getMessage().contains(\"Parent process instance\") && e.getMessage().contains(\"suspended\")) { activateParentThenRetry(); } else { throw e; } }","preventionTips":["Suspend definitions with activateProcessInstances=true so live parents can still finish.","Drain running call-activity children before suspending.","Alert on suspended instances with active children.","Schedule suspensions outside expected child completion times."],"tags":["flowable","call-activity","suspended","lifecycle"],"backgroundTag":"invalid-state-transition","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}