flowable/flowable-engine · error · FlowableIllegalArgumentException
Variable value is missing for variable:
Error message
Variable value is missing for variable:
What it means
addProcessVariables throws this when the variable operation requires a value (anything other than EXISTS or NOT_EXISTS) but variable.getValue() is null. Operations like equals or greaterThan need a concrete value to compare against; existence checks do not.
Source
Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java:440
case NOT_EXISTS:
taskInstanceQuery.taskVariableNotExists(variable.getName());
break;
default:
throw new FlowableIllegalArgumentException("Unsupported variable query operation: " + variable.getVariableOperation());
}
}
}
protected void addProcessVariables(HistoricTaskInstanceQuery taskInstanceQuery, List<QueryVariable> variables) {
for (QueryVariable variable : variables) {
if (variable.getVariableOperation() == null) {
throw new FlowableIllegalArgumentException("Variable operation is missing for variable: " + variable.getName());
}
if (variable.getVariableOperation() != QueryVariableOperation.EXISTS && variable.getVariableOperation() != QueryVariableOperation.NOT_EXISTS) {
if (variable.getValue() == null) {
throw new FlowableIllegalArgumentException("Variable value is missing for variable: " + variable.getName());
}
}
boolean nameLess = variable.getName() == null;
Object actualValue = restResponseFactory.getVariableValue(variable);
// A value-only query is only possible using equals-operator
if (nameLess) {
throw new FlowableIllegalArgumentException("Value-only query (without a variable-name) is not supported.");
}
switch (variable.getVariableOperation()) {
case EQUALS:
taskInstanceQuery.processVariableValueEquals(variable.getName(), actualValue);
break;
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Provide the value in the variable parameter or JSON body.
- If you only want tasks that have/don't have the variable, use operation exists or notExists instead of a value operation.
- URL-encode the value; an empty string can be dropped during serialization, triggering this error.
Example fix
// before
{"name":"status","variableOperation":"equals"}
// after
{"name":"status","variableOperation":"equals","value":"active"} Defensive patterns
Strategy: validation
Validate before calling
const NO_VALUE_OPS = ['exists','notExists'];
vars.forEach(v => { if (!NO_VALUE_OPS.includes(v.variableOperation) && (v.value === undefined || v.value === null)) throw new Error('Value required for op ' + v.variableOperation); }); Type guard
function valueRequired(v) { return v.variableOperation !== 'exists' && v.variableOperation !== 'notExists' && v.value != null; } Try / catch
try { query(vars) } catch (e) { if (String(e.message).startsWith('Variable value is missing')) { /* supply value or switch to exists */ } else throw e } Prevention
- Use exists/notExists when no comparison value is intended
- URL-encode values so empty values do not silently vanish
When it happens
Trigger: GET /history/historic-task-instances?processVariable=equals==status with empty value, or a POST body QueryVariable with variableOperation=equals and value omitted/null.
Common situations: Client template rendering leaves the value blank; intent was actually an exists check; null value used to mean 'match null' which the REST layer rejects — encode with equalsString/no-value semantics instead.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Variable operation is missing for variable:
- Unsupported variable query operation:
- Variable operation is missing for variable: ${variable.getNa
- Variable value is missing for variable: ${variable.getName()
- Variable operation is missing for variable:
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/8eb1530178094296.
Report an issue: GitHub.