Programmatically Render a Webform I'm attempting to render a webform inside a block plugin. I'm able to successfully retrieve the webform using the following code

$webform = \Drupal::entityTypeManager()-&gt;getStorage('webform')-&gt;load('my_webform');


However I'd like to render this form. I've attempted using

return $webform;


But I receive the error 


  Recoverable fatal error: Argument 1 passed to
  Drupal\Core\Render\Element::isEmpty() must be of the type array,
  object given


I'm assuming this is because $webform isn't formatted as a proper render array, but I'm not sure how to do this. I've been searching for clues inside the code of the original webform module, but I haven't been able to find anything.

How would I programmatically render a webform? And/or is there a way to find in the code of a module or entity the way to render that entity?
I managed to find a method for the webform entity class called getSubmissionForm. I found it in the webform module code in src/Entity/Webform.php 

I invoked it like so

$webform = \Drupal::entityTypeManager()-&gt;getStorage('webform')-&gt;load('my_webform');
$webform = $webform-&gt;getSubmissionForm();

return $webform;


Which returned the specified webform rendered.