flowable/flowable-engine · error · ActivitiObjectNotFoundException

No process definition found for id

Error message

No process definition found for id '${processDefinitionId}'

What it means

Thrown by SignalEventHandler.handleEvent when a signal event subscription carries a process definition id that is not present in the deployment cache, i.e. no deployed process definition with that id exists. It is an ActivitiObjectNotFoundException with ProcessDefinition.class. Signals targeting a process-definition-level start subscription require the definition to still be deployed.

Solutions

  1. Ensure the referenced process definition is still deployed (check ACT_RE_PROCDEF for the id); redeploy it if it was removed.
  2. Delete stale signal event subscriptions pointing to the removed definition (ACT_RU_EVENT_SUBSCRIBER) instead of signaling them.
  3. Deploy a new process version rather than deleting old definitions that still have live signal subscriptions.
  4. Check that the engine connects to the database where the deployment actually exists.

Example fix

// before: deleting the old definition that still has signal subscriptions
repositoryService.deleteDeployment(oldDeploymentId, true);
// after: keep it, or cascade-delete subscriptions first
List<Execution> subs = runtimeService.createExecutionQuery().signalEventSubscriptionName("mySignal").list();
if (subs.isEmpty()) {
    repositoryService.deleteDeployment(oldDeploymentId, true);
} else {
    repositoryService.suspendProcessDefinitionById(oldDefinitionId);
}
Defensive patterns

Strategy: validation

Validate before calling

ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
    .processDefinitionId(processDefinitionId).singleResult();
if (pd == null) throw new IllegalStateException("Definition not deployed: " + processDefinitionId);

Try / catch

try {
    runtimeService.signalEventReceived(signalName);
} catch (org.activiti.engine.ActivitiObjectNotFoundException e) {
    LOGGER.warn("Signal targets missing definition: {}", e.getMessage());
}

Prevention

When it happens

Trigger: RuntimeSignalEventReceived (or runtimeService.signalEventReceived) resolves an event subscription whose processDefinitionId no longer resolves via DeploymentManager.findDeployedProcessDefinitionById — typically after the process definition was deleted or the deployment cache lost it.

Common situations: Redeploying a new version of a process and deleting the old definition while signal subscriptions on the old definition remain in ACT_RU_EVENT_SUBSCRIBER; manually purging deployments; running against a different database than the one holding the deployment.

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/70a688bc2fae7fbe. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/event/SignalEventHandler.java:55

    @Override
    public String getEventHandlerType() {
        return EVENT_HANDLER_TYPE;
    }

    @Override
    public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) {
        if (eventSubscription.getExecutionId() != null) {
            super.handleEvent(eventSubscription, payload, commandContext);
        } else if (eventSubscription.getProcessDefinitionId() != null) {
            // Start event
            String processDefinitionId = eventSubscription.getProcessDefinitionId();
            DeploymentManager deploymentCache = Context
                    .getProcessEngineConfiguration()
                    .getDeploymentManager();

            ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
            if (processDefinition == null) {
                throw new ActivitiObjectNotFoundException("No process definition found for id '" + processDefinitionId + "'", ProcessDefinition.class);
            }

            ActivityImpl startActivity = processDefinition.findActivity(eventSubscription.getActivityId());
            if (startActivity == null) {
                throw new ActivitiException("Could no handle signal: no start activity found with id " + eventSubscription.getActivityId());
            }
            ExecutionEntity processInstance = processDefinition.createProcessInstance(null, startActivity);
            if (processInstance == null) {
                throw new ActivitiException("Could not handle signal: no process instance started");
            }

            if (payload != null) {
                if (payload instanceof Map) {
                    Map<String, Object> variables = (Map<String, Object>) payload;
                    processInstance.setVariables(variables);
                }
            }

View on GitHub (pinned to d6d39ce1c6)