{"record":{"id":"b0c0859838d6743a","repo":"flowable/flowable-engine","slug":"cannot-start-a-sub-process-instance-process-model-b0c085","errorCode":null,"errorMessage":"Cannot start a sub process instance. Process model \" + subProcessDefinition.getName() + \" (id = \" + subProcessDefinition.getId() + \") could not be found","messagePattern":"Cannot start a sub process instance\\. Process model \" \\+ subProcessDefinition\\.getName\\(\\) \\+ \" \\(id = \" \\+ subProcessDefinition\\.getId\\(\\) \\+ \"\\) could not be found","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/dynamic/AbstractDynamicStateManager.java","lineNumber":1091,"sourceCode":"            childExecutionEntity.setScope(false);\n\n            CommandContextUtil.getProcessEngineConfiguration().getActivityInstanceEntityManager().recordActivityStart(childExecutionEntity);\n\n            ActivityBehavior boundaryEventBehavior = ((ActivityBehavior) boundaryEvent.getBehavior());\n            LOGGER.debug(\"Executing boundary event activityBehavior {} with execution {}\", boundaryEventBehavior.getClass(), childExecutionEntity.getId());\n            boundaryEventBehavior.execute(childExecutionEntity);\n        }\n    }\n\n    protected ExecutionEntity createCallActivityInstance(CallActivity callActivity, ProcessDefinition subProcessDefinition, ExecutionEntity parentExecution, String initialActivityId, CommandContext commandContext) {\n\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n        ExpressionManager expressionManager = processEngineConfiguration.getExpressionManager();\n        ExecutionEntityManager executionEntityManager = processEngineConfiguration.getExecutionEntityManager();\n\n        Process subProcess = ProcessDefinitionUtil.getProcess(subProcessDefinition.getId());\n        if (subProcess == null) {\n            throw new FlowableException(\"Cannot start a sub process instance. Process model \" + subProcessDefinition.getName() + \" (id = \" + subProcessDefinition.getId() + \") could not be found\");\n        }\n\n        String businessKey = null;\n\n        if (!StringUtils.isEmpty(callActivity.getBusinessKey())) {\n            Expression expression = expressionManager.createExpression(callActivity.getBusinessKey());\n            businessKey = expression.getValue(parentExecution).toString();\n\n        } else if (callActivity.isInheritBusinessKey()) {\n            ExecutionEntity processInstance = executionEntityManager.findById(parentExecution.getProcessInstanceId());\n            businessKey = processInstance.getBusinessKey();\n        }\n\n        ExecutionEntity subProcessInstance = executionEntityManager.createSubprocessInstance(subProcessDefinition, parentExecution, businessKey, initialActivityId);\n        if (processEngineConfiguration.isEnableEntityLinks()) {\n            EntityLinkUtil.createEntityLinks(parentExecution.getProcessInstanceId(), parentExecution.getId(), callActivity.getId(),\n                    subProcessInstance.getId(), ScopeTypes.BPMN);\n        }","sourceCodeStart":1073,"sourceCodeEnd":1109,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/dynamic/AbstractDynamicStateManager.java#L1073-L1109","documentation":"Thrown when starting a sub process instance for a CallActivity during process instance migration: ProcessDefinitionUtil.getProcess() returned null for the target sub process definition, meaning the BPMN model for that definition could not be resolved from the repository. The engine cannot build the sub process instance without its model, so it fails fast.","triggerScenarios":"Migrating (or changing) a process instance whose new definition contains a CallActivity while the called sub process definition cannot be resolved — the model was not deployed, the definition is in another tenant/app engine, or the deployment cache/repository is inconsistent.","commonSituations":"Missing deployment of the called process in the target definition's deployment; multi-tenant setups where the call activity does not resolve the tenant-specific sub process; referencing a sub process definition that was deleted or deployed to a different Flowable app engine.","solutions":["Deploy the BPMN file containing the called sub process so a resolvable definition exists for the call activity","Verify the CallActivity 'called element' key matches the sub process process id (and tenant handling) in the new definition","Check ACT_RE_PROCDEF for the sub process definition id; redeploy if the definition row exists but the model can't be parsed","Clear/refresh the deployment cache or restart the engine if the repository and cache are out of sync"],"exampleFix":"// before (target def references 'orderSubProcess' never deployed)\nmigrationBuilder.migrateTo(newDefId);\n// after: deploy the sub process first\nrepositoryService.createDeployment().addClasspathResource(\"orderSubProcess.bpmn20.xml\").tenantId(tenant).deploy();\nmigrationBuilder.migrateTo(newDefId);","handlingStrategy":"validation","validationCode":"ProcessDefinition def = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(calledElement).latestVersion().singleResult();\nif (def == null) throw new IllegalStateException(\"Deploy called sub process before migrating: \" + calledElement);","typeGuard":null,"tryCatchPattern":"try {\n    migrationBuilder.migrateTo(newDefId);\n} catch (FlowableException ex) {\n    if (ex.getMessage().contains(\"could not be found\")) {\n        // deploy missing sub process model and retry\n    } else throw ex;\n}","preventionTips":["Deploy all called sub processes together with the parent definition","Verify CallActivity calledElement keys and tenant resolution after model changes","Check ACT_RE_PROCDEF for definitions of every called element","Keep repository and deployment cache consistent (redeploy after deletes)"],"tags":["call-activity","deployment","process-migration","flowable"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}