A growing number of organizers and donors say the midterm election results show Democrats that the formula for winning back the White House in 2020 is a two-part equation.

First, they need to organize voters year-round. And second, they must recruit the same type of coalition of people of color, women, Millennials and progressive whites that elected Barack Obama twice.

That message wasn’t just evident in races that gave Democrats control of the House. It was clear even in red states like Texas and Georgia, where Democrats lost high-profile races by relatively narrow margins, according to a San Francisco political strategy and donor group called Way to Win that spent $22 million on the midterms.

Way to Win, started by three activists who created a network of 130 mostly wealthy donors with progressive worldviews, is one of several recently founded groups that operate differently from the Democratic Party to try to get people to the polls: They spend their money on local grassroots organizing instead of TV advertising, and concentrate on recruiting new voters instead of converting existing ones.

They want to support organizations that can work year-round to reach voters instead of just during election season. That’s in contrast to a typical political campaign that closes its doors shortly after the votes are counted.

It’s a challenge to Democrats who say the key to winning back the White House is to appeal to working-class white voters who backed President Trump in 2016, many of whom voted for Obama twice. Way to Win leaders say that part of the Obama coalition will be harder to recruit again. It will be easier to find people who haven’t voted.

“Our swing voter is not someone we’re trying to move from red to blue,” said Jenifer Fernandez Ancona, a co-founder of Way to Win. “It’s nonvoter to voter.”

Take Georgia. Four years ago, the Democratic gubernatorial candidate — former President Jimmy Carter’s grandson Jason Carter — lost by 200,000 votes. Over the past year, Way to Win funded grassroots organizations in Georgia that worked on increasing turnout among Democrats who don’t usually vote in midterms, particularly African Americans.

The result: This year, Democratic gubernatorial candidate Stacey Abrams is down by roughly 63,000 votes and could be headed for a recount. Plus, Democrats flipped one House seat and seven more in the state Legislature.

Same goes for Rep. Beto O’Rourke’s loss to GOP Sen. Ted Cruz in Texas. Way to Win organizers point out that Hillary Clinton lost Texas by roughly 800,000 votes two years ago. O’Rourke lost by 200,000, and Democrats picked up two seats in the House and 14 in the state Legislature.

Way to Win also funded grassroots organizing among Latinos in Arizona, where Democratic Rep. Kyrsten Sinema is locked in a too-close-to-call race for the U.S. Senate with GOP Rep. Martha McSally. In Florida, the group helped to pass Amendment 4, which restored voting rights to 1.5 million felons.

“That is progress in the deep, Deep South,” said Tory Gavito, president and co-founder of Way to Win.

But UC Hastings College of the Law Professor Joan Williams said Democrats don’t need to choose between working-class white voters and the old Obama coalition. They have the money and grassroots energy to reach out to both in all parts of the country, she said.

“It’s a false choice,” said Williams, author of “White Working Class: Overcoming Class Cluelessness in America.” “These races are so close that Democrats need everybody.”

When it funded candidates, Way to Win often bet on long shots like Gina Ortiz Jones. If she wins, Ortiz Jones would be the first openly lesbian, first Iraq War veteran and first Filipina ever elected to Congress from Texas. Few gave her a chance against Republican Rep. Will Hurd. Yet Ortiz Jones trailed by roughly one percentage point as ballots were still being counted.

“We know that long-term, we win when people are excited and energized, and people are excited by Gina Ortiz Jones,” said Way to Win co-founder Leah Hunt-Hendrix. “Even if she doesn’t win, she’s driving more turnout statewide.”

Over the past year, Way to Win has built a network of donors who range from some of the nation’s wealthiest liberal givers to others for whom “$10,000 is a stretch,” as one fundraiser for the group put it.

Ancona is familiar with deep-pocketed liberals through her other job as a vice president of the Women’s Donor Network, a group of 220 progressive women. Gavito, who is based in Texas, is connected to wealthy liberals there through her other job as executive director of the Texas Future Project.

Hunt-Hendrix, granddaughter of Texas oil tycoon H.L. Hunt, is an author and organizer who co-founded Solidaire, a network of donors that funds liberal social movements on issues ranging from immigration to support for Muslim communities.

The organization tries to avoid the appearance that it consists of rich San Francisco liberals micromanaging campaigns in faraway red states. They do that by funding local organizations like Black Voters Matter and then staying out of the business of day-to-day strategizing.

“A lot of those groups are the best political strategists in their communities,” Ancona said. “It’s all about shifting who the political expert is.”

NextGenAmerica, the San Francisco organization founded by billionaire Democratic activist and former hedge fund manager Tom Steyer, takes the same approach of partnering with locals. It spent $3.8 million in California and $33 million nationally to help local organizers persuade young people to vote.

NextGen worked with the Korean Resource Center to register voters in Orange County, where there were four competitive GOP-held House seats that Democrats were trying to flip. It hired Spanish-speaking organizers at community colleges and universities to work competitive races in the Central Valley and Southern California.

Nationally, turnout among voters between 18 and 35 years old was 31 percent, the highest in 25 years, according to the nonpartisan Center for Information and Research on Civic Learning and Engagement. Two-thirds of those young voters supported Democrats, the center said. They “almost certainly helped the Democratic Party take control of the House,” the researchers said.

In California, vote totals rose near colleges where NextGen hired organizers. Turnout quadrupled at a precinct that includes California State University Stanislaus in Turlock (Stanislaus County), where NextGen registered more than 700 students. It’s likely that those voters helped Democrat Josh Harder in his still-too-close-to-call race against Turlock GOP Rep. Jeff Denham.

“And that’s in Turlock. Turlock! It’s wild,” said Ben Wessel, NextGen’s deputy political director. “The biggest takeaway is that we brought in a bunch of people off the sidelines. It gave us hope for 2020 — and a bit of confirmation that our tactics weren’t completely crazy.”

Joe Garofoli is The San Francisco Chronicle’s senior political writer. Email: jgarofoli@sfchronicle.com Twitter: @joegarofoli