The Messenger of Allah ﷺ said, "The drop of fluid remains in the womb for forty days without change. When the forty days have passed, it becomes a clinging clot, then a lump of flesh in the same manner, then bones in the same manner. When Allah wishes to complete its creation, He sends an angel to it, and the angel in attendance says, 'My Lord, male or female? Wretched or blessed? Short or tall? Deficient or complete? What of its strength and its lifespan? Healthy or sickly?' All of this is then written down."A man from the people asked, "Then what is the point of action, when all of this has already been decided?"He replied, "Act, for everyone will be guided toward that for which he was created."
حدثنا هشيم أنبأنا علي بن زيد قال سمعت أبا عبيدة بن عبد الله يحدث قال
قال رسول الله ﷺ إن النطفة تكون في الرحم أربعين يوما على حالها لا تغير فإذا مضت الأربعون صارت علقة ثم مضغة كذلك ثم عظاما كذلك فإذا أراد الله أن يسوي خلقه بعث إليها ملكا فيقول الملك الذي يليه أي رب أذكر أم أنثى أشقي أم سعيد أقصير أم طويل أناقص أم زائد قوته وأجله أصحيح أم سقيم قال فيكتب ذلك كله فقال رجل من القوم ففيم العمل إذن وقد فرغ من هذا كله قال اعملوا فكل سيوجه لما خلق له
Its isnad is daif due to its disconnection.Abu Ubayda bin Abdullah bin Masud, it is said that his name was Amir. He was a trustworthy Follower, but he did not hear anything at all from his father, since his father died while he was still young. Tirmidhi said in 1:29, "Abu Ubayda bin Abdullah bin Masud did not hear from his father, and we do not know his name."Muhammad bin Bashshar narrated to us, Muhammad bin Jafar narrated to us, from Shuba, from Amr bin Mura, who said, "I asked Abu Ubayda bin Abdullah, 'Do you remember anything from Abdullah?' He said, 'No.'"The hadith is found in Majma al-Zawaid, 7:192–193, where it is said, "It appears in the Sahih in a shortened form similar to this. Ahmad narrated it, but Abu Ubayda did not hear from his father, and Ali bin Zayd has poor memory."The hadith referred to in the Sahih was narrated by Bukhari and Muslim through Amash, from Zayd bin Wahb, from Ibn Masud, and it is the fourth hadith of Arbain Nawawiyya.It will come again at 3624. See also Jami al-Ulum wal-Hikam, 33–41, where this narration is referred to, and see also 1348.