{"record":{"id":"b621e329884eaa26","repo":"flowable/flowable-engine","slug":"no-processes-deployed-with-key-processdefinition","errorCode":null,"errorMessage":"no processes deployed with key '<processDefinitionKey>'","messagePattern":"no processes deployed with key '<processDefinitionKey>'","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java","lineNumber":150,"sourceCode":"                }\n            }\n\n            // Convert the bpmn 2.0 xml to a bpmn model\n            BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();\n            bpmnModel = bpmnXMLConverter.convertToBpmnModel(new BytesStreamSource(resource.getBytes()), false, false);\n            bpmnModelCache.add(processDefinition.getId(), bpmnModel);\n        }\n        return bpmnModel;\n    }\n\n    public ProcessDefinition findDeployedLatestProcessDefinitionByKey(String processDefinitionKey) {\n        ProcessDefinition processDefinition = Context\n                .getCommandContext()\n                .getProcessDefinitionEntityManager()\n                .findLatestProcessDefinitionByKey(processDefinitionKey);\n\n        if (processDefinition == null) {\n            throw new ActivitiObjectNotFoundException(\"no processes deployed with key '\" + processDefinitionKey + \"'\", ProcessDefinition.class);\n        }\n        processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();\n        return processDefinition;\n    }\n\n    public ProcessDefinition findDeployedLatestProcessDefinitionByKeyAndTenantId(String processDefinitionKey, String tenantId) {\n        ProcessDefinition processDefinition = Context\n                .getCommandContext()\n                .getProcessDefinitionEntityManager()\n                .findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);\n        if (processDefinition == null) {\n            throw new ActivitiObjectNotFoundException(\"no processes deployed with key '\" + processDefinitionKey + \"' for tenant identifier '\" + tenantId + \"'\", ProcessDefinition.class);\n        }\n        processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();\n        return processDefinition;\n    }\n\n    public ProcessDefinition findDeployedProcessDefinitionByKeyAndVersion(String processDefinitionKey, Integer processDefinitionVersion) {","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java#L132-L168","documentation":"ActivitiObjectNotFoundException thrown by DeploymentManager.findDeployedLatestProcessDefinitionByKey when no process definition with the given key is deployed. The entity manager's findLatestProcessDefinitionByKey returns null and the manager converts it into this descriptive error. It means the workflow key being referenced has no deployed (latest) version in this engine.","triggerScenarios":"Calling RuntimeService.startProcessInstanceByKey(key) or RepositoryService...latestProcessDefinitionByKey where the key was never deployed, was misspelled, or all deployments with that key were deleted.","commonSituations":"Typos in the key vs the id attribute in the BPMN XML, deploying to a test engine but running against production, or deleting a deployment removes the only version of the process.","solutions":["Deploy the BPMN process with that key before starting instances: repositoryService.createDeployment().addClasspathResource(...).deploy()","Check the key: it must match the id attribute of the <process> element in the BPMN XML","Verify with repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).count() > 0","Confirm you are connected to the correct database/tenant where the process is deployed"],"exampleFix":"// before\nruntimeService.startProcessInstanceByKey(\"OrderProcess\"); // key never deployed\n// after\nif (repositoryService.createProcessDefinitionQuery().processDefinitionKey(\"OrderProcess\").count() > 0) {\n    runtimeService.startProcessInstanceByKey(\"OrderProcess\");\n} else {\n    repositoryService.createDeployment().addClasspathResource(\"order-process.bpmn20.xml\").deploy();\n}","handlingStrategy":"validation","validationCode":"if (repositoryService.createProcessDefinitionQuery()\n        .processDefinitionKey(key).latestVersion().count() == 0) {\n    throw new IllegalStateException(\"No deployed process with key: \" + key);\n}","typeGuard":null,"tryCatchPattern":"try {\n    return runtimeService.startProcessInstanceByKey(key);\n} catch (ActivitiObjectNotFoundException e) {\n    // deploy the process or route to a dead-letter handler\n}","preventionTips":["Match the start key to the <process id=\"...\"> attribute exactly","Add deployment steps to environment bootstrap so keys always exist","Verify which database your engine config points to"],"tags":["process-definition","not-found","deployment","workflow"],"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-14T11:17:12.474Z"}