{"record":{"id":"4c741ffae438fe8e","repo":"flowable/flowable-engine","slug":"variable-value-is-missing-for-variable-name-4c741f","errorCode":null,"errorMessage":"Variable value is missing for variable: ${name}","messagePattern":"Variable value is missing for variable: (.+?)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":409,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskBaseResource.java","lineNumber":368,"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":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskBaseResource.java#L350-L386","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n{\"taskVariables\":[{\"name\":\"priority\",\"operation\":\"equals\",\"value\":null}]}\n// after\n{\"taskVariables\":[{\"name\":\"priority\",\"operation\":\"equals\",\"value\":10}]}\n// or, when only checking existence:\n// {\"taskVariables\":[{\"name\":\"priority\",\"operation\":\"exists\"}]}","handlingStrategy":"validation","validationCode":"const needsValue = v => !['exists','notExists'].includes(v.operation);\nconst invalid = (body.taskVariables||[]).filter(v => needsValue(v) && (v.value === null || v.value === undefined));\nif (invalid.length) throw new Error('Missing value for taskVariables: ' + invalid.map(v=>v.name).join(', '));","typeGuard":"const hasValue = v => typeof v === 'object' && v !== null && v.value !== undefined && v.value !== null;","tryCatchPattern":null,"preventionTips":["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"],"tags":["rest-api","query","validation","flowable"],"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-18T11:17:12.947Z"}