{"record":{"id":"08a327cccbfe3818","repo":"flowable/flowable-engine","slug":"no-message-start-event-found-for-process-definitio","errorCode":null,"errorMessage":"No message start event found for process definition ${id} and message name ${messageName}","messagePattern":"No message start event found for process definition (.+?) and message name (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/ProcessInstanceHelper.java","lineNumber":159,"sourceCode":"        if (process == null) {\n            throw new FlowableException(\"Cannot start process instance. Process model \" + processDefinition.getName() + \" (id = \" + processDefinition.getId() + \") could not be found\");\n        }\n\n        FlowElement initialFlowElement = null;\n        for (FlowElement flowElement : process.getFlowElements()) {\n            if (flowElement instanceof StartEvent startEvent) {\n                if (CollectionUtil.isNotEmpty(startEvent.getEventDefinitions()) && startEvent.getEventDefinitions()\n                        .get(0) instanceof MessageEventDefinition messageEventDefinition) {\n                    String actualMessageName = EventDefinitionExpressionUtil.determineMessageName(commandContext, messageEventDefinition, processDefinition);\n                    if (Objects.equals(actualMessageName, messageName)) {\n                        initialFlowElement = flowElement;\n                        break;\n                    }\n                }\n            }\n        }\n        if (initialFlowElement == null) {\n            throw new FlowableException(\"No message start event found for process definition \" + processDefinition.getId() + \" and message name \" + messageName);\n        }\n\n        return createAndStartProcessInstanceWithInitialFlowElement(processDefinition, businessKey, businessStatus, null, null, null, initialFlowElement,\n                process, variables, transientVariables, callbackId, callbackType, referenceId, referenceType, ownerId, assigneeId, null, true);\n    }\n    \n    public ProcessInstance createAndStartProcessInstanceWithInitialFlowElement(ProcessDefinition processDefinition,\n            String businessKey, String businessStatus, String processInstanceName, FlowElement initialFlowElement, Process process,\n            Map<String, Object> variables,\n            Map<String, Object> transientVariables, String ownerId, String assigneeId, boolean startProcessInstance) {\n        \n        return createAndStartProcessInstanceWithInitialFlowElement(processDefinition, businessKey, businessStatus, processInstanceName, null, null,\n                initialFlowElement, process, variables, transientVariables, null, null, null, null,\n                ownerId, assigneeId, null, startProcessInstance);\n    }\n\n    public ProcessInstance createAndStartProcessInstanceWithInitialFlowElement(ProcessDefinition processDefinition,\n            String businessKey, String businessStatus, String processInstanceName,","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/util/ProcessInstanceHelper.java#L141-L177","documentation":"Thrown when starting a process instance by message and no StartEvent in the resolved process model has a MessageEventDefinition whose message name matches the given messageName. The engine cannot determine which start event to use.","triggerScenarios":"RuntimeService.startProcessInstanceByMessage(messageName, ...) where messageName is not declared on any <messageStartEvent> of the process definition resolved (by key or tenant).","commonSituations":"Message name mismatch between the BPMN <message name=\"...\"> and the caller; missing <message> declaration in the model; a new process version dropped the message start event; wrong tenant — another tenant's definition has the event but the resolved one does not.","solutions":["Match the messageName string exactly to the name of the <message> referenced by the start event in the BPMN XML.","Add a <startEvent><messageEventDefinition messageRef=\"...\"/></startEvent> plus the <message> declaration and redeploy.","Check you resolved the right definition (key/tenantId) — pass tenantId if messages are tenant-scoped.","Use RuntimeService.createProcessDefinitionQuery().processDefinitionKey(key) to inspect the active version and confirm it contains the message start event."],"exampleFix":"// before\nruntimeService.startProcessInstanceByMessage(\"orderRecieved\", vars); // typo\n// after\n// <message id=\"orderReceivedMsg\" name=\"orderReceived\"/>\nruntimeService.startProcessInstanceByMessage(\"orderReceived\", vars);","handlingStrategy":"validation","validationCode":"BpmnModel model = repositoryService.getBpmnModel(def.getId());\nboolean hasMsgStart = model.getMainProcess().getFlowElements().stream()\n    .filter(org.flowable.bpmn.model.StartEvent.class::isInstance)\n    .map(fe -> (org.flowable.bpmn.model.StartEvent) fe)\n    .flatMap(se -> se.getEventDefinitions().stream())\n    .anyMatch(ed -> ed instanceof org.flowable.bpmn.model.MessageEventDefinition\n        && messageName.equals(((org.flowable.bpmn.model.MessageEventDefinition) ed).getMessageName()));\nif (!hasMsgStart) throw new IllegalArgumentException(\"No message start event '\" + messageName + \"' on \" + def.getId());","typeGuard":"public static boolean isMessageStartEvent(StartEvent se, String messageName) {\n    return se.getEventDefinitions().stream()\n        .filter(MessageEventDefinition.class::isInstance)\n        .map(MessageEventDefinition.class::cast)\n        .anyMatch(ed -> messageName.equals(ed.getMessageName()));\n}","tryCatchPattern":"try {\n    runtimeService.startProcessInstanceByMessage(messageName, vars);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"No message start event found\")) {\n        throw new IllegalArgumentException(\"Message '\" + messageName + \"' has no start event in the active definition\", e);\n    }\n    throw e;\n}","preventionTips":["Centralize message names as constants shared between BPMN and producers","Keep <message> declarations and messageRefs in sync when renaming","Re-check message start events on every new process version","Pass tenantId explicitly for tenant-scoped message resolution"],"tags":["bpmn","message-start-event","message-name","flowable"],"backgroundTag":"resource-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"}