flowable/flowable-engine · error · FlowableIllegalArgumentException
Provided job id is null
Error message
Provided job id is null
What it means
Flowable's TimerJobQueryImpl.jobId(String) throws FlowableIllegalArgumentException when the caller passes a null job id. The query API validates every filter argument up front so that an invalid query fails fast at build time rather than producing a broken SQL query or silently empty results. Passing null to a single-value filter is never meaningful, so it is rejected unconditionally.
Source
Thrown at modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/TimerJobQueryImpl.java:98
protected boolean inOrStatement;
public TimerJobQueryImpl() {
}
public TimerJobQueryImpl(CommandContext commandContext, JobServiceConfiguration jobServiceConfiguration) {
super(commandContext);
this.jobServiceConfiguration = jobServiceConfiguration;
}
public TimerJobQueryImpl(CommandExecutor commandExecutor, JobServiceConfiguration jobServiceConfiguration) {
super(commandExecutor);
this.jobServiceConfiguration = jobServiceConfiguration;
}
@Override
public TimerJobQueryImpl jobId(String jobId) {
if (jobId == null) {
throw new FlowableIllegalArgumentException("Provided job id is null");
}
if (inOrStatement) {
this.currentOrQueryObject.id = jobId;
} else {
this.id = jobId;
}
return this;
}
@Override
public TimerJobQuery jobIds(Collection<String> jobIds) {
if (jobIds == null) {
throw new FlowableIllegalArgumentException("Provided job id list is null");
}
if (inOrStatement) {
this.currentOrQueryObject.jobIds = jobIds;
} else {
this.jobIds = jobIds;View on GitHub (pinned to d6d39ce1c6)
Solutions
- Ensure the jobId value is populated before building the query (check the source variable/expression for null)
- If the job may not exist, guard the query call: only build/run the query when id != null
- If you intended a broad query, omit the jobId() filter entirely instead of passing null
- Catch FlowableIllegalArgumentException and handle it as invalid input if the id comes from user input
Example fix
// before
timerJobQuery.jobId(variables.get("timerJobId"));
// after
String jobId = (String) variables.get("timerJobId");
if (jobId != null) {
timerJobQuery.jobId(jobId);
} Defensive patterns
Strategy: validation
Validate before calling
if (jobId == null) { throw new IllegalArgumentException("jobId is required before calling timerJobQuery.jobId()"); } Type guard
boolean hasJobId(String jobId) { return jobId != null && !jobId.isEmpty(); } Try / catch
try { query.jobId(jobId); } catch (FlowableIllegalArgumentException e) { log.warn("Invalid job id filter: {}", e.getMessage()); } Prevention
- Null-check ids before applying query filters
- Skip filters conditionally instead of passing null to clear them
- Wrap query building in a helper that ignores null filter values
- Validate ids at API boundaries before they reach service code
When it happens
Trigger: Calling timerJobService.createTimerJobQuery().jobId(null), directly or via wrapper code that forwards an uninitialized/nullable variable.
Common situations: Resolving a job id from a optional configuration property, a REST parameter, or a process variable that is unset; refactoring code where the id variable became nullable; passing a lookup result that returned null because the entity does not exist.
Related errors
- Business key is null
- Business status is null
- Process definition category is null
- categoryLike is null
- categoryNotEquals is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/2b43b4d5b967860a.
Report an issue: GitHub.