flowable/flowable-engine · error · FlowableIllegalArgumentException

id is null

Error message

id is null

What it means

deploymentId(null) throws FlowableIllegalArgumentException with the (slightly mismatched) message 'id is null' — the method filters app definitions by their deployment id, which must be a concrete non-null string for an equality predicate.

Source

Thrown at modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java:131

            throw new FlowableIllegalArgumentException("name is null");
        }
        this.name = name;
        return this;
    }

    @Override
    public AppDefinitionQueryImpl appDefinitionNameLike(String nameLike) {
        if (nameLike == null) {
            throw new FlowableIllegalArgumentException("nameLike is null");
        }
        this.nameLike = nameLike;
        return this;
    }

    @Override
    public AppDefinitionQueryImpl deploymentId(String deploymentId) {
        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("id is null");
        }
        this.deploymentId = deploymentId;
        return this;
    }

    @Override
    public AppDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {
        if (deploymentIds == null) {
            throw new FlowableIllegalArgumentException("ids are null");
        } else if (deploymentIds.isEmpty()) {
            throw new FlowableIllegalArgumentException("ids is an empty collection");
        }
        this.deploymentIds = deploymentIds;
        return this;
    }

    @Override
    public AppDefinitionQueryImpl appDefinitionKey(String key) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the deployment id is resolved and non-null before querying; if it is null the deployment itself likely does not exist — fix the earlier step
  2. Null-check and skip the filter when absent if that is semantically valid
  3. Catch FlowableIllegalArgumentException and surface a 400/404 as appropriate

Example fix

// before
AppDefinition appDef = repoService.createAppDefinitionQuery().deploymentId(deploymentId).singleResult();
// after
if (deploymentId == null) {
    throw new IllegalArgumentException("No deployment id available");
}
AppDefinition appDef = repoService.createAppDefinitionQuery().deploymentId(deploymentId).singleResult();
Defensive patterns

Strategy: validation

Validate before calling

if (deploymentId == null) {
    throw new IllegalStateException("deploymentId must be resolved before querying");
}
query.deploymentId(deploymentId);

Type guard

boolean hasDeploymentId(Object ctx) { return ctx != null && ((DeploymentContext) ctx).getDeploymentId() != null; }

Try / catch

try {
    query.deploymentId(deploymentId);
} catch (FlowableIllegalArgumentException e) {
    throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Deployment id missing or unknown", e);
}

Prevention

When it happens

Trigger: Calling appDefinitionQuery.deploymentId(deploymentId) where the deployment id variable is null — e.g. derived from a nullable path variable, an optional lookup result, or an unset config value.

Common situations: Deploying/fetching flow where the deployment was never created so its id is null; REST param not provided; passing another entity's null id field directly into the query.

Related errors


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