flowable/flowable-engine · error · FlowableObjectNotFoundException

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

Error message

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

What it means

The message event subscription pointed to a processDefinitionId, but no deployed process definition with that id exists in the deployment cache. This typically means the definition was deleted or the deployment cache is stale relative to the subscription's stored configuration.

Source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/StartProcessInstanceByMessageCmd.java:104

        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
        MessageEventSubscriptionEntity messageEventSubscription = processEngineConfiguration.getEventSubscriptionServiceConfiguration().getEventSubscriptionService()
                .findMessageStartEventSubscriptionByName(messageName, tenantId);

        if (messageEventSubscription == null) {
            throw new FlowableObjectNotFoundException("Cannot start process instance by message: no subscription to message with name '" + messageName + "' found.", MessageEventSubscriptionEntity.class);
        }

        String processDefinitionId = messageEventSubscription.getConfiguration();
        if (processDefinitionId == null) {
            throw new FlowableException("Cannot start process instance by message: subscription to message with name '" + messageName + "' is not a message start event.");
        }

        DeploymentManager deploymentCache = processEngineConfiguration.getDeploymentManager();

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

        ProcessInstanceHelper processInstanceHelper = processEngineConfiguration.getProcessInstanceHelper();
        ProcessInstance processInstance = processInstanceHelper.createAndStartProcessInstanceByMessage(processDefinition,
                messageName, businessKey, businessStatus, processVariables, transientVariables, callbackId, callbackType, referenceId, referenceType,
                ownerId, assigneeId);

        return processInstance;
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Re-deploy the process definition so the id resolves in the deployment cache
  2. Delete the stale message event subscription (or redeploy/restart the app so subscriptions rebuild)
  3. Verify you are connected to the same Flowable database the process was deployed to
  4. Check ACT_RE_PROCDEF for the processDefinitionId referenced by the subscription's CONFIGURATION_ column

Example fix

// before: undeployed definition, subscription orphaned
repositoryService.deleteDeployment(deploymentId);
runtimeService.startProcessInstanceByMessage("orderMsg");
// after: redeploy before starting
repositoryService.createDeployment().addClasspathResource("order.bpmn20.xml").deploy();
runtimeService.startProcessInstanceByMessage("orderMsg");
Defensive patterns

Strategy: validation

Validate before calling

ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult();
if (pd == null) throw new IllegalStateException("deploy the process before starting by message");

Type guard

boolean isDeployed(RepositoryService rs, String procDefId) {
    return rs.createProcessDefinitionQuery().processDefinitionId(procDefId).count() > 0;
}

Try / catch

try {
    runtimeService.startProcessInstanceByMessage("orderMsg");
} catch (FlowableObjectNotFoundException e) {
    // redeploy or resolve id from ProcessDefinitionQuery, then retry once
}

Prevention

When it happens

Trigger: Calling RuntimeService.startProcessInstanceByMessage when the subscription's configuration references a process definition id that findDeployedProcessDefinitionById cannot resolve (definition undeployed, database purged, or cascade deletion left orphaned subscriptions).

Common situations: Old deployments were deleted without cleaning message event subscriptions; running against a different database than where the process was deployed; cluster node with stale/partial deployment cache.

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