flowable/flowable-engine · error · FlowableObjectNotFoundException

no case definition deployed with key

Error message

no case definition deployed with key '<caseDefinitionKey>'

What it means

findDeployedLatestCaseDefinitionByKey queries the persistence layer for the case definition with the highest version for the given key. When no definition with that key is deployed at all, it throws FlowableObjectNotFoundException. Callers like resolveCaseDefinition rely on a non-null result to populate the cache.

Solutions

  1. Check deployed keys via cmmnRepositoryService.createCaseDefinitionQuery().list() and correct the key
  2. Deploy the CMMN model containing the case (RepositoryService.createDeployment().addClasspathResource(...).deploy())
  3. Verify the engine points at the database/environment where the case definition is deployed

Example fix

// before
cmmnRuntimeService.createCaseInstanceBuilder().caseDefinitionKey("creditChck").start();
// after (key matches deployed <case id="creditCheck">)
cmmnRuntimeService.createCaseInstanceBuilder().caseDefinitionKey("creditCheck").start();
Defensive patterns

Strategy: validation

Validate before calling

CaseDefinition def = repositoryService.createCaseDefinitionQuery().caseDefinitionKey(key).latestVersion().singleResult(); if (def == null) { /* not deployed */ }

Try / catch

try { builder.caseDefinitionKey(key).start(); } catch (FlowableObjectNotFoundException e) { log.error("Case '{}' not deployed", key, e); }

Prevention

When it happens

Trigger: Calling APIs that resolve by key (e.g. starting a case instance by caseDefinitionKey) with a key that has no deployed case definition — typo in the key, or the model was never deployed to this engine/database.

Common situations: Deploying to a test environment but running the app against production DB; renaming the <case id> in the CMMN XML while code still uses the old key; forgetting to deploy the .cmmn resource entirely.

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/9bd82402e4f6e758. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/deployer/CmmnDeploymentManager.java:80

        CaseDefinitionCacheEntry cacheEntry = caseDefinitionCache.get(caseDefinitionId);
        CaseDefinition caseDefinition = cacheEntry != null ? cacheEntry.getCaseDefinition() : null;

        if (caseDefinition == null) {
            caseDefinition = caseDefinitionEntityManager.findById(caseDefinitionId);
            if (caseDefinition == null) {
                throw new FlowableObjectNotFoundException("no deployed case definition found with id '" + caseDefinitionId + "'", CaseDefinition.class);
            }
            caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();
        }
        return caseDefinition;
    }

    public CaseDefinition findDeployedLatestCaseDefinitionByKey(String caseDefinitionKey) {
        CaseDefinition caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKey(caseDefinitionKey);

        if (caseDefinition == null) {
            throw new FlowableObjectNotFoundException("no case definition deployed with key '" + caseDefinitionKey + "'", CaseDefinition.class);
        }
        caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();
        return caseDefinition;
    }

    public CaseDefinition findDeployedLatestCaseDefinitionByKeyAndTenantId(String caseDefinitionKey, String tenantId) {
        CaseDefinition caseDefinition = caseDefinitionEntityManager.findLatestCaseDefinitionByKeyAndTenantId(caseDefinitionKey, tenantId);
        if (caseDefinition == null) {
            throw new FlowableObjectNotFoundException("no case definition deployed with key '" + caseDefinitionKey + "' for tenant identifier '" + tenantId + "'", CaseDefinition.class);
        }
        caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();
        return caseDefinition;
    }

    public CaseDefinition findDeployedCaseDefinitionByKeyAndVersionAndTenantId(String caseDefinitionKey, Integer caseDefinitionVersion, String tenantId) {
        CaseDefinition caseDefinition = (CaseDefinitionEntity) caseDefinitionEntityManager
                .findCaseDefinitionByKeyAndVersionAndTenantId(caseDefinitionKey, caseDefinitionVersion, tenantId);
        if (caseDefinition == null) {

View on GitHub (pinned to d6d39ce1c6)