Johann Kuhnau had been Thomaskantor in Leipzig from 1701 until his death on 5 June 1722. Bach had visited Leipzig during Kuhnau's tenure: in 1714 he attended the service at the St. Thomas Church on the first Sunday of Advent, and in 1717 he had tested the organ of the Paulinerkirche. In 1716 Bach and Kuhnau had met on the occasion of the testing and inauguration of an organ in Halle.