flowable/flowable-engine · error · FlowableException

No multi instance execution found for

Error message

No multi instance execution found for ${execution}

What it means

DeleteMultiInstanceExecutionCmd deletes an execution of a multi-instance activity. It reads the current activity's loop characteristics from the BPMN model; if the activity has no MultiInstanceLoopCharacteristics (or the model lookup yields a non-Activity element), it throws FlowableException because there is no multi-instance execution to delete.

Solutions

  1. Verify the execution's current activity is a multi-instance activity before calling (check bpmnModel flow element's getLoopCharacteristics() != null).
  2. Pass the execution id of the multi-instance root/child execution, not an unrelated execution.
  3. Ensure the running instance uses the same process definition version where the activity is still multi-instance.
  4. Catch FlowableException and skip when the activity is not multi-instance if your logic only conditionally needs deletion.

Example fix

// before
runtimeService.deleteMultiInstanceExecutionForProcessInstance(executionId);
// after
ExecutionEntity exec = (ExecutionEntity) runtimeService.createExecutionQuery().executionId(executionId).singleResult();
BpmnModel bpmnModel = repositoryService.getBpmnModel(exec.getProcessDefinitionId());
FlowElement el = bpmnModel.getFlowElement(exec.getActivityId());
if (el instanceof Activity && ((Activity) el).getLoopCharacteristics() != null) {
    runtimeService.deleteMultiInstanceExecutionForProcessInstance(executionId);
}
Defensive patterns

Strategy: validation

Validate before calling

ExecutionEntity exec = (ExecutionEntity) runtimeService.createExecutionQuery()
        .executionId(executionId).singleResult();
BpmnModel bpmnModel = repositoryService.getBpmnModel(exec.getProcessDefinitionId());
FlowElement el = bpmnModel.getFlowElement(exec.getActivityId());
boolean isMultiInstance = el instanceof Activity && ((Activity) el).getLoopCharacteristics() != null;
if (isMultiInstance) {
    runtimeService.deleteMultiInstanceExecutionForProcessInstance(executionId);
}

Type guard

boolean isMultiInstanceExecution(RepositoryService rs, ExecutionEntity exec) {
    FlowElement el = rs.getBpmnModel(exec.getProcessDefinitionId()).getFlowElement(exec.getActivityId());
    return el instanceof Activity && ((Activity) el).getLoopCharacteristics() != null;
}

Try / catch

try {
    runtimeService.deleteMultiInstanceExecutionForProcessInstance(executionId);
} catch (FlowableException e) {
    if (e.getMessage().startsWith("No multi instance execution found")) {
        log.info("Execution {} is not multi-instance; skipping", executionId);
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: RuntimeService.deleteMultiInstanceExecutionForProcessInstance/deleteMultiInstanceExecution... on an execution whose current activity is not a multi-instance (MI) activity, or whose activityId does not resolve to an Activity with loopCharacteristics in the deployed BPMN.

Common situations: Calling the delete-multi-instance API after the MI activity already completed; a wrong execution id pointing at a child/regular execution; changing the process model so the activity is no longer multi-instance while old instances are still running (model/version drift).

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/DeleteMultiInstanceExecutionCmd.java:61

    protected String executionId;
    protected boolean executionIsCompleted;

    public DeleteMultiInstanceExecutionCmd(String executionId, boolean executionIsCompleted) {
        this.executionId = executionId;
        this.executionIsCompleted = executionIsCompleted;
    }

    @Override
    public Void execute(CommandContext commandContext) {
        ExecutionEntityManager executionEntityManager = CommandContextUtil.getExecutionEntityManager();
        ExecutionEntity execution = executionEntityManager.findById(executionId);
        
        BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(execution.getProcessDefinitionId());
        Activity miActivityElement = (Activity) bpmnModel.getFlowElement(execution.getActivityId());
        MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = miActivityElement.getLoopCharacteristics();
        
        if (miActivityElement.getLoopCharacteristics() == null) {
            throw new FlowableException("No multi instance execution found for " + execution);
        }
        
        if (!(miActivityElement.getBehavior() instanceof MultiInstanceActivityBehavior)) {
            throw new FlowableException("No multi instance behavior found for " + execution);
        }
        
        if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, execution.getProcessDefinitionId())) {
            throw new FlowableException("Flowable 5 process definitions are not supported for " + execution);
        }
        
        ExecutionEntity miExecution = getMultiInstanceRootExecution(execution);
        executionEntityManager.deleteChildExecutions(execution, "Delete MI execution", false);
        executionEntityManager.deleteExecutionAndRelatedData(execution, "Delete MI execution", false);
        
        int loopCounter = 0;
        if (multiInstanceLoopCharacteristics.isSequential()) {
            SequentialMultiInstanceBehavior miBehavior = (SequentialMultiInstanceBehavior) miActivityElement.getBehavior();
            loopCounter = miBehavior.getLoopVariable(execution, miBehavior.getCollectionElementIndexVariable());

View on GitHub (pinned to d6d39ce1c6)