flowable/flowable-engine · error · ActivitiException

No outgoing sequence flow of the inclusive gateway

Error message

No outgoing sequence flow of the inclusive gateway '${activityId}' could be selected for continuing the process

What it means

In performOutgoingBehavior, when no outgoing sequence flow can be selected (all conditions false and no default flow exists) the execution ends, and if throwExceptionIfExecutionStuck is enabled an ActivitiException is thrown reporting the activity id where the process got stuck. It prevents silent, stuck process instances.

Solutions

  1. Add a default sequence flow (default attribute) to the inclusive gateway as a catch-all
  2. Fix/loosen the outgoing flow conditions and ensure required variables are set before the gateway
  3. Set throwExceptionIfExecutionStuck=false if silently ending is acceptable (usually not)
  4. Log execution variables at the gateway to see why all conditions fail

Example fix

// before
<inclusiveGateway id="gw1"/>
<sequenceFlow id="f1" sourceRef="gw1" targetRef="a"><conditionExpression xsi:type="tFormalExpression">${x > 10}</conditionExpression></sequenceFlow>
// after
<inclusiveGateway id="gw1" default="fDefault"/>
<sequenceFlow id="f1" sourceRef="gw1" targetRef="a"><conditionExpression xsi:type="tFormalExpression">${x > 10}</conditionExpression></sequenceFlow>
<sequenceFlow id="fDefault" sourceRef="gw1" targetRef="b"/>
Defensive patterns

Strategy: validation

Validate before calling

// Before the gateway, ensure a fallback exists and required variables are present
if (execution.getVariable("x") == null) throw new IllegalStateException("variable x required before gateway");

Try / catch

try { /* advance process */ }
catch (ActivitiException e) {
  if (e.getMessage().contains("No outgoing sequence flow")) { alertStuckProcess(activityId); }
  throw e;
}

Prevention

When it happens

Trigger: Reaching an inclusive gateway whose incoming token satisfies no outgoing flow condition and which has no (resolvable) default flow, with the engine configured to throw on stuck executions.

Common situations: Conditions written against variables that are missing or of unexpected type at runtime, so every condition evaluates false; incomplete gateway configurations after process model changes.

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


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/BpmnActivityBehavior.java:179

                Object isForCompensation = execution.getActivity().getProperty(BpmnParse.PROPERTYNAME_IS_FOR_COMPENSATION);
                if (isForCompensation != null && (Boolean) isForCompensation) {
                    if (execution instanceof ExecutionEntity) {
                        Context.getCommandContext().getHistoryManager().recordActivityEnd((ExecutionEntity) execution);
                    }
                    InterpretableExecution parentExecution = (InterpretableExecution) execution.getParent();
                    ((InterpretableExecution) execution).remove();
                    parentExecution.signal("compensationDone", null);

                } else {

                    if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("No outgoing sequence flow found for {}. Ending execution.", execution.getActivity().getId());
                    }
                    execution.end();

                    if (throwExceptionIfExecutionStuck) {
                        throw new ActivitiException("No outgoing sequence flow of the inclusive gateway '" + execution.getActivity().getId()
                                + "' could be selected for continuing the process");
                    }
                }

            }
        }
    }

}

View on GitHub (pinned to d6d39ce1c6)