Updated loop template workflow