flowable/flowable-engine · error · FlowableObjectNotFoundException

no event definitions deployed with key

Error message

no event definitions deployed with key '${eventDefinitionKey}'

What it means

findDeployedLatestEventDefinitionByKey throws FlowableObjectNotFoundException when the event definition entity manager returns no definition for the given key, i.e. no event definition with that key has ever been deployed.

Solutions

  1. Verify the event key exists: SELECT from the event definition table where KEY_ = key
  2. Deploy the event definition with that key before looking it up
  3. Point the engine at the database where the definition was deployed
  4. Catch FlowableObjectNotFoundException and provide a default/skip path for optional keys

Example fix

// before
EventDefinitionEntity def = deploymentManager.findDeployedLatestEventDefinitionByKey("order.created");
// after
try {
    def = deploymentManager.findDeployedLatestEventDefinitionByKey("order.created");
} catch (FlowableObjectNotFoundException e) {
    // deploy or fail fast with context
    throw new IllegalStateException("Event 'order.created' not deployed; run the event-registry migrations", e);
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
    def = deploymentManager.findDeployedLatestEventDefinitionByKey(key);
} catch (org.flowable.common.engine.api.FlowableObjectNotFoundException e) {
    throw new IllegalStateException("No event definition deployed for key " + key, e);
}

Prevention

When it happens

Trigger: Calling findDeployedLatestEventDefinitionByKey with a key that has no latest deployed definition: key never deployed, all deployments of it deleted, or misspelled key.

Common situations: Application startup wiring consumers/producers to keys not yet deployed to that database; renaming event keys without redeploying; environment where deployment scripts for the event registry were skipped.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java:111

        // first try the cache
        ChannelDefinitionCacheEntry cacheEntry = channelDefinitionCache.get(channelDefinitionId);
        ChannelDefinitionEntity channelDefinition = cacheEntry != null ? cacheEntry.getChannelDefinitionEntity() : null;

        if (channelDefinition == null) {
            channelDefinition = engineConfig.getChannelDefinitionEntityManager().findById(channelDefinitionId);
            if (channelDefinition == null) {
                throw new FlowableObjectNotFoundException("no deployed channel definition found with id '" + channelDefinitionId + "'");
            }
            channelDefinition = resolveChannelDefinition(channelDefinition).getChannelDefinitionEntity();
        }
        return channelDefinition;
    }

    public EventDefinitionEntity findDeployedLatestEventDefinitionByKey(String eventDefinitionKey) {
        EventDefinitionEntity eventDefinition = eventDefinitionEntityManager.findLatestEventDefinitionByKey(eventDefinitionKey);

        if (eventDefinition == null) {
            throw new FlowableObjectNotFoundException("no event definitions deployed with key '" + eventDefinitionKey + "'");
        }
        eventDefinition = resolveEventDefinition(eventDefinition).getEventDefinitionEntity();
        return eventDefinition;
    }
    
    public ChannelDefinitionEntity findDeployedLatestChannelDefinitionByKey(String channelDefinitionKey) {
        ChannelDefinitionEntity channelDefinition = channelDefinitionEntityManager.findLatestChannelDefinitionByKey(channelDefinitionKey);

        if (channelDefinition == null) {
            throw new FlowableObjectNotFoundException("no channel definitions deployed with key '" + channelDefinitionKey + "'");
        }
        channelDefinition = resolveChannelDefinition(channelDefinition).getChannelDefinitionEntity();
        return channelDefinition;
    }

    public EventDefinitionEntity findDeployedLatestEventDefinitionByKeyAndTenantId(String eventDefinitionKey, String tenantId) {
        EventDefinitionEntity eventDefinition = eventDefinitionEntityManager.findLatestEventDefinitionByKeyAndTenantId(eventDefinitionKey, tenantId);

View on GitHub (pinned to d6d39ce1c6)