// insert a new external output node with an auto-generated name
ExternalOutputNode externalOutput =
new ExternalOutputNode(transferName, mRootGateway);
RequestNodeInput newInput =
new SingleRequestNodeInput(externalOutput, ExternalOutputNode.INPUT_NAME, 0);
replaceTarget(connection, target, newInput);
externalOutput.getAllInputs().get(ExternalOutputNode.INPUT_NAME).put(0, connection);
externalOutput.addAnnotation(AnnotationKeys.GATEWAY, sourceGateway);
graph.add(externalOutput);