{"record":{"id":"f72b4abcc36aa39b","repo":"flowable/flowable-engine","slug":"variable-operation-is-missing-for-variable-f72b4a","errorCode":null,"errorMessage":"Variable operation is missing for variable: ","messagePattern":"Variable operation is missing for variable: ","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java","lineNumber":436,"sourceCode":"\n            case EXISTS:\n                taskInstanceQuery.taskVariableExists(variable.getName());\n                break;\n\n            case NOT_EXISTS:\n                taskInstanceQuery.taskVariableNotExists(variable.getName());\n                break;\n\n            default:\n                throw new FlowableIllegalArgumentException(\"Unsupported variable query operation: \" + variable.getVariableOperation());\n            }\n        }\n    }\n\n    protected void addProcessVariables(HistoricTaskInstanceQuery taskInstanceQuery, List<QueryVariable> variables) {\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) {\n                throw new FlowableIllegalArgumentException(\"Value-only query (without a variable-name) is not supported.\");\n            }\n\n            switch (variable.getVariableOperation()) {\n","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceBaseResource.java#L418-L454","documentation":"addProcessVariables validates every QueryVariable in a historic task instance query. If variable.getVariableOperation() is null — i.e. the request did not specify an op at all — this FlowableIllegalArgumentException is thrown before any query is built. The operation is mandatory to know which query predicate to apply.","triggerScenarios":"GET /history/historic-task-instances?processVariable=<name>/<value> without the <operation> segment, or a JSON body QueryVariable entry that omits the \"operation\" field.","commonSituations":"Omitting the op segment in the variable=... query-parameter shorthand; forgetting the operation property in POST query bodies; hand-written clients copying only name and value.","solutions":["Add the operation segment to the variable query parameter, e.g. processVariable=equals==status/active.","In JSON query bodies, set \"variableOperation\": \"equals\" (or another supported op) on each QueryVariable.","Validate query-variable parameters client-side before sending to the REST API."],"exampleFix":"// before\n?processVariable=status/active\n// after\n?processVariable=equals==status/active","handlingStrategy":"validation","validationCode":"vars.forEach(v => { if (!v.variableOperation) throw new Error('Missing operation for variable ' + v.name); });","typeGuard":"function hasOperation(v) { return typeof v.variableOperation === 'string' && v.variableOperation.length > 0; }","tryCatchPattern":"try { query(vars) } catch (e) { if (e instanceof FlowableIllegalArgumentException && e.message.startsWith('Variable operation is missing')) { /* fix payload */ } else throw e }","preventionTips":["Always include the op segment in variable=... parameters","Validate query bodies against a QueryVariable schema before sending"],"tags":["rest-api","query-variable","missing-field","history-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"}