Activiti/Activiti · error · ActivitiObjectNotFoundException
no deployed process definition found with id '
Error message
no deployed process definition found with id '
What it means
DeploymentManager.findDeployedProcessDefinitionById throws ActivitiObjectNotFoundException when neither the process definition cache nor the process definition entity manager can resolve the given id. This means the id is well-formed and non-null but no deployed process definition with that id exists in this engine's database. The ProcessDefinition.class is attached as the missing entity reference.
Solutions
- Verify the id exists via repositoryService.createProcessDefinitionQuery().processDefinitionId(id).singleResult() before use
- Re-obtain the id from the current database instead of hardcoding it (list latest definitions by key)
- Check you are connected to the correct database/engine (JDBC URL, schema)
- If the deployment was deleted, redeploy the process definition or restore from a backup
Example fix
// before
ProcessDefinition pd = repositoryService.getProcessDefinition(savedId); // may be gone
// after
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(savedId).singleResult();
if (pd == null) {
pd = repositoryService.createProcessDefinitionQuery()
.processDefinitionKey(key).latestVersion().singleResult();
} Defensive patterns
Strategy: try-catch
Validate before calling
// Java, check existence first
long n = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(id).count();
if (n == 0) throw new IllegalStateException("unknown process definition id: " + id); Try / catch
// Java
try {
runtimeService.startProcessInstanceById(defId);
} catch (ActivitiObjectNotFoundException e) {
if (ProcessDefinition.class.equals(e.getObjectClass())) {
// fall back to latest definition by key
return startByKey(fallbackKey);
}
throw e;
} Prevention
- Never hardcode definition ids; resolve them from the same database at runtime
- Confirm dev/staging/prod point at the intended database before using copied ids
- Beware cascading deployment deletes referenced by external systems; prefer suspending over deleting
When it happens
Trigger: Calling repositoryService.getProcessDefinition(id)/startProcessInstanceById(id)/runtime lookups with an id from a different database or engine; using an id deleted by a cascading deployment delete; an id string with wrong casing or whitespace.
Common situations: Copying process definition ids between dev/staging databases; running multiple engine instances against different schemas and mixing ids; cleanup jobs that removed old deployments while external systems still reference their ids.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Cannot find execution with id
- Cannot find process definition for id '
- Cannot find process definition for key '
- Cannot find process definition with id
- Cannot find process definition with id
AI-assisted analysis of Activiti/Activiti@56435b1a97 (2026-09-09).
Data as JSON: /api/errors/948bd9037e11ba59.
Report an issue: GitHub.
Appendix: source
Thrown at activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/deploy/DeploymentManager.java:79
public void deploy(DeploymentEntity deployment, Map<String, Object> deploymentSettings) {
for (Deployer deployer : deployers) {
deployer.deploy(deployment, deploymentSettings);
}
}
public ProcessDefinition findDeployedProcessDefinitionById(String processDefinitionId) {
if (processDefinitionId == null) {
throw new ActivitiIllegalArgumentException("Invalid process definition id : null");
}
// first try the cache
ProcessDefinitionCacheEntry cacheEntry = processDefinitionCache.get(processDefinitionId);
ProcessDefinition processDefinition = cacheEntry != null ? cacheEntry.getProcessDefinition() : null;
if (processDefinition == null) {
processDefinition = processDefinitionEntityManager.findById(processDefinitionId);
if (processDefinition == null) {
throw new ActivitiObjectNotFoundException(
"no deployed process definition found with id '" + processDefinitionId + "'",
ProcessDefinition.class
);
}
processDefinition = resolveProcessDefinition(processDefinition).getProcessDefinition();
}
return processDefinition;
}
public ProcessDefinition findDeployedLatestProcessDefinitionByKey(String processDefinitionKey) {
ProcessDefinition processDefinition = processDefinitionEntityManager.findLatestProcessDefinitionByKey(
processDefinitionKey
);
if (processDefinition == null) {
throw new ActivitiObjectNotFoundException(
"no processes deployed with key '" + processDefinitionKey + "'",
ProcessDefinition.classView on GitHub (pinned to 56435b1a97)