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

  1. Add a form field named exactly "variableName" to the multipart request.
  2. Ensure the field is sent as a regular text part, not another file part.
  3. 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

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


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