flowable/flowable-engine · error · FlowableException

DMN decision with key ${externalRef} was not executed. For $

Error message

DMN decision with key ${externalRef} was not executed. For ${planItemInstanceEntity}

What it means

After building an ExecuteDecisionBuilder with the resolved externalRef, the behavior calls executeWithAuditTrail(). If the DMN service returns a null audit container, the decision was not executed at all and the engine throws this FlowableException. This indicates the DMN engine could not find or run the referenced decision (e.g. it was not deployed) without a more specific error surfacing.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/DecisionTaskActivityBehavior.java:114

            executeDecisionBuilder.fallbackToDefaultTenant();
        }

        String sameDeploymentValue = getFieldString(STRING_DECISION_TABLE_SAME_DEPLOYMENT);
        if (sameDeploymentValue != null) {
            if (Boolean.parseBoolean(sameDeploymentValue)) {
                executeDecisionBuilder.parentDeploymentId(
                        CaseDefinitionUtil.getDefinitionDeploymentId(planItemInstanceEntity.getCaseDefinitionId(), cmmnEngineConfiguration));
            }
        } else {
            // backwards compatibility (always apply parent deployment id)
            executeDecisionBuilder
                    .parentDeploymentId(CaseDefinitionUtil.getDefinitionDeploymentId(planItemInstanceEntity.getCaseDefinitionId(), cmmnEngineConfiguration));
        }

        DecisionExecutionAuditContainer decisionExecutionAuditContainer = executeDecisionBuilder.executeWithAuditTrail();

        if (decisionExecutionAuditContainer == null) {
            throw new FlowableException("DMN decision with key " + externalRef + " was not executed. For " + planItemInstanceEntity);
        }
        
        if (decisionExecutionAuditContainer.isFailed()) {
            throw new FlowableException("DMN decision with key " + externalRef + " execution failed. For " + planItemInstanceEntity,
                    decisionExecutionAuditContainer.getException());
        }

        /* Throw error if there were no rules hit when the flag indicates to do this. */
        String throwErrorFieldValue = getFieldString(EXPRESSION_DECISION_TABLE_THROW_ERROR_FLAG);
        if (decisionExecutionAuditContainer.getDecisionResult().isEmpty() && throwErrorFieldValue != null) {
            if ("true".equalsIgnoreCase(throwErrorFieldValue)) {
                throw new FlowableException("DMN decision with key " + externalRef + " did not hit any rules for the provided input. For " + planItemInstanceEntity);
            
            } else if (!"false".equalsIgnoreCase(throwErrorFieldValue)) {
                Expression expression = CommandContextUtil.getExpressionManager(commandContext).createExpression(throwErrorFieldValue);
                Object expressionValue = expression.getValue(planItemInstanceEntity);
                
                if (expressionValue instanceof Boolean && ((Boolean) expressionValue)) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Deploy the DMN model containing a decision with the exact key referenced by the decision task (ideally in the same deployment as the case so parentDeploymentId resolution works).
  2. Verify the externalRef/decision key spelling against the deployed DMN definition key, including tenant handling.
  3. Check DMN deployment history via DmnRepositoryService to confirm the decision definition exists and is active.
  4. If cases and decisions are deployed independently, ensure version/parentDeploymentId lookup matches your deployment strategy or update the case model.

Example fix

// before: case deployed without DMN model
repositoryService.deploy().addClasspathResource("myCase.cmmn").deploy();
// after: deploy both so parentDeploymentId resolves
repositoryService.deploy()
    .addClasspathResource("myCase.cmmn")
    .addClasspathResource("myDecision.dmn")
    .deploy();
Defensive patterns

Strategy: validation

Validate before calling

DmnDecisionQuery q = dmnRepositoryService.createDecisionQuery().decisionKey(externalRef);
if (q.count() == 0) {
    throw new IllegalStateException("DMN decision not deployed: " + externalRef);
}

Try / catch

try {
    executeDecisionBuilder.executeWithAuditTrail();
} catch (FlowableException e) {
    if (e.getMessage().contains("was not executed")) {
        log.error("DMN decision {} missing in deployment {}", externalRef, deploymentId);
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling executeWithAuditTrail() on a decision with key externalRef that does not resolve to a deployed DMN decision, causing a null DecisionExecutionAuditContainer to be returned.

Common situations: DMN model not deployed or deployed under a different key/tenant; externalRef key typo; running with a parentDeploymentId filter where the DMN decision was not deployed in the same case deployment; decision key changed after a redeploy while old case instances still reference the old key.

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