{"record":{"id":"3eeeda272900af8e","repo":"flowable/flowable-engine","slug":"no-event-definition-found-for-event-key-sendeven","errorCode":null,"errorMessage":"No event definition found for event key ${sendEventServiceTask.getEventType()} for ${execution}","messagePattern":"No event definition found for event key (.+?) for (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/SendEventTaskActivityBehavior.java","lineNumber":165,"sourceCode":"        } else if ( (sendSynchronously && !executedAsAsyncJob)\n                || (!sendEventServiceTask.isTriggerable() && executedAsAsyncJob)) {\n            // If this send task is specifically marked to send synchronously and is not triggerable then leave\n            leave(execution);\n        }\n    }\n\n    protected EventModel getEventModel(CommandContext commandContext, DelegateExecution execution) {\n        EventModel eventModel = null;\n        if (Objects.equals(ProcessEngineConfiguration.NO_TENANT_ID, execution.getTenantId())) {\n            eventModel = CommandContextUtil.getEventRepositoryService(commandContext)\n                .getEventModelByKey(sendEventServiceTask.getEventType());\n        } else {\n            eventModel = CommandContextUtil.getEventRepositoryService(commandContext)\n                .getEventModelByKey(sendEventServiceTask.getEventType(), execution.getTenantId());\n        }\n\n        if (eventModel == null) {\n            throw new FlowableException(\"No event definition found for event key \" + sendEventServiceTask.getEventType() + \" for \" + execution);\n        }\n        return eventModel;\n    }\n\n    protected boolean isSendOnSystemChannel(DelegateExecution execution) {\n        List<ExtensionElement> systemChannels = execution.getCurrentFlowElement().getExtensionElements().getOrDefault(\"systemChannel\", Collections.emptyList());\n        return !systemChannels.isEmpty();\n    }\n\n    protected List<ChannelModel> getChannelModels(CommandContext commandContext, DelegateExecution execution, boolean sendOnSystemChannel) {\n        List<String> channelKeys = new ArrayList<>();\n\n        Map<String, List<ExtensionElement>> extensionElements = execution.getCurrentFlowElement().getExtensionElements();\n        if (extensionElements != null) {\n            List<ExtensionElement> channelKeyElements = extensionElements.get(\"channelKey\");\n            if (channelKeyElements != null && !channelKeyElements.isEmpty()) {\n                String channelKey = channelKeyElements.get(0).getElementText();\n                if (StringUtils.isNotEmpty(channelKey)) {","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/SendEventTaskActivityBehavior.java#L147-L183","documentation":"SendEventTaskActivityBehavior.getEventModel throws this when the event registry has no event definition matching the task's eventType and tenant. Without an EventModel, the send event task has nothing to send and Flowable aborts the execution.","triggerScenarios":"A send event task whose eventType attribute references an event definition key that is not deployed (or not deployed for the execution's tenant) at the moment the task executes, since getEventModelByKey(eventType, tenantId) returns null.","commonSituations":"Multi-tenant deployments where the event definition exists for tenant A but the process runs as tenant B; forgetting to deploy the event registry artifact alongside the process; renaming the event key in the event definition JSON without updating the BPMN.","solutions":["Verify the eventType in the BPMN matches the deployed event definition key exactly (case-sensitive)","Deploy the event definition (event registry JSON artifact) in the same deployment as the process","Check tenant handling: ensure the event definition is deployed for the tenant of the running execution, or use a tenant-less deployment","List event definitions via EventRepositoryService.getEventModelsByKeysAndTenantId to confirm what is actually deployed"],"exampleFix":"// before\n<sendEvent eventType=\"orderShipped\"/>  <!-- event key not deployed -->\n// after\n<sendEvent eventType=\"orderShippedEvent\"/>  <!-- matches deployed event registry key -->","handlingStrategy":"validation","validationCode":"// Check deployment of event definition for the tenant before starting the process\nEventRepositoryService ers = CommandContextUtil.getEventRepositoryService(commandContext);\nif (ers.getEventModelByKey(eventType, tenantId) == null) {\n    throw new IllegalStateException(\"Event definition missing for tenant \" + tenantId + \": \" + eventType);\n}","typeGuard":null,"tryCatchPattern":"try {\n    processEngine.getRuntimeService().startProcessInstanceByKey(processKey);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"No event definition found for event key\")) {\n        // deploy event registry artifact or fix eventType\n    }\n}","preventionTips":["Deploy event registry JSON artifacts together with BPMN","Keep eventType keys in a shared constants class used by both BPMN and event definitions","Verify tenant-aware deployments in multi-tenant setups"],"tags":["event-registry","deployment","tenant","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-14T05:17:10.506Z"}