Complex sentence: Bach moved to Leipzig in 1723 to take up the post of Thomaskantor in which role he composed a large number of cantatas for performance in the city's churches.
Split into simpler sentences: Bach moved to Leipzig in 1723 to take up the post of Thomaskantor. In this role he set about composing a large number of cantatas for performance in the city's churches.