flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find a deployment with id '<deploymentId>

Error message

Could not find a deployment with id '<deploymentId>

What it means

After validating ids, getDeploymentResourceData queries DmnDeploymentQuery.deploymentId(deploymentId).singleResult(); if no DMN deployment matches, FlowableObjectNotFoundException is thrown with that id in the message. It means the deployment id does not exist in the DMN engine's ACT_DMN_DEPLOYMENT table (note the message omits the closing quote, a known cosmetic quirk).

Source

Thrown at modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/BaseDecisionResource.java:83

        
        return decision;
    }

    protected byte[] getDeploymentResourceData(String deploymentId, String resourceId, HttpServletResponse response) {

        if (deploymentId == null) {
            throw new FlowableIllegalArgumentException("No deployment id provided");
        }
        if (resourceId == null) {
            throw new FlowableIllegalArgumentException("No resource id provided");
        }

        // Check if deployment exists
        DmnDeploymentQuery deploymentQuery = dmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId);
        
        DmnDeployment deployment = deploymentQuery.singleResult();
        if (deployment == null) {
            throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessDeploymentById(deployment);
        }

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

        if (resourceList.contains(resourceId)) {
            String contentType = contentTypeResolver.resolveContentType(resourceId);
            response.setContentType(contentType);
            try (final InputStream resourceStream = dmnRepositoryService.getResourceAsStream(deploymentId, resourceId)) {
                return IOUtils.toByteArray(resourceStream);
                
            } catch (Exception e) {
                throw new FlowableException("Error converting resource stream", e);
            }
        } else {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the id by listing deployments: GET /dmn-repository/deployments and confirm the id exists.
  2. If you have a BPMN deployment id, query the process-engine REST API instead — DMN deployments are stored separately.
  3. Check your datasource configuration points at the database where the deployment was made.
  4. Re-deploy the DMN artifact if the deployment was deleted, then use the new deployment id.

Example fix

// before
byte[] data = client.getDeploymentResourceData("8a5c...oldId", resourceId); // id deleted
// after
DmnDeploymentResponse dep = client.getDeployment(deploymentId); // 404 surfaces early
if (dep == null) {
    deploymentId = deployDmnModel(new ClassPathResource("my.dmn")).getId();
}
byte[] data = client.getDeploymentResourceData(deploymentId, resourceId);
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check
DmnDeployment dep = dmnRepositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
if (dep == null) throw new IllegalStateException("Unknown DMN deployment: " + deploymentId);

Try / catch

try {
    byte[] data = client.getDeploymentResourceData(deploymentId, resourceId);
} catch (FlowableObjectNotFoundException e) {
    // message starts with 'Could not find a deployment with id' -> refetch deployment list
}

Prevention

When it happens

Trigger: GET /dmn-repository/deployments/{deploymentId}/resources/{resourceId} with a deploymentId that matches no deployment: deleted deployment, id from a process-engine (not DMN) deployment, truncated id, or environment pointing at a different database.

Common situations: Using a BPMN process deployment id against the DMN REST API (separate deployment tables); the deployment was removed by a cleanup job or cascade-delete; staging vs production database confusion; hard-coded ids from another environment.

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