flowable/flowable-engine · error · FlowableIllegalArgumentException
Variable value is missing for variable
Error message
Variable value is missing for variable: ${name} What it means
Flowable's task query REST API throws this FlowableIllegalArgumentException when a task query includes a task variable whose value is null while the variable operation requires a value. Operations other than EXISTS/NOT_EXISTS compare or match against the value, so a missing value would produce a broken SQL predicate. It is raised in TaskBaseResource.addTaskvariables while translating REST QueryVariable objects into a TaskQuery.
Solutions
- Supply a non-null value for each taskVariable entry that uses an operation other than exists or notExists.
- If you only want to test variable existence, change the operation to exists (or notExists) — these do not require a value.
- Filter out variable entries with null values on the client before sending the query.
Example fix
// before
{"taskVariables":[{"name":"priority","operation":"equals","value":null}]}
// after
{"taskVariables":[{"name":"priority","operation":"equals","value":10}]}
// or, when only checking existence:
// {"taskVariables":[{"name":"priority","operation":"exists"}]} Defensive patterns
Strategy: validation
Validate before calling
const needsValue = v => !['exists','notExists'].includes(v.operation);
const invalid = (body.taskVariables||[]).filter(v => needsValue(v) && (v.value === null || v.value === undefined));
if (invalid.length) throw new Error('Missing value for taskVariables: ' + invalid.map(v=>v.name).join(', ')); Type guard
const hasValue = v => typeof v === 'object' && v !== null && v.value !== undefined && v.value !== null;
Prevention
- Always pair equals/notEquals/like/greaterThan/lessThan operations with an explicit value
- Use exists/notExists for presence checks instead of null values
- Validate the query body against the TaskQueryRequest schema before sending
When it happens
Trigger: POST /cmmn-query/tasks with body {"taskVariables":[{"name":"foo","operation":"equals","value":null}]} (or the value field omitted) for any operation other than exists/notExists.
Common situations: Client-side serialization silently dropping null fields, template/config placeholders left unset before building the query body, users filtering a dashboard by a variable that has no value selected yet.
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
- Value-only query (without a variable-name) is not supported
- Value-only query (without a variable-name) is only…
- Value-only query (without a variable-name) is only…
- Value-only query (without a variable-name) is only…
- Variable operation is missing for variable:
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/4c741ffae438fe8e.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskBaseResource.java:368
taskQuery.taskParentScopeId(request.getParentScopeId());
}
if (restApiInterceptor != null) {
restApiInterceptor.accessTaskInfoWithQuery(taskQuery, request);
}
return paginateList(requestParams, request, taskQuery, "id", properties, restResponseFactory::createTaskResponseList);
}
protected void addTaskvariables(TaskQuery taskQuery, 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 && variable.getVariableOperation() != QueryVariableOperation.EQUALS) {
throw new FlowableIllegalArgumentException("Value-only query (without a variable-name) is only supported when using 'equals' operation.");
}
switch (variable.getVariableOperation()) {
case EQUALS:
if (nameLess) {
taskQuery.taskVariableValueEquals(actualValue);
} else {View on GitHub (pinned to d6d39ce1c6)