An assembly for an extendable and retractable boom of an agricultural machine, comprising - a first boom section having a first frame structure comprising a plurality of frame elements; - a second boom section connected to the first boom section by an articulating joint configured to allow 180 degrees rotational movement between the first and second boom sections (20, 21), thereby, relocating the first and second boom sections (20, 21) between an extended boom section arrangement and a retracted boom section arrangement; - an arrangement of hinged elements connected to both the first and the second boom sections (20, 21); - an actuator provided with a cylinder-piston arrangement; - an actuator mechanism, the actuator mechanism comprising the actuator received inside the first frame structure of the first boom section and functionally connected to the arrangement of hinged elements, wherein the actuator mechanism and the arrangement of hinged elements are configured to produce the 180 degrees rotational movement between the first and second boom sections (20, 21), and the actuator is configured to drive the 180 degrees rotational movement; and - a limiting device; wherein the actuator provided with the cylinder-piston arrangement is prevented by the limiting device from rotational movement while driving the 180 degrees rotational movement between the first and second boom sections (20, 21) and while moving a movable actuator element between an extended and a retracted position; and characterized in that the limiting device comprises a guiding mechanism provided with guiding wall elements (36a, 36b) receiving the movable actuator element for guiding while the movable actuator element is moved between the extended and retracted positions, thereby, preventing the actuator from rotation. - a first boom section having a first frame structure comprising a plurality of frame elements; - a second boom section connected to the first boom section by an articulating joint configured to allow 180 degrees rotational movement between the first and second boom sections (20, 21), thereby, relocating the first and second boom sections (20, 21) between an extended boom section arrangement and a retracted boom section arrangement; - an arrangement of hinged elements connected to both the first and the second boom sections (20, 21); - an actuator provided with a cylinder-piston arrangement; - an actuator mechanism, the actuator mechanism comprising the actuator received inside the first frame structure of the first boom section and functionally connected to the arrangement of hinged elements, wherein the actuator mechanism and the arrangement of hinged elements are configured to produce the 180 degrees rotational movement between the first and second boom sections (20, 21), and the actuator is configured to drive the 180 degrees rotational movement; and - a limiting device; wherein the actuator provided with the cylinder-piston arrangement is prevented by the limiting device from rotational movement while driving the 180 degrees rotational movement between the first and second boom sections (20, 21) and while moving a movable actuator element between an extended and a retracted position; and characterized in that the limiting device comprises a guiding mechanism provided with guiding wall elements (36a, 36b) receiving the movable actuator element for guiding while the movable actuator element is moved between the extended and retracted positions, thereby, preventing the actuator from rotation.