flowable/flowable-engine · error · FlowableIllegalArgumentException

Involved groups are null

Error message

Involved groups are null

What it means

TaskQueryImpl.taskInvolvedGroups() throws this when the passed collection is null. The query API requires an explicit, populated collection to filter tasks by involved groups; a null cannot be translated into a query criterion. Fail-fast validation avoids downstream database errors.

Solutions

  1. Pass a non-null collection of group ids to taskInvolvedGroups().
  2. Guard with a null check and skip the filter when groups are unavailable.
  3. Initialize the collection (e.g. Collections.emptyList()) at its source, but note empty is also rejected by a separate error.
  4. Fix the provider that returns null groups.

Example fix

// before
TaskQuery query = taskService.createTaskQuery().taskInvolvedGroups(groups);
// after
TaskQuery query = taskService.createTaskQuery();
if (groups != null && !groups.isEmpty()) {
    query = query.taskInvolvedGroups(groups);
}
Defensive patterns

Strategy: validation

Validate before calling

if (involvedGroups == null) {
    throw new IllegalArgumentException("involvedGroups must be non-null before taskInvolvedGroups()");
}
query.taskInvolvedGroups(involvedGroups);

Type guard

boolean isValidGroupCollection(Collection<String> g) { return g != null && !g.isEmpty(); }

Try / catch

try {
    query.taskInvolvedGroups(groups);
} catch (FlowableIllegalArgumentException e) {
    logger.warn("Invalid task query: {}", e.getMessage());
    query = taskService.createTaskQuery();
}

Prevention

When it happens

Trigger: Calling taskQuery.taskInvolvedGroups(null), e.g. when group ids come from a service call that returned null or an unset collection field.

Common situations: Group list fetched from an external identity provider returned null; collection field never initialized; conditional logic forgot to populate groups before querying.

Related errors


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

Appendix: source

Thrown at modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java:606

    }

    @Override
    public TaskQueryImpl taskInvolvedUser(String involvedUser) {
        if (involvedUser == null) {
            throw new FlowableIllegalArgumentException("Involved user is null");
        }
        if (orActive) {
            currentOrQueryObject.involvedUser = involvedUser;
        } else {
            this.involvedUser = involvedUser;
        }
        return this;
    }

    @Override
    public TaskQueryImpl taskInvolvedGroups(Collection<String> involvedGroups) {
        if (involvedGroups == null) {
            throw new FlowableIllegalArgumentException("Involved groups are null");
        }
        if (involvedGroups.isEmpty()) {
            throw new FlowableIllegalArgumentException("Involved groups are empty");
        }
        if (orActive) {
            currentOrQueryObject.involvedGroups = involvedGroups;
        } else {
            this.involvedGroups = involvedGroups;
        }
        return this;
    }

    @Override
    public TaskQueryImpl taskCandidateGroup(String candidateGroup) {
        if (candidateGroup == null) {
            throw new FlowableIllegalArgumentException("Candidate group is null");
        }

View on GitHub (pinned to d6d39ce1c6)