The Prophet ﷺ said, "Allah has appointed an angel over the womb. The angel says, 'My Lord, a drop of fluid. My Lord, a clot. My Lord, a lump of flesh.' Then, when the Lord
decrees its creation, the angel says, 'My Lord, wretched or blessed? Male or female? What is its provision, and what is its lifespan?' And so it is written while the child is still in its mother's womb."
حدثنا يحيى بن أيوب حدثنا حماد بن زيد بمكة حدثنا عبيد الله بن أبي بكر بن أنس أبو معاذ عن أنس عن النبي ﷺ نحوه