It was an idea born of a cold New England winter and a few beers among co-workers at Dimagi, a Cambridge, Massachusetts-based company that develops mobile apps designed to improve health care in developing countries. Next winter, why not move the whole company someplace warmer? Danny Roberts, a software engineer who had spent part of his childhood in Brazil, recommended it as a destination, and the idea started to gain traction.

It wasn't such a crazy notion. The company had just 15 employees in its home office (another 14 were working elsewhere, including company offices in India and South Africa). And given that Dimagi has projects in 25 countries, its workers--mostly programmers--were used to working remotely, connecting via email and Skype, and saving their work to a cloud server. "All we really need are our laptops and a power supply," says the chief technology officer, Cory Zue. What's more, Dimagi's work force consists mostly of twentysomethings, so leaving spouses and families behind wasn't a concern for most. Still, although it made sense to the employees, clearing it with the boss was another matter.

Roberts pleaded the case with Dimagi's CEO, Jonathan Jackson. An informal planning committee had already worked out several technical details of the proposed work-cation. The most important detail--a place to stay and work--was settled later, when Roberts's grandmother offered her apartment in São Paulo while she was away on vacation. A nearby hostel would provide additional beds.

"By the time the plan got to me, it was already pretty big," says Jackson. "The employees were driving this, and I wanted to support them. From a business-development perspective, getting a better understanding of South America and scouting potential partners there made sense. But I wanted people to know that this wasn't just a way to party down in Brazil. They needed to be able to communicate with the team at home, and remote clients as well." Given that there was only a one-hour time difference between Boston and São Paulo, and after a successful Internet speed test was performed by Roberts's grandmother, Jackson was reassured that long-distance collaboration was logistically feasible. He also trusted that his young team was mature enough to stay out of trouble abroad.

Even though everyone at the company was invited, one of Jackson's main concerns was that those who couldn't make the trip might feel left out. "I didn't want people here to feel that the people in Brazil were wasting time," he says. Because not everyone could go, Jackson insisted that employees who wanted to go would pay their own way. "Nobody argued with that at all," says Zue.

Team members deployed in two waves starting in late January 2012. Almost everyone made it for at least a week, with a core group staying on for a full six weeks. At the peak, 10 people were working out of the São Paulo apartment. The team gathered laptops around the kitchen table, sprawled on a couch, or vied for a prized spot on the small deck. By and large, the close quarters improved communication among co-workers, and bickering was rare. "There was a lot more casual asking questions across the table," says Zue. "And we tended to work later in the day than we would at home, since we were having dinner together almost every night." It also helped that there were no major technical glitches. "Our Internet service in São Paulo was actually better than we had in Cambridge at the time," says Zue.

After hours, the team frequented a local bar, and it made good use of vacation days for long weekends spent sightseeing in Rio. The staff celebrated Carnival in a small colonial town and hung out at a beach house on the island of Ilhabela. Though there were concerns about having half the company go offline all at once, it was never an issue. "If anything, we were much better about communicating when we were going to be on- and offline," says Carter Powers, Dimagi's chief operations officer.

When Jackson flew in for a week, he was impressed. "We'd done Skype chats, so I knew they were being productive, but the second I saw them, it was clear they had a really cool level of bonding," he says. "There was a ton of great energy. People really wanted to prove that the idea of an away month was feasible, and they were very productive."

Those who couldn't go lived vicariously via videoconference with colleagues who seemed to be wearing less clothing with each passing week. For Dan Myung, 32, a senior engineer with a then-pregnant wife and a major project set to deploy during the São Paulo trip, getting away wasn't viable, but he holds no grudge against his freewheeling co-workers. "I'm one of the older guys in the company, and I feel less pressure to have my social life and work life be related. They put the most hilarious stuff that happened on YouTube, anyway."

For both employees and management, the trip has had enduring benefits. "A lot of that friendship and energy is still there," says Jackson. "People are definitely walking tall, being able to tell their friends that they got to work in Brazil." And it's been good for hiring. "We recently gave an offer to a guy who, when he accepted, said, 'How can I not go to work for a company that goes to Brazil for no reason?' For the social-enterprise sector, we offer competitive pay, but we're not in the Google range. Doing this type of thing absolutely helps."

Jackson says companies contemplating a similar experiment don't necessarily need a trip to Brazil. Getting the group together anywhere away from the office will probably lead to a great bonding experience. He does suggest letting employees--not management--drive the planning process. And it's important to recognize that even if you're the world's coolest boss, you're still a boss. "I think they appreciated that I went there for part of it," says Jackson, "and also that I wasn't there for all of it."

Jackson doesn't expect an away month overseas to happen every year, but he's open to trying out variations on the theme. In fact, the company recently had a second trip, to a place closer to home but exotic in its own way--the New Jersey shore.