// There is a default return node with name [flow-name]-return and
// that by default points to an outer /[flow-name]-return outcome
FacesFlowReturnImpl returnNode = new FacesFlowReturnImpl();
returnNode.setId(flowName+"-return");
NavigationCaseImpl returnNavCase = new NavigationCaseImpl();
returnNavCase.setFromOutcome("/"+flowName+"-return");
returnNode.setNavigationCase(returnNavCase);
flow.addReturn(returnNode);
facesConfig.getFacesFlowDefinitions().add(flow);
return facesConfig;