flowable/flowable-engine · error · FlowableObjectNotFoundException
Could not find a case definition with id
Error message
Could not find a case definition with id '${caseDefinitionId}'. What it means
BaseCaseDefinitionResource.getCaseDefinitionFromRequestWithoutAccessCheck looks up a case definition by id via repositoryService.getCaseDefinition. When no case definition exists for the given id, it throws FlowableObjectNotFoundException carrying CaseDefinition.class so REST mappings translate it to a 404.
Solutions
- Verify the id by listing definitions: GET /cmmn-repository/case-definitions and copy the exact 'id'.
- Check you are not confusing the definition 'key' with the 'id'; the endpoint requires the id.
- Confirm the CMMN deployment still exists and was not removed (check /cmmn-repository/deployments).
- Ensure the REST service connects to the same database/tenant where the definition is deployed.
Example fix
// before GET /cmmn-repository/case-definitions/myCase // key, not id // after GET /cmmn-repository/case-definitions // find exact id GET /cmmn-repository/case-definitions/caseOrderProcess:1:104
Defensive patterns
Strategy: try-catch
Validate before calling
const defs = await get('/cmmn-repository/case-definitions');
const exists = defs.data.some(d => d.id === caseDefinitionId);
if (!exists) throw new Error(`Unknown case definition id: ${caseDefinitionId}`); Try / catch
try {
const def = await getCaseDefinition(id);
} catch (e) {
if (e.response?.status === 404 && /case definition/.test(e.response.data?.message)) {
// refresh id from /case-definitions list and retry once
} else throw e;
} Prevention
- Always resolve ids from the list endpoint instead of hard-coding them.
- Remember REST endpoints take definition id, not key.
- Re-fetch ids after any redeploy or cascade delete.
When it happens
Trigger: Any REST call resolving a case definition path variable, e.g. GET /cmmn-repository/case-definitions/{caseDefinitionId} or POST .../case-definitions/{id}/identity-links, where the id does not match a deployed case definition.
Common situations: Typos in the definition id; referencing a definition that was deleted by a redeploy/cleanup; using a case definition key instead of id; querying a different tenant/database than where it was deployed.
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
- Could not find a case definition with id
- ${aonfe.getMessage()}
- Batch part with id ' ' does not have a batch part document.
- Batch with id ' ' does not have a batch document.
- Cannot find case definition for id:
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/cade397d62538fe4.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/BaseCaseDefinitionResource.java:59
protected CaseDefinition getCaseDefinitionFromRequest(String caseDefinitionId) {
CaseDefinition caseDefinition = getCaseDefinitionFromRequestWithoutAccessCheck(caseDefinitionId);
if (restApiInterceptor != null) {
restApiInterceptor.accessCaseDefinitionById(caseDefinition);
}
return caseDefinition;
}
/**
* Returns the {@link CaseDefinition} that is requested without calling the access interceptor
* Throws the right exceptions when bad request was made or definition was not found.
*/
protected CaseDefinition getCaseDefinitionFromRequestWithoutAccessCheck(String caseDefinitionId) {
CaseDefinition caseDefinition = repositoryService.getCaseDefinition(caseDefinitionId);
if (caseDefinition == null) {
throw new FlowableObjectNotFoundException("Could not find a case definition with id '" + caseDefinitionId + "'.", CaseDefinition.class);
}
return caseDefinition;
}
}
View on GitHub (pinned to d6d39ce1c6)