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

  1. Provide the value in the variable parameter or JSON body.
  2. If you only want tasks that have/don't have the variable, use operation exists or notExists instead of a value operation.
  3. 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

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


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