The Kayanians (also Kays or Kayanids or Kaianids) are a semi-mythological dynasty of Greater Iranian tradition and folklore. Considered collectively, the Kayanian kings are the heroes of the Avesta, the sacred texts of Zoroastrianism, and of the Shahnameh, Iran's national epic.
As an epithet of kings and the reason why the dynasty is so called, Middle- and New Persian "Kay(an)" is a continuation of Avestan kavi (or kauui) "king" and also "poet-sacrificer" or "poet-priest." The word is also etymologically related to the Avestan notion of kavaēm kharēno, the "divine royal glory" that the Kayanian kings were said to hold. The Kiani Crown is a physical manifestation of that belief.
In Yasht 5, 9.25, 17.45-46, Haosravah, a Kayanian king later known as Kay Khosrow, together with Zoroaster and Jamasp (a premier of Zoroaster's patron Vishtaspa, another Kayanian king) are seen to worship in Airyanem Vaejah. King Haosravah is described to have united the various Aryan tribes as one nation (Yasht 5.49, 9.21, 15.32, 17.41).
The compilation may have been prompted by concern over deteriorating national spirit. There were disastrous global climate changes of 535-536 and the Plague of Justinian to contend with and the Iranians would have found much-needed solace in the collected legends of their past.
Following the collapse of the Sassanid Empire and the subsequent rise of Islam, the Kayanian legends fell out of favour until the first revival of Iranian culture under the Samanids. Together with the folklore preserved in the Avesta, the Khwaday-Namag served as the foundation of other epic collections in prose, such as those commissioned by Abu Mansur Abd al-Razzaq, the texts of which have since been lost. The Samanid-sponsored revival also led to the resurgence of Zoroastrian literature, such as the Denkard, book 7.1 of which is also a historiography of Kayanians. The best known work of the genre is however Firdowsi's Shahnameh "Book of Kings", which - though drawing on earlier works - is entirely in verse.