enable/disable node_save programmatically
In a nutshell:

function mymodule_form_submit($form, &amp;$form_state) {
  if ($form_state['values']['mycheckbox'] == 1) {
    // node code...
    node_save($node);
    drupal_set_message('Node saved.');
    $form_state['redirect'] = 'some/path';
  }
}


Or you could just require the checkbox in the form:

$form['mycheckbox'] = [
  // props
  '#required' =&gt; TRUE,
];


If the checkbox is required, the form can't be submitted, and thus the node won't be created.

I would probably require the field(s) instead of silently do nothing on submit if they did not check it. That way the form submit won't get hit and the user won't have to re-enter all of the information.