flowable/flowable-engine · error · FlowableIllegalArgumentException
executionId is empty
Error message
executionId is empty
What it means
InternalVariableInstanceQueryImpl.executionId(String) throws FlowableIllegalArgumentException when the given executionId is null or empty. Variable lookups by execution require a concrete id, so blank input is rejected at query-construction time before any database access.
Solutions
- Obtain the execution id from the correct context (e.g. DelegateExecution.getId()) before querying
- Guard the call site and skip the query when the id is missing
- Validate the id upstream in your service layer
Example fix
// before
query.executionId(executionId); // throws when null/empty
// after
if (executionId != null && !executionId.isEmpty()) {
query.executionId(executionId);
} else {
return Collections.emptyList();
} Defensive patterns
Strategy: validation
Validate before calling
if (executionId == null || executionId.isEmpty()) { throw new IllegalArgumentException("executionId required"); } Type guard
boolean hasExecutionId(String id) { return id != null && !id.isEmpty(); } Try / catch
try { query.executionId(executionId); } catch (FlowableIllegalArgumentException e) { log.warn("Missing executionId for variable query", e); return Collections.emptyList(); } Prevention
- Get execution ids from DelegateExecution inside delegates, not custom fields
- Validate ids from message headers/variables before query construction
- Return early (empty result) when execution context is absent
When it happens
Trigger: Calling executionId(null) or executionId("") — e.g. using ExecutionEntity.getId() outside an active execution, an id from an empty message header, or an uninitialized variable.
Common situations: Code running outside execution context (no current execution id available); execution id taken from a delegate/variable that was never set; refactors leaving the id blank.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- None of the given process categories can be null
- processInstanceId is empty
- scopeId is empty
- Task id list is null
- Task name list is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/801048865229cf5f.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/InternalVariableInstanceQueryImpl.java:104
throw new FlowableIllegalArgumentException("Cannot combine taskIds(Collection) with withoutTaskId() in the same query");
}
this.taskIds = taskIds;
return this;
}
@Override
public InternalVariableInstanceQuery processInstanceId(String processInstanceId) {
if (StringUtils.isEmpty(processInstanceId)) {
throw new FlowableIllegalArgumentException("processInstanceId is empty");
}
this.processInstanceId = processInstanceId;
return this;
}
@Override
public InternalVariableInstanceQuery executionId(String executionId) {
if (StringUtils.isEmpty(executionId)) {
throw new FlowableIllegalArgumentException("executionId is empty");
}
this.executionId = executionId;
return this;
}
@Override
public InternalVariableInstanceQuery executionIds(Collection<String> executionIds) {
if (executionIds == null || executionIds.isEmpty()) {
throw new FlowableIllegalArgumentException("executionIds is null or empty");
}
this.executionIds = executionIds;
return this;
}
@Override
public InternalVariableInstanceQuery withoutTaskId() {
if (taskId != null || taskIds != null) {
throw new FlowableIllegalArgumentException("Cannot combine withoutTaskId() with task(String) or taskIds(Collection) in the same query");View on GitHub (pinned to d6d39ce1c6)