The ESP modules are magical. They can actually be programmed with an Arduino sketch. You don't need an Arduino at all.
If you do want to use an ESP with an Uno, so you have access to the IO etc, you can use the ESP as a Uno WiFi shield. You just need to use the Blynk based Cayenne library and program the ESP with an AT command set.
You can also upload the ESP MQTT sketch to the ESP - the sketch you attached earlier, and get connected to Cayenne.
I do not know of a way to use the ESP as a Uno WiFi shield with the Cayenne MQTT however.
Does this clarify things for you.