flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided execution id is null

Error message

Provided execution id is null

What it means

SuspendedJobQueryImpl.executionId(String) throws FlowableIllegalArgumentException when the given executionId is null. Flowable validates required query parameters at setter time so callers get an immediate, precise error instead of an empty result set or downstream persistence-layer failure. A suspended job filter on execution id must always be a concrete, non-null identifier.

Solutions

  1. Resolve the execution id via RuntimeService before querying and confirm it is non-null.
  2. Only apply the executionId filter when the value exists; otherwise query on other criteria (processInstanceId, handlerType).
  3. If the execution is expected to exist, check whether the process instance has completed/been deleted and use the historic service instead.

Example fix

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

Strategy: validation

Validate before calling

if (executionId == null) {
    throw new IllegalStateException("executionId not resolved; cannot query suspended jobs by execution");
}

Type guard

boolean hasExecution(Execution e) { return e != null && e.getId() != null; }

Try / catch

try {
    query.executionId(executionId);
} catch (FlowableIllegalArgumentException e) {
    // fall back to processInstanceId or skip the execution filter
    query.processInstanceId(processInstanceId);
}

Prevention

When it happens

Trigger: Calling executionId(null) directly, or passing the result of execution.getId() from a variable that was not loaded (e.g. process instance ended and execution no longer resolvable, or a variable/DTO field that is null).

Common situations: Admin tooling listing suspended jobs per process instance where the execution id lookup returned null after the process ended; batch scripts that read execution ids from files/DB and hit missing rows.

Related errors


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

Appendix: source

Thrown at modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/SuspendedJobQueryImpl.java:383

    }

    @Override
    public SuspendedJobQueryImpl 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 SuspendedJobQueryImpl 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 SuspendedJobQueryImpl 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)