Prevent form regeneration when a callback function is called through ajax
If you need a entity (which could be a node) to be created whenever the form is loaded, can create the enitiy, and pass it to your form, rather than creating it within your form. Then you can also use the same form for editing the entity.

For example, in a module called nodeform:

function nodeform_menu() {
  $menu['nodeform/add'] = [
    'title' =&gt; 'Nodeform add',
    'page callback' =&gt; 'nodeform_add_page',
    'access arguments' =&gt; ['some_create_permission'],
  ];

  // Note: using %node will call node_load(), passing it
  // the value given in that index of the path. If no node
  // is loaded, or the user does not have access, a page
  // not found error is returned (or maybe access denied)
  $menu['nodeform/%node'] = [
    'title' =&gt; 'Nodeform add',
    'page callback' =&gt; 'nodeform_edit_page',
    // The page argument is the 1st index of the path
    // which is %node. So the page argument will be a
    // node object.
    'page arguments' =&gt; [1],
    'access arguments' =&gt; ['some_edit_permission'],
  ];

  return $menu;
}

function nodeform_add_page() {
  global $user;

  $node = (object) array(
    'uid' =&gt; $user-&gt;uid,
    'name' =&gt; isset($user-&gt;name) ? $user-&gt;name : '',
    'title' =&gt; t('Default title'),
    'type' =&gt; 'some_node_type',
    'language' =&gt; LANGUAGE_NONE,
  );

  return [
    '#prefix' =&gt; '&lt;div id="nodeform_add_form_page"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
    'form' =&gt; drupal_get_form('nodeform_default_form', $node),
  ];
}

// The edit page receives a loaded node as its argument:
function nodeform_edit_page(array $node) {
  return [
    '#prefix' =&gt; '&lt;div id="nodeform_edit_form_page"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
    'form' =&gt; drupal_get_form('nodeform_default_form', $node),
  ];
}

// The form then receives a node:
function nodeform_default_form($form, $form_state, $node) {
  // Get the node from the form state if it exists, or use
  // the node passed to the form if it does not.
  $node = isset($form_state['nodeform_node']) ? $form_state['nodeform_node'] : $node;
  // Save the nodeform to the node
  $form_state['nodeform_node'] = $node;

  // Add your form elements:
  $form['title'] = [
    '#title' =&gt; t('Title'),
    '#type' =&gt; 'textfield',
    '#default_value' =&gt; $node-&gt;title,
  ];

  return $form;
}

function nodeform_default_form_submit($form, $form_state) {
  $node = &amp;$form_state['nodeform_node'];
  $node-&gt;title = $form_state['values']['title'];
  node_save($node);
}


You may not need all of the above example, but if you look at the nodeform/add menu path, it shows how you can always create a node when the form is called, and it will only happen once, rather than every time the form is built. If you don't need to use it in the form, then call node_save() on the node in node_add_page().