flowable/flowable-engine · error · FlowableIllegalArgumentException

Only string variable values are supported using like, but…

Error message

Only string variable values are supported using like, but was: 

What it means

Flowable's REST task query API throws FlowableIllegalArgumentException when a process-variable predicate uses LIKE with a non-String value. SQL-style pattern matching is only defined for strings, so numeric/boolean/date values are rejected while constructing the TaskQuery.

Solutions

  1. Quote the value in JSON so it is a String (value: "12%" not value: 12).
  2. Use EQUALS (or GREATER_THAN etc.) for non-String variables instead of LIKE.
  3. Convert the pattern to a String on the client before submitting.
  4. Validate request payloads client-side to ensure LIKE variables are strings.

Example fix

// before
{"processVariable": "orderNumber", "variableOperation": "LIKE", "value": 42}
// after
{"processVariable": "orderNumber", "variableOperation": "LIKE", "value": "42%"}
Defensive patterns

Strategy: validation

Validate before calling

if (variable.getValue() != null && !(variable.getValue() instanceof String)) {
    throw new IllegalArgumentException("LIKE requires a String pattern for variable " + variable.getName());
}

Type guard

function isStringVar(v) { return typeof v.value === 'string'; }

Try / catch

try {
    // task query call
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage().contains("Only string variable values are supported using like")) {
        // resend with String pattern or switch operation
    } else throw e;
}

Prevention

When it happens

Trigger: Task query REST call with a processVariable whose variableOperation is LIKE and whose value is not a String (e.g. an integer or boolean pattern value).

Common situations: Building pattern queries programmatically where the value kept its native JSON type, or sending patterns like 12% as a number instead of a quoted string.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskBaseResource.java:551

                break;

            case GREATER_THAN_OR_EQUALS:
                taskQuery.processVariableValueGreaterThanOrEqual(variable.getName(), actualValue);
                break;

            case LESS_THAN:
                taskQuery.processVariableValueLessThan(variable.getName(), actualValue);
                break;

            case LESS_THAN_OR_EQUALS:
                taskQuery.processVariableValueLessThanOrEqual(variable.getName(), actualValue);
                break;

            case LIKE:
                if (actualValue instanceof String) {
                    taskQuery.processVariableValueLike(variable.getName(), (String) actualValue);
                } else {
                    throw new FlowableIllegalArgumentException("Only string variable values are supported using like, but was: " + actualValue.getClass().getName());
                }
                break;

            case LIKE_IGNORE_CASE:
                if (actualValue instanceof String) {
                    taskQuery.processVariableValueLikeIgnoreCase(variable.getName(), (String) actualValue);
                } else {
                    throw new FlowableIllegalArgumentException("Only string variable values are supported using like, but was: " + actualValue.getClass().getName());
                }
                break;

            case EXISTS:
                taskQuery.processVariableExists(variable.getName());
                break;

            case NOT_EXISTS:
                taskQuery.processVariableNotExists(variable.getName());
                break;

View on GitHub (pinned to d6d39ce1c6)