How to use values from the output of a block in GNURadio
I want to use the output values of the top_block

A top_block has no output; a signal processing block in a flowgraph has.

So I want the flowdiagram to take one path if the output of my processing block is 0 and take a different path if it is non-zero.

Ah, you kind of want to &quot;demux&quot; something. So write a simple demux block that has two inputs and multiple outputs; copy from the first input to any of the outputs, depending on your second input.

I have implemented an if statement within the top block which disconnects and connect parts of the diagram accordingly.

Don't do that. Flow graph reconfiguration is asynchronous to signal processing in GNU Radio, i.e. this won't work, and especially not on a per-sample basis.