Check out the latest Cognex earnings call transcript.

Machine vision specialist Cognex (CGNX 1.63%) is a much-admired growth company with significant exposure to many long-term growth trends -- the increasing use of automation and robotics in manufacturing and growth in e-commerce fulfillment centers, to name two. Everybody knows what you should do with such stocks -- buy on any significant near-term weakness caused by a downside shock as long as the long-term growth expectations are in place. Is this a good idea with the stock right now? Let's look at the arguments for and against.

The case for buying Cognex stock

There are three key reasons to buy the stock. First, the company's long-term growth depends on secular trends, which are augmented by cyclical factors. The bulls see 2018 as a year when some cyclical factors went against the company -- a moderation in capital spending by OLED/smartphone customers and slowing spending by customers in China -- but those issues shouldn't affect long-term prospects.

Coins and cash

Image source: Getty Images.

For example, as e-commerce grows as a share of global retail sales, it's likely that spending on e-fulfillment centers will increase dramatically -- that's good news for Cognex's machine vision solutions, which help logistics centers monitor and sort packages. Although logistics sales make up less than 10% of current sales, management sees them growing at 50% a year over the long-term.

Moreover, even if consumer electronics and automotive markets (Cognex's two big industry verticals) are seeing slowing end-market conditions, there is still pressure on customers to automate production.

Second, if you accept that Cognex is a long-term growth stock, its current cash flow valuation is starting to look attractive. As I've previously argued, a high-growth stock like Cognex is a good value if you can buy it on a free cash flow yield of around 3%.

As you can see below, the current price-to-free-cash-flow multiple is around 37 times, or

a free cash flow yield of 2.7% -- that's a good value for a stock that's capable of 20% revenue growth over the long term.

CGNX Chart

CGNX data by YCharts

Third, history suggests that it's usually a good idea to buy into Cognex when there isn't too much optimism baked in -- and a bad idea to buy in when there's a lot of optimism. For example, the company entered 2018 with management talking about market conditions being the best ever experienced, only to disappoint the market later in the year -- the stock declined 37% in 2018.

On the other hand, Cognex had a growth hiccup in 2015, and, as you can see in the chart above, the resulting share price slump provided a good entry point into the stock. 

The case against buying Cognex

The bearish worry about the near- and middle-term headwinds the company faces. For example, Cognex's single largest customer is Apple (AAPL 2.86%), and the iPhone maker's commentary on end markets in China casts doubt on the idea that Cognex's smartphone customers are going to loosen up capital spending budgets in 2019.

Moreover, the general slowdown in China observed by Cognex's management on the third-quarter earnings call in October has probably extended, given the anecdotal and hard evidence of slowing growth in the country.

Moreover, the passing of a peak in North American automotive sales could put Cognex's automotive sales at risk. The automotive industry has been an early adopter of machine vision and automated production in general, and it represents a key industry vertical. For reference, management believes it can grow automotive sales at 10% over the long term

Time to buy?

Given the near-term headwinds, don't be surprised if Cognex's management doesn't have great things to say about 2019 when it reports its fourth-quarter 2018 earnings in the coming weeks. In addition, it's very hard to know if and when China's growth will improve again. That said, the company's long-term growth drivers are still in place, and if you have a strong belief in their potential, now is a good time to buy into the stock.

All told, Cognex is a stock worth buying for enterprising investors willing to tolerate some potential near-term volatility and hold the stock for the long term.