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

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.

Source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskVariableBaseResource.java:162

            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 {

            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;
            }

            RestVariableScope scope = RestVariableScope.LOCAL;
            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());

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Add a form field named 'name' with the variable name to the multipart request.
  2. Confirm the field is exactly 'name' (case-sensitive) and non-empty.
  3. For PUT .../variables/{name}, still include the file part correctly and keep the name in the path.
  4. Log FormData entries client-side before sending to verify the field.

Example fix

// before
curl -X POST /cmmn-runtime/tasks/123/variables -F 'file=@data.bin'
// 400: No variable name was found in request body.

// after
curl -X POST /cmmn-runtime/tasks/123/variables -F 'name=doc' -F 'file=@data.bin'
Defensive patterns

Strategy: validation

Validate before calling

if (!form.get('name')) form.append('name', variableName);

Type guard

const hasName = (fd) => typeof fd.get('name') === 'string' && fd.get('name').length > 0;

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

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

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/3f976508bbb629c5. Report an issue: GitHub.