Latest / AI Fire Daily / #210 Max: Build Your First AI Email Assistant in n8n (Part 2: The "Hands")
Transcript
- 0:00Email. It's essential, obviously, but let's be
- 0:04honest, for most of us, it's just chaos, pure
- 0:07chaos. We talked last time about building the
- 0:09AI brain, the part that sorts through it all.
- 0:11Right, the classification layer. And that's huge,
- 0:13don't get me wrong. But thinking, that's only
- 0:16half of it. The real magic, the part that actually
- 0:20gives you back hours every week, that happens
- 0:22when your AI doesn't just read, but it acts.
- 0:25We're basically giving the AI hands, you know,
- 0:28so it can manage your inbox all the time, 24
- 0:30-7, sending replies, picking the right teams,
- 0:34clearing out all that junk. So that's the mission
- 0:36for this deep dive. We're getting into part two
- 0:38of that AI. Email Assistant Guide, focusing specifically
- 0:42on building out those action branches, the hands,
- 0:45as you said. Exactly, within the workflow. And
- 0:46we'll be mentioning NANN quite a bit. Just quickly
- 0:49for anyone unfamiliar, NANN is essentially a
- 0:51no -code tool. It lets you build and automate
- 0:54these kinds of workflows, linking things like
- 0:56AI models to your Gmail. Yep, it's the glue.
- 0:59So the plan today is pretty straightforward.
- 1:01We're going to look at four key actions, kind
- 1:03of tiered by risk, actually. Low -risk auto -replies
- 1:06for common stuff. Then safe team notifications,
- 1:10especially for sensitive things like finance.
- 1:12After that, high priority draft creation where
- 1:15a human still needs to press send. And finally,
- 1:18the easy one. Just cleaning up the inbox. Right.
- 1:21And we'll wrap up with how to actually turn it
- 1:23on the activation step, which is critical. And
- 1:26then some really cool ways to scale this up,
- 1:28including, you know, the costs involved. Sounds
- 1:30like a solid plan. Let's start with those auto
- 1:32replies. The customer support branch. This feels
- 1:35like where the biggest immediate time saving
- 1:37could be, right? Getting rid of repetitive answers.
- 1:40Oh, absolutely. Total elimination of that Q &A
- 1:43grind. So once an email is classified as, say,
- 1:47a support request, the next step is you add an
- 1:49AI agent node. Okay, the agent node. That's where
- 1:52the thinking happens. Well, the writing happens.
- 1:54It needs to generate the reply content. So you
- 1:56configure it to see the original email's subject
- 1:58and body. It just pulls that info right from
- 2:01the Gmail trigger that kicked everything off.
- 2:02Makes sense. It needs the context. But how do
- 2:06we stop it sounding like, well, like a robot?
- 2:10How do we make sure it represents the company
- 2:12properly? Ah, that's all down to the system prompt.
- 2:14This is absolutely crucial. Think of it less
- 2:17like a suggestion and more like the AI's hard
- 2:20-coded rulebook. It's job description, basically.
- 2:23You have to give it really specific rules like
- 2:25define the exact tone, be friendly, professional,
- 2:29empathetic, specify its expertise. You only know
- 2:33about the 2024 product guide, things like that.
- 2:35So you're building guardrails. What if it gets
- 2:37asked something outside that guide? It can't
- 2:40just make something up for you. Exactly. That's
- 2:43maybe the most important guardrail. You put in
- 2:44a hard rule. If you do not know the answer, stop.
- 2:47Do not guess. Just tell the user, we've passed
- 2:49this to a human. Please reach out to support
- 2:51at company .com or whatever the real email is.
- 2:54And you even specify the sign off like AI fires
- 2:57AI assistant for total brand consistency. And
- 3:00technically, how does that reply actually get
- 3:02sent? You'd pick a good conversational model.
- 3:05Something like Claude 3 .7 Sonnet is great for
- 3:08this. Then in the Gmail node itself, the key
- 3:11action is reply to a message. Why that specific
- 3:15action? Because it keeps the reply perfectly
- 3:17threaded within the original email conversation.
- 3:19It looks completely natural to the person who
- 3:22emailed you. Oh, and a pro tip. Disable the little
- 3:25N8N attribution footer in the settings. Keeps
- 3:28it looking professional. That system prompt really
- 3:31does sound like the linchpin then. How critical
- 3:33is getting that right for making the AI act like
- 3:36a reliable company representative? Oh, it's everything.
- 3:39The prompt is the AI's script. It guarantees
- 3:42the brand voice and provides those essential
- 3:44guardrails. All right, let's climb that ladder
- 3:46of sensitivity you mentioned. Finance and billing
- 3:48emails definitely don't want AI auto -replying
- 3:50there. What's the safe play? Yeah, absolutely
- 3:53not. The goal here is different. It's safe. professional
- 3:56human notification, instantly letting the right
- 3:59team, maybe finance at your company .com, know
- 4:02something needs their attention. But crucially,
- 4:04we do not want the AI generating any content
- 4:07here. So this branch actually skips the AI agent
- 4:11node entirely. Interesting. So you're deliberately
- 4:13not using the AI here, even though it's an AI
- 4:17workflow. Is it just to save a few pennies on
- 4:20API calls? That's a tiny part of it, maybe. But
- 4:23the main reason, it's risk, compliance risk,
- 4:27accuracy risk. LLMs can hallucinate, right? You
- 4:30just cannot risk the AI misreading an account
- 4:33number or a payment amount or a due date. Finance
- 4:36stuff needs humanized, period. Accuracy and safety
- 4:39first. Right. So the potential downside of an
- 4:41AI mistake, a hallucination, is just way too
- 4:44high when money's involved. Makes sense. Totally.
- 4:46So technically it's simple. You just use a standard
- 4:48Gmail send node. You're basically just forwarding
- 4:50the key info. You build a clean little report
- 4:52in the body of that email, the one going to your
- 4:55internal team. Use dynamic expressions to pull
- 4:57in, say, the sender's name, their email address,
- 5:00the original subject. Makes it super easy for
- 5:02the finance team to see what's up at a glance.
- 5:04So beyond saving a bit on API costs. The expert
- 5:08level thinking for avoiding AI generation in
- 5:10finance is really about safety and compliance.
- 5:13Absolutely. Money requires human review. Notifications
- 5:17prioritize accuracy and safety over instant generated
- 5:20replies. Okay, now for that middle ground. High
- 5:24priority emails. Things that need a fast response,
- 5:27but definitely need a human to sign off before
- 5:29it goes out. How do we blend AI speed with human
- 5:33control here? Yeah, this is a really common need.
- 5:35The strategy is straightforward. Let the AI draft
- 5:38the response, but a human reviews potentially
- 5:40tweaks it and then hit send. So another AI agent
- 5:43node. Yep. Another AI agent likely configured
- 5:46differently. Maybe you want a more formal or
- 5:48detailed tone for these high priority messages.
- 5:51The system prompt here is, again, absolutely
- 5:52key to getting that right. You know, it's funny,
- 5:54even doing this stuff regularly, I still wrestle
- 5:56with prompt drift sometimes trying to get that
- 5:59tone just right. It's amazing how one small change
- 6:01of the prompt can totally change. the AI's personality.
- 6:04Oh, tell me about it. It's incredibly sensitive.
- 6:07That prompt basically sits the AI's entire character.
- 6:11We've seen people build wild system prompts just
- 6:14for testing. I remember one called Mr. Apocalypse.
- 6:17The goal was to make the AI brutally honest,
- 6:20even rude. Slash slightly. Wow. Shows how much
- 6:24control you have. But for a serious high priority
- 6:27response, you'd use a powerful model, maybe Claude
- 6:29Sonnet again, and a prompt that demands careful
- 6:31synthesis, maybe referencing specific internal
- 6:34policies if you have RG set up, which we can
- 6:36talk about later. OK, so the AI writes this perfect
- 6:39context aware response. How does it get queued
- 6:42up for the human review? it physically appear
- 6:45right the magic technical bit in the final gmail
- 6:48node for this branch you select the action create
- 6:50a draft simple enough but here's the detail that
- 6:53tricks people up constantly you must map the
- 6:56threaded from the original email trigger into
- 6:59the draft id field of that action hold on threaded
- 7:02not message id for folks may be less familiar
- 7:04with email apis why is that specific id so important
- 7:08what happens if you accidentally use message
- 7:10id Good question. If you use MessageEyed, yeah,
- 7:12it'll probably create a draft. But often it's
- 7:15like disconnected. It just shows up as a brand
- 7:18new standalone email in your drafts folder, completely
- 7:21separate from the original conversation. But
- 7:24when you use the threaded... You're linking that
- 7:27AI -generated draft directly to the entire conversation.
- 7:30So when you open the original email, boom, the
- 7:32draft is sitting right there ready to go in context.
- 7:35You can just review it, maybe tweak a word, and
- 7:37hit send. It keeps the flow perfect. So threaded
- 7:40is the key. Why is using the threaded so critical
- 7:43versus the message -eyed? Threaded links the
- 7:45draft to the whole conversation, making it ready
- 7:47for a quick context -aware send. Okay, let's
- 7:50hit the easiest one now, the promotional emails.
- 7:53Yeah. The junk mail branch. Yeah. This sounds
- 7:56less about complex actions and more about satisfaction.
- 7:59Chuckles. Yeah, this is the simplest but maybe
- 8:02the most satisfying part. Pure inbox cleanup,
- 8:05reducing that cognitive load. Once an email gets
- 8:08classified as promotion, the action is super
- 8:10quick. Two steps. First, you maybe add a promotion
- 8:13label just for organization. Then immediately
- 8:16after, you use another Gmail node with the action
- 8:19mark a message as read. That's it. That's it.
- 8:22Just mark as read. It sounds almost too simple.
- 8:24Are there any hidden downsides? Does marking
- 8:27it read immediately cause any problems? Honestly,
- 8:30very few downsides for true promotional stuff.
- 8:33The email still gets filed away by the label
- 8:35if you used one, so you can find it later if
- 8:37you really need to. The main goal here is psychological.
- 8:41How so? It stops that email from contributing
- 8:44to the unread count. You know, that little red
- 8:46badge that causes so much anxiety. Yeah. This
- 8:49just removes that low value interruption from
- 8:51your immediate attention. You basically set it
- 8:53and forget it. It tidies things up automatically.
- 8:56So this sounds almost too simple. Are there any
- 8:58drawbacks to immediately marking promotional
- 9:01mail as read? Minimal risk, high satisfaction.
- 9:04The goal is removing low value interruptions
- 9:07from the main view. Right then. We've built out
- 9:10all four paths. The auto replies, the team notifications,
- 9:15the drafts, and the cleanup crew for promotions.
- 9:18We have this whole sophisticated workflow sitting
- 9:20there, but it's not actually doing anything yet,
- 9:23is it? Exactly right. Everything we've described
- 9:25so far only runs if you go into NAN and manually
- 9:28click execute workflow, which isn't very automated.
- 9:31No. The final absolutely essential step is you
- 9:34go to the top right corner of the NANN workflow
- 9:36editor and you find the toggle switch that says
- 9:39inactive. You have to flip that switch to active.
- 9:42Yeah, the big green switch. That's the one. That
- 9:45tells the system, OK, now you're live. Start
- 9:47checking Gmail automatically. Usually it checks
- 9:49every minute by default for new emails and run
- 9:52this process. OK, so it's active. It's checking
- 9:54every minute. How do we know it's working correctly?
- 9:56Like, how do we check if it's actually sending
- 9:58emails down the right paths? Good call. You need
- 10:01to monitor it, especially at first. Inside NEN,
- 10:04there's a tab called Executions. That's your
- 10:07command center, your audit log. Every time the
- 10:09workflow runs because a new email came in, it
- 10:11logs an execution. You can click into each one
- 10:13and visually see the path it took. Did it go
- 10:16down the support branch? Did it correctly identify
- 10:18a finance email and just send the notification?
- 10:21It's how you verify and troubleshoot. When people
- 10:24first build something like this, what's the most
- 10:25common, maybe... slightly embarrassing mistake
- 10:28they make right after building it that stops
- 10:31it from working? Honestly, forgetting to flip
- 10:33that switch. They build this amazing thing, spend
- 10:36hours on it, and then wonder why nothing's happening.
- 10:39It's just sitting there, inactive. So what is
- 10:41the most common, simple mistake people make right
- 10:44after building the workflow? Forgetting to switch
- 10:46the workflow toggle from inactive to active,
- 10:49it's a manual setup detail. Okay, so once you
- 10:51have that basic system humming along nicely,
- 10:54filtering emails, sending replies, creating drafts,
- 10:57then you can start thinking bigger. How do we
- 10:59upgrade this from just an assistant to more like
- 11:02a chief of staff for your inbox? Scaling up.
- 11:06I like the sound of that. Where do we start?
- 11:08What are the big enhancements? Okay, three key
- 11:11things come to mind. First, build a proper logging
- 11:14system. Think of it like the black box recorder
- 11:17for your workflow. How does that work? At the
- 11:19end of every single one of those action branches
- 11:21we just discussed, the reply, the notification,
- 11:24the draft, the cleanup, you add one final node,
- 11:27maybe a Google Sheets node or a database node
- 11:29if you prefer. And in that node, you log key
- 11:32details, the timestamp. which category the email
- 11:36fell into, maybe the sender. And if an AI response
- 11:39was generated, log the actual response text.
- 11:42This creates a permanent record and audit trail.
- 11:45You can see exactly what the AI is doing over
- 11:47time. Invaluable for improvement. That sounds
- 11:49powerful for tracking. What's next? Yeah. How
- 11:52do we make the AI itself smarter? Right. Connect
- 11:54knowledge bases. This is where you implement
- 11:56RA. That's retrieval augmented generation. RA.
- 11:59We hear that term a lot. Break it down simply.
- 12:01What does RA let the AI do? Basically, RIG lets
- 12:05your AI look things up in your own documents
- 12:07before it answers. Instead of just relying on
- 12:09its general knowledge from its training data,
- 12:11it can consult your specific internal help docs,
- 12:14product manuals, policy guides, whatever you
- 12:17give it. Ah. So it stops guessing about company
- 12:20-specific stuff. Precisely. It uses a vector
- 12:22store that's a special database, like Supabase
- 12:24or Pinecone, to hold your documents in a way
- 12:26the AI can quickly search. It finds the relevant
- 12:29passages from your info and uses that to construct
- 12:31the answer. Massive quality improvement. Okay.
- 12:35Logging for monitoring, RAG for accuracy. What's
- 12:38the third? A -B testing models. Don't just pick
- 12:41one AI model and stick with it forever. Models
- 12:44evolve, prices change. Set up a simple splinter
- 12:47node early in the workflow. Send, say, 50 % of
- 12:50incoming emails to a cheaper, faster model, maybe
- 12:53like GPT 4 .1 Mini. Send the other 50 % to a
- 12:57more powerful, maybe slightly more expensive
- 12:58model, like Claude 3 .7 Sonnet. Then... use that
- 13:02logging system we just talked about log which
- 13:05model handled which email and maybe even track
- 13:07the quality or if a draft needed editing over
- 13:11time you get real data on which model gives you
- 13:14the best bang for your buck for different types
- 13:16of emails whoa hang on if you combine that logging
- 13:19with the a b testing You could scale that across
- 13:22a whole company. Use the logs to scientifically
- 13:24figure out the absolute best, most cost -effective
- 13:27model for every single different email task.
- 13:30That's genuinely data -driven efficiency right
- 13:33there. Exactly. Optimizing cost and quality based
- 13:36on real results. How quickly does connecting
- 13:38a knowledge base with our ag actually change
- 13:41the quality? Is it noticeable right away? Immediately.
- 13:44The agent shifts from potentially guessing to
- 13:46actually looking up facts from your own internal
- 13:49docs. It's night and day for accuracy on specific
- 13:51topics. OK, but it's tech. Things will go wrong
- 13:54sometimes. Yeah. What are the usual problems
- 13:56people run into and how do they fix them quickly?
- 13:58Yeah, inevitably there's some turbulence. We
- 14:00usually see kind of a big four. First is misclassification
- 14:03emails going down the wrong path. The fix there
- 14:06is usually refining those category descriptions
- 14:08in your initial classifier. Add more specific
- 14:11keywords, maybe better examples. Okay, what else?
- 14:13Generic responses. If the AI's replies sound
- 14:17bland or unhelpful, that points straight back
- 14:20to the system prompt for that AI agent. You need
- 14:23to inject more detail, more personality, more
- 14:25specific company context. Make the prompt richer.
- 14:29We talked about drafts earlier. What if the drafts
- 14:32aren't linking properly to the original email
- 14:34thread? 99 % of the time, that's the threaded
- 14:38issue again. Go back to that create draft action
- 14:41in the Gmail node. Double, triple check that
- 14:43you've correctly mapped the threaded from the
- 14:45trigger into the draft ID field, not the message
- 14:48ID. That's almost always the culprit. Got it.
- 14:50Threaded. And the fourth common issue. Credentials
- 14:53errors or the workflow just stopping. This could
- 14:56be simple, like needing to reauthenticate your
- 14:58Google connection in N8NN. Or it could be you've
- 15:01run out of API credits with your AI provider,
- 15:04like OpenRouter or OpenAI. Always check your
- 15:07billing dashboard if things just stop working.
- 15:09So if a user's workflow just dies unexpectedly,
- 15:12what's the very first thing they should check
- 15:14before diving into complex debugging? Honestly,
- 15:17confirm that active toggle switch is still green.
- 15:20It sounds silly, but sometimes things can get
- 15:23accidentally deactivated. It's the simplest possible
- 15:26fix for what looks like a dead workflow. This
- 15:28all sounds incredibly powerful. A 2047 AI assistant
- 15:33managing email must cost a fortune, right? Let's
- 15:37talk ROI. What's the actual cost here? You'd
- 15:39be surprised. It's actually very accessible.
- 15:41Let's break it down. You've got your base platform
- 15:43cost, so the NAN cloud plan you'd likely need
- 15:46is around, say, $25 a month. That's fixed. Okay.
- 15:49Then you have the variable cost. the AI API calls.
- 15:53This is pay as you go. But the key is, remember
- 15:55how we use cheaper, faster models like GPT 4
- 15:58.1 mini for that initial high volume classification
- 16:00step? Right. Most emails just get sorted. Exactly.
- 16:03That keeps the cost way down. So even if you're
- 16:06processing, let's say, 100 emails every single
- 16:08day. Yeah. Give me a real world number for that
- 16:10kind of volume. With this kind of optimized setup,
- 16:13you're probably looking at only about... 50 cents
- 16:15to maybe a dollar per day in total API fees.
- 16:18Seriously, that low? Yeah. So add that up for
- 16:21a month, maybe $15 to $30 max for the AI usage.
- 16:24Your total all -in cost per month for this whole
- 16:27system, realistically, somewhere around $40 to
- 16:30$55. Okay, hold on. $55 a month sounds amazing,
- 16:33almost too good to be true, but that's just the
- 16:36software and API cost. What about the human time?
- 16:39Isn't there a hidden cost in setting this up,
- 16:42tweaking the prompts? fixing things when they
- 16:45break that's a really fair point yes there's
- 16:47an initial time investment you got to build it
- 16:49right maybe budget i don't know three to five
- 16:51hours for the initial setup and the first week
- 16:52of watching it tuning it okay but once it's stable
- 16:55it really does mostly run itself maybe occasional
- 16:57tweaks so you weigh that initial time cost and
- 17:00the 55 a month against the time it saves you
- 17:02if this thing genuinely handles tasks that used
- 17:05to take you five maybe 10, even more hours every
- 17:09single week. Yeah. That $55 looks pretty insignificant
- 17:12pretty quickly. The ROI is usually exceptional,
- 17:15often within the first month or two. And that
- 17:17minimal running cost, is that mostly because
- 17:19we're being smart about using cheaper AI for
- 17:22the bulk classification work? Yes, absolutely.
- 17:25Optimizing model choice by task is the key. It
- 17:28keeps those API costs extremely low while still
- 17:31using powerful models where you really need quality.
- 17:34Wow. OK, so we've really seen this technical
- 17:37guy transform, haven't we? It's gone from just
- 17:39sorting emails into a genuinely operational system,
- 17:42one that sends replies, preps drafts for you,
- 17:46alerts the right people and just cleans up the
- 17:48clutter. Yeah, it's about building structure.
- 17:50This AI assistant, when set up right, it delivers
- 17:53organization, sure, but also like genuine peace
- 17:56of mind. And yeah, critically, it really does
- 17:58give you back those five or 10 hours every week,
- 18:00the gap between email chaos and having this like.
- 18:03personal 247 chief of staff. It's just a bit
- 18:06of setup time and that's surprisingly small monthly
- 18:08cost. So for everyone listening, maybe take a
- 18:10minute after this to think about your own email
- 18:12habits. Where are those repetitive tasks? Where
- 18:14does all the time go? Start thinking about which
- 18:15action branches you'd build first. And that brings
- 18:18us to our final thought. A bit provocative, maybe.
- 18:21If you actually manage to delegate 10 hours of
- 18:23email work every single week using a system like
- 18:26this, what's the one big, important, high -value
- 18:29project you'd finally have the bandwidth, the
- 18:31focus, the time to really dedicate yourself to?
- 18:33What becomes possible then? At UTR, we'll music.