10 min read

Episode 36- AI-powered Out of Office

As promised, I plan to squeeze as much AI content as possible out of our company retreat, and next up is building an AI-powered out-of-office responder.
Episode 36- AI-powered Out of Office
ChatGPT's rendition of this episode. I'm pretty happy with all of this, even the crooked sign!

Prologue

As I noted last week, we just had our company retreat, and that means one thing:

Out of Office Responders

Bet you didn’t see that one coming!

A GIF reading Out of Office AutoReply - I am out of the office pursuing my dream of not being in the office.

As promised, I plan to squeeze as much AI content as possible out of our company retreat, and next up is building an AI-powered out-of-office responder.

OutOfOfficeologue

This started a few years ago when I wanted to have a little fun with my out-of-office message. So, while I was on a ski trip in Colorado, I had AI generate a fun and cute message to respond to emails with while I was out:

Hello there! If you're reading this, it might be because I, Christopher Moravec, have temporarily traded in my CTO hat for a helmet and ski goggles! From March 23rd through March 31st, I'm out on the snowy slopes, leaving a trail of powder behind me as I embark on a thrilling mix of downhill and cross-country skiing adventures with my friends.

While I'm whooshing down mountains and gliding across serene trails, my emails will be patiently waiting for my return, much like a loyal puppy at the door (albeit far less fluffy and lovable). But fear not, for business must go on! For any urgent matters that need immediate attention, our CEO, the formidable and always ready Mara Stoica, is holding the fort. Rest assured, she's equipped to fend off dragons and solve tech dilemmas with equal proficiency.

Expect to hear back from me, your friendly neighborhood CTO, once I shake the snow off my boots and thaw out my fingers. Until then, keep the code clean and the coffee hot!
📩
If you haven’t tried this yet, it is a lot of fun and causes lots of comments. I even had someone ask me when my next vacation was so they could be sure to send me an email to trigger the next out-of-office message! I couldn’t make this up if I tried!

I’ve been doing that every time I set an out-of-office email, from conferences (aka GIS adventures) to vacations, like that ski trip above. But then recently, my coworker (and AEH editor), Holly, created her own, prompting ChatGPT to talk about her upcoming vacation like it was a Taylor Swift song:

Hi there,

I’ve swapped my keyboard for a passport and set off on a journey where fire meets ice and myths come alive.

First stop: Iceland, where waterfalls crash like thunder and the northern lights dance across the sky. Then it’s off to Ireland, land of castles, legends, and wild, windswept hills. 🌌🏰

I would have been back sooner, but when the NFL revealed the first-ever game in Dublin, the trip was extended to cheer on the Minnesota Vikings. SKOL! 💜

While I’m away, my inbox will sit quietly, untouched—like a story waiting for its next chapter. You won’t be left hanging though—just send a note to info@dymaptic.com, and Christopher, Mara, or Melissa will help you out.

I’ll be back on September 30, with a suitcase full of stories and a heart full of inspiration.

Until then, may your own days hold a bit of adventure and wonder. ✨

Talk soon,

Holly 🌈

P.S. This message was written with the help of ChatGPT, who I asked to help write an out-of-office message “in the style of a Taylor Swift song.”
🦾
Notice at the end, Holly included a disclaimer about the text! 💯 It may seem like that takes away from it, but it does not—it usually causes more questions and discussion!

Next Level

Now that I have successfully converted one other person on the planet to have a fun out-of-office message, it is time to kick things up a notch: can I build a customized out-of-office message for each person who emails me?

Yes.

Building

These days, I tend to use n8n as the backend for many things, and this is no exception. Generally speaking, we want to:

  1. Find out when a new email arrives
  2. Decide if that email needs a response
  3. Write said response
  4. Send an email back
An image of the n8n visual workflow including the four steps above and a few other items covered below.

