flowable/flowable-engine · error · FlowableIllegalArgumentException
Provided element ids are null
Error message
Provided element ids are null
What it means
ExternalWorkerJobQuery.elementIds(Collection<String>) throws FlowableIllegalArgumentException when the provided element-id collection is null. Like jobIds, the multi-value filter is validated eagerly; a null collection cannot be translated into an IN clause. Use an empty collection or conditionally apply the filter.
Source
Thrown at modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java:214
}
@Override
public ExternalWorkerJobQuery elementId(String elementId) {
if (elementId == null) {
throw new FlowableIllegalArgumentException("Provided element id is null");
}
if (inOrStatement) {
this.currentOrQueryObject.elementId = elementId;
} else {
this.elementId = elementId;
}
return this;
}
@Override
public ExternalWorkerJobQuery elementIds(Collection<String> elementIds) {
if (elementIds == null) {
throw new FlowableIllegalArgumentException("Provided element ids are null");
}
if (inOrStatement) {
this.currentOrQueryObject.elementIds = elementIds;
} else {
this.elementIds = elementIds;
}
return this;
}
@Override
public ExternalWorkerJobQuery elementName(String elementName) {
if (elementName == null) {
throw new FlowableIllegalArgumentException("Provided element name is null");
}
if (inOrStatement) {
this.currentOrQueryObject.elementName = elementName;
} else {
this.elementName = elementName;View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass Collections.emptyList() instead of null when there are no ids.
- Only call elementIds(ids) when the collection is non-null and non-empty.
- Default optional config fields to empty collections at load time.
- Ensure deserialization frameworks populate collection fields with empty defaults.
Example fix
// before
query.elementIds(selectedElementIds);
// after
if (selectedElementIds != null && !selectedElementIds.isEmpty()) {
query.elementIds(selectedElementIds);
} Defensive patterns
Strategy: validation
Validate before calling
if (elementIds != null && !elementIds.isEmpty()) {
query.elementIds(elementIds);
} Type guard
boolean hasElementIds(Collection<String> ids) { return ids != null && !ids.isEmpty(); } Try / catch
try {
query.elementIds(ids);
} catch (FlowableIllegalArgumentException e) {
query; // rebuild without the elementIds filter
} Prevention
- Initialize element id collections as empty sets/lists, never null.
- Configure deserialization to default missing collection fields to empty collections.
- Filter out empty collections before applying multi-value filters.
When it happens
Trigger: Calling externalWorkerJobQuery().elementIds(null), typically when the set of interesting element ids is computed conditionally and ends up null.
Common situations: Bulk job inspection tools built from config where 'elementIds' is an optional list; refactorings replacing a varargs helper with a collection argument; deserialized payloads missing the field.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/6802ad97c1f137c0.
Report an issue: GitHub.