flowable/flowable-engine · error · FlowableObjectNotFoundException

no case definition deployed with key

Error message

no case definition deployed with key '<caseDefinitionKey>' for tenant identifier '<tenantId>'

What it means

Same lookup as the by-key variant but additionally constrained to a tenant: findDeployedLatestCaseDefinitionByKeyAndTenantId finds nothing matching both key and tenantId and throws FlowableObjectNotFoundException. Multi-tenancy means the definition may exist globally but not under the given tenant.

Solutions

  1. Deploy the case definition with the same tenantId: deployment.tenantId(tenantId).deploy()
  2. Verify the tenantId string matches exactly the one used at deployment time (including null/empty)
  3. List definitions with createCaseDefinitionQuery().caseDefinitionTenantId(tenantId).caseDefinitionKey(key) to see what exists

Example fix

// before
repositoryService.createDeployment().addClasspathResource("credit.cmmn").deploy(); // no tenant
runtimeService.createCaseInstanceBuilder().caseDefinitionKey("credit").caseDefinitionTenantId("acme").start();
// after
repositoryService.createDeployment().addClasspathResource("credit.cmmn").tenantId("acme").deploy();
Defensive patterns

Strategy: validation

Validate before calling

CaseDefinition def = repositoryService.createCaseDefinitionQuery().caseDefinitionKey(key).caseDefinitionTenantId(tenantId).latestVersion().singleResult(); if (def == null) { /* deploy or fix tenantId */ }

Try / catch

try { builder.caseDefinitionKey(key).caseDefinitionTenantId(tenantId).start(); } catch (FlowableObjectNotFoundException e) { /* wrong tenant or missing deployment */ }

Prevention

When it happens

Trigger: Starting a case by key with tenantId set, where the case definition was deployed either without that tenant id or under a different tenant; passing a wrong/default tenant string from configuration.

Common situations: Tenant id mismatch after introducing multi-tenancy (definitions deployed pre-tenant with null tenant); case sensitivity differences in tenant ids ('acme' vs 'ACME'); config file carrying another environment's tenant.

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

Appendix: source

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

            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) {
            throw new FlowableObjectNotFoundException("no case definition deployed with key = '" + caseDefinitionKey + "' and version = '" + caseDefinitionVersion + "'", CaseDefinition.class);
        }
        caseDefinition = resolveCaseDefinition(caseDefinition).getCaseDefinition();
        return caseDefinition;
    }

    public CaseDefinitionCacheEntry resolveCaseDefinition(CaseDefinition caseDefinition) {
        String caseDefinitionId = caseDefinition.getId();
        String deploymentId = caseDefinition.getDeploymentId();

View on GitHub (pinned to d6d39ce1c6)