{"record":{"id":"b9c9d8bb5943b51d","repo":"flowable/flowable-engine","slug":"invalid-process-definition-id-null","errorCode":null,"errorMessage":"Invalid process definition id : null","messagePattern":"Invalid process definition id : null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/persistence/deploy/DeploymentManager.java","lineNumber":68,"sourceCode":"    protected List<EngineDeployer> deployers;\n\n    protected ProcessEngineConfigurationImpl processEngineConfiguration;\n    protected ProcessDefinitionEntityManager processDefinitionEntityManager;\n    protected DeploymentEntityManager deploymentEntityManager;\n\n    public void deploy(DeploymentEntity deployment) {\n        deploy(deployment, null);\n    }\n\n    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);","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/persistence/deploy/DeploymentManager.java#L50-L86","documentation":"Flowable throws FlowableIllegalArgumentException when RuntimeService/RepositoryService APIs are called with a null process definition id. DeploymentManager.resolveById is the central lookup point; it validates the id before consulting the process definition cache or the database. The null check prevents downstream lookups (cache get, EntityManager.findById) from failing obscurely.","triggerScenarios":"Calling runtimeService.startProcessInstanceById(null), taskService.createTaskQuery().processDefinitionId(null) with an id variable that was never assigned, or a resolver that returned null before being passed into an API that fetches a deployed process definition by id.","commonSituations":"A workflow variable or query result used as the definition id was null (e.g. task.getProcessDefinitionId() on a standalone task); a DTO field not populated; a caller passed a process instance id where a definition id was expected.","solutions":["Log/inspect where the id originates and fix the upstream code that leaves it null","Check you are passing the processDefinitionId, not the processInstanceId or deploymentId","Only call the API when a definition id is actually needed (e.g. skip definition queries for standalone tasks)","Guard with a null check before invoking the engine API"],"exampleFix":"// before\nProcessDefinition pd = repositoryService.getProcessDefinition(task.getProcessDefinitionId());\n// after\nif (task.getProcessDefinitionId() != null) {\n    ProcessDefinition pd = repositoryService.getProcessDefinition(task.getProcessDefinitionId());\n}","handlingStrategy":"validation","validationCode":"if (processDefinitionId == null || processDefinitionId.isBlank()) {\n    throw new IllegalArgumentException(\"processDefinitionId must be provided\");\n}\nrepositoryService.getProcessDefinition(processDefinitionId);","typeGuard":"boolean hasDefinitionId(Task t) { return t != null && t.getProcessDefinitionId() != null; }","tryCatchPattern":null,"preventionTips":["Never pass engine ids through nullable fields without checks","Distinguish processDefinitionId vs processInstanceId vs deploymentId in your DTOs","Log the id source when wiring engine calls"],"tags":["flowable","null-argument","process-definition"],"backgroundTag":"null-argument","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"}