flowable/flowable-engine · error · FlowableIllegalArgumentException

Provided execution id is null

Error message

Provided execution id is null

What it means

JobQueryImpl.executionId(String) rejects a null execution id with FlowableIllegalArgumentException before storing it as a query filter. Execution id ties jobs to a specific BPMN execution; null would make the filter invalid, so the library fails fast at query construction. This is thrown before any database interaction, purely from argument validation.

Source

Thrown at modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/JobQueryImpl.java:373

    }

    @Override
    public JobQueryImpl 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 JobQueryImpl 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 JobQueryImpl 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. Null-check the execution id before calling and skip the filter when absent
  2. Use processInstanceId instead when you have the process instance but not the execution id
  3. Verify the execution still exists at runtime (runtimeService.createExecutionQuery()) before querying its jobs
  4. Fix the upstream code that should populate the execution id field

Example fix

// before
List<Job> jobs = jobService.createJobQuery().executionId(executionId).list();
// after
if (executionId != null) {
    List<Job> jobs = jobService.createJobQuery().executionId(executionId).list();
} else {
    List<Job> jobs = jobService.createJobQuery().processInstanceId(processInstanceId).list();
}
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

boolean hasExecutionId(String id) { return id != null; }

Try / catch

try {
    jobQuery.executionId(executionId);
} catch (FlowableIllegalArgumentException e) {
    logger.warn("executionId was null", e);
}

Prevention

When it happens

Trigger: Calling jobQuery.executionId(null); commonly when the execution id comes from a DelegateExecution/Task field that was null (e.g. a task not tied to an execution), or from a lookup that found no execution.

Common situations: Passing executionId from a historic record whose runtime execution was removed; using the method on job/async-executor code paths where the execution context is absent; copy-pasted query builders where the variable was never set.

Related errors


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