{"record":{"id":"7be0a60309b82df4","repo":"flowable/flowable-engine","slug":"no-deployed-process-definition-found-for-key-pro","errorCode":null,"errorMessage":"No deployed process definition found for key '{processDefinitionKey}'.","messagePattern":"No deployed process definition found for key '(.+?)'\\.","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AbstractProcessStartEventSubscriptionCmd.java","lineNumber":105,"sourceCode":"                    } 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\n    protected ProcessDefinition getProcessDefinitionById(String processDefinitionId, CommandContext commandContext) {\n        RepositoryService repositoryService = CommandContextUtil.getProcessEngineConfiguration(commandContext).getRepositoryService();\n\n        ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()\n            .processDefinitionId(processDefinitionId)\n            .singleResult();\n\n        if (processDefinition == null) {\n            throw new FlowableIllegalArgumentException(\"No deployed process definition found for id '\" + processDefinitionId + \"'.\");\n        }\n        return processDefinition;\n    }\n","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AbstractProcessStartEventSubscriptionCmd.java#L87-L123","documentation":"This FlowableIllegalArgumentException is a terminal guard in getLatestProcessDefinitionByKey: after all key/tenant lookup branches, processDefinition is still null, meaning no deployed definition exists for the key at all (e.g. processDefinitionKey was non-null but the entity manager returned nothing through any branch).","triggerScenarios":"Any invocation of the command where the key-based resolution paths all returned null — effectively no definition deployed for that key regardless of tenant handling.","commonSituations":"Engine connected to a database from a different environment; deployment rolled back; key mismatch between BPMN process id and the string used in code.","solutions":["Deploy the process definition and confirm it appears in ACT_RE_PROCDEF","Cross-check the key with repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).count()","Point the engine at the correct database (jdbc url / schema) for the environment that has the deployment"],"exampleFix":"// before\n// assume 'invoice' deployed but DB is dev, deployment was in prod\nProcessDefinition pd = ...; // throws\n// after\nrepositoryService.createDeployment().addClasspathResource(\"invoice.bpmn20.xml\").deploy();","handlingStrategy":"validation","validationCode":"if (repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).count() == 0) {\n    throw new IllegalStateException(\"Definition not deployed: \" + key);\n}","typeGuard":null,"tryCatchPattern":"try {\n    // operation by key\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"No deployed process definition\")) {\n        // trigger deployment or fail fast with actionable message\n    }\n}","preventionTips":["Run engine on the database matching the environment that holds deployments","Auto-deploy on startup (flowable auto-deploy) and verify","Keep keys synchronized between BPMN process id and code constants"],"tags":["flowable","process-definition","deployment","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"}