flowable/flowable-engine · error · ActivitiIllegalArgumentException
Provided execution id is null
Error message
Provided execution id is null
What it means
Thrown by EventSubscriptionQueryImpl.executionId when a null execution id is passed as a query criterion. The eager validation ensures queries are well-formed when built; a null executionId filter is not a meaningful criterion and is rejected with ActivitiIllegalArgumentException. It points to a caller bug rather than an engine problem.
Solutions
- Null-check the execution id and skip the executionId criterion when it is absent
- Fix the upstream code that should supply a valid execution id (e.g. use execution.getId() of a live DelegateExecution)
- If filtering by execution is conditional, build the query conditionally instead of passing null
- Log/validate the id source to find why it is null at query time
Example fix
// before
EventSubscriptionQuery q = runtimeService.createEventSubscriptionQuery().executionId(execId);
// after
EventSubscriptionQuery q = runtimeService.createEventSubscriptionQuery();
if (execId != null) {
q = q.executionId(execId);
} Defensive patterns
Strategy: validation
Validate before calling
if (executionId == null) { throw new IllegalArgumentException("executionId must be non-null before querying"); }
query.executionId(executionId); Type guard
boolean hasExecutionId(DelegateExecution e) { return e != null && e.getId() != null; } Try / catch
try {
query.executionId(execId);
} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {
// execId was null: verify you hold a live execution reference
} Prevention
- Use execution.getId() from a live DelegateExecution rather than cached/stale references
- Null-check ids from process variables before querying
- Build criteria conditionally when the execution scope is uncertain
When it happens
Trigger: Calling createEventSubscriptionQuery().executionId(null), often when the execution id comes from an Execution/DelegateExecution reference that is null or from a variable holding an optional id.
Common situations: Using execution.getId() inside a delegate where the execution is not yet available; ids stored in process variables that were not set; refactored code where an earlier execution lookup now returns null.
Related errors
- Provided activity id is null
- Provided event name is null
- Provided event subscription id is null
- Provided process instance id is null
- activity tenant id is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/2e9d75d662eede24.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/EventSubscriptionQueryImpl.java:65
public EventSubscriptionQueryImpl eventSubscriptionId(String id) {
if (eventSubscriptionId == null) {
throw new ActivitiIllegalArgumentException("Provided event subscription id is null");
}
this.eventSubscriptionId = id;
return this;
}
public EventSubscriptionQueryImpl eventName(String eventName) {
if (eventName == null) {
throw new ActivitiIllegalArgumentException("Provided event name is null");
}
this.eventName = eventName;
return this;
}
public EventSubscriptionQueryImpl executionId(String executionId) {
if (executionId == null) {
throw new ActivitiIllegalArgumentException("Provided execution id is null");
}
this.executionId = executionId;
return this;
}
public EventSubscriptionQueryImpl processInstanceId(String processInstanceId) {
if (processInstanceId == null) {
throw new ActivitiIllegalArgumentException("Provided process instance id is null");
}
this.processInstanceId = processInstanceId;
return this;
}
public EventSubscriptionQueryImpl activityId(String activityId) {
if (activityId == null) {
throw new ActivitiIllegalArgumentException("Provided activity id is null");
}
this.activityId = activityId;
View on GitHub (pinned to d6d39ce1c6)