flowable/flowable-engine · error · FlowableObjectNotFoundException

No channel definition found for id = ''

Error message

No channel definition found for id = ''

What it means

Thrown when looking up a channel definition by explicit channelDefinitionId and the deployment manager finds no deployed ChannelDefinitionEntity with that id. FlowableObjectNotFoundException carrying the id and ChannelDefinitionEntity type; the id was syntactically accepted but does not reference a deployed definition.

Source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/cmd/GetChannelModelCmd.java:68

    public GetChannelModelCmd(String channelDefinitionKey, String tenantId, String parentDeploymentId) {
        this(channelDefinitionKey, null);
        this.tenantId = tenantId;
        this.parentDeploymentId = parentDeploymentId;
    }

    @Override
    public ChannelModel execute(CommandContext commandContext) {
        EventRegistryEngineConfiguration eventEngineConfiguration = CommandContextUtil.getEventRegistryConfiguration(commandContext);
        EventDeploymentManager deploymentManager = eventEngineConfiguration.getDeploymentManager();
        ChannelDefinitionEntityManager channelDefinitionEntityManager = eventEngineConfiguration.getChannelDefinitionEntityManager();

        // Find the channel definition
        ChannelDefinitionEntity channelDefinitionEntity = null;
        if (channelDefinitionId != null) {

            channelDefinitionEntity = deploymentManager.findDeployedChannelDefinitionById(channelDefinitionId);
            if (channelDefinitionEntity == null) {
                throw new FlowableObjectNotFoundException("No channel definition found for id = '" + channelDefinitionId + "'", ChannelDefinitionEntity.class);
            }

        } else if (channelDefinitionKey != null && (tenantId == null || EventRegistryEngineConfiguration.NO_TENANT_ID.equals(tenantId)) && 
                        (parentDeploymentId == null || eventEngineConfiguration.isAlwaysLookupLatestDefinitionVersion())) {

            channelDefinitionEntity = deploymentManager.findDeployedLatestChannelDefinitionByKey(channelDefinitionKey);
            if (channelDefinitionEntity == null) {
                throw new FlowableObjectNotFoundException("No channel definition found for key '" + channelDefinitionKey + "'", ChannelDefinitionEntity.class);
            }

        } else if (channelDefinitionKey != null && tenantId != null && !EventRegistryEngineConfiguration.NO_TENANT_ID.equals(tenantId) && 
                        (parentDeploymentId == null || eventEngineConfiguration.isAlwaysLookupLatestDefinitionVersion())) {

            channelDefinitionEntity = channelDefinitionEntityManager.findLatestChannelDefinitionByKeyAndTenantId(channelDefinitionKey, tenantId);
            
            if (channelDefinitionEntity == null && eventEngineConfiguration.isFallbackToDefaultTenant()) {
                String defaultTenant = eventEngineConfiguration.getDefaultTenantProvider().getDefaultTenant(tenantId, ScopeTypes.EVENT_REGISTRY, channelDefinitionKey);
                if (StringUtils.isNotEmpty(defaultTenant)) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Query the repository for the valid id first: repositoryService.createChannelDefinitionQuery().list() and use a returned id
  2. Verify the deployment containing this id still exists and wasn't deleted
  3. Check you are connected to the same database/environment the id was created in

Example fix

// before
ChannelDefinition cd = repositoryService.getChannelDefinition(knownId); // stale id
// after
ChannelDefinition cd = repositoryService.createChannelDefinitionQuery()
    .channelDefinitionId(knownId).singleResult();
if (cd == null) {
    cd = repositoryService.createChannelDefinitionQuery().latestVersion().singleResult();
}
Defensive patterns

Strategy: try-catch

Validate before calling

ChannelDefinition existing = repositoryService.createChannelDefinitionQuery()
    .channelDefinitionId(channelDefinitionId).singleResult();
if (existing == null) throw new IllegalStateException("unknown channel definition id " + channelDefinitionId);

Try / catch

try {
    return repositoryService.getChannelModel(id, null, null, null);
} catch (FlowableObjectNotFoundException e) {
    LOGGER.warn("channel definition {} not found; refreshing ids", id);
    return repositoryService.createChannelDefinitionQuery().latestVersion().singleResult();
}

Prevention

When it happens

Trigger: Calling getChannelModel / getChannelDefinitionModel with a channelDefinitionId that was never deployed, was already deleted with its deployment, or belongs to a different engine's schema/database.

Common situations: Stale id cached in client code after redeployment; id copied from a test environment database; deployment deleted concurrently; typos in the id.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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