This very ingenious elaboration of this Chorale forms the conclusion of J.S. Bach's "The Art of Fugue". During the composition of the unfinished Fugue preceding this Chorale, Bach became blind and dictated the Prelude to his son-in-law, Altnikol, imbuing it with the profound expression of his own distress and resignation. A few days later he died.
Here is a link to a more in-depth background story of this Chorale Prelude.
Blind and restricted to his deathbed, Johann Sebastian Bach asked a fellow organist to play one of his own hymns. Bach then did what any brilliant composer would have done. No, he did not criticize his colleague for the way he interpreted it musically. Bach, in his final hours, revised his own composition, making a number of musical improvements. And the genius did not rest there, he retitled the work and modified its strains in a manner which perfectly addressed his circumstances. Anticipating his imminent encounter with his Creator, he changed the name to Vor deinen Thron tret’ ich hiermit (Before Your Throne I Now Appear). The first and last verses of the hymn are as follows.
Before your throne I now appear
O God, and beg you humbly
Turn not your gracious face
From me, a poor sinner.
Confer on me a blessed end,
On the last day waken me Lord,
That I may see you eternally:
Amen, amen, hear me.