flowable/flowable-engine · error · FlowableIllegalArgumentException
No variable name was found in request body.
Error message
No variable name was found in request body.
What it means
REST request-body validation in BaseVariableResource.setBinaryVariable (CMMN REST): a binary (multipart) variable was uploaded without a 'name' form field, so the engine has no variable name to store the binary stream under.
Source
Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/BaseVariableResource.java:343
if (paramMap.get(parameterName).length > 0) {
if ("scope".equalsIgnoreCase(parameterName)) {
variableScope = paramMap.get(parameterName)[0];
} else if ("name".equalsIgnoreCase(parameterName)) {
variableName = paramMap.get(parameterName)[0];
} else if ("type".equalsIgnoreCase(parameterName)) {
variableType = paramMap.get(parameterName)[0];
}
}
}
try {
// Validate input and set defaults
if (variableName == null) {
throw new FlowableIllegalArgumentException("No variable name was found in request body.");
}
if (variableType != null) {
if (!CmmnRestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE.equals(variableType) && !CmmnRestResponseFactory.SERIALIZABLE_VARIABLE_TYPE.equals(variableType)) {
throw new FlowableIllegalArgumentException("Only 'binary' and 'serializable' are supported as variable type.");
}
} else {
variableType = CmmnRestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE;
}
if (variableScope != null) {
scope = RestVariable.getScopeFromString(variableScope);
}
if (variableType.equals(CmmnRestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE)) {
// Use raw bytes as variable value
byte[] variableBytes = IOUtils.toByteArray(file.getInputStream());
setVariable(instanceId, variableName, variableBytes, scope, isNew, async, variableInterceptor);View on GitHub (pinned to d6d39ce1c6)
Solutions
- Add a form field named exactly "variableName" to the multipart request.
- Ensure the field is sent as a regular text part, not another file part.
- Check field spelling and case ('variableName', 'variableScope', 'variableType').
Example fix
// before curl -F "file=@doc.pdf" .../variables // after curl -F "file=@doc.pdf" -F "variableName=orderDoc" .../variables
Defensive patterns
Strategy: validation
Validate before calling
if (!formData.get('variableName')) {
throw new Error('multipart body must include a variableName form field');
} Type guard
function hasVariableName(fd) { return typeof fd.get('variableName') === 'string' && fd.get('variableName').length > 0; } Try / catch
try {
await uploadBinaryVariable(id, formData);
} catch (e) {
if (/No variable name was found/.test(e.message)) throw new Error('Add -F "variableName=<name>" to the multipart request');
throw e;
} Prevention
- Always append the text field "variableName" alongside the file part.
- Keep a shared helper that builds the multipart body so fields are never forgotten.
- Remember the filename is NOT used as the variable name.
When it happens
Trigger: POST/PUT binary variable upload missing the required form field 'variableName' next to the file part.
Common situations: Clients send only the file part assuming the filename is used; field misnamed ('name' instead of 'variableName'); building the multipart request programmatically and forgetting the text part.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- No file content was found in request body.
- Multipart request is required
- Multipart request with file content is required
- Invalid reschedule timer action. Reschedule timer actions mu
- Variable name is required
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/2db811d82cb22522.
Report an issue: GitHub.