$node->form_id doesn't exist?
This code is actually correct. When checking for an object, it's always a good idea to use isset() to make sure the variable exists!

This code was adjusted to the following: 

function mymodule_node_insert($node){
  if (isset($node-&gt;form_id) &amp;&amp; ($node-&gt;form_id == 'whatever_node_form')) {
    // do stuff
  }
}