Much of Bach’s prodigious output consists of re-workings of previous compositions.
This is true of Cantata 191. It is described by Bach as a Christmas Cantata, and it is entirely a reworking of parts of the Gloria from his Mass in B minor. For the first movement he has used the chorus Gloria in excelsis – et in terra pax from the Mass unchanged, and the following duet is the Domine Deus from the Mass sung to the words ‘Gloria Patri et Filio et Spiritui sancto’. The cantata concludes with the chorus Sicut erat in principio.The music for this is the chorus Cum sancto spiritu which concludes the Gloria in the Mass. The words Sicut erat don’t fit the original, so he has modified the beginning so that they do.
So we get a small insight into the way Bach worked. There are many more examples of reworkings to hand, since all the Mass in B minor apart from the Kyrie and the Gloria consists of reworkings of previous cantatas.