flowable/flowable-engine · error · FlowableException
No multi instance execution found for activity id
Error message
No multi instance execution found for activity id
What it means
FlowableException thrown in AddMultiInstanceExecutionCmd.execute when searchForMultiInstanceActivity cannot locate a multi-instance (MI) execution for the given activityId under the given parentExecutionId. Dynamic MI execution addition (runtimeService.addMultiInstanceExecution) only works on activities whose current execution structure is multi-instance.
Solutions
- Confirm the activityId in the BPMN XML actually has multiInstanceLoopCharacteristics and is currently active in the process instance.
- Check the activity is in an active state (use runtimeService.createExecutionQuery().activityId(...) or process instance diagram) before adding executions.
- If the activity is inside a subprocess/callActivity scope, pass the correct parentExecutionId or use the process instance id of the right scope.
Example fix
// before
runtimeService.addMultiInstanceExecution("approveTask", processInstanceId, vars); // task not MI or not active
// after
Execution mi = runtimeService.createExecutionQuery()
.processInstanceId(processInstanceId)
.activityId("approveTask").singleResult();
if (mi != null) {
runtimeService.addMultiInstanceExecution("approveTask", processInstanceId, vars);
} Defensive patterns
Strategy: validation
Validate before calling
long active = runtimeService.createExecutionQuery()
.processInstanceId(processInstanceId)
.activityId(activityId).count();
if (active == 0) {
// no active execution at that activity: cannot add MI executions
} Try / catch
try {
runtimeService.addMultiInstanceExecution(activityId, piId, vars);
} catch (FlowableException e) {
if (e.getMessage().startsWith("No multi instance execution found")) {
// verify BPMN model has multiInstanceLoopCharacteristics on activityId
}
throw e;
} Prevention
- Extract activity ids from the deployed BpmnModel instead of hardcoding strings.
- Verify the activity has multiInstanceLoopCharacteristics before dynamic MI calls.
- Check the MI activity is currently active (not completed/not yet reached).
When it happens
Trigger: Calling runtimeService.addMultiInstanceExecution(activityId, processInstanceId, executionVariables) where activityId is not a multi-instance activity, or is one whose execution has already completed / not yet started, or parentExecutionId does not point at the execution containing the MI activity.
Common situations: Activity id typo or mismatch with the BPMN XML; trying to add executions to a parallel/sequential MI task that has finished; calling against a subprocess activity without supplying the correct parent execution; process model changed (MI marker removed) after ids were baked into calling code.
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
- Active execution could not be found with activity id
- Batch part with id ' ' does not have a batch part document.
- Batch with id ' ' does not have a batch document.
- Call activity '" + executionActivityId + "' loop…
- Cannot associate execution by id: no execution with id '
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/fdebb3af16d5b272.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AddMultiInstanceExecutionCmd.java:58
protected String activityId;
protected String parentExecutionId;
protected Map<String, Object> executionVariables;
public AddMultiInstanceExecutionCmd(String activityId, String parentExecutionId, Map<String, Object> executionVariables) {
this.activityId = activityId;
this.parentExecutionId = parentExecutionId;
this.executionVariables = executionVariables;
}
@Override
public Execution execute(CommandContext commandContext) {
ExecutionEntityManager executionEntityManager = CommandContextUtil.getExecutionEntityManager();
ExecutionEntity miExecution = searchForMultiInstanceActivity(activityId, parentExecutionId, executionEntityManager);
if (miExecution == null) {
throw new FlowableException("No multi instance execution found for activity id " + activityId);
}
if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, miExecution.getProcessDefinitionId())) {
throw new FlowableException("Flowable 5 process definitions are not supported");
}
ExecutionEntity childExecution = executionEntityManager.createChildExecution(miExecution);
childExecution.setCurrentFlowElement(miExecution.getCurrentFlowElement());
BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(miExecution.getProcessDefinitionId());
Activity miActivityElement = (Activity) bpmnModel.getFlowElement(miExecution.getActivityId());
MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = miActivityElement.getLoopCharacteristics();
Integer currentNumberOfInstances = (Integer) miExecution.getVariable(NUMBER_OF_INSTANCES);
miExecution.setVariableLocal(NUMBER_OF_INSTANCES, currentNumberOfInstances + 1);
if (executionVariables != null) {
childExecution.setVariablesLocal(executionVariables);View on GitHub (pinned to d6d39ce1c6)