flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find a resource with id '${resourceName}' in deplo

Error message

Could not find a resource with id '${resourceName}' in deployment '${deploymentId}'.

What it means

The deployment-resource endpoint looks up a resource by name inside a deployment's resource list. If no resource with the given id/name exists in the specified deployment, it throws FlowableObjectNotFoundException. Note the id is the resource NAME (e.g. 'case.cmmn.xml'), not a numeric resource id.

Source

Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/DeploymentResourceResource.java:89

        // Check if deployment exists
        CmmnDeployment deployment = getCmmnDeployment(deploymentId);

        String pathInfo = request.getPathInfo();
        String resourceName = pathInfo.replace("/cmmn-repository/deployments/" + deployment.getId() + "/resources/", "");

        List<String> resourceList = repositoryService.getDeploymentResourceNames(deployment.getId());

        if (resourceList.contains(resourceName)) {
            // Build resource representation
            String contentType = contentTypeResolver.resolveContentType(resourceName);

            DeploymentResourceResponse response = restResponseFactory.createDeploymentResourceResponse(deploymentId, resourceName, contentType);
            return response;

        } else {
            // Resource not found in deployment
            throw new FlowableObjectNotFoundException("Could not find a resource with id '" + resourceName + "' in deployment '" + deploymentId + "'.");
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. GET /repository/deployments/{deploymentId}/resources first and use an exact resource name from that list.
  2. Verify the deploymentId is correct for the environment you are querying.
  3. URL-encode special characters in resourceName so the full name (including .cmmn.xml) reaches the handler.
  4. Catch FlowableObjectNotFoundException and treat it as 404 in client code.

Example fix

// before
get('/repository/deployments/12345/resources/17'); // numeric id

// after
get('/repository/deployments/12345/resources/case.cmmn.xml'); // resource name
Defensive patterns

Strategy: try-catch

Validate before calling

const resources = await get(`/repository/deployments/${deploymentId}/resources`);
if (!resources.some(r => r.id === resourceName)) throw new Error('resource not in deployment');

Try / catch

try {
  return getResource(deploymentId, resourceName);
} catch (FlowableObjectNotFoundException e) {
  throw new NotFoundException("Deployment resource not found: " + resourceName);
}

Prevention

When it happens

Trigger: GET /cmmn-query/repository/deployments/{deploymentId}/resources/{resourceName} where resourceName does not match any resource deployed under that deploymentId (typo, wrong deployment, or passing a numeric id instead of the resource name).

Common situations: Copy-pasting deployment ids across environments, assuming resource ids are integers, redeploying a corrected case under a new deployment id and querying the old one, or URL-encoding issues dropping the .xml extension.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/8529087935f13d66. Report an issue: GitHub.