flowable/flowable-engine · error · FlowableObjectNotFoundException

No event definition found

Error message

No event definition found

What it means

When creating an event instance via the REST API, the resolved event definition (by id, key, or latest version) is null; the endpoint throws FlowableObjectNotFoundException 'No event definition found'.

Solutions

  1. Deploy the event definition first and verify deployment success.
  2. Check the eventDefinitionId/key spelling against deployed definitions.
  3. Remove or correct tenantId so the query is not over-filtered.
  4. Catch FlowableObjectNotFoundException and surface a client-friendly 404.

Example fix

// before
eventRegistry.eventReceived("myKey", payload); // key not deployed
// after
EventDefinition def = repo.createEventDefinitionQuery().eventDefinitionKey("myKey").latestVersion().singleResult();
if (def == null) throw new IllegalStateException("Deploy event definition 'myKey' first");
Defensive patterns

Strategy: validation

Validate before calling

EventDefinition def = repositoryService.createEventDefinitionQuery()
    .eventDefinitionKey(key).latestVersion().singleResult();
if (def == null) throw new IllegalStateException("Deploy event definition first: " + key);

Type guard

null

Try / catch

try {
    createEventInstance(request);
} catch (FlowableObjectNotFoundException e) {
    logger.error("No event definition matched request", e);
}

Prevention

When it happens

Trigger: POST to event runtime endpoint with an eventDefinitionId/key matching no deployed event definition, or with only a key whose definition does not exist.

Common situations: Calling the endpoint before deploying the event registry model; misspelled key; wrong tenantId narrowing the query; version-specific lookups where the version doesn't exist.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/37e08b4dda25fbd4. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/runtime/EventInstanceCollectionResource.java:105

                eventDefinitionQuery.tenantId(request.getTenantId());
            }
            
            eventDefinition = eventDefinitionQuery.latestVersion().singleResult();
            
            if (eventDefinition == null && eventRegistryEngineConfiguration.isFallbackToDefaultTenant()) {
                String defaultTenant = eventRegistryEngineConfiguration.getDefaultTenantProvider().getDefaultTenant(request.getTenantId(), ScopeTypes.EVENT_REGISTRY, request.getEventDefinitionKey());
                if (StringUtils.isNotEmpty(defaultTenant)) {
                    eventDefinitionQuery = repositoryService.createEventDefinitionQuery().eventDefinitionKey(request.getEventDefinitionKey()).tenantId(defaultTenant);
                } else {
                    eventDefinitionQuery = repositoryService.createEventDefinitionQuery().eventDefinitionKey(request.getEventDefinitionKey());
                }
                
                eventDefinition = eventDefinitionQuery.latestVersion().singleResult();
            }
        }
        
        if (eventDefinition == null) {
            throw new FlowableObjectNotFoundException("No event definition found");
        }

        ChannelModel channelModel = null;
        if (StringUtils.isNotEmpty(request.getChannelDefinitionId())) {
            channelModel = repositoryService.getChannelModelById(request.getChannelDefinitionId());
        } else if (StringUtils.isNotEmpty(request.getTenantId())) {
            channelModel = repositoryService.getChannelModelByKey(request.getChannelDefinitionKey(), request.getTenantId());
        } else {
            channelModel = repositoryService.getChannelModelByKey(request.getChannelDefinitionKey());
        }

        eventRegistry.eventReceived((InboundChannelModel) channelModel, request.getEventPayload().toString());
    }

    protected void validateRequestParameters(@RequestBody EventInstanceCreateRequest request) {
        if (request.getEventDefinitionId() == null && request.getEventDefinitionKey() == null) {
            throw new FlowableIllegalArgumentException("Either eventDefinitionId or eventDefinitionKey is required.");
        }

View on GitHub (pinned to d6d39ce1c6)