Bach composed the cantata in his second year in Leipzig as part of his second annual cycle of chorale cantatas for the 15th Sunday after Trinity. The prescribed readings for the Sunday were from the Epistle to the Galatians, Paul's admonition to "walk in the Spirit", and from the Gospel of Matthew, from the Sermon on the Mount, the demand not to worry about material needs, but to seek God's kingdom first. The cantata text is based on the chorale "Was Gott tut, das ist wohlgetan" by Samuel Rodigast, which is generally related to the Gospel. Bach used the chorale in several other cantatas, especially later in another chorale cantata, "Was Gott tut, das ist wohlgetan, BWV 100". All six stanzas begin with the same line. An unknown author retained the text of the first and last stanza, but paraphrased the inner four stanzas to as many movements, even retaining some of the rhymes in the second movement. In the fourth movement, he refers to the Gospel, paraphrasing the last verse to "Even if every day has its particular trouble". He introduced references to the cross twice in the fifth movement, stressing the suffering of Jesus and his followers. Bach first performed the cantata on 17 September 1724.
The opening chorus is a distinct concerto movement. The strings open with a theme derived from the chorale melody. After 16 measures, a concertino of flute, oboe d'amore and violin I begins, with the oboe playing the theme introduced by the strings and the flute playing a virtuoso counterpoint. Three measures later, the voices enter, with the cantus firmus in the soprano, doubled by the horn. In the interlude following the Stollen of the bar form, all of the instruments participate in the concerto. The complete sequence is repeated for the second Stollen. For the Abgesang, Bach combines differently, now the strings and woods play tutti, and the flute appears as a solo, alternating with the oboe. Therefore, the instrumental postlude is not a repeat of the introduction, but a more complex combination. According to Julian Mincham, "this movement would still work perfectly well if the vocal parts were entirely removed." The first secco recitative ends on a long coloratura on the last word "wenden", or "turn", as in "can turn aside my misfortune". The first aria is accompanied by the flute, another work for an able flute player, following Was frag ich nach der Welt, BWV 94 and Nimm von uns, Herr, du treuer Gott, BWV 101, composed only a few weeks earlier. The text mentions "erschüttern" ; shaking and torment of the soul are pictured in virtuoso figuration, although the soul is asked not to shudder. The second recitative is similar to the first, ending on the last word "erscheinet", or "appeareth", as in "when God's true loyal will appeareth". In the last aria, a duet, the strings are still silent, while the flute and oboe accompany the voices. The instruments begin with a ritornello, a trio with the continuo. After a first vocal section, a second section presents new material, but refers to the first section by a repeat of instrumental motifs from the first section and a complete repeat of the ritornello as a conclusion. The closing chorale is set for four parts.