flowable/flowable-engine · warning · FlowableObjectNotFoundException
The variable does not have a binary data stream.
Error message
The variable does not have a binary data stream.
What it means
FlowableObjectNotFoundException from the historic case instance variable data endpoint: the variable's value is not a byte-array/serializable type, so there is no binary stream to download. Only ByteArray and Serializable variables expose raw data.
Source
Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceVariableDataResource.java:81
public byte[] getVariableData(@ApiParam(name = "caseInstanceId") @PathVariable("caseInstanceId") String caseInstanceId,
@ApiParam(name = "variableName") @PathVariable("variableName") String variableName, HttpServletResponse response) {
try {
byte[] result = null;
RestVariable variable = getVariableFromRequest(true, caseInstanceId, variableName);
if (CmmnRestResponseFactory.BYTE_ARRAY_VARIABLE_TYPE.equals(variable.getType())) {
result = (byte[]) variable.getValue();
response.setContentType("application/octet-stream");
} else if (CmmnRestResponseFactory.SERIALIZABLE_VARIABLE_TYPE.equals(variable.getType())) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutputStream outputStream = new ObjectOutputStream(buffer);
outputStream.writeObject(variable.getValue());
outputStream.close();
result = buffer.toByteArray();
response.setContentType("application/x-java-serialized-object");
} else {
throw new FlowableObjectNotFoundException("The variable does not have a binary data stream.", null);
}
return result;
} catch (IOException ioe) {
// Re-throw IOException
throw new FlowableException("Unexpected exception getting variable data", ioe);
}
}
public RestVariable getVariableFromRequest(boolean includeBinary, String caseInstanceId, String variableName) {
HistoricCaseInstance caseObject = getHistoricCaseInstanceFromRequest(caseInstanceId);
HistoricVariableInstance variable = historyService.createHistoricVariableInstanceQuery()
.caseInstanceId(caseObject.getId())
.variableName(variableName)
.singleResult();
if (variable == null || variable.getValue() == null) {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Only request data endpoints for byte-array or serializable variables; read plain values via the variable JSON endpoint
- Check the variable's type field in the variable response before fetching data
- Fix the case definition so the variable is stored as byte array/Serializable if binary data is expected
- Handle the 404/FlowableObjectNotFoundException client-side with a graceful fallback
Example fix
// before byte[] data = restClient.getVariableData(caseId, varName); // fails for String vars // after VariableResponse v = restClient.getVariable(caseId, varName); byte[] data = "byteArray".equals(v.getType()) ? restClient.getVariableData(caseId, varName) : null;
Defensive patterns
Strategy: try-catch
Validate before calling
if (!"byteArray".equals(variable.getType()) && !"serializable".equals(variable.getType())) return null; // no binary data to fetch
Type guard
boolean hasBinaryData(VariableResponse v) {
return "byteArray".equals(v.getType()) || "serializable".equals(v.getType());
} Try / catch
try { return resource.getVariableData(caseId, varName); }
catch (FlowableObjectNotFoundException e) {
log.info("Variable {} has no binary data", varName);
return null;
} Prevention
- Check the variable type field before calling the data endpoint
- Read plain values via the normal variable JSON endpoint
- Handle type changes in case definitions across versions
When it happens
Trigger: GET of variable data for a historic case variable whose stored value is a plain String/Integer/etc. rather than a byte[] or Serializable payload.
Common situations: Client assumes every variable has downloadable data; variable type changed between case versions (was a document byte array, now a string); querying the wrong variable name.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Could not find a case instance
- Could not find a plan item instance
- Plan item instance '${instanceId}' doesn't have a variable w
- Case instance '${instanceId}' doesn't have a variable with n
- Plan item instance '${id}' does not have a variable '${varia
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/4e20adaa590469e0.
Report an issue: GitHub.