flowable/flowable-engine · error · FlowableObjectNotFoundException
No case instance found for id = '${caseInstanceId}'.
Error message
No case instance found for id = '${caseInstanceId}'. What it means
Thrown by SetCaseInstanceDueDateCmd.execute when the case instance id passed validation but no CaseInstanceEntity exists for it. The command uses caseInstanceEntityManager.findById and throws FlowableObjectNotFoundException (with CaseInstance.class) when the lookup returns null, aborting the due date update.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/SetCaseInstanceDueDateCmd.java:48
private final String caseInstanceId;
private final Date dueDate;
public SetCaseInstanceDueDateCmd(String caseInstanceId, Date dueDate) {
if (caseInstanceId == null || caseInstanceId.length() < 1) {
throw new FlowableIllegalArgumentException("The case instance id is mandatory, but '" + caseInstanceId + "' has not been provided.");
}
this.caseInstanceId = caseInstanceId;
this.dueDate = dueDate;
}
@Override
public Void execute(CommandContext commandContext) {
CaseInstanceEntityManager caseInstanceEntityManager = CommandContextUtil.getCaseInstanceEntityManager(commandContext);
CaseInstanceEntity caseInstanceEntity = caseInstanceEntityManager.findById(caseInstanceId);
if (caseInstanceEntity == null) {
throw new FlowableObjectNotFoundException("No case instance found for id = '" + caseInstanceId + "'.", CaseInstance.class);
}
caseInstanceEntityManager.updateCaseInstanceDueDate(caseInstanceEntity, dueDate);
return null;
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Confirm existence via cmmnRuntimeService.createCaseInstanceQuery().caseInstanceId(id) before updating
- Check the id is a CMMN case instance id, not a process instance or task id
- Verify the engine points at the intended database/schema
- Catch FlowableObjectNotFoundException and map it to a not-found response
Example fix
// before
cmmnRuntimeService.setCaseInstanceDueDate(caseInstanceId, dueDate);
// after
CaseInstance ci = cmmnRuntimeService.createCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();
if (ci != null) {
cmmnRuntimeService.setCaseInstanceDueDate(caseInstanceId, dueDate);
} Defensive patterns
Strategy: try-catch
Validate before calling
CaseInstance ci = cmmnRuntimeService.createCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();
if (ci == null) { throw new NotFoundException("Case instance not found: " + caseInstanceId); } Try / catch
try {
cmmnRuntimeService.setCaseInstanceDueDate(caseInstanceId, dueDate);
} catch (FlowableObjectNotFoundException e) {
logger.warn("Case instance {} not found", caseInstanceId);
throw new NotFoundException(e.getMessage(), e);
} Prevention
- Check existence before mutating; ids can become stale between calls
- Confirm the engine's datasource matches where the case was created
- Handle case-instance completion races in async flows
When it happens
Trigger: Calling CmmnRuntimeService.setCaseInstanceDueDate(id, dueDate) with a well-formed but unknown case instance id.
Common situations: Stale id after case instance termination/removal; id belonging to a BPMN engine instead of CMMN; multi-tenant or environment mismatch pointing at a different database.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Cannot find case instance for id ${caseInstanceId}
- Cannot find case instance with id
- Cannot find case instance with id
- case instance ${caseInstanceId} doesn't exist
- No case instance found for id = '${caseInstanceId}'.
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/350c7fe6e9b36c73.
Report an issue: GitHub.