{"record":{"id":"bc351ac9c434ec87","repo":"flowable/flowable-engine","slug":"no-deployed-process-definition-found-with-id","errorCode":null,"errorMessage":"no deployed process definition found with id '\" + processDefinitionId + \"'","messagePattern":"no deployed process definition found with id '\" \\+ processDefinitionId \\+ \"'","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/persistence/deploy/DeploymentManager.java","lineNumber":78,"sourceCode":"    public void deploy(DeploymentEntity deployment, Map<String, Object> deploymentSettings) {\n        for (EngineDeployer deployer : deployers) {\n            deployer.deploy(deployment, deploymentSettings);\n        }\n    }\n\n    public ProcessDefinition findDeployedProcessDefinitionById(String processDefinitionId) {\n        if (processDefinitionId == null) {\n            throw new FlowableIllegalArgumentException(\"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 FlowableObjectNotFoundException(\"no deployed process definition found with id '\" + processDefinitionId + \"'\", ProcessDefinition.class);\n            }\n            processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();\n        }\n        return processDefinition;\n    }\n\n    public ProcessDefinition findDeployedLatestProcessDefinitionByKey(String processDefinitionKey) {\n        ProcessDefinition processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKey(processDefinitionKey);\n\n        if (processDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"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 = processDefinitionEntityManager.findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/persistence/deploy/DeploymentManager.java#L60-L96","documentation":"Flowable throws FlowableObjectNotFoundException when a process definition id is well-formed but no deployed definition with that id exists. The cache is checked first, then the database via ProcessDefinitionEntityManager.findById; if both miss, this error is thrown. It means the definition was deleted, never deployed, or the id is wrong.","triggerScenarios":"repositoryService.getProcessDefinition(\"pid-123\") or runtimeService.startProcessInstanceById(\"pid-123\") where \"pid-123\" was never deployed, points to another database/schema, or the deployment was removed (possibly via cascade delete).","commonSituations":"Hardcoded ids copied from another environment; cascade delete of deployments removed the definition while running instances still reference it; pointing at a wrong database or tenant schema; restarting against a fresh in-memory H2 database without redeploying.","solutions":["Verify the id exists: repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult()","Re-deploy the process definition (repositoryService.createDeployment().addClasspathResource(...).deploy())","Check you are connected to the database/schema where the definition was deployed","If the definition was cascade-deleted, redeploy and restart the affected instances"],"exampleFix":"// before\nruntimeService.startProcessInstanceById(\"myProcess:1:4\");\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionId(\"myProcess:1:4\").singleResult();\nif (pd == null) {\n    repositoryService.createDeployment().addClasspathResource(\"processes/myProcess.bpmn20.xml\").deploy();\n}\nruntimeService.startProcessInstanceById(\"myProcess:1:4\");","handlingStrategy":"try-catch","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionId(id).singleResult();\nif (pd == null) { /* redeploy or fail fast */ }","typeGuard":null,"tryCatchPattern":"try {\n    ProcessDefinition pd = repositoryService.getProcessDefinition(id);\n} catch (FlowableObjectNotFoundException e) {\n    // redeploy the definition or fall back to a lookup by key\n}","preventionTips":["Resolve ids via queries instead of hardcoding","Recreate deployments after database resets","Include deployment steps in test setup"],"tags":["flowable","process-definition","not-found"],"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-18T11:17:12.947Z"}