flowable/flowable-engine · error · FlowableIllegalArgumentException
Variable name is required.
Error message
Variable name is required.
What it means
Thrown by composeInputVariables when an entry in the request's inputVariables/variables array has a null name. Each EngineRestVariable must carry a name so it can be mapped into the DMN input map. The whole request is rejected at validation time.
Solutions
- Ensure every object in inputVariables has a non-null "name" property, e.g. {"name":"amount","value":100}
- Validate the array client-side before posting (each element has name)
- Fix key mismatch in variable construction (must be "name", not "key" or "variableName")
- Log the offending payload to find which variable entry lacks a name
Example fix
// before
{"decisionKey":"d1","inputVariables":[{"value":5}]}
// after
{"decisionKey":"d1","inputVariables":[{"name":"x","value":5}]} Defensive patterns
Strategy: validation
Validate before calling
boolean allNamed = request.inputVariables == null ||
request.inputVariables.stream().allMatch(v -> v.getName() != null);
if (!allNamed) throw new IllegalArgumentException("every inputVariable needs a name"); Type guard
const namedVars = (vars) => (vars == null || vars.every(v => typeof v.name === 'string' && v.name.length > 0));
Try / catch
try {
resp = client.executeDecision(req);
} catch (HttpClientErrorException e) {
if (e.getResponseBodyAsString().contains("Variable name is required")) {
throw new IllegalArgumentException("an input variable is missing its name", e);
}
throw e;
} Prevention
- Use a shared variable DTO with a required name field
- Validate each variable entry before posting
- Avoid building variables from loosely typed maps
When it happens
Trigger: POST to any /dmn-rule/execute-decision(-service)[/single-result] endpoint with an inputVariables array containing an object without a "name" property, e.g. {"inputVariables":[{"value":5}]}.
Common situations: Hand-written JSON missing the name field; variable objects built from generic maps where keys are {name, value} but a different key was used; bulk-converted payloads where one variable lost its name.
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
- File must be of type .dmn
- Invalid body was supplied
- No decision execution id provided
- No deployment id provided
- No variable name was found in request body.
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/375994656eb477d9.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/decision/DmnRuleServiceResource.java:318
decisionBuilder.disableHistory();
}
Map<String, Object> executionResult = decisionBuilder.executeDecisionServiceWithSingleResult();
return dmnRestResponseFactory.createDmnRuleServiceResponse(executionResult);
} catch (FlowableObjectNotFoundException fonfe) {
throw new FlowableIllegalArgumentException(fonfe.getMessage(), fonfe);
}
}
protected Map<String, Object> composeInputVariables(List<EngineRestVariable> restVariables) {
Map<String, Object> inputVariables = null;
if (restVariables != null) {
inputVariables = new HashMap<>();
for (EngineRestVariable variable : restVariables) {
if (variable.getName() == null) {
throw new FlowableIllegalArgumentException("Variable name is required.");
}
inputVariables.put(variable.getName(), dmnRestResponseFactory.getVariableValue(variable));
}
}
return inputVariables;
}
}View on GitHub (pinned to d6d39ce1c6)