flowable/flowable-engine · error · ActivitiIllegalArgumentException
Execution id is null
Error message
Execution id is null
What it means
ExecutionQueryImpl.executionId throws ActivitiIllegalArgumentException when the executionId argument is null. The query builder validates each criterion eagerly, so a null id fails immediately at query-construction time rather than at database execution time.
Solutions
- Resolve a valid execution id before constructing the query
- Skip the executionId criterion if filtering by it is not intended
- Return a clearer domain error at the call site when the id is required but missing
Example fix
// before Execution e = runtimeService.createExecutionQuery().executionId(execId).singleResult(); // after Objects.requireNonNull(execId, "execId is required"); Execution e = runtimeService.createExecutionQuery().executionId(execId).singleResult();
Defensive patterns
Strategy: validation
Validate before calling
Objects.requireNonNull(executionId, "executionId required");
Type guard
boolean hasExecId = executionId != null && !executionId.isEmpty();
Try / catch
try { q.executionId(execId); } catch (ActivitiIllegalArgumentException e) { throw new BadRequestException(e.getMessage(), e); } Prevention
- Chain lookups defensively: check the previous result before using its id
- Fail at entry points with descriptive messages rather than deep in query building
- Prefer Optional<Execution> flows so null ids are handled explicitly
When it happens
Trigger: Calling query.executionId(id) with a null id, usually a variable that was supposed to hold a resolved execution identifier from a prior API result.
Common situations: Chaining service calls where an earlier task/execution lookup returned null; message correlation handlers that receive no execution id; refactors introducing a nullable id field.
Related errors
- Business key is null
- Parent id is null
- Process definition keys is null
- Process definition version is null
- Process instance id is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/6d1f8745bf286718.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java:184
this.businessKey = processInstanceBusinessKey;
this.includeChildExecutionsWithBusinessKeyQuery = includeChildExecutions;
return this;
}
}
@Override
public ExecutionQuery processDefinitionKeys(Set<String> processDefinitionKeys) {
if (processDefinitionKeys == null) {
throw new ActivitiIllegalArgumentException("Process definition keys is null");
}
this.processDefinitionKeys = processDefinitionKeys;
return this;
}
@Override
public ExecutionQueryImpl executionId(String executionId) {
if (executionId == null) {
throw new ActivitiIllegalArgumentException("Execution id is null");
}
this.executionId = executionId;
return this;
}
@Override
public ExecutionQueryImpl activityId(String activityId) {
this.activityId = activityId;
if (activityId != null) {
isActive = true;
}
return this;
}
@Override
public ExecutionQueryImpl parentId(String parentId) {
if (parentId == null) {View on GitHub (pinned to d6d39ce1c6)