He was one of the advisors of king of Poland, Jogaila, becoming his confessor in 1386 and accompanying him during the baptism of Lithuania in 1387 . At court he held the titles of Royal Notary from 1390 and Deputy Chancellor of the Crown from 1403 to 1412. In 1391 with the help of queen Jadwiga of Poland he was allowed by Pope Boniface IX to undertake higher Holy Orders. He was known for his opposition to the Teutonic Knights, and become trusted advisor of the king who often would discuss his plans only with him and his cousin Vytautas the Great. Trąba accompanied the king into many battlefields, including the Battle of Grunwald in 1410, where he was one of his chief clercs and officials. Because of Jagiełło's support, he became the bishop of Halicz from 1410 to 1412, and later an archbishop of Gniezno from 1412 onwards.
As the leader of the Polish delegation to the Council of Constance , he was part of the larger German delegation. After they arrived in Konstanz in 1415, Trąba was, according to Ioannes Longinus, briefly considered as one of the candidates for papacy, although historians still debate the reliability of this information. Certainly Trąba temporarily abandoned his support for the Polish cause, supporting pro-Teutonic candidate Oddone Colonna, the future Pope Martin V against pro-Jagiełło Antipope John XXIII. This would later cause him problems in Poland, as well as his lack of criticism of the sentence on Jan Hus, which caused further questions about his loyalties in Poland and Bohemia, especially when contrasted with strong defence of Hus by Włodkowic. He also strongly criticized the marriage of king Jagiełło to 45-year-old Elisabeth of Pilica and criticized his rival, the Archbishop of Lwów, Jan of Rzeszów, who remained in Poland. Some speculate that his stance was motivated by a desire to become pope, and that he hoped that after his election he would be able to reverse all the damage he had caused ; others, that he put the elimination of the Western Schism over the good of his country . In 1418 Pope Martin V was elected to that office, and quickly annulled Antipope John XXIII's papal bulls supporting Poland against the Teutonic Knights. Mikołaj and other members of the Polish delegation felt betrayed and demanded reparations, at one point forcing an entry into a papal audience. Eventually Martin condemned some of the more vocal and "anti-Polish" declarations of the Teutonic Knights, particularly that of Johannes Falkenberg. He offered Trąba the title of cardinal as a consolation, however Mikołaj refused, not willing to become a such close servant of the new Pope, accepting in exchange the honorary title of primate of Poland ; since then, all archbishops of Gniezno were also primates of Poland, which elevated them above the archbishops of Lwów. In Poland, the title of primate gained much importance, as the primate presided over local synods, crowned kings and even ruled if no king was present.
Further controversy
Upon his return to Poland, Trąba was faced with many challenges, among them the accusation of treason, especially from the angry nobility eventually, he succeeded in clearing his name; ironically, he was defended by his rival, whom he had criticized at Konstanz, Archbishop Jan of Rzeszów.