Divorce mutual agreement

Me and wife got recently divorce but not filed yet, my question is that as we have discussed and agreed on somethings, can we put in writing, have it signed in front of the witnesses? Will this be considered as a legal agreement?

Also, we both from IL and have a house, since she doesnt want her name on the mortgage can her name be removed since she agreed that she will not ask for the money, my retirement benefits or anything, Instead she needs a lump sump cash which I am willing to pay. How should I proceed?

How soon then we can finalise the procedure if all agreed in writing? Do we have to be presence in the court since we both are working out of country?

One of you MUST be an Illinois Resident 90 days before filing or 90 days before judgment. This is an UNWAIVABLE requirement. If you are both out of country, Illinois may not (for now) be the best venue - talk to a family law attorney in your area for specific guidance.

First you are not divorced until the Judge says you are divorced. Right now you are separated. You need to have an attorney go through your agreement and create an Agreement that a court will not find unconscionable. That is not one sided.
You can only remove one person's obligation on a Mortgage if you refinance the property.
Otherwise your wife is still responsible for the mortgage.
Finally one of you will have to file a Petition for Dissolution of Marriage and then once all the paperwork is in order appear before the Judge for a prove-up of the Petition.

You cannot simply wave a magic wand and become divorced. Dissolution of marriage is a court proceeding. One of you must have resided in the State of Illinois continuously for 90 days before you file and resided there at the time the Judgment is entered. A proper Petition for Dissolution of Marriage must be filed. A properly drafted Marital Settlement Agreement can be accepted by the judge and a dissolution of marriage entered upon production of a properly drafted Judgment for Dissolution of Marriage. At least one of you really needs a lawyer. You might wish to consider getting your divorce in the country where you work. If it is legal there, it will be legal here.