flowable/flowable-engine · error · FlowableException
Could not execute inner activity behavior of multi instance…
Error message
Could not execute inner activity behavior of multi instance behavior for ${execution} What it means
SequentialMultiInstanceBehavior.continueSequentialMultiInstance wraps any exception raised while executing the inner activity behavior of a sequential multi-instance loop into a FlowableException with cause e (re-throwing BusinessError untouched). This is a wrapper: the real problem is in the inner activity, retrievable via getCause().
Solutions
- Inspect the cause chain (e.getCause()) in logs to find the real failing activity and error
- Fix the inner activity's delegate/expression for the failing iteration's data
- Add loop-item validation before the multi-instance activity to avoid bad data reaching the inner task
- If a business fault is intended, model it as a BPMN error event (BusinessError is re-thrown and can be caught by an error boundary event)
Example fix
// before
try {
executeInner(execution);
} catch (Exception e) {
log.error("multi-instance failed", e); // only sees wrapper
}
// after
try {
executeInner(execution);
} catch (FlowableException e) {
Throwable cause = e.getCause();
log.error("inner activity failed: {}", cause == null ? e : cause);
} Defensive patterns
Strategy: try-catch
Try / catch
try {
processEngine.getRuntimeService().signal(executionId);
} catch (FlowableException e) {
Throwable cause = e.getCause();
// log/inspect cause — the real inner-activity failure is there
if (cause instanceof BpmnError) {
// route to error boundary event handling
}
} Prevention
- Always inspect getCause() on this wrapper exception
- Validate loop collection items before entering the multi-instance activity
- Model expected business faults as BPMN errors so they are re-thrown as BusinessError
When it happens
Trigger: Any RuntimeException thrown by the inner behavior during a sequential multi-instance loop iteration — e.g. the inner service task's delegate throws, a sub-process fails — while continueSequentialMultiInstance advances the loop.
Common situations: Java delegates or expressions failing for specific loop iterations (bad data in one collection element), class-loading errors for the inner delegate, or database errors during iteration — surfacing as this generic wrapper in logs.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- Call activity '" + executionActivityId + "' loop…
- Cannot autoMap activity migration for '" +…
- doesn't implement FlowableCollectionHandler
- Expected an activity behavior in flow node
- Invalid number of instances: must be a non-negative integer…
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/5c23555f17df9673.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/SequentialMultiInstanceBehavior.java:131
executionToContinue.setScope(true);
executeOriginalBehavior(executionToContinue, multiInstanceRootExecution, loopCounter);
} else {
CommandContextUtil.getActivityInstanceEntityManager().recordActivityEnd((ExecutionEntity) execution, null);
// Delete all local variables
Set<String> localVariableInstances = execution.getVariableInstancesLocal().keySet();
localVariableInstances.remove(NUMBER_OF_INSTANCES);
localVariableInstances.remove(NUMBER_OF_COMPLETED_INSTANCES);
localVariableInstances.remove(NUMBER_OF_ACTIVE_INSTANCES);
execution.removeVariablesLocal(localVariableInstances);
executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter);
}
} catch (BusinessError error) {
// re-throw business fault so that it can be caught by an Error
// Intermediate Event or Error Event Sub-Process in the process
throw error;
} catch (Exception e) {
throw new FlowableException("Could not execute inner activity behavior of multi instance behavior for " + execution, e);
}
}
}
View on GitHub (pinned to d6d39ce1c6)