{"record":{"id":"b7b221d2fdff52d9","repo":"flowable/flowable-engine","slug":"no-process-definition-found-for-key-processdefin-b7b221","errorCode":null,"errorMessage":"No process definition found for key '{processDefinitionKey}'. Fallback to default tenant was also applied.","messagePattern":"No process definition found for key '(.+?)'\\. Fallback to default tenant was also applied\\.","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AbstractProcessStartEventSubscriptionCmd.java","lineNumber":92,"sourceCode":"            }\n\n        } else if (processDefinitionKey != null && tenantId != null && !ProcessEngineConfiguration.NO_TENANT_ID.equals(tenantId)) {\n\n            processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);\n\n            if (processDefinition == null) {\n                ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n                if (processEngineConfiguration.isFallbackToDefaultTenant()) {\n                    String defaultTenant = processEngineConfiguration.getDefaultTenantProvider().getDefaultTenant(tenantId, ScopeTypes.BPMN, processDefinitionKey);\n                    if (StringUtils.isNotEmpty(defaultTenant)) {\n                        processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, defaultTenant);\n                        \n                    } else {\n                        processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKey(processDefinitionKey);\n                    }\n                    \n                    if (processDefinition == null) {\n                        throw new FlowableObjectNotFoundException(\"No process definition found for key '\" + processDefinitionKey +\n                            \"'. Fallback to default tenant was also applied.\", ProcessDefinition.class);\n                    }\n                    \n                } else {\n                    throw new FlowableObjectNotFoundException(\"Process definition with key '\" + processDefinitionKey +\n                        \"' and tenantId '\"+ tenantId +\"' was not found\", ProcessDefinition.class);\n                }\n            }\n\n        }\n        \n        if (processDefinition == null) {\n            throw new FlowableIllegalArgumentException(\"No deployed process definition found for key '\" + processDefinitionKey + \"'.\");\n        }\n        \n        return processDefinition;\n    }\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AbstractProcessStartEventSubscriptionCmd.java#L74-L110","documentation":"This FlowableObjectNotFoundException means the process definition key was not found even after falling back to the default tenant. getLatestProcessDefinitionByKey first tried the key with the given tenantId, then retried with findLatestProcessDefinitionByKey; both returned null.","triggerScenarios":"Calling a start-event subscription command with both processDefinitionKey and a specific tenantId where no definition exists for that tenant and none exists without a tenant either.","commonSituations":"Definitions deployed under a different tenant id than the one passed; multi-tenant deployment scripts skipped this tenant; tenantId casing mismatch.","solutions":["Deploy the process definition with the correct tenantId (deployment.tenantId(...))","Verify with repositoryService.createProcessDefinitionQuery().processDefinitionTenantId(tenantId, isEqual).list()","Correct the tenantId string passed to the API","Check the fallback: if the definition exists without tenant, pass NO_TENANT_ID instead"],"exampleFix":"// before\nrepositoryService.createDeployment().addClasspathResource(\"p.bpmn\").tenantId(\"tenantA\").deploy(); // but lookup uses \"tenant-a\"\n// after\nString tenantId = \"tenantA\"; // match deployment tenant exactly","handlingStrategy":"validation","validationCode":"boolean exists = !repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(key).processDefinitionTenantId(tenantId, true).list().isEmpty();\nif (!exists) throw new IllegalStateException(\"No definition for key=\" + key + \" tenant=\" + tenantId);","typeGuard":null,"tryCatchPattern":"try {\n    // tenant-scoped start\n} catch (FlowableObjectNotFoundException e) {\n    // fall back to default tenant lookup or surface a clear tenant mismatch message\n}","preventionTips":["Centralize tenant ids in one enum/config; never free-type tenant strings","Ensure deployments always set tenantId in multi-tenant apps","Log deployed key+tenant pairs on startup for troubleshooting"],"tags":["flowable","multi-tenant","process-definition","not-found"],"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-14T05:17:10.506Z"}