COMPUTERS slow as they age, and before long must be replaced by newer models. Something similar is true of the business models of Indian IT firms. Specialised in running global companies’ outsourced back-offices, the likes of Infosys, Wipro and Tata Consultancy Services (TCS) used to be national champions growing at double-digit rates. Their prospects have dimmed of late; an entire industry built on the back of globalisation is fretting about the incoming American president. But Donald Trump is merely the latest threat to their operating systems.

Over three decades, Indian IT has become a $140bn industry built on a simple proposition: rich-country companies could trim costs by getting tedious behind-the-scenes IT work done by cheap engineers in India. The Indian firms hoovered up bright graduates—the big three have over 700,000 employees in total—paying them starting salaries of $5,000 or so, a decent local wage. After gaining some experience, tens of thousands were dispatched to client sites in Europe or America, along with a few expensive local staff. The rest ensured their clients’ computer systems kept ticking over from cosy cubicles in Bangalore, Hyderabad and elsewhere.

Growth spurts and stalls are nothing new for the trio, the most international of dozens of Indian IT firms (American and European companies such as IBM, Accenture and Capgemini have large Indian presences, too). Their prospects are ultimately tied to the sluggish rich-world economies of their clients: America makes up over half of Indian IT sales, Europe a quarter. Banks and insurance companies, the biggest customers, have been in penny-pinching mode of late; ditto energy companies struck by falling oil prices.

But what felt like cyclical softness looks increasingly like it is being compounded by structural decline. Dollar-denominated growth rates have oscillated but clearly trended downwards and are now firmly in the single digits (see chart). Margins of over 20% are coming under pressure, even after a sustained fall in the rupee against the dollar increased the cost advantage of earning in America and paying staff in India.

There is still plenty of the $900bn global IT services budget for them to capture. But some headwinds now look like they will endure. Mr Trump’s swearing-in is the most immediate concern. The incoming president has railed against certain visas for skilled workers, many of which are gobbled up by Indian IT firms to send staff on stints to America. A proposal to hike the minimum salaries to qualify for such schemes from $60,000 to $100,000 would make many postings uneconomical. That would mean replacing Indian expats to America with locals, especially if the cap for the number of new visas is lowered from the existing 65,000 a year. Add in higher visa-application fees for large-scale labour importers, and that might trim up to five percentage points from IT companies’ margins, analysts think. Fuzzy talk of an “outsourcing tax” will in any case hardly encourage IT procurement managers to look overseas. Changes in how clients think about technology is a bigger worry for Indian IT firms. Budgets globally are growing steadily, at about 3% a year reckons Gartner, a research outfit. But an increasing amount of the money is spent on trendy stuff like analytics or the internet of things. Such new “digital” services will rise from a tenth of total IT spending in 2014 to over a third in 2020 according to McKinsey, a consultancy. IT managers at big firms think they can finance the development of snazzy big-data projects and mobile apps by trimming spending in their existing IT infrastructure, for example by replacing their own data centres (which they pay Indian firms to maintain) with cloud storage (which they do not). And some of the tasks which engineers used to do, such as tailoring software for a client, can now be done by machines. It seems that workers in India’s vast code-writing centres are as much at risk of being made obsolescent by automation as those in factories making cars or shoes.

Indian firms want to get in on the new digital action, which they think is less likely to be commoditised. But they specialise in fixing problems cheaply, not driving innovation. Devising a mobile-banking app for millennials, say, is a far cry from parsing lines of code for bugs.

The IT firms know they need to adapt. “We will not survive if we remain in the constricted space of doing as we are told, depending solely on cost arbitrage,” Vishal Sikka, the boss at Infosys, wrote in a recent letter urging staff to shape up. “If we don’t we will be made obsolete by the tidal wave of automation and technology-fuelled transformation that is almost upon us.”

Please wait, update in progress

Others have a head start in the race to the sunlit digital uplands. Accenture has digital-services revenue per employee around four times its Indian rivals, points out Vaibhav Dhasmana of Jefferies, a bank. It derives more than a fifth of its revenues from such work. Most Indian firms don’t break out this figure, somewhat tellingly, but it is thought to be in the 10-17% range.

European and American rivals have heftier consulting arms that can shape companies’ spending. They are eager acquirers of companies, often boutiques that give them skills they cannot develop internally. They spend more on research and development, too: 2% of revenues for Accenture, compared with a mere 0.5-1% of revenues at Indian firms. All this reduces profits: Accenture has margins on earnings before interest and tax of around 15%, not much more than half what Indian firms have traditionally secured.