{"record":{"id":"9a22d762e10a72cb","repo":"flowable/flowable-engine","slug":"no-process-definition-found-with-id-processdefin","errorCode":null,"errorMessage":"No process definition found with id ${processDefinitionId}","messagePattern":"No process definition found with id (.+?)","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/ProcessDefinitionUtil.java","lineNumber":127,"sourceCode":"\n    public static BpmnModel getBpmnModelFromCache(String processDefinitionId) {\n        ProcessDefinitionCacheEntry cacheEntry = CommandContextUtil.getProcessEngineConfiguration().getProcessDefinitionCache().get(processDefinitionId);\n        if (cacheEntry != null) {\n            return cacheEntry.getBpmnModel();\n        }\n        return null;\n    }\n\n    public static boolean isProcessDefinitionSuspended(String processDefinitionId) {\n        ProcessDefinitionEntity processDefinition = getProcessDefinitionFromDatabase(processDefinitionId);\n        return processDefinition.isSuspended();\n    }\n\n    public static ProcessDefinitionEntity getProcessDefinitionFromDatabase(String processDefinitionId) {\n        ProcessDefinitionEntityManager processDefinitionEntityManager = CommandContextUtil.getProcessEngineConfiguration().getProcessDefinitionEntityManager();\n        ProcessDefinitionEntity processDefinition = processDefinitionEntityManager.findById(processDefinitionId);\n        if (processDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"No process definition found with id \" + processDefinitionId);\n        }\n\n        return processDefinition;\n    }\n}\n","sourceCodeStart":109,"sourceCodeEnd":133,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/ProcessDefinitionUtil.java#L109-L133","documentation":"getProcessDefinitionFromDatabase queries the ProcessDefinitionEntityManager by id; if no row matches, it throws FlowableObjectNotFoundException. This is a typed not-found signal meaning the requested processDefinitionId does not exist in the database (it is not an engine-internal fault).","triggerScenarios":"Calling APIs that resolve a definition (getProcessDefinitionFromDatabase via processDefinition lookups) with an id that is not present in ACT_RE_PROCDEF — deleted deployment, wrong id string, or an id from another engine/database.","commonSituations":"Application storing process definition ids from an older database; redeployments replacing ids (definition ids include version keys); tenant-specific queries using ids from a different tenant; typo in configuration that references a definition id.","solutions":["Look up the correct id via repositoryService.createProcessDefinitionQuery().processDefinitionKey(...).latestVersion().singleResult() and use its getId().","Check the deployment still exists (it may have been deleted via repositoryService.deleteDeployment with cascade).","Verify you are connecting to the database/schema where the definition was actually deployed.","Catch FlowableObjectNotFoundException in callers that accept optional definitions."],"exampleFix":"// before\nrepositoryService.getBpmnModel(\"procDef:123:999\"); // stale id\n\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(\"myProcess\").latestVersion().singleResult();\nif (pd != null) {\n    repositoryService.getBpmnModel(pd.getId());\n}","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionId(processDefinitionId).singleResult();\nif (pd == null) {\n    throw new IllegalArgumentException(\"Process definition \" + processDefinitionId + \" does not exist\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.startProcessInstanceById(processDefinitionId);\n} catch (FlowableObjectNotFoundException e) {\n    log.warn(\"Definition {} not found; resolving latest version instead\", processDefinitionId);\n    ProcessDefinition latest = repositoryService.createProcessDefinitionQuery()\n        .processDefinitionKey(key).latestVersion().singleResult();\n    if (latest != null) runtimeService.startProcessInstanceById(latest.getId());\n}","preventionTips":["Store process definition keys, not ids, in application config; resolve latest version at runtime","Cascade-delete awareness: track when deployments are removed","Catch FlowableObjectNotFoundException where lookups are optional"],"tags":["process-definition","not-found","lookup"],"backgroundTag":"entity-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"}