flowable/flowable-engine · error · FlowableObjectNotFoundException
The variable does not have a binary data stream.
Error message
The variable does not have a binary data stream.
What it means
HistoricVariableInstanceDataResource.getVariableData returns the binary/serializable content of a historic variable. For byte-array and serializable types it reads the raw bytes or deserializes the value; if the variable has no binary data stream (e.g. it is a plain string/number or the bytes were deleted), it throws FlowableObjectNotFoundException.
Source
Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/variable/HistoricVariableInstanceDataResource.java:77
@ResponseBody
public byte[] getVariableData(@ApiParam(name = "varInstanceId") @PathVariable("varInstanceId") String varInstanceId, HttpServletResponse response) {
try {
byte[] result = null;
RestVariable variable = getVariableFromRequest(true, varInstanceId);
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);
}
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Check the variable's type before requesting /data; only byte and serializable variables have a binary stream.
- Handle HTTP 404 from the /data endpoint as 'no binary content' rather than a hard failure.
- If the blob was deleted by history/purge jobs, re-run the process case or configure retention so variable blobs are kept as long as needed.
Example fix
// before
byte[] data = client.get("/cmmn-history/historic-variable-instances/" + id + "/data");
// after
if (variable.getType().equals("byte") || variable.getType().equals("serializable")) {
byte[] data = client.get("/cmmn-history/historic-variable-instances/" + id + "/data");
} Defensive patterns
Strategy: try-catch
Validate before calling
const BINARY_TYPES=["byte","serializable"];
if (!BINARY_TYPES.includes(variable.type)) throw new Error(`Variable ${variable.id} has no binary data`); Type guard
const hasBinary = v => v.type === 'byte' || v.type === 'serializable';
Try / catch
try { data = fetch(url) } catch (e) { if (e.status === 404) { /* no binary content: treat as empty */ } else { throw e } } Prevention
- Check variable type before calling /data.
- Treat 404 on /data as expected for primitive variables.
- Don't configure history cleanup that removes blobs you still need.
When it happens
Trigger: GET /cmmn-history/historic-variable-instances/{variableId}/data on a variable whose value is a primitive type (string, integer, date) rather than byte[] or Serializable, or whose blob data is no longer present.
Common situations: Scripts assuming every variable has downloadable binary data; variables stored in a database where the act_ge_bytearray row was purged/cleaned; querying serializable variables after DB cleanup jobs removed the data.
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
- The variable does not have a binary data stream.
- The variable does not have a binary data stream.
- Task '${taskId}' does not have a variable '${variableName}'
- The variable does not have a binary data stream.
- Only string variable values are supported using like, but wa
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/7dfb9ff51f0cb0fa.
Report an issue: GitHub.