flowable/flowable-engine · error · FlowableIllegalArgumentException
There is no batch with the id ${configuration}
Error message
There is no batch with the id ${configuration} What it means
Thrown by ComputeDeleteHistoricCaseInstanceStatusJobHandler.execute() when its periodic status-check job runs but the parent Batch (looked up via createBatchQuery().batchId(configuration)) no longer exists. The job's 'configuration' holds the batch id; without the batch, completion status cannot be computed.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/delete/ComputeDeleteHistoricCaseInstanceStatusJobHandler.java:57
public class ComputeDeleteHistoricCaseInstanceStatusJobHandler implements JobHandler {
public static final String TYPE = "compute-delete-historic-case-status";
@Override
public String getType() {
return TYPE;
}
@Override
public void execute(JobEntity job, String configuration, VariableScope variableScope, CommandContext commandContext) {
CmmnEngineConfiguration engineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);
CmmnManagementService managementService = engineConfiguration.getCmmnManagementService();
Batch batch = managementService.createBatchQuery()
.batchId(configuration)
.singleResult();
if (batch == null) {
throw new FlowableIllegalArgumentException("There is no batch with the id " + configuration);
}
if (DeleteCaseInstanceBatchConstants.STATUS_STOPPED.equals(batch.getStatus())) {
// The batch has been stopped there is nothing that we need to check anymore, so we will set the repeat to null
job.setRepeat(null);
return;
}
long totalBatchParts = createStatusQuery(batch, managementService).count();
long totalCompleted = createStatusQuery(batch, managementService).completed().count();
if (totalBatchParts == totalCompleted) {
long totalFailed = createStatusQuery(batch, managementService)
.status(DeleteCaseInstanceBatchConstants.STATUS_FAILED)
.count();
if (totalFailed == 0) {
List<BatchPart> deleteBatchParts = managementService.createBatchPartQuery()View on GitHub (pinned to d6d39ce1c6)
Solutions
- Cancel the repeat job (delete the job entity) when deleting the batch so no orphan status job remains
- Restore/verify the batch id in ACT_RU_BATCH matches the job configuration
- Check job configuration points to the correct engine/database
- Clear stale jobs after data purges
Example fix
// before managementService.deleteBatch(batchId); // leaves status job behind // after managementService.deleteBatch(batchId); managementService.deleteBulkIdJobs / cancel jobs with configuration=batchId; // cancel related jobs too
Defensive patterns
Strategy: try-catch
Validate before calling
Batch b = managementService.createBatchQuery().batchId(batchId).singleResult();
if (b == null) { // cancel the orphan repeat job instead of letting it run
managementService.deleteJob(jobId); } Try / catch
try { jobHandler.execute(job, configuration, scope, ctx); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().contains("no batch with the id")) { log.warn("Batch gone; removing orphan status job", e); managementService.deleteJob(job.getId()); } } Prevention
- Cancel repeat/status jobs when deleting a batch
- Avoid manual SQL purges of ACT_RU_BATCH without also cleaning jobs
- Keep job execution and batch storage in the same environment/database
When it happens
Trigger: The repeat job fires after the Batch entity was deleted (manually removed, purged by cleanup, or deleted by another management operation), so the query returns null.
Common situations: Manual database cleanup deleting ACT_RU_BATCH rows while repeat jobs remain; batch deletion via management API without cancelling its compute-status jobs; environment mismatch (job from a different database).
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- There is no batch with the id ${configuration}
- There is no batch part with the id ${configuration}
- There is no batch part with the id ${batchPartId}
- There are no case instance ids to delete
- type is null
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/17a5c723e6bf8d93.
Report an issue: GitHub.