{"record":{"id":"9cbdad476073b2fb","repo":"flowable/flowable-engine","slug":"no-variable-name-was-found-in-request-body-9cbdad","errorCode":null,"errorMessage":"No variable name was found in request body.","messagePattern":"No variable name was found in request body\\.","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java","lineNumber":141,"sourceCode":"            if (paramMap.get(parameterName).length > 0) {\n\n                if (\"scope\".equalsIgnoreCase(parameterName)) {\n                    variableScope = paramMap.get(parameterName)[0];\n\n                } else if (\"name\".equalsIgnoreCase(parameterName)) {\n                    variableName = paramMap.get(parameterName)[0];\n\n                } else if (\"type\".equalsIgnoreCase(parameterName)) {\n                    variableType = paramMap.get(parameterName)[0];\n                }\n            }\n        }\n\n        try {\n\n            // Validate input and set defaults\n            if (variableName == null) {\n                throw new FlowableIllegalArgumentException(\"No variable name was found in request body.\");\n            }\n\n            if (variableType != null) {\n                if (!RestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE.equals(variableType) && !RestResponseFactory.SERIALIZABLE_VARIABLE_TYPE.equals(variableType)) {\n                    throw new FlowableIllegalArgumentException(\"Only 'binary' and 'serializable' are supported as variable type.\");\n                }\n            } else {\n                variableType = RestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE;\n            }\n\n            RestVariableScope scope = RestVariableScope.LOCAL;\n            if (variableScope != null) {\n                scope = RestVariable.getScopeFromString(variableScope);\n            }\n\n            if (variableType.equals(RestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE)) {\n                // Use raw bytes as variable value\n                byte[] variableBytes = IOUtils.toByteArray(file.getInputStream());","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java#L123-L159","documentation":"FlowableIllegalArgumentException thrown when the multipart request carries a file but no variable name. setBinaryVariable reads form fields (variable_name, variable_scope, variable_type) from the request; without variable_name the API cannot know which variable to set.","triggerScenarios":"POST/PUT of a binary variable where the multipart form omits the 'variable_name' field or it is sent as empty/null.","commonSituations":"Client uploads the file but forgets the accompanying form field; field name misspelled (e.g. 'name' instead of 'variable_name'); form fields lost because client sent them as query params.","solutions":["Add a form field 'variable_name' with the target variable name to the multipart request","Verify the field name spelling matches the REST API contract","Catch FlowableIllegalArgumentException and return 400 telling the caller the required field"],"exampleFix":"// before\ncurl -F \"file=@data.bin\" /runtime/process-instances/123/variables\n// after\ncurl -F \"variable_name=myVar\" -F \"file=@data.bin\" /runtime/process-instances/123/variables","handlingStrategy":"validation","validationCode":"if (variableName == null || variableName.isBlank()) {\n    throw new IllegalArgumentException(\"variable_name form field is required for binary variable upload\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    client.uploadBinaryVariable(executionId, name, file);\n} catch (HttpClientErrorException.BadRequest e) {\n    // check that variable_name field was included\n}","preventionTips":["Always include the variable_name form field alongside the file","Double-check exact field name ('variable_name') against the API docs","Build uploads through a helper function that enforces required fields"],"tags":["rest-api","multipart","validation","missing-field"],"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-14T05:17:10.506Z"}