Get the form ID from a Webform entity I need to output the form id of a webform entity. 
I load a chunk of enabled webforms directly from the database by using 

\Drupal::entityTypeManager()-&gt;getStorage('webform')-&gt;loadMultiple();


Afterwards I have to output the form_id's of the webform entities.

How to achieve this? I cannot see any "form_id" stored in the returned entity object.

UPDATE:

I can use the following script to receive a static version of the form id:

$target_form_id = str_replace('email_confirm_redirect_2_', '', $entity-&gt;getSubmissionForm()['#form_id']);


Still not really professional
Rather than storing the form ID, you could just store the webform ID and check that in a form alter. Webform provides its own form alter hook that only fires for webforms and lets you put the hook in a dedicated include file.

See honeypot_webform_submission_form_alter() in third_party_settings/webform.honeypot.inc for an example of getting the webform from the hook:

/**
 * Implements hook_webform_submission_form_alter().
 */
function honeypot_webform_submission_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
  // &lt;snip&gt;

  /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */
  $webform_submission = $form_state-&gt;getFormObject()-&gt;getEntity();
  $webform = $webform_submission-&gt;getWebform();


From there you can use $webform-&gt;id() to get the webform ID.