parsing nested blocks (in columns, etc) via PHP

If I understand it correctly, you can use a recursive function which loops through inner blocks to find the specific block. Example:

/* Sample usage, assuming $post is defined properly:

    $blocks = parse_blocks( $post->post_content );
    wpse_387661( $blocks );
*/
function wpse_387661( $blocks ) {
    foreach ( $blocks as $block ) {
        if ( ! empty( $block['innerBlocks'] ) ) {
             wpse_387661( $block['innerBlocks'] );
        } elseif ( 'custom/block' === $block['blockName'] ) {
            echo apply_filters( 'the_content', render_block( $block ) );
            break; // this could mean that inner blocks were never looped
        }
    }
}

tech