(Lidan Chen/for The Washington Post)

Have you ever breast-fed while replying to an urgent email? Driven around in circles until your toddler falls asleep so you can make a call in peace? Placed your sick child in the care of way too many episodes of “Doc McStuffins”? Sat down at your computer, bleary-eyed at 11 p.m. because no one wanted to go to bed on time and you have a deadline to meet?

I’ve done it all — over the course of writing this article.

I should know better. I’ve worked remotely now for four years. And, yes, I usually have reliable and consistent child care. But for me, and the growing number of parents who choose a flexible, work-from-home career, all it takes is a couple of curveballs to send your hard-earned work-life balance into free fall. That’s one reason last year’s BBC dad facepalm moment — when his kids burst into the room while he was doing an interview — became the conference-call interruption heard around the world.

Remote work is steadily becoming the norm — nearly half of all workers worked remotely at least some of the time in 2017, according to a recent Gallup survey. But as the lines blur between what it means to be a working parent and a stay-at-home parent, it’s clear we could all benefit from some ground rules.

“Flexible work is the promised land, but no one is talking about how you buy your plane ticket there and avoid getting stuck in security on the way,” says Daisy Wademan Dowling, chief executive of Workparent, a company she founded after a career in corporate human resources. “No one becomes happy in their work life because in the employee manual there’s a sentence that people can work from home.”

Dowling suggests starting with a specific goal. For example, do you want to eliminate your long commute? Allow for more flexible hours so you can pick your children up from school? Once you have a realistic target in mind, she recommends planning when and where you will be working — making sure it gets you close (but not too close) to your kids — what your child-care setup will be, and any other important logistics.

“Put it on a piece of paper,” says Dowling, who emphasizes that it is important to communicate this plan to your partner and any other stakeholders, so people realize you’re serious about it.

Speaking of stakeholders, don’t forget to include the people who are most affected by this arrangement: your children.

“Boundaries are something every parent really struggles with,” Dowling says. “Up until children are pretty old, it’s extraordinarily difficult for them to realize you’re there and not present for them.”

She says clarity is crucial, especially with young children. Whether you promise to set a timer and check in every hour or schedule a snack date, set their expectations and know that sometimes the clearest signal you can send is shutting yourself behind a closed door.

Basecamp chief technology officer David Heinemeier Hansson, who co-wrote the bestsellers “Rework” and ­“Remote: Office Not Required,” has run a remote team for the past 15 years. He enjoys a leisurely breakfast each morning with his children before working from his home office. He says the key to success while working remotely is to maximize focused productivity and prevent multitasking overload.

“I have an iMac computer in my home office,” he explains. “Everywhere else, I carry my iPhone and tablet and try not to use it to answer work email. It’s a way of delineation, so you don’t sit on your laptop all day long.”

Hansson says one of the biggest mistakes he sees people make when they start working remotely is working too much. “People are so eager to prove themselves that they are working all day and night,” he says. “We actually have to train them not to do this.”

Not all personal interruptions are bad, he emphasizes. Spending spontaneous time with your family is one of the biggest perks of remote work.

“You can take a 15-minute break to console your kid without it having an impact on your work,” says Hansson. “It leads to a happier environment and more harmonious work and home life.”

He says one common trick is to use clothes to delineate when you’re in work or leisure mode. One of his employees found great success by simply switching between two sets of slippers.

“It’s not that you have to dress up,” Hansson says. “It’s just that he knew, ‘I have my home slippers on right now, so I’m not responding to this email.’ ”

Outspoken advocates for calmer workplaces, Hansson and his Basecamp co-founder and co-writer Jason Fried have a book coming out in October, “It Doesn’t Have to be Crazy at Work.” In it, the two make it clear that work-life balance starts at the top and extends down.

Jim Harter, chief scientist of workplace management and well-being for Gallup, agrees that for parents seeking a fulfilling remote career, finding a good management fit makes all the difference. He says as managers prioritize collaboration and coaching, remote work becomes more effective.

According to Harter, research six years ago revealed that people with one day of remote working had the highest level of engagement, but now that same level is achieved by people who work three to four days remotely. He attributes this difference to more experienced employers and managers.

Harter adds that the biggest shift he’s seen in the past five years is an increase in the percentage of people who work 80 to 100 percent of their time away from an office — now almost a third of all workers.

There’s a learning curve to managing a completely remote role — and when you throw kids into the mix, things can get even trickier.

“You’re never away from your job,” says Karen Alpert, author of “I Heart My Little A-Holes” and the blog Baby Sideburns. “You’re living in your office 24 hours a day.”

Alpert, who once ranted in Fast Company that “working from home is the worst of both worlds,” says thanks to hard work and many late nights, she has achieved the work-from-home career she wanted. Still, she finds herself decamping to Starbucks on a regular ­basis, just to be around other adults.

“Being a parent is isolating, but being a parent and working from home is really isolating,” she says. “Especially as a mom, there’s so much pressure to do your job as fast and efficiently as possible.”

Alpert says that although it’s not always easy, she and her husband (who also works a flexible job from home) have been able to save money on child care and spend more time with their kids, thanks to a “ridiculously equal partnership.”

For Andrea Goulet, co-founder and chief executive of the remote tech company CorgiBytes, it took an unconscious bias test for her to realize she was holding herself back in the work-from-home workplace.

“The big spike in my bias was about me thinking women should do more of the housework,” she says.

When you’re working from home as a parent, the cognitive load of “housework” can feel paralyzing. Goulet says that, armed with this knowledge, she and her husband, who also works from home, figured out a way to offload some of that work — together.

One of the biggest challenges they faced was getting their kids out the door each morning. “We have an assistant who is helping us get the kids ready and getting them to school,” says Goulet. “We get six hours a day of productivity by paying someone $20 an hour for two hours.”

She says she’s always had confidence in the power of working from home as a parent because she saw her father quit his job in 1985, buy an Apple computer and launch a successful business from their house.

“He always said it was the best decision he ever made,” Goulet says. “Later when I asked, he said he did it because he got to see me get off the bus every day.”