When setting a microflow as a startup event or a shutdown event it means that that action will be executed after de XAS is started and before the XAS is shutdown. Here an example when I personally use it:
I have an object which may only contain one of instance per year. When my project is run it will look for that object, when none is found it will create one. In the client the user doesn't have a button to create such an object. It can only be created after start up. In this case you know that there can only one object per year.
But beware when you are developing! When you create an object which is changed or created after start up the object already needs to be in the database. When it is not already in the database the XAS will crash. So first synchronize the database, so all the needed objects are in the database and after that you can set the microflow as after start up event.
These events should be used to check if some objects that are required to run the system actually exist. For example an object that contains all application settings, that object is required and all flows expect it to exist.
Or if you have to integrate with another application which requires a connection you can connect or disconnect with that application during a shutting down or start up event
In the HAR2009 Logistics application, I've been using a startup and shutdown microflow to announce the restart of the application on an IRC channel using a Gozerbot IRC-bot. It's also possible to use this on a Jabber channel. ;]
Yes the before shutdown microflow is executed (suprise) before shutting down the XAS. You probably want to e-mail the projectmanager if the server (and the XAS on it) is shutting down.