flowable/flowable-engine · error · ActivitiObjectNotFoundException

no processes deployed with key =

Error message

no processes deployed with key = '<processDefinitionKey>' and version = '<processDefinitionVersion>'

What it means

ActivitiObjectNotFoundException thrown by DeploymentManager.findDeployedProcessDefinitionByKeyAndVersion when no process definition matches both the given key and exact version number. The entity manager query returns null and the manager raises this error. Both conditions must match simultaneously — the key may exist but not at that version.

Solutions

  1. Check available versions: repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).list() and inspect getVersion()
  2. Use latestVersion() query instead of pinning an explicit version
  3. Deploy the missing version if it is genuinely required
  4. If pinning is intentional, derive the version dynamically instead of hard-coding

Example fix

// before
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
    .processDefinitionKey("OrderProcess").processDefinitionVersion(2).singleResult();
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
    .processDefinitionKey("OrderProcess").latestVersion().singleResult();
Defensive patterns

Strategy: validation

Validate before calling

List<ProcessDefinition> versions = repositoryService.createProcessDefinitionQuery()
    .processDefinitionKey(key).orderByProcessDefinitionVersion().desc().list();
if (versions.stream().noneMatch(pd -> version.equals(pd.getVersion()))) {
    throw new IllegalStateException("Version " + version + " not deployed for key " + key);
}

Try / catch

try {
    pd = findDeployedProcessDefinitionByKeyAndVersion(key, version);
} catch (ActivitiObjectNotFoundException e) {
    pd = repositoryService.createProcessDefinitionQuery()
        .processDefinitionKey(key).latestVersion().singleResult();
}

Prevention

When it happens

Trigger: Calling newProcessDefinition-related flows or RuntimeService.startProcessInstanceByKeyAndVersion? wait — this method is internal — practically: any API resolving a definition by key+version (e.g., startProcessInstanceByMessage/DTO flows) where the requested version was never deployed or was removed by deleteDeployment.

Common situations: Hard-coding version numbers that shift after redeployment (auto-incremented versions), requesting version 1 after multiple redeployments cleaned old versions, off-by-one assumptions about the current version.

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

Appendix: source

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

    public ProcessDefinition findDeployedLatestProcessDefinitionByKeyAndTenantId(String processDefinitionKey, String tenantId) {
        ProcessDefinition processDefinition = Context
                .getCommandContext()
                .getProcessDefinitionEntityManager()
                .findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);
        if (processDefinition == null) {
            throw new ActivitiObjectNotFoundException("no processes deployed with key '" + processDefinitionKey + "' for tenant identifier '" + tenantId + "'", ProcessDefinition.class);
        }
        processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();
        return processDefinition;
    }

    public ProcessDefinition findDeployedProcessDefinitionByKeyAndVersion(String processDefinitionKey, Integer processDefinitionVersion) {
        ProcessDefinition processDefinition = (ProcessDefinitionEntity) Context
                .getCommandContext()
                .getProcessDefinitionEntityManager()
                .findProcessDefinitionByKeyAndVersion(processDefinitionKey, processDefinitionVersion);
        if (processDefinition == null) {
            throw new ActivitiObjectNotFoundException("no processes deployed with key = '" + processDefinitionKey + "' and version = '" + processDefinitionVersion + "'", ProcessDefinition.class);
        }
        processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();
        return processDefinition;
    }

    public ProcessDefinitionCacheEntry resolveProcessDefinition(ProcessDefinition processDefinition) {
        String processDefinitionId = processDefinition.getId();
        String deploymentId = processDefinition.getDeploymentId();
        ProcessDefinitionCacheEntry cachedProcessDefinition = processDefinitionCache.get(processDefinitionId);
        if (cachedProcessDefinition == null) {
            DeploymentEntity deployment = Context
                    .getCommandContext()
                    .getDeploymentEntityManager()
                    .findDeploymentById(deploymentId);
            deployment.setNew(false);
            deploy(deployment, null);
            cachedProcessDefinition = processDefinitionCache.get(processDefinitionId);

View on GitHub (pinned to d6d39ce1c6)