flowable/flowable-engine · error · ActivitiObjectNotFoundException

no deployed process definition found with id

Error message

no deployed process definition found with id '<processDefinitionId>'

What it means

The database lookup inside findProcessDefinitionByIdFromDatabase returned no row for the given (non-null) id, so the engine throws ActivitiObjectNotFoundException('no deployed process definition found with id ...', ProcessDefinition.class). Called mainly by isProcessDefinitionSuspended, so suspension checks fail when the definition is absent from ACT_RE_PROCDEF.

Solutions

  1. Confirm via query: repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult(); if null, obtain the correct id by key/latestVersion
  2. If the deployment was deleted intentionally, stop making suspension calls for it and clean dependent jobs/instances
  3. If deleted unintentionally, redeploy the BPMN and update stored references to the new definition id
  4. Audit ACT_RE_PROCDEF vs ACT_RU_JOB rows to find references to removed definitions

Example fix

// before
if (repositoryService.isProcessDefinitionSuspended(storedId)) { ... }
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
    .processDefinitionKey(key).latestVersion().singleResult();
if (pd == null) throw new IllegalStateException("no deployed definition for key " + key);
if (pd.isSuspended()) { ... } // avoids the raw id lookup entirely
Defensive patterns

Strategy: validation

Validate before calling

ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
    .processDefinitionId(id).singleResult();
if (pd == null) {
  pd = repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey(key).latestVersion().singleResult(); // fallback by key
}
if (pd == null) throw new IllegalStateException("no deployed definition for id=" + id + " key=" + key);
boolean suspended = pd.isSuspended(); // avoids the raw id DB lookup

Type guard

boolean isDeployedInDb(String id) {
  return id != null && repositoryService.createProcessDefinitionQuery()
      .processDefinitionId(id).count() > 0;
}

Try / catch

try {
  boolean suspended = repositoryService.isProcessDefinitionSuspended(id);
} catch (FlowableObjectNotFoundException e) {
  if (e.getObjectClass() != null && ProcessDefinition.class.equals(e.getObjectClass())) {
    log.warn("definition {} gone from DB; treat as suspended/inactive", id);
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling isProcessDefinitionSuspended / findProcessDefinitionByIdFromDatabase with an id that is not in the database — deleted deployment, wrong-environment id, or an id of a definition never deployed.

Common situations: Timer suspension handlers resolving ids that were removed by deleteDeployment; mixed-version cluster nodes or split databases; hardcoded definition ids in scripts that break after redeploys.

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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java:97

            processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();

        } else {
            processDefinition = cacheEntry.getProcessDefinition();
        }
        return processDefinition;
    }

    public ProcessDefinitionEntity findProcessDefinitionByIdFromDatabase(String processDefinitionId) {
        if (processDefinitionId == null) {
            throw new ActivitiIllegalArgumentException("Invalid process definition id : null");
        }

        ProcessDefinitionEntity processDefinition = Context.getCommandContext()
                .getProcessDefinitionEntityManager()
                .findProcessDefinitionById(processDefinitionId);

        if (processDefinition == null) {
            throw new ActivitiObjectNotFoundException("no deployed process definition found with id '" + processDefinitionId + "'", ProcessDefinition.class);
        }

        return processDefinition;
    }

    public boolean isProcessDefinitionSuspended(String processDefinitionId) {
        return findProcessDefinitionByIdFromDatabase(processDefinitionId).isSuspended();
    }

    public BpmnModel getBpmnModelById(String processDefinitionId) {
        if (processDefinitionId == null) {
            throw new ActivitiIllegalArgumentException("Invalid process definition id : null");
        }

        // first try the cache
        BpmnModel bpmnModel = bpmnModelCache.get(processDefinitionId);

        if (bpmnModel == null) {

View on GitHub (pinned to d6d39ce1c6)