Prostration of thanksgiving after every mandatory prayer was the practice (Sunna Mu’akkada) of the Prophet (S).
Imam Ja’far As-Sadiq (as) has hinted at it’s being mandatory and said that when a person makes a prostration of thanksgiving, Allah addresses the angels and tells them that a sincere creature is doing the Sajda al-Shukr. He asks the angels to suggest what Reward must be given to the person. The angels would suggest that Allah keep His Blessings with the person for his act. Allah will again ask them what else should be the Reward for the person?
The angels say, ‘O Sustainer! Give him a place in the Heaven!’ Allah will again ask the angels,’ What else?’ The angels reply, ‘O Allah! Give a place in the Heaven for the person’s parents and children, as well!’ Allah will again ask the angels to suggest some more Reward for the person. The angels would reply,’ We have made suggestions to the best of our knowledge! We have nothing else to suggest! You know everything!’ Then Allah would say, ‘The person has thanked Me in all sincerity and humility, therefore, in return, I too shall thank him!’
Imam Ar-Ridha’ (as) has said that while making the prostration of thanksgiving, a person should say Shukran lillah atleast three times. Also he should say a hundred times Afwan or Shukran. Either in prostration he should first say a hundred times Afwan or Al-afu Al-afu. Then he should keep the right cheek at the place of prostration and s make any supplication as, for example, Ya Allaho, Ya Rabbaho, Ya Syedaho. Similarly he should keep his left cheek at the place of prostration and say the same words. In the end he should place his forehead at the same spot and repeat Shukran Shukran ya Shukran Allah a hundred times.
Remember that this prostration is not a part of the mandatory prayer. This is only a Sunna. While doing this, the person should place his chest and the tummy on the ground, spread his arms and keep his kness flat on the ground. He should pray for the welfare of himself and all the Mu’mineen with tearful eyes. Allah likes his creatures imploring Him for help in this manner.
Our Imams (as) used to make long prostrations of thanksgiving. Specially Imam Musa al-Kadhim (as) used to do the sajda after completing his fajr prayer which stretched well into the sun up. When he was asked about his Sajda al-Shukr, the Imam (as) said, one should recite the following supplication while doing the Sajda:
اَللَّهُمَّ إِنّي أُشْهِدُكَ وَأُشْهِدُ مَلائِكَتَكَ وَأَنْبِيَائَكَ وَرُسُلَكَ وَجَمِيعَ خَلْقِكَ أنَّكَ اللهُ رَبّي وَالإسْلامَ دِينِي وَمُحَمّدًا نَبِيِّي وَعَلِيّاً وَالحَسَنَ وَالحُسَيْنَ وَعَلِيَّ بْنَ الحُسَيْنِ وَمُحَمَّدَ بْنَ عَلِيٍّ وَجَعْفَرَ بْنَ مُحَمَّدٍ وَمُوسَى بْنَ جَعْفَرٍ وَعَلِيَّ بْنَ مُوسَى وَمُحَمَّدَ بْنَ عَلِيٍّ وَعَلِيَّ بْنَ مُحَمَّدٍ وَالحَسَنَ بْنَ عَلِيٍّ وَالحُجَّةَ بْنَ الحَسَنِ أَئِمَّتِي بِهِمْ أَتَوَلَّى وَمِنْ أعْدَائِهِمْ أَتَبَرَّأُ.
“O Allah I bear witness to you, your angels and your prophets and your messengers and all your creations, that you Allah, is my Lord and Islam is my religion and Muhammad is my prophet, ‘Ali, Hasan, Husain, ‘Ali son of Husain, and Muhammad son of ‘Ali, Jaffer son of Muhammad, Musa son of Jaffer, ‘Ali son of Musa, Muhammad son of ‘Ali, ‘Ali son of Muhammad, Hasan son of ‘Ali and the Proof, son of Hasan , are my Imams and I follow them and denounce their enemies.”
Then the person should recite Shukran a hundred times and also say the Salawat.
Afterwards he should say thrice:
اَللَّهُمَّ إنِّي أَنْشُدُكَ دَمَ المَظْلُومِ.
Allahumma inni unshudaka dam al mazloom
Then repeat the following thrice as well:
اَللَّهُمَّ إنِّي أَنْشُدُكَ بِإيوَائِكَ عَلَى نَفْسِكَ لأعْدَائِكَ لَتُهْلِكَنَّهُمْ بِأيْدِينَا وَأيْدِي المُؤْمِنِينَ، اَللَّهُمَّ إنّي أنْشُدُكَ بِإيوَائِكَ عَلَى نَفْسِكَ لأوْلِياءِكَ لَتُظْفِرَنَّهُمْ بِعَدُوِّكَ وَعَدُوِّهِمْ أنْ تُصَلِّيَ عَلَى مُحَمَّدٍ وَعَلَى المُسْتَحْفَظِينَ مِنْ آلِ مُحَمَّدٍ.
Allahumma inni unsheduka bayuaayeka ala nafseka leaadayeka letuhlaknahum beaidiana wa aidial Mu’mineena allahumma inni ansheduka beyuaieka ala nafseka leauliyaeka letuzfera behim beaduweka wa aduwwehim antusalle ala Muhammadin wa alal mustahfezeena min aale Muhammadin
Then he should recite the following thrice:
اَللَّهُمَّ إنّي أسْأَلُكَ اليُسْرَ بَعْدَ العُسْرِ.
Allahumma inni asalukal yusra baadal usre
Then he should keep his right cheek at the place of prostration and repeat thrice the following:
يَا كَهفِي حِينَ تُعيِينِي المَذاهِبُ وَتَضيقُ عَليَّ الأرْضُ بِما رَحُبَتْ وَيا بَارِئَ خَلقِي رَحْمَةً بِي وَكُنْتَ عَن خَلقِي غَنِيّاً، صَلِّ عَلى مُحَمَّدٍ وَعَلى المُسْتَحْفَظِينَ مِن آلِ محَمَّدٍ.
Ya kahufi heena tuainil mazahiba wa tuzeeqa alalarze bema rahubato wa ya berabbia khalqi rahmata bee wa kunto min qalqi ghaniyan salle ala Muhammadin wa alal mustahfezeena min aale Muhammadin
Then the left cheek is kept at the place of prostration and the following words recited thrice:
يَا مُذِلَّ كُلِّ جَبّارٍ، يَا مُعِزَّ كُلِّ ذَليلٍ، قَدْ - وَعِزَّتِكَ - بَلَغَ بِي مَجْهُودِي.
Ya muzilla kulli jabbarin ya muizza kulli zaleelin qad izzateka balagh bee majuhoori.
In one narration it is said that the Prophet of Allah (S) used to recite the following while doing the prostration of thanksgiving:
أعُوذُ بكَ مِن نارٍ حَرُّها لا يُطْفى، وَأعوذُ بِكَ مِن نارٍ جَدِيدُها لا يَبْلى، وأعُوذُ بكَ مِن نارٍ عَطْشانُها لا يُروَى، وأعُوذُ بكَ مِن نارٍ مَسلُوبُها لا يُكسَى.
Aauzubeka min naarin harreha la yutfa wa aaoozubeka min naarin jadeeduha la yubla wa aauzubeka min naarin utusanuha la yuruwayee wa aaoozubeka min naarin masukubaha la yuksa
It is narrated that Amir-ulMu’mineen (as) used to recite the following supplication while doing the Sajda al-Shukr:
إرْحَمْ ذُلِّي بَينَ يَدَيكَ وَتَضَرُّعِي إلَيْكَ وَوَحْشَتِي مِنَ النّاسِ وَأُنْسِي بِكَ يا كَرِيمُ.
Irhamo zulli baina yadaika wa tazurrai ilaika wa wahshati minan naase wa unsa beka ya kareem