Someone recentley asked me if bowing at the end of lecha dodi is considered Avodah Zarah, since we are bowing to the Shabbat Malkah and not to Hashem. I responded that it is like the way we used to bow to Malchei Yisrael. But then I began thinking, why isn't bowing to Malchei Yisrael and to the Shabbat Malkah considered Avodah Zarah?
Min hatorah one is Chayav Misa (liable to death penalty) if he prostrates by bowing all the way down till one is lying on the floor on his front and has intention that he is prostrating to a deity other than Hashem. miderabanan even to prostrate on a bare stone floor is osur hence on yom kippur we have these sheets to separate us and the floor (though there is usually carpet anyway) even though we are prostrating to Hashem. Merely bowing ones head in aknowlagement of shabbos to welcome the Shechina which is Hashems revelation Me ein olam haba vested as the shabbos queen, is a sign of respect towards Hashem.