The opportunity for Silicon Valley is enormous. The federal government spends $80 billion a year on information technology, much of it used to maintain outdated technology such as data systems that are decades old and storage that includes floppy disks used at the Defense Department. Federal agencies maintain 6,100 data centers that could be consolidated and moved to the cloud.

The meeting occurred as tech company stocks roared back after declining in the last two weeks, pushing the stock market to records on Monday. Apple and Alphabet, the parent of Google, were among the top gainers after three consecutive sessions of declines.

The tech industry has walked a delicate line in its engagement with the Trump administration. Some tech workers and customers have called on industry leaders to withdraw from positions as official advisers to the president. Uber’s chief executive, Travis Kalanick, resigned as a White House adviser after protests by employees and users. Elon Musk, chief executive of SpaceX and Tesla, quit the White House business advisory council after the administration withdrew the United States from the Paris climate accord.

Mr. Musk did not attend the meeting Monday. Mark Zuckerberg, the chief executive of Facebook, was invited but declined because of a scheduling conflict, the company said.

The meeting occurred only weeks after tech executives, including Mr. Musk and Mr. Cook, publicly criticized the withdrawal from the Paris accord. But senior administration officials said they had not encountered any reluctance to participate in the event and had a waiting list for people who wanted to attend.

“This is a double-edged sword for the tech C.E.O.s because they don’t want to be window dressing and used for photo ops,” said Jeffrey Sonnenfeld, a professor and associate dean at the Yale School of Management. “But on the other side, this is the most business-friendly administration since Eisenhower and is much more open than any administration to influence on the spot.”

Administration officials said that the chief executives had done their homework and were engaged in the workshops and discussions.