BERLIN — She stood before an adoring throng on Monday, cheers rising to the roof, having won nearly 99 percent of the vote for a top post in Germany’s most powerful political party. She smiled, waved and beckoned the rank and file to help her guide the party and the country.

It was familiar stagecraft, except for one thing: The woman basking in praise from the Christian Democratic Union was not Angela Merkel but the politician seen as her chosen heir apparent, Annegret Kramp-Karrenbauer. Dubbed “mini-Merkel” by the German news media, Ms. Kramp-Karrenbauer was elected general secretary of the governing party, a post once occupied by the chancellor herself, and one considered a potential steppingstone to becoming chancellor.

Long criticized for not grooming successors during 12 years in power, Ms. Merkel seems to have embraced the task after an election in which her party bled voters to both the liberal Free Democrats and the far-right Alternative for Germany. In tapping Ms. Kramp-Karrenbauer, she found a candidate widely seen as having the mix of liberalism and conservatism to unite a restive party base.

Even as the chancellor works to patch together another governing coalition, which party delegates approved on Monday, the ascension of possible successors offers the latest sign that the Merkel era is approaching its end. The succession will determine the direction of the party and possibly the nation, both deeply divided over the chancellor’s 2015 decision to open Germany’s borders to hundreds of thousands of people fleeing war and mayhem in the Middle East and Africa.