flowable/flowable-engine · error · FlowableIllegalArgumentException
The given variable value is not a date: '" + result.getValue
Error message
The given variable value is not a date: '" + result.getValue() + "'
What it means
The date REST variable converter parses a string variable value with RequestUtil.parseLongDate(). When the string does not parse as an ISO-8601 date, a DateTimeParseException is wrapped into a FlowableIllegalArgumentException that includes the offending value. It is thrown from getVariableValue when converting an engine variable to a REST date representation.
Source
Thrown at modules/flowable-common-rest/src/main/java/org/flowable/common/rest/variable/DateRestVariableConverter.java:46
public String getRestTypeName() {
return "date";
}
@Override
public Class<?> getVariableType() {
return Date.class;
}
@Override
public Object getVariableValue(EngineRestVariable result) {
if (result.getValue() != null) {
if (!(result.getValue() instanceof String)) {
throw new FlowableIllegalArgumentException("Converter can only convert string to date");
}
try {
return RequestUtil.parseLongDate((String) result.getValue());
} catch (DateTimeParseException e) {
throw new FlowableIllegalArgumentException("The given variable value is not a date: '" + result.getValue() + "'", e);
}
}
return null;
}
@Override
public void convertVariableValue(Object variableValue, EngineRestVariable result) {
if (variableValue != null) {
if (!(variableValue instanceof Date dateValue)) {
throw new FlowableIllegalArgumentException("Converter can only convert booleans");
}
result.setValue(dateValue.toInstant().toString());
} else {
result.setValue(null);
}
}
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Inspect the variable value returned in the message and correct it to the format expected by RequestUtil.parseLongDate (ISO-8601, e.g. 2026-09-10T00:00:00.000Z).
- Re-set the variable in the engine as a java.util.Date (or ISO string) instead of an arbitrary string.
- Change the variable's REST type to 'string' if the value is not meant to be a date.
- If the value originates from a form or upstream API, validate/normalize the date format before storing it.
Example fix
// before runtimeService.setVariable(processInstanceId, "dueDate", "10/09/2026"); // after runtimeService.setVariable(processInstanceId, "dueDate", "2026-09-10T00:00:00.000Z");
Defensive patterns
Strategy: validation
Validate before calling
public static boolean isValidRestDate(String v) {
if (v == null) return false;
try { RequestUtil.parseLongDate(v); return true; } catch (Exception e) { return false; }
} Type guard
public static boolean isDateString(Object v) { return v instanceof String && isValidRestDate((String) v); } Try / catch
try {
Object value = restClient.getVariable(id, "dueDate");
} catch (FlowableIllegalArgumentException e) {
if (e.getMessage().startsWith("The given variable value is not a date")) {
// fix or re-set the variable as a proper date
} else { throw e; }
} Prevention
- Always store date variables as java.util.Date or ISO-8601 strings, never locale-formatted strings.
- Validate/parse dates at the point of setVariable so bad formats fail early.
- Pin the REST variable type name to match the stored Java type.
When it happens
Trigger: Calling a REST endpoint that reads a process/execution/task variable whose declared REST type is 'date', where the stored value is a String that RequestUtil.parseLongDate cannot parse (e.g. '2026-13-45', 'yesterday', empty string, or missing timezone offset).
Common situations: A variable was set externally or by an older engine version as a plain string instead of a java.util.Date; a client wrote a non-ISO date format; a timezone suffix was omitted; the value was manually edited in the ACT_RU_VARIABLE table.
Related errors
- Converter can only convert booleans
- Converter can only convert string to date
- Converter can only convert doubles
- Converter can only convert string to instant
- Converter can only convert instant
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/6475a19fdecfd7a0.
Report an issue: GitHub.