It was late summer and the Democratic presidential primary was in flux. Joseph R. Biden Jr. was sinking in national polls and Senator Elizabeth Warren was on the rise. And two men, Michael R. Bloomberg and Deval Patrick, were again thinking quietly about running for president.

They had both ruled out entering the race over the winter. Mr. Bloomberg, the former New York City mayor, had conducted polling and focus groups and concluded it was not worth challenging a rival as strong as Mr. Biden. Mr. Patrick, the former governor of Massachusetts, had confronted a family illness — his wife was diagnosed with cancer — and new scrutiny of his business record. He, too, opted out of the race.

But over time, they both developed second thoughts. Critical of Mr. Biden’s campaign, Mr. Bloomberg asked his aides to bring updated polling information gauging his prospects. Mr. Patrick began expressing unease to friends about whether the existing crop of candidates could unite the Democratic Party after the primary, or heal a divided country after the general election.

And both men still harbored an undimmed ambition to be president.

Now, Mr. Bloomberg and Mr. Patrick are at the precipice of joining the tumultuous 2020 race, encouraged by a combination of anecdotal angst among voters and party officials, and in Mr. Bloomberg’s case by a trove of public-opinion research.