how to show a message after a node form is submitted How do I show a message (notice or alert) after the node form is submitted and saved? 

I'm writing a module that synchronizes the node content with a remote endpoint. All working good. But, if for any reason the sync fails, I want to show a message on the page the user is redirected to. 

My problem is that I don't find the hook or function which is invoked after the form is saved to databases but before the redirect happens, where I hopefully can set the message I want.
You can create an additional submission callback.  Not sure if it will run late enough for you.  May be worth a shot.

Create a form alter hook using hook_form_alter();
Within there add an additional submit function to the #submit array

Example:

hook_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['#submit'][] = 'custom_submit_function';
}

function custom_submit_function($form, &amp;$form_state) {
  drupal_set_message('your message');
}


You could try going 1 step further and adding the submit hook to #submit in the #after_build.  This will ensure it is the very last submit callback (unless other higher weighted modules also use the afterbuild)

Example:

hook_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['#after_build'][] = 'custom_afterbuild_function';
}

function custom_afterbuild_function($form, &amp;$form_state) {
  $form['#submit'][] = 'custom_submit_function';
}

function custom_submit_function($form, &amp;$form_state) {
  drupal_set_message('your message');
}


I hope this helps

[update] added drupal_set_messages to code examples.