flowable/flowable-engine · error · FlowableIllegalArgumentException
The given variable value is not an instant: '" +…
Error message
The given variable value is not an instant: '" + result.getValue() + "'
What it means
InstantRestVariableConverter.getVariableValue calls Instant.parse on the string value; when parsing fails with DateTimeParseException it wraps it in a FlowableIllegalArgumentException naming the bad value. Instant.parse requires strict ISO-8601 with offset 'Z' or ±hh:mm.
Solutions
- Correct the variable value to a full ISO-8601 instant string ending with 'Z' or an offset, e.g. 2026-09-10T12:00:00Z.
- Store the value as an Instant/date type in the engine rather than a hand-formatted string.
- Normalize/validate the string with Instant.parse in application code before setVariable.
- If the value genuinely has no time zone, use the 'date' REST type or store a LocalDate representation instead.
Example fix
// before runtimeService.setVariable(executionId, "timestamp", "2026-09-10T12:00:00"); // after runtimeService.setVariable(executionId, "timestamp", "2026-09-10T12:00:00Z");
Defensive patterns
Strategy: validation
Validate before calling
public static boolean isValidInstant(String v) {
if (v == null) return false;
try { java.time.Instant.parse(v); return true; } catch (java.time.format.DateTimeParseException e) { return false; }
} Type guard
public static boolean isParseableInstantString(Object v) { return v instanceof String s && isValidInstant(s); } Try / catch
try {
Object ts = restClient.getVariable(id, "firedAt");
} catch (FlowableIllegalArgumentException e) {
if (e.getMessage().startsWith("The given variable value is not an instant")) {
// re-set the variable with a valid ISO-8601 instant string
} else { throw e; }
} Prevention
- Always include the zone designator: 'Z' or ±hh:mm in stored instant strings.
- Run Instant.parse on values before setVariable to fail fast.
- Never store date-only or local-date-time strings under the instant REST type.
When it happens
Trigger: Reading an 'instant'-typed REST variable whose String value is not valid ISO-8601 instant syntax (e.g. '2026-09-10', '2026-09-10T10:00:00' without zone, '10-09-2026 10:00').
Common situations: Clients storing LocalDateTime/LocalDate strings without the mandatory zone offset; date-only strings; locale-formatted dates written by an external system or manual DB edit.
Related errors
- Converter can only convert instant
- Converter can only convert string to instant
- A group or a user is required to create an identity link.
- A group or a user is required to create an identity link.
- A group or a user is required to create an identity link.
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/fc6703f406b26241.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-common-rest/src/main/java/org/flowable/common/rest/variable/InstantRestVariableConverter.java:44
public String getRestTypeName() {
return "instant";
}
@Override
public Class<?> getVariableType() {
return Instant.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 instant");
}
try {
return Instant.parse((String) result.getValue());
} catch (DateTimeParseException e) {
throw new FlowableIllegalArgumentException("The given variable value is not an instant: '" + result.getValue() + "'", e);
}
}
return null;
}
@Override
public void convertVariableValue(Object variableValue, EngineRestVariable result) {
if (variableValue != null) {
if (!(variableValue instanceof Instant)) {
throw new FlowableIllegalArgumentException("Converter can only convert instant");
}
result.setValue(variableValue.toString());
} else {
result.setValue(null);
}
}
}View on GitHub (pinned to d6d39ce1c6)