Programmatically create a node with a menu link
You can save menu link Separately using the below code on node save.

 $menu_link = MenuLinkContent::create(array(
      'title' =&gt; 'Menu Title', // Menu title is your title of menu, in this case node title
      'path' =&gt; '/path/to/node', // Menu link something like '/node/'.$nid, replace $nid with your node id
      'menu_name' =&gt; 'navigation',
      'weight' =&gt; 0,
      'bundle' =&gt; 'menu_link_content',
 ));

 $menu_link-&gt;save();