{"record":{"id":"03fd68c5d18f61a8","repo":"flowable/flowable-engine","slug":"no-deployed-process-definition-found-with-id-pro","errorCode":null,"errorMessage":"no deployed process definition found with id '<processDefinitionId>'","messagePattern":"no deployed process definition found with id '<processDefinitionId>'","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java","lineNumber":97,"sourceCode":"            processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();\n\n        } else {\n            processDefinition = cacheEntry.getProcessDefinition();\n        }\n        return processDefinition;\n    }\n\n    public ProcessDefinitionEntity findProcessDefinitionByIdFromDatabase(String processDefinitionId) {\n        if (processDefinitionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid process definition id : null\");\n        }\n\n        ProcessDefinitionEntity processDefinition = Context.getCommandContext()\n                .getProcessDefinitionEntityManager()\n                .findProcessDefinitionById(processDefinitionId);\n\n        if (processDefinition == null) {\n            throw new ActivitiObjectNotFoundException(\"no deployed process definition found with id '\" + processDefinitionId + \"'\", ProcessDefinition.class);\n        }\n\n        return processDefinition;\n    }\n\n    public boolean isProcessDefinitionSuspended(String processDefinitionId) {\n        return findProcessDefinitionByIdFromDatabase(processDefinitionId).isSuspended();\n    }\n\n    public BpmnModel getBpmnModelById(String processDefinitionId) {\n        if (processDefinitionId == null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid process definition id : null\");\n        }\n\n        // first try the cache\n        BpmnModel bpmnModel = bpmnModelCache.get(processDefinitionId);\n\n        if (bpmnModel == null) {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java#L79-L115","documentation":"The database lookup inside findProcessDefinitionByIdFromDatabase returned no row for the given (non-null) id, so the engine throws ActivitiObjectNotFoundException('no deployed process definition found with id ...', ProcessDefinition.class). Called mainly by isProcessDefinitionSuspended, so suspension checks fail when the definition is absent from ACT_RE_PROCDEF.","triggerScenarios":"Calling isProcessDefinitionSuspended / findProcessDefinitionByIdFromDatabase with an id that is not in the database — deleted deployment, wrong-environment id, or an id of a definition never deployed.","commonSituations":"Timer suspension handlers resolving ids that were removed by deleteDeployment; mixed-version cluster nodes or split databases; hardcoded definition ids in scripts that break after redeploys.","solutions":["Confirm via query: repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult(); if null, obtain the correct id by key/latestVersion","If the deployment was deleted intentionally, stop making suspension calls for it and clean dependent jobs/instances","If deleted unintentionally, redeploy the BPMN and update stored references to the new definition id","Audit ACT_RE_PROCDEF vs ACT_RU_JOB rows to find references to removed definitions"],"exampleFix":"// before\nif (repositoryService.isProcessDefinitionSuspended(storedId)) { ... }\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(key).latestVersion().singleResult();\nif (pd == null) throw new IllegalStateException(\"no deployed definition for key \" + key);\nif (pd.isSuspended()) { ... } // avoids the raw id lookup entirely","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionId(id).singleResult();\nif (pd == null) {\n  pd = repositoryService.createProcessDefinitionQuery()\n      .processDefinitionKey(key).latestVersion().singleResult(); // fallback by key\n}\nif (pd == null) throw new IllegalStateException(\"no deployed definition for id=\" + id + \" key=\" + key);\nboolean suspended = pd.isSuspended(); // avoids the raw id DB lookup","typeGuard":"boolean isDeployedInDb(String id) {\n  return id != null && repositoryService.createProcessDefinitionQuery()\n      .processDefinitionId(id).count() > 0;\n}","tryCatchPattern":"try {\n  boolean suspended = repositoryService.isProcessDefinitionSuspended(id);\n} catch (FlowableObjectNotFoundException e) {\n  if (e.getObjectClass() != null && ProcessDefinition.class.equals(e.getObjectClass())) {\n    log.warn(\"definition {} gone from DB; treat as suspended/inactive\", id);\n  } else { throw e; }\n}","preventionTips":["Call pd.isSuspended() on a queried definition instead of the raw id API","Delete deployments with cascade=true so no dangling references remain","Scan ACT_RU_JOB/ACT_RU_EXECUTION for definition ids missing from ACT_RE_PROCDEF after cleanup operations","Look up definitions by key+latestVersion rather than storing ids"],"tags":["process-definition","not-found","suspension","stale-reference"],"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-18T11:17:12.947Z"}