By the time of Bach, most of the old church modes were no longer being used. The Ionian mode stuck around, but in a common-practice context we usually call it "major." The Aeolian mode also stuck around, however it was consistently modified to usually have a raised leading tone, and often have a raise submediant as well. When the 6th and 7th scale degrees are consistently altered according to function, "Aeolian" is no longer an appropriate term, and we should code the mode "minor." The other modes temporarily fell by the wayside.
The chunk of the eighth invention that you have posted in your question is unequivocally in F Major throughout, there aren't any modulations or mode changes. When you look at music of the Baroque, Classical and Romantic eras, you shouldn't be looking for mode changes. You should be looking for chord changes at the local level, and key changes (shifts of tonic, not shifts of mode) at the larger level. There will occasionally be mode changes, but only from major to minor or vice-versa. The further you get into the Romantic era, and, especially once you start looking into the twentieth century, the more likely it will be that you might see the re-emergence of the other modes. Pop/Rock music, for example, is often modal. Otherwise, you generally have to go back to the Renaissance and Medieval music to find most of the modes used consistently.