Hi Sam,
Good question! 
LOOP (the equivalent of “for” in Java) is indeed helpful and the first solution that comes to mind when iterating is involved.
You do not have this option with REPEAT (the equivalent of “do while” in Java). The workaround I suggest for this is to have a counter (‘pos’ for example) that is initialized before the REPEAT block which is incremented by 1 at the end of each REPEAT block.
In order to extract the record for the corresponding iteration:
Step1: branch on /…/element[pos] and check if it’s null.
IF element[pos] !=null - it means you found records in the database OR you did not reach the end of the list returned from the DB call; you can proceed by invoking the service that builds the webservice call and creates the file from the response to FTP it (avoid having long service, try keep these as granular as possible).
ELSE - it means that the DB call returned no entries or you reached to the end of the list.
This is just my recommendation based on my preference, it does not mean that using a Java solution for this where you invoke Thread.sleep(ms) would not work.
I hope this helps, let me know if you have any questions and/or the approach you decide to go for!
//Ana
#Integration-Server-and-ESB#webMethods#webMethods-General