flowable/flowable-engine · error · FlowableException
Cannot start process instance. Process model (id = " +…
Error message
Cannot start process instance. Process model (id = " + processDefinitionId + ") could not be found for " + eventSubscription
What it means
Thrown by CompensationEventHandler.handleEvent when the process model for the compensating execution's processDefinitionId cannot be resolved via ProcessDefinitionUtil.getProcess. Compensation needs the parsed BPMN model to find the compensation handler element; if the model is missing, compensation cannot proceed to start/continue the compensating activity.
Solutions
- Ensure the original process definition and deployment still exist while instances referencing it run - do not cascade-delete deployments with active instances.
- Check ACT_RE_PROCDEF for the processDefinitionId in the message; re-deploy the original BPMN XML if it was deleted.
- Cancel the stuck process instance (deleteProcessInstance) and start a fresh one on the current definition.
- If a tenant/multi-tenant setup is used, verify the definition is deployed under the expected tenant.
Defensive patterns
Strategy: validation
Validate before calling
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(processDefinitionId).singleResult();
if (pd == null) {
throw new IllegalStateException("definition deleted while instances may still compensate");
} Try / catch
try {
/* trigger compensation */
} catch (FlowableException e) {
if (e.getMessage().contains("could not be found")) {
// redeploy the original BPMN or cancel the stuck instance
}
} Prevention
- Never cascade-delete deployments with active process instances.
- Re-deploy the same BPMN resource when re-publishing instead of deleting old versions.
- Monitor for event subscriptions referencing missing process definitions.
- In multi-tenant setups, verify deployments per tenant.
When it happens
Trigger: handleEvent resolves compensatingExecution and calls ProcessDefinitionUtil.getProcess(processDefinitionId), which returns null - e.g. the process definition was deleted/undeployed while process instances were still running, the definition cache misses the model, or the definition id is stale/invalid.
Common situations: Redeploying with cascade deletion of old definitions while runtime instances still reference them; deleting deployments from ACT_RE_* while compensation subscriptions exist in ACT_RU_*; environment where the definition was deployed to a different database; cache/tenant mismatch.
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
- Invalid attribute value for 'activityRef': no activity with…
- Process model for could not be found
- Process model (id = ) could not be found for
- Cannot find bpmn model for process definition id
- Cannot start process instance. Process definition
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/9b8afee2f5ce3907.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/event/CompensationEventHandler.java:62
public String getEventHandlerType() {
return CompensateEventSubscriptionEntity.EVENT_TYPE;
}
@Override
public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) {
String configuration = eventSubscription.getConfiguration();
if (configuration == null) {
throw new FlowableException("Compensating execution not set for " + eventSubscription);
}
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
ExecutionEntity compensatingExecution = processEngineConfiguration.getExecutionEntityManager().findById(configuration);
String processDefinitionId = compensatingExecution.getProcessDefinitionId();
Process process = ProcessDefinitionUtil.getProcess(processDefinitionId);
if (process == null) {
throw new FlowableException("Cannot start process instance. Process model (id = " + processDefinitionId + ") could not be found for " + eventSubscription);
}
FlowElement flowElement = process.getFlowElement(eventSubscription.getActivityId(), true);
if (flowElement instanceof SubProcess && !((SubProcess) flowElement).isForCompensation()) {
// descend into scope:
compensatingExecution.setScope(true);
List<CompensateEventSubscriptionEntity> eventsForThisScope = processEngineConfiguration.getEventSubscriptionServiceConfiguration().getEventSubscriptionService()
.findCompensateEventSubscriptionsByExecutionId(compensatingExecution.getId());
ScopeUtil.throwCompensationEvent(eventsForThisScope, compensatingExecution, false);
} else {
try {
FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();
if (eventDispatcher != null && eventDispatcher.isEnabled()) {
View on GitHub (pinned to d6d39ce1c6)