Anas bin Malik reported,

The Prophet ﷺ said, "Allah عز وجل has appointed an angel over the womb, and it says, 'My Lord, a drop of fluid. My Lord, a clot. My Lord, a lump of flesh.' Then, when Allah عز وجل wills to complete its creation, the angel asks, 'My Lord, male or female? Wretched or blessed? What is its provision? What is its lifespan?' And so it is written while the child is still in its mother's womb."

Ahmad 12500

Sahih

حدثنا يحيى بن سعيد حدثنا حماد بن زيد حدثنا عبيد الله بن أبي بكر بن أنس عن أنس عن النبي ﷺ نحوه

أحمد 12500صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Anas bin Malik
Numbering
Darussalam 12500
Ahmad 12500