flowable/flowable-engine · error · ActivitiIllegalArgumentException
Involved user is null
Error message
Involved user is null
What it means
ProcessInstanceQuery.involvedUser() rejects a null user id. Involvement is tracked via identity links, and a null user cannot match any identity-link row, so the library fails fast with ActivitiIllegalArgumentException rather than building a query with a meaningless null filter.
Solutions
- Check the user id for null before calling involvedUser and skip the filter when absent.
- Resolve the current authenticated user first and reject requests without one.
- Catch ActivitiIllegalArgumentException around query building to return a 400-style validation response.
- Log the call site where the null id originates to fix the upstream data flow.
Example fix
// before
query.involvedUser(userId); // userId may be null
// after
if (userId != null) {
query.involvedUser(userId);
} Defensive patterns
Strategy: validation
Validate before calling
if (userId == null || userId.isBlank()) {
throw new IllegalArgumentException("involvedUser id must not be null");
}
query.involvedUser(userId); Type guard
boolean hasUserId(String userId) {
return userId != null && !userId.isBlank();
} Try / catch
try {
query.involvedUser(userId);
} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {
// handle null user, e.g. return empty result or 400
} Prevention
- Resolve the authenticated user before building user-scoped queries.
- Use Objects.requireNonNull on ids at API boundaries.
- Skip the involvedUser filter rather than passing null when user context is absent.
When it happens
Trigger: Calling processInstanceQuery().involvedUser(null), typically when the userId variable passed from an upstream layer (session, request parameter, task assignee lookup) is null.
Common situations: Unauthenticated or anonymous users reaching a 'my involved processes' page; a user id lookup that returned null before building the query; optional request parameters mapped straight into the query call.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/eb030f091419cc50.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/ProcessInstanceQueryImpl.java:346
this.subProcessInstanceId = subProcessInstanceId;
}
return this;
}
@Override
public ProcessInstanceQuery excludeSubprocesses(boolean excludeSubprocesses) {
if (inOrStatement) {
this.currentOrQueryObject.excludeSubprocesses = excludeSubprocesses;
} else {
this.excludeSubprocesses = excludeSubprocesses;
}
return this;
}
@Override
public ProcessInstanceQuery involvedUser(String involvedUser) {
if (involvedUser == null) {
throw new ActivitiIllegalArgumentException("Involved user is null");
}
if (inOrStatement) {
this.currentOrQueryObject.involvedUser = involvedUser;
} else {
this.involvedUser = involvedUser;
}
return this;
}
@Override
public ProcessInstanceQuery active() {
if (inOrStatement) {
this.currentOrQueryObject.suspensionState = SuspensionState.ACTIVE;
} else {
this.suspensionState = SuspensionState.ACTIVE;
}
return this;View on GitHub (pinned to d6d39ce1c6)