ספר הזהר, Vayechi Vayechi · כ
Zohar 184
א
Rabbi Yitzchak was sitting one day at the door of Rabbi Yehudah, and he was sad. Rabbi Yehuda came out and found him at his door, and saw that he was sitting in a sad mood. He asked: what is different today from all other days?
ב
He [R. Yitzchak] said: I came to ask you three things. One - when you say words of Torah, and you remember words that I said, please say them in my name, so my name will be remembered. Another - please teach my son Yosef Torah. And last - please go to my grave all 7 days and say prayers over me.
ג
He [R. Yehudah] said: From where do you know this [that you are going to die]? He answered: every night my soul leaves me, and I do not remember clearly in dreams as I used to. And more, when I pray and listen to the [repetition of] the Prayer I look at my image on the wall and I cannot see it. and I say that I am going to die since the image [of God] is fleeing and is not seen, the pronouncement has gone out, as it is written "in the image a person walks" (Ps. 39:7) - all the time that the image of a person is not fading, the person walks, and her/his spirit is strong in him/her. And as the image is fading and is not seen, the person will fade from this world.
ה
They went to Rabbi Shimeon's house, and they found him studying Torah, Rabbi Shime'on raised his eyes and saw R. Itzchak, and saw that the angel of death ran and danced in front of him. Rabbi Shime'on got up and held Rabbi Itzchak's hand, and said: "I decree that whoever is accustomed to come to me should come, and whoever is not accustomed to come should not come. Rabbi Itzchak and Rabbi Yehuda came in. The angel of death was tied to the outside by this [and could not come in].
ו
Rabbi Shime'on looked, and saw that his time to die had not yet come, but that his time was at eight hours of the day. They sat in front of Rabbi Shime'on and they studied Torah with him, and Rabbi Shime'on said to his son Rabbi Eleazar: "sit at the entrance, and whoever you see, do not talk to him, and if he wants to come in, make an oath that he should not enter.
ז
Rabbi Shime'on said to Rabbi Itzchak: di you see the image of your [deceased] father today or not? We have learned: at the moment a person leaves this world, their parent and other relatives that are already there show up, the person sees them and recognizes them. And all those who are close to him in the same level [but are in that world] all of them come together and visit the person, and go with the person's soul until the place where the person's soul will dwell there. And Rabbi Itzchak responded: until this moment I have not seen the image of my father.