How to tell if node has been updated via UI form as oppose to programmatically? I am importing/updating nodes from a web service using node_save.  One feature that I want to achieve is when the imported node is changed locally, it should not receive any further updates from the web service.  

So, what I want to achieve is:


Detect when a node has been updated
If the update was carried out by a user submitting a form (as oppose to programmatically)
Then flag that this node should receive no further updates form the web service (I don't need any assistance with this part)


I wanted to use hook_node_update but I'm not sure how to tell whether the update was carried out by a user submitting a form.  

Any suggestions?
Create an additional field in the content type - for example update_source - and set the value programmatically.

If the user is editing the node on node/[nid]/edit page, set the value to UI and otherwise set it to programmatic.

You can do this with simple hook_form_alter() and URL checks to make sure the user is on node/[nid]/edit page. Something like this would work:

if (arg(0) == 'node' &amp;&amp; arg(1) &amp;&amp; arg(2) == 'edit') {
  // Your code
}