The four Afghan delegations meeting near Bonn are expected to sign an agreement today establishing an interim administration to take office in Kabul.
The UN worked last night to "distil down" the 150 names suggested by the four sides to a group of 29 to head the new administration that would be acceptable to all sides.
"This is a very difficult hurdle that is equally as important as negotiating the text of the agreement," said Mr Ahmed Fawzi, the UN spokesman at the talks.
But he said a "meeting of minds" of the groups made it very likely that the agreement would be ready today.
The UN must also find acceptable names from the four lists to fill posts in a new supreme court and for a 21-member committee to organise a loya jirda, a traditional ethnic gathering that will pick the next administration next March.
"Now we have a road map for a period of two and a half years leading to a constitution and free and fair elections," said Mr Fawzi.
The final task facing delegates last night was to agree on a date for the interim authority to assume power. The UN hoped to have agreement on a date, believed to be towards the end of December, to insert into the agreement by early this morning.
The UN declined to release the final text of the agreement ahead of the today's expected signing ceremony, to be attended by the German Chancellor, Mr Gerhard Schr÷der, and the his Foreign Minister, Mr Joschka Fischer. It remains unclear whether such an international force could be on the ground in Kabul by the time the agreement takes effect.
Behind the scenes at the UN in New York efforts are already underway to prepare a Security Council resolution that would give a UN mandate to an international security force in Afghanistan. The UN believes there is a real danger of a security vacuum in Kabul if a force cannot get in as soon as possible.
A deciding figure in this will be the Northern Alliance leader, Mr Burhanuddin Rabbani, who has played a key role in the talks down the phone line from Kabul. "I would appeal to Mr Rabbani to continue to co-operate with the UN and continue supporting the Bonn process until a successful transfer of power," said Mr Fawzi yesterday.
Mr Rabbani's representative at the talks, Mr Yunus Qanooni, was notably absent from the meeting that agreed to the final draft document at 1 a.m. yesterday morning.
Diplomats at the talks say Mr Qanooni appeared intent on sidelining Mr Rabbani with the help of the Northern Alliance Foreign Minister, Dr Abdullah Abdullah. "As soon as these guys check out of their hotel rooms tomorrow there is going to be a power struggle in Afghanistan like you wouldn't believe," said a US diplomat observing the talks.
The 29 candidates will be selected for the interim administration based on their "professional competence and personal integrity" by Mr Lakhdar Brahimi, the representative of the UN Secretary-General for Afghanistan.
He is determined that the lists will reflect Afghanistan's ethnic balance. The final agreement also contains several references to the need for participation of women in Afghan society and the need for "gender sensitivity". Delegates have also discussed creating a Ministry for Women and Children, which could be headed by one of the female delegates at the talks.
The UN also confirmed that the final draft removes earlier plans to establish an amnesty for those guilty of war crimes and violations of human rights. This could be significant following last week's prison massacre at Qala-e-Jhangi where hundreds of Taliban prisoners were killed.