“It’s a rough life, but Beijing has been good to us,” said Mr. He, 43, who said he had abandoned the economic stagnation of rural Sichuan Province nearly a decade ago. “If you work hard here you can do well.”

When the work dried up last month, they rented an apartment and tried to stick it out. The jobs never came, and the rent was steep, so on Thursday the couple packed their cutting board, the electric cooking burner and a vase of plastic flowers and joined the throngs at the station. Their destination: Jiangxi Province, 24 hours away, where a relative said there was ample opportunity. Mr. He and Ms. Pang said they might come back next year, depending on whether Beijing’s construction revives after the Olympic Games.

“We can only hope,” Mr. He said.

Some people said they were leaving out of fear. Li Ping, a 33-year-old seamstress from Sichuan, said co-workers at her suitcase factory insisted that anyone who remained in Beijing without a residency permit would face a steep fine. She said she had scrambled to apply for the coveted document but was too late.

Image Pang Chunlian and her husband, He Yanjun, center, were leaving Beijing after work dried up. Credit... Du Bin for The New York Times

“I should have paid attention sooner,” she said.

Her boss, unsympathetic, docked her a month’s pay, or about $140. He told her that by skipping town, she was violating her contract, even if she had never signed one.

“I should be happy for the Olympics, but I’m angry,” she said. “These bosses can be so evil. I don’t think I will be coming back.”

A few rows away, Wang Yongsheng and his wife, Ma Ernu, sat in the waiting room’s orange plastic chairs looking dazed. Two weeks earlier, the couple had come to the capital from their home in Inner Mongolia in the hopes of finding treatment for Ms. Ma’s worsening kidney disease. The couple, retired farmers, said they could not find decent medical care back home.