flowable/flowable-engine · error · FlowableObjectNotFoundException

no decision deployed with key =

Error message

no decision deployed with key = '${definitionKey}' and version = '${definitionVersion}'

What it means

findDeployedDefinitionByKeyAndVersionAndTenantId throws FlowableObjectNotFoundException('no decision deployed with key = ... and version = ...') when the exact key+version pair has no decision row. Unlike the latest-version lookups, an older or newer version will not satisfy it.

Solutions

  1. Check available versions: createDecisionQuery().decisionKey(key).list() and use an existing versionValue.
  2. Switch to latest-version lookup (findDeployedLatestDefinitionByKey) if you don't need a pinned version.
  3. Redeploy the DMN resource so the requested version exists again.

Example fix

// before
DecisionEntity d = manager.findDeployedDefinitionByKeyAndVersionAndTenantId("approveOrder", 1, null); // v1 gone
// after
DmnDecision latest = dmnRepositoryService.createDecisionQuery().latest().decisionKey("approveOrder").singleResult();
int version = latest != null ? latest.getVersion() : 1;
DecisionEntity d = manager.findDeployedDefinitionByKeyAndVersionAndTenantId("approveOrder", version, null);
Defensive patterns

Strategy: validation

Validate before calling

boolean versionExists = dmnRepositoryService.createDecisionQuery()
    .decisionKey(key).decisionVersion(version).tenantId(tenantId).count() > 0;

Try / catch

try { return manager.findDeployedDefinitionByKeyAndVersionAndTenantId(key, version, tenantId); } catch (FlowableObjectNotFoundException e) { throw new IllegalStateException("decision " + key + " v" + version + " not deployed", e); }

Prevention

When it happens

Trigger: Pinning execution to an explicit decision version that was never deployed, or that was removed by a later deployment deletion.

Common situations: Hard-coded version numbers in configuration that drift after redeploys; tests expecting version 1 after the definition was redeployed (now version 2); deleting an old deployment that contained the pinned version.

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

Appendix: source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/persistence/deploy/DeploymentManager.java:128

    }

    public DecisionEntity findDeployedLatestDecisionByKeyDeploymentIdAndTenantId(String definitionKey,
            String deploymentId, String tenantId) {
        DecisionEntity definition = decisionEntityManager.findDecisionByDeploymentAndKeyAndTenantId(deploymentId, definitionKey, tenantId);

        if (definition == null) {
            throw new FlowableObjectNotFoundException("no decisions deployed with key '" + definitionKey +
                            "' for deployment id '" + deploymentId + "' and tenant identifier " + tenantId);
        }
        definition = resolveDecision(definition).getDecisionEntity();
        return definition;
    }

    public DecisionEntity findDeployedDefinitionByKeyAndVersionAndTenantId(String definitionKey, int definitionVersion, String tenantId) {
        DecisionEntity definition = decisionEntityManager.findDecisionByKeyAndVersionAndTenantId(definitionKey, definitionVersion, tenantId);

        if (definition == null) {
            throw new FlowableObjectNotFoundException("no decision deployed with key = '" + definitionKey + "' and version = '" + definitionVersion + "'");
        }

        definition = resolveDecision(definition).getDecisionEntity();
        return definition;
    }

    /**
     * Resolving the decision will fetch the DMN, parse it and store the {@link org.flowable.dmn.model.DmnDefinition} in memory.
     */
    public DecisionCacheEntry resolveDecision(DmnDecision decision) {
        String decisionId = decision.getId();
        String deploymentId = decision.getDeploymentId();

        DecisionCacheEntry cachedDecision = decisionCache.get(decisionId);

        if (cachedDecision == null) {
            DmnDeploymentEntity deployment = engineConfig.getDeploymentEntityManager().findById(deploymentId);
            List<DmnResourceEntity> resources = engineConfig.getResourceEntityManager().findResourcesByDeploymentId(deploymentId);

View on GitHub (pinned to d6d39ce1c6)