At the age of 20, a significant event occurred during the life of the Ramchal, as he himself describes in Otzros Ramchal, pages 315-316:
On Rosh Chodesh Sivan in 5487 (1727), while I was concentrating on the unification of Hashem's Name, I fell into a slumber, and when I awoke, I heard a voice saying, "I have come down to reveal hidden secrets of the Holy King." I could hardly stand up from trembling, but after that, I managed to strengthen myself. The voice did not cease, but told me the secret of what it was saying. In the second day... the voice returned and told me another secret, until a few days later, it revealed to me that it was a Maggid (a heavenly messenger) sent from "Heaven... I do not see it, but I hear its voice... After that, it also gave me permission to ask questions. After about three months, it gave me certain instructions to follow in order that I could merit that Eliyahu the prophet would appear to me. After that, it commanded me to write a commentary on Koheles and it explained to me the secret meaning of each of the verses. After that, Eliyahu came and told me certain secret things and informed me that now the great angel Metatron would come.
Over the next 2 1/2 years, the Ramchal wrote many important Kabbalistic works, which were dictated to him by these spiritual beings. The first was the one mentioned above, a Kabbalistic commentary (of some 800 pages) on the book of Koheles. The second was a major work which he was told to call Zohar Tinyana (The Second Zohar). It was written in the style of the original Zohar, but with particular emphasis on the redemption of the Jewish people at the end of their long exile. The following is an excerpt from the introduction (ibid., page 261), in the name of the prophet Eliyahu:
That [i.e., the first Zohar) was the beginning, and this [i.e., the second Zohar] is the completion .... From this source [of great light] came the first Zohar [of Rabbi Shimon bar Yochai]. This Zohar did not complete [the revelation of this light]. What came out, came out, and through it, the world was illuminated until now. Now the illumination of the light of the Zohar is to be completed. Through this light comes the second Zohar, and through this second Zohar, this light will finish becoming attached to Yisrael ... through this, great rectifications have been put in place ... and when the necessary rectifications are completed, Yisrael will be completely redeemed.
Apart from a few very small extracts, neither of these works is in our possession today. Fast forward ... The Ramchal wrote works explaining in his own words the Kabbalistic system as taught in the Zohar and the writings of the Arizal. The most complete work we have of this type is the Klach Pischei Chochmah ("138 Gates of Widsom")... These works are more accessible and easier to understand thanthe earlier works dictated by the Maggid, since the ideas are translated into logical terms understandable to the human mind. It seems that it was part of Hashem's Divine Plan that the Ramchal should be forced to stop writing directly revealed works and use his own mind to synthesize what he had learned from the Maggid into a graspable system. In this sense, although we have lost nearly all the writings that were transmitted directly to the Ramchal, we still have their inner content.
... We have seen how the restrictions placed on the Ramchal by his opponents actually worked to the advantage of the Jewish people, requiring him to simplify the content of his writings until they became more accessible to the average Jewish person. Nevertheless, it is clear that during his own lifetime, the world was not yet ready to perceive his true greatness. This was stored away for later generations. In fact, we can say that his influence is ever increasing in our generation when more and more people have become aware of his singular greatness. Perhaps the knowledge that was revealed to him all that time ago was ultimately meant for our generation that is living through the travails of the pre-Messianic era. May his merit be a protection for us and may his wisdom guide us toward the coming Redemption.
The Ramchal was buried next to Rabbi Akiva on a hilltop overlooking the city of Teveriah. There are those who say that the Ramchal's 40 years came to rectify the first 40 years of Rabbi Akiva's life during which he did not learn Torah.
Source: Daas Tevunos by the Ramchal, translated by R' Mordechai Rose