{"record":{"id":"5d61c654baa2e926","repo":"flowable/flowable-engine","slug":"no-processdefinitionid-processdefinitionkey-nor-m-5d61c6","errorCode":null,"errorMessage":"No processDefinitionId, processDefinitionKey nor messageName provided","messagePattern":"No processDefinitionId, processDefinitionKey nor messageName provided","errorType":"exception","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/RuntimeServiceImpl.java","lineNumber":525,"sourceCode":"\n    @Override\n    public List<Event> getProcessInstanceEvents(String processInstanceId) {\n        return commandExecutor.execute(new GetProcessInstanceEventsCmd(processInstanceId));\n    }\n\n    @Override\n    public ProcessInstanceBuilder createProcessInstanceBuilder() {\n        return new ProcessInstanceBuilderImpl(this);\n    }\n\n    public ProcessInstance startProcessInstance(ProcessInstanceBuilderImpl processInstanceBuilder) {\n        if (processInstanceBuilder.getProcessDefinitionId() != null\n                || processInstanceBuilder.getProcessDefinitionKey() != null) {\n            return commandExecutor.execute(new StartProcessInstanceCmd<ProcessInstance>(processInstanceBuilder));\n        } else if (processInstanceBuilder.getMessageName() != null) {\n            return commandExecutor.execute(new StartProcessInstanceByMessageCmd(processInstanceBuilder));\n        } else {\n            throw new ActivitiIllegalArgumentException(\n                    \"No processDefinitionId, processDefinitionKey nor messageName provided\");\n        }\n    }\n\n}\n","sourceCodeStart":507,"sourceCodeEnd":531,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/RuntimeServiceImpl.java#L507-L531","documentation":"RuntimeServiceImpl.startProcessInstance() dispatches the ProcessInstanceBuilder, which must specify how to start: by processDefinitionId, processDefinitionKey, or messageName. If none of the three is set on the builder, the method throws ActivitiIllegalArgumentException because there is no way to resolve a process definition.","triggerScenarios":"Building via runtimeService.createProcessInstanceBuilder() and calling start() without having called processDefinitionId(...), processDefinitionKey(...), or messageName(...) on the builder — e.g. all three sources were conditional and every one was skipped.","commonSituations":"Dynamic process starters driven by configuration where the config keys (process key, message) are missing/empty; migrating from startProcessInstanceByKey to the builder API and forgetting to set the key; conditional logic that sets id XOR key XOR message but none when the input is incomplete.","solutions":["Set at least one of processDefinitionId, processDefinitionKey, or messageName on the builder before calling start().","Validate the driving input (key/id/message) before creating the builder and reject incomplete requests early.","Catch ActivitiIllegalArgumentException around start() and return a descriptive 'missing process identifier' error to the caller.","If input provides multiple identifiers, prefer processDefinitionId, then key, then message, ensuring at least one is applied."],"exampleFix":"// before\nruntimeService.createProcessInstanceBuilder()\n    .variables(vars)\n    .start(); // nothing set\n\n// after\nruntimeService.createProcessInstanceBuilder()\n    .processDefinitionKey(\"orderProcess\")\n    .variables(vars)\n    .start();","handlingStrategy":"validation","validationCode":"if (processDefinitionId == null && processDefinitionKey == null && messageName == null) {\n    throw new IllegalArgumentException(\"Provide processDefinitionId, processDefinitionKey or messageName\");\n}\nProcessInstanceBuilder b = runtimeService.createProcessInstanceBuilder();\nif (processDefinitionId != null) b.processDefinitionId(processDefinitionId);\nelse if (processDefinitionKey != null) b.processDefinitionKey(processDefinitionKey);\nelse b.messageName(messageName);\nProcessInstance pi = b.start();","typeGuard":null,"tryCatchPattern":"try {\n    builder.start();\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    // report missing process identifier to caller\n}","preventionTips":["Validate the start input (id/key/message) before touching the builder API.","Ensure conditional builder setup always sets at least one identifier.","Prefer processDefinitionKey in config-driven starters and validate config completeness at startup."],"tags":["process-instance","builder","missing-argument","activiti"],"backgroundTag":"missing-required-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"}