To use mqtt, you would need some wifi connected hardware, such as a shelly relay or even adding a wifi equipped module to your existing relays.
The advantage of using mqtt is that you would not need to physically connect the pi to the relay, so no wires. Your pi would send instructions to the relay via wifi instead.
But back to your current project, can you paste your current flow, so that we can see what you have so far. - How to share code or flow json