flowable/flowable-engine · error · FlowableException
No initial activity found for subprocess + subProcess.getId(
Error message
No initial activity found for subprocess + subProcess.getId() + in + execution
What it means
SubProcessActivityBehavior.execute looks up the start element that begins the embedded subprocess. If the subprocess model contains no usable initial activity (no start event or none resolvable), the engine cannot enter the subprocess and throws this FlowableException. It almost always means the deployed BPMN model for the subprocess is malformed.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/SubProcessActivityBehavior.java:56
*/
public class SubProcessActivityBehavior extends AbstractBpmnActivityBehavior {
private static final long serialVersionUID = 1L;
protected boolean isOnlyNoneStartEventAllowed;
public SubProcessActivityBehavior() {
this.isOnlyNoneStartEventAllowed = true;
}
@Override
public void execute(DelegateExecution execution) {
SubProcess subProcess = getSubProcessFromExecution(execution);
FlowElement startElement = getStartElement(subProcess);
if (startElement == null) {
throw new FlowableException("No initial activity found for subprocess " + subProcess.getId() + " in " + execution);
}
ExecutionEntity executionEntity = (ExecutionEntity) execution;
executionEntity.setScope(true);
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();
// initialize the template-defined data objects as variables
Map<String, Object> dataObjectVars = processDataObjects(subProcess.getDataObjects());
if (dataObjectVars != null) {
executionEntity.setVariablesLocal(dataObjectVars);
}
CommandContext commandContext = Context.getCommandContext();
ProcessInstanceHelper processInstanceHelper = processEngineConfiguration.getProcessInstanceHelper();
processInstanceHelper.processAvailableEventSubProcesses(executionEntity, subProcess, commandContext);
ExecutionEntity startSubProcessExecution = CommandContextUtil.getExecutionEntityManager(commandContext).createChildExecution(executionEntity);View on GitHub (pinned to d6d39ce1c6)
Solutions
- Add a (none) startEvent inside the embedded subprocess in the BPMN XML and redeploy
- Re-export/repair the diagram in the Flowable modeler so the subprocess has a valid start event
- Check that the process definition deployed is the corrected version (delete old deployment or redeploy)
- Validate the BPMN XML against the schema before deployment
Example fix
// before <subProcess id="sub1" name="Sub"> <serviceTask id="t1" ... /> </subProcess> // after <subProcess id="sub1" name="Sub"> <startEvent id="sub1Start" /> <sequenceFlow id="f1" sourceRef="sub1Start" targetRef="t1" /> <serviceTask id="t1" ... /> </subProcess>
Defensive patterns
Strategy: validation
Validate before calling
SubProcess sub = (SubProcess) execution.getCurrentFlowElement();
boolean ok = sub.getFlowElements().stream()
.anyMatch(fe -> fe instanceof StartEvent);
if (!ok) throw new IllegalStateException("Subprocess " + sub.getId() + " has no start event"); Type guard
boolean hasStartElement(SubProcess sub) {
return sub.getFlowElements().stream().anyMatch(fe -> fe instanceof StartEvent);
} Prevention
- Always model a startEvent inside embedded subprocesses
- Validate BPMN XML with the Flowable validator before deployment
- Avoid hand-editing generated BPMN XML
- Re-deploy after model repairs and confirm the new definition version
When it happens
Trigger: Executing an embedded subprocess whose start element resolves to null: subprocess defined with no start event, or getStartElement returns null because the start event is missing/mis-parented in the model.
Common situations: Hand-edited or programmatically generated BPMN XML missing a startEvent inside the subprocess element; modelers deleting the start event of an embedded subprocess; converting an ad-hoc subprocess where a start event was never added.
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
- Cannot deploy process definition '${processDefinition.getRes
- Programmatic error: sub process behaviour can only be applie
- Error while completing sub process of execution + scopeExecu
- The deployment contains process definitions with the same ke
- EventRegistryEventDefinition on '" + elementId + "' has an e
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/f7c15830880e267b.
Report an issue: GitHub.