{"record":{"id":"0a767daf97d8a32c","repo":"flowable/flowable-engine","slug":"process-definition-processdefinitionkey-was-not","errorCode":null,"errorMessage":"Process definition ${processDefinitionKey} was not found in sameDeployment[${isSameDeployment}] tenantId[${tenantId}] fallbackToDefaultTenant[${this.fallbackToDefaultTenant}]","messagePattern":"Process definition (.+?) was not found in sameDeployment\\[(.+?)\\] tenantId\\[(.+?)\\] fallbackToDefaultTenant\\[(.+?)\\]","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/CallActivityBehavior.java","lineNumber":329,"sourceCode":"\n        if (tenantId == null || ProcessEngineConfiguration.NO_TENANT_ID.equals(tenantId)) {\n            processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKey(processDefinitionKey);\n        } else {\n            processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);\n            if (processDefinition == null && ((this.fallbackToDefaultTenant != null && this.fallbackToDefaultTenant) || processEngineConfiguration.isFallbackToDefaultTenant())) {\n\n                String defaultTenant = processEngineConfiguration.getDefaultTenantProvider().getDefaultTenant(tenantId, ScopeTypes.BPMN, processDefinitionKey);\n                if (StringUtils.isNotEmpty(defaultTenant)) {\n                    processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKeyAndTenantId(\n                                    processDefinitionKey, defaultTenant);\n                } else {\n                    processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKey(processDefinitionKey);\n                }\n            }\n        }\n\n        if (processDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Process definition \" + processDefinitionKey + \" was not found in sameDeployment[\"+ isSameDeployment +\n                \"] tenantId[\"+ tenantId+ \"] fallbackToDefaultTenant[\"+ this.fallbackToDefaultTenant + \"]\");\n        }\n        return processDefinition;\n    }\n\n    protected String getCalledElementValue(DelegateExecution execution, ProcessEngineConfigurationImpl processEngineConfiguration) {\n        String calledElementValue = callActivity.getCalledElement();\n        if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()){\n            ObjectNode taskElementProperties = BpmnOverrideContext\n                    .getBpmnOverrideElementProperties(callActivity.getId(), execution.getProcessDefinitionId());\n            calledElementValue = getActiveValue(callActivity.getCalledElement(), DynamicBpmnConstants.CALL_ACTIVITY_CALLED_ELEMENT, taskElementProperties);\n        }\n        if (StringUtils.isNotEmpty(calledElementValue) && calledElementValue.matches(EXPRESSION_REGEX)) {\n            calledElementValue = (String) processEngineConfiguration.getExpressionManager().createExpression(calledElementValue).getValue(execution);\n        }\n        return calledElementValue;\n    }\n","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/CallActivityBehavior.java#L311-L347","documentation":"CallActivityBehavior.getProcessDefinitionByKey resolves the called process by key, honoring sameDeployment, tenantId and fallbackToDefaultTenant. If no matching deployed process definition is found under those constraints, it throws FlowableObjectNotFoundException detailing all the resolution parameters. This is the standard 'called process not deployed (or not visible to this tenant)' error.","triggerScenarios":"A call activity with calledElementType=key executes and: the key is not deployed at all; sameDeployment=true and the key isn't in the same deployment; the process is deployed under a different tenantId and fallbackToDefaultTenant=false.","commonSituations":"Sub process forgotten from the deployment BAR file; tenant-aware deployments where the tenant's deployment lacks the subprocess; sameDeployment=true combined with separately versioned subprocess deployments; key typos or renamed process keys.","solutions":["Deploy the process with the missing key (include its BPMN XML in the parent's BAR or deploy it separately for the same tenant).","Set fallbackToDefaultTenant=true on the call activity if a tenantless default deployment of the subprocess should be used.","Check what exists: repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).processDefinitionTenantId(tenantId).list() and align tenantId/sameDeployment.","If versioning independently, set sameDeployment=false so the latest definition by key across deployments is used.","Fix typos in the calledElement key."],"exampleFix":"// before: tenant 'acme' cannot see subprocess deployed without tenant, fallback disabled\n<callActivity id=\"c\" calledElement=\"subProcess\" flowable:fallbackToDefaultTenant=\"false\"/>\n// after\n<callActivity id=\"c\" calledElement=\"subProcess\" flowable:fallbackToDefaultTenant=\"true\"/>","handlingStrategy":"validation","validationCode":"ProcessDefinition def = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(\"subProcess\")\n    .processDefinitionTenantId(tenantId)\n    .latestVersion().singleResult();\nif (def == null) throw new IllegalStateException(\"Deploy subprocess for tenant \" + tenantId + \" before starting parent\");","typeGuard":null,"tryCatchPattern":"try { startParent(); }\ncatch (FlowableObjectNotFoundException e) { if (e.getMessage().contains(\"Process definition\")) { deployMissingSubProcess(); } else { throw e; } }","preventionTips":["Package subprocess BPMN in the same BAR as the caller when using sameDeployment.","Enable fallbackToDefaultTenant for shared subprocess deployments.","Query definitions per tenant in deployment smoke tests.","Grep call activities and assert each calledElement key is deployed."],"tags":["flowable","call-activity","process-definition","tenant","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}