UiPath's (PATH -3.40%) stock surged 14% during after-hours trading on Wednesday after the company posted its latest earnings report. For the fourth quarter of fiscal 2023, which ended on Jan. 31, revenue for the robotic process automation (RPA) company rose 7% year over year to $309 million and exceeded analysts' estimates by $30 million.

Its adjusted net income more than tripled to $83 million, or $0.15 per share, and cleared the consensus forecast by $0.08. On the basis of generally accepted accounting principles (GAAP), it narrowed its net loss from $63 million to $28 million.

Androids dressed in business suits.

Image source: Getty Images.

Revenue increased 19% to $1.06 billion for the full year, a deceleration from its 47% growth in fiscal 2022, but its adjusted net income still jumped 78% to $80 million. It also narrowed its GAAP net loss from $526 million to $328 million.

Those stable growth rates impressed investors, but its stock remains about 70% below its initial public offering price of $56 in 2021. Could it still be worth buying as a long-term investment?

Why is UiPath's growth cooling off?

UiPath's RPA software can be integrated into an organization's existing software to automate repetitive tasks like processing invoices, onboarding customers, managing inventories, entering large amounts of data, and sending out mass emails. These tools can be used to streamline an organization and reduce its dependence on employees.

UiPath enjoys an early mover's advantage in the RPA market, which Fortune Business Insights estimates will expand at a compound annual growth rate (CAGR) of 23.4% between 2022 and 2029. But it also faces fierce competition from similar services like Microsoft's (MSFT -4.15%) Power Automate, Salesforce's (CRM -2.19%) MuleSoft RPA, and Appian (APPN -2.89%) RPA.

The RPA market might initially seem resistant to macroeconomic headwinds, since companies can use its software to improve their operating efficiency and cut costs. However, UiPath's slowdown over the past year -- which it attributed to a soft macro environment, the suspension of its business in Russia, and currency headwinds -- dispels that idea. 

During economic downturns, many companies will likely tighten their belts with faster and simpler cost-cutting measures, like mass layoffs, instead of spending more money on automation software. RPA software providers generally fare better when companies want to expand efficiently instead of shrinking their businesses.

During the latest conference call, chief financial officer Ashim Gupta said UiPath will still face "macroeconomic variability and [currency exchange] headwinds" in fiscal 2024. It expects its revenue to rise 10% to 11% year over year in the first quarter and 18% to 19% for the full year.

Will UiPath's profits continue to rise?

Adjusted gross margin declined from 87% in fiscal 2022 to 86% in fiscal 2023, and the company expects that figure to drop to 84% in fiscal 2024. Its dollar-based gross retention rate came in at 97% in the fourth quarter, which indicates it's retaining most of its customers. But its dollar-based net retention rate, which gauges its year-over-year revenue growth per existing customer, dipped to 123%, compared to 126% in the third quarter and 145% in the prior-year quarter.

UiPath's slipping gross margins and dollar-based net retention rates suggest it's losing its pricing power in the saturated market for RPA services. For example, Microsoft and Salesforce already integrate their own RPA services into their market-leading enterprise software, and that pressure could be curbing the market's appetite for stand-alone services like UiPath.

Its adjusted operating margin declined from 8% in fiscal 2022 to 6% in fiscal 2023, but it expects that figure to expand to 9.5% in fiscal 2024 as it reins in spending. It already went through two rounds of layoffs in fiscal 2023 (a 5% reduction followed by a 6% reduction) and might trim more jobs over the next few quarters.

It also plans to rein in the stock-based compensation (SBC) expenses, which gobbled up 35% of its revenue in fiscal 2023, diluted its outstanding shares, and kept it unprofitable on a GAAP basis. It didn't provide any bottom-line guidance for fiscal 2024, but analysts expect it to narrow its GAAP net loss by $75 million year over year to $253 million. On an adjusted basis, analysts expect its earnings per share to stay roughly flat.

UiPath ended fiscal 2023 with $1.4 billion in cash and equivalents along with $355 million in marketable securities, so its liquidity won't dry up anytime soon. Its low debt-to-equity ratio of 0.4 also gives its plenty of room to raise more cash.

Is UiPath's stock worth buying?

With an enterprise value (EV) of $6.4 billion, UiPath trades at about five times this year's sales. By comparison, Salesforce -- which is larger but growing slower than UiPath -- also trades at the same EV/revenue ratio. Appian, which is also growing slower and still posting non-GAAP losses, trades at nearly six times this year's sales.

UiPath's valuations should limit its downside potential, so I think it's worth nibbling on at these levels. Its stock could remain volatile this year, but its growth could accelerate significantly once the macroeconomic and currency headwinds wane. It could also still be a tempting takeover target for larger tech companies like Microsoft and Salesforce.