flowable/flowable-engine · error · org.flowable.common.engine.api.FlowableIllegalArgumentException
id is empty
Error message
id is empty
What it means
InternalVariableInstanceQuery.id() throws FlowableIllegalArgumentException when the id argument is null or an empty string (StringUtils.isEmpty). A variable instance query by id is meaningless without an identifier, so the empty case is rejected up front instead of yielding an empty or malformed database query.
Solutions
- Pass a valid non-empty variable instance id string.
- Check StringUtils.isNotBlank(id) before invoking the query and handle the missing-id case in your code.
- If ids are resolved dynamically, verify the lookup succeeded before building the query.
- If querying by something other than id is intended, use the appropriate filter (name, taskId, executionId) instead.
Example fix
// before
internalQuery.id(variableInstanceId);
// after
if (variableInstanceId != null && !variableInstanceId.isEmpty()) {
internalQuery.id(variableInstanceId);
} else {
throw new IllegalArgumentException("variableInstanceId is required");
} Defensive patterns
Strategy: validation
Validate before calling
if (id == null || id.trim().isEmpty()) {
throw new IllegalArgumentException("variable instance id is required");
} Try / catch
try {
internalQuery.id(id);
} catch (FlowableIllegalArgumentException e) {
throw new IllegalStateException("Missing variable instance id for query", e);
} Prevention
- Validate ids at the boundary (API/DTO layer) before they reach query builders.
- Use StringUtils.isNotBlank rather than plain null checks for identifier inputs.
- Fail fast with your own descriptive exception when an id is missing instead of relying on library messages.
When it happens
Trigger: Calling internalVariableInstanceQuery.id(null) or id("") — typically an id variable that was never set, or an id stripped to empty by trimming/parsing.
Common situations: An id passed as a method parameter from an upstream layer where it was optional; deserialization of a payload missing the id field; string manipulation (e.g. substring/split) accidentally producing an empty id.
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
- appsDefinitionIds is null
- Booleans and null cannot be used in 'greater than' condition
- Booleans and null cannot be used in 'greater than or equal'…
- Booleans and null cannot be used in 'less than' condition
- Booleans and null cannot be used in 'less than or equal'…
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/03c0735fa0ab6020.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/InternalVariableInstanceQueryImpl.java:59
protected Collection<String> taskIds;
protected String processInstanceId;
protected String executionId;
protected Collection<String> executionIds;
protected boolean withoutTaskId;
protected String scopeId;
protected Collection<String> scopeIds;
protected String subScopeId;
protected Collection<String> subScopeIds;
protected boolean withoutSubScopeId;
protected String scopeType;
protected Collection<String> scopeTypes;
protected String name;
protected Collection<String> names;
@Override
public InternalVariableInstanceQuery id(String id) {
if (StringUtils.isEmpty(id)) {
throw new FlowableIllegalArgumentException("id is empty");
}
this.id = id;
return this;
}
@Override
public InternalVariableInstanceQuery taskId(String taskId) {
if (StringUtils.isEmpty(taskId)) {
throw new FlowableIllegalArgumentException("taskId is empty");
}
if (withoutTaskId) {
throw new FlowableIllegalArgumentException("Cannot combine taskId(String) with withoutTaskId() in the same query");
}
this.taskId = taskId;
return this;
}View on GitHub (pinned to d6d39ce1c6)