“You certainly saw the power of united Democratic resistance to the Trump agenda on Friday,” said Senator Christopher S. Murphy, Democrat of Connecticut. “There’s no way you can explain the failure of that bill without the story of a united Democratic and progressive resistance.”

Of course, much of the story revolves around the inability of the fractured Republican majority to reach a consensus. But while many Republican lawmakers were under pressure to oppose the health bill, Democratic members of Congress also felt the heat thanks to the new wave of activism in response to Mr. Trump.

Though the ability of Democrats to do much more than say no remains limited, their success in helping to thwart Mr. Trump will not only embolden them to confront him again — it will also inspire activists to push them to do whatever it takes to block his path.

“Having tasted victory, the resistance forces will feel even more empowered to insist that Democrats continue withholding any cooperation and not granting Trump any victories when he is so wounded,” said Brian Fallon, a Democratic strategist.

Still, this rising energy could create internal turbulence for Democrats if activists turn their attention to the next major showdown in Washington: the Supreme Court nomination of Judge Neil M. Gorsuch. The court battle has not yet engendered the same intensity among activists as the health care bill or Mr. Trump’s executive orders on immigration. Some Democratic senators are uneasy about rejecting Judge Gorsuch, preferring to save any fight for an opportunity by Mr. Trump to fill a seat now held by a liberal justice.

But the party’s senators may now be pressed to take a more aggressive posture against Mr. Gorsuch, opposition that may not halt his confirmation but would force Senate Republicans to eliminate the filibuster for such nominations.

An infrastructure plan may be a safer harbor for Mr. Trump — a measure many in Washington are mystified that he did not try to pursue at the outset of his administration. But Mr. Schumer suggested that the president would find Democratic votes only if he defied his party and embraced a huge spending bill, rather than just offering tax incentives for companies to build roads, bridges and railways.