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

  1. Inspect the cause chain (e.getCause()) in logs to find the real failing activity and error
  2. Fix the inner activity's delegate/expression for the failing iteration's data
  3. Add loop-item validation before the multi-instance activity to avoid bad data reaching the inner task
  4. 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

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


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)