flowable/flowable-engine · error · FlowableIllegalArgumentException

Deployment id is null

Error message

Deployment id is null

What it means

DeploymentQueryImpl.deploymentId(String) throws FlowableIllegalArgumentException when the deploymentId argument is null. Flowable validates query filter arguments at builder-call time, so a null id never reaches the database. A deployment id filter must be an actual identifier string.

Solutions

  1. Pass a valid non-null deployment id obtained from RepositoryService.createDeploymentQuery().list() or the deploy() result.
  2. Guard the call: if (deploymentId != null) query.deploymentId(deploymentId).
  3. For 'not deployed yet' cases, handle the missing id before building the query.

Example fix

// before
Deployment d = repoService.createDeploymentQuery().deploymentId(id).singleResult();
// after
if (id == null) throw new IllegalArgumentException("deployment id required");
Deployment d = repoService.createDeploymentQuery().deploymentId(id).singleResult();
Defensive patterns

Strategy: validation

Validate before calling

if (deploymentId == null || deploymentId.isEmpty()) {
    throw new IllegalArgumentException("A non-empty deployment id is required");
}

Type guard

boolean isValidDeploymentId(String id) { return id != null && !id.trim().isEmpty(); }

Try / catch

try {
    Deployment d = repoService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
} catch (FlowableIllegalArgumentException e) {
    log.warn("Null deployment id supplied", e);
}

Prevention

When it happens

Trigger: repositoryService.createDeploymentQuery().deploymentId(null), usually when the id is read from a variable, request parameter, or an empty lookup result.

Common situations: REST/admin endpoints where the deployment id query parameter is missing; code that stored a deployment id from a previous step that returned null.

Related errors


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

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/DeploymentQueryImpl.java:69

    protected String processDefinitionKey;
    protected String processDefinitionKeyLike;
    protected boolean latest;

    public DeploymentQueryImpl() {
    }

    public DeploymentQueryImpl(CommandContext commandContext) {
        super(commandContext);
    }

    public DeploymentQueryImpl(CommandExecutor commandExecutor) {
        super(commandExecutor);
    }

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

    @Override
    public DeploymentQueryImpl deploymentIds(List<String> deploymentIds) {
        if (deploymentIds == null) {
            throw new FlowableIllegalArgumentException("Deployment ids is null");
        }
        this.deploymentIds = deploymentIds;
        return this;
    }

    @Override
    public DeploymentQueryImpl deploymentName(String deploymentName) {
        if (deploymentName == null) {
            throw new FlowableIllegalArgumentException("deploymentName is null");

View on GitHub (pinned to d6d39ce1c6)