Walgreens Boots Alliance (WBA -0.23%) is going to scale back on mergers and acquisitions. The company's pivot to healthcare and launching primary-care clinics has been taking up a significant portion of its resources and attention, and that's where its focus will remain.

Is this good news for investors, or could it be a sign of trouble ahead for the stock?

Not ruling out all acquisitions, just large ones

On Walgreens' first-quarter earnings call earlier this month, Chief Financial Officer James Kehoe said that while the company won't be pursuing multibillion-dollar acquisitions in the near term, it could acquire businesses that are "in the hundreds of millions." The focus will be on "smaller companies with specific, call it, capabilities that we need to advance our organic business."

The company's recent investing activities have been related to its healthcare business. Last September, Walgreens announced it would buy out the remaining 30% stake and take full ownership in Shields Health Solutions, a specialty pharmacy business, for $1.37 billion. It also entered into an agreement in October 2022 to fully acquire home health company CareCentrix by spending $392 million to obtain the remaining 45% stake in the business.

Meanwhile, it has also been spending billions more on investing in primary-care company VillageMD, which recently announced plans to acquire urgent-care provider Summit Health-CityMD. On top of the $5.2 billion that Walgreens invested in VillageMD in 2021 to launch primary-care clinics at its locations, the pharmacy retailer has also put in an additional $3.5 billion to help fund the Summit Health-CityMD acquisition.

The new healthcare segment is the current priority

Kehoe said on the earnings call that the company's focus needs to be on "integration activities," alluding to the company's recent moves and its new healthcare segment. And there's good reason for that goal. For the period ended Nov. 30, 2022, its U.S. healthcare segment had a gross profit of just $17 million on revenue of $989 million.

Profitability has to be a big priority for Walgreens as the business itself usually generates single-digit profit margins. Otherwise, the new growth initiative could become a drain on the bottom line and make this healthcare stock a worse buy. By the end of fiscal 2023, Walgreens is expecting the healthcare segment to be profitable -- but only on an adjusted EBITDA (earnings before interest, taxes, depreciation, and amortization) basis.

It sounds as though profitability could remain a challenge for Walgreens. But the bigger concern might be generating cash, which is what the company's ultimate goal could be in scaling back M&A activities.

Should the company's cash flow be a concern?

In the trailing 12 months, Walgreens' free cash flow has totaled $1.4 billion. The problem here is that during that period, the company has paid out dividends of nearly $1.7 billion. In previous years, the company's free cash flow has normally been around $4 billion.

The company did report cash and marketable securities of $4.2 billion as of the end of its most recent quarter, so it isn't in a bad position in terms of cash. But with the company paying a dividend and also investing billions in its new healthcare business, this is something investors should pay close attention to now. It could cause problems later on and possibly even jeopardize the safety of the dividend.

Is Walgreens stock a buy today?

With the stock trading at a forward price-to-earnings multiple of just 8, investors are clearly discounting shares of Walgreens right now. And there's good reason for it as sales are declining, and the company's all-in pursuit of primary-care clinics might not necessarily prove successful.

Given the risk involved and the questionable safety of the dividend, Walgreens might not be a suitable investment unless you have a high risk tolerance. You might want safer dividend stocks for your portfolio instead.