flowable/flowable-engine · error · FlowableIllegalArgumentException

Variable value is missing for variable: " + variable.getName

Error message

Variable value is missing for variable: " + variable.getName()

What it means

For historic task variable query filters, every operation other than EXISTS/NOT_EXISTS requires a value. If the value is null Flowable throws FlowableIllegalArgumentException because equals/greaterThan/like style comparisons are meaningless without a value.

Source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java:348

     * Throws the right exceptions when bad request was made or instance was not found.
     */
    protected HistoricTaskInstance getHistoricTaskInstanceFromRequestWithoutAccessCheck(String taskId) {
        HistoricTaskInstance taskInstance = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
        if (taskInstance == null) {
            throw new FlowableObjectNotFoundException("Could not find a task instance with id '" + taskId + "'.", HistoricTaskInstance.class);
        }
        
        return taskInstance;
    }

    protected void addTaskVariables(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.taskVariableValueEquals(variable.getName(), actualValue);
                break;

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Provide a value for the filter: {"name":"x","operation":"equals","value":"y"}
  2. If you only want to test variable presence, use operation 'exists' (or 'notExists') which legally has no value
  3. Fix client serialization so the value is not dropped when it is a zero/empty value

Example fix

// before
{"taskVariables":[{"name":"status","operation":"equals"}]}
// after
{"taskVariables":[{"name":"status","operation":"exists"}]}
// or provide the value:
{"taskVariables":[{"name":"status","operation":"equals","value":"done"}]}
Defensive patterns

Strategy: validation

Validate before calling

for (QueryVariable v : variables) {
    if (v.getVariableOperation() != QueryVariableOperation.EXISTS
        && v.getVariableOperation() != QueryVariableOperation.NOT_EXISTS
        && v.getValue() == null)
        throw new IllegalArgumentException("value required for variable " + v.getName());
}

Prevention

When it happens

Trigger: POST /query/historic-tasks with a taskVariables entry using e.g. operation 'equals' but no 'value' property, reaching addTaskVariables with variable.getValue()==null.

Common situations: Client omits the value field; JSON null value serialized for the filter; client tries to query 'variable is set' but uses equals instead of the exists operation.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/3b5d403939f67178. Report an issue: GitHub.