{"record":{"id":"9b95007bb8038c06","repo":"flowable/flowable-engine","slug":"no-start-element-found-for-process-definition-id","errorCode":null,"errorMessage":"No start element found for process definition ${id}","messagePattern":"No start element found for process definition (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"critical","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/ProcessInstanceHelper.java","lineNumber":115,"sourceCode":"        FlowElement initialFlowElement = null;\n        if (StringUtils.isNotEmpty(startEventId)) {\n            FlowElement startEventFlowElement = process.getFlowElement(startEventId);\n            if (startEventFlowElement == null) {\n                throw new FlowableException(\"No start element found with id \" + startEventId + \" for process definition \" + processDefinition.getId());\n            }\n            \n            if (!(startEventFlowElement instanceof StartEvent)) {\n                throw new FlowableException(\"Provide start event id is not a start event \" + startEventId + \" for process definition \" + processDefinition.getId());\n            }\n            \n            initialFlowElement = startEventFlowElement;\n            \n        } else {\n            initialFlowElement = process.getInitialFlowElement();\n        }\n        \n        if (initialFlowElement == null) {\n            throw new FlowableException(\"No start element found for process definition \" + processDefinition.getId());\n        }\n\n        return createAndStartProcessInstanceWithInitialFlowElement(processDefinition, businessKey, businessStatus, processInstanceName,\n                overrideDefinitionTenantId,\n                predefinedProcessInstanceId, initialFlowElement, process, variables, transientVariables,\n                callbackId, callbackType, referenceId, referenceType, ownerId, assigneeId, stageInstanceId, startProcessInstance);\n    }\n\n    public ProcessInstance createAndStartProcessInstanceByMessage(ProcessDefinition processDefinition, String messageName, String businessKey,\n            String businessStatus, Map<String, Object> variables, Map<String, Object> transientVariables, String callbackId, String callbackType,\n            String referenceId, String referenceType, String ownerId, String assigneeId) {\n\n        CommandContext commandContext = Context.getCommandContext();\n        if (Flowable5Util.isFlowable5ProcessDefinition(processDefinition, commandContext)) {\n            return CommandContextUtil.getProcessEngineConfiguration(commandContext).getFlowable5CompatibilityHandler().startProcessInstanceByMessage(\n                    messageName, variables, transientVariables, businessKey, processDefinition.getTenantId());\n        }\n","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/ProcessInstanceHelper.java#L97-L133","documentation":"Thrown when no initial flow element could be determined for the process definition — neither an explicit startEventId was given and process.getInitialFlowElement() returned null. This typically means the process model has no start event at all.","triggerScenarios":"Calling createProcessInstance via RuntimeService.startProcessInstance* for a deployed BPMN model that contains no <startEvent> (or one that the model parser could not register as initial), without specifying a startEventId.","commonSituations":"Hand-written BPMN XML missing the start event; a model built programmatically (BpmnModel API) without addFlowElement of a StartEvent; processes designed only with signal/message start events where the parser found none applicable as initial; importing diagrams from external tools that drop the start event.","solutions":["Add a <startEvent> to the BPMN model and redeploy.","If building with the BpmnModel API, call process.addFlowElement(startEvent) with an initial StartEvent before deployment.","If you intend a specific start event, pass its id as startEventId so it is used explicitly.","Validate the process with ProcessValidator before deployment to catch start-event-less models early."],"exampleFix":"// before (programmatic model)\nProcess p = new Process(); p.setId(\"noStart\"); p.addFlowElement(new ServiceTask());\n// after\nStartEvent se = new StartEvent(); se.setId(\"start1\");\np.addFlowElement(se); p.addFlowElement(new ServiceTask());","handlingStrategy":"validation","validationCode":"BpmnModel model = repositoryService.getBpmnModel(defId);\nif (model.getMainProcess().getInitialFlowElement() == null) {\n    throw new IllegalStateException(\"Process \" + defId + \" has no start event — fix and redeploy\");\n}","typeGuard":"public static boolean hasStartEvent(Process process) {\n    return process.getFlowElements().stream().anyMatch(fe -> fe instanceof org.flowable.bpmn.model.StartEvent);\n}","tryCatchPattern":"try {\n    return runtimeService.startProcessInstanceByKey(key, vars);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"No start element found\")) {\n        throw new IllegalStateException(\"Deployed model for '\" + key + \"' lacks a start event\", e);\n    }\n    throw e;\n}","preventionTips":["Run ProcessValidator on models before deployment","Never hand-edit BPMN XML without revalidating","When building models with the BpmnModel API, always add an initial StartEvent","Add a deployment test that starts each process once in a test tenant"],"tags":["bpmn","start-event","invalid-model","flowable"],"backgroundTag":"schema-validation-failed","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"}