Because I was preparing for the improvisation recital on the most famous Easter hymns which will be tomorrow, that day I planned to improvise the piece in the form of a modulating rondo based on the three Easter hymns: Wer nun den lieben Gott (A), Gelobt sei Gott (B), and Alelluia by Palestrina (C).
The main refrain which should occur 4 times was supposed to be Wer nun den lieben Gott, and the entire rondo structure would look like this: A (G minor), B (G minor), A (D minor), C (Bb major), A (C minor), B (C minor), C (G minor), and A (G minor).
This plan, if executed fluently would sound quite nicely, because Bach used it in one of his most famous preludes for organ (Eb major, BWV 552). But what to do, if the improvisation has to be shortened unexpectedly, when for example, a certain part of the liturgy lasts shorter than usual?
That's exactly what happened to me - in this video you will hear how the improvisation has to be completed before I finish this plan - as I was playing the ending of the second B part (the third episode from the end), I saw in the organ mirror that the priest is ready to start his prayer for the Offertory part of the mass.
Because I wasn't ready to return to the original key of G minor, I had to do it very quickly, if the piece should be ended on time.
Therefore after starting the new episode C, even at the end of the first sentence I created a final cadence in G minor and finished the improvisation. At the end of this video you can hear that it was done just in time, because the priest started to read his prayer for the Offertory right away. In my case, the final version of this improvisation could have been more complete (if there was more time to do it), but at least I ended after the end of the musical idea.
So if you are ever in a situation like I'm here describing, I think it's not really important on which part of the improvisation you are on, because the best way is simply to return to the main key as quickly as possible and create a final cadence. But try not to end the improvisation or a written down composition abruptly and without warning, as sometimes might happen to some organists.