Born at Gourdon (Lot département). He was sent by his département as deputy to the Convention, where he associated himself with the party of the Mountain and voted for the death of Louis XVI.
He was constantly employed on missions in the provinces, and distinguished himself by his rigorous repression of opponents of the revolution in the départementts of Landes, Basses-Pyrénées and Gers. With his colleague Jacques Pinet (1754-1844) he established at Bayonne a revolutionary tribunal with authority in the neighbouring towns. Charges of cruelty were preferred against him by a local society before the Convention in 1795, but were dismissed. He had represented the Convention in the armies of Brest and of the Eastern Pyrenees in 1793, and in 1795 he was sent to the armies of the Moselle and the Rhine.
He filled various minor administrative offices, and in 1806 became an official at Naples in Murat's government. During the Hundred Days he was prefect of the Somme. At the French Restoration he was proscribed as a regicide, and spent the last years of his life at Brussels, where he died.
His eldest son was Eleonore Louis Godefroi Cavaignac (1801-1845).
His second son was General Eugène Cavaignac.
Jean Baptiste's brother, Jacques-Marie, vicomte Cavaignac (1773 - 1855), French general, served with distinction in the army under the republic and successive governments. He commanded the cavalry of the XI corps in the retreat from Moscow, and eventually became Vicomte Cavaignac and inspector-general of cavalry.