{"record":{"id":"4e941a0d5093bfc2","repo":"flowable/flowable-engine","slug":"cannot-start-process-instance-by-message-no-subsc-4e941a","errorCode":null,"errorMessage":"Cannot start process instance by message: no subscription to message with name '<messageName>' found.","messagePattern":"Cannot start process instance by message: no subscription to message with name '<messageName>' found\\.","errorType":"exception","errorClass":"ActivitiObjectNotFoundException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/StartProcessInstanceByMessageCmd.java","lineNumber":71,"sourceCode":"        this.messageName = processInstanceBuilder.getMessageName();\r\n        this.businessKey = processInstanceBuilder.getBusinessKey();\r\n        this.processVariables = processInstanceBuilder.getVariables();\r\n        this.transientVariables = processInstanceBuilder.getTransientVariables();\r\n        this.tenantId = processInstanceBuilder.getTenantId();\r\n    }\r\n\r\n    @Override\r\n    public ProcessInstance execute(CommandContext commandContext) {\r\n\r\n        if (messageName == null) {\r\n            throw new ActivitiIllegalArgumentException(\"Cannot start process instance by message: message name is null\");\r\n        }\r\n\r\n        MessageEventSubscriptionEntity messageEventSubscription = commandContext.getEventSubscriptionEntityManager()\r\n                .findMessageStartEventSubscriptionByName(messageName, tenantId);\r\n\r\n        if (messageEventSubscription == null) {\r\n            throw new ActivitiObjectNotFoundException(\"Cannot start process instance by message: no subscription to message with name '\" + messageName + \"' found.\", MessageEventSubscriptionEntity.class);\r\n        }\r\n\r\n        String processDefinitionId = messageEventSubscription.getConfiguration();\r\n        if (processDefinitionId == null) {\r\n            throw new ActivitiException(\"Cannot start process instance by message: subscription to message with name '\" + messageName + \"' is not a message start event.\");\r\n        }\r\n\r\n        DeploymentManager deploymentManager = commandContext\r\n                .getProcessEngineConfiguration()\r\n                .getDeploymentManager();\r\n\r\n        ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) deploymentManager.findDeployedProcessDefinitionById(processDefinitionId);\r\n        if (processDefinition == null) {\r\n            throw new ActivitiObjectNotFoundException(\"No process definition found for id '\" + processDefinitionId + \"'\", ProcessDefinition.class);\r\n        }\r\n\r\n        // Do not start process a process instance if the process definition is suspended\r\n        if (deploymentManager.isProcessDefinitionSuspended(processDefinition.getId())) {\r","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/StartProcessInstanceByMessageCmd.java#L53-L89","documentation":"StartProcessInstanceByMessageCmd throws ActivitiObjectNotFoundException when no message start-event subscription exists with the given message name (within the optional tenant scope). The engine correlates the message to a deployed process definition's message start event; absent such a subscription, no instance can be started, and it fails with MessageEventSubscriptionEntity.class as the missing type.","triggerScenarios":"Calling runtimeService.startProcessInstanceByMessage(messageName[, tenantId]) where no deployed process definition has a message start event subscribed to that name, or the tenantId does not match the subscription's tenant.","commonSituations":"BPMN model lacks a message start event (or it was removed in the latest deployment); message name differs from the bpmn:message name; wrong tenantId passed in multi-tenant setups; definition not yet deployed when the message arrives.","solutions":["Verify the subscription: runtimeService.createEventSubscriptionQuery().eventType(\"message\").eventName(messageName).list() should be non-empty.","Align the message name with the exact name in the BPMN file and redeploy if the model changed.","Pass the correct tenantId (or none for the default tenant) matching the deployment."],"exampleFix":"// before\nruntimeService.startProcessInstanceByMessage(\"OrderReceived\", \"tenant-42\");\n// after\nif (!runtimeService.createEventSubscriptionQuery().eventName(\"OrderReceived\").tenantId(\"tenant-42\").list().isEmpty()) {\n    runtimeService.startProcessInstanceByMessage(\"OrderReceived\", \"tenant-42\");\n}","handlingStrategy":"validation","validationCode":"boolean hasStartSubscription = !repositoryService.createEventSubscriptionQuery()\n        .eventName(messageName).tenantId(tenantId).list().isEmpty();\nif (hasStartSubscription) runtimeService.startProcessInstanceByMessage(messageName, tenantId);","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.startProcessInstanceByMessage(messageName, tenantId);\n} catch (ActivitiObjectNotFoundException e) {\n    logger.warn(\"No message start event '{}' for tenant {}\", messageName, tenantId, e);\n}","preventionTips":["Match message names exactly against the deployed BPMN.","In multi-tenant setups always verify the tenantId of the deployment.","Check EventSubscriptionQuery after each relevant deployment."],"tags":["message-start-event","subscription","not-found","workflow"],"backgroundTag":"entity-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"}