In some revealing open-seat races, Democratic voters have also flouted the directives of party leaders and embraced inspiring activists. They nominated Jahana Hayes, an African-American educator, for Congress in Connecticut over a candidate approved by the state Democratic Party, and picked Andrew Gillum, the African-American mayor of Tallahassee, for governor of Florida over a field of better-funded candidates that included the scion of an imposing dynasty.

Many of these campaigns have been fueled by themes of identity and diversity, but they are also linked by a loosely overlapping set of policy concerns, including demands for higher taxes on the wealthy, new legal protections for women and immigrants and a drastic reassessment of narcotics regulation and the criminal-justice system.

For all their internal feuding, Democrats still remain a more obedient and orderly party than their counterparts on the right: They have not experienced convulsions on a scale of the Republican revolution of 2010, which saw multiple sitting senators crumble in primary elections and a host of far-right lawmakers elected to the House. Not one Democratic senator faced a difficult primary battle this year, and the Senate candidates recruited by national party leaders were easily approved by voters. And in important parts of the country, Democrats have nominated thoroughly conventional, left-of-center men for offices like governor of Ohio and Wisconsin.

But the thirst for change among Democratic voters has been evident across the map, even where incumbents were not challenged and even in conservative areas where the party is seeking to rebuild from its decimation in the Obama years. In scores of close-run congressional races, primary voters have turned to women and minority candidates to take on Republicans, including nominating the first-ever black candidates for governor in Georgia and Florida.

These primary elections may not have much impact on the battle for control of Congress this year. Democrats need to gain 23 House seats to take power, and nearly all of the primary upsets have occurred in deep-blue seats that the party already controls.

But if a good number of those candidates take office next year, in Washington and the states, it could heighten the disparity between the party’s old-guard lawmakers — largely white Democrats, or black leaders of a now-distant generation — and its new arrivals, and propel Democrats toward a more conclusive choice about their identity in 2020.

Nika Elugardo, a Democrat who beat a powerful incumbent in the Massachusetts House on Tuesday, said Mr. Trump’s election had created a new sense of urgency and boldness in communities that some Democrats had taken for granted in the past.