Drupal 8: Best practice to get nid in form_submit I can get nid from within form_submit by using one of those snipet:

$form_state-&gt;getFormObject()-&gt;getEntity()-&gt;id()


or

\Drupal::routeMatch()-&gt;getParameter('node')-&gt;id()


If feel this is a little bit overkilling... what is the best way?
You're looking for $node = $form_state-&gt;getFormObject()-&gt;getEntity().

Oh, saw that you actually mentioned that. This is the correct way to do it.