After releasing its second-quarter earnings, investors in Canadian National Railway Company (TSX:CNR)(NYSE:CNI) might be a bit wary of the company’s future.

CEO Luc Jobin called the past quarter a “very challenging volume environment,” as the railroad saw declining freight volumes in nearly every sector. Total freight volumes fell by 12%, pushing revenues lower to $2.8 billion. Net income also fell to $858 million from $886 million the year before. While the results were horrible in comparison to the company’s history, they appear fairly healthy when considering the volatile Canadian economy, swooning commodity prices, and a roiled export market.

How worried should you be about Canadian National Railway Company’s future?

Current headwinds aren’t new

Across nearly every commodity segment, Canadian National has been feeling volume pressures. Executive Jean-Jacques Ruest said last quarter that “volume is weak, will get weaker, and pricing is not the greatest.”

“Our crude-by-rail volume dropped by half to 14,000 carloads, for the more relevant aspect of the crude story is a prevalent incremental rail capacity pricing that brought crude by rail to become the least profitable for the unit train business,” the company explained. “The downturn in oil and gas capital program also impacted our steel, cement aggregate and frac sand business. Frac sand was down 45% in volume to 13,000 carloads.”

The good news is that the current headwinds aren’t under Canadian National’s control. Everything that it can control—such as operating, labour, and capital costs—have been improving at an impressive clip. Earnings per share should remain flat this year during one of the company’s most challenging periods of operation. That’s an impressive feat for any company.

Can the dividend still grow?

In January 2015 Canadian National boosted its dividend by 25%. This January the company followed that up with another increase of 20%. Back in 2011 the annualized dividend rate was just $0.65 a share. With the dividend now at $1.80 per share (a 1.8% yield), the company has proven to be a major winner with dividend-growth investors. Can that continue with flattening sales and volumes?

To invest in Canadian National today, you must believe in a few things. First, both the United States and Canada will avoid slipping into another economic recession. As Canada’s number one trade partner, the health of the United States is just as important as a strong domestic economy. Second, commodities will continue their latest rebound, boosting both pricing and volumes for the company’s weakest segments.

If those conditions are realized, Canadian National Railway Company is likely a buy at these levels. With the latest macroeconomic pressures, the company’s stock is now trading at its lowest valuation in nearly two years. Its payout ratio also stands at just 30%. If the North American economy continues to hold steady, investors should still realize plenty of long-term dividend growth.

Stock buy alert hits astounding 96% success rate!

The hand-picked investing team inside Stock Advisor Canada recently issued a buy alert for one special type of "bread-and-butter" stock where The Motley Fool U.S. has banked profits on 23 out of 24 recommendations. Frankly, with an astounding 96% success rate that has delivered average returns of 260%, chances are this new pick could deliver life-changing returns as well. Because the team at Stock Advisor Canada fully embraces the same time-tested investing philosophies that have led to countless Motley Fool winners globally. So simply click here to unlock the full details behind this new recommendation and join Stock Advisor Canada.

*96% accuracy includes restaurant stock recommendations from Motley Fool U.S. services Stock Advisor, Rule Breakers, Hidden Gems, Income Investor and Inside Value since each services inception. Returns as of 5/27/16.

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Ryan Vanzo has no position in any stocks mentioned. David Gardner owns shares of Canadian National Railway. The Motley Fool owns shares of Canadian National Railway. Canadian National Railway is a recommendation of Stock Advisor Canada.