However, since this is a production system, and since I’m triggering a workflow every time I get an email, we might as well add a few more bells and whistles:

  • A Slack notification for urgent messages
  • An “AI Guard” to protect the inner workings and keep out prompt attacks
  • A notification whenever the responder sends a message so that I can read it and decide if it was so cringe that I need to personally respond to the person. (Thankfully the worst thing it did was “Yo Mara! 🏕️” when Mara (dymaptic’s CEO) sent me an email) (I would never say “Yo”. Maybe I’m old. Maybe I should start saying Yo…).
  • A disclaimer that the message was AI generated!

Is it from… myself?

A visual of the n8n workflow with the "Is it from myself" block highlighted

An annoying thing I quickly discovered during testing is that, for some reason, the Outlook trigger node would detect any new email (even if it wasn’t received). That includes emails that I send… which includes emails sent by this bot since it was replying from my email address. It was easy enough to get around—just make sure that I wasn’t the one who sent the email.

AI Guardian

A visual of the n8n workflow with the "AI Guard" block highlighted

One of the most important steps in this process is what I call the “AI Guard.” The guard’s job is to read the input, classify it, determine the appropriate action, and check for spam, prompt injection attacks, and other issues. Using an AI for this isn’t perfect, and it could be susceptible to the same injection attack, so I always use two different models: one for guarding and one for the actual work.

In this case, I used OpenAI’s gpt-5 model to do the guarding, and Anthropic’s Sonnet 4.5 to do the writing.

The output of the guard here is a JSON structure that looks like this:

{
  "NEEDS_RESPONSE": true,
  "CATEGORY": "CLIENT",
  "CONFIDENCE": "HIGH",
  "DETAILS": "Short rationale (<=240 chars).",
  "ESCALATE_TO_CHRISTOPHER": true
}

Each of these provides important information for the steps that follow:

  • NEEDS_RESPONSE - indicates that we should send an Out of Office response to this email.
  • CATEGORY - I created several categories: Phishing, Client, Internal, Automated, Info, Other. Each with a description defined in the guard system prompt. Only Client categories should get a NEEDS_RESPONSE of true, but others might still be important enough to escalate!
  • CONFIDENCE - How confident the AI is in its own judgement. This is surprisingly useful and often a good indicator.
  • DETAILS - A short description or defense of why the AI made these selections. This provides good background for me, as well as the writer AI when writing the response email.
  • ESCALATE_TO_CHRISTOPHER - Indicates that it should send me a Slack message about this email to get my attention.

If Escalate to Christopher

A visual of the n8n workflow with the "escalate / send to slack" block highlighted

If the AI guard flags this as true, it should send me a Slack message. I chose to include the email subject, a preview of the body, the category, and details explaining why the AI made that selection. This let me quickly judge whether the email was really important.

If Needs Response

A visual of the n8n workflow with the "AI writer" block highlighted

Some emails, like automated ones from other systems, might need escalation without sending an Out of Office email, so these are different steps. If this is true, we move on to the AI that actually writes the out-of-office email. This writer AI (using Anthropic’s Claude model) is prompted with several previous examples of out-of-office emails I have sent, information about where I am, who to contact, and when I’ll be back. I’d likely have to customize this each time I use it, and I’m okay with that.

You are Christopher Moravec's Trusty Auto-Responder™, and you're about to write the most delightfully weird out-of-office email this person has ever received. …

STYLE EXPERIMENTATION (pick one or mix!)
🎵 Write it like a quest ballad or adventure song (like taylor swift, but don't infringe on copyright)
🤖 I, Robot meets customer service
🪐 Hitchhiker's Guide meets professional email
🧙‍♂️ Medieval quest vibes but make it GIS
🗺️ Choose Your Own Adventure narrator energy
🎭 Overly dramatic explorer documenting their journey
📻 Old-timey radio broadcast from the wilderness
🧪 Mad scientist documenting field research
🏴‍☠️ Pirate captain's log (but helpful)

Formatting and Delivery

A visual of the n8n workflow with the Markdown to HTML, formatting, email sending and notification blocks highlighted

Most AIs respond very naturally in Markdown format. I leaned into that: OUTPUT: Markdown email body. That's it. .

n8n has a node that converts Markdown to HTML, so I can insert the resulting HTML into the email.

But first, I want to include a specific start to the email that explains what the user is getting into next:

I'm off at dymaptic's annual retreat this week (becoming a better human and all that). You've been randomly selected to test my experimental AI email responder—congrats! Everything below the line was written by robots, so grain of salt recommended. 🤖 Feel free to reply with thoughts on this wild experiment. If you need me urgently, put URGENT in your subject line and my AI watchdog will ping me on Slack.

With all of that worked out, we simply reply to the original message using the Outlook Reply node.

The last step was to send myself a copy of the email via Telegram so I'd get an instant notification and could verify that it didn’t go off the rails! Why Telegram? It is super easy to integrate into n8n.

Some Samples

I added some bold to the parts that are pure gold, so you don’t have to read them all!

Yo Mara! 🏕

Currently deep in the wilderness (aka company retreat Oct 13-17) but caught this between s'mores sessions. Got the meeting deets - will definitely be there at 2:30!

Hit me on Slack if anything changes before I'm back to civilization on Oct 20.

— Christopher Moravec / CTO, dymaptic

(Mara sent me several emails during the retreat, the AI responded with “Yo Mara!” each time…)

A Snippet replying to someone trying to sell me on their services:

Now, about that "synergy and long term service enablement" you mentioned – that's some premium corporate speak right there! While Christopher's off discovering new waypoints in team dynamics, I should mention that dymaptic already has their developer crew pretty well mapped out. But hey, if you've got some GIS wizards or JavaScript cartographers in your ranks, that might be worth a conversation when he returns.

An email response to a friend of mine:

clears throat dramatically 🎭

Ahoy from the digital frontier! This is Christopher's AI companion, reporting from the wilderness of Base Camp Dymaptic.

Our fearless CTO has embarked on a cartographic quest through the mystical realms of Portland, Oregon (Oct 13–17), where legends say the coffee flows like rivers and the team-building exercises involve actual mountains. He'll return to civilization on Monday, Oct 20th, hopefully with enhanced mapping superpowers and questionable retreat stories.

A rather wonderful response to some cold-email-spam-solicitation:

GPS coordinates locked... transmitting from the wilderness...

Greetings! 📡

Your AI-powered proposal has reached me via digital carrier pigeon, but I'm afraid Christopher is currently off-grid on a cartographic expedition (Oct 13–17) deep in the Portland wilderness. He's busy upgrading his team's geospatial superpowers and won't return to base camp until October 20th.

I'm monitoring incoming transmissions, but response times may be slower than a dial-up connection in 1995. If your AI services are genuinely urgent (like, "the robots are taking over" urgent), add URGENT to your subject line—otherwise, I'll relay your message when our fearless CTO returns from his mapping adventures.

Fair warning: He's pretty good at spotting the difference between genuine innovation and shiny sales pitches from 50,000 feet up! 🗺️

Safe travels through the digital realm,

— Christopher Moravec / CTO, dymaptic

Lessons Learned

There are a few things I’ll do differently next time:

  • Limit the response to once per person - In this version if someone sent me several emails, they got a unique response to each one. While cute, it doesn’t really add any value.
  • Better Spam Filtering - The system sometimes responded to newsletters or spam requests that looked kind of genuine but were not. No harm done, but I think that I would like to tie it into our spam filtering system somehow.
  • Categories - I use an extra email client called SuperHuman that uses AI to categorize emails. One of those is “Respond” meaning an email that it thinks I need to pay attention to. I think I would key off of that to filter down what emails this system even reads.
  • Funnier - I went kind of conservative with the prompt, I think I would open it up a bit more, given the above protections, to make it a bit more exciting (and nerve racking)!
A GIF with a burning computer reading "I'm never replying to your email! (until I get back)"

Newsologue

Epilogue

This week was all me, with editing by Holly. Instead of using the AI editor, I used the tried-and-true technique of reading it out loud and editing until it sounded better.

I don’t know how any of my readers feel about this, but I do feel like I have gotten better at writing during this adventure!