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

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.

Source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseExecutionVariableResource.java:141

            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 (!RestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE.equals(variableType) && !RestResponseFactory.SERIALIZABLE_VARIABLE_TYPE.equals(variableType)) {
                    throw new FlowableIllegalArgumentException("Only 'binary' and 'serializable' are supported as variable type.");
                }
            } else {
                variableType = RestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE;
            }

            RestVariableScope scope = RestVariableScope.LOCAL;
            if (variableScope != null) {
                scope = RestVariable.getScopeFromString(variableScope);
            }

            if (variableType.equals(RestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE)) {
                // Use raw bytes as variable value
                byte[] variableBytes = IOUtils.toByteArray(file.getInputStream());

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Add a form field 'variable_name' with the target variable name to the multipart request
  2. Verify the field name spelling matches the REST API contract
  3. Catch FlowableIllegalArgumentException and return 400 telling the caller the required field

Example fix

// before
curl -F "file=@data.bin" /runtime/process-instances/123/variables
// after
curl -F "variable_name=myVar" -F "file=@data.bin" /runtime/process-instances/123/variables
Defensive patterns

Strategy: validation

Validate before calling

if (variableName == null || variableName.isBlank()) {
    throw new IllegalArgumentException("variable_name form field is required for binary variable upload");
}

Try / catch

try {
    client.uploadBinaryVariable(executionId, name, file);
} catch (HttpClientErrorException.BadRequest e) {
    // check that variable_name field was included
}

Prevention

When it happens

Trigger: POST/PUT of a binary variable where the multipart form omits the 'variable_name' field or it is sent as empty/null.

Common situations: 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.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/9cbdad476073b2fb. Report an issue: GitHub.