Form submit : how to pass parameters?
You can try this. Set the node id in the form element

    '#nid' =&gt; $nid,


and use FormState::getTriggeringElement to get the triggering element and the property #nid:

  public function deleteNode(array &amp;$form, FormStateInterface $form_state) {

    $trigger = $form_state-&gt;getTriggeringElement();
    $nid = $trigger['#nid'];


In some cases you have to get the triggering button from the parent property:

    $clicked_button = end($form_state-&gt;getTriggeringElement()['#parents']);