But at this point in the 2016 race, few Republicans thought Mr. Trump could actually win the nomination, and hardly any members of Congress had endorsed him. Mr. Trump was clearly an outsider. Mr. Sanders, by contrast, has been in politics for decades and, despite his affiliation as an independent, is a member of the Senate Democratic leadership with relationships across the Capitol.

In addition, the party’s complicated nominating system gives congressional Democrats a say in the process, which individual Republican lawmakers do not have. Every congressional Democrat is a “superdelegate,” which gives them the ability to cast a vote for their favored nominee if no one gets a majority of delegates after all states have conducted their caucuses and primaries.

With so many Democratic candidates in the race, that is a real possibility this year. Mr. Sanders is the only candidate who has said “the person with the most votes should get the nomination.” On Thursday, Ms. Pelosi appeared to push back on that assertion, though she declined to say whether she would urge her fellow Democrats to support a candidate who lacked a majority of pledged delegates at the convention this summer.

“The person who will be nominated will be the person who has a majority plus one,” Ms. Pelosi told reporters at her weekly news conference. “That may happen before they even get to the convention, but we’ll see.”

While Ms. Pelosi has repeatedly called for Democrats to remain unified, she is also pushing them to run on the three-pronged “For the People” agenda — creating good-paying jobs, rooting out corruption and lowering the cost of health care and prescription drugs — that delivered them the majority in 2018.

“We have to win in certain particular areas,” she told reporters Thursday morning, adding, “It is not unusual for a party platform or the candidates for president to have their own agenda that they would put forth, and it’s not unusual for the House of Representatives to have its agenda as well.”