flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find a deployment with id

Error message

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

What it means

FlowableObjectNotFoundException thrown when no EventDeployment exists for the supplied deployment id. The id is syntactically present but does not correspond to any deployment in the event registry repository.

Solutions

  1. Verify the id via GET /event-registry-repository/deployments and use an id from that list.
  2. Check the event registry engine is pointed at the database where the deployment was made (compare datasource config).
  3. Re-deploy the event definitions if the deployment was deleted by the deployment cleanup job.

Example fix

// before
String id = oldConfig.get("deploymentId"); // stale id from a wiped test DB
// after
String id = deploymentList.stream().filter(d -> d.getName().equals("events")).findFirst().get().getId();
Defensive patterns

Strategy: try-catch

Validate before calling

boolean exists = repositoryService.createDeploymentQuery().deploymentId(deploymentId).count() > 0;

Try / catch

try { ... } catch (FlowableObjectNotFoundException e) { return ResponseEntity.status(404).body(e.getMessage()); }

Prevention

When it happens

Trigger: GET .../deployments/{deploymentId}/resources/{resourceName} with an id that was never deployed, was deleted, or belongs to a different database/schema.

Common situations: Referencing ids from another Flowable app (process vs event registry tables), stale ids after redeployment cleanup, pointing at a different database in test vs prod, or truncated/copy-pasted ids.

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

Appendix: source

Thrown at modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/BaseDeploymentResourceDataResource.java:57

    @Autowired
    protected EventRepositoryService repositoryService;
    
    @Autowired(required=false)
    protected EventRegistryRestApiInterceptor restApiInterceptor;

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

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

        // Check if deployment exists
        EventDeployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
        if (deployment == null) {
            throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", EventDeployment.class);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessDeploymentById(deployment);
        }

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

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

View on GitHub (pinned to d6d39ce1c6)