People who are divorced and share children will often have to deal with each other a lot throughout the child's life. While there aren't any set rules for how you handle this situation, you have to remember that being respectful is the key to making parenting arrangements work. For some divorced parents, there is a matter of whether they should remain friends or not after the split.
If you and your ex do decide to remain friends, remember not to rush things. It can be difficult to keep things on a friend level when you are splitting up after an intimate relationship. Your emotions might be all over the place, especially right after the marriage ends. Make sure that you address these feelings so that they don't creep up and ruin your happiness as you carry out your new life.
It might help things if you discuss the future with your ex. Talk about how you will make various situations -- such as graduations and birthdays-- work so that you have a general plan in mind. This is especially important for your children since they will likely want both parents around for these milestones in their life.
You also need to set boundaries. For example, neither parent should worry about the other parent's social life. Remember that the focus for the friendship is going to be the children. You also need to set up a plan for how mutual friends will be handled. There is a good chance that you will still share some friends, which could lead to you and your ex coming into contact with each other during social interactions.
In the period immediately following the end of the marriage, you will likely need to focus solely on the terms of the divorce. Getting this taken care of as quickly as possible lets you close that chapter of your life.