flowable/flowable-engine · error · ActivitiException

Default sequence flow

Error message

Default sequence flow '${defaultSequenceFlow}' not found

What it means

ExclusiveGatewayActivityBehavior.leave() evaluates outgoing conditions and, if none matches, falls back to the gateway's default flow. When a default flow id is configured but no outgoing transition with that id exists on the gateway, it throws ActivitiException because the configured default route cannot be resolved.

Solutions

  1. Ensure a sequence flow with an id exactly matching the gateway's default attribute exists
  2. Remove the default attribute if no default is wanted and instead guarantee one condition always matches
  3. Validate the process definition at deployment to catch dangling default flow references

Example fix

// before
<exclusiveGateway id="gw" default="gone"/>
// after
<exclusiveGateway id="gw" default="flowDefault"/>
<sequenceFlow id="flowDefault" sourceRef="gw" targetRef="else"/>
Defensive patterns

Strategy: validation

Validate before calling

boolean ok = gateway.getOutgoingFlows().stream()
    .anyMatch(f -> f.getId().equals(gateway.getDefaultFlow()));
if (!ok) throw new IllegalStateException("default flow id dangling");

Try / catch

try { /* execute process */ }
catch (ActivitiException e) { if (e.getMessage().contains("Default sequence flow")) { repairModel(); } throw e; }

Prevention

When it happens

Trigger: An exclusive gateway has default='flowX' but no sequence flow with id 'flowX' leaves the gateway, and no other outgoing condition evaluated true.

Common situations: Sequence flow renamed/deleted after the default attribute was set; XML edited by hand or by tooling that changed flow ids.

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/b1938a50fe2c7ecd. Report an issue: GitHub.

Appendix: source

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

                        LOGGER.debug("Sequence flow '{}' selected as outgoing sequence flow.", seqFlow.getId());
                    }
                    outgoingSeqFlow = seqFlow;
                }
            } else if (SkipExpressionUtil.shouldSkipFlowElement(execution, skipExpression)) {
                outgoingSeqFlow = seqFlow;
            }
        }

        if (outgoingSeqFlow != null) {
            execution.take(outgoingSeqFlow);
        } else {

            if (defaultSequenceFlow != null) {
                PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow);
                if (defaultTransition != null) {
                    execution.take(defaultTransition);
                } else {
                    throw new ActivitiException("Default sequence flow '" + defaultSequenceFlow + "' not found");
                }
            } else {
                // No sequence flow could be found, not even a default one
                throw new ActivitiException("No outgoing sequence flow of the exclusive gateway '"
                        + execution.getActivity().getId() + "' could be selected for continuing the process");
            }
        }
    }

}

View on GitHub (pinned to d6d39ce1c6)