Mevlana Jelaluddin Rumi told this story about an event in the days of Harun the Just, that there was a certain chief of police who by day sat in the court of the Caliph and attended to his duties, and every night was granted a visit from Khidr, the green prophet and hidden guide of the worthy.
After a time, this chief of police began to view his life in the world as nothing but pointless sham and illusion, and one day, without warning, he retired from his post. To his surprise, though, from the day he left court the visits from Khidr stopped abruptly.
As days passed without a glimpse of Khidr, the man began to worry. Had he unwittingly committed some error that had caused him to fall from grace? He examined his conduct and his conscience, but could find nothing to explain the matter. Then one night, a voice of intuition whispered to him that, as the visits had stopped when he left his work, perhaps they would resume if he returned to his post.
The next day, he went to the Caliph and begged to be taken back. He was restored forthwith and indeed, that night his vigils were blessed by the sight of Khidr.
The chief of police then asked Khidr why he had ceased his visits and Khidr replied, “Your virtue is that you sit in the Divan all day and protect the poor and the needy, and rescue them from the claws of their oppressors. Know that this service is worth more to the Unseen than a thousand Sufi retreats!”