I Built an AI Agent Email Manager with No Code in n8n (100% Automated)
847 views4871 WordsCopy TextShare
Nate Herk | AI Automation
JOIN THE FREE SKOOL COMMUNITY👇
https://www.skool.com/ai-automation-society-3440/about
In this vide...
Video Transcript:
so what you're looking at right here is an inbox management agent I was able to build this thing in about 25 to 30 minutes using absolutely no code so by the end of this video you guys should all understand what's taking place in this workflow and how you can get one of these things up and running within your own email to completely manage your inbox and almost completely remove yourself out of the process of emails this agent is going to save me a ton of time as you get an email it comes in here it goes through this classifier and it gets labeled into one of four groups of email and then there's a certain action that takes place based on what type of email it is so for example example with high priority emails it just creates a draft for you in your Gmail but it doesn't actually send it because it's high priority so you probably want some manual touch Point involved but then it's also going to send you a telegram notification on your phone that you got a high priority alert so um that's just sort of how this is going to work and one thing I wanted to point out is that this section of the workflow this is just where we sort of label an email based on the content of the email but this section I have a video about right here where I sort of go step by step of how to actually build this part and then over here is what we added today which I'll be expanding on which is based on the label we're going to do a specific type of action and it's also going to telegram us what happened and why it happened so we're going to break down each node each path so that everyone can understand what exactly is taking place here and we'll do a demo for each one too so let's just get started here with high priority as the first example real quick I don't want to take too much time away from this video but just wanted to announce that our school Community is finally open so you can find the link to that down in the description it's 100% free to join um hopefully we can get a lot of people in here a lot of people to bounce ideas off of and get our questions answered with one another because we all are sort of interested in the same space you know sometimes you guys ask for you know the workflows for me to share them with you or code Snippets that I use in the video so all those resources can sort of be attached to certain videos under there so everything will be in one clean space so please hop in there I'd love to chat with you guys and you know I I'll see you in there but back to the video all right so here is the high priority email we're about to fire off it says hi Nate we need your immediate approval on the final proposal for the Johnson project the deadlines 5: p. m. today and the client is expecting us to proceed please review and confirm as soon as possible thanks Dwight so what we're going to do is we're going to fire this email off now back in N end we're going to hit test workflow we're going to bring in the telegram we can see that it got classified as a high priority email created a draft create the draft in Gmail and then it let us know high priority email from Nate herkelman we have created a draft with the subject approval needed for Johnson project proposal so if we hop into Gmail we can see the email that we got if we refresh this real quick we should see that it got labeled as high priority and then within our drafts we'll see the draft that was created which says hi Dwight I received the final proposal for the Johnson project and I approve it to proceed everything looks in order let's move forward as planned so it's nice that it makes this draft for you it won't actually send this off because you know something high priority you want to make sure that you're involved make sure that you're getting the right information fed back to whoever the email is from but that's nice because it gives you a nice starting point or sometimes you can just send it off right away okay so let's break down this branch of the work flow first thing I want to point out is that it says high priority email from Nate herkelman and you might be confused as to why it's not coming from Dwight and that's because back here you know the email was signed off from Dwight but it's actually coming from one of my other emails which is Nate herkelman and that would be an easy fix we could go in here and have an open AI node figure out who actually signed off the email and that's who it would say in the telegram message but for the purpose of this video I wanted to pretty much pull from the email account that is being sent so just wanted to clear that up all right now back in Ed end let's figure out what's going on here so the email comes in and we can see over here this is the content of the email so we have this thing that I just sent off here then it goes into the text classifier and we gave it parameters on how to distinguish what type of email is what so as you can see high priority right here we said emails requiring immediate detention or action typically from Key stakeholders clients or decision makers these emails often contain time sensitive requests deadlines or escalated issues and then we gave it some keywords that you may find in a high priority email so all it did here was then it spit it out and labeled it as a high priority email so that means that it's going to follow this Branch we in here all this node is doing is giving it the label of high priority back in Gmail as you can see and so once that takes place now it knows to go down this path so the first thing we have here is to create a draft so in here obviously we connect our account I gave it the model 40 and then here is the prompt I gave it so I said you're an executive assistant your job is to respond to incoming high priority inquiries as accurately as you can here is the email you're responding to so I went over here to the Gmail trigger where we're actually getting the original email and we just want to find text which is right here this contains the content of the email so I drag that in here and it's green and this just means that it's a JavaScript variable and as you can see it comes in with the actual email right here hi Nate we need your immediate approval on the final proposal for the Johnson project deadline is 5: p.
m. today you get the point with the variables and then I said please output the following parameters which were subject and message so it gave us a subject and a message and then another important thing to point out is you need to check output output content as Json if you don't do that then it's going to lump all of this information into one field which is fine you could later parse that out but it's so much easier to just output it as Json right away so that we can drag in these fields later subject and message into the Gmail node to create that draft for us all right so we made the draft in open AI now we're going to open up a Gmail node that is to create a draft so we've got the resource draft and now all we need to do is drag in pretty much the subject and the message which we just got from open AI so right here this is why we output it as Json so they're two separate things we drag in subject and then we drag in message that's all I did and then once you test that that draft will be created in um your Gmail but then we want to alert the user that that happened so we come into here which is a telegram node we just want to send a text message we had to grab a chat idid which um if you don't know how to do that pretty much you want to grab your Telegram and you want to do a chat trigger and you'll just send your Bot a trigger or sorry you'll send your Bot a message and then your trigger will come through with data and one of those parameters from your telegram trigger will be a chat ID so you're just going to grab that chat ID and throw it in here then down here in this text box this is going to be what's actually being sent back to the user in telegram so we put NC caps high priority email from and this is where I said we grabbed who the actual email was from based on the email address not based on who signed it off so right here um I went into the Gmail trigger once again because this is where the original email came from and we close down headers we go all the way near the bottom we'll see from and then down here we have an email address and the actual name of the person who sent it so you could sort of configure this how you want I just wanted to drag in the name of the person that sent it so as you can see in the result it says high priority email from Nate herkelman then I gave it we have created a draft with the subject and then just throw in the subject that way if you're getting multiple high priority emails throughout the day you can see exactly which ones were sent or which drafts were created from um this agent based on each subject and at what time that sort of thing so that was it for this high priority Branch now we're going to do an example for the customer support Branch where open AI creates an email and it actually just automatically takes care of it for us and then lets us know that it did that for us all right this is the email we're going to use for the customer support Branch it says hello I'm unable to log into my account on your dashboard I've tried resetting the password but it's still still isn't working can you help resolve this issue thanks Pam so we'll send that off okay back in NN we're going to test workflow and then I'm going to pull up telegram so we can see everything happen live but we'll hit test workflow Here Comes telegram we'll see that it's getting labeled came through as customer support an email is being created it's sent off back in Gmail and then we just got a confirmation confirmation message that says we have just responded to a customer support inquiry from Nate herkelman so let's take a look at what's going on within each node in this Branch so at this point everyone should understand how it's being triggered how it's being classified and then we got it as customer support so now we're going to go into this open AI node where we're actually creating the email first thing we want to do is obviously set up credentials we're doing text message a model gbt 40 and now let's get into this prompt so here I said you're a customer service representative your job is to respond to incoming customer support inqueries as accurately as you can and if it is an inquiry you cannot handle please refer to the user please refer the user to the following email customer support at abcc corp.