{"record":{"id":"948bd9037e11ba59","repo":"Activiti/Activiti","slug":"no-deployed-process-definition-found-with-id","errorCode":null,"errorMessage":"no deployed process definition found with id '","messagePattern":"no deployed process definition found with id '","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java","lineNumber":79,"sourceCode":"    public void deploy(DeploymentEntity deployment, Map<String, Object> deploymentSettings) {\n        for (Deployer deployer : deployers) {\n            deployer.deploy(deployment, deploymentSettings);\n        }\n    }\n\n    public ProcessDefinition findDeployedProcessDefinitionById(String processDefinitionId) {\n        if (processDefinitionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid process definition id : null\");\n        }\n\n        // first try the cache\n        ProcessDefinitionCacheEntry cacheEntry = processDefinitionCache.get(processDefinitionId);\n        ProcessDefinition processDefinition = cacheEntry != null ? cacheEntry.getProcessDefinition() : null;\n\n        if (processDefinition == null) {\n            processDefinition = processDefinitionEntityManager.findById(processDefinitionId);\n            if (processDefinition == null) {\n                throw new ActivitiObjectNotFoundException(\n                    \"no deployed process definition found with id '\" + processDefinitionId + \"'\",\n                    ProcessDefinition.class\n                );\n            }\n            processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();\n        }\n        return processDefinition;\n    }\n\n    public ProcessDefinition findDeployedLatestProcessDefinitionByKey(String processDefinitionKey) {\n        ProcessDefinition processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKey(\n            processDefinitionKey\n        );\n\n        if (processDefinition == null) {\n            throw new ActivitiObjectNotFoundException(\n                \"no processes deployed with key '\" + processDefinitionKey + \"'\",\n                ProcessDefinition.class","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/Activiti/Activiti/blob/56435b1a97deeafdc09dd40074b056c89fba5a8a/activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java#L61-L97","documentation":"DeploymentManager.findDeployedProcessDefinitionById throws ActivitiObjectNotFoundException when neither the process definition cache nor the process definition entity manager can resolve the given id. This means the id is well-formed and non-null but no deployed process definition with that id exists in this engine's database. The ProcessDefinition.class is attached as the missing entity reference.","triggerScenarios":"Calling repositoryService.getProcessDefinition(id)/startProcessInstanceById(id)/runtime lookups with an id from a different database or engine; using an id deleted by a cascading deployment delete; an id string with wrong casing or whitespace.","commonSituations":"Copying process definition ids between dev/staging databases; running multiple engine instances against different schemas and mixing ids; cleanup jobs that removed old deployments while external systems still reference their ids.","solutions":["Verify the id exists via repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult() before use","Re-obtain the id from the current database instead of hardcoding it (list latest definitions by key)","Check you are connected to the correct database/engine (JDBC URL, schema)","If the deployment was deleted, redeploy the process definition or restore from a backup"],"exampleFix":"// before\nProcessDefinition pd = repositoryService.getProcessDefinition(savedId); // may be gone\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n  .processDefinitionId(savedId).singleResult();\nif (pd == null) {\n  pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(key).latestVersion().singleResult();\n}","handlingStrategy":"try-catch","validationCode":"// Java, check existence first\nlong n = repositoryService.createProcessDefinitionQuery()\n  .processDefinitionId(id).count();\nif (n == 0) throw new IllegalStateException(\"unknown process definition id: \" + id);","typeGuard":null,"tryCatchPattern":"// Java\ntry {\n  runtimeService.startProcessInstanceById(defId);\n} catch (ActivitiObjectNotFoundException e) {\n  if (ProcessDefinition.class.equals(e.getObjectClass())) {\n    // fall back to latest definition by key\n    return startByKey(fallbackKey);\n  }\n  throw e;\n}","preventionTips":["Never hardcode definition ids; resolve them from the same database at runtime","Confirm dev/staging/prod point at the intended database before using copied ids","Beware cascading deployment deletes referenced by external systems; prefer suspending over deleting"],"tags":["not-found","process-definition","stale-reference"],"backgroundTag":"entity-not-found","analyzedSha":"56435b1a97deeafdc09dd40074b056c89fba5a8a","analyzedAt":"2026-09-09T21:00:06.703Z","contentChangedAt":"2026-09-09T21:00:06.703Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}