From this answer, “Of course, these also add drag, even when the wing is not stalling, so they are only added where needed”. Are there any aircraft that have vortex generators that are retractable so that if the flight computers determine that the wing is stalling, the vortex generators are automatically deployed without them causing drag all the time?
From my research on them, when used as a "poor man's slat" along the top of the leading edge, that is, to increase stalling AOA (about 1/3 to 1/2 the effect of a slat) and make the stall more gentle, as opposed to reattaching flow somewhere, the drag penalty of the VGs at cruise speed is too small to be worth the complexity and weight of the sort of under-skin gang-bar device that you would need to design that could allow the VGs to be extended and retracted all at once along the LE.
Even on faster airplanes like larger twins, the speed penalty of the VGs is only a few knots if at all, not enough to justify that kind of system.
The reason the drag penalty is so small appears to be that at low AOA/high speed, there is actually some some recovery of the energy used to create the vortices in the form of a drag reduction farther aft where the boundary layer starts to get thicker, because the boundary layer is better managed and is less turbulent due to the vortices. Enough to negate a significant part of the drag penalty of generating the vortices in the first place.
Some background on the use of VGs as a stall behaviour modification device here .