{"record":{"id":"ddcc3fde4e7d0489","repo":"flowable/flowable-engine","slug":"no-process-definition-found-for-id-processdef-ddcc3f","errorCode":null,"errorMessage":"No process definition found for id = '${processDefinitionId}'","messagePattern":"No process definition found for id = '(.+?)'","errorType":"exception","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/StartProcessInstanceCmd.java","lineNumber":272,"sourceCode":"            callbackId, callbackType, referenceId, referenceType, ownerId, assigneeId, stageInstanceId, true);\n    }\n\n    protected boolean hasStartFormData() {\n        return startFormVariables != null || outcome != null;\n    }\n\n    protected boolean hasFormData() {\n        return hasStartFormData() || extraFormInfo != null;\n    }\n\n    protected ProcessDefinition getProcessDefinition(ProcessEngineConfigurationImpl processEngineConfiguration, CommandContext commandContext) {\n        // Find the process definition\n        ProcessDefinition processDefinition = null;\n        if (processDefinitionId != null) {\n            DeploymentManager deploymentCache = processEngineConfiguration.getDeploymentManager();\n            processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);\n            if (processDefinition == null) {\n                throw new FlowableObjectNotFoundException(\"No process definition found for id = '\" + processDefinitionId + \"'\", ProcessDefinition.class);\n            }\n\n        } else if (processDefinitionKey != null) {\n            processDefinition = processEngineConfiguration.getProcessInstanceHelper()\n                    .resolveProcessDefinition(processDefinitionKey, tenantId,\n                            fallbackToDefaultTenant || processEngineConfiguration.isFallbackToDefaultTenant(),\n                            processDefinitionParentDeploymentId, processEngineConfiguration);\n\n            if (tenantId != null && !ProcessEngineConfiguration.NO_TENANT_ID.equals(tenantId)\n                    && !tenantId.equals(processDefinition.getTenantId())) {\n                // Process definition comes from the fallback to the default tenant\n                overrideDefinitionTenantId = tenantId;\n            }\n\n        } else {\n            throw new FlowableIllegalArgumentException(\"processDefinitionKey and processDefinitionId are null\");\n        }\n        return processDefinition;","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/StartProcessInstanceCmd.java#L254-L290","documentation":"StartProcessInstanceCmd could not resolve the given processDefinitionId to a deployed process definition. Flowable looks the id up in the DeploymentManager cache/backing store and throws FlowableObjectNotFoundException when nothing matches.","triggerScenarios":"Calling RuntimeService.startProcessInstanceById(id) (or the builder equivalent) with an id that is not deployed, was deleted, or from a different database/tenant environment.","commonSituations":"Hardcoded ids copied between environments (dev vs prod ids differ); definition deleted via repositoryService.deleteDeployment; lookup against a fresh/empty Flowable database.","solutions":["Fetch valid ids at runtime via RepositoryService.createProcessDefinitionQuery().list() instead of hardcoding","Verify the id string equals the ACT_RE_PROCDEF.ID_ value in the connected database","Re-deploy the BPMN resource if the definition was deleted","Ensure the app connects to the intended Flowable database/environment"],"exampleFix":"// before\nruntimeService.startProcessInstanceById(\"myProcess:1:4\");\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(\"myProcess\").latestVersion().singleResult();\nif (pd != null) runtimeService.startProcessInstanceById(pd.getId());","handlingStrategy":"validation","validationCode":"ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionId(processDefinitionId).singleResult();\nif (pd == null) throw new IllegalArgumentException(\"unknown process definition id: \" + processDefinitionId);","typeGuard":"boolean definitionExists(RepositoryService rs, String id) {\n    return id != null && rs.createProcessDefinitionQuery().processDefinitionId(id).count() > 0;\n}","tryCatchPattern":"try {\n    runtimeService.startProcessInstanceById(id);\n} catch (FlowableObjectNotFoundException e) {\n    // resolve latest id via ProcessDefinitionQuery and retry\n}","preventionTips":["Never hardcode definition ids; resolve via processDefinitionKey + latestVersion","Start by key (startProcessInstanceByKey) rather than id when possible","Keep deployments in sync across environments"],"tags":["process-definition","resource-not-found","process-start"],"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"}