{"record":{"id":"3f976508bbb629c5","repo":"flowable/flowable-engine","slug":"no-variable-name-was-found-in-request-body-3f9765","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-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskVariableBaseResource.java","lineNumber":162,"sourceCode":"\n            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            if (variableName == null) {\n                throw new FlowableIllegalArgumentException(\"No variable name was found in request body.\");\n            }\n\n            if (variableType != null) {\n                if (!CmmnRestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE.equals(variableType) && !CmmnRestResponseFactory.SERIALIZABLE_VARIABLE_TYPE.equals(variableType)) {\n                    throw new FlowableIllegalArgumentException(\"Only 'binary' and 'serializable' are supported as variable type.\");\n                }\n            } else {\n                variableType = CmmnRestResponseFactory.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(CmmnRestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE)) {\n                // Use raw bytes as variable value\n                byte[] variableBytes = IOUtils.toByteArray(file.getInputStream());","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskVariableBaseResource.java#L144-L180","documentation":"For binary task variables, the variable name must be provided in the multipart request. setBinaryVariable collects form fields (name, type, scope) and throws FlowableIllegalArgumentException (HTTP 400) when no 'name' field was supplied alongside the file.","triggerScenarios":"POST /cmmn-runtime/tasks/{taskId}/variables (or PUT to .../variables/{name} missing the name form field) with a file part but without a 'name' text field.","commonSituations":"Clients that only attach the file and expect the URL path to supply the name while calling the collection endpoint; renamed form field (e.g. 'variableName'); frontend dropping extra FormData entries.","solutions":["Add a form field named 'name' with the variable name to the multipart request.","Confirm the field is exactly 'name' (case-sensitive) and non-empty.","For PUT .../variables/{name}, still include the file part correctly and keep the name in the path.","Log FormData entries client-side before sending to verify the field."],"exampleFix":"// before\ncurl -X POST /cmmn-runtime/tasks/123/variables -F 'file=@data.bin'\n// 400: No variable name was found in request body.\n\n// after\ncurl -X POST /cmmn-runtime/tasks/123/variables -F 'name=doc' -F 'file=@data.bin'","handlingStrategy":"validation","validationCode":"if (!form.get('name')) form.append('name', variableName);","typeGuard":"const hasName = (fd) => typeof fd.get('name') === 'string' && fd.get('name').length > 0;","tryCatchPattern":"try { await api.post(url, form, {headers:{'Content-Type':'multipart/form-data'}}); } catch (e) { if (e.response && e.response.status === 400) { /* add the missing name field and retry once */ } throw e; }","preventionTips":["Always include the 'name' form field with binary variable uploads","Build multipart requests via a helper that enforces required fields","Inspect FormData before sending in dev mode"],"tags":["rest-api","cmmn","multipart","variables","validation"],"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"}