Although a few of Bach's sacred cantatas date from the Mühlhausen period (1707-1708), his first series of more regularly produced cantatas comes from Weimar, after his appointment as concertmaster in 1714. These twenty Weimar cantatas (1714-1716) chiefly use librettos by the resident poet Salomo Franck, and contain a wide variety of musical types: recitatives, da capo arias, ariosos, and different types of chorale movements; the orchestral instruments provide highly imaginative accompaniments.
Bach's most concentrated period for composing cantatas was during his first years in Leipzig. Here he developed a consistent plan for the outermost movements of most cantatas: the first movement was an elaborate polyphonic setting for chorus, while the last movement was a simple four-part harmonization of a chorale tune. The inner movements followed a variety of plans: sometimes there was a simple alternation of recitative and arias (or duets), and other times recitatives and arias framed a central choral movement. The Leipzig cantatas may be placed into five cycles, perhaps each consisting originally of about sixty works for the full liturgical year. Although Bach's obituary mentions the existence of five such complete cycles, thereby suggesting a total of three hundred works, at least one hundred (mostly from the conjectural fourth and fifth cycles) are now lost. The first two cycles were produced for 1723-1724 and 1724-25, respectively. In the second cycle, Bach concentrated first on a large group of works based on chorale texts (or paraphrases thereof), and then on a group of nine librettos by Marianne von Ziegler. The third and fourth cycles were produced over a longer period of time: in 1725-1727 and 1728-1729, respectively. The fourth cycle, now largely lost, featured tests by C.F. Henrici (usually called Picander), who skillfully interlaced his own poetry with chorale texts. Surviving works from the fifth cycle, stretching from 1729 into the 1740s (but mostly before 1735) suggest that Bach continued with forms and styles developed in his earlier Leipzig years.
Bach composed cantatas for special occasions throughout his career. Many of them had sacred texts, for weddings, funerals, the inauguration of a new city council, etc. Others had secular texts, e.g., the familiar Coffee and Peasant Cantatas. In many cases, the texts for these occasional works have survived, but the music is lost.