{"record":{"id":"82b750ca42bf3550","repo":"flowable/flowable-engine","slug":"default-sequence-flow-defaultsequenceflow-cou","errorCode":null,"errorMessage":"Default sequence flow '${defaultSequenceFlow}' could not be not found","messagePattern":"Default sequence flow '(.+?)' could not be not found","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/BpmnActivityBehavior.java","lineNumber":158,"sourceCode":"            execution.take(transitionsToTake.get(0));\n\n        } else if (transitionsToTake.size() >= 1) {\n\n            execution.inactivate();\n            if (reusableExecutions == null || reusableExecutions.isEmpty()) {\n                execution.takeAll(transitionsToTake, Collections.singletonList(execution));\n            } else {\n                execution.takeAll(transitionsToTake, reusableExecutions);\n            }\n\n        } else {\n\n            if (defaultSequenceFlow != null) {\n                PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow);\n                if (defaultTransition != null) {\n                    execution.take(defaultTransition);\n                } else {\n                    throw new ActivitiException(\"Default sequence flow '\" + defaultSequenceFlow + \"' could not be not found\");\n                }\n            } else {\n\n                Object isForCompensation = execution.getActivity().getProperty(BpmnParse.PROPERTYNAME_IS_FOR_COMPENSATION);\n                if (isForCompensation != null && (Boolean) isForCompensation) {\n                    if (execution instanceof ExecutionEntity) {\n                        Context.getCommandContext().getHistoryManager().recordActivityEnd((ExecutionEntity) execution);\n                    }\n                    InterpretableExecution parentExecution = (InterpretableExecution) execution.getParent();\n                    ((InterpretableExecution) execution).remove();\n                    parentExecution.signal(\"compensationDone\", null);\n\n                } else {\n\n                    if (LOGGER.isDebugEnabled()) {\n                        LOGGER.debug(\"No outgoing sequence flow found for {}. Ending execution.\", execution.getActivity().getId());\n                    }\n                    execution.end();","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/BpmnActivityBehavior.java#L140-L176","documentation":"BpmnActivityBehavior.performOutgoingBehavior() looks up the outgoing transition whose id matches the activity's default sequence flow. When a default flow is configured but no outgoing transition with that id exists on the activity, it throws ActivitiException because the process would otherwise end silently with no route taken.","triggerScenarios":"A BPMN activity (task/gateway) defines attribute default='someFlowId' but no sequence flow with id 'someFlowId' leaves the activity, and no other conditional flow's condition evaluates true so the default is consulted.","commonSituations":"BPMN XML refactors where a sequence flow was renamed or deleted while the default attribute still referenced the old id; hand-edited or generated process models with dangling flowId references.","solutions":["Add or fix the sequence flow so its id matches the activity's default attribute","Remove the default attribute if no default flow is intended","Validate the BPMN model at deploy time with a model validator to catch dangling default-flow references"],"exampleFix":"// before\n<sequenceFlow id=\"flow1\" sourceRef=\"task1\" targetRef=\"task2\"/>\n<task id=\"task1\" flowable:default=\"defaultFlow\"/>\n// after\n<sequenceFlow id=\"defaultFlow\" sourceRef=\"task1\" targetRef=\"task2\"/>\n<task id=\"task1\" flowable:default=\"defaultFlow\"/>","handlingStrategy":"validation","validationCode":"boolean defaultExists = activity.getOutgoingFlows().stream()\n    .anyMatch(f -> f.getId().equals(defaultFlowId));\nif (!defaultExists) throw new IllegalStateException(\"default flow not found: \" + defaultFlowId);","typeGuard":null,"tryCatchPattern":"try { runtimeService.startProcessInstanceByKey(key); }\ncatch (ActivitiException e) { if (e.getMessage().contains(\"Default sequence flow\")) { /* fix model */ } throw e; }","preventionTips":["Run BPMN validation on deployment","Keep default attribute and sequence flow ids in sync during refactors","Use a graphical modeler that keeps references consistent"],"tags":["bpmn","process-model","sequence-flow","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}