You would do the same thing that you would do when showing a flex field on the site.
if (have_rows('flex_field', $post_id)) {
while (have_rows('flex_field', $post_id)) {
the_row();
if (get_row_layout() == 'content') {
// do something to show the content or add it
$content .= get_sub_field('some_sub_field');
}
}
}