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

FlowableObjectNotFoundException thrown by getDeploymentResource when the deployment exists but contains no resource named resourceName. The deployment's resource list is searched and if the name does not match any entry exactly, this error is raised. Results in HTTP 404.

Source

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

        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessDeploymentById(deployment);
        }

        String pathInfo = request.getPathInfo();
        String resourceName = pathInfo.replace("/repository/deployments/" + deploymentId + "/resources/", "");

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

        if (resourceList.contains(resourceName)) {
            // Build resource representation
            DeploymentResourceResponse response = restResponseFactory.createDeploymentResourceResponse(deploymentId, resourceName, contentTypeResolver.resolveContentType(resourceName));
            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. List exact resource names via GET /repository/deployments/{deploymentId}/resources and copy the 'id' field verbatim
  2. Include the full path prefix stored in the archive when the resource came from a .bar/.zip
  3. Match case exactly — resource lookup is case-sensitive
  4. Confirm the resource was part of this specific deployment, not an earlier one

Example fix

// before
GET /repository/deployments/1/resources/process.bpmn20.xml  // actual id: mypkg/process.bpmn20.xml
// after
GET /repository/deployments/1/resources  -> find exact id
GET /repository/deployments/1/resources/mypkg%2Fprocess.bpmn20.xml
Defensive patterns

Strategy: validation

Validate before calling

const res = await rest.get(`/repository/deployments/${deploymentId}/resources`);
const found = res.data.find(r => r.id === resourceName);
if (!found) throw new Error(`Resource ${resourceName} not in deployment; available: ${res.data.map(r => r.id).join(', ')}`);

Try / catch

try {
    await rest.get(`/repository/deployments/${deploymentId}/resources/${encodeURIComponent(resourceName)}`);
} catch (e) {
    if (e.response?.status === 404) {
        // list resources to discover exact ids (case, path prefix) and retry
    }
}

Prevention

When it happens

Trigger: GET /repository/deployments/{deploymentId}/resources/{resourceName} where the resource name differs in case, path prefix, or spelling from any resource in that deployment.

Common situations: Resource names inside bar/zip archives carry internal paths (e.g. 'order/process.bpmn20.xml'); using only the file name, wrong case (Linux DBs are case-sensitive), or querying a resource that belongs to a different deployment.

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/39244b2dc29b6aac. Report an issue: GitHub.