Datalogue’s expansion to Montreal, Mr. Delisle’s hometown, evolved swiftly. He and a partner founded Datalogue in 2016 at Cornell Tech in Manhattan and were lucky when a tech mogul, Charles E. Phillips Jr., the chief executive of Infor, gave him two desks on the fifth floor of Infor’s elegantly restored Flatiron headquarters.

By spring 2017, Datalogue had grown to five employees and had raised $1.5 million in seed funding. But to bring in more engineers would have cost thousands of dollars in visa fees, Mr. Delisle said, and even then, the process would not be guaranteed. Canada has a burgeoning artificial intelligence sector, and the company opened its Montreal office in April in the trendy Mile End neighborhood; it raised another $1.5 million in seed funding by November.

Still, Mr. Delisle said that his company has better access to customers in New York, and for that reason he has kept seven employees there for sales and marketing.

While tech is still thriving in New York, where it is the fastest-growing industry in the city, losing offices or whole companies to Canada could be a concern, said Kevin Ryan, an entrepreneur who had founded a half-dozen start-ups. The multiplier effect of the start-up world is a powerful one.

“When someone decides not to come here to join a start-up, and they go to Toronto, some of them may break off and start a new company across the street,” he said. “The wider impact will be felt, literally, for decades.”

Mr. Delisle agreed. “I’m not necessarily scared for New York; there’s phenomenal programs there,” he said. “I am more scared for the broader policies being applied right now.”

According to the Partnership for New York City, a business advocacy group, immigration has always been central to the economy of New York. Forty-eight percent of the city’s small-business owners are immigrants, and 45 percent of the work force in the city is foreign-born.