What is the execution sequence of functions while rendering a form? I have a form in my website with id: sample_test_custom_form. I have used hook_form_alter in a custom module  to alter this form. I also have a preprocess function (mytheme_preprocess_sample_test_custom_form) to do a little preprocessing.

However the alter function and the preprocess function are a little dependent on each other.

So I ask, what is the execution sequence of these function? Which of them is executed first?
Here's a diagram of the form build workflow in Drupal 7



More info: https://drupal.org/node/165104