flowable/flowable-engine · error · FlowableIllegalArgumentException

executionId is empty

Error message

executionId is empty

What it means

InternalVariableInstanceQueryImpl.executionId(String) throws FlowableIllegalArgumentException when the given executionId is null or empty. Variable lookups by execution require a concrete id, so blank input is rejected at query-construction time before any database access.

Solutions

  1. Obtain the execution id from the correct context (e.g. DelegateExecution.getId()) before querying
  2. Guard the call site and skip the query when the id is missing
  3. Validate the id upstream in your service layer

Example fix

// before
query.executionId(executionId); // throws when null/empty
// after
if (executionId != null && !executionId.isEmpty()) {
    query.executionId(executionId);
} else {
    return Collections.emptyList();
}
Defensive patterns

Strategy: validation

Validate before calling

if (executionId == null || executionId.isEmpty()) { throw new IllegalArgumentException("executionId required"); }

Type guard

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

Try / catch

try { query.executionId(executionId); } catch (FlowableIllegalArgumentException e) { log.warn("Missing executionId for variable query", e); return Collections.emptyList(); }

Prevention

When it happens

Trigger: Calling executionId(null) or executionId("") — e.g. using ExecutionEntity.getId() outside an active execution, an id from an empty message header, or an uninitialized variable.

Common situations: Code running outside execution context (no current execution id available); execution id taken from a delegate/variable that was never set; refactors leaving the id blank.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/InternalVariableInstanceQueryImpl.java:104

            throw new FlowableIllegalArgumentException("Cannot combine taskIds(Collection) with withoutTaskId() in the same query");
        }
        this.taskIds = taskIds;
        return this;
    }

    @Override
    public InternalVariableInstanceQuery processInstanceId(String processInstanceId) {
        if (StringUtils.isEmpty(processInstanceId)) {
            throw new FlowableIllegalArgumentException("processInstanceId is empty");
        }
        this.processInstanceId = processInstanceId;
        return this;
    }

    @Override
    public InternalVariableInstanceQuery executionId(String executionId) {
        if (StringUtils.isEmpty(executionId)) {
            throw new FlowableIllegalArgumentException("executionId is empty");
        }
        this.executionId = executionId;
        return this;
    }

    @Override
    public InternalVariableInstanceQuery executionIds(Collection<String> executionIds) {
        if (executionIds == null || executionIds.isEmpty()) {
            throw new FlowableIllegalArgumentException("executionIds is null or empty");
        }
        this.executionIds = executionIds;
        return this;
    }

    @Override
    public InternalVariableInstanceQuery withoutTaskId() {
        if (taskId != null || taskIds != null) {
            throw new FlowableIllegalArgumentException("Cannot combine withoutTaskId() with task(String) or taskIds(Collection) in the same query");

View on GitHub (pinned to d6d39ce1c6)