flowable/flowable-engine · error · FlowableIllegalArgumentException

executionIds is null or empty

Error message

executionIds is null or empty

What it means

InternalVariableInstanceQueryImpl.executionIds(Collection<String>) throws FlowableIllegalArgumentException when the collection is null or empty. An empty IN-clause is invalid or meaningless, so the builder fails fast instead of executing a broken query. Pass at least one execution id.

Solutions

  1. Check for null/empty before calling and return an empty result instead
  2. Ensure the execution-id collection is populated (or short-circuit) before query construction
  3. Treat empty input as 'no variables' and skip the service call

Example fix

// before
query.executionIds(executionIds); // throws when empty
// after
if (executionIds == null || executionIds.isEmpty()) {
    return Collections.emptyList();
}
query.executionIds(executionIds);
Defensive patterns

Strategy: validation

Validate before calling

if (executionIds == null || executionIds.isEmpty()) { return Collections.emptyList(); }

Type guard

boolean hasItems(Collection<?> c) { return c != null && !c.isEmpty(); }

Try / catch

try { query.executionIds(ids); } catch (FlowableIllegalArgumentException e) { log.warn("executionIds empty; skipping variable lookup", e); return Collections.emptyList(); }

Prevention

When it happens

Trigger: Calling executionIds(null), executionIds(Collections.emptyList()), or a collection derived from an empty stream/filter (e.g. child executions of a scope with no children).

Common situations: Bulk variable fetch where the execution-id list came from an earlier query returning no rows; batch jobs over empty datasets.

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

Appendix: source

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

            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");
        }
        this.withoutTaskId = true;
        return this;
    }

    @Override
    public InternalVariableInstanceQuery scopeId(String scopeId) {
        if (StringUtils.isEmpty(scopeId)) {
            throw new FlowableIllegalArgumentException("scopeId is empty");

View on GitHub (pinned to d6d39ce1c6)