{"record":{"id":"7a983fbed8ea9f19","repo":"flowable/flowable-engine","slug":"variable-value-is-missing-for-variable-variablen","errorCode":null,"errorMessage":"Variable value is missing for variable: {variableName}","messagePattern":"Variable value is missing for variable: (.+?)","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskBaseResource.java","lineNumber":392,"sourceCode":"            taskQuery.taskParentScopeId(request.getParentScopeId());\n        }\n\n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessTaskInfoWithQuery(taskQuery, request);\n        }\n\n        return paginateList(requestParams, request, taskQuery, \"id\", properties, restResponseFactory::createTaskResponseList);\n    }\n\n    protected void addTaskvariables(TaskQuery taskQuery, List<QueryVariable> variables) {\n\n        for (QueryVariable variable : variables) {\n            if (variable.getVariableOperation() == null) {\n                throw new FlowableIllegalArgumentException(\"Variable operation is missing for variable: \" + variable.getName());\n            }\n            if (variable.getVariableOperation() != QueryVariableOperation.EXISTS && variable.getVariableOperation() != QueryVariableOperation.NOT_EXISTS) {\n                if (variable.getValue() == null) {\n                    throw new FlowableIllegalArgumentException(\"Variable value is missing for variable: \" + variable.getName());\n                }\n            }\n\n            boolean nameLess = variable.getName() == null;\n\n            Object actualValue = restResponseFactory.getVariableValue(variable);\n\n            // A value-only query is only possible using equals-operator\n            if (nameLess && variable.getVariableOperation() != QueryVariableOperation.EQUALS) {\n                throw new FlowableIllegalArgumentException(\"Value-only query (without a variable-name) is only supported when using 'equals' operation.\");\n            }\n\n            switch (variable.getVariableOperation()) {\n\n            case EQUALS:\n                if (nameLess) {\n                    taskQuery.taskVariableValueEquals(actualValue);\n                } else {","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskBaseResource.java#L374-L410","documentation":"Flowable's REST task query endpoint validates each variable filter in the request body. If a variable declares an operation that requires a value (anything other than EXISTS/NOT_EXISTS) but the 'value' field is null, TaskBaseResource.addTaskvariables throws this FlowableIllegalArgumentException. The library refuses to build a TaskQuery with a valueless comparison.","triggerScenarios":"POST/GET to /runtime/tasks (query) with a JSON variable filter like {\"name\":\"x\",\"operation\":\"equals\",\"value\":null}, or omitting the value field entirely while using equals/notEquals/like/greaterThan etc.","commonSituations":"Hand-written query bodies where the value key is forgotten; templated clients interpolating a null variable; scripts that strip empty JSON values; users copying EXISTS-style examples and forgetting to remove the value requirement.","solutions":["Set the variable 'value' field in the query body to a concrete value","If you only want to test presence, switch the operation to 'exists' or 'notExists' which don't require a value","Ensure your client serializer doesn't drop or null out the value (e.g. omitEmptyBehaviour on a struct)"],"exampleFix":"// before\n{\"taskVariables\":[{\"name\":\"priority\",\"operation\":\"equals\"}]}\n// after\n{\"taskVariables\":[{\"name\":\"priority\",\"operation\":\"equals\",\"value\":50}]}","handlingStrategy":"validation","validationCode":"// before sending a task query\nfunction validateVar(v) {\n  const noValueNeeded = ['exists','notExists'].includes(v.operation);\n  if (!noValueNeeded && (v.value === undefined || v.value === null)) {\n    throw new Error(`Variable '${v.name}' needs a value for operation '${v.operation}'`);\n  }\n}","typeGuard":"const hasValue = (v) => v != null && v.value != null;","tryCatchPattern":"try {\n  const res = await flowable.queryTasks(body);\n} catch (e) {\n  if (e.message && e.message.includes('Variable value is missing')) {\n    // fix request body: add value or switch to exists/notExists\n  } else throw e;\n}","preventionTips":["Never rely on omit-empty serialization for query variable values","Use 'exists'/'notExists' for presence checks instead of null comparisons","Validate query bodies against the Flowable REST schema before sending"],"tags":["rest","validation","flowable","query"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}