{"record":{"id":"be7fb61b1452be2f","repo":"flowable/flowable-engine","slug":"variable-operation-is-missing-for-variable-name-be7fb6","errorCode":null,"errorMessage":"Variable operation is missing for variable: ${name}","messagePattern":"Variable operation is missing for variable: (.+?)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionBaseResource.java","lineNumber":128,"sourceCode":"        if (queryRequest.getTenantIdLike() != null) {\n            query.executionTenantIdLike(queryRequest.getTenantIdLike());\n        }\n\n        if (Boolean.TRUE.equals(queryRequest.getWithoutTenantId())) {\n            query.executionWithoutTenantId();\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessExecutionInfoWithQuery(query, queryRequest);\n        }\n\n        return paginateList(requestParams, queryRequest, query, \"processInstanceId\", allowedSortProperties, restResponseFactory::createExecutionResponseList);\n    }\n\n    protected void addVariables(ExecutionQuery processInstanceQuery, List<QueryVariable> variables, boolean process) {\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.getValue() == null) {\n                throw new FlowableIllegalArgumentException(\"Variable value is missing for variable: \" + variable.getName());\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) {","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionBaseResource.java#L110-L146","documentation":"FlowableIllegalArgumentException thrown when a variable supplied in an execution/process-instance query has no variableOperation. Each query variable must declare how it should be matched (equals, notEquals, like, etc.); the operation field is mandatory.","triggerScenarios":"POST /query/process-instances or /query/executions with body variables:[{\"name\":\"orderId\",\"value\":\"42\"}] omitting the 'operation' field.","commonSituations":"Hand-written query JSON copied from a non-Flowable example; client library serializes an enum to null; API version change where the field was renamed; user assumes operation defaults to equals.","solutions":["Add the operation field to each variable in the query body, e.g. \"operation\":\"equals\".","If a default-equals was intended, explicitly set operation to equals — there is no implicit default.","Validate the client-side model maps its operation enum to the Flowable QueryVariableOperation names.","Catch FlowableIllegalArgumentException (HTTP 400) and surface a schema error to the caller."],"exampleFix":"// before\n{\"variables\":[{\"name\":\"orderId\",\"value\":\"42\"}]}\n// after\n{\"variables\":[{\"name\":\"orderId\",\"value\":\"42\",\"operation\":\"equals\"}]}","handlingStrategy":"validation","validationCode":"for (const v of query.variables) {\n  if (!v.operation) throw new Error(`Variable operation missing for ${v.name}`);\n}","typeGuard":"const hasOperation = (v) => typeof v?.operation === 'string' && v.operation.length > 0;\nquery.variables.filter(hasOperation)","tryCatchPattern":"try { /* query process instances */ } catch (e) {\n  if (e.status === 400 && /Variable operation is missing/.test(e.message)) {\n    // fix payload: add operation field\n  } else throw e;\n}","preventionTips":["Never assume a default operation — always set operation explicitly (usually \"equals\")","Validate query payloads against a schema before sending","Share a typed client model for query variables"],"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-18T16:17:23.245Z"}