flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find a channel definition with id

Error message

Could not find a channel definition with id '${channelDefinitionId}'.

What it means

FlowableObjectNotFoundException thrown by BaseEventDefinitionResource.getChannelDefinitionFromRequest when repositoryService.getChannelDefinition(id) returns null. The channel definition id does not exist in the event registry repository.

Solutions

  1. List channel definitions via GET /event-registry-repository/repository/channel-definitions and use a returned id.
  2. Verify the id comes from the event registry engine, not another Flowable engine.
  3. Redeploy the channel model if the definition was removed by cleanup.

Example fix

// before
ChannelDefinition cd = repoService.getChannelDefinition("chan-99");
// after
ChannelDefinition cd = repoService.createChannelDefinitionQuery().channelDefinitionKey("orderChannel").latestVersion().singleResult();
Defensive patterns

Strategy: try-catch

Validate before calling

boolean exists = repositoryService.createChannelDefinitionQuery().channelDefinitionId(id).count() > 0;

Try / catch

try { ... } catch (FlowableObjectNotFoundException e) { return ResponseEntity.status(404).build(); }

Prevention

When it happens

Trigger: GET /event-registry-repository/repository/channel-definitions/{channelDefinitionId} with an id that was never deployed or has been removed.

Common situations: Confusing channel definition ids with event definition ids, stale references after redeployment, or pointing at an environment where the channel was never deployed.

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/5b50cf8029c24790. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/BaseEventDefinitionResource.java:62

        if (eventDefinition == null) {
            throw new FlowableObjectNotFoundException("Could not find an event definition with id '" + eventDefinitionId + "'.", EventDefinition.class);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessEventDefinitionById(eventDefinition);
        }
        
        return eventDefinition;
    }
    
    /**
     * Returns the {@link ChannelDefinition} that is requested. Throws the right exceptions when bad request was made or definition was not found.
     */
    protected ChannelDefinition getChannelDefinitionFromRequest(String channelDefinitionId) {
        ChannelDefinition channelDefinition = repositoryService.getChannelDefinition(channelDefinitionId);

        if (channelDefinition == null) {
            throw new FlowableObjectNotFoundException("Could not find a channel definition with id '" + channelDefinitionId + "'.", ChannelDefinition.class);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessChannelDefinitionById(channelDefinition);
        }
        
        return channelDefinition;
    }
}

View on GitHub (pinned to d6d39ce1c6)