flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided ids is null

Error message

Provided ids is null

What it means

Flowable's TokenQueryImpl.tokenIds(List<String> ids) throws FlowableIllegalArgumentException when the ids list is null. The null list cannot be converted into a SQL IN clause for the token query. Validation happens immediately in the fluent API method, before command execution.

Source

Thrown at modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java:74

    }

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

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

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

    @Override
    public TokenQuery tokenValue(String tokenValue) {
        if (tokenValue == null) {
            throw new FlowableIllegalArgumentException("Provided token value is null");
        }
        this.tokenValue = tokenValue;
        return this;
    }

    @Override
    public TokenQuery tokenDate(Date tokenDate) {
        if (tokenDate == null) {
            throw new FlowableIllegalArgumentException("Provided token date is null");

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Only call tokenIds when the list is non-null, or pass an empty list if you want the criterion to be a no-op equivalent (or omit it entirely)
  2. Normalize upstream nulls: List<String> safeIds = ids == null ? Collections.emptyList() : ids;
  3. Fail fast in your own service layer with a clearer domain message when ids are required

Example fix

// before
TokenQuery query = identityService.createTokenQuery().tokenIds(ids);
// after
TokenQuery query = identityService.createTokenQuery();
if (ids != null && !ids.isEmpty()) {
    query.tokenIds(ids);
}
Defensive patterns

Strategy: validation

Validate before calling

if (ids == null) { throw new IllegalArgumentException("ids must not be null before tokenIds()"); }

Type guard

boolean isValidIds(List<String> ids) { return ids != null; }

Try / catch

try { query.tokenIds(ids); } catch (FlowableIllegalArgumentException e) { log.warn("Invalid token query: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Calling tokenIds(null) on a TokenQuery, e.g. when an optional id collection from a request or upstream service was null and the call was made unconditionally.

Common situations: Batch lookups of tokens where the input collection came back null from a cache or API; deserialized JSON payloads with absent arrays; dynamic query construction where a branch forgot to set the list.

Related errors


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