{"record":{"id":"f82d5ed9fc79b012","repo":"Activiti/Activiti","slug":"no-start-element-found-for-process-definition-pr","errorCode":null,"errorMessage":"No start element found for process definition ${processDefinitionID}","messagePattern":"No start element found for process definition (.+?)","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/util/ProcessInstanceHelper.java","lineNumber":81,"sourceCode":"        }\n\n        Process process = ProcessDefinitionUtil.getProcess(processDefinition.getId());\n        if (process == null) {\n            throw new ActivitiException(\n                \"Cannot start process instance. Process model \" +\n                processDefinition.getName() +\n                \" (id = \" +\n                processDefinition.getId() +\n                \") could not be found\"\n            );\n        }\n        return process;\n    }\n\n    public FlowElement getInitialFlowElement(Process process, String processDefinitionID) {\n        FlowElement initialFlowElement = process.getInitialFlowElement();\n        if (initialFlowElement == null) {\n            throw new ActivitiException(\"No start element found for process definition \" + processDefinitionID);\n        }\n        return initialFlowElement;\n    }\n\n    public ProcessInstance createAndStartProcessInstance(ProcessInstanceCreationOptions options) {\n        Process process = this.getActiveProcess(options.getProcessDefinition());\n        FlowElement initialFlowElement = this.getInitialFlowElement(process, options.getProcessDefinition().getId());\n\n        return createAndStartProcessInstanceWithInitialFlowElement(options, initialFlowElement, process, true);\n    }\n\n    public ProcessInstance createProcessInstance(\n        ProcessDefinition processDefinition,\n        String businessKey,\n        String processInstanceName,\n        Map<String, Object> variables,\n        Map<String, Object> transientVariables\n    ) {","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/Activiti/Activiti/blob/56435b1a97deeafdc09dd40074b056c89fba5a8a/activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/util/ProcessInstanceHelper.java#L63-L99","documentation":"A BPMN process model must declare exactly one start event (none start event) for regular instantiation. When process.getInitialFlowElement() is null, getInitialFlowElement throws ActivitiException because the engine cannot determine where execution should begin.","triggerScenarios":"Starting a process instance by key/id whose BPMN XML has no <startEvent>, or where startEvent is not the first flow element (e.g., model starts with a message/timer start event only and the caller starts without a message/signal).","commonSituations":"Hand-edited BPMN missing startEvent; models designed only for message start events started via startProcessInstanceByKey; diagram tools exporting incomplete process XML.","solutions":["Add <startEvent id=\"start\"/> with an outgoing flow as the first element of the process","For message-start-only models, start via runtimeService.startProcessInstanceByMessage(messageName) instead of by key","Validate the model: repositoryService.getBpmnModel(id) and check getMainProcess().getInitialFlowElement() != null before starting","Re-export/redeploy the corrected BPMN file"],"exampleFix":"// before (BPMN)\n<process id=\"invoiceProcess\">\n  <serviceTask id=\"t1\" .../>\n<!-- after -->\n<process id=\"invoiceProcess\">\n  <startEvent id=\"start\"/>\n  <sequenceFlow id=\"f1\" sourceRef=\"start\" targetRef=\"t1\"/>\n  <serviceTask id=\"t1\" .../>","handlingStrategy":"validation","validationCode":"BpmnModel model = repositoryService.getBpmnModel(definitionId);\nif (model.getMainProcess().getInitialFlowElement() == null) {\n    throw new IllegalStateException(\"Process \" + definitionId + \" has no start event\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.startProcessInstanceById(definitionId);\n} catch (ActivitiException e) {\n    if (e.getMessage().startsWith(\"No start element found\")) {\n        // fix BPMN and redeploy, or start by message if it's a message-start model\n    }\n}","preventionTips":["Always include a <startEvent> as the first element of every process","Validate BPMN models in CI with the engine's schema validation","Use message/signal start APIs for models that have no none start event"],"tags":["start-event","bpmn-model","invalid-model","start-process"],"backgroundTag":"schema-validation-failed","analyzedSha":"56435b1a97deeafdc09dd40074b056c89fba5a8a","analyzedAt":"2026-09-09T21:00:06.703Z","contentChangedAt":"2026-09-09T21:00:06.703Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}