flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided execution id is null

Error message

Provided execution id is null

What it means

ExternalWorkerJobQueryImpl.executionId() requires a non-null execution id and throws FlowableIllegalArgumentException otherwise. The execution id ties external worker jobs to a BPMN execution; null cannot form a valid filter so Flowable validates the argument at query-build time instead of returning misleading results.

Source

Thrown at modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java:381

    }

    @Override
    public ExternalWorkerJobQuery correlationId(String correlationId) {
        if (correlationId == null) {
            throw new FlowableIllegalArgumentException("Provided correlationId is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.correlationId = correlationId;
        } else {
            this.correlationId = correlationId;
        }
        return this;
    }

    @Override
    public ExternalWorkerJobQuery executionId(String executionId) {
        if (executionId == null) {
            throw new FlowableIllegalArgumentException("Provided execution id is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.executionId = executionId;
        } else {
            this.executionId = executionId;
        }
        return this;
    }

    @Override
    public ExternalWorkerJobQuery handlerType(String handlerType) {
        if (handlerType == null) {
            throw new FlowableIllegalArgumentException("Provided handlerType is null");
        }
        if (inOrStatement) {
            this.currentOrQueryObject.handlerType = handlerType;
        } else {
            this.handlerType = handlerType;

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Only call executionId() with a non-null id; use scopeType/scopeId filters for CMMN cases
  2. Guard the call on null before applying the filter
  3. Fix the execution lookup that produced null (wrong process instance?)
  4. Catch FlowableIllegalArgumentException and log the incomplete query context

Example fix

// before
query.executionId(execution == null ? null : execution.getId());
// after
if (execution != null) {
    query.executionId(execution.getId());
}
Defensive patterns

Strategy: validation

Validate before calling

if (executionId == null) { throw new IllegalArgumentException("executionId must not be null"); }
query.executionId(executionId);

Type guard

boolean hasExecutionId(String executionId) { return executionId != null && !executionId.trim().isEmpty(); }

Try / catch

try {
    query.executionId(executionId);
} catch (FlowableIllegalArgumentException e) {
    log.warn("Null execution id in job query: {}", e.getMessage());
    throw new InvalidQueryException(e);
}

Prevention

When it happens

Trigger: Calling externalWorkerJobQuery.executionId(null), typically when the execution variable is optional, a lookup returned null, or the query is built for case-only scenarios where no execution exists.

Common situations: Generic job handlers that filter by execution only for BPMN jobs but pass null for CMMN jobs; refactored code paths where execution context was dropped; deserialized filter objects with missing fields.

Related errors


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