n8n Masterclass: Build AI Agents & Automate Workflows (Beginner to Pro)

1.2k views20949 WordsCopy TextShare
Nate Herk | AI Automation
JOIN THE FREE SKOOL COMMUNITY👇 https://www.skool.com/ai-automation-society-3440/about Welcome to t...
Video Transcript:
all right today we've got a very exciting one this is the nadn master class where ideally I'm taking you from a beginner in nadn all the way to an AI agent Builder by the end of this or even just someone who wants to implement AI automations into their daily life or into their work so I was about to say grab a pen and a piece of paper but more realistically since you're here grab some sort of AI notetaker and let's dive into this one this is a master class so we're going to start at the
bottom start with the basics and we'll continuously work our way up but just want to start off here with what is any so at this point I'm sure you guys have been hearing the term low code no code tools and nadn is a low code no code automation tool so that just basically means that nadn allows users to automate processes build workflows with minimal coding knowledge and the key idea behind this is that low code means it's very easy to develop things with a very userfriendly interface where people can just go in there and drag
and drop different components different nodes is what they're called in nadn to create these flows without having to come in here and type a bunch of JavaScript or python this is so significant because it's going to allow anyone to be able to get an in and get up and running with building automations even if you don't have you know a background in computer science or programming the barrier entry to this is so low it's very very accessible for anyone to get in here and start playing around with stuff but even though it's very simple it
also retains a lot of flexibility for more advanced users who do have coding background and they're able to come in here and take some of the basic principles and also come come on top of that with you know custom code or different type of logic and Integrations and it's a very very powerful tool you can build tools directly in NAD as you see here and that's a little bit different from other things like make or zappier because you can build let's say an agent that's able to call four or five tools and these tools you
built within NN itself which is just super super cool stuff what about the importance of automating workf flows so we've got five points here I'll touch on real quick increasing efficiency and productivity automation is going to eliminate repetitive tasks it's going to reduce human error and it's going to allow you and your team to focus on higher value work it's also going to save time and money of course automating workflows is going to reduce operational risk free up Time by completing tasks faster than manual scalability and adaptability you can scale a lot more effortlessly you
can focus on your growth as a business and these Solutions these automation Solutions can be customized or adjusted to meet your changing needs you've also got improved data handling automation is going to integrate data from various sources it's going to provide real-time insights for better decision making and then the last benefit I wanted to hit on here was enhanced customer experience you're going to be able to respond faster to your clients or automatically to your clients personalize interactions through automated workflows and all of this is just going to lead to better customer satisfaction and Customer
Loyalty moving on here we've got why should you learn nadn so when I was building the slide I had so many thoughts and I tried to put them all under three main bullets and so this first first one here is nadn empowers non-developers with Automation and I know we've touched on this a little bit with the whole low code no code stuff but it's just so powerful that anyone can pretty much come into NN and start building things in 15 20 minutes that's actually going to automate real work that they would do on a daily
basis so even if you're not a programmer you can come in here create workflows it's going to save you time make your life easier for example you could very easily get up a workflow that is going to automatically move data from one app to another like ually copying contacts from one spreadsheet to another without having to do it every time it's like having a digital assistant that can handle these repetitive tasks for you and you don't really need the technical skills to set it up so super cool stuff the second one we've got access to
over 300 built-in Integrations which is insane andn comes with a ton of Integrations ton of connections to popular tools that you probably use every day like Gmail um Google Sheets slack Twitter we got Microsoft stuff too if you want to connect to teams or Outlook it's super super cool what you can do these Integrations let you connect quickly to these tools and you can connect tools to other tools without needing to like code in between that for example you could set up a workflow where every time you receive an email it's going to automatically add
that information to some sort of spreadsheet and then it's going to send you a notification on slack or teams and all of that will take place without you needing to be in there and doing it manually then this last one you can connect to almost any tool so kind of similar to the second point but if there's something that you want want to connect to that there's not a built-in integration to you can still pretty much connect to it whether that's through an API or a web hook um these ones are a little more technical
but for the most part um you know a quick YouTube video or using chat gbt even you'll be able to get them up and running and connect to almost anything you want a little bit of custom code and um really when you realize you can connect to almost anything then you have almost endless possibilities of what you want to automate all right we're going to be moving into part one of this master class here which is just very simple getting started with NN we're going to talk about how you set it up the different ways
you can set it up and then we'll just get into the interface and start actually learning what it looks like and what everything does the first thing I think that we should talk about when it comes to setting up your NN is if you want to set it up self-hosted or if you want to Cloud host and I'm going to run through a few features of each of these two different options and then we'll talk about which one you should choose so first with self-hosted some of the things that it's going to offer you are
control and flexibility you're going to have full control over your environment you can customize your server integrate with any internal system you have the ability to adjust your configurations as needed we've got data ownership so all the data and workflows are going to stay on your private server so this is ideal if you need to comply with privacy regulations or you want to keep sensitive data in-house cost self-hosting can be more cost effective in the long run it depends on the server and maintenance costs but there's no ongoing subscription fee to naden like if you
were to do Cloud hosted but with the cost as aspect you may need to account for infrastructure with like database management or server hosting and you also may need to have some sort of team that will help you maintain it but who knows fourth with self-hosting is installation and maintenance you are going to be responsible for setting up and managing and updating your instance this also includes backups and scaling so this is going to require more technical knowledge then finally we've got customization so you can modify the source code you can add custom features that
might not be available in the cloud environment so this is cool if you want complete freedom to modify the system as you want and now moving on to the cloud environment here are some features of cloud it's going to be easier to use because it's managed by nadn itself so there's no need to worry about setup updates scaling maintenance stuff like that so good for beginners you've also got availability and reliability so the NN cloud is hosted on a scalable and reliable infrastructure it's going to be maintained by Ann's team so they're always going to
keep stuff up to date with the latest features and Bug fixes the security is a little different it's going to be managed security so SSL certificates or you know secure API handling and that's going to be done by the N team and then also this is going to be more suitable for users who don't want to handle server security now when it comes to cost of nadn it's really not that bad either way the cloud version comes with a subscription model that's going to be based on usage tiers how many products you want how many
seats you want on your you know an inn environment and so you'll be basically paying based on that so in the long run it could be more expensive if you have a ton of users and a ton of projects going on but if that's the case then hopefully you're either saving a ton of money or you're making a ton of money so balance is out then finally we have data handling different than self-hosted data is going to be stored and processed in the cloud so like I said if you're a business dealing with highly sensitive
data this may be a limitation due to the server dependencies okay so at this point you may already have an idea of which one you're going to choose but if you don't real quick you should go with self-hosted if you need full control over your data and your infrastructure if you want to integrate any in deeply with other on premise systems and if you're technically comfortable handling server maintenance and management or you have a dedicated team that will do that for you and then you're going to want to go with Cloud if you prefer Simplicity
and you don't want to handle infrastructure or server maintenance you want a quick setup and reliable hosting it's going to be managed by the NN team and you're okay with paying for a subscription for a managed service and you don't mind being handled by a third party provider okay so before we actually hop into NN and we look around at the interface probably important to understand the difference between workflows nodes and executions so I'm going to break this down as simple as I can pretend you're in a restaurant we've got workflows which are going to
be the recipes nodes are going to be the ingredients the steps within each recipe and then executions are going to be every time someone sits down and orders that specific recipe or workflow so the workflow think of it as like a set of instructions that you're going to be giving to nadn in order to automate a task so for this example we'll say that the workflow is a a chocolate cake then we'll move down to nodes nodes are like the building blocks of the workflow each node is going to represent a single step a single
action within a workflow so one node might send an email one might update a spreadsheet one might pull data and then you can kind of Link those together in order to make the chocolate cake so you know eggs flour baking soda we're going to put those together then we have the execution which is simply just running your workflow in nadn this can happen by different triggers whether you want to do that manually or whether you want the automation to take place every time you update a row in a spreadsheet but in the example like I
said just picture someone coming to the restaurant and ordering a piece of chocolate cake and then you kind of start that process of making the cake and delivering the cake all right now that we've covered the three main building blocks that go into pretty much every automation let's actually get into nadn look around a little bit at the user interface see what I'm talking about when I say drag and drop we'll talk about accessing Community Resources Community templates stuff like that and it'll really start to make more sense all right so we're in nadn as
you can see as what we're looking at right now is we're just on my homepage so it's going to show me a ton of the different workflows that I've been working on um we've got our projects right here so I only have the one right now it's called Nate testing so in here it's pretty much just everything I have but if you had a specific project for a specific client or a specific project for an actual specific project at work you could add them here so you can keep everything organized honestly my stuff is not
too organized but here's what it looks like we've got stuff on the Le hand side we can see we have an admin panel we have templates we have variables we can see executions of each workflow we've got some help and then you have your profile down here as long as well as you know I'm Cloud hosted so I can see that there's some updates here with some bug fixes that I'll I'm going to be able to just go in and install real quick let's just add a new workflow right here and see what the interface
sort of looks like so this is the canvas that I was talking about where I said it was a very userfriendly drag and drop interface the first thing you're going to see is that you have and add First Step button so we'll get into different types of nodes after this and we'll talk about triggers and all that but first step is always going to be a trigger so you'll click on that and it will list up you know some triggers trigger manually just means that you'll be hitting test workflow button down here in order to
run the workflow execute the workflow every single time you can schedule it you can do um on chat message you can call it by another workflow so that's where all the stuff is super powerful we'll just add a manual one so you guys can see what it looks like this is where you hit test workflow in order to run it and you know obviously nothing's coming through but it didn't fail so that's good then from here you would want to add different nodes to connect to so you could do that from either clicking on this
plus button where it says click to add node or drag to connect or up in the top right you can click up here and it will pull up this panel for you to search through nodes you know by category or you can just search for them if you want um another cool thing with the triggers is there's not just those triggers there's different triggers for each app so let's say that you wanted to run a workflow every time you got an email you can click on on Gmail down at the bottom you'd see different triggers
and this one says on message received so this would execute the workflow every time you get an email and you can tell a trigger if it has this little lightning bolt so that's a trigger node but anyways let's just say that we wanted to put some fake data in here so I would just come in here and I could either type for the the node that I want or I know I'm looking for an edit Fields node so I can come to data transformation and I would see edit Fields right here this is where I
could configure stuff so let me just quickly pretend um we're going to make make a field called name and we'll just put in my name and what's really cool about NN is that you can test each step individually as you're going through and automating something so rather than having to run the whole workflow you could just test step right here we'll see that what's coming out of this node is Nate um in the field called name so we have that information running through but it's nice to know because you'll always see on the left of
this configuration panel you'll see data that's coming in and then you'll see data that's coming out so it makes it really easy to troubleshoot and test each step individually which is really cool but you have to make sure that your your um nodes are connected because let's say you know I didn't drag this one right here and connect it to the edit Fields if I was to run this nothing would come through the edit Fields there's no output as you can see it says wire me up this node can only receive input data if you
connect it to another node and yeah so that's how that's going to work I say this is probably all we'll do for now in here we'll get into some Community templates and just show you how that all works but as far as just basic setting up a workflow and seeing what um the interface looks like how easy it is to just drag and drop stuff that's what we've got so back in the homepage we've got workflows you all can also look at your credentials so this is just different things that you've connected to like I
said there's so many Integrations so it can easily access my Google Drive my telegram my Google Sheets all that kind of stuff so that's where you can sort of see and manage your credentials and then down here the only thing I'll touch on real quick will be the templates you can click into templates and it will pull up nad's website where there's sort of like this community where people can upload cool things they're building or you can search for specific use cases specific um you know tools that you want to use so it's a really
great place to get in here and learn but as you can see we have you know learn by doing so you can download these templates which is really cool sometimes it's you know it's nice to watch a tutorial on YouTube but being able to really learn you have to just get in there and you have to let things fail in order to figure out why they're failing so right here we have you know AI agent chat we can download from NN we can click here we can look at it um and we can see what's
going on we could click this button here to download it and um start playing around with it in our own nadn we have this one where you can click in here and a lot of times people will annotate like what's going on so you can see how to set it up you can see which you know what's taking place in each scenario so that's super super useful and then I'll just show you real quick let say you wanted to use this one we could just import the template to my cloud environment and as that loads
up it's pretty much just going to put it right into my workspace so I've got this information here I can now test this data I can look at what's going through each step we can see right here we've got um you know this information's coming through and then it comes out as you know flour eggs milk which is interesting because I just did a you know a little example about cake so um seems like it's meant to be but either way you can start to see actual data moving through which is how you're really going
to be able to wrap your head around what's going on another great thing about nnn is there's so much documentation it's super easy to get help so if you come down here you can see help we've got a lot of stuff here they even have a course that you can go through through but documentation if you click on here you can see pretty much anything you need to find like there there's quick starts there is um Concepts about flow logic Concepts about data so like I said super easy to learn about all this kind of
stuff you can look at you know what each node is doing specifically so let's say you were confused about the loop node you could come in here read about looping you could see you know how the node works you could maybe see some examples of how people are using it and yeah like at the bottom it's probably going to throw you in some you know templates of actual workflows with loops but super easy to get help Within naden part two of the master class we're going to be talking about some Core Concepts so we just
saw what the interface looked like we saw a few nodes but now we actually need to dive into different types of nodes and what they do and then we're going to end this section of the master class with an actual example where we'll get into nadn I'll do a live build of a really quick Automation and then we'll talk about the different type of nodes and how data is moving through so it should be pretty cool to see so before we in nadn and we build out our first automation we really need to understand these
sort of four main types of nodes so we've got Trigger action data transformation and logic so let's just break these down real quick starting off here with trigger nodes because a trigger node is pretty much going to be what starts every workflow we just saw these in nadn they were the ones with the little lightning bolt next to them anyways different types of trigger nodes we can look at something like a web hook trigger um an email trigger like I showed you anything that's going to start the the workflow whether that's going to be manual
or on a chat or on an event or I have called by another workflow bolded here because it's sort of the power of NN you can build a workflow that will be called by another workflow and then you can build an agent that can call that workflow as well as maybe this agent can call like 10 other workflows so super powerful stuff here next we've got action nodes these are the actual doers they're going to perform a very specific task within your workflow so it's like an assembly line this guy is going to to um
you know put the present in the Box this guy's going to wrap the present this guy's going to put the bow on the present all that sort of stuff but they can do different things like you know send email create a record make an API request they can get a text message they can set your calendar um almost anything that you could do on your computer on your phone manually you could have some sort of action node to do this thing third we have data transformation nodes these are going to help you change or process
your data in some way so that it flows through the whole process and you get the end result as you want want it so these type of nodes can do things like set that can add Fields change values within Fields it can do some sort of processing your data you've got something like an aggregate where you can combine a ton of data into a single output or something like a merge where you can combine data from two different sources and put them into one the last type I'm going to touch on real quick are logic
nodes these are sort of the decision makers they're going to help n and figure out what path to take how to handle a different situation so we've got something like an if node it's going to check if a specific condition is true or false is you know this value higher than 10 it's going to go this way otherwise it's going to go this way we've got a switch node which is going to allow you to put multiple conditions in there and it's going to be checked and direct the workflow to a specific action based on
that conditional check and then something like a weit node which is going to pause the workflow let's say you wanted to pause the workflow until you come back and respond like yes that's good to go then it will continue to move on through the rest of the process or you could have it like wait for 20 seconds um what whatever you want it to do all right now it's time to finally hop back into NAD in hopefully these slides weren't too boring but we're going to be building an example workflow here it's going to be
really simple it's just going to automatically process customer orders and then it's going to summarize it and send us a report automatically every time we get a new order so super cool stuff let's hop into how we're going to build this thing all right we are in a Google sheet this is going to be the customer order data that we'll be using for this example so I had chat gbt make up some data for us we've got stuff like order ID customer name product quantity price order date and the status of that order so every
time a new row is put into this Google sheet it's going to run through nadn automatically it's going to get summarized by some sort of large language model like chat gbt or Claude and then that summarization is going to be emailed off back to us or back to our team automatically so this will be a nice simple example but it's going to feature different types of nodes and we'll be able to see the data move through real time so it'll give us a really good base we are now in n8n this is the canvas we'll
be working on and this is the workflow that we'll be building here um NN masterclass customer orders so we know the first step that we always need to do is add some sort of trigger we'll click in here and we can see different triggers like manual um on app event called by another workflow we talked about this but in this case we want to make this one automatic so we're going to be doing a Google Sheets trigger Google Sheets has three triggers it's got on row added on row updated or on row added or updated
so we'll do this one because that way if you have to go in there and change some sort of information about an order like let's say one goes from you know the status is pending to shipped or something we'll also get an email about that so we have to set up the Google Sheets account um this is where you're going to have to set up a credential and I'll walk you guys through how to do this so you're going to click create new credential and you'll see this screen pop up where we need to grab
a client ID and a client secret um this looks a little confusing and I was definitely confused when I first saw the screen so what we need to do is right here um I talked about how nadn has is really good at having documentation that explains stuff so we'll click on open docs right here we will see that the prerequisite we need is a Google Cloud account so we'll go in here and make a Google Cloud account um and then we can see that it's going to walk you through step by step so if my
explanation isn't good enough you can come in here and grab the docs but hopefully I'll show you real quick how to do this so we'll come into Google Cloud um this is what it's going to look like you'll have to sign in make an account then you want to go to your console once you're in your console you'll see the screen you might not know what to look at but all we want to do is we're going to create a project so mine right here is just called my first project make sure you're in your
project and then you want to come in this left hand side to apis and services we're going to click on enabled apis and services and at this point you just need to search for a Google Sheets so we're going to type in Google um okay we need to do sheets be more specific so Google Sheets we can see Google Sheets API we'll click in here and then all you need to do is just enable this API so we've got ours enabled already um there will be a button right here it's just as simple as that
so get that enabled and then you're going to come in here go back to your apis and services and then we want to go to credentials once we're in credentials um this is where you can set up your client IDs to get an ID and a secret so I'll just walk you guys through how we're going to do this one you're going to click create credentials up here you'll go to ooth client ID once that loads up you want to choose the application type this is going to be a web app you can name it
whatever you want we'll call this one demo for for the sake of this video and then all you need to do here is add a redirect URI so this is where you see in nadn you've got this UD redirect URL um we're just going to click here to copy go back into Google cloud and we're going to add this right in here just just paste it in and then you'll hit create you'll get the screen pop up with um your client ID and your client secret so it's as simple as copying the ID pasting that
into the ID field in NN going back to Cloud grabbing your secret and pasting it into the secret then you want to sign in with Google so this screen's going to pop up it's just going to be a simple prompt to sign in with Google like you would normally have um so I'll drag this in right here and now it says that Google hasn't verified this app so this is where you need to set up your ooth consent screen um so back in here you've got your ID and your secret now you need to go
back in your credentials right here ooth consent screen all you need to do here is either make sure that your app is published so um you need to make make sure the app is published so that it has you know access to actually go through and grab information out of your Google Sheets your drive your email whatever it is or you can add yourself as a test user so I've got my emails down here as test users this also will allow these emails to sign in and go through but if you're getting blocked for some
reason it's probably because you didn't set this up right so just make sure it's published or that you're in there as a test user so back into nadn um we've got this signin field we'll hit continue just make sure you give this email access to everything give NAD access and then you'll hit continue and then pretty much you'll be good to go you'll see we got this account created right here it's green we're good so we will come out and now we're connected so now that we're connected we can configure the rest of this node
it's going to be running every minute and that's when it's going to be checking for if a row was added or updated now we can select the document that we want so it's really nice you can choose from a list you can enter the URL or the ID of your document but list is so much easier it's just going to access your Google Drive and see what sheets you've got so we're going to do customer orders um there's only one sheet in this document so we'll grab that sheet and it's going to trigger on row
added or updated so if we can fetch a test event here we'll see some of our sample data coming through so as you can see we've got um five items we've got the columns up here and then we have all of these orders that we just had right here in Google Sheets so we've got John Jane Mike Emily Robert Brown and in here you can see we've got John Jane Mike Emily and Robert Brown so this node's working we've got our information coming through into NN now we want to add an open AI node so
we'll just click on this plus right here or click on the plus up in this top right corner and you can search for a new node we're going to grab open AI you could use a different large language model if you wanted to but I'm going to be using open AI you can see we've got 15 different actions within this node what we want to do here is message a model basically just means that we're going to be talking to chat GPT just call this no summarize and now we need to hook up this node
with our credentials so at this point if you don't have an open AI account you need to do so and then once you do that you can come in here click create new credential this time all we need is a single API key so once you have your open AI account you'll come into it on left hand side you'll see all the stuff but we just want to go to API Keys up in the top right you can click create new key give it a name and then it will give you a value to copy
so pretty simple same thing you just want to come in here and copy that information in or sorry past that information in hit save and it will go green once you're all good um so that is all you got to do but pretty much every time that you need to configure a node you're going to have to grab some sort of key so just keep that in mind so as you can see the resource is text the operation is messaging a model and now we need to choose what model we want to message so I'm
going to come in here and grab GPT 40 right there and now we need to configure the rest of this node so this is the message that we're sending to GPT 40 you have a couple options here you can have it be a user message an assistant message or system message you can see the differen is right here usually when you're going to be prompting the node how to act we're going to choose system so in here I'm going to type a quick prompt and I'll be right back to explain it all right here is
the system prompt that I came up with just typed this out really quick so I said you are in charge of client orders your job is to take incoming information regarding new orders and give a nice summary that will be emailed to the team the email should be signed off from customer success team and then we want to give it the information from the previous Google Sheets trigger that's coming in here on the left we need to actually give it the information to summarize so it's going to be getting order ID customer name product quantity
price order date and status and so all we need to do is come in here and drag and drop each of the fields into the prompt and it will be a variable so it will change for each one so I'll just show you guys order ID we drag this in and I don't know why it does that um we want to make sure that right here with order ID so first of all first thing to note this is a green variable with the two curly brackets around it that just means that it's a JavaScript variable
so this doesn't involve any coding it's as simple as dragging and dropping but this just means that it's going to change based on whatever value is in this field so as you can see in the result tab right here we've got the the json. order ID is coming through as 101 because that's the first order and you can see similar things when we drag in customer name we'll get in the the results we got John Doe um we'll drag in everything else and then I'll show you guys so we're just going to drag in product
quantity price order date and Status so that's assigned wherever it needs to be and then as you can see in the result we've got here's the information on client orders we've got the correct order ID name price quantity all this kind of stuff we have the actual information coming through as you can see and then the last thing that we wanted to say was please output the following parameters So based on this information that it's getting right here that it's going to sum summarize it's going to Output an email subject for us and an email
body for us so we can go ahead here and hit test step and I'll show you one thing about how we want to Output this content as Json so I didn't check this yet and so that means that this is going to execute and it's going to all come out in one sort of like large string so as you can see we've got um for the first order email subject new order confirmation order ID 101 here actually let me make this a little bigger so it says hello team we have a new order that has
been successfully processed and shipped below are the details so it's going to summarize out for us and then it signs off thank you for your attention best regards customer success team but this is coming through as one big chunk of text called content so what we want to do is output the content as Json we'll test the step again and now it's going to come through as two separate Fields one will be the email subject and then one will be the email body and this is just important so that we can drag and drop the
next Fields later when we want to configure the actual Gmail node so as you can see right here we've got the subject and then we've got the body and we've got the subject and the body we'll read one more real quick so order 103 we've got the subject and then the body says we have a new order summary order ID 103 Mike Johnson you got headphones at $200 just one pair please let us know if you need further details so as you can see these are all coming through as an email subject and an email
body and this will be important when we set up this next node here which is going to be a Gmail node this time we're going to add the node by clicking the plus up here it's the same thing as this plus but just wanted to show you guys different ways we're going to grab a Gmail node and there's 25 actions within Gmail as you can see there's a lot of stuff you can do which is just awesome but here we're going to be sending a message so we'll click on send a message um real quick
let's just make sure we wire this one up otherwise it's not going to work and then we'll come back into the node and we can configure it so first thing you got to do is obviously set up your new credential you'll come in here just got to grab that same client ID and secret from the previous one so we'll come back into um our enabled apis and services you want to go to credentials and then you can click into that um client ID that we just made and then all you got to do once again
is copy and paste that information in so let me just do this real quick we'll grab the secret paste that in there and then once again just sign in with Gmail it's again going to make you verify the app we'll go through give access to everything and then we go green because we're good to go so we've got that set up now all we need to do is configure the rest of this node so as you can see the resource is a message the operation is that we're sending a message now you can see why
it's so important that we set up the email subject and the email body as two separate Fields because we output it as Json so all we got to do is drag in this subject right here where it says subject so the subject of this Gmail being sent off will be order confirmation 101 for John Doe and then same thing with body you're going to grab that and put that in the message field where this is the actual message that's going to be sent in the email we we want to make the email type is text
that's just how I usually like to do it and then for the sake of this example we will just put in my email so we can see this email coming through and you could make this variable you could make this change based on the order if you wanted to but right now let's keep it simple we're just going to send it to nerk 88@gmail.com every time and finally you've got some options here you could attach things you could CC people you could change the sender name variably whatever you want to do here I usually just
will come in here and click append and add an attribution and make sure I turn that off otherwise at the bottom of the email it'll just say this email was generated by nadn or sent by nadn so this looks good to go we can test this step and it will it should be firing off five emails because we have five emails um in the sample data so you can see these came through it's just giving us a message ID and a thread ID which right now we don't need but you can see that all of
these got sent so let's hop over to the email I will refresh and we should see five new emails in my inbox so yeah we've got order um 101 102 103 104 and 105 so this is information from all the orders as you can see this one says new order from Robert Brown he got a tablet three of them actually 600 per unit so the total price was 1,800 it was on August 28th and the status is still pending so thank you best regards customer success team so all that came through exactly how we wanted
it so that's good to see now we're back in n8n and we're pretty much done with this workflow we've got three nodes in here and we can save it and now what we want to do is check this box to inactive or sorry to active so all this means is that now that the workflow is activated it will regularly check Google Sheets for events and then it will trigger executions each time that um a row is added or updated and they won't show immediately in the editor so that means like we won't be seeing like
these turn green every time it actually is going through but they will'll be going through so let's hop into the Google Sheets real quick add a new row and then let's let's wait for the email okay so I've got this information I'm about to paste into here we've got order 106 for Phil dumpy he ordered 500 crayons $5 for each one we've got the date and we got the status so now we're just going to hop into our email and I'll just refresh and we should see the new email coming through okay so I just
refreshed and we can see this new New Order we've received the New Order from Phil dumpy here are the details 106 Phil dumpy 500 crayons $5 per unit we've got the date and then we have the status so um as you can see the date is actually coming through is January 20 2025 um and we did not put January 2025 so what you can do here is because there's you know a discrepancy we will go back and N ITN we will go to our executions over here or right here so executions we can see this
is the most recent execution we'll click into here and we can see what's actually taking place so as you can see the trigger went off it grabbed one new item we'll open up this message and model node so we can see the information coming through and you can see the date come through here as 45585 so that's not what we want um that's why it's coming through as um January 20 2025 so what we need to do is come in here and fix this specific node because we see exactly where the issue is happening I
think the issue here was just weird formatting with numbers coming through as far as dates so let's just try this one again I just out of this row so it should be working right now to fire off this email to us but we kept this one as just plain text so hopefully it reads through an n and end as plain text but let's take a look at the email and then we'll take a look at the actual execution okay just refreshed got this new order it's coming through order 106 and we got the date correctly
as October 20th 2024 which is what we put right here so let's go back into Ed and let's refresh this page so we can get the most recent execution and making sure all the data is coming through exactly how we want it and it's a great thing to keep in mind that you're able to go into the executions you can see exactly how stuff's coming through so from the Google Sheets trigger we're getting this information and the date's now coming through correctly how we want it previously it was coming through as just like 4554 whatever
sometimes in sheets it can be weird with date formatting and then it's being able to come through correctly order date and it's giving us a nice summarization right here we've received New Order with the following details order ID 106 for Phil dumpy crayons 500 all this kind of stuff and then it's just going to take that subject and and um body and put it into a Gmail node which is being sent over to Nate herk 88@gmail.com which is what we see right here so that was it for this first example I know it was very
simple we just utilized three nodes to build this workflow that automatically takes data every time a row is added in your Google Sheets it's going to summarize it with a large language model of chat gbt 40 and then it's going to move into the Gmail node which actually sends it off and this was one execution of this work worklow okay now we're moving into part three of this master class which is going to be talking about Rag and Vector databases I'm sure you've heard these terms but maybe you don't completely understand them so I'm here
to break it down for you and then we're going to end this part with going back into nadn building out a simple rag AI agent and this will include you know actually uploading information into a vector database and then being able to use an agent and rag in order to go talk to that PDF or file and get answers back okay so what is is rag rag stands for retrieval augmented generation and it's a very powerful technique that's going to combine two different approaches the first part is retrieval and then the second part is Generation
so this technique really helps AI models provide accurate and relevant answers especially when you need upto-date or specialized information so the first part here is retrieval when you ask the AI a question instead of it making up answers based on its training data it's going to retrieve relevant information from um external sources so in this case the pine cone Vector database that we're going to be setting up um so this is obviously going to be the database but it could be other documents or it could be websites and then the generation aspect of it is
after it retrieves back this information that's relevant and accurate and up to date then the AI model will use this information to generate an answer so this is where the AI actually crafts a human readable response with the information if you don't already understand from that previous slide why rag matters let's break it down real quick let's say for this example you're using an AI assistant that needs to answer questions about your company's internal policies you don't want this thing to just guess um answers based on its training data it might be out of date
because you're going to update policies stuff like that so in this case the AI assistant will use rag to retrieve the most relevant information from the system it's going to generate an answer based on that specific information which makes the AI far more reliable and up toate for your needs okay rag is a pretty simple concept to wrap your head around now we're going to move into databases which I think are a little more complicated but once you really break them down not that bad so in order to make rag work the system needs a
way to store and retrieve data efficiently this is where the vector databases are going to come into play so in simple terms Vector databases store data in the form of vectors which are just numbers that represent the meanings of words or text or whatever it is and it's going to store these vectors into a multidimens dimensional database so these vectors are going to help us find find similar or related information much quicker than sort of like a relational um structured database this one's going to be using a lot more unstructured data so even if the
words are not the exact same for example you're asking about cars the vector database might also help you find related information about vehicles or automobiles as you can see in this picture down here we've got um wolf dog cat and then the query is a kitten so it's going to be searching for a kitten information about kittens and it will kind of be um in this three-dimensional database store it'll be seeing like similarities based on characteristics of these things and as you can see like we've got fruits over here and then you might have vehicles
down here and you might have like you know information related to certain types of products up here so that's kind of how this works just as like from a visual perspective so if you're wondering how Vector databases work in relation to rag the AI is going to convert documents or text into Vector stores and it's going to put them in the vector database where they need to be then when a question is asked the system is going going to look for similar vectors and sort of search out the right area to pull information back um
you know relevant documents or data and then once it finds these most relevant vectors it's going to retrieve that information and then finally it's going to generate an answer for the human once you understand what a vector database is what Vector stores are you need to understand how can you actually get information into a vector store so this next slide is going to talk about sort of embeddings and stuff like that all right so embedding data into a vector database this this slide is going to be kind of tailored towards doing this in n8n there's
other ways to but NN is the way I do it so real quick let's just break down this picture so what's going on here is we're testing the workflow it's going to be searching a Google Drive for a specific file it's going to pull that file and then we need to embed it into the pine cone Vector Store Pine Cone is just a vector store database that we use um it just seems to be you know very cheap very easy to use so this is the one we're using but there's other Vector databases out there
you might have heard of something like super base but this one's really simple then what it's going to do is it needs to load the information so the type of information coming through whether it's Json or binary it's going to load that it needs to be able to split it up you know it's going to chunk it up and then it's going to use the open AI model to embed it into the actual Vector store so I know that this stuff may not make sense yet we'll get into an actual example in NN where we're
building this out and we're getting real PDFs from our Google Drive up into pine cone and we'll see all that take place but we just wanted to give you a quick visual real quick quick so you can understand what's going through the first thing I'll touch on real quick um is the default data loader aspect of this so in NN when we connect the vector store we have to load the data this node is basically just going to allow us to load data from a previous step flowing through um you know right here and then
we need to load it into here so that we can actually chunk it up and get it embedded into the vector store so this note is pretty much just going to be looking at what kind of data we're loading in um if it's like Json or if it's binary that sort of stuff and then we can just you know configure how much we want to pass through stuff like that and then we move into actually text splitting so right here I have a recursive character text splitter as you can see right here the three options
in NN will be character recursive character or by tokens so the first option is character text splitter this is just going to split the text into chunks based on a set number of characters so you might want to use this when you want to break down text into equally sized pieces regardless of where sentences or paragraphs end um and then the next one we have is recursive character text splitter which I seem to use the most because this one is going to split text by characters but it does so intelligently because it's going to break
down logical points like after a sentence or in between paragraphs stuff like that but same concept of just chunking stuff down so this is recommended when you want to keep the text meaningful instead of cutting off a sentence in the middle it's going to split at natural breaks like after you know a period or a comma something like that and then finally the token splitter this is going to split text based on tokens which are usually words or subwords that the model understands and you kind of want to use this when you're working directly with
a language model like Chachi BT because it's going to process text in terms of tokens and you know it's going to chunk It Down based on how the AI model reads the text so you know if you're processing data for a model it's going to split the text accordingly hopefully I didn't confuse you guys too much maybe I went into too much detail but just wanted to break down those different types of splitting but best practic is a lot of times you can just use recursive character so the information stays meaningful but um just a
quick summary here so the rag is going to be um retrieving information from documents right here that we're putting into a vector store in order to give us intelligent answers then the vector database is going to store text in a way that allows us to quickly and efficiently search based on meaning not just exact words that are you know hardcoded in we're looking at stuff that's related to specific meanings of words and then we're going to use a text splitter to um help break down the large documents into manageable pieces in order to put them
into to the vector database and then open I AI here in this case is just going to embed it into the vector store so that is basically how it's going to work and we'll hop into NN and actually show you guys this as you can see what we're going to do here is build an RG rag AI agent and in this workflow we'll be using a Nike earnings PDF and we're going to put that into pine cone which is the vector database that we'll be using and then we can chat with the agent in order
for it to retrieve information about Nike earning so that we don't have to read through the PDF we you can just ask questions about it all right like I said we're going to be looking at this PDF of Nike earnings reports so we're going to see this is the PDF that we're looking for it's 10 pages we don't want to really have to read this thing we want to be able to just chat with an agent and it can pull the information for us so first up here get some sort of document that you want
to put into pine cone Vector store then as you can see I have this in my Google Drive right here so that we're able to actually you know call this information and push it into pine cone through nn and then you want to go into pine cone it's just type in Pine cone. it's free to get started you want to set one up you'll come into here and all you want to do is you're going to create an index so you can name it whatever you want um I'm pretty much just going to keep everything
as is the only thing that you want to make sure that you set up here is right here you want to set it up by model and you want to choose text embedding three small so you'll set that configuration and then you'll just hit create index your index is going to pop up right here if you click into it you can see that there's no information you can see that there's no name spaces in here um just a really quick explanation of name spaces you can have different name spaces within each index like let's say
I was in here and I had one for um internal documents and then I had one for um client a and then I had one for client B that's just going to help your agent be able to search for the information quicker because it can sort of break it down by okay I need to go to this index and I need to go to this namespace and then here's all relevant information regarding this project or client once you've got all that information set up we are good to hop into to NN and start pushing information
into that pine cone Vector store so the first thing that we're going to do here is I'm just going to make this a manual trigger in the future you could have this where every time you upload a document to a certain drive it would do a Google Drive trigger and then it would automatically push that information into pine cone which is super cool because then your database is going to you know stay up to date every single day every single time you add more information but right now we're just going to be doing a manual
trigger next thing we need to do is add a Google Drive node because we need to get that information from Google Drive drive into NN so we're going to click on this plus button going to type in Google and we will see Google drive right here once again lots of actions the Integrations are awesome but what we're going to do here is download a file so if you haven't got this node configured yet it should be super easy because you've already set up your consent screen and your client ID and secret and all that but
in here you just need to go and make sure that you have enabled the right API so as you can see here I've got Google Sheets Google Drive Gmail Google Docs custom search all the different apis that I can use within in NN so set that up make sure you're connected to the right account and then we're going to be downloading is the operation and we're grabbing a file the resource and once again we can choose from a list which is awesome we're going to come in here and look for the Nike press release PDF
so I'll grab that and then what we're going to do is just hit test step because then we can see the information coming back so on the output you can see that we're getting this information one thing that's really important to know is that it's not coming through as Json there's no information here it's coming through as binary so we don't have to get too technical on what exactly that means but we have to just make sure we know how this information is coming through so that later when we want to embed it into the
vector store we can make sure it's getting loaded correctly and I'll I'll show you guys that later but for now just remember that this PDF is coming through as binary so we can view this PDF make sure it's the right one as you can see it's Nike earnings so we're good to go here and we can move on to the next step we've got our file next we need to add the actual pine cone Vector store so so we can push the information into pine cone so we're going to add this we've got four actions
within pine cone right now we're just going to be adding documents to a vector store but as you can see you could also retrieve you could update all that sort of stuff and we will be retrieving later in order to actually chat with our agent about this PDF once again it's a little Annoying to have to set up the credentials for everything but once you have them you're good to go so in here we need to set up the pine cone I'm going to create new credential and as you can see we need to grab
an API key once you hop back into pine cone you can see obvious you've got your indexes on the left hand side you can go down to API keys and then all you're going to do is just copy this value with this button right here copy that and then you're just going to really quickly paste that into the API key hit save and it should go green because our connection is successful now we're actually able to insert documents to the index so the index that we want to insert to is called sample and for the
sake of this video let's add it to a namespace so click on ADD option Pine code namespace and we will just call this one Nike and now we're good to go with this node but what we need to do is we need to set up like I talked about earlier the the default document loader how we're going to check Chunk Up the text and then the actual embedding so first we will do the embedding I'm going to use open AI you you should have your credential already set up and then we need to choose the
model so if you remember when we set up our pine cone index we set up the model of text embedding three small so we don't want to do Ada O2 we want to come in here and grab three small so that it's being being embedded properly then we need to choose this plus button and we're going to do the default data loader like we mentioned now here is what I talked about with we need to remember how the information is coming through this Google Drive so remember we came in here we see the output is
binary not Json so binary is how we want the information to come through so in the data loader we need to make sure we're selecting the type of data is going to be binary otherwise you're probably not going to get any information put into pine cone so we're good to go here the last step is just to set up the text splitter so like I talked about the differences between these three as you can see there's also a short little description here so if you forget you can always come in here and read what they
do but we're going to choose recursive character text splitter the chunk size like we talked about is just how many characters are going to be within each chunk and the overlap um we don't want to have any overlap and chunk size 1 th I'm sure that's fine for now the PDF is pretty big but we can see how this works so let's just hit save and then we will test out this workflow so it's a manual trigger so we're going to hit test workflow it's going to grab the file download the PDF as you can
see it went through the data loader it went in here and then it had to embed it until it came into the actual Vector store so let's hop back over to Pine Cone let's go to our database let's go to the index called sample we can see that we have information in here now and if we click on names spaces we will see that we just created a name space called Nike and there are 29 vectors in here and as you can see 29 items left the pine cone Vector store node all right our information
has been successfully put from Google Drive into pine cone now we need to build an agent workflow that we'll be able to chat with in order to get answers from this PDF all right we're in a new workflow here and once again we got to add a trigger so the first step is going to be a chat message because we want to talk to the agent in order for the workflow to start execution so we'll click on chat message we can leave this as is because we'll be using this button down here to actually you
know talk to the agent and that that's how it's going to work but we have our chat message trigger now we're going to add a new node we can come in here to Advanced Ai and we see there's a ton of different AI things we can do um there's even some templates up here to see you know what's possible and you can download those and start playing with them but we're just going to come in here and grab an AI agent now within this AI agent you have different types of Agents you can use you've
got tool conversational or openi functions agent you can read a little bit about what each of these do but because we're giving these agent different tools I think that we'll just keep this one as a tools agent come in here and call this guy our Nike agent and then you can also do things like add a system message you can return immediate steps you can have him have a max amount of iterations we will add a system message right now it's just going to say you're helpful assistant we can set this up in a sec
once we get all the tools configured but this is where we sort of tell the agent you know this is your job here's background information here are the tools that you have here's how you use them here's like an example flow so we'll talk about all that after we get the rest of this workflow configured we've got our Nike agent and then you can see there's different things we need to set up so the first one is going to be the chat model I'm going to grab an open AI chat model and connect our credential
once again and then we choose the type of model we want since this is going to be pretty conversational I think I'm going to use 40 it just seems to be the most consistent it's kind of the one that I'm pretty loyal to but sometimes for smaller things like if you're just labeling emails or if you're um doing some sort of classifier where you just need to parse the information and see um like a category maybe then you could come in here and grab you know 35 or 40 mini but don't get too caught up
on what each model's good at but right now 40 is kind of the most expensive but it is the most powerful so we set that up with 40 now let's really quickly add a memory so this is super super easy we just want to grab a window buffer memory um this is super easy because that's all we have to do we don't have to set anything up you could change the context window length but five chats is how many the model is going to remember so I'm fine with that but this is a really easy
way to give the agent some context of what's going on otherwise when you're chatting with it let's say you asked um what was Nike's earnings in you know quarter 3 and then if it came back with the information and then you said okay what about quarter 4 it would be like what are you talking about quarter 4 for what so that's going to give context of oh he just asked about earnings now he wants to know about quarter the next quarter so just just going to give context to your agent super easy way to add
that memory then finally this is where all the magic happens this is where you can add different tools So within here we have you know different things that we can give our agent access to of course we've looked at all the different nodes and the actions they can take but we can see here that this is where it's really powerful because we can call an NN tool or an NN workflow as a tool so that workfl that we just made about um you know getting information into pine cone we could call as a tool here
but that's not exactly what we're going to do we are just going to call um sorry a vector store tool and this is the one that's going to be getting our um Nike information so we will just call this um database and then you need to give it a description of when to use this tool so we'll say call this tool to um read to get get information about Nike's earnings to answer the user question okay so that is the description for this tool now we need to set this up with the actual Vector store
because we need to connect this to Pine Cone and then a model of course so let's add the model real quick pretty much same exact thing we're just connecting the credential we're adding a model I'll just do foral mini here um and then we can see we need to grab the vector store so we have in memory we have different options here super base that I talked about but this is how we actually want to work with data within our pine cone Vector store so we're going to click on that um I'm going to set
this up real quick and now we see there's different operations this is the time we want to actually retrieve documents we don't want to put anything in there right now we're just trying to get information so we'll click retrieve we need to choose the index that we want which is just sample and then here's another option where we can add the name space for this agent to go search through so we called ours Nike so make sure you put the right name space in here and make sure it's spelled correctly too so now we have
that set up so we're almost done with this agent last thing we need to do here is ADD the embedding which once again we did um three small so we need to set up three small once again okay so this is pretty much it for this agent we should be able to talk to it and have a conversation with it now so let's hit save and let's just give it a shot so real quick let's go to the PDF and ask about something so we can see the gross margin for the fourth quarter increased 110
basis points to 44.7% so let's ask about um the gross margin for the fourth quarter so we'll come back into nnn we'll chat with his agent um we'll just say how was Nike's um gross margin for the fourth quarter see what he says Nike's gross margin for the fourth quarter was 44.7% so that was right that's the information we're getting but we maybe don't like the way that this agent's talking to us so that's where we need to actually come back into the agent and prompt it so let me just type out a real real
simple prompt and then we will take another look all right I went into chat gbt and I said hey can you help me prompt this agent it needs to understand its role some context instructions I want to give it some example flows of how it should operate and we got a pretty good prompt out of it so let's just read through it real quick we said you are a friendly and helpful Nike representative tasked with answering any questions users may have about Nike's earnings you have access to a vector database with all the relevant data
on Nike's financial performance including Revenue profits other earning related info when a user asks a question you should search this database to find the most accurate and up-to-date information and respond in a friendly approachable tone be sure to add humor and use emojis to make the conversation fun and engaging then we gave it instructions for an interaction flow so basically we said a user asks a question you're going to search the database you're going to respond and then we gave it some information or some examples of a friendly tone greeting the user throwing emojis using
jokes um all that kind of stuff and then we wanted to give it a sample flow sort of like more exact um the more examples that you can give an agent about you know what it might run into different situations the better and then finally we said the actual tools that it has so Vector database is really the only tool we hooked up and we said to use this to retrieve specific earnings information and financial performance remember your goal is to provide accurate data while keeping the user engaged with humor emojis and a conversational tone
all right so let's give this a save and ask another question let's let's just come in here and say um who is Matthew friend because he's the Executive Vice President and CFO of Nike so we'll say who is Matthew friend and like what did he say I guess let's see what we get from that who is Matthew friend and what are his thoughts okay so here's what we got from the agent Matthew friend is the executive VP and CFO of Nike he's the financial Mastro and ensuring the Swit stays profitable and Innovative and then we
have um two emojis there let's see he said he G the agent gives us the quote that he said and then at the end it says if you have any more specific aspects you're curious about I can dig up his latest commentary for you so good emojis very friendly um let's just say sure can we get some more info and this is information this is important because it's going to remember what we were just talking about which was Matthew friend and we can see if there's anything else in this PDF that he said um so
here's a slice of wisdom from Matthew friend the CFO he recently highlighted that while Nike is driving a better balance across his portfolio the fourth quarter brought some challenges but no worries he's on it Matthew emphasized that Nike is taking strategic actions to reposition itself for sustainable profitable long-term growth okay so we're seeing a conversation with this agent right here in the log you can see exactly what's happening so you can see our agent um it updated the memory it went to the chat model it read through it prompt and then it basically is like
making sure it knows what to do it's going to go to the vector store tool and we have the query which is Matthew's friend Matthew friend's recent statements or comments and then it got an output from the um pine cone database so if you don't understand what's going on here basically it's just being able to see the flow of what's going on so that you can um you know troubleshoot if need be but this is super cool and it just shows you how you can connect different tools so we could even come in here and
add a um what is it Wikipedia so this is going to let it search in Wikipedia so if there's information maybe that's not about um that's not on this PDF it could also access this tool and we'd have to obviously prompt it a little bit to do that but let's just see if this is going to work we can say what is the capital of Florida and it should be searching through wikkipedia to answer that question so the capital Florida is Tallahassee it's not just about beaches and theme parks haah nice and friendly but um
you know this information the capital of Florida I doubt that it was on this earnings report from Nike so that just shows you that it actually went and searched through this tool and you know you can also add like a calculator in case you want to make sure it's doing you know math accurately um so we got a calculator tool here now too so we would prompt in that but it's super cool because like I said you can connect different workflows that you build within NS tools so let's say we have this agent here and
we give it a tool that um can send emails because we're going to build a workflow of automatically sending an email and and then we would just give the agent this this tool so that if we wanted to chat with the agent and say hey by the way could you send this information to um you know Matthew friend in an email and it would actually be able to go to do that as long as it had Matthew friend's email which we would give it in some sort of vector store as well so um I hope
that that you know is a breaks down the concept of rag Vector databases um pine cone Vector store how you can link all these together when it comes to giving an agent access to all these different things in order to do what you wanted to so at the end of that last build we saw we started expanding on that agent and giving it access to you know Wikipedia and a calculator tool and so I wanted to talk a little bit more about how you can actually expand on these agents to make them even more powerful
and scalable um you know like giving an agent access to more tools giving an agent access to agents to call on it's it it's super powerful the stuff you can do so in this part just wanted to quickly talk about building workflows as tools how that all works how that all comes together and the importance of it and then we'll just go through a couple examples in NN of some agents that I've built and you can just see the way that they use different tools all right the power of being able to build custom Tools
in NN it's it's honestly insane so first we have the fact that agents can use these tools obviously you can build a tool and have an agent call on it like in this example down here you can see um I have get email tool send email tool update database summarize database set calendar event and get calendar all of these are tools that I built within nadn so these are workflows I'll show you guys them once we hop back into nadn but these are all different tasks that I built out in nadn and then the agent
is able to decide based on what I tell it texting it on telegram based on what I tell it to do it will decide which tool to use in order to go complete that task and then it will either tell me that it did the task or it will give me you know the summary of a database or my calendar that sort of stuff so agents can use these tools um you know like a smart agent or a smart AI assistant that can call these workflows so this is a great example right here of a
personal agent we also have the fact that tools can be reused and recombined so now that I have these tools built out I have a send email tool if I ever need to build a different type of agent to send emails I can just give it this tool I've already built it so it's already there in my workflow and I can call on it in multiple different agents it won't really matter so that is super cool they can be reused anytime and they can be combined with other tools and now for scaling so this is
what I talk about the fact that as you build out tools you just have more and more tasks that you can complete um more things that you can give your agent to do and then it gets even more powerful because um let's say you want to not just have a send email tool but you want to have an agent that can do everything within email so you would have an agent and you would give it a ton of different tasks and email so youd have an agent with get emails send emails label emails draft emails
delete emails all this kind of stuff and then you could give your overarching like larger agent access to the agent that does email stuff so this agent would be able to decipher okay do I need to go into Outlook or calendar or teams or slack and then you would down here have one agent that does everything in slack One agent that does everything in teams One agent that does everything in your calendar and then you can just build on top of each other and also that's going to make your workflows more efficient rather than trying
to you know send a prompt through with like giving this agent you know 50 to 60 tools like that would be way too much even I think like 20 is probably too much but that way you could give the agent other agents and it's just like you know the hierarchy of it's going to go through this guy then it's going to go to these agents and then it's going to come back so it's just you can get really creative here with how you can get stuff done and all you have to do is break it
down by tasks so take a task and combine these with a larger workflow of getting all these tasks done and then you know larger just just scale up pretty much so now let's just hop into nadn and we can take a look at you know this assistant and a couple other ones all right so this is the personal assistant that we were just kind of taking look at back in the slides but as you can see it's got just pretty much seven tools it's got database information so for something like getting or sorry sending emails
it needs you know contact data information who do I actually send it to what's their email address and then we have these different tools get emails send email get calendar set calendar and then update or summarize the database so real quick I'll just show you guys how I talked about these ra all tools within my nadn so if I go back here we can see um here's the update database tool here's the calendar email so we can like click into one of these so let's do summarize database as you can see it's just a very
simple workflow we've got different nodes we've got um the actual database it's going to call on this database it's going to summarize it aggregate everything into one clean field and then it's going to send the response of the information back to the agent so it's going to go through this process then it's going to have a summarization right here once we get that information summarized it's going to go back to the agent and then it knows its job is done so then it's going to Output a telegram message back to me so real quick let's
take a look at this database this is the project database that I'm summarizing in this case so we've got different tools or sorry different projects we've got notes about the project and then we have the different statuses so I know it's a very simple example but that's just you know I was testing out this personal assistant and trying to make a video about it so here's the assistant let me just pull up my telegram with my that I talked to for my AI assistant um as you can see there's different information that I've been testing
out with other workflows and other executions but let's just come in here and say can you summarize our database and so this is going through telegram the agent is under getting this prompt right here can you summarize our database it's figuring out which tool it needs to call in order to do that and then it's going to summarize the database as you can see we just got this message back here's a summary of the current status and contents the a AI project is complete the marketing campaign is pending it involves drafting content this that is
ready and awaiting review by the marketing head um mobile app project this project involves developing a user authentication module which is currently ongoing beta testing has been scheduled indicating progresses in the works so as you can see it's you know summarizing all this information for us could be super useful if you were on the road and you need to send a quick email so you just have to text this agent real quick or you know on your way to a meeting and you need to summarize get some quick information summarized it could even summarize all
the emails you've gotten from a certain day so that is a cool example of um building an agent and giving it examp giving it access to different tools that you've built in NN by the way if you if you want to know more about what this agent can do please go watch the video I'll tag it right here um I made a whole video about you know building this personal assistant and sort of like the capabilities of it and how you can expand on it so definitely go watch that video if you want a more
in-depth look at what this agent does here's another quick example of a different way you can structure an agent this one is being triggered by Gmail so every time I got a new email it's going to come through here it's going to classify the email give it a label of high priority customer support promotion finance and billing and it will actually give it a label on Gmail and then for each of those types of email it's going to come through here and select for high priority one it's going to create a draft and then it's
going to have the draft sitting in our email and then what I would do is um actually I made a video about this one too so if you haven't seen it I'll tag this one too and you want to you know go look and see how this works and how to build it but then what I did in the video is we hooked it up to a send text message node right here in telegram so I configured this and then it was able to let me know hey we made a high priority draft for you
based on this email from Kevin and now it's like there for you and then I did the same thing with all these other ones so like for customer support we let it actually create an email and reply to it so it actually sends off an email and then the telegram message says um we sent off an email for you based on you know it was a customer support email same thing with these two down here in you know if I pull up telegram we can actually see these past interactions I've had so like for a
finance and billing one down here we wanted it to summarize the information and then send it to the finance department so right here we see you received a finance and billing inquiry from Angela from the accounts Department we've notified your finance department of this email um right here it's like a promotional one so here are details regarding a promotional email from Nate it gives us a summary of the promotion and then it gives us a recommendation so that's something that we crafted out right here and all of these were linked up to different telegram nodes
to let us know notify us of what's coming through and what the agent had done so like I said go watch that video if you want a more in-depth run through of what this um agent does but the purpose of me just showing you guys this real quick was just to open your eyes about how you can expand how you can build off of you know different ways you can structure agents and how you can you know make them do exactly what you want to do and remove yourself out of that process to automate things
so just super cool stuff moving on to part five which is going to be talking about apis and HTTP request quests um this kind of stuff can sort of get a little Technical and seem confusing but I'm here to make sure we just sort of break it down as simple as possible so before we really get into the content of this part I wanted to just stress that you know we've already been working with API calls and API tools whether you've known it or not all of the preconfigured nodes in nadn are pretty much just
HTTP requests in some way or another so when you're using these nodes naden is doing all that hard work of making the API call for you you know either fetching or getting some data like in that previous example when we were using that Google Drive node to get information to put it into our pine cone Vector store that was pretty much an API call to Google Drive looking in our Google Drive grabbing the file and then we got the information back in Ann so we're pretty much already doing that you only will really need to
use apis and HTTP requests in nadn if you want to connect to something that there's not an integration for which um is kind of rare but it's good to go over just in case you do need to do this so yeah the an NN they know exactly what to do exactly where to go where to send their requests and how to get the information you need or put information somewhere that you need to so now we can move into talking about apis so what is an API it stands for application programming interface so basically just
think of it as the bridge that is going to allow two different softwares to talk to each other like nadn and Google Drive whatever it may be so here's a concise summary about API endpoints calls and HTTP requests so so um the endpoint is just basically going to be a specific URL or address within the API where a certain service or piece of data can be accessed so it's like the exact path that you need to take once you access that API you have that endpoint so it's going to specify where you need to go
then the API call is just that request that you're making to the API asking it to you know perform some sort of task or provide some sort of data so it's like you're placing an order and then the HTTP request is the actual method that you use to send that API call over on the internet so it's sort of just the messenger that's going to carry your request to the API endpoint and then it's going to bring the response back in a nutshell you're going to be making an API call using an HTTP request which
is going to be sent to a specific API endpoint and then we'll get the information back from the API and then the HTTP request is going to return the information to us okay so what is an HTTP request think of this as just the way that your computer or nadn is going to be talking to the other service so you can do things like get data which will be sort of a g HTTP request or you can send data which will be a post HTTP request which you'll see once we hop into NN and actually
look at some examples but just as simple as either asking for information or sending information somewhere I remember when I first heard about all these different terms I thought to myself like that sounds so similar how do you really distinguish so let's just quickly talk about how they actually work together so like we said an HTTP request is is how you actually make an API call it's the messenger that's going to carry your API call to the server so we've got a quick restaurant analogy let's think about it like this so we have the API
this is like the restaurant itself so this is the service that you're talking to the restaurant is going to provide different services to its customers you know just like an API the restaurant offers a menu of things that you can request different actions or different data then we have the API endpoint the API endpoint is like this specific kitchen station that you're talking to so it's going to handle a particular dish there are different stations for each tasks you know cooking pasta making pizza so the end point is like going to the correct station in
order to get the specific dish that you ordered then we have API call um an API call is like placing the order it's the actual request so in this case you know we wanted spaghetti that's how we know to get it to the right spot but um you know you look you you'd order the specific meal and then um that's just making the request um for data or for a specific service from the API and then finally we have the HTTP request which like we said is pretty much just the mechanism that's being used to
deliver the request so in this analogy it's going to be a waiter who's going to take your order bring it to the kitchen staff and then when they bring the dish the waiter is going to bring back that food to bring back that information that you were looking for so hopefully that was simple enough API call is the concept HTTP request is the tool so you're asking for something with an API call and then the request is going to be how you're delivering it over the internet all right now let's just get into NN real
quick and just look at a few examples of an HTTP request node and sort of what it looks like to configure something like that we are now back in nadn as you can see I've got three different HTTP request nodes in here so you would just come in here and grab HTTP request as you can see right here um but these first two we've got two gets so we'll be asking for information in one way or another and then this last one will show a post where we're actually sending information somewhere so let's just go
into this first example here so this one's going to be a really simple one we're making a get request like I said so we're asking for information here would be like sort of that API endpoint like we talked about so we're going to be going to openweathermap.org um we're going to be asking for weather you can see here's some parameters Q equals New York so we're looking for weather from New York and then we have a little credential here we had to set up an API key to actually be able to access um the API
of open weather map and get into you know that's my API key so it knows that we have permission and we'll hit test step here so we can just see that this request is working we can see information coming through on the right hand side we've got clouds we've got temperatures we've got wind um and then as you can see it came back for the name the city of New York so we know that this request was working I won't go too much right now into you know setting up parameters and headers and body for
your request but usually when you want to connect to a certain API they're going to have documentation on it so in this example for open weather map they have exactly like the end points that you need to find or they they'll give you what you need to type in and how to specify parameters it's not like you have to know how to just find the stuff cuz that seems pretty technical um so yeah most of the things that you want to connect to if there's not an integration in NN already we'll have documentation on their
website of how to connect to different things how to request for different things how to send different things so you'll just have to read through documentation but another cool thing obviously like we were getting weather from open weather map but as you can see like open AI already or sorry nadn has Integrations for this where it's a lot easier because this is basically setting up that API call they just did all the coding the technical stuff on the back end of that so we have this basically the exact same thing okay so this next one
is another get request this one is as you can see we're going to be searching Google so we have the endpoint right here of google.com/ search but we did want to set up some parameters here so we have q like we saw that last one Q equals New York this time Q is equaling site colon linkedin.com slin okay so this is the URL that we're basically trying to access so if we p ped this into Google right here we would see like it brings us up Google so that's what we're searching on and then within
Google we want to be searching for site umon linkedin.com so we go back to Google paste that in there and you can see what's coming back is actual LinkedIn just LinkedIn profiles so that's sort of how this parameter is working and we can go ahead and test the step real quick we can see exactly what's coming back which is going to be a nasty chunk of HTML a lot of information in here your next step here would be to parse through this information with a different node that would grab you just LinkedIn profiles so like
if I come in here and search um linkedin.com you can see like I'm sorry we've got a lot of hits 173 hits and we can sort of go down until we find actual profile so that's what you'd have to be parsing out but right here we have Robert W Livingston so if we go back to the actual Google search we can see that first profile coming through is Robert Livin um and then if we were to continue to go down and look through all the different results we'd see all these different profiles coming through into
our naden so that is the way that this request is asking for information from site colon linkedin.com in and then we're actually getting back the parameters from or sorry the information from Google through that request and for this final one we're making a post request as you can see right here so I click into this we'll see what's going on in this node this is a post request and I was able to go to Google apis in order to see how to access my calendar there's going to be different API endpoints in their documentation of
like you know copy this URL if you want to create event copy this URL if you want to update an event copy this URL if you want to get information back on your events so that's all I did I I hooked up that that API endpoint in here obviously had to set up my credentials and then in this example we have to send a body because we're posting data sending information and so this is really simple it's just Json um sort of setting up the criteria for the event you could you know go into chat
GPT and say hey I'm like accessing a Google API for my calendar can you help me set up a body and it should work with you there but in this case the summary of the event that it's going to be making is meeting with team we have a start date um noon we have an end date of 1:00 and then we can add like attendees and different emails and real quick I'll show you this is the calendar that I'm accessing right here so there's nothing going on today and we're going to make the event for
noon so if I hit test step it'll come through and it'll say that it worked and we can see on here we just got our meeting with Team from noon to 1:00 p.m. and the information coming back here is just going to be like you know meeting link it's just going to basically tell you that that post request went through successfully all this kind of stuff but another case where that would just be over complicating things you've got Google Calendar right in here um where is it right here we can get availability we can create
an event so all we did right here was create an event this is going to make it a much easier way to actually send that request because you just have to fill in different parameters and you don't have to worry about the API endpoint putting that in you don't have to worry about um you know the Json sending over the data in that post request you could just do that right here as well now that that concept of just how you access endpoints and how you actually send or receive data makes more sense what you
would want to do from here is like the more realistic use case when you're building stuff like this and you need to you know integrate with something is going to be a web hook trigger so you can see like you've got your url here you have an HTT method and this is the kind of stuff that you'd be more familiar with setting up once you understand the basics of um sort of these noes but these are going to be really powerful tools because these will let you trigger a workflow based on um information coming through
from another site so if you wanted if you had some sort of form on your website and you wanted to hook up to that and then every time someone filled out the form you could have this go through where it's going to you know notify you that someone filled out the form it's going to send them an email sort of welcoming them it's going to throw them into a database and then it's going to send slack message to your team something like that so these web hooks can be very powerful when it comes to automating
other processes as well and getting pretty customized but before you get in here and you want to start configuring stuff I think it's just important that you understand the the framework and the basics of you know apis and points HTTP requests and how all that stuff is going to work in nadn and then you can really explore with stuff like web hook triggers which are very cool and offer a lot of flexibility all right we have now made it to part six which is going to be the final part of this master class you know
we've covered a lot of ground we started the basics of NN building your first workflow we created an AI powered agent using RG Rag and Vector databases we made API calls and HTTP requests we talked about extending your workflows with custom tools and web hooks so you're no longer a beginner you have the tools and knowledge to create powerful automations that are going to transform your productivity the way you approach your automation projects and I just wanted to close off with talking about error workflows um just sort of best practices when it comes to creating
workflows in na then and sort of how you can do that most optimally and then um just some final next steps and just closing thoughts all right back in NN here we have a error demo workflow which is just an error workflow that I just created real quick as you can see it's going to start off with an error trigger so this workflow is going to execute whenever there's an error and another workflow that we're hooking up this one too so that'll make more sense once we actually configure it but as you can see It'll
Get triggered and then it will come in my telegram um which will be sending me a message so it's going to notify me that there's an error it's going to tell me the workflow that's erroring it's going to tell me the error message message that happened and then it will give me a link to the actual execution of the error so that would all just pop up on my telegram I can click on the link and come in and see what's going on but in this case this is going to be you know a personal
assistant I showed this a little bit earlier so this is the workflow we want to hook up to that error workflow we come in here up top right grab that three dots click on settings and then right here you can see error workflow so a second workflow to run if the current one fails the second workflow should have an error trigger node so we saw the error trigger node we saw that this workflow is called error demo so we've hooked that up as this error workflow and um now we just need to make sure that
this workflow is going to error so let's just delete the brain of the assistant so this one should error for sure as you can see it already is and um it's going to be calling this and then it's going to be filling in the information when it airs so let me just pull up my telegram real quick as you can see this telegram this is my AI personal assistant so this is how we talk to it and this is how how it talks to us back right here if you can see this flow but let's
just ask it to do something like can you get my emails this should airor and as you can see we got the error notification the workflow is personal assistant which is right up here the message is that a chat model subn node must be connected so that's the eror that's going on right here and then we have a link to that execution I can click on that link and it should bring me into what exactly just happened and we can see why it's erroring so as you can see this is the most recent execution that
just happened um it's going to take a second to load up but basically the error is just happening because a chat model sub node must be connected that's why it aired and as you can see that's exactly what it told us in here okay so that's kind of how this works um you know you could even go you could expand off of this so let's say you want to get notified um but then let's say that we want to you know send an email to the team that says hey this this isn't working right now
um we're working on this to get fixed so let's just come in here and let's send a message um obviously we need to set up all this information so let me do this real quick really quickly configured this node obviously we're sending a message put who you want to send it to this could be you know a ton of different emails you got the subjects which is going to be error and then it's going to tell us the error message and then the message of the email is going to say hey team we received an
error in blank workflow we're working to resolve the issue thanks so if I just you know test this step we would see that that came through um let me pull up the email real quick so here you can see we got the error example error message hey team we received an error in example workflow we're working to resolve the issue um so let's just quickly go back and end it in turn off the append attribution and we'll save this and then we can um pull up telegram we will ask it to get the emails again
and we will get an error notification in our telegram right here but then we should also get a new email with that information coming through um so we'll just give this one a sec here okay now we got an error a chat model sub node must be connected hey team we receiving error and personal assistant where we're going to resolve the issue so obviously that's just a very quick example email um you could configure the subject and the message however you want but that's just goes to show how a quick error workflow you can set
that up you can hook it up to multiple different um agents multiple different workflows that you have that when they when they error this logic will take place and you'll get notified right away so that's just another cool feature of net all right if you guys have made it this far really appreciate you sticking it through all the way hopefully this has been a really helpful session but before we close out let's quickly go over some best practices for workflow optimization to ensure that your workflows are staying efficient maintainable scalable and you know all this
kind of stuff as you build out more complex automations so the first thing I wanted to touch on real quick is just keeping your workflows organized as they grow you got to keep them well organized it's going to save you a ton of time down the road when you realize uh oh like we have to redo this or there's a problem and now we are all confused about what's going on here so make sure you use you know descriptive node names you can throw in comments really easy with a little sticky note um you can
you know make notes in your workflow so that if anyone else wants to come in and look at what's going on or wants to help you out in the future they can quickly understand what the workflow is doing what each part of the workflow is doing then we want to be able to use sub workflows for reusability you don't need to reinvent the wheel every single time you want to do a similar task in these different workflows consider creating subw workflows like we talked about with you know maybe one for sending email one for creating
calendar events and then you can hook that up to a bunch of different agents or even have agent that's you know a specialist in one certain type of platform so that's going to make it sa saves you a ton of time later down the road when you want to make more complex automations you don't have to build out the same you know five nodes that are going to be the same staple for every single thing that you need to do in that space um so that's just going to save you a lot of time and
avoid redundancy and the third thing we want to do is Implement air handling so already talked about that a little bit but you can even take it a step further so you know errors are going to happen no no workflows immune to issues like an API failing or something like that so if you build in some of these issues or error handling issues it's going to ensure that your workflows remain robust you can be notified when something goes wrong you'll have like a safety net behind each of your automations and then finally just you want
to optimize for scalability so as your workflows get bigger efficiency is going to be super important so you want to use features like batch processing or pagination you want to have a lot of conditional logic in there in order to handle larger data sets more complex branching workflows so scaling doesn't just mean bigger workflows it also means making them smarter workflows and next steps now that you've made it through this master class you built a solid foundation I encourage you to keep pushing your boundaries there's so much more that you can explore in nadn and
your next step should be about expanding your skills and experimenting with sort of more advanced templates so in order to do this to continue growing and learning I definitely want to invite you all to join my fre School Community where we all you know share ideas workflows cool things that we've built using nadn it's all about collaboration and inspiration so whether you're looking for feedback or you just want to brainstorm new ideas or get some questions answered um it's nice to have a very supportive Community to share your progress with and it's going to make
the experience a lot better so please hop in the link for that is going to be in the description and I'll also be sharing a lot of resources in there that I I use in each of the videos and stuff like that so I'd love to talk to you guys and I'll see you in there the first thing here is going to be just to get in and start building you know the power of learning by doing is insane a but really anything that involve tools like n is it's best to just learn by getting
your hands dirty you know as you build workflows experiment with things push the boundaries of what you can automate you're going to run into challenges and you're going to have some failures but that's definitely a good thing like it's just part of the process and when you fail and you can go in and figure out what happened and actually solve that problem you're going to just understand the process way more than someone who you know is not actually getting in there and doing things just watching YouTube videos stuff like that you even every time I
build out any sort sort of agent any sort of workflow it always fails and it's just going to happen but that's how you really understand you know the logic of stuff moving through so these moments where you're going to gain the deepest understanding of how n in works and how you're able to actually improve on your skills so you know don't be afraid to make mistakes it's just going to happen then I would say you want to get in and start exploring some Advanced templates so at the beginning of this master class we looked at
sort of the community in nadn and the template Gallery which is just a gold mine of ideas and pre-built workflows so you can dive into those and you can see how people are building things you know there's no one right way to build an automation so you can see different ideas and it will really help you sort of expand your skills there too the third thing I would say would be to experiment with new Integrations you know don't be afraid to try out new ones even though naden supports over 300 Integrations for you know popular
CRM systems social media platforms databases um it's really important to just get in there play around with HTTP requests different web Hooks and see all the possibilities of how you can automate stuff and it's really just going to you know expand your your capabilities and then you can always start to build and share your own templates once you really get experience with um building out different things and you you start to get more creative with your workflows so that'll be really cool you can share them with the community it's a great way to inspire others
and also get feedback on the sort of builds that you're doing and how to optimize them so yeah that is going to be it for the master class those of you that made it this far I really appreciate you taking the time to you know sit down for however long this video was and um just listen through all this kind of information and I really uh try to structure it in a way where you'd really be able to come from a beginner and really understand what goes on in NN and how to just get in
there and start building some simple agents and then just make them more more complex as you learn but like I said that's the end so congratulations for making it this far thank you guys so much for your time and I will see you in that school community
Related Videos
Run ALL Your AI Locally in Minutes (LLMs, RAG, and more)
20:19
Run ALL Your AI Locally in Minutes (LLMs, ...
Cole Medin
172,890 views
Step-By-Step: Add 100+ Files to Pinecone for RAG AI Agent with n8n
14:41
Step-By-Step: Add 100+ Files to Pinecone f...
Nate Herk | AI Automation
2,435 views
Adobe Announced HUGE AI Video Updates: Here's the Truth...
27:07
Adobe Announced HUGE AI Video Updates: Her...
Curious Refuge
8,933 views
Stop using Zapier, Make, n8n
25:33
Stop using Zapier, Make, n8n
Adam Skjervold
36,237 views
AI Agents, WatsonX, and Python   The Future of Planning Analytics with Nic Renotte
43:58
AI Agents, WatsonX, and Python The Futur...
Cubewise
1,299 views
How I Wish Someone Explained AI Agents To Me (as a beginner)
12:01
How I Wish Someone Explained AI Agents To ...
Nate Herk | AI Automation
5,195 views
"All In" - Elon Musk's BRUTALLY Honest Interview With Tucker Carlson (2024)
24:01
"All In" - Elon Musk's BRUTALLY Honest Int...
Visionary
2,599,612 views
AI in n8n: Supercharge Your Workflows in Minutes!
17:21
AI in n8n: Supercharge Your Workflows in M...
Leon van Zyl
9,793 views
25 Things You Didn't Know ChatGPT Could Do
41:38
25 Things You Didn't Know ChatGPT Could Do
Jono Catliff
9,960 views
ChatGPT Upgrades, Adobe Surprise & More AI Use Cases
20:13
ChatGPT Upgrades, Adobe Surprise & More AI...
The AI Advantage
11,722 views
18 Months of Building Autonomous AI Agents in 42 Minutes
42:12
18 Months of Building Autonomous AI Agents...
Devin Kearns | CUSTOM AI STUDIO
160,407 views
Build your first NO CODE AI Agent in n8n (for beginners)
20:33
Build your first NO CODE AI Agent in n8n (...
Nate Herk | AI Automation
2,098 views
n8n AI Agents Masterclass | Complete guide to all AI nodes in N8N
23:12
n8n AI Agents Masterclass | Complete guide...
FuturMinds
6,118 views
This RAG AI Agent with n8n + Supabase is the Real Deal
16:27
This RAG AI Agent with n8n + Supabase is t...
Cole Medin
55,482 views
How to Build a Client Onboarding AI Agent with n8n (Step-by-Step Tutorial, No Code)
21:00
How to Build a Client Onboarding AI Agent ...
Nate Herk | AI Automation
2,251 views
16 Months of Building AI Agents in 60 Minutes
1:00:49
16 Months of Building AI Agents in 60 Minutes
Frank Nillard | AI Studio
43,447 views
Using Ollama and N8N for AI Automation
13:43
Using Ollama and N8N for AI Automation
Matt Williams
25,814 views
Introducing Swarm with Code Examples: OpenAI's Groundbreaking Agent Framework
27:54
Introducing Swarm with Code Examples: Open...
Sam Witteveen
25,441 views
What is AI Agent? | Simple Explanation of an AI Agent
8:53
What is AI Agent? | Simple Explanation of ...
codebasics
29,715 views
This Social Media AI System Creates Unique Content Daily! (100% Automated)
19:39
This Social Media AI System Creates Unique...
Helena Liu
724,664 views
Copyright © 2024. Made with ♥ in London by YTScribe.com