flowable/flowable-engine · error · FlowableIllegalArgumentException

Unsupported variable query operation: ${operation}

Error message

Unsupported variable query operation: ${operation}

What it means

This FlowableIllegalArgumentException is the default branch of the variable-operation switch in TaskBaseResource.addTaskvariables. It fires when a task query variable specifies a QueryVariableOperation that the task-query builder does not implement. The REST API only supports a fixed set: equals, notEquals, equalsIgnoreCase, notEqualsIgnoreCase, like, likeIgnoreCase, greaterThan, greaterThanOrEquals, lessThan, lessThanOrEquals, exists, notExists.

Source

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

            case LIKE_IGNORE_CASE:
                if (actualValue instanceof String) {
                    taskQuery.taskVariableValueLikeIgnoreCase(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.taskVariableExists(variable.getName());
                break;

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

            default:
                throw new FlowableIllegalArgumentException("Unsupported variable query operation: " + variable.getVariableOperation());
            }
        }
    }

    protected void addProcessvariables(TaskQuery taskQuery, List<QueryVariable> variables) {
        for (QueryVariable variable : variables) {
            if (variable.getVariableOperation() == null) {
                throw new FlowableIllegalArgumentException("Variable operation is missing for variable: " + variable.getName());
            }
            if (variable.getVariableOperation() != QueryVariableOperation.EXISTS && variable.getVariableOperation() != QueryVariableOperation.NOT_EXISTS) {
                if (variable.getValue() == null) {
                    throw new FlowableIllegalArgumentException("Variable value is missing for variable: " + variable.getName());
                }
            }

            boolean nameLess = variable.getName() == null;

            Object actualValue = restResponseFactory.getVariableValue(variable);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Check the spelling of the operation field against the supported QueryVariableOperation enum values.
  2. Replace unsupported operators (e.g. "in", "between") with combinations of supported ones (multiple criteria or range via greaterThan/lessThan).
  3. If an operation exists in newer Flowable docs, upgrade the Flowable version rather than sending it to an older engine.

Example fix

// before
{"taskVariables":[{"name":"status","operation":"contains","value":"open"}]}
// after
{"taskVariables":[{"name":"status","operation":"like","value":"%open%"}]}
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = ['equals','notEquals','equalsIgnoreCase','notEqualsIgnoreCase','like','likeIgnoreCase','greaterThan','greaterThanOrEquals','lessThan','lessThanOrEquals','exists','notExists'];
for (const v of body.taskVariables || []) {
  if (!SUPPORTED.includes(v.operation)) throw new Error('Unsupported operation: ' + v.operation);
}

Type guard

const isSupportedOperation = op => ['equals','notEquals','equalsIgnoreCase','notEqualsIgnoreCase','like','likeIgnoreCase','greaterThan','greaterThanOrEquals','lessThan','lessThanOrEquals','exists','notExists'].includes(op);

Try / catch

try {
  // query call
} catch (e) {
  if (String(e.message).startsWith('Unsupported variable query operation')) {
    // correct the operation and retry with a supported operator
  } else throw e;
}

Prevention

When it happens

Trigger: POST /cmmn-query/tasks with a taskVariables entry whose operation is an unknown string (e.g. "contains", "in", "between") or a typo such as "equlas".

Common situations: Copy-pasted query bodies from other Flowable APIs (e.g. process-instance or history queries with different supported operations), typos, newer operations used against an older Flowable version that doesn't recognize them.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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