flowable/flowable-engine · error · FlowableIllegalArgumentException
Provided element id is null
Error message
Provided element id is null
What it means
Flowable's TimerJobQueryImpl.elementId(String) throws FlowableIllegalArgumentException when the element id filter is null. The element id identifies the BPMN activity the timer is attached to; null is not a valid filter value so it is rejected eagerly. Omit the call if you do not want to filter by element.
Solutions
- Validate the FlowElement/BpmnModel reference is non-null before reading its id
- Null-check and skip the elementId filter when absent
- Fix the BPMN model so the relevant timer/boundary event has an id
- Catch FlowableIllegalArgumentException for defensive UI/API layers
Example fix
// before
query.elementId(flowElement.getId());
// after
if (flowElement != null) {
query.elementId(flowElement.getId());
} Defensive patterns
Strategy: validation
Validate before calling
if (elementId == null) { throw new IllegalArgumentException("elementId must be resolved from a non-null FlowElement"); } Type guard
boolean hasElementId(FlowElement e) { return e != null && e.getId() != null; } Try / catch
try { query.elementId(elId); } catch (FlowableIllegalArgumentException e) { log.warn("Null element id filter", e); } Prevention
- Ensure BPMN elements carry unique ids
- Null-check FlowElement/BpmnModel references before reading ids
- Handle executions that have not reached the target activity
- Prefer conditional filtering over null passthrough
When it happens
Trigger: Calling createTimerJobQuery().elementId(null), e.g. when the id is taken from a FlowElement reference or model node that was null.
Common situations: Resolving the element from an execution that has not reached the activity yet; a misconfigured BPMN model where the boundary event has no id; dynamic inspection code that passes through a nullable model object.
Related errors
- Provided element name is null
- Business key is null
- Business status is null
- Case definition category is null
- Case definition id is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/7a4e2dd4150ec1e4.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/TimerJobQueryImpl.java:199
}
@Override
public TimerJobQueryImpl categoryLike(String categoryLike) {
if (categoryLike == null) {
throw new FlowableIllegalArgumentException("Provided categoryLike is null");
}
if (inOrStatement) {
this.currentOrQueryObject.categoryLike = categoryLike;
} else {
this.categoryLike = categoryLike;
}
return this;
}
@Override
public TimerJobQueryImpl 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 TimerJobQuery 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;View on GitHub (pinned to d6d39ce1c6)