The withdrawal agreement must be in accordance with article 128, headland 3, of the Functioning Treatment of the European Union:
The Commission, or the High Representative of the Union for Foreign Affairs and Security Policy where the agreement envisaged relates exclusively or principally to the common foreign and security policy, shall submit recommendations to the Council, which shall adopt a decision authorising the opening of negotiations and, depending on the subject of the agreement envisaged, nominating the Union negotiator or the head of the Union's negotiating team.
Then the negotiations must conclude in a period of two years, if not all the treaties stopped being applied to the State that withdraw the EU. Then the agreement must be approved by simple majority in the European Parliament. The Council can address a special committee in consultation to guide the negotiations.
Nowadays, this process is taking part in order to reach an agreement between the EU and the UK.