Automatic packaging line capable of handling two product types, packed both in 3-flap lid boxes (up to 120 boxes/minute) and in preglued cartons up to 330 cartons/minute. The line is composed of an electronic glue forming and glue closing machine, a 4 axis robot, electronic continuous motion cartoning machine and a wrap-around machine.