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

  1. 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).
  2. Re-set the variable in the engine as a java.util.Date (or ISO string) instead of an arbitrary string.
  3. Change the variable's REST type to 'string' if the value is not meant to be a date.
  4. 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

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/6475a19fdecfd7a0. Report an issue: GitHub.