Transcription
By the end of this video, you are going to have the tools, knowledge, and confidence to build out fully autonomous AI agents by yourself. I'm going to take you from a complete beginner, somebody who knows absolutely nothing about AI agents, to an AI agent building pro.
The truth is, people have been taking advantage of this AI agent wave for the past six months now. I've had students in my community completely replace their nine-to-five work because they understand how to build AI agents. I've also had people create new businesses out of selling AI agents and AI systems to other businesses or other individuals. And let me tell you, the demand for these agents is super high right now, but the supply of agent builders is very low because people just haven't been properly taught on how to build them.
Chances are you may have even seen some videos on n8n and agent building where people are building out these complex workflows, but they're not really explaining it step by step and talking about why things are happening. That is why I am creating this full course. It doesn't matter whether you have zero technical experience or previous agent building skills, or whether you're a developer or not a developer. The beautiful thing about these tools is it's all non-code. So, if you understand how to use natural language and if you can follow along in a video, then by the end of it, you are going to be a successful agent builder. You're going to have the knowledge and confidence to build out these systems.
And if you're wondering where I spend most of my time, I spend it in the AI Foundations community. I'm going to leave a link in the description and the top pinned comment for you to join this community. And I highly recommend this. This will excel your growth by 5 to 10x because what this group does is it aggregates everybody's knowledge from different industries. And everyone's in here building agents. Everyone's in here selling agents. People in here are making real money and seeing real results. So, if you want to ask those questions to people and you also want a classroom full of much more content than what you're going to see in this video, then I highly recommend joining because if you like my style of teaching, we have uh more courses and we have a lot more modules on building AI agents as well. We even have pre-built agents in here like things like YouTube Shorts agents, blogging agents, YouTube transcripts agents, deep research agents that you can just download and implement today.
So, I highly recommend checking this out after watching this course because the learning only gets even deeper in surrounding yourself with people who are selling these agents for thousands and thousands of dollars. Implementing them into their business. Getting on calls with these people, which we have a calendar with at least usually three calls a week. That's just going to dramatically put you ahead of anyone else. So, I highly recommend joining. I will leave this in the description and the top pinned comment if you want to check it out.
But with that being said, let's get into section one of the agent training. Welcome to the AI agents full course. I've specifically designed this video for YouTube. I haven't taken any material out of my premium course. I've created this to take a beginner to a pro. And if this is your first time watching this video, I recommend watching this on 1x speed. I recommend taking notes and not skipping anything because like I said, I've designed this video in specific for YouTube for free to help take you and give you everything you need to know to go out and build agents on your own. Zero fluff. I just want you to succeed. So, if you're watching this for the first time, I recommend watching it two or three times, but if you're watching this for the first time, don't skip around. Watch it on 1x speed and just pay attention and take notes. That way you can watch it once and be good forever. This is not going to be a quick fix video, but rather a video giving you all the knowledge that you need to successfully build AI agents. So let's go into section one, which is the basics.
Now, we need to start small. I am going to be building out multiple automations and agents in this video, but everything that is preceding that is going to be important for you to understand. I'm going to be going over terminology. I'm going to be going over tools and pretty much everything you need to know to get up to speed on why agents are important and how to build them. So, let's start with the basics and the most important thing, actually defining what is an AI agent. So, what are they? Well, agents are systems that can act autonomously and use tools to perform complex tasks. Now, in the case of agents, I'm going to define a complex task as a task that requires human reasoning. So, in other words, AI agents are good at replacing the need for a human to be in the loop. They're very dynamic and can adapt to different situations or edge cases. And that's what makes these things so powerful is they can adapt to unique situations. So you don't just like build it once for one unique situation and have it run. That would be considered an automation. Agents take in new information every time. It's a different scenario every single time, but you can get a good result if you can build them correctly.
So there are major differences between agents and automations. And I want to look at those differences and just give you a little scenario so that you can wrap your head around what is the difference between an agent and an automation, but how are they kind of similar as well? This is an important uh distinction to make. The difference between agents versus automations. So automations are predefined workflows that perform structured tasks. Something that happens the exact same every single time. You predefine this. You can build this in the same software that we're going to be using today. And automations are great because they're super consistent. But agents, on the other hand, are non-deterministic and can adapt to situations in real time. So you don't have to worry about a unique situation or something small being different because the agent can adapt very well. And you can think of agents like a human brain. When we are presented with a problem, our conscious mind is going to use our subconscious mind to find out, you know, how have we dealt with this problem in the past? What are some tools that I've used in the past? what are all of my resources I have available in order to make a decision about this problem or about the situation that I'm presented with? Um, that's kind of how an agent is acting. And actually, that's the way that we're trending uh for AGI is these reinforced self-learning feedback loops. But we're not getting there yet. Let's just think about an agent. So, like I said, when we're presented with a problem, the conscious will use the subconscious to determine how can we solve this problem and what tools do we need to get it done.
So, I want you to picture this in agents versus automations. Let's say you have a garden and you get sick of watering this garden by yourself. Maybe you set up a very simple self-watering automation. Now, your garden will get watered by itself at the same time each day. Let's say you just set a timer. You say, "At this time every single day, I want my garden to water itself." So, this is great because you now no longer have to go outside and water your garden. and you know that your garden is going to receive water every day. It takes you out of the equation, but there might be a few problems that you have to look out for. Maybe you get a bunch of rain. Well, your automation isn't going to know any better. It's going to keep producing the same amount of water as before, which could lead to overwatering your plants, and this could well damage your results if your plants are getting way too much water, right? your water automation where it's watering your plants. It doesn't know how much rain you're going to get in the future. It doesn't really know how much rain you got. It's just going to keep running at the same time every single day because it's predefined and you set it up like that. Uh or maybe you don't get enough rain. Again, your automation does not know any better. It will keep producing the exact same amount of water as before. And this could lead to underwatering your garden or it could cause your plants to die. Well, underwatering it would cause your plants to die. So, if you're going through a dry spell and you need to keep that soil nice and moist for these plants, then your water automation doesn't know any better. It's just producing the same amount of water as it would in normal conditions.
But now, I want you to imagine this. Imagine you have an AI agent baked into this water system. Instead of just setting up an automation where it runs at the same time every day, imagine the AI agent dynamically controls the water flow depending on current and future weather patterns. Imagine it can also take into account how tall your plants are, the zone in which you're growing your plants in, the soil moisture, the plant type, and then make decisions for when to water your plants based on all of these changing factors. That's kind of the difference between an AI agent and an AI automation or an automation in general. Your agent will be able to take in a bunch of dynamic factors and be able to make decisions based on your exact situation today. It can adapt to certain edge cases which in this case would lead to an epic garden that is very lush.
So agents and automations, they have their differences, but I will say automations are far more consistent, which can be good for certain situations. While on the other hand, AI agents can respond and act as a human by using its tools to determine what needs to be done. And this is the exact reason why AI agents are taking off right now. They are replacing humans in many day-to-day tasks. And not only are they doing a better job, but also they're working longer hours because these things don't get tired. They don't need sleep. They don't make mistakes if they're having a bad day, right? They don't have life factors weighing in on their decisions. They're machines that have human intelligence. So that's why they're taking off right now. And they're taking off for good reason. It's not like some flash in a pan. It's like, no, this is actually doing better than humans. So, you build them once and then you relax. And that's what we're going to learn how to do today is how to build not only automations because that's super important to learn before you build agents, but also how to build these AI agents.
So, let's take a look at the agent and automation data flow. That way, we can kind of see how information will be passed through agents and automations. And this is really going to help you understand what I am talking about today. So all automations and agents follow this similar framework. We have an input which I will be referring to as a trigger often like what begins this automation. You need something that wakes up the automation or the agent and says hey it's time to begin. That could be on a schedule. That could be when a certain news article is uploaded. That could be when you post on social media. Maybe you have a workflow that goes through and does content uh recycling for you. A trigger can really be anything but it's how is this automation going to begin and then we have configuration which is step number two and we call these actions as well. So this is where you're configuring the data from the input or you're taking data from the input or spawning in new data after the trigger happens. So actions are where uh the fun happens in the agent and automation workflows. But if we configure our actions well enough then we get a result or a good custom output and the custom output can be like a physical thing that you get like okay now I have new data in this database or it can be a feeling people get right so like because the actions took place after the input maybe you have happy customers so we're going to be diving into that but the difference between an automation and an agent happens in the configuration section so right here at the action stage. This right here is the difference between an agent and an automation and how the data is being configured. Because in an automation, it's going to be the same each and every time. But in the agent, it's going to dynamically decide how to configure an output based on the situation. So furthermore, it can even act on natural language instructions you give it without the use of tools. So based on the input, the AI agent decides which tool it's going to use. And it can use these tools that you give it or just instructions, right? It doesn't have to use tools, but that's what makes AI agent so powerful is it can use your Google calendar tool. It can use your email tool. It can use any tool that you give it. You can even set up a custom tool with an HTTP request, which we're going to get into in the future. But you're going to begin to understand this a lot more as we build throughout the video. Don't just like feel like you have to understand all of these terms right now, all of the setup. Uh this is just a basic understanding of how this is going to be working.
So next we need to understand real quick who are AI agents for. So AI agents are for everyone. And when I say everyone, I mean everyone. I have coached thousands of people in a paid community, the one that I shared with you earlier. And you know, I am amazed myself at how many different people are seeing the benefits of AI agents. When I started, I was like, okay, maybe just for online people, people who are in the tech industry. But as we started coaching more and more people, we started to see all walks of life benefiting from AI agents. So, if you want to become more efficient, if you want to save loads of time, if you want to create a new stream of income, if you want to save more of your income, then AI agents are for you. Like I said, I've personally trained marketing teams, salespeople, construction workers, data analysts, accountants, lawyers, CEOs, content creators, e-commerce leaders, consultants, and everyone under the sun. I've helped them find a use case for their line of work uh regarding AI agents. Everyone has a use case. So, if you're wondering like, "Do I have a use case for my life?" You do. And I promise. Uh, and by the end of this video, you're going to be flooded with ideas. So, uh, not only are people finding these use cases, but students of mine have went on to sell their AI agents for thousands of dollars. Somebody in the community actually sold an agent for uh, $59,000, an AI agent workflow. So, you can see how powerful these things are because money talks, right? When people are paying tens of thousands of dollars to have these built consistently in small little communities, then yeah, like it's a pretty big thing. Uh, furthermore, we've helped bigger, more established businesses save thousands of dollars with AI agents as well. So, AI agents literally for everyone. If you want to save money, you want to save time, you want to make money, or you want to just become more efficient, then I recommend paying attention.
Let's dive into the next section of the basics, which is the agent building tool stack. We're going to keep it very simple and we're going to be using other tools throughout this, but like the main thing that you need to build AI agents are these two tools. And the second one can is interchangeable, but we're going to keep it simple. And just so we're all on the same page, these are the two tools that we're going to be using for this course. So, number one, we have n8n. tough to say. Uh, but this is the node tool that we are going to be using to build out our automations and agents. And the good news is is you can start for free. So, I'll leave an affiliate link down in the description. So, if you do end up purchasing a plan, I will receive a little bit of kickback. I would highly appreciate it if you use that link, but if not, don't worry about it. Go to n8n.io and you get a 14-day free trial. So, this is a perfect time to create your account if you haven't already. Next we have OpenAI and OpenAI are the creators of chat GPT. So we need to integrate AI into our automations and agents. And the way we do that is by giving it a large language model to use. So we can talk to it just as we would chat GBT. We can almost like create our own version of chat GBT with n8n that's very specialized at doing any task we want. If you wanted to think about it like that, you could also do this with Claude, Gemini, pretty much any model uh that's out there right now. And we can easily connect and use these models in n8n to supercharge how we are transforming our data. Now, usually for like an API key or for using these models outside of the physical platform, you're going to need about $5 to $10 to load in so that you can access these models because of the computational cost.
So now we've made it through section one. Congratulations. We are going to move on to section two where we're actually going to dive into uh the basics of n8n and so that we can learn more about our tool, go over the pricing and everything you're going to need to know in order to get started when it comes to building automations and agents. So, let's do that now. I hope that you're sticking with me, and I'm excited because we're one step closer to building out these automations and learning the in-depth techniques. So let's get into it. The basics of n8n. So first of all, what is n8n? Right. Well, this is the node tool that we are going to be using to build out our automations and agents. It will be the lynch pin for your agent building success. I've battle tested multiple platforms for building agents and n8n wins every time. Think of it like an interface where you can connect and integrate AI into 500 plus tools on the internet. And within each tool, you can take multiple different actions. So you can connect to the Google ecosystem, the entire Microsoft ecosystem, all of your favorite CRM tools, Airtable, Notion, Superbase, Slack, Stripe, email accounts, any AI model that you want. And it allows you to bring all of these tools and connect them together in a canvas like setting. So you could connect your Gmail to a Microsoft tool so that when one thing happens in your Gmail, it triggers another event to happen in Microsoft. So, it's just insane how you can connect all of your favorite tools and have them perform actions and you can link them to AI to have AI help you perform actions while you are sleeping.
So, let's get into a couple of things about n8n so we can actually like get off this presentation and start building agents. So, we're going to go over the pricing which could change depending on when this video is uh released, right? Usually the functionality is staying quite similar, but things like pricing and the user interface might change a little bit. But we're going to go over pricing. We're going to go over how to sign up and then we're going to dive into the interface in the settings. That way you are a master of navigating your way around n8n. Now, this step is very important to pay attention because if you want to be a master at what you do, you have to understand your tools best, right? If you're like a samurai ninja, you've got to understand the movement of the sword in and out. You have to know your weapon if you want to be a master of it. So, that's what we're going to do. We're going to learn how to navigate around the workspace. We're going to learn about the pricing, how to sign up, and these things that you need for your foundation of building agents and automations on this platform. All right, so first, let's go over n8n's pricing. So, if you're on n8n.io, io. You could head up to the pricing tab if you want to follow along, but I'm going to go over it. Now, we have three plans here. We have starter, pro, and enterprise. If you want to switch this tab to monthly, you can see that starter plan is going to begin at $24 per month. The pro plan will begin at $60 per month. And if you go annually, you do get a little bit of a discount. On my main account, I do believe I am on the pro plan, uh the pro annual plan. So, I do get everything in the starter plan plus all
Of this, but the starter plan is pretty good for getting started, for sure. Uh, you can even begin for free, like I said, on a 14-day free trial. So, all of this stuff isn't really going to matter right now until you actually get logged in and see what I'm talking about. But, this is where the pricing starts. And obviously, we have enterprise.
But the cool thing about NADN is if you want to get a little bit more into the technical side of things, there is a free local version that you can run on your computer. So you can download this to your computer, essentially, and you can use it for free because NADN is an open-source product. So anytime they roll out an update, they also make it open source, and you can update it from your terminal and do all of that. But that allows you to use it for completely free, but it does make setup a lot more difficult. And there is definitely a, uh, skill window that you have to be a part of. Like it takes some time getting used to and learning. So I always teach on the cloud. If you want to go the self-hosted route and you're a more technical person, I highly recommend it because you get to use it for free and it's local so you have a little bit more control of your data. But with that being said, I'm going to be teaching on the cloud since it's the easiest way to get started.
So, in the upper right-hand corner, you can hit "Get Started." And this is going to take you to a screen where you can basically just create an account like any other app. So, I'll type in my name, and then I can type in a test email. I can confirm that email address, and then I can give this a little bit of a password. And then you can give yourself an account name. So, I could just name this like "a test" and see if it's available. And then what you can do is you can hit "Start 14-day free trial" in order to begin that process. But keep in mind, once you hit "Start 14-day free trial," your free trial will begin. So you want to make sure that you get the most in these 14 days to see if it's something you want to continue.
Now, as you can see, it says "Looking to self-host." And you can get the community edition by self-hosting NADN on your own local machine, which you can use for free. So, you can open the installation docs and you can go check out and see if this is something for you and something to see if you'd be able to set it up. They have installation guides here that are pretty good and pretty straightforward, but it does take a little bit more technical experience. For now, I'm going to hit "Start 14-day free trial," and then we are going to go around the dashboard so I can show you around there. All right, you can fill out the survey real quick.
And now, as you can see, it says "Your workspace is ready." So, I can just jump in and hit "Start automating." And then it's going to load and take us to our workspace. So, as you can see, we have a nice clean slate. It might look like a lot at first, but don't worry, I'm going to break everything down. And what we can actually do is we can start in the upper left-hand corner. So, as you can see in the upper left-hand corner of our sidebar, which you can collapse and expand, we have a plus button. This plus button is going to allow us to create new things in our workspace. So if I click plus, we can create new workflows, we can create new credentials, and we can create a new project.
Now workflows are things that hold your automations and your agent. So every new workflow is a new automation or a new agent. So if I click "New Workflow" and I can create that in my personal folder right now. If I hit "Personal" and create a new workflow, it's going to take me to a completely open canvas where I can then build out my agents. I can add my first step, I can connect to all of these tools over on the right. If I go to "onApp event," as you can see, I have all of these applications I can connect to right out of the gate. And this would be a workflow. Okay, so workflows lie within your folders and your projects. So, I'm just going to go to this overview section again. And this is basically like your homepage. It holds all of your workflows and projects. I can click this plus button again. And credentials we're going to get into in the future, so I'll skip over that right now.
But projects, what you can do is you can add projects for, well, different projects you're working on. So I'll hit "New Project." And for this project, what I'll do is I'll name this project "Full Agents Guide" just so I can put all of my tutorial workflows and automations in here. I could give it an icon name. You could even name this like "Test Project," but you only get so many of these projects. So, I recommend making sure that you want to keep this project going or making sure it's named something pretty general if you want to add a lot of automations here. So I'll do "AI Agents Full Guide" with that little A icon. And from there, our project has been created. So now in this project section, I can house folders. I can house workflows. And that's how everything is pretty much organized. You have projects, folders, and then workflows. So I could create a folder real quick. So maybe I want to create a folder and just call it like "Section One: The Basics" and then hit "Create." Now I can click into this folder and I can create a workflow within the folder. So I could create an automation in this folder or an agent in this folder. I recommend organizing this pretty good from the beginning because, uh, it can get very messy, and I have to spend now probably hours cleaning my original workspace because I didn't organize this in the beginning. I got a little too ahead of myself. So, this is the project and this is our folder. You can even create folders within folders within folders, however you want to organize it. But that's essentially the basics of organization in the NADN interface. And you can go to your overview and see all of the workflows that you've created. Right now, we have no workflows created, so we don't have anything to see. But if I were to go in here and create a workflow not in this folder, and just—I could rename it in the upper left-hand corner, something like "Workflow One." And once I save it, when I go to the overview section, you can now see that I have "Workflow One." And also within the "Full Agents Guide" project, I can also click, hold, and drag the workflows into other folders. So now it's in the "Basics" folder. I could create another folder like I said. And yeah, that's the basics of organization.
Now over in the bottom left-hand corner here, you're going to see a couple of different things. You have the admin panel. This is where you go to update your NADN workspace, which you have to manually do. Um, we have the template section where you can go browse pre-made, uh, templates, agents, and automations. So, as you can see, they have a bunch of pre-made workflows in here that you can click. You can search for one if you want. Maybe you want like a Gmail automation. You can go check out what everyone in the community has been creating. And some of these are paid, some of these are free, but there are some pretty cool automations to get you started in there. Next, we have variables, insights, help, and we also have settings within our interface. This is different from the admin panel. So, I can click into settings here, and here you can change your name, you can change your email, you can enable 2FA, you can add users to your workspace over here on the left. So, if you're working with a team, you can do it like that. You have external secrets which is only available on the enterprise plan. Environments also enterprise, and then all of the rest are also just enterprise features that we will not be covering in today's video.
Now what you can do is just like me, you can create a new workflow. This doesn't have to be within any project if you don't want it to be, but I just want to show you around the canvas so you can feel comfortable with adding something NADN calls nodes. And nodes are what allow you to actually build automations and agents. So if I select "Workflow One" right here, what you're going to notice is we get this canvas. I can collapse the sidebar here. And right off the bat, they give you something that says "Add first step." We can select that plus button. And now all of these things come up and it says what triggers this workflow. So remember like I said in the beginning when we were talking about the flow of data in an automation or an agent, we always had a trigger, something that started the workflow or an input, something that said, "Hey agent/automation, wake up. It's time to run." Well, that's what we need to add first. And these are all called nodes within, uh, this section here. All these little rectangles, circles, and squares that you're going to see on the canvas, we are calling those nodes. So, we need to master the nodes of NADN. I can hit "Add first step," and let's add our first node. I can do a "Trigger manually" node. You can click on that. And now, whatever's after this, we're going to be able to connect a bunch of different apps and a bunch of different tools. We can connect AI to this thing. We can have it do specific things. We can run certain props. So much we can do. But when I hit "Execute workflow," since we added a trigger manually, this is going to run the workflow. Beautiful. So now whatever's after this would have begun.
Now nodes are great. There's so many different things you can do with these little boxes on this open canvas that can make you a lot of money, save you a lot of time, and overall just make your life so much more efficient. So we need to learn these things inside and out. First, what I'm going to do is I'm going to show you how to rename these. So, as you can see, it gives you kind of a sloppy name. So, you can right-click this and actually rename this. Or what you can do is select a node and hit spacebar. And then you can just quickly rename it. So, I can just name this like "Manual Trigger" and then hit "Rename." And beautiful, we now have our first node on the canvas. But let's learn about nodes a little bit more in depth. Since they are what make up the entire automation and the entire agent and literally the entire workflow, we need to master these things. So, let's do an in-depth study on them. So, that takes us to section three of this full course, which is the nodes section. And this section, do not skip it. I'm telling you right now, this is going to be important. The terminology that I'm going to lay forward, literally everything in here is crucial for your success.
So what are nodes? Well, nodes are what you build your automations with. Each node will perform a new action on your canvas in N8N. Nodes can be applications, functions, tools, and more. And in order to master these nodes, we can look at the five node types of NADN. As you can see, we have a nice workflow down here. Uh, this is actually my deep research workflow. So you can get a lot of these nodes on the canvas in order to perform actions one right after the other. And you can do things like loops. You can add in AI, give them tools to use in the agent section. There's so many different things we can do. Uh, don't get overwhelmed. We're going to take it step by step so you can become a master and start building out sweet automations like these that save you hours per day. So let's take a look at those five node types. And I like just breaking them down into categories. The first category is the triggers category. These are nodes that begin your automations. So we refer to these as triggers or inputs. And this is where, when, and how does your agentic framework begin. An agentic framework or an automation always will need a trigger or, in other words, something that begins the automation and tells it to start. This can be a schedule. This can be a manual trigger like the one we added in last step. This could be a web hook. This could be when something happens in your Gmail or in one of your databases. When a new lead enters your CRM, when a new YouTube video gets published from your favorite creator, a new news article, anything that could trigger a workflow is called a trigger node.
Category number two is actions. So action nodes do something in an app or service. Think about it like Google Sheets, Air Table, Notion, WhatsApp, Telegram. Actions perform actions in applications. So if you want to create a new row in Google Sheets, that would—you could actually put in an action node for that node. Category number three, utility nodes. These transform your data with filters, if statements, and data conversion tools. And don't worry if this seems confusing right now. I'm going to show you all of these tools, uh, categorized out in an NADN canvas that I created. And so the utility nodes are tools you can use that are native to NADN. And these things help you organize, modify, or send your data, uh, elsewhere within your canvas to another application. It kind of like prepares your data. Then we have code nodes. So even though we're using a no-code tool, it's kind of interesting because you have the option to run code in the no-code canvas, which is very powerful once you understand how to use it. We're even going to be diving into that in this full course. So with the code nodes, you can run code, make HTTP requests, set web hooks, run JavaScript, and more. And this will take your agents to the next level and your automations to the next level. Category number five is the advanced AI category. And this is what makes your agent autonomous. You can add AI to your workflows, start large language model chains, perform sentiment analysis, and much more. So these are the five node categories that I want you to kind of memorize and start wrapping your head around. So how about we go more in depth on all of these five node categories and I actually show you examples of these nodes within NADN so you can start to familiarize yourself with how they look, the names of them, what they do.
All right. So, I've broken it down into the categories here, uh, in order to explain visually what these nodes are actually looking like, and I will combine some together to show you also what they are doing. So, right here we have trigger nodes. These are ways that you can start your NADN automation. So, you can start it manually. I already showed you that one. You can start your automations with a form. You could start your automations on a Telegram message, for instance. And these are just like nine ways you can start automations, but there are hundreds of different ways you can start automations. I'm just trying to give you a good variety of different ways that you can begin your automations. Same with these action nodes and everything that follows. There are many more nodes. I'm just showing you a very small section of what is out there. So you could start your automation on a schedule. So you can come in here and you could say like "days." Maybe you want your automation to run every day at 9:00 a.m., right? Well, now that we have this configured, if we connect a node to the other side of the schedule, for instance, if we connect a Gmail node, maybe a "Send a message" Gmail node to the schedule, then every day at 9:00 a.m., if we activate this workflow, this automation will run and it will trigger this "Send a message," and we can have our own subject line. We can send it to anybody we want. We can send a custom message. You can send emails to yourself. Just an example showing you how this would run every day at 9 and actually perform any action you want afterwards. So "Schedule" node is very useful and we can use that for many different situations. Really automates things at a very specific time. We have a web hook node. We have, uh, another trigger node which you can, uh, set up so that when you get a new Gmail or a new email in general, then it will begin the workflow using the details of that email. It's one of my favorites. I love that you can set up the automation to begin when NADN receives a chat. So, they have this native chat feature. I could type in a message right here in a message, and this message would then get passed throughout my workflow, which I'm going to be showing you how the data connects and all of that in future steps. But this would begin an automation. So if I send that off, as you can see that just began an automation. If we had things connected to the back half of this chat message, it would have started that process. So for now, I'm going to hide that chat. And there's many other triggers. Like I said, you can have a workflow be called by another workflow. You could have things happen in your relational database tools like Air Table, Notion that begin your workflow and that would work out perfect. So, this is a general rundown of trigger nodes.
Next, let's get into action nodes, and I'm going to kind of speed up here, uh, because you're going to understand the point, right? These are nodes that perform actions in external applications that you can connect. So, I gave you three examples here: Gmail, Air Table, and Google Sheets. But like I said in the beginning of this video, there are over 500 different applications you can connect to. So if you have a tool in mind that you want to run some automations in, chances are it's in here. And if it's not, you can use a node called an HTTP request to connect to that tool if it has an API to connect to. But not only can you connect to these tools, but you can also perform multiple different actions within each one. So, as you can see, this little gray text beneath all of the nodes here, those are actually the actions that we're performing. So, if you want to get a message, you can do that in Gmail. If you want to send a message, you can do that. You can double-click into these nodes and even run certain operations. So, the operations are like the actions that you can take. So, as you can see, look at how many different actions we can take within the Gmail tool alone. So I could reply, send, send and wait for a response, remove a label, mark as unread, mark as read, delete, get, and that's just on the message, right? If I go to threads, we have even more operations that we can run on that specific resource. So it's some pretty cool stuff. Uh, we're going to get into setting all of that up in the future, but that was just the Gmail. Like I said, Air Table has a bunch of different actions that you can take, similar to Google Sheets, which has certain actions you can take, uh, depending on what you're trying to do here. So, you can do quite a bit of things. And action nodes are what really bring your automation to life and allow you to perform actions in all of those external applications that you do want to connect.
Next up, we have utility nodes. And utility nodes are nodes that are native to NADN that help you transform data. So, I'm not really going to take the time to explain each and every one of these because they're kind of dependent upon the use case. And we're going to be using a lot of these today, but these are nodes that help you move data around, convert data, filter data, limit data, switch data, so that if you have a field that you want to filter by, you could have four, five, 30 different automation routes if you wanted to. It's a beautiful thing. It allows you to just manipulate the data that is within your workflow very well. And these are utility nodes. Next up, we have code nodes like I was talking to you about in the presentation where you can run code in NADN. You can use an HTTP request in order to get information, post information, and, uh, use any URL pretty much in order to bring data into NADN. We also have web hooks. Then we have the fun nodes. So those were the code nodes. These help you send requests, use code, and add extra customization. While the agent nodes, these things are what integrate AI into your automation. So, I just showed
You two, the sentiment analysis node and the barebones AI agent node, which allow you to give it custom instructions, give it a prompt, require a specific output, and you can connect models to these things. So, as you can see, I connected GPT-40. I can click into here and use any model that OpenAI has because I've connected my API key. And so I could even use like 03 Pro in here, 01 mini. I could do whatever I'd like. And this sentiment analysis one is cool. I wanted to add this in here because what this can do is this can take in a message or text to analyze and determine whether the sentiment of that text is positive, neutral, or negative. And depending on which one it is, you could have three different automations running based on what the sentiment of that text is.
So this was a very quick overview of all of the node types within NAND. And it's really good to make yourself familiar with each one of these because we're going to be using each one in today's video. Now, the best learning genuinely comes from just using it yourself and building yourself. So like I can give you all the information in words and text, but the biggest gains will be made when we actually dive in and start building these automations and agents. And that is exactly why I'm so excited to move on to section number four where we are going to be building out our first automation in NAND.
So finally, we are getting into building out these automations. We're going to start by building automations because it's fundamental. Like you need to understand how to build an automation. Like you need to walk before you can run, and you even need to crawl before you can walk. So like we were kind of learning the crawling stages of agents and automations. Now it's time to learn how to walk. And that's building out automations. Understanding how nodes connect in this open canvas-like setting is going to be crucial.
So, before we get into building automations, I've got a couple of things that I want to go over because usually there's a couple of different types of people when it comes to uh who wants to build an automation. So, I want to go over what that means for everyone. So, let's start off with some automation building tips before we hop into the granular activities of connecting nodes together and actually building out an automation.
So, the best automations are built when you know how to solve the problem without the automation, right? It's something that you've been doing for years that you wish you could automate or that you wish you could speed up because you know it inside out. That's why we always recommend to scale vertically at AI Foundations. Meaning use automations to complement your current work experience, your strengths, or your passions, something that you're very passionate about. For example, we've had members in our community who have worked construction their entire life. So, when it comes to building automations for construction companies, they will know it best because they've gone through all the problems of not having it automated. They understand the jobs in and out. They understand what it's like to quote a construction project, quote a deck, quote a, I don't know, a painting job. Like, they they understand everything when it comes to construction. So, having previous experience in what you're about to automate helps dramatically.
But here's the deal. Even if you don't have experience in a specific vertical, there is someone else that does and that will need automations. And so you can fill that gap. And this is really where the two paths intersect. There are many of you watching this video right now who want to learn automations so you can automate what you're doing day-to-day, speed up existing workflows, or maybe even create a new system or product in the market in which you currently reside. We will call this group one. And that's perfect. This tutorial is going to get you there. If you've made it this far, I know you're committed, so keep on chipping away.
Now, there's another group of you who are looking to build automations so you can start new businesses around selling automations and agents to other people. This is going to be called group two in this scenario. So, group one, you're good. Keep on watching this video. You're chugging along perfectly. Group two, pay attention because this is very important. And this is group two's biggest mistake. The people that want to build a business out of selling agents and automation usually fall for this trap. And I've seen it happen way too many times. So, a lot of people in group two after watching a video like this will go out and build an automation for something they think is helpful or an agent for something they think is helpful. The truth is, if you aren't building vertically and leaning into your passion and previous experience, then you don't know what's truly helpful. First, you must discover problems for existing businesses because business equals solving problems. At the end of the day, automations and agents equal your tool for solving those problems. So, if you don't know what problem you're solving and you think you have a good idea, before you're going and trying to build out these huge solutions for something you think will be good, discover if it's even a problem in the first place. Don't build to sell when you don't know if what you build will sell. Okay? I just wanted to give you some of that advice because I've seen the mistake happen to many new automation agency or agent agency type people.
So finally, let's build our first automation together. Now that we have that preliminary stuff out of the way, we're going to be using a mix of nodes in order to accomplish this. And the best way to build something is to lay out the project and describe it in your own words. So for automation build number one, finally we're getting into it. We are going to be doing a lead form automation. And so if I wanted to describe this to somebody in my own words and tell somebody exactly what I want this automation to do, how might I describe it? Well, that's what I put beneath lead form automation right here. I say, I want this automation to take in form requests from my project's lead form and then send me an email notification letting me know that I got a new lead. I wanted to properly label the emails depending on what the project budget is. For example, if they pick the highest project budget, I want the automation to label that new lead in my email as high budget. On the other hand, if they select a lower budget, I want that automation to label that new lead in my email as low budget. So, let's jump into NAND and let's build out this lead form automation that will send us emails whenever the form is filled out and it will label them for us. This is a very simple automation that I've been helping people implement under the hood years back, right? Just simply organizing new leads by labeling them.
So, what we can do now is finally jump into NAND. And what I want you to do is I want you to first create a project folder. And just so we can stay organized, I'm going to open up my full agents guide project. You could name this project anything you'd like. And remember, you only have a certain amount of projects. Like on the free plan, you can only create one project, which is kind of limiting. So, you know, you can't really have much organization on the project level, but you can get creative with your folders. So, I'm going to select full agents guide. And then I'm going to create a new folder outside of section one, the basics. I'll actually delete that folder. And um I'll archive all workflows. And what I want to do is I want to create a new folder. So in the upper right-hand corner, I'm going to hit this dropdown and then hit create folder and then I can just name this. Right now I'll just name this automations. I'll hit create. Then I can click within this folder just so we can stay organized. And then I will hit create workflow. This is entirely up to you. I'm just trying to organize our automations, our agents throughout this tutorial. So I'm going to hit create workflow now. And now we can begin the automation process. Remember we can use our lead form automation in our own words as our guide.
So first we want it to take in form requests. So lucky for us we have a form field that we can use to begin this automation in NAND. But before we begin and before we do anything I want to rename this. So I'm going to rename it up here where it says my workflow and I'm going to rename it to lead form automation. Okay. You can even add tags to this like I was saying earlier. So I could add a tag maybe for what business is this for. Maybe this is for AI Foundations. I'll create that tag. And now it's nice and labeled. You can filter by these when you're in your project folder as well. And it helps keep things nice and clean.
So for the first step, what I want you to do is I want you to add a form. It's probably one of the easiest ways that you can pull in multiple fields to NAND and begin practicing building out automation. So I'm going to select add first step and then in the upper right-hand corner right here I'm going to type in form or you can select on form submission and this is going to generate a form in NAND allow you to create a form and then create responses for that form. So I'm going to type in form and where it says NAND form I'm going to select that and then where it says trigger I want to select on new NAND form event. This is again a trigger node. That little lightning bolt means it's what's going to begin our automation. We need to begin our automation with something other than like an action, right? We need something that says, "Let's go. It's time to run." So, I'm going to select that. And what you're going to notice is we have this popup here. I'm going to click out of this popup or in the upper left-hand corner, I can hit back to canvas. And now we are on the main screen. Perfect.
So now we need to configure this form so that when we hit execute workflow, as you can see, it's going to take us to a window. And this window is going to have all of our form fields on it that we can fill out. And whatever we fill out here is going to be the information that gets passed through to the next node. So we need to configure that form. For now, I'm just going to hit this stop button, and then I'll save this automation in the upper right-hand corner. So let's configure this form. I'm going to double click into here. And then I can give this form a title. And we don't have to worry about the form URLs right now. You can even just close that. We'll get into that a little bit later. Now, I want to give this form a title. Maybe I want to name it lead form. Then I can give this form a description. You don't have to be too specific right now, but I can just say form for new leads for my automation agency. Let's say I have an automation agency and I want this form to take in new leads for specific projects. Form description doesn't matter. Form title doesn't matter. That's just for you to see.
So, next we need to add form elements. And this is where we can start adding things like if we want people to fill out their name, their project budget. We can add drop-down lists, number fields, text fields, just like you'd create on like a Google form. It's not rocket science. So, I'm going to add a form element. And for field name, what I can do is I can just have this be um full name. So, maybe we want to pick up people's full name. element type. I want to select text since that's all we're going to need. We're not going to need a text area since it's just a single line of text. People's names don't take down multiple rows. So, I can just make that a text field. You could even put a placeholder in here if you want to give people an example of what your name would be. You can decide whether you want to make it required or not. And the form won't be able to be submitted unless that field gets filled out. I can add another form element. I can make this one a text area because I'm going to have it say, "What project do you want automated?" Or maybe I just say, "What do you want automated?" Maybe I'm like an everything agency. I just allow people to automate anything when they come through me, right? So, what do you want automated? I can make this a text area. And I recommend you follow along and just do these form fields with me so you can get a feel for NAND. This all is going to have a meaning. So for this I can put like um describe your project goal here and they will understand that this is where they type in their project goal. I could make that required and then I can add another form element maybe like what is your time frame and then for element type instead of text what you can also do is a drop-down list and then you provide the options for them to select. So like 1 to 3 months. I could add a field option for this drop-down list element type. Maybe it's 3 to 6 months or maybe it's 6 to 8 months or 6 to 9 months. Let's keep it coordinated here. I can make this field required as well. And then I'll add one more form element to complete our uh lead form here. So, for this one, I'm going to add what's your project budget? And this is what I want to filter my emails by. So, I can do another drop-down list. And maybe I have my lowest package at a 99.97. So, like 99.97 to 2997, something like that. Maybe I have another option that is 2997 to 4997. And then maybe I have a bigger package that is 4997. I just am doing the 997s like crazy here. But to let's just say 9997. All right. I it's unnecessary doing all the 999s and the sevens. But you know classic pricing model. So I'll make that one a required as well. And so now the cool thing about this form and NAND is when I hit execute step it's going to pull up these form fields here. So, I'm going to click out of here and save this. You can also save by hitting command S on your keyboard or control S if you are on Windows. So, I'm going to save that. And make sure that you're saving frequently because if you X out of this and you come back, don't expect your stuff to be there. It won't be there.
So, now let's click on this node and hit spacebar so we can rename it. And what we can rename it to is just like a lead form uh for agency. And I'll hit rename. Beautiful. Now, when I hit execute workflow, it's going to take me to this new window where I can fill out all of this information. So, I'll do that real quick. I'll fill out all of this information. My project spelling it wrong. I'll do 3 to 6 months. And we'll do the second option. And when I hit submit, what I want you to notice is in the NAND automation, we have now one item since we executed that once. So, when I click into here, you're going to be able to see all of my form fields over here. So, if I go to schema, you can see my full name, my what do I want automated, my time frame, my project budget, my submitted at, which is pretty cool, and also the form mode. Since we were using the test URL, it comes back as test. So, we now have all of these fields that we can work with and pull into other nodes. So, it's amazing what you can do because not only can you use your utility nodes and can you format data like if three to six months then go this way, if six to nine months go this way, if project budgets high, you can do all sorts of different things. So, that's what we're going to get into. But that's why I like this form field here is because you can really start to see how data is getting processed in NAND.
So, the next thing that I want to show you is going to be a very crucial step in understanding how NAND truly works. So, what I'm going to do is I'm going to hit this plus button. And I recommend that you be following along while I'm doing this. I'm going to hit this plus button right here. And then I'm going to type in switch. Okay? Because what I want to happen is I want this automation to take a different route depending on the budget. Remember, my goal for this automation was to label emails depending on what the project budget is. So, in that form that we just created, we have how many project budgets? Three different project budgets. So, I want to create three different emails for each project budget and have a label for each email. So, what we can do is we can add that switch node. So, I'm going to hit that plus button, type in switch, and this is going to allow us to change the direction of the automation. So, I'm going to hit switch. And now we get this screen right here. And this screen is important, and we need to touch on this before we move forward. As you can see, we have switch. And we only have one field right now. The switch node is very cool. It's a utility node because you can add a routing rule, add another routing rule, you can rename the outputs of those routing rules, which I'm going to break this down for you, but you could have like route one, you could have route two. I just want to show you what this looks like. You could have route three. And then when you click out, as you can see, you can take three different routes depending on if this value, which could be any one of these, matches a value of your choice. So it will take route one if value one is equal to value two. And you get to set what those rules are. So we're going to come back to that. But what I want to point your attention to is this screen right here. Because when you're within any node in NAND, you have these three sections always. Unless you're in like a trigger input node, then you only have like two sections, right? You only have the middle and the output. But what I want you to notice is in the upper left-hand corner we have input. Okay? So the left side of the screen this black box right here is your input. This is the information coming in from the previous node in NAND. So this information is going from the form to the switch node and that would be considered our input. So this is information that we can now work with and I'm going to show you how we can do that using these fixed fields and expressions. So the next section that you need to pay attention to is the node in which you currently reside. So since I double-clicked into the switch node, the switch node is going to be the exact node that we're configuring. So you have an input configure section in the middle, right? input left, configure in the middle, and then your output on the right. And we saw what the output looked like in this form field. As you can see, the output is the result of that node running. So the form ran there was no previous information to work with. So this is the beginning. So all we have is a configure section in the middle and we are configuring the form. And once that step executes successfully, we get hopefully a green check mark and not a red X, right? But we have a nice green output and it ran successfully and this is the information. This is the result of the information going through this configure section on the form node. Similarly, we have the switch node which also has a configure section and an output which we don't have yet, right? We don't have an output because we haven't configured this node. So that's what we're going to do now. But that was a very important piece of the puzzle in NAND because every time you double click into a node, you're going to have the setup of input, node configuration, and output. Okay, node configuration being in the middle. So now let's do this switch. And what I'm going to do is I'm going to delete these values and start fresh so that you can understand this. So for mode, we're going to leave it on rules. If you want to get advanced and have uh very crazy conditional logic and change things based on expressions and going crazy with the code, you can use expression. But the
The switch node is very powerful, just using its basic mode of rules. It's going to allow you to change the direction. Again, I recommend you follow along with me here.
So for the switch node, what I'm going to do is I'm going to double-click in here. And the goal of this switch node needs to be routing based on budget. So if that's the value that I want to compare to, then I need to map it to value one. So in order to do that, what I can do is, over on the lefthand side, if I want to route based on budget, then over on the lefthand side, what I'm going to need to do is drag and drop that to the configure section. That's the beautiful thing about n8n; it allows you to grab a hold of these fields on the lefthand input side and drag them to the configure section.
So, I'm going to drag "what's your project budget" into value one. And as you can see, it pulls up this crazy-looking, uh, value here. And that's because it changed it to an expression. So, that means this is going to be a dynamic value. Since the project budget will always be changing from lead form to lead form, it's great that we have the ability to put in these values here. So if value one, "what's your project budget," equals this, then medium budget, right? Since this is our medium option, I can rename that route. I'm going to show you what that looks like. But the difference between a fixed variable and an expressed variable or a dynamic variable is that the one in these curly braces here, where it says JSON, just means you mapped the field. And this value will change based on what the input over here says. So we have our field name of "what's your project budget." And the only way I got this, guys, was by simply clicking, dragging, and dropping it right there. I didn't even have to change this to an expression. If I change it to fixed, as you can see, it will always look like this. Or I could have it be a fixed value of anything, right? But we want to compare "what's your project budget" to the result.
So that's what we're going to put in value two is the result. And I'm going to show you what this looks like coming to life. So for "what's your project budget," I'm going to drag that in here. And then I will do value two in a minute. But first, I just want to get all three of our options out on the floor. So I'm going to rename this output. And I'll name this low budget. And then I'm going to add a routing rule. I'm going to drag and drop that same thing because remember we have three different options that it could be. So, we're always going to be pulling from the same field, but the result will change. So, if these don't match, then it won't go down that route. I'm going to rename this output two to medium budget. And then I'm going to add another routing rule. And again, same thing. I'm going to drag and drop "what's your project budget" on value one. And then I'm going to rename that to high budget.
So, hopefully you're following along and you have all of this ready. Now what we need to go do is find the low budget and make it fixed down here so that no matter what, if this field matches the low budget, then it will go down the low budget route. So what we can do is we can click into our form actually to make sure that we get the exact budget in here. And even if you have a space, that's going to be a problem because that's considered a character. As you can see, we have that blue line right there, which means the space is a character. That's where you have to be careful. So, I'm going to actually backspace and ensure that there are no spaces in here. And then what I can do is I can just copy this by right-clicking and hitting copy or hitting control or command C. And then I can go map it to the switch field in value one. So in the first routing rule for low budget, where it says value two, I can just paste that. So, if this is equal to this, then low budget, right?
So, now you can probably guess what we're going to do for medium and high budget. I'm going to click out of there, go to the form field, and then just go copy and paste the exact thing right here. Remember, we don't want any spaces. So, if you're clicking and dragging behind it, and you see blue characters, make sure that you delete it. I'm going to click, drag, copy. And this is going to be our medium budget option. So I'm going to go down here, and for the medium budget route, we want it to ensure that this value matches this value. So in this case, as you can see, this value would match our medium budget right here. So it would take this route. Same thing with the high budget. I'm going to click off and I'm going to go on to that last option and copy that. And then I'm going to go into the switch and paste it in the last output for high budget. Beautiful. So now we have all of our conditions set up within this switch node, and our automation is going to begin working for us.
So now that we have data in here, what I can actually do is I can test this step. Since we have input over here, when you're in your node, if you have an input data over on the lefthand side, what you can do is you can execute just this node since there's already data that you're working with over here. And it will show you which route it actually took. So, I'll execute this step. And as you can see, low budget, no; medium budget, nothing; and high budget, nothing. So, I did forget with a form field, you can't necessarily just execute that because no fields or items will exist. So, we're going to have to test this from the top. That was my mistake. But what we can do is we can hit execute workflow and give this a full test. So, this is going to be waiting. The switch node's waiting for me to submit the form. And maybe what I'll do is I'll just make this a smaller window so we can watch everything come to life here. So, we can really play with it. Now, what do we want? Do we want it to be on the low budget, the medium budget, or the high budget? It's waiting for me to fill out my response. So, you could have this automated, and you could embed this form on like a website or something, but I'll just put in my name again. I'll put in project details right there. I'll select my time frame, and then for my project budget, let's say we want to take it down the low budget route. I'll select that low budget and then I'll hit submit. And as you can see now, if we zoom in here, I'm going to X out of that lead form. If we zoom in, we have one item under low budget, but medium budget and high budget are empty. We can see that even closer if we actually double-click into this node. As you can see, we have these three options up here for outputs. We don't have any output data in the medium budget branch, zero output data in the high budget branch. But if we go to that low budget item, it passes all of that previous data from the lead form through to the next part of the automation. So we can now use this data to do different things if it's a low-budget option, right? Or if it's a low-budget client. And if you wanted to, you could go through and test the medium budget route, the high budget route, and so on. But what I'm going to do right now is just keep on building out our lead form automation.
So I hope you understand the switch node. Now it was your first time using a utility node because now you can have your automation change three different times depending on which budget is selected. So what I can do now is I can just add an action node. So so far we've used a trigger node, we've used a utility node, but now it's time to dive into the action nodes, right? And for this one, we're just going to be using Gmail. What I recommend doing is getting a test email that you can use. I just created a new, completely new email account, and I made it, uh, just for n8n. So I can like send test emails to it, and I don't have to worry about it, right? I don't have to like worry about messing with data in my own email if I'm just practicing.
So what I can do now is I can hit this plus button on low budget. I can do the same for medium and the same for high. But first, we're just going to do the low budget route. So I'm going to hit that plus button. And what that's going to do is pull up this window. Next, we can add an action in an app, or we can just type in Gmail, and that'll take us straight to that action. So, I'm going to select Gmail. And what I want to do is I want to send a message, and I want to send that message to myself. Nice low-risk automation that you could run. Maybe you want to get notified whenever you get a new lead. So, I can do that by using this Gmail action node. Send a message. And when I click this again, we get our input, our configure, and our output, once we execute this Gmail node.
So next we have to set up a credential. So what are credentials? Well, credentials provide you a way to essentially log in to your accounts on n8n. So you can actually perform actions on those accounts and applications. They often provide you functionality to control or use certain features of the application that you're trying to connect within n8n, which is, you know, kind of the whole point. If you're trying to automate things, uh, you're going to need to use n8n to automate those things. So, you will need these for pretty much every external app or service that you connect. And some are more difficult to set up than others. Gmail is very simple. Lucky for us, I'll show you how that's done right now.
So, what you can do under credential to connect with is you can just hit this drop-down arrow and then select create new credential. And this is going to allow us to connect to our Gmail. So, when I do that, all we have to do is hit sign in with Google. And then you literally just sign into your Google account. So I'm going to leave that off screen, but it's literally a two-click, 10-second process. So it says connection successful. Account connected. And I'm not kidding you. It was a 10-second process. All you literally do is sign in with Google just like you would any other application. And that's why I like using Gmail for testing and for teaching because it's a very low barrier to entry. So you can name your credential so you remember it later down the line because if you're connecting to multiple different accounts, you're going to want to understand which one you're connecting to in your credential dropdown list. So I can just name this test account and then I can hit save. Now what I want you to notice is when I hit save and I close this, we now can select our test account credential. So, this is connected to the Gmail that you signed into, and you can now send emails from n8n, which is very cool because we can use all this data from previous nodes in our automation. So, if I wanted to, I could create a new credential and sign into a different account and use multiple Gmail accounts at the same time or email each other with them, right? But for now, I'm just going to hit test account. And then for resource, we don't really want a label yet. We don't really want a draft. We don't really want a thread; uh, we just want to click message because we want to send ourselves a message. So for operation, we can leave that on send because as you can see, we have a ton of different things that we could do here, but we just want to send ourselves a message, and then I can send this literally to myself. So I'll type in the email address that I'm actually connected to. You could send this to any one of your email addresses, but I'm just going to send it to myself, tested.io. And here is where you could get really custom because just like before we have expressions, right? So we have fixed variables and we have expressions when it comes to creating new fields or messages in n8n.
So for example, if you wanted to get custom, I could just have a fixed subject that says new automation lead or something, right? With like a little party emoji, right? We got a new automation lead. Woo. But what you could do is you could have a little bit of fun, right? You could actually use an expression and dynamically map certain fields so it's custom every time. So I could put new automation lead, and then in parenthesis, or I could just put like a colon, I could drop the full name of that lead, right? And so now it's going to look like this: New automation lead, Drake Srirach. And I could get rid of that space in the front. So I'll delete all that space. And now it just looks like this. Maybe I want one space. New automation lead. And this would change depending on, uh, who puts their name into the form. So that's just because I typed out Drake Srirach into the form, and this is the information that we're working with. But I could type out John Smith, Jane Doe, and this email subject line would be changing every single time based upon the name. So it's kind of a cool way that you can get dynamic with it by using the expression rather than a fixed variable. And I could still add in the emoji if we wanted that, right? So that's perfect. Maybe I'll even add it in the beginning so that we always can see the emoji no matter how long the lead name is. And now for email type, what I can do is instead of HTML, I can just do text. And then I can type out a message. I could set this up as a fixed message. But what we really want to do is make this automation useful. So what I'm going to do is make it an expression. And whenever you make it an expression, I always recommend opening up this pop-out window by hitting that little, uh, button in the bottom right-hand corner of the field that you're trying to edit once expression is selected. So I'll hit that. And now you have this big open canvas to work with. And right here is where you're typing in your email message. And this is showing you what it's going to look like. Since we're using an expression, we can throw in all of these dynamic fields. We can drag and drop all of these fields. So, this is what that would look like if I'm dragging those fields back to back together. And I don't have to know how to type this out. All I have to know is how to drag and drop those fields.
So, now I could craft my message using these fields. So, I could say, "Hey there, Drake. You got a new lead." I could even just like recreate the form in here. I could just say their name is. And the beauty of this is I could drag and drop their full name. And then I could put a period. So now this will change every time. I could make this even more custom. Here is the project they want built. And then I could drop in the project details. So I can drag and drop that form field, uh, the result of that form field right there. And so that will change every time. Maybe I even want to make this more consistent. I could do so just like that. Now I can say they want this project built in, and then I can put a colon, and then I can drag and drop the project time frame. And then same thing with the budget: their project budget is, and then I could drag and drop the project budget. Perfect. And then I could even put some information just for myself down here like they submitted this form at, and then I could drop the submitted at field that comes native to n8n. Perfect. So now we have this nice custom email that will get sent to me any time that I have a new lead. And remember if we go back to our automation in our own words, I want to label these as high budget, low budget, medium budget, depending on which route they go down. So remember, we are still in the low-budget route. So if I click out of here, we're just mapping this email to be in the low-budget route. So I could create completely custom messages depending on the budget, right? Or I could send it to a different person depending on the budget. I could do really whatever I wanted. So what I can do right now is hit save so we don't lose all of our hard work. And I can click into this Gmail node once again. And then what I want to do is I want to add an option down here. So I'm going to select add option. And what I'm going to do is I'm going to append n8n attribution. And I'm just going to turn that off so it doesn't say like sent with n8n, uh, at the bottom of the email. This makes it look a lot cleaner.
So what I could do right now is I could test out this entire workflow on the low-budget end. So let's do that. Let's test out this workflow. I'm going to hit execute workflow. Going to type in a new name, John Smith. I want personal health automation. Maybe my time frame is one to three months. And I just want to test out the low-budget route right now. So I'm going to select low budget. Then I'm going to hit submit. And when we go back here, as you can see, it already sent me that email in a matter of seconds. So let's go check that out. As you can see, I got my new automation lead from John Smith right here. So it says, "Hey there, Drake. You got a new lead. Their name is John Smith. Here's the project they want built. I want a personal health automation. They want this project built in 1 to 3 months, and here's the budget." So this is working, but right now our labels are not yet added. So this is going to be the same every time.
So the cool thing about n8n is you can actually copy and paste these nodes. So each and every time we're going to want that email sent regardless of what the budget is. So what I can do is I can just duplicate this node, and then I can add it to the medium budget. I can duplicate the node again, and I can add it to the high budget. Just like that. So now we have these three options for the lead form to go down. Is it a low budget, medium, or high budget option? And either one is going to send that exact same email message that we just got into our inbox. It really doesn't matter. But what it does matter is the way it's labeled. Right now we don't have a label. And the way we can label it in n8n is after the message is sent; what you're going to notice is within our node configuration, our input, configure, output, in the output, what you're left with is an ID and a thread ID. So the cool thing about this is we can use that ID in another node after this that actually labels the email. That's its only job, right? Is to take in email IDs and label them depending on the route they go. So this is where it gets kind of custom, right? This is where the route actually matters. What we can do is we can add a node. We'll just stick to the low budget option. We can add a node, and we're going to add another Gmail node. Going to select Gmail here, and then the very top message action is add label to message. So that's what we're going to do. We're going to select add label to message. And then just like we did before, we can add our test account. Our test account will already be in there. That's the cool thing about credentials is once you connect them on your n8n account, they're connected for good. So I can just select test account; resource, I want message, and it's not label because we're not creating a new label. We're adding a label to a message. So when you select resource message, the operation can be add label. And so here you're going to see message ID. Well, just like before, that message ID is going to be changing every time. So,
We're going to want an expression. If we just like mapped in a fixed uh message ID, then it's going to change the label of this email only, since this email has a unique ID, right? So, that means anytime the automation would run, it would only relabel this email. So, we want it to be dynamic. We don't want a fixed uh value in here. We want it to be dynamic depending on the message that was previously sent from this node right here. And remember, we have our input configure output. So from the input, we're going to drag and drop the ID from the previously executed Gmail field.
So if you haven't ran a test, I recommend doing that. So you have this value in the low budget route. And then what I can do is I can drop that. And this is going to change to expression. And as you can see, now we have that value getting mapped in here just like shown. And it's going to change depending on the email. And every new email has a new ID. So you're going to need to do this uh in this way.
And next, we have to select a label. So right now, we don't have a label created in our email for low budget lead. So what I can do is I can go back to my email. And then I can just create a label right here. So where it says labels over here in the center left of my screen, I can just hit this plus button. And I can just name this like low budget lead. And I can hit create. I can add another one: Medium budget lead. Create. I can add another one: High budget lead and create.
Next, I can color these. So, for low budget, I'll make it red. For medium budget, you guessed it, I'll make it yellow. I'll make it a little bit better of a yellow so you guys can actually see though. And then, uh, for high budget, we'll make it green. So, perfect. We have low, medium, and high in here now.
So now if we go back to our lead form automation and we click into these labels and maybe we type something out, we go back. We just need to refresh this. So maybe make it expression fixed. Try to pull them in here. If you're not seeing them come in here after just like changing some things around, just like go out, save this automation completely and refresh your page. And that's going to erase the data that we just got. But we can send another test email; that won't be a problem. And maybe the label will be in here now. Yeah. So now we have our low budget lead, medium budget, and our high budget right here. So that's all it took was a little refresh. And now I can hit low budget lead. So this is what we want to label it because it's going down the low budget route. So I can even rename this node like low budget label.
And the beautiful thing is is everything is set up the exact same. So, what we can do is I can just duplicate this node and then drag it right here. And the only thing I want to change within this node is the label because it's still going to pull in the message ID from the previous step. And that's going to be named the exact same as it was before. So, for low budget lead, I can X out of that and then go to medium budget lead. Perfect. And I can rename this node to medium budget lead. I can click out of there and then I can duplicate this once again. And then I can name this one down here high budget lead. Perfect. And then I can change the high budget label. Uh not medium budget lead, but I want it to be a high budget lead. So if it's going down the high budget path, it's going to get labeled as a high budget lead and it's going to dynamically pull in that message that goes down that route. So this is perfect. I could name, you know, these if I wanted to to clean it up. So, it didn't just say Gmail, Gmail 1, Gmail 2. But now we have a pretty solid automation that we can test out. And let's test all three different cases.
And the cool thing is is maybe if you get a high budget lead, you want to be sure, right, that you get to that. So maybe you could even double up your notifications or send an SMS if it's a high budget lead because you need to message that person right away, right? I mean, all leads are important, especially at these price ranges, but I'm just saying like that's kind of the thing you can do with automations is set up conditional routes for certain values. So, I'm going to hit save. And what I'm going to do is I'm just going to test this three times. And we are going to watch them flood into here, which is going to be nice. So, they're going to be automatically labeled because we're pulling the ID from the message that we sent ourselves. So, I'm going to hit execute workflow. I'm not going to focus too much on the other stuff. I'm just going to describe project time frame. Boom. Let's do a high budget lead. We're going to hit submit. And this lead form automation is going to run. Just like that. It sent us an email. Go to the inbox. Refresh. We have a high budget lead labeled in here. So, wouldn't that be nice if you saw like these coming in with all the green, right? Uh automations are so much fun. I love it. But we can test out all of our different routes now. So, I'm going to just describe and then I'm going to set the medium budget route. Hit submit. Our lead form automation ran through that medium budget route. One node connecting to the other. Perfect. And now let's do the low budget option once again. So, I'll execute and name it lowballing. And then I will just say don't care. And then I will put one to three months. And I want the cheapest option. Beautiful. Submit. And now you can X out of all these lead forms right here, but it went to the low budget route. It added the label. The medium budget one ran as well. So when we go back here and we refresh, as you can see, we have a high budget lead, a medium budget lead, and a low budget lead. And we could change the emails even based on what type of lead it is as well. We don't have to keep them the same. But this would be an example of creating your first automation.
So if you made it this far and you did this, congratulations. I'm sure that you're already having ideas of how you can categorize emails because remember these don't have to be coming from uh your lead form, but what you could do is you could set up a Gmail trigger so that whenever you receive a new message, it takes it depending on what the subject line is, goes down different routes, does things for you. So, congratulations. This is your lead form automation that you've just built. Uh there are multiple ways to actually embed this form. You can even customize the way it looks by adding options and custom form styling. So, it doesn't just have to be that nice uh blank page, but you can actually make it any theme you want.
So, now it's time to take it up a notch, right? We've built out a basic automation, but now let's use some things like HTTP requests, code nodes, and some other things like relational databases in our automation so we can start combining multiple tools and using everything that NAD has to offer. So now we are going to be building another automation before we get into the agents. It's really important to understand how agents and automations work together. And first you need to learn automations because in the future what you can do is you can actually use these automations, these full canvases as just a single tool for one agent. So that's a concept that we're going to get into in the future is using your automations as tools for your agent so that your agent can decide whether to use the automation or not. That's when you start really getting into the deep end with NAND and agents in the multi-agent hierarchy section. But first, we need to walk a little bit more before we start running. And that's why we are going to be building a second automation.
So, automation number two, like I said, is going to be a little bit more complex and I'm going to be speaking a little bit faster uh because we're starting to understand the terminology. I'm not going to get hung up on input, configure, output, and I'm not going to be repeating myself constantly. But it's important in that first automation that you understand how data is flowing. So if I seemed like I was just like talking very basic and repeating things a lot because I'm trying to ingrain all of this knowledge into your head. So in automation number two, you're going to learn how to use HTTP requests. I'm going to break that down and explain that for you. This is crucial for connecting to things that NADN doesn't have natively. So maybe your application is not in NAND. Chances are if it's big enough, it should have a way that you can connect to it via HTTP request and not even like for connecting to things that aren't available in NAND, but for getting extra functionality and making a custom call to either get data or perform an action in another app. So, you're also going to be using a code node and running code to make this automation even more powerful. But don't worry, I will show you how I am getting this code as someone who has zero experience coding. Guys, I'm not kidding. I can create all of this JavaScript and I have zero idea what's happening. I just know it works. And that's kind of the new era of development that we're entering. And people will comment and say, "No, it's not." But then again, we're not also going to the library to get books on programming anymore, right? Like that used to be a thing. And somebody in our community said like, "I used to have to go to the library to get all of these books and then study uh coding, right? And now we have these like pre-built libraries online that we can just install. All the information is readily available. And now we're entering another era where you can start coding with your mouth. And we're going to get into that in the future as well. But I'm also going to be showing you in this automation how to set up a database in Air Table. You can do this on a free Air Table account. But I just want you to know to not be scared because we are going to do this together. And this might seem like a lot: HTTP request, code node, databases, but this is where you really start getting ahead. And we're just on the automation section.
So, we're going to be building a weather report automation. In our own words, if I had to describe the automation, I want to be able to select a location from a drop-down list. So, already you're probably thinking, okay, we need another form. And that's absolutely right. We do need another form. And I want to be able to get the high and low temperatures for today in that specific location that I select. So there's the first function that we have to be able to perform in NAND is when we select that location from the drop-down list, we're going to need to somehow pull the high and the low temperatures for today in that specific location that I select. And now after I get the high and the low temperatures, I want to map those values to a database and air table each time that I get a location. So I can see all my past runs of this automation and track the weather data. So as you can see, we're adding a lot more things in here now. We're trying to get specific values from weather data. Like how are we going to get the weather data? How are we going to build out this Air Table database? How is this all going to come together? Well, that's what we're going to get into now. So jump back over to NADN and we are about to get building.
All righty, I'm in NAND and as you can see in the overview section, we now have our lead form automation. I can also go over here on the lefthand side to projects. And if I click into the automations folder, I can see lead form automation. So in the automations folder, I'm going to create another workflow. But before I do that, I want to open up airtable.com. So exactly how it said airtable.com. So when you go to airtable, make sure that you sign in or you create an account. And airtable is a lynchpin for agent building success in my opinion. If you want a place where you can store your data, where you can view that data dynamically, where you can build interfaces around your data, then Air Table is a tool that you need to become familiar with and that you need to start learning. It's not that hard. You can think of it like a Google sheet on steroids, right? You can run internal automations, you can build interfaces, you can create graphs, you can do pretty much whatever you want in Air Table. And airtable itself is like its own automation software. So when one thing happens in your database, you could automate other things to follow. But again, I highly recommend learning airtable. So what I want to do right now in airtable is just get our database ready. So I'm going to hit create in the bottom lefthand corner. And when I hit create, this screen will come up and I want to hit start from scratch. And then here this is like your Google Sheets area, right? You can even see how it says importing your work from Google Sheets. Some of you may be already familiar with Air Table. So, if so, perfect. But you basically have these tables that you can create and these different views for the table. So, I could view this data in a hundred different ways if I wanted to. I'm going to name my base. I'm just going to name this like the weather center. And I could keep all of the weather data that I want in here. And then I could just name table one. I'll rename that like weather data raw or something like that. It doesn't really matter. And then I can go through here and I can just delete all of these fields right now. And we can add all of these fields manually. I'm not going to spend too much time on Air Table, but I do want to show you how to send data to a database uh from NAND. So, we can set this up beforehand. So, if we go back here, remember I wanted to be able to select a location from a drop-down list and get the high and the low for the date in the specific location I select. So, I then say I want to map those values to a database in Air Table and so I can track the weather. So, what we could do for this first column instead of name, we could just have that be location, we can just pull in the location that we selected. So, the location will come in here. For instance, like Chicago, New York, right? And so, like anytime we run the automation, we'll be able to see the weather data for that specific row or that specific location. Next, we can pull in the values. So, uh I'll just do low. Actually, no, I can't type in low. I have to type in number. Okay. And then I'll select number. And then we can name that field low. But I'm actually going to name it high because I feel like high always comes before low. And then here you can mess with like how you want the number to look. I'll just leave that how it is. I'll turn that off. So now we'll get this as an example value. But I'll hit create field. And now we have an opportunity to type in numbers here. Right? If I want to, I could even be a little bit more specific. I'm going to do Fahrenheit since, well, I'm in America. I'm sorry for uh all the people who use Celsius like everybody else in the world. But next, what I can do is I can duplicate this field since it's built how we want it. So I will right-click it and hit duplicate. And I'll just duplicate all the cells as well. And then I'm going to remove the word copy. And then I am going to type in instead of high low. Then I'll hit save. And then this is a really cool field that you can add in Air Table. I'm going to type in created time. And now anytime a new record is created, this will autopopulate at the exact time that record was created. So anytime we fill out location high low, this field will autopopulate at what time was that record created. So we can see when did this automation run. I'll just name that field created time. And then I will hit create field. And as you can see, if I add a new one, it's just going to add in like that. Add a new one. Uh same time, but you get the point. So right now I'm going to delete all of these fields. We have the high, we have the low, and we have the created time as well as the location. So now our database is ready to accept data. We're going to need to hook up a credential, but I'll wait until we actually get to that part because for now, we have to build the automation. So I'm going to go back over to NADN. And within my automations folder, I'm going to hit create workflow. And like I said, I'm going to be moving a little bit faster now that we have the basic terminology. We understand that we can dynamically map data; we kind of understand how the data is moving throughout the workflow. So, I'm not going to be getting hung up as much on the granular details. But what I want to do is I want to hit add first step. And we wanted to begin this automation on a form once again because we want that drop-down list. So, I'll select NADN form and then I'll select the form trigger and then I can name this weather. Actually, I'll name this location selector and then uh select a unique location from the list. And now I will just add a form element. And that form element is going to be a drop-down list. And then I can make this field name select your location just like that. And then I can give all the location options I want. And remember this is an automation. So I'm like predefining all these fields. I don't have the ability right now just to type in a location and get the weather data. That's something we could set up with an agent. But what I want to do, I just want to give myself some options. So, I will do the Chicago option. Maybe I'll do New York. We can do Miami. And then we can do Phoenix. So, boom. We have our four options: Chicago, New York, Miami, Phoenix. Now, if I hit execute step, what you're going to see is we get this drop-down selector and we can pick the location that we want to get the weather data from. So, if I select New York and hit submit, that will run through and location will be New York. And so, now we could go through a similar process of routing this automation to do different things based on the location that we select. If we wanted to, we could do that switch node. And how about we do that just so we can get some good practice. Now, it might not be necessary for this automation in specific, but it is good getting used to being able to route your automation. So, once again, I'm going to hit this plus button, and then I'm going to type in switch. Then, I'm going to select the switch node right there. And then for select your location, remember, I'm going to drag this dynamically over value one because we're going to be comparing it to the actual location. So if under select your location, I drag that, it will automatically change that into an expression from a fixed field. And now what do we want this value to match in order to go down this route? Well, if I go back to my form, I could kind of go in order. So I'm just going to copy Chicago. And I'm not going to copy and paste the rest of these; I'll just type them in. But we have Chicago. And then I can rename that output Chicago. Beautiful. Then I can add a routing rule. And then I just keep on doing the same thing going down the list with all of the locations. So now I'll type in New York. Add a routing rule. Uh value one is select your location, Miami. And then I'm going to add another routing rule and then drag that into value one once again. And then I'm going to type in Phoenix. Beautiful. And make sure you...
Don't have any like extra spaces on them either, otherwise it won't work. So now we can rename the outputs. New York. I'll rename this one to Miami. Not Miami, but Miami. And then I will rename that one to Phoenix.
So now when we click out, we have all of these different routes we can go. It's like a little road system if you want to think about it like that. So if I execute the workflow and I select Phoenix and hit submit, what you're going to notice is it didn't actually go down the Phoenix route. And it's probably because I added an extra space somewhere.
So, if I go in here and I open up this Phoenix expression window, as you can see, there is an extra space that I added on the back of Phoenix. So, that's why it's important to make sure that when you're typing in your form values, you don't have any extra spaces like this one is right here. So, if I delete that and then go back and save and then test this one more time. Now, when I type in Phoenix and hit submit and go back, it is working. So, this is good.
Now, what we need to do is we need to, before we start trying to like route our data, how about we get the actual tool that we're going to use in order to pull in this weather data? So, you might have to do some research on this by yourself using AI, asking, "Do we have this available, this data available uh to pull into n8n via HTTP request?" You might have to ask that stuff, but I've done my research ahead of time and working with weather data is great because there's so many factors that go into it for practice.
So, I'm going to open up a new tab and then I'm going to type in open-meteo.com. I can click this right here and this is a free weather API. So, it offers free access for non-commercial use. You don't even need an API key. You can start using it right now. So, what you can do when you're on open-meteo.com is you can go to the API documentation. So, API docs, and here you get to create an HTTP get request.
Now before we move any further, as you can see, we have a lot of fields that we can edit and set. We can also edit all of those fields in n8n if we wanted to and add all of these things so that we can actually get this data from n8n. That's the beautiful thing about this API here. But before we go any further, what I want to do is I want to explain to you what is an HTTP get request real quick.
So you can think of an HTTP get request like a call center for a very specific task. The phone number for this call center in this scenario would be the URL of our request. Whenever you want to get specific information from an app or a service, you can call that phone number, which in this case, instead of a phone number, it's going to be a URL just like you see up here, except it's going to be for this website.
So, if I scroll down a little bit, what you're going to notice is we get this API URL. This URL contains data and it's like our phone number for the call center. So if I copy this and I paste it in like right here, uh based on all the metrics we have set up here, that URL is changing. So when I send it off, it's going to bring back all of this data. And it might look like really weird, but it's actually data for a specific latitude and longitude. So it has time and then it has all of the temperature right here in Celsius. So that is kind of what an HTTP get request is and we can pull all of this data into n8n in order to work with it. And that's the beautiful thing about having an open API that you can use for the weather.
And so if we go back to this right here, uh in this case we are contacting a weather call center and we want to be able to pull weather data from a location that we select because remember we have our drop-down list in our form. We want weather from Chicago, New York, Miami and Phoenix. So, this HTTP get request is going to allow us to say, "Hey, I want weather from here right now. It's like we're calling that phone that has the very specific weather. Maybe we have a Chicago phone number that we call." Maybe we have a New York phone number that we call like, "Hey, what's the high and the low for today?" Maybe we have a Miami, hey, what's the high and the low for the day? So, that's what this unique URL that we can craft will do for us. But what you're going to notice is this URL is based upon latitude and longitude in order for location. So we have to figure out a way to set the latitude and longitude for each location in n8n so that if it goes down that route, we use that specific latitude and longitude. Right?
So what I can do right now is I can go to open-meteo.com and I can just go down and copy this URL. Actually, you can change your settings before you copy. Like if you want precipitation, rain, if you want weather code, sunrise, sunset, you can check all these boxes and it's going to change that for you. And the URL down here is going to change. So, right now, I just want to get my settings. All right. So, for temperature unit for me, I'm sorry. I'm sorry, guys. I've got to go Fahrenheit here. And now, when I scroll down, as you can see, it says temperature unit equals Fahrenheit. So, what I can do is I can copy this URL. I'm going to hit Ctrl + C on my keyboard, go back to my workflow, and then just so we can test this, I'm going to add in another trigger. So, this can kind of stay down there right now. But in the upper right hand corner, I am going to type in manual. And as you can see, we have a manual trigger that we can add here. So, I'm going to select that. And now, we have two different ways that we can start these workflows. And I'm going to make my own little separate workflow up here to show you how the HTTP request is actually working. So I'm going to hit this plus button or you can just add it like that. But I'm going to hit this plus button to the right of that and type in HTTP. And then you'll see the HTTP request pop up. When I select that, we can keep it on method get. And then what we need to do is we just need to paste in this API URL because this is our unique phone number. Right now we're calling the call center for the latitude 52.52 longitude 13.41. This is a very unique phone number that we're calling in order to receive that data. So I'm going to copy that URL once again. I'm going to leave the method on get and then I'm going to paste it in where it says URL. This is our phone number that we need to contact. And what you're going to notice is when I execute this step, what we're going to receive is all of that data in the form of dynamic fields. So now we could even use this data. Like I said, maybe we want to just throw in a random node here. We can map that data, all of these times, all of these inputs. It gives us the latitude, the longitude. It gives us literally everything we need. The Fahrenheit symbol, if it were Celsius, we could do that, too. But now we have the ability to actually work with all of this data. And we can process it through code. We can do really whatever we want now that we have all of this within n8n, which is the beautiful thing about using an API URL.
And so this little workflow up here was just to show you how the HTTP request was working. We crafted this unique URL and it gave us a unique set of data for the weather based on that latitude and longitude. So now instead of having a fixed URL, we need to make this an expression and we need to dynamically change the latitude and the longitude depending on the location. So how can we even do that? Well, now I'm going to show you how that's possible. So I'm going to close out of this. You can kind of just drag that up top and leave that. I'm going to save my automation. Actually, right now I'll rename this to the weather report. And I could even give it a little emoji if I wanted to. Maybe like a little cloud here. Some rain. Beautiful. I could add a tag. Maybe it's for my company. Once again, beautiful. And now we need to figure out how to set the latitude and longitude. So we can use another utility node for this to set the values because the latitude and longitude for Chicago is not going to change. It's not going to change for New York. It's not going to change for Miami. It's a fixed thing, right? Chicago has a fixed latitude and longitude. So, we can just set that as a fixed variable within our workspace.
So, on the Chicago line, let me hit this plus button. And what you need to type in is edit fields. And you're going to see this node that says edit fields set. And this allows you to set fields in n8n. So that no matter what happens, you can run through that data. And so I'm going to select this set field. And now what I want to do is I want to send some test data up the Chicago line so that we can manually configure this ourselves. So I'm going to hit execute workflow on the form and then I'm going to select Chicago and then hit submit. Then it says form submitted and data went down the Chicago route and hit the set node or the edit fields node which is perfect. So now we have our location. We have everything we need. Now we don't really need to do anything dynamic at this point. All we need to do is set the latitude and the longitude for Chicago. So we can give uh latitude and then we can add another field and then we can do longitude. And now we just drop the value of latitude and the value of longitude for Chicago. So as you can see I just looked up Chicago latitude and it popped up. So I can just copy these first four numbers. Hit control C. And now for the latitude, I can go back to the n8n automation and I can just pop this in as the value. 41.87. And then I can do the exact same thing for the longitude. So 87.62. Could probably round that up to 63. So I'll paste it in where it says longitude. I'll round that up to 63. And I'll round that up to 88. So now we have the latitude and longitude for Chicago. Just like that. And what I also want to do is in this edit fields node, I want to tick this box, include other input fields, because this is going to allow us to pass all of this information through this node and not just have these two items. So I'm going to tick that on. And then I'm select all for all of the input fields that go into this thing because I want them in the output section as well. So now when I hit execute step, what you're going to notice is we have latitude and longitude. And the only way it's going to give us this is if it goes down the Chicago route. So now you probably understand what we need to do for the other routes. We need to get the latitude and longitude for New York, Miami, and Phoenix and set it up just how we did in their respective routes. So I can name this Chicago coordinates. Beautiful. And now I can do the same for New York and so on. So all I'm going to do is I'm just going to duplicate this. So, I'll duplicate and then I'll just rename it to New York coordinates. Beautiful. Connect it. And then we're just going to go find the latitude and longitude and map those values in each one of their nodes. So, we have New York here. I'm going to copy. I'm going to paste in latitude. We have the New York longitude, 74.00, a nice round number. And paste it in. Now, we do the same for Miami and Phoenix. I'll be back when I have those values mapped.
All right, perfect. So, I have all of those values mapped. I have New York's latitude and longitude. I have Miami's latitude and longitude. And I have Phoenix's latitude and longitude. So depending on which route it will go, it will receive that specific latitude and longitude which we can then dynamically place into this HTTP request or we can kind of change the phone number if you would so that we can call it and get that specific data for the location that we select from the drop-down list. So now what I want to do is I want to connect this HTTP request to all of them. So we can kind of keep funneling things back here. And since we're just dynamically mapping the exact same fields, latitude and longitude, that's the only value that's going to be changing. So we can connect all four of these nodes to the HTTP request. Just like that. So we have this cool looking shape. Now we can actually get rid of this manually execute by just hitting delete, saving the automation. And now we need to dynamically map the latitude and the longitude. Since all of these values are labeled the exact same, we don't have to worry about uh different naming conventions, right? Or like renaming the values so that they all match. All we have to do is dynamically pull in latitude longitude. So make sure that you switch it from fixed to expression. We can use that same URL that we previously received from the open-meteo API URL that we created. And like I said, you can get creative with this. You could throw in anything you want. You could change your time zone. You could make this for your exact location. Get the soil temperature. I mean, come on. Like, this is insane what you can do.
So, I'm going to go back to the weather report and where it says latitude equals and gives me the fixed value. I want to make that dynamic. So, I'm going to delete 52.52. And before this amperand symbol, what you can actually do if you are struggling to see this is you can open up this big box and it gives you a nice canvas to work with. And after latitude equal, I just want to drag and drop this latitude value that will always be changing depending on location. So now, as you can see, this is what it will look like over on the right. It's in green, so it's a dynamic value. And I want to do the same with longitude here. So I'm going to drag, delete, and then where it says longitude, I'm going to drag before that amperand. And now we have a custom URL that will be changing based on location. So I can rename this like uh weather poll and that'll be perfect. So we have that now. And actually I was just running some tests and I realized that I forgot to add the negative symbol to a lot of my longitude coordinates. So for Miami, I also need to add that. But for Phoenix, it was actually -12. And as I was testing it, I'm like, this does not seem like the weather in Phoenix. It should be a lot hotter right now. And it turns out that it wasn't. it was in a different location because I didn't add the negative symbol there. So for Miami, I also have to do the same. And I'm not sure if I have to do the same for New York or Chicago. I can go back to the open-meteo docs and check. They actually have the search locations feature in open-meteo, which really helps. So I can search and then I could type in like New York to see if there's any negatives. And yeah, on the uh latitude there is a negative there. So I'm going to go back and make sure that those are correct. And I actually meant to say on the longitude there, but yeah, it's important that we have those negatives in there. Otherwise, it gives you a completely new location. So, I'm assuming Chicago is going to be the same. So, I'm going to go check. And this is kind of just some things that you go through and you deal with. Yeah. So, 87.65. That should work. I'll add make that a five. But now we can actually test this out. And I did do testing, but we cut around that because I was like confused about the Phoenix data. It was because I forgot the negative. Rookie mistake, but time to get back into it.
So, what I can do now is I can just X out of some tabs here before I uh start freaking out. And then I can hit execute workflow. And then what I'm going to do is select. We can try New York. I'll hit submit. Go. As you can see, it went down the New York path, pulled the coordinates, and then got us this weather data for New York. And if I scroll down and check, this is for today, June 20th, at the time of recording. And let me see what that temp is looking like. So, in the 70s, 60s, uh, looks like it gets up in the 80s. So, if I go check New York weather, as you can see, that looks pretty accurate here, uh, for the hourly because remember, it's giving us hourly, not daily. And this is insane for New York. Look at that. So, we might be able to see that in the weather data. If we scroll down far enough, gets up to the hundreds in New York City. Wild. 101, 103. So, yes, we're getting the weather. It's successful. I can test it again with other locations to ensure. Beautiful. And now, let me select Miami to ensure that it's going down the Miami route. If I go back, as you can see, all locations are working. Miami is probably blazing with heat. Not as much as New York actually right now. And all right, the first part of this automation is complete. But now here comes the fun part. Extracting the high and low from all of this messy data. So that's where we need to use things like a code node. And you don't really have to understand how the code works. But code is really good at parsing this data that's coming in like this every single time and finding all of those values.
So, what we can do, this is what I always like doing, even if I'm not using a code node, but I'm just struggling to figure something out in general, is we can use AI to help build things for us. So, what I'm going to do is I'm going to open up ChatGPT. And now that I'm in ChatGPT, I want to tell it to create me JavaScript code. And the only reason I know that is because, well, I've been using n8n for a while now, so I know what they use. But what you can do after the weather poll is you can hit this plus button and you can add a code node. And this is going to allow you to run custom JavaScript. So, as you can see, it has this little box here where you can use all of this input data on the left and run it through code. And so, you can probably understand how powerful that is, especially if you're coming from a developer background. But we'll get a clean output with whatever we want. And we can do that programmatically. So, I will name this like finding high and low so we know what that code is doing. And as you can see, the language is JavaScript. And so I want it to give ChatGPT all of these details that it needs in order to create code that finds the high and low. So I'm going to save my workflow. I'm going to go back to ChatGPT. Then I can just tell it what I want. So I said I need help creating JavaScript code for my n8n workflow that dynamically extracts high and low temperature from today from a set of weather data that's coming in like this. And now we need to give it an example of how this data is coming in. So what you can do is you can hold shift and enter down a few times. And then you can go back to your weather report and make sure that you run it to the weather poll so you can get some data and that you have this code node added after. But you want to select into the weatherpool node and then in the upper right hand corner you can see this little edit button. Right now, what I want you to do is hit that little pencil icon, and
This is going to allow you to get into the back end of the data. So, what you can do is copy all of this, paste it into chat GBT, and then send it off with an action command. So, uh, a little hack on your keyboard is you can hit control or command A, and it will copy everything uh that you have selected. And so if my mouse is in here in this box, I can hit command A and then Ctrl C. And that just copied all of the data to my clipboard, all 300 lines. And so now I can go back. I'll hit cancel and go back to chat GBT. And then I'll hit control V to paste that in.
And so now I'm giving ChatGBT an example of how the data is coming in. And next we need to tell it one more thing. I always like doing this whenever I'm having it create code. I say, "no functions or libraries allowed. Create me the code that will extract the high and low temperature from today." Beautiful. And so now I can send this off and it has all of the commands that I need. It understands that I'm going to want JavaScript code. And this is just part of the process of building agents is understanding how to ask good questions to AI to help you build. That's how most people learn the quickest is just by talking to chat GBT, taking screenshots of their workflow, copying and pasting in errors.
So I'm going to copy this code that it gave me and then I'm going to go back to the code node and I'm going to paste it in. And it's going to be using this data. As you can see, it says items0.json. This is going to assume that the data is in items zero. So, it's basically going to try to grab all of it. And now we can test this step. So, I'll hit execute and we'll see if it worked. As you can see, look at this. Gave me the high temperature and the low temperature. I could add in as many variables as I want here. I could say I want the high and low for each day in the data because remember it's giving us 620, 21, 22, and all the way up to 26. It's giving us a 7-day forecast, but as you can see, it works like magic, right?
So now, anytime we run this automation, this is going to extract the high and low of the most recent day. So, I'll hit execute workflow and I will go to Chicago and I will hit submit. And now, as you can see, in a matter of seconds, it extracted the high and low for Chicago. It will do the same for Phoenix if I select Phoenix. Same with Miami, and so on. So, I'll hit execute workflow, and we'll do Phoenix. And this should be a little bit higher of a temperature. And so if I go back to the high and the low, so you can see the high today is 114 degrees. I'm sorry if you live in Phoenix. And a low of 83. Wow.
And so now we have pretty much all the data we need in order to map it to our database. We've configured the HTTP get request. We've configured the code node. Two things which are very prevalent in all automations. So now it's time to actually map all of this information that we're receiving during this automation to our Air Table database. And this is going to be another step, another thing that you can learn for mapping values to database rows. And you can do the same thing in Google Sheets, but I just recommend using something like Air Table, ripping the band-aid off and learning this thing inside and out.
So what we can do is we can go back and we can add in an Air Table node. So I'm going to hit this plus button and type in air table and I'm going to select that. What we want to do is we want to create a record. That's what every new row in air table is called is a record. So like that would be me creating the new record. That would be me creating the new record. Again, a new record. So now we have three new records in here. I'm going to delete all of those. But we want to go back and we want to select the create a record record action. So I'm going to select that. And now once again we need to create a new credential. And this credential is going to be a little bit different.
So in Air Table when I hit create new credential as you can see it says, "make sure you've enabled the following scopes for your token." Now you might be thinking, what is it even talking about scopes tokens. Now we need an access token. Well every app has a different way that you connect to it. And an access token is a pretty common way. So I'm going to go to Air Table's uh token page. And in order to get to that tokens page, what you have to do is you have to go to airtable.com/create/tokens/new. Okay? And when you hit enter, it's going to take you to the builder hub. And the builder hub is where you can programmatically connect to this database. So we can edit values from NADN. Rather than having to be in the database to update records, create records. We can do it all from NAND when we go this route.
So, this is going to take you directly to the personal access token page where you can create a token, but you might first have to go to the builder hub and sign in on this page. As you can see, I have a ton of different tokens in here that I've connected to in NADN. So, if you get to this create/tokens page, what you can do is you can hit create new token in the upper right hand corner as well, and it will also take you to this screen. But, we need to create a name for our token. So, we can just call this weather data testing delete just so I remember to delete this after this video is uploaded. And then I can add a scope. Remember it said, if we go back to NADN, "make sure you've enabled the following scopes. Records read, data records, write, and schema basis read." So now we can just kind of match those up. So data records read, add a scope, data records, write, add a scope, and schema basis read. This is giving Nadine access to do these things for us in our air table. And for access, what I want to do is I want to add a base. And then I want to scroll down until I find the weather center. So I can select the weather center. And now it has access to this workspace. And it can do these things within that workspace. I can hit create token. And then you get a secret key that you don't want to give out. So store it in a safe secure location. I'm going to copy this and then hit done. And once you hit done, you can't see that ever again as well. So make sure that you save it in a good spot. And I'm going to go back to NADN. And then under access token, I'm going to paste in that secret. And then you can rename this. I'll just name this like weather center connection. And then I'll hit save. And it should say connection tested successfully. Just like that. And now we can back out. And now we have access to this base. So under base now I can select the base, the weather center, and the table. Sometimes the table uh won't load. If it doesn't load, just select by URL and then from list again and that will like refresh it. But as you can see, we're now pulling our weather data raw table. As you can see right here, what we renamed that to from our weather center base. So I'll select weather data raw. And now it's going to pull in all of those columns dynamically. So anytime this automation runs, it will create a new record because that's the operation we selected. And we can just map all of these values. And what you can do is you can actually drop down these arrows on the left hand side to see which ones actually ran. So what I can do is I can go to the very beginning. I can go to the source. If I want to map a location, I don't really want to try to pull from Chicago, New York, because sometimes those won't run. So I want to go from the source. So I'm going to open up the form node. As you can see, each one of these are a node in our workflow. And I want to go to the form submission node and where it says select your location, I want to drag and drop that. So location is always getting updated based on which one I select from the beginning of the workflow. High and low, well, we can just use the code node that just extracted that for high and low. So I'm going to make high an expression. I'm going to delete what's already in there. And then I'm going to drag high temperature in just like that. So now it's dynamically pulling in the high. Same thing for low. I'll create an expression. Delete that and then drag and drop in the low. So now when we execute this step, what you're going to notice is it creates a record in our air table. It gives us the record ID so that if we want to update that record later down the line, we can pull in this ID and update the record. And it created that for us just like shown. So if I go to the weather center, as you can see, it created that record just like that. Beautiful. You can add in as many fields as you want.
And so now what I'm going to do is I will go back to the weather report and save this automation. And this is complete. We've built automation number two, which gets a report on the weather based on location. What I'm going to do is test out a few more um locations. So I'll go Miami. Submit. And I don't really have to worry about like looking at the data in here in NAN now. Now that we have that database built, so I'm going to close out of some of these tabs and I'll test out a few more locations. So, I'll go to New York, submit. I will execute workflow. I'm going to go to Chicago, submit. And this is just going to keep on running for us. So, if I go back to the weather center, as you can see, we have all of these locations from the time that they were filled in because we set it up to run in NAD. So, congratulations once again. You've just built your second automation and I hope that you've been following along and implementing this step by step with me because this is some good stuff that you're going to have to know when it comes to building agents.
I think it's safe to say that you understand how automations are beginning to come together. Now, you're not going to be an expert after watching me or building these two automations with me, right? What it takes is actually going out and implementing it. Finding a use case. Finding something that you know will stay the same every time that you want to automate. Maybe you are selling products. Well, set up a post-product purchase email. Do something that allows you to creatively expand yourself when you're building out these automations and really allows you to strengthen your learning. And that's going to be the best way to learn automations and agents. Like we're going to get into agents and I'm going to teach you. But the best way to learn is by looking at something, asking if it's possible, and then just testing to see if it's possible. And when you get stuck, copy and paste your problems into chat GBT. Literally, that's it. Okay, that's how I learned how to build agents from no courses, absolutely nothing, is I would just have conversations uh with AI about the tools that I was using. And that's how I figured it out is just trying things out. So, you have to literally go out and just start building something.
But next, we're going to get into the agent stage of this. And you're going to learn a lot here because you're going to learn how to prompt an agent. You're going to learn how to give an agent tools, instructions, and then further down the line, we're going to get into a multi-agentic hierarchy. So, we're going to be learning how to link agents to one another. Congratulations on making it this far. Uh, if you're still watching this video and following along, I know that you're going to be successful because probably over 70% of the people have clicked off the video by now. So well done for being here. You are a special breed. Uh now let's get into it. So first we need to review the differences between an automation and an agent one more time just so we can kind of ingrain this in our head. So this is the automation concept that we've been following the entire time. We have trigger, action, and result. Now the agent concept is very similar except on the action it's just replaced with an AI action that can dynamically make decisions. So an automation once again is predefined and fixed while an agent is adaptable to unique situations.
So what is the difference between these two? Well, automations perform predefined tasks. They require exact instruction and they're limited in their adaptability to unique situations. They follow a linear predictable sequence. While agents act autonomously based on goals with less instructions, they can make decisions, handle complexity, and adapt to new information. They learn, reason, and optimize their outcomes over time. So, agents are adapting. That's like the biggest word that I found to describe the difference between an automation and an agent. Now, we've built out a few automations that do predefined tasks. Our weather report and our lead form automation. But now we need to let this agent do something a little bit more powerful for us. So we're going to get into what we're building in a second. But the agentic side of things happens mainly at the action level of the sequence. I want you to keep that in mind.
So with this, let's look at a few examples. First, I'm going to show you another fixed automation. So maybe you are selling digital products online. And this is something I have used in the past uh for the past like three or four years as a matter of fact, actually even longer. So, since we use Stripe, the payment processor, whenever somebody purchased a product on our website, we used all of that information from the Stripe payment in our uh automation. So, we we could pull in all that info. So, things like email, what product they purchased, what date they purchased on, what their name was, how much the product was, like we were just pulling in all sorts of information from that digital product sale. And then with that, we would do product delivery via email template. And this was a fixed automation because we did the same thing every each and every time. And it's sometimes good just to do these fixed automations because you know they're going to work and you know the exact result you're going to get, which is happy customers because you have timely product delivery in this scenario here. That's an example of like a real life practical automation that's super easy to build that has a very high ROI. But this is like the action that would take place. So we had R2 email which we pulled from the digital product sale. So like they have to put in their email if they want to purchase. So we could just easily send that email send the product to the email that they put in uh into the their payment field information when they're buying the product. And then we had fields for customer name as well that were coming in from our uh product purchase form. So we could pull that in there. We would say something like, "Hey there customer name. Thanks for purchasing." And then the line item name in Stripe, otherwise known as the product name, is what we could pull in next. So, it's very dynamic. We could even uh have a product link at the very end. So, we said, "Here's a link to get started, and then there's a link to that dynamic uh product install guide or whatever we were doing." But this is an example of building out a fixed automation, right? We're going to be using like this exact same email template each and every time. And I know for a fact the products are going to get delivered to the customer because it's such a simple automation. Like once purchased, then use that information that's required upon purchase to send an email and then have this custom message and get people the product that they bought. Like simple automation, but it saves me a lot of headache. And if somebody purchases a product while I'm sleeping, I don't got to worry about it.
But let's look at how we could make this agentic. And this could be really good for like a bigger company. You don't even like need this. But I just want to show you what an agentic workflow of this could look like and how it could be beneficial. And this is just one tiny example that may not even be necessary. But we have a digital product sale. So the same trigger. Somebody buys a product based on whatever whatever your industry is in. And then an AI action takes place. Instead of just like a fixed email, maybe you have a custom email with upsells based on customers past purchases or live market data from whatever industry you're in or live company data. So if your company's constantly updating things, this agent can understand that and it can think and it can go look at that company data and make a very custom email that almost seems too real to be true. And the result would be even happier customers with more sales and more customization. So, like if you have good products and you're pointing your customers uh based on their past purchases for the best product to buy in order to help them solve their problems, then I mean that's like the dream result, right? You're helping clients solve problems and you're making more sales. So, you're doing the right thing in sales if you have a good product that you know works.
So, here now instead of just like this like fixed email with okay, we're pulling in the form fields. We have customer name, product name, dynamic product link. We've got all these fixed fields pulling in from the form. Now, we have an email that's maybe looking at a backend profile of the past customer, right? Maybe the backend profile here is John and John has purchased product X in the past, product Y, John created their account five months ago. John has a company named ABC Company. Maybe you have a bunch of information on all of your leads and you kind of have a journey that they followed uh with being with you. Maybe they signed up for your email list 12 months ago. You could use that in your email. You could have the agent look at this profile, look at your company data, look at the market conditions, look at everything. And you still want to do some fixed fields, right? Like you don't want to get cute with the email. Like the email, you just want to get the email to the person. So let's say somebody purchases a product on your store and instead this is the email they get. "Hey there John," which could be pulled from the backend profile. "I saw that this was the second product you've purchased from us. Can't thank you enough for your continued support." So like even that a lot more customization, right? And you could do this with an automation right now, but um what's about to come would be very difficult because there's a lot of changing factors. So the the rest of the email might go, "Usually customers who are purchasing these two products, right? Maybe uh customers who have purchased product X and products Y in the past have also really liked uh a different product or the agent has seen data that when product X and Y are purchased, usually product Z is purchased soon after. So I could put that in the email. Usually customers who are purchasing these two products together always say this product. Maybe you could link to another product. Compliments and enhances the products you've already purchased. I know you've been a customer with us for five months now, so I wanted to show my gratitude. Here's a 30% off coupon in case you wanted to join the others." And then maybe we could have the agent say uh in purchasing product Z. "Uh thanks for your continued support." So like these are the types of messages that agents could put together instead of just having it be very fixed, right? Everybody has a unique use case or a unique scenario that they're dealing with. And in this case, the better that you know your customer and the better the customer feels heard and feels like, "oh, this is a very custom experience," the more likely that they're going to purchase from you and the happier they're going to be. So agents allow you to do these pretty crazy things where you can
Craft these human-like messages or make these human-like decisions. It doesn't just have to be about generating new content, but also using existing content to make decisions on your behalf, as we will see in the agent that we create. So essentially, agents can use tools and information from other sources to craft adaptable answers or make adaptable decisions on its own.
So the agent interfaces with data, and this data can be anything in your life. You could just have a table or a Google sheet of what you want to accomplish in 2026, 2025, 2027. It doesn't really matter what you have, but you can have your agent look at these things and then go, "Is this best? What's the best decision to make in this scenario? Should I schedule this meeting based on an email coming in, or does it go against Drake's goals?" Like, these are the types of things that the agent can do. It really becomes like a personal assistant. And the more that you dive into it and the better you can instruct this agent and set guidelines, the more useful it can be.
So, we're going to learn how to do all that. In this case, it was completely custom user email, post-product purchase, personalized to the user. But, like the agent, if you're having a product store, for instance, could be looking at all that past customer information that's always changing, right? It could be looking at live company product updates. Maybe you guys have a database of, like, or a Slack or a communication channel where you're talking constantly about these products. You could set guidelines and you could set rules to where this agent is looking for those unique updates that could help increase your sales, and also outside analytics from other platforms. It doesn't even have to be internal things, but it could be literally market conditions. It could be the price of a stock. It could be whatever you desire, okay? It could be about the housing market. It could be about what's new in content creation right now. What's new trending in your niche, right?
And so when you're thinking about this, don't think about it from a perspective of only helping your customers, but also helping yourself, right? Like, how are you going to use this in order to gain that competitive edge on people who are not using it? That's what you need to be thinking about.
So, with that being said, I think we can dive back into the course here, and we can kind of go through our system of where we're building it in our own words first. We're actually going through and describing what we want this agent to do.
So, this is the next thing that we're going to be building. I want to build an agent that reads all of my incoming emails, labels them, and drafts responses based on my current goals and my calendar. I want these drafts to be put into my inbox so I can review them before sending.
So, right off the bat, what you're going to notice is not only is this agent going to have to read all of my incoming emails, but it's going to have to label them and categorize them. So, we'll have to figure out how to make this agent categorize certain things. And then we can add labels to them as we did in our first automation, but we can have different categories for different areas of my life. And next, I wanted to draft responses. I don't really want it to send emails. I just wanted to draft responses in my email inbox so I can go in and review and send those off if I desire. And those responses are not just going to be like typical AI responses like, "Hey, uh, draft me an email based on this text." It's going to be looking at my current goals. So, we're going to set up a goals table in Airtable. That'll be very simple. And also my calendar. So, like what do I have going? If people are emailing me and wanting me to do all these things, I want to automatically deny that if I have something on my calendar, and I don't want to have to think about it. I want my agent to go, "Nope, you can't do that today because you've got to go to a dentist appointment, you've got to walk the dog, whatever you have on your calendar." And then I say, "I want these drafts to be put in my inbox so I can review them before sending." Obviously, don't really just want to let this thing run wild right now, but you could actually, when you perfect it good enough. I know people who have completely just automated their inbox, which is very interesting, but that's kind of the world that we are moving towards.
So this is what we're going to be building. I think the best way to get into it is to just get into it because we have a long road ahead. But this is where the fun really begins, and this is where most people are clicking off, not wanting to take the extra step to just learn. So congratulations if you are even beginning this. We are going to build this together, and this is just the beginning of our agent journey in this full course.
All righty. So I'm back in NAND, and I recommend you do the same. So right now I'm in the overview, but I can go to my agents full guide project, and instead of creating an automation in our automations folder, I'm going to create a new folder and I'm going to label it agents. Beautiful. I'm going to hit create. Click in here, and then I'm going to create a new workflow. Uh, rinse and repeat. Again, as we move on, I'm going to start explaining the small details less and less because we have bigger, more important things to worry about. And if you need to spruce up on the little details, like me just clicking around, hitting triggers and things like that, then go back and rewatch the automation steps of this full guide.
But what we want to do right now is we need to add our first step. So, what is it that we actually wanted this agent to do? Well, we wanted it to read all of our incoming emails and make decisions based upon that. So, what we need to do is we need to add that first step to watch the email inbox. So, I'm going to hit add first step, and then I'm going to go on app event, and then I can search in Gmail. I can select Gmail. And as you can see, we have actions within apps and we have triggers within apps. So, like not all apps have things that you can begin agents or automations with, but Gmail has on message received, which is very, very useful. So anytime we receive an email, it will be watching the inbox and then pulling in the email information like the body, the subject line, the sender, the date, and a bunch of other information. And we'll be able to use that in our agent workflow. So I'm going to select on message received.
And here, if you haven't already connected your Gmail credential, you can do so now, which if you've been watching this video all the way through, as I recommended, you know how to do this now. So, when you hit create new credential, all you have to do is sign in with Google. Uh, that's just a little hint, or you can go back and watch what I did in order to do that. But, I'm going to connect to my test account. So, I recommend if you weren't here in the beginning, creating a test account for NAD, just like a completely new email that you can just mess around with and get comfortable, just get to getting to know your tools before you start putting them in production.
So, we have pull times, and pull times in email are how often is it checking your email inbox. This doesn't really affect how many executions or automation runs you are having, but what it does is it just gives you an option where you can set it every minute, every hour, day, week, month. And usually I'm just doing like every minute, or you can even do custom and do a cron expression and use AI to help you form a cron expression of this right here. You could copy and paste this into AI and say like, "I want my email to be checked every blank second. Help me write a cron expression," and then you could do so like that. But I'm just going to do every minute so that it's literally like live. In the event, we want message received filters, you can add filters here, which is pretty cool. So, like you could add a filter for only unread emails. So if you get in there before your automation and you read an email and you don't want it to pull it in, then you could do that. But right now I'm going to leave it pretty barebones, so I'm going to have everything normal right here, and then I'm going to click off, and now we have our Gmail trigger.
So if we activate this workflow in the upper right-hand corner by hitting activate, what's going to happen is it will now regularly check Gmail for events and trigger them automatically. Okay. So now whenever I get an email, this will run, and we can see that happening in our execution tab once the automation is active or the agent is active. When it's active, you can't see the green lines like we can in the development phase. So, you have to check the execution tab to see if you're getting any new emails. I'll show you what that looks like real quick.
So, I'll go email myself. I'll just say like, "Hey there, Drake. How are you doing? Can we link up tomorrow at 10?" Beautiful. Then I'll just say like, "Johnny," there we go. And then I'm just going to send this email to myself. And now I'm in the executions tab. And since we have an active automation in the next minute, you're going to be able to see that appear here. And this is a really good way to debug your workflows is using the execution tab because you get to see if it ran successfully or didn't run successfully. And when you get a big automation or a big agent workflow, it's really good to see that. So since this is active and it's running every minute, we'll probably have to wait about a minute before it comes in, depending on the cycle in which it's currently on. Maybe we're on second 20, 230. That much, I don't know. As you can see, just populated in at 11:29. Right now, it is still 11:29. And so, we can click into here and see the execution data. And this is just a way to see active automations or agents. So, we can see that that ran successfully. I can go back to the editor now, and I'm going to deactivate this. And then, I'm just going to hit execute workflow so we can pull in some test data so you can see what that Gmail information is looking like.
So, I'm going to double click into here. And as you can see, it gives me all of this. So, it gives me the to email, the from email, the subject, it gives me the snippet, it gives me the body if I want. I can turn off simplify and get even more information. So, maybe I will just leave that on simplify for now because the next step is we can just pull in more information by adding another node. So, I want to get everything from that email so I can work with everything before we implement our AI agent node. So, what I'm going to do is I'm going to hit this plus button and then I'm going to type in Gmail again, and I'm going to select the get a message action so that it can get that message. I'm going to select that, and then I'm going to drag and drop the Gmail trigger ID to this box right here, and that'll turn it to an expression. So, I'm dragging and dropping into there. I'm going to turn off simplify, and then I'm going to execute that step. So, now it's using this message ID, the email that I just sent myself. And now, when I execute the step, as you can see, we have just a ton of different things in here that we can use. Now, we have the HTML body, which could be good for hyperlinks. If anything in the information is hyperlinked, the HTML will be able to extract that link. We'll be able to get that link if we need to.
Now that we have the email information coming in and we know that this will fire whenever a new email is in my inbox, and this will get all of the message details, I can actually rename this stuff. So I'll rename this first one watching inbox. Maybe I'll give it a nice little eyes emoji. There we go. So that one's watching my inbox. This one's getting details. Maybe I'll add a little lightning bolt for that and then hit rename. So, this one's watching my inbox, getting details. Next, we need to actually port all of those details into an AI agent so that it's like if we go to ChatGPT, give it some custom instructions for how we want it to respond, paste in our email. That's essentially what we want to do right now, except in the NAN canvas.
So, finally, we've gotten to the part where we can integrate AI into this workflow to make it a Gentic. So, I'm going to hit this plus button in the upper right-hand corner and I'm going to type in AI agent. I'm going to select AI agent, and then I can just go back to canvas. I can click the upper left-hand corner, go back to canvas. And now you're going to see we have this awesome-looking node in here. And now right away you're going to see that we have an issue with this AI agent. As you can see, we don't have any chat model, and we have that little red symbol after chat model, meaning it's required. So now we actually have to give AI capabilities to this AI agent. So when I click into chat model, what you're going to see is all of these different options for models pop up. We have OpenAI, we have Grock, Open Router, Olama, Mistral, Grock, Google Vertex, Google Gemini, Deepseek, and the list goes on. Open router actually gives you access to every model if you'd rather just sign up for an Open Router account and load in some credits there. But for now, we're going to keep it simple and stable, and we're just going to use the OpenAI chat model. So, I want you to select OpenAI chat model. And it looks like we get 100 free OpenAI API credits. So, I mean, we could hit claim. And it looks like we're now using this. But, uh, I'm actually going to show you how to connect the credential. We don't need to use the free credits, but if you want to, you can get started with that. And you can select a couple of the models from the list right here. And that's great, but let's actually connect this thing so we can use its full capabilities.
So, what I want you to do is I want you to go to create new credential. And what you're going to notice is we have an API key right here. Similar to Airtable, how we set that up earlier, we're going to want to create a new OpenAI API key. So, in order to do that, you need to go to platform.openai.com. And as you can see, it's going to look a little bit different. This is like ChatGPT's backend in a way. So, you're probably going to need to sign up even if you're on the plus plan of ChatGPT or the pro plan, even paying 200 a month. You're not going to be able to use the developer tools because you actually need to import credits. So, it's separate from your ChatGPT subscription if you have one. And you could do this on Claude. Pretty much the same process, but you need to log in or sign up for the platform. And I believe you can log into the same account you have for ChatGPT, but it's not linked to your payment at all. Okay.
Once you're logged in, what you need to do is you need to go to settings and then go down to API keys. And once you're in API keys, what you might need to do is actually go to billing or limits or usage and add in some credits, which is pretty straightforward to do. You can just add in $5 to get started. And you'll probably be adding in a lot more once you understand the power of these agents and everything that you want to do with them. And the money truly does go a long way. So like $5 to $10 will definitely get you through this tutorial and even more, especially depending on the model you're using. You can select the lower-end model and be paying like cents per day. So right now what I'm going to hit is create new secret key. And similar to Airtable, you don't want to give this away. So I'm going to name this delete after full agent guide. You can name it whatever you want. Select the project. I'll name it default. And you can do things like service accounts, restricted, read-only, certain permissions, but I'm going to hit create secret key. Then I'm going to copy this and hit done. Like I said, keep this safe. And you can only see it on this screen. So I'm going to hit done. And then I'm going to go back and then paste it in API key here. And then I can name this like connection one full agents guide. And then once I hit save, it should say tested successfully. And yeah, connection tested successfully. Perfect.
So now we have access to an AI model within our canvas. So what I can do is instead of selecting my OpenAI free credits, I'm going to go to connection one full agents guide. And now I have access to all of their models. And if you're going to be using like GPT-3 Pro, you're going to burn through your money a lot quicker. GPT-3 Mini, a lot less intensive. GPT-1 Mini, a lot less intensive. So, I'm just going to be using GPT-3 Mini cuz I do believe it's a pretty cheap model. And then I'm going to click off. You can select anything you want in here, though. You could go GPT-4. The better the model, though, like the more up-to-date the model, the better responses you will get and the better it will understand how to use the tools that we're going to give it in the future. But it does a pretty good job on the base models as well. So, I think GPT-3 Mini will be a good medium. And now when I click off, we no longer have the issue because we've connected the model. I can just rename this model to GPT-3 so I understand which one I'm using. Can actually name it GPT-3 mini. Hit rename. Beautiful.
And now we need to find a way of getting all of these message details into the AI agent and then prompting it for how to respond, how to categorize. We need to give it access to tools. So this is where AI agents become super fun. But this is also really where you need to think about what do you want this agent to be able to do. Well, if we go back, remember we wanted to read all the emails. Easy. We can easily put in that information. We wanted to label them. So, now we're going to have to think of labels, and we want it to draft responses based on current goals and my calendar. So, first let's just get all of our tools together and let's add them to this agent so that it has access to that, and then we can prompt it on how to use those tools.
So, when you're giving your agents tools, think of your tools for your agent as tools you would use if you had to complete that task. For example, if somebody told you to schedule an event for them, wouldn't it be nice if you could first look at their calendar? Well, of course, I would. And that's how you can think of tools for your agents. You always have to ask yourself, "What would I need to complete this task?" Once you've discovered what you would need, you can use it as a tool for your agent, and you need to add it as a tool for your agent. So, this really gets into the concept of granular thinking. Right now, you must think pretty granular when it comes to completing tasks with AI. Every little action, ID, URL, and instruction must be accounted for. And a lot of this you're going to learn as you build, but this might be a little exposing as well because you'll realize you don't have systems built that you probably should. But anyway, let's continue. And we're going to be building out these tools. We're going to build out a Google Calendar tool so that it can search my calendar to check if I have any events. And we're also going to be giving it access to an Airtable tool where it can look over my Airtable database.
And see what current goals I have. So, I have a test Google calendar on that new Gmail that I created, and I just put in some arbitrary information. But let's say we want the agent to have access to my calendar so that it can make decisions on my behalf. Like if somebody asks me, "Hey, are you on for a call, I don't know, Wednesday the 25th at 4?" It's like, "No, well, I've got an AI mastermind scheduled from 4:00 to 7:00, so I'm not available, but I am available Thursday at 4." You know, we want the agent to be able to do things like that.
So, if we want it to make decisions on our behalf, it needs to know what we're doing on a day-to-day basis, which may sound a little scary, but all that means is giving it access to the calendar events that we decide to put in. So, what I can do is I can actually add Google calendar as a tool for my agent. So, what I'm going to do is go back to my workflow in NADN. And what we can do is we can actually rename this. We can just rename this like mini assistant, or you can rename it whatever you want. But that's kind of how I'm imagining this is like a mini assistant. Now, we need to add these tools that I've been discussing. So, let's add Google calendar first.
So, under the AI agent, what you're going to notice is you have something called memory and you have something called tools. So, I'm going to hit the plus button under tool. And then these tools come in the form of these little circles. So, it's not like your squares, but I'm going to type in Google Calendar. And as you can see, we have a nice little Google calendar tool that we can use. And setting up tools is a little bit different than setting up nodes. So, I'm going to get into that a little bit, too. But I'm going to select Google Calendar tool. And now, we have to connect to Google Calendar by adding our credential. So, what I'm going to do is hit this dropdown, create new credential, and then just sign in with Google just as I have been for my Gmail. There we go. We got connection successful. So, now I can go back to NAND. It says account created. So, I can close out of that. And now we can have it do things in our Google calendar.
So, for the tool description, this is where you kind of want to get specific. So, you want to describe what this tool's purpose is. So I can just say instead of create an event in Google calendar, I can say searches events in Google calendar. The agent's going to use this so that when we're instructing it to search events in Google calendar, it's going to try to find the tool with the best description. So that's why I like setting that manually and just ensuring that I have an accurate description of what this tool is going to do. So next, what we want to do is for resource instead of event, we can select calendar. And then for operation, we can just leave that on availability. So if a time slot is available in a calendar. So I can select that. Then for my calendar, I'll just select my test email. And then for start time and end time, as you can see, you can put in fixed things in here so that it uses the exact same uh start and end time every time. You could have expressions. So that's changing every single time. Or what you can do if you really just don't know what you need here, which right now I honestly don't know what I would need here because every email is going to be different. What you can do is you can hit this little sparkly icon and let the model define this parameter for you. Every time the agent runs, it will define the new parameter. So I'm going to say let the model define this parameter. And then I'm going to let the model define the end time parameter as well. So now it's deciding when should it search based on the email. And you can even add descriptions to these if you want, but for now I think we will be okay. So this node is going to use the time zone you have in your NAND settings. So I'm set to Eastern in my settings. So make sure that you go configure that because that could get messy if you're using two different time zones like NAN UTC with your EST or whatever time zone you're in.
So next what we need to do is we need to rename this tool. So I like giving the tool a very specific name. You can go back to canvas now that we have this completely set up. I like renaming it to something that I can call it when we start building out instructions. So instead of just Google calendar, I'm going to rename this to like search_vents and then hit rename. And now we can look for calendar availability and search events. Now we need to add another tool. What we want to do is we want to add an Airtable tool. So, we can create a goals database and add in a few goals for this agent to look at when deciding uh what to respond back the email with. So, I'm going to add in that Air Table tool. But now, all we have is the weather center connection that we created earlier. So, I can create a new table in Air Table and then a new token to connect to.
So, in my crazy looking Air Table database, I'm going to hit create in the bottom lefthand corner and start from scratch. For the base name, I'm just going to name this goals. And then for my table, I will just name this goals as well. So, I guess we'll have double goals here. Actually, I can just name this like goals workspace or something just so we can have uh a little bit of a difference. And then for name, I'm going to change name to goal. I'm going to delete assigne, delete status, and delete attachments. And for notes, I can just rename notes. I'll keep that on long text, but I'll name it to like goal description. And then I can kind of put like my goal and my goal description in here so that uh we can always have the agent using this as a tool. And no matter what, if my goals are updating and I'm adding new goals in here or I'm saying like completed, it won't use that goal in forming its response. It's very dynamic. So maybe my first goal is like get more sponsorship deals and then I could give a little goal description like I want to start getting more sponsors on my YouTube channel and then I could kind of keep on going more in depth if I wanted. So I'll give my channel name and then maybe I am working with another channel but I don't want sponsorships for them. I could say like a lot of sponsors keep coming in for productive dude which is my brother's channel also the co-founder of AI foundations and we want to pump the brakes on sponsors for him and rather make the sponsors interested more in AI foundation. So maybe that's a goal I have. Maybe Carter or Productive Dude's channel is getting a bunch of sponsors, but we want to start pushing them more towards AI foundations. That could be one goal. Maybe I have another goal of decreasing spam emails by opting out. So like I want to email back more promotional offers saying I am not interested in following their instructions to opt out. So maybe I can have that be one of my goals that AI can look at so that if I get a spam a spam email, it knows, okay, I need to reply back to this thing in order to opt out.
So right now I'm creating this little goals database so that our agent can look at it even when our goals update. Maybe this is just like our workspace. You could have this in Notion. You could have this in Google Sheets. You could have this pretty much anywhere. It doesn't really matter. But you want your agent to be in the loop of what's going on. You know, like how are you feeling about certain things? Do you want to take on more opportunities? Do you want to take on less opportunities? What is it that you want? And so, for now, I'll just leave it at those two just so you can see how this works. And again, this is not like a set in stone agent that's going to completely move the needle for you. I'm just trying to show you how it can use tools effectively in order to make decisions on your behalf. So now that we have this goals database worked out, we could even create a form to where we add a new goal anytime that we want to and then our workspace could get automatically updated. But I'm going to go back to the airtable.com create tokens new page that we were at earlier using this URL. And then I'm going to create a personal access token. So I'm going to name it goals db delete. And then I'm going to give it scopes. Remember when we're adding an air table token, we need to give it data records read, data records, write, and schema bases read. We need to give it those three. For access, I can add a base and I can go find the goals database. So, as you can see, we have our goals workspace down here. And then I can hit create token. And then I'm going to copy this. Hit done. And then go back to the mini assistant. Double click into Air Table. And then create that new credential and paste it in here. And then I can just name this goals database. Then when I hit save, it should say tested successfully. Beautiful. Now I can close out of this. And now we get to actually configure the tool.
So this is something that the agent is going to have access to. As you can see, we're getting this spiderlike formation down here where we can just add a bunch of tools and give it different functionality. So, all we wanted to do is be able to search our goals. Right now, you can have tools perform actions for you like create new goals, update goals, um, search goals, delete goals, whatever you want. Right now, we're just going to focus on search functionality with the tools. So, searching events, getting our goals. Beautiful. So, I'm going to set the description manually once again in the Air Table tool. And then I'm going to say gets goals from air table database by searching records. And then for resource, we can leave that on record. And then operation, we can do search for specific records or list all. So this is very useful when you're trying to split out all of your records. And then I can just go through and select the base from this connection which is obviously the goals workspace. And then the table, same thing. I want to select goals. And now you can filter by formula or you can let AI define this model. I don't really want to filter since I don't have that many goals. So I'll just return all and that'll be fine. And now I can click out of here. And this is pretty much ready to go. If I wanted to, I could come in here and execute that step. And just to show you, it's returning all of our records. So it's returning our goal, it's returning our goal description, goal, goal description. So now it's going to be able to use all this data in its response from an external tool, which is Air Table. We can do the same in Google Calendar, but that's going to be a little bit more difficult because you need to provide a start time and an end time. And that's why we're having the AI uh model define what that is.
So now just to show you a quick example, what I could even do is without instructing this agent at all, what I could do is I could add a chat node to this. So I'll in the upper right hand corner hit the plus button and type in chat and we can add in multiple triggers to test this out. So add in a chat trigger here and then click off back to canvas. Drag it by your other trigger or somewhere where you can see it easily and then connect it to the AI agent. And now the AI agent is going to have this chat input field in the prompt. So whenever we message it, it's going to be able to respond. So I could ask it now that I have tools connected. If I open up my chat and ask it what are my goals and send that message off as you can see it just searched that air table tool and now it's formulating a response just as we would in chat GPT. So as you can see it says here are your goals decrease spam and get more sponsorship deals. So it's basically like we have our own little version of chat GPT in this NAN canvas but it has access to my air table has access to my calendar. So, I could ask it like, "What upcoming events do I have?" And I could send that off. And now it's going to use that 03 Mini, the model that we connected, and it's going to be able to search our calendar. As you saw, it just searched that calendar. And this is with no instructions. It's just seeing the tools it has access to. And as you can see, it says, "It looks like you have at least one upcoming event in your calendar. Would you like more details about these events, or is there anything else you'd like to check out?" So, it can see what I have upcoming, which is just amazing.
And what we could even do for the search events tool is instead of doing resource calendar operation availability like I like this one but I think a better one is actually just selecting event and then going to instead of create get many. So like retrieve many events from the calendar and then you could return all if you want. But what I like doing is now I like letting the AI model define after and before once we do resource event instead of calendar an operation get many instead of availability. So I would recommend making that change. I think this works a little bit better. And yeah you can just let the model define your after time. Let the model define your before time. So now that we have changed the search events tool instead of just looking for an available time slot to actually get all of the details of the event, I do believe it will work a lot better, especially once we add some instructions in the AI agent. So that's kind of the next step that we need to follow is giving this agent instructions. And how do we instruct this agent to ensure that it's going to give me a good response each and every time? Well, let's take a look at that because now we're entering the instruction phase of the AI agent journey.
So before we complete any tasks like uh labeling emails or responding to emails, we need to tell it how to label emails and we need to tell the AI agent how to respond to certain emails and how to use the goals database that we've added, how to should it use the Google calendar. So we can set little rules and little guidelines just to keep it on track. But as you saw, I mean, it was good at searching the goals database without any instructions because that's the way this agent is set up is to call functions or call these tools. So here's the instruction basics. Uh you should be following like a simple framework whenever you're instructing an agent in its system prompt. So, if I go back to my NAND automation and I double click into the agent under options, what you're going to be able to see uh when we select add option is a system message. So, a system message is custom instructions for how the AI agent should use its tools, how the AI agent should respond. And you're not really putting in any information in here other than like instructions, examples in the framework that I'm about to show you. If you want to pull in your emails, those need to go into the prompt section because this is like your prompt bar on chat GBT if you want to think about it this way. And these are like your backend instructions. So source for prompt, you could even change that to define below. And now we can pull in a custom prompt instead of just using the connected chat trigger node which we connected a little earlier. But we need to figure out right now how to craft a good system message so that the agent can work like a charm. So I'm going to go back and show you the basic instruction framework. Number one, role setting. Number two, goals guidelines. Number three, and input and output examples in JSON if needing structure. So let's focus on one through three. Right now we need to give this agent a role. So an example I gave was you are an agent that specializes in and then description of what that agent specializes in. Goals your main goal is to create what? Okay, we want it to not only create an email but we also want it to label incoming emails. Guidelines don't do X Y or Z. Ensure responses follow whatever. So you can set guidelines if you want. Let's get into our AI agent and start building out some instructions.
So instead of you are a helpful assistant, I can just put this: You are a personal emailing assistant that categorizes and responds to emails. So that's kind of like I'm setting a role. So now it knows before anything, okay, it's a personal email assistant. What are its two jobs? It's categorizing and responding to emails. I could even go further based on availability from a calendar tool and also a goals database to ensure the emails are being properly responded to and categorized. So now it kind of has its job description and what it's here to do. Before we get into the goals, we can actually give it what it has access to in regards to tools so that it knows how to best use the tools that we've already added. So I can put here are the tools you have access to and then I can list those tools. And here I want to get very specific when listing the tools. So I don't just want to say you can search calendar, you can search goals database. I want to say the tool name and the exact name that we named it in the uh workflow beneath it. So like I don't just want to say like you can search my air table or you can search my Google calendar. I want to say you have access to the search_vents tool and I can rename this air table to goals database. Rename. Beautiful. So these are the two tool names. So that's what I want to use in the custom instructions. I'm going to save this real quick just so we don't lose our progress. And then I'm going to double click into here and open that back up. And I want to say here are the tools you have access to. And then I can name the tool exactly how we named it in the canvas search events. And then I can give a little description. This is used to search for Google calendar events for the user and to check availability. So there's tool number one. I can also list tool number two which is goals database. Then I can say this is used to search an air table database to see and find the users's goals. So now it knows that it can search events and search the goals database. And I can even add a little description like this should be checked to ensure the email responses you will be drafting are in line with the user. So now it knows, okay, if I'm going to be responding to an email, I need to check the goals database. Same with search events. I could even add like a little guideline or rule on the back of this tool. I could say this must be checked uh before responding to emails about anything regarding events or times or days. So I said this must be checked before drafting responses regarding events, meeting calls, etc. So now we're getting some pretty good instructions here. And this is kind of like the foundation for your instructions like role setting, defining what tools the agent has access to and how you want it to use those tools and when you want it to use those tools. And so now what we could do is we could set like a few guidelines, but the agent does a pretty good job at crafting good responses with minimal instructions. That's kind of like the power of these agents. So now what I like adding is input output examples. So like example emails and how it would respond or how it should respond in that situation or example flows as well. Like if I receive an email and it says this check goals database and then form a response that looks like this. Now, right now, let's actually test this out and send oursel a test email so we can get a baseline and see.
Where we're at right now with this AI agent. So, for the prompt user message, we actually need to uh define what the information is that we want to use these instructions for. So, we don't just want to use these instructions for any information. We need to pull in the entire email. So, we can do that by saving this. And we can disconnect this chat node actually and just delete that. And right now, let's just execute the workflow. Get some test data in here. And as you can see, it pulls that to the AI agent. I'll stop that workflow because right now it has no information to work with. It has zero prompt.
So, what we need to do is in the prompt, we need to add in the details of the email so that it can use it, right? It doesn't even have anything right now. It has empty in our prompt in the user message. And we need to make sure that we put this on define below and then define the prompt. So, I'll open this up in a big screen view and then I can kind of describe this email and pull in what I want it to see. So, I can pull in the two. So, I'll label two and then I will pull in the two email address. And then I can enter down a few times. I can pull in the subject line. So, I'm going to go find that. As you can see, we have subject right here. Hey there, Drake. So, I'll pull in that subject. And this is what the result is going to look like. So this would be like us telling chat GPT with these instructions down here or Claude or Gemini like here's the information. I want you to respond to the information like this. Right? That's kind of the idea of it.
So now I can do email body and then I can pull in the entire email body from the getting details node. So I'll just pull in the text right here under the HTML. You could also pull in the HTML if you want your agent to extract links for you. But I'll just pull in the text. And now this is what the email is going to look like going into the AI agent. So now the AI agent has this stuff to work with. And this is dynamic, remember? And so now if I hit execute step on this AI agent, it's going to get to work and it's going to use our goals database, use our events if it needs to based on the email. As you can see, it searched events and as you can see, it searched our Google calendar because the email we were getting said, "How are you doing? Can we link up tomorrow at 10:00?" And so, it checked our availability in our calendar to see if we were available tomorrow at 10:00.
And there's a couple of things going on here. And just these are things that you need to understand when building out agents. Number one is, as you can see, it didn't search our goals database. So, we need to be more explicit saying you must check the goals database every single time before responding to any email to make sure that it aligns with what we're trying to do here. Number two, it searched events, but I didn't give it what day it was right now. So, I don't know if it searched for the right day. So, what we can do in order to fix that is at the very top or somewhere in here, even under the search events field, I could enter down a few times and I could say today's date is and then I can use a special expression. So I can hold shift and put in those two curly brackets and uh that's going to make this little field right here where we can map in a value. So I'm going to do money symbol and then type in now and then select that suggested now. And now it will pull in the date and time of right now today on the dot. So when it's searching events uh it will be able to use today's date. Um, so I can say when searching events use today's date and I'll actually add in the prompt the date of when the email was sent. The date of when the email was sent to find calendar availability based on those factors.
So now it's going to be able to look at today's date and I'm also in our prompt here going to give um email sent on and I'm going to throw in that email sent on date so it can search and filter for events based on when this email was sent because maybe this uh email for some reason got lost in the sauce and didn't get sent till the next day or something like that. But we want to ensure that it understands the date and time of when that email was sent. So now we have email sent on, we have email body, we have everything we need. So now it not only has the date the email was sent, but also has um today's date in here. I also after that run noticed that the goals database didn't fire. And so I can add in a more explicit instruction. I could say this must be checked before drafting any emails no matter what to see if it truly aligns with what the user wants. And so regardless of if it thinks it should, I always want it to check it to ensure that it's not going against what I want.
So now I'm going to hit execute step once again within the AI agent. I could even hit that little play button. We already have the data in here of that email. So, I'm going to save it. Hit this play button. And now, let's see if it searches the gold database. And if not, we can try out some new things. There it goes. So, it searched the goals database this time, which is perfect. We just had to add in a little bit more explicit of instructions. And now, let's see how that email came out. Responding to hold Johnny, who wanted to meet up at 10 o'clock, says, "Hi, Johnny. I'm doing well. Thanks for asking. Linking up tomorrow works perfectly for me at 10. Let me know if there's anything specific you'd like to discuss or any agenda you have in mind. Looking forward to catching up. Best regards, Drake." Perfect.
So, we now have a good little email response in here. But watch this because I want to show you the power of an agent. Maybe uh on my own time or, you know, if this automation's active and running, it's always going to have access to this database. Maybe I have a temporary goal of not accepting any meetings outside discussing YouTube analytics. And then I can put like I don't want to meet up with anyone unless it's to discuss YouTube growth. And now if I have that as one of my goals and I go back and now I fire off this agent with the message of Johnny asking me, "Hey, can we link up tomorrow at 10?" Let's see if the response changes. So I will hit this play button and let's check and see. Hopefully it checks the goals database and searches the events. I think it will since we gave it pretty explicit instructions here. So it's checked my goals database. Let's see if it picked up that new goal, searched the events, and Johnny didn't say anything about YouTube analytics. So, it should respond back um in regards to that new goal that I added about only wanting to meet up if YouTube analytics were discussed. So, I'm going to double click into this AI agent. And as you can see here, it's responding to this email. It says, "Hi, Johnny. Thanks for reaching out. I'd be happy to catch up if we can focus our discussion on YouTube analytics and growth. If that's what you had in mind, please let me know and we can figure out a time that works best." So, now it's gearing its responses towards the goal in my database, which is perfect. And so this is working okay and it's a very basic agent, but we need to add in more grand functionalities here.
So we have this very basic agent that is responding to emails in kind of just a way that we didn't really define. Maybe we want all of our emails to be a certain length. Maybe we want to add certain information in our emails like a custom sendoff line, add our contact information at the bottom of the email. We can do all of these things and we can have it form that email for us in any way that we want. But remember, we also want to label and categorize this email. So, we need to define how do we want to label each email. Do we want it to be like archive, spam, meeting, invite, sponsorship? So, let's get our label ideas on a canvas just so we can kind of see how do we want to label these incoming emails. And you don't necessarily have to follow my exact email labels. You can create a few of your own if you'd like. But what I want to do is I want to get into the next phase of this agent with structured outputs, labeling, and multiunctionality.
So with this agent, I'm thinking I kind of want to label my emails with a couple of categories. Number one, we kind of need a spam category. Um because yeah, there are just spam emails. So maybe I just go spam uh sponsorships. And you could have as many categories as you want. I'll probably just do a few for the sake of this video. So, I'll do sponsorships for the money green. And then for the next one, how about we just do like meetings? So, like do people want to schedule meetings with me? And what I could also do is I could do one more and I could just do like promos just so I can label certain things as like promotional things maybe that I signed up for in the past. And so, good, we have these categories now. So now we need to tell the agent in our instructions that not only do we want a response, but we also want to label these emails in one of these uh four categories. And maybe we even have like a check later category. Um if it can't decide what type of email it is, we could add in that check later category. So I'm going to go back to my AI agent now and we're going to instruct it these things. So I can kind of list its goals and its responsibilities. So I made a section called your jobs. And for the first job I put respond to the email always using the goals database tool to ensure it aligns with the user. When responding to emails that require time availability, always check the calendar. And then I give some instructions on how to create these emails. Make these emails short, snappy, and down to earth. Add one fitting emoji per email so we can get custom and throw in some fun things if we'd like. And the next goal I want to describe is categorizing the emails. So I said next, you must categorize which type of email this is by adding one of the following labels to each response. So now here is where I want to enter down and describe what labels we have. So I'll say label one and then I will put maybe spam. And then I can kind of describe what spam looks like in my eyes. So the assistant or in this case the AI agent knows how to label something as spam. So I just said anything that seems spammy, sketchy or unnecessary based on my goals. And then I can just keep on going and doing this exact same thing for all the labels that I want. So next maybe sponsorships. And then I could put anything regarding sponsor deals. And then I can keep on going with all of my labels here. So, I'll do promos. Any promotional information that is about products or services. And I'm going to put all of these labels actually in quotes so it knows like the exact name that it needs to label that. Label four, we have meetings. Again, I'll put that in quotes. Then I can say anything that requires me to be on a call, show up to an event, etc. And then finally, label five is like the catch all for things that it doesn't know how to label, and that can be the check later. And then I'll describe that as anything that falls outside the other four label categories. And so this is just like one step of its responsibilities is to label emails. And as you can see, I'm being very specific on what I want it to label so that it's consistent across the board.
And honestly guys, this stuff might seem like a little boring writing instructions, but this is where you are literally creating another version of yourself. So this is like one of the most important parts of building agents is learning how to craft good instructions to yield amazing results, right? like this is going to be a little version of yourself that has access to your tools. So keep this in mind that it's as fun as you make it, number one. And number two, you have to be very specific and very granular if you want this thing to operate like you or like another human with advanced reasoning. And so now that I've given it jobs, how about we send a couple of test emails just to watch how it works? because we're going to run into a problem here that I want to talk to you about and I'm going to show you how to fix that problem. Because right now, if we want to label emails and we want to respond to emails, right now it's going to be putting the label and the email in the exact same result. So, as you can see, we only get one output here. So, how are we going to pull the label and use that in another uh node to actually label the email if all we have is one output with the body, right? Everything gets really confusing. But that's where we get into the output format right here.
So, let me just do something real quick. I'm going to go email myself. Maybe uh Test AI Foundations is like a parent company for the Productive Dude YouTube channel and the AI Foundations YouTube channel. Let's say we're getting a sponsorship request for Productive Dude. So, I wrote my test email. Would love if you featured us on Productive Dude. Would you be interested in sponsoring our app, Funny AI? We create memes with the power of AI. Interested? We have 5K with your name on it. Thanks, Funny AI Squad. Sounds like a pretty good deal to me. But I'm going to send this email to my test account and then we will see it come through on NAND. And now I'm going to go back to NAND and hit execute workflow with those new instructions. Make sure that you're saving this throughout uh the process of building it. I'm going to hit execute. And now it's going to watch my inbox, get that new email. Let's see if it did pull in the new one. Um, it looks like it did. Says we have a 5K uh sponsorship with your name on it. There we go. And now the AI agent has ran through. And since I didn't have anything regarding time, like any availability or anything, it didn't search the calendar, which is perfect. But it still searched the goals database. Let's see the response it gave us. It says, "Hey, funny AI squad. Thanks for reaching out. We are currently not accepting sponsorships for productive dude as we're focused on partnerships for AI foundations instead. Wishing you good luck and please opt me out from future promos." Wow. So, as you can see, it took my goals into consideration like as much as it possibly could because remember my goal was to get more sponsorship deals, but in my description I said a lot of sponsors keep coming in for Productive Dude and we want to pump the brakes on sponsors for him and make the sponsors for AI Foundation. So, this is perfect. It also uh worked on opting me out of promotional or sponsorship deals that weren't interested in AI Foundation. So, this is amazing how it works. But right now, what you're going to notice is it gave the label as sponsorships, but how can we pull this sponsorships label, right? Because if I add a new node here, let's say I just add an air table node just for fun, just so I can show you. Create a record right there. If I'm trying to add in a new uh sponsorship label to one of my emails, what you're going to notice is we only have one output from the AI agent that we pull in. And we can't really extract this label because it's stuck within this single output. So that's where we need to learn how to create structured outputs in order to separate the body from the labels and the subject line from the body. So that we have three things that we can dynamically pull. Similar to how we have all of these fields that we can use in the email, we want to make sure that we have all of those fields that we can use in our AI agent output. And so we can instruct it on how to respond and how to create these JSON structures. If I go to JSON, you can see we only have one output. So how do we create multiple ones depending on all the info that we want separated out?
Well, now I want to show you how to create structured outputs with your AI agents, which is a crucial step in learning NADN in AI agent building. So, I do have a little bit of a presentation for you once again in order to visually internalize the knowledge. But if you double click into this AI agent, what you're going to see is a little switch that says require specific output format. When we tick that on, it says connect an output parser on the canvas to specify the output format you require. So when I select output parser, it gives us three options right here. And what we want to do is just select the structured output parser. And when I select that, this box will pop up. And we will have some examples in here. I can just not worry about that right now. I'm going to explain what this is all about in a second here. But when I click off, as you can see, it adds a new section to our AI agent called output parser. and we can have it respond in a set structure for us each and every time. So that is absolutely amazing. But how do we create the structured output? Well, it's a combination of understanding what this structure is and also prompting in our system message how we want this AI agent to respond. So remember in the basic instruction framework how I kind of skipped over input and output examples because we weren't at that step where we needed that structure of separating it out from the email bodies to the subject line to the labels. We didn't need that yet. But now we're running into that problem where we have one single output and we need to separate those outputs. So we're going to need to start understanding JSON. And don't worry, I'm a non-developer. I'm going to walk you through this how I understood it. I took about an hour prompting back and forth with chatgbt and I learned it pretty quick.
So, let's get into the JSON basics. This will go quick, but you have to understand this uh at least what it is so you can ask AI about it. JSON stands for JavaScript object notation. That's not important, but it's a lightweight format for storing and transporting data. Humans can read it easily. AI loves reading it. It's actually what NAN is built upon. With JSON, AI can parse and structure your data into multiple fields that you can easily map. So, as you saw in that example, the AI agent gives us one output by default. It doesn't give us multiple fields that we can dynamically drag and drop into other fields in other applications. So, we need to make it do that. And this is going to be great for filtering, routing, exporting fields, and more. Think of it like a form. You don't tell people to input all of their information into a single form field, right? You don't just make a form and have one field where you just say like h just you know comma separate your answers like what's your full name, what's your age, what's everything allin one. You break it up into key value pairs. So on a form for instance you have full name. That would be your key and the value would be whatever the user types in as their full name. Then you maybe have another key age. The value is whatever they type in for their age. You might have another key pair. What are you interested in? What are you interested in being the key, the value being whatever the user is interested in who filled out the fields above. So, as you can see, you break up a form like that. And that's how I want you to think of JSON and AI agent outputs. So, let's get into some more JSON basics. The fundamental building blocks of JSON are objects. And objects are the things that fall within these little curly braces and arrays. And those
Are the square brackets? Everything in JSON is either a JSON array, so like item one, item two, a primitive, which is a string, number, boolean, or null. You don't have to remember all this, don't worry. Or a JSON object, key value, another key, another value. It's basically just a bunch of key value pairs or a bunch of form fields, right? With the form title, the form field label rather, and then the uh value of that field.
So, let me just give you an example, and this is going to help you break it down. If we wanted to classify me by my age instead of a natural language sentence like Drake is 21 years old, because if we were to map this, I would only be able to map the entire sentence. So if this is one object, okay, Drake is 21 years old is one object. I can't map my age into an age field. I can't map my name into a name field. I just have this one sentence. But instead, we could break it up into JSON object format. And so if I wanted to separate it out, maybe I tell the AI agent to separate my name. So now I could map Drake into a field and my age. So now I could mess around with my age and I could create my own sentence like hey there, and then I could write name. Hope you're doing well. It's interesting because we don't have many map in age year olds here. So like you could get really custom with this.
And this is the idea of JSON. We want to create these structured outputs so that we can map fields to different sections. So we do that by structuring our outputs with the structured output parser. And we can force the agent responses to be structured and consistent by using JSON. In our example, we want our agent to label our incoming emails and draft responses. So these are the two objects that we need. We can have a label as the key and we can have whatever that label is as the value, similar to draft responses.
So to ensure that these two things happen every time, we can use something called a structured output parser, which I've already showed you. And the structured output parser allows us to tell the agent which fields or key pair values we want. And this is crucial for consistency and for ensuring that we have multiple unique fields we can use for mapping to other applications. So in this case we need a label and a response to be in separate fields because right now, as I've been showing you, right now we only have output, but we want label and we want response. So how do we do that? Well, first we have to define how we want the fields to look in the structured output parser by just providing an example. This information in here doesn't matter. This just shows the structure. So right now we have an object, a key value pair state. What's the state? California. Cities. What cities are in California? This would be an array. And we don't even need an array for this example. So, we have like Los Angeles, San Francisco, San Diego. We could actually create an array with like email details. We could have subject line, email body, to or from email. Like, we could do whatever we wanted.
So, I'm going to start fresh. And for your JSON example, in this case, if we want label and response, then we want to hold shift, do the curly brace, and close off that curly brace. We can enter down a few times once we select in the middle. Actually, just enter down once. Then you're going to need a quote. You want to type in label, another quote, a colon, and then you can just give an example of any of your labels. It doesn't really matter. Maybe I can just do promos. And then I want to close that off with another quote. Since this is a string. Next, since we want to add another value, our response, we need to put a comma. And that signifies like, hey, we're not finished here. I can enter down. And then I can do another quote because I'm labeling my field name. So, you put quotes around your field name. And from there, what I can do is I can just name this response. And then put another colon and then just put like response. Doesn't really matter; you're just showing that this is going to be a string and closing it off. And since this is our last field, we don't need to put a comma after it. So I can take and copy now, since we don't have any errors, this JSON object in our structured output parser. I can go back to our instructions and in the system message I can click in and now I can tell it how to respond. I can say you must respond, and this is crucial. You have to say this in JSON object format. If you have a structured output parser and you want it to respond in JSON object format, you have to say JSON within your system message. It's actually like a rule; like it won't work if you don't say that. So I can say here is the structure that you need to categorize each part of your response in. And then I can put a colon and then I can just paste in an example of that JSON structure. And instead of promos I could even just put like label here and then response here in the instructions so it understands like okay I'll put a label here. I'll put a response here.
And so now with that same email, as you can see right now, we have output. We have, "Hey, funny AI squad." So now that we have all of this done with, we have our label, we have our response. I say, "Here's the structure you need to categorize everything in. We have our structured output parser on the other end." What I actually recommend doing here is going and changing the model instead of 03 Mini. 03 Mini is not the best at tool calling while having structured outputs. So I'm going to change the model to GPT 4.5 preview. And that's a little bit better in my opinion at creative writing as well. So, it's going to help us when it comes to drafting emails because it's geared more towards that creative writing and research tasks. So, um I'm going to select GPT 4.5 preview as my model and then I'm going to execute this workflow with the structured output parser. And what I want you to notice, so this is no longer 03 Mini, but rather it's uh 4.5. But now that we have the structured output parser, it's still checking our goals database, and I click into the AI agent. What you're going to notice is we have multiple fields under output. Now we have label and we have response. So now I can dynamically pull in the label and map it to something. I can dynamically pull in the response and map it to another thing as well. This is the beauty of having structured outputs. You can get very crazy with your structured outputs. I've done some where I have like 30 different fields and it just gets absolutely insane.
So, if you ever need to craft these, what I recommend doing is going to AI and asking it to craft a JSON object with these fields. Whatever fields you want to have control over, ask it to create that structured output around that and then add in the exact same instructions like give it the structure you want to use while saying you must respond in JSON object format. And that's the secret sauce to getting multiple fields from your AI agent in the output section.
So now we need to add the last part of this agent, which is drafting up emails and labeling them for us. So what we can do is since we have the ID of the message we got ahead of the AI agent, we can add another node to the back of this AI agent after it gets all the things we need. So I can add another node and I'll type in Gmail. And what we want to do is we want to reply to a message as a draft. So under draft actions, I'm going to select create a draft. And then what we want to do here is we want to keep our resource on draft operation. We can do create subject. You see that's another field we could add. Right now we just have like body and label, but we could add a subject field so that we can dynamically pull in a subject. But right now what we can do is for response we can drag and drop response into the message. So now that's going to be changing every single time. And now for options what you want to do, like we have the draft being created now. Subject we can just leave it testing. Since we're actually drafting our reply we don't really need a subject line, but it might make us put one. So, I'll just put test, and we could create our own subject line like I said with this output label response. We could create one for subject and have it uh be baked into the instructions where it creates a subject line for each one as well. Uh two-word, three-word subject line.
So, next what we need to do is we need to add an option. And the first one we need to add is thread ID because we're going to need the thread that we're replying to so it can stay all within like one, well, email thread, right? And we can do that by going to getting details. We can go to that getting details node because this has all of the info of the email and we can just pull in this thread ID right here. So I'm going to drag and drop thread ID into thread ID. And then I'm going to add an option. And I want two email because we need to send this to somebody. And the two email will be required if we do want to send it. So this two email needs to be the from email in getting details because that's who we want to send it to is the person who we got it from. I'm going to close down everything and I'm going to find the from email. So from value and we have the address. So going to drag and drop the from address right here. Make sure those are on expression so they're always changing. And now I think we're ready to go. So what I'm going to do is I'm going to click out of here and hit save. And this I'll actually rename to create draft, can get Q, add in a little paper emoji or something uh like that. Hit rename. And now I'll hit save. And let's go send myself another test email. So I will from in my two uh send it to my test email and then I'll say like yo trying to hang I want to get together and discuss a new idea I had in mind and then I can send that off. And now since we sent that email what I can do is I can go in here and I can just hit execute. If it were active it would be running on that one minute timer so it would pick up all the new emails that you need. But for now, I'm just going to execute for testing purposes. It's going to go through, pick up that email, and by the way, we're using 4.5, not 03 mini. But it's going to search my events, search my goals database. Now, it's crafting a response, created its structured output, and created a draft. So, right away, let's not even look in here. Let's just go to my email inbox where it created the draft. So, we got the email yo trying to hang. If I refresh, as you can see, we have a draft already uh created. So, people are getting messaged instantly based on my goals. So, I click in here, it says, "Thanks for reaching out. Right now, I'm focusing on meetings about YouTube analytics. Let's chat later if you have ideas on that front." Since we put in the two email right here, I could just send that off if I like it. And we could even have NAN send it for us, but I like the review process as well.
So, next we need to label these emails. And we've done that in a previous automation we built in this video. That's quite simple. So now in order to add that label to this thread, what we want to do is hit this plus button and type in Gmail. And we want to select Gmail. And under thread actions down here in the bottom right, let's hit add a label to a thread. We don't want to label the message necessarily, but kind of like what the whole thread is about. We could go labeling individual messages, but I'm just more so interested in labeling the overall thread. So I'll add a label to the thread. And once again, when we create the draft, we get the thread ID in here. So I'm going to map in the thread ID, which is different than the message ID. And I'm going to put it right there. And for label names or IDs, we can now select them. And remember, we have our high budget lead, low budget lead, medium budget lead from earlier. But what I can do is I can go back to my email and I can create some new labels here. So like I said, I wanted one for meetings. I wanted one for promos, which it looks like they already have a system label for promotion, so I'll leave that. That's fine. I wanted one for sponsorships, check later, and spam is already in here, so I don't really need to add the spam one. So, what I can do right here is I can make these any color that I want. Maybe I want that check later red. Meetings, maybe we want a nice blue. Sponsorships, we want that green. I'll make it a different green than the high budget lead though. And now we want to make sure these labels are the exact same names as we told it to write our labels and our instructions. So if we go to our instructions here, remember we told it we have label one spam, sponsorships, promos. So we want to make sure we name it exactly how we named it in our instructions. If you really want to get uh consistent with it, show examples of how to write each label in multiple different JSON objects. So like you could copy this and say like here's how to write the labels and then you could just show exactly how you want each label to be wrote. So like number one sponsorships and then you could just keep on going down the list. Same with spam and promos. But we won't do that for now. This should work.
And so when we get to the point where we need to label these emails and categorize them using the labels that were created from our instructions, remember we have these labels being created. What we need to do is similar to what we did in our automation step of this full course. We need to set up a switch node right here. So I'm going to hit the plus button and type in switch. And then we're just going to route uh the agents direction or this uh backflow's direction based on the label that was given in the structured output parser. So we can do that by just putting in our values. So if label is what we want to check by is going to be the value one of all of our routes. So if label is equal to spam, then we can go down the spam route. add a routing rule. If label is equal to promos, then we can rename that and go down the promos route. And we can just keep doing this for all of the cases that we have. So if label is equal to check later, which in this case it is, then we can go down the check later route. And we can just keep on adding all these routing rules like I was saying. So label if it's equal to what other ones do we have? Sponsorships. Beautiful. Then we can go down the sponsorships route. So I'll copy that output name. Add a routing rule. Final one if it's equal to meetings. Then we want it to go down the meetings route. So a lot of different uh routes it can go down here. But we can uh decide what to label it based on the route it goes down. So now we have all of these different ways that it could go to get labeled. So, we could name this switch like the labeler if we wanted. And then for spam, what we want to do is we want to hit this plus button, type in Gmail, and then we want to add a label to a thread. So, down here at the very bottom under thread actions, we see add label to thread. So, I'll select add label to thread. And then we want to pull in some execution data. So, what we want to do is just run this switch node if we already have test data in here. So I can run that switch node so it can pull it to this setup right here. And then for spam I can drag drop and for thread ID we can go back to the creates draft node. And remember like these are all nodes that we get to dynamically map data from that previously ran in this automation. So this is excellent. But we want to go to this create draft uh node right here and pull in the thread ID. And so I'm going to drag and drop that thread ID right there. So that if it goes down that route, it will pull that thread ID. And since we're on the spam route, I can just manually select the spam label. So I'll label it as spam, just like that. And then I can click off. And then I can do the exact same thing for all of the other ones. So I'm just going to duplicate that node, connect it to promos, and then all I'm going to do here is switch the label. So I'm going to delete that. type in uh promotions. That'll work in that category. And I can just rename the nodes accordingly. And it's basically going to be the exact same process for everything. So, I'll be back when I'm finished uh adding all of these nodes. And just keep in mind that all we're doing here is duplicating them because we're pulling the thread ID from this node right here. And so, that's going to stay the same. The only thing that's changing in this is the label itself. So when we duplicate, we just double click in, get rid of that category or that label, and then go find the right label, and then add it to the specific route. So we want to add the check later label to the check later route.
Okay, so I've added all my labels in here. Now I'm going to go in and change the last one and look for my meetings label. Add it. So now anytime it goes down the meeting route, this label will get attached to it. And boom, we have this nice little agent built that can respond to emails for us and also label them. And the instructions can go a lot more in-depth than this. These are pretty basic instructions. And if you want it to sound like you, then you can also do that as well. I mean, that's a little bit more advanced because you've got to provide input output examples. But this is a pretty good start and you can get a lot done with providing basic instructions on how to use tools and so on.
So, I'm going to go send myself some emails. The first email is uh me wanting to book a meeting with myself to talk about YouTube analytics. I say I want to go over our channel's growth and discuss it tomorrow around 6 p.m. if you have some time available. Thanks, Drake. John, so if we go check my Google calendar, tomorrow around 6, since today's the 21st, tomorrow around 6, I have nothing. So that should technically come back as okay, we can do the meeting. And remember, it's taking into account all of my goals. It's taking into account my calendar. And so when I send this email off, I'm going to hit send. This email is going to hit my inbox. And the automation we built is going to be looking for these incoming emails. So as you can see, it populated in my inbox. Let me go to NADN and execute this workflow manually. The route that it should go down is the meetings route and it should say that I am available because it's talking about YouTube analytics. We'll see if this all works out on this first test. But do keep in mind this does take some iterating to get exactly how you want it. So if it doesn't do exactly what you want it to, you may have something wrong. You may have a misspelling or there might be something a miss. But as you can see, it got stopped out at the labeler. So if we click in here, let's go see why it got stopped out. And it looks like because um I made my result, it has to be equal to meetings, but it output it as meetings since that's probably what I told it to do in the instruction. So if I go back, as you can
See, I had it labeled as just "meeting," not "meetings." So, if I switch that in my switch to "meeting" instead of "meetings," now I hit execute step, it should go down the meeting route and label that thread for us. So now that issue is fixed forever. Beautiful.
And now let me actually go into my email and see how that worked. So if I refresh, as you can see, we have a draft in here. Now, and it says, "Hey, John, I'm clear tomorrow evening at 6 p.m. Let's discuss the YouTube analytics." Then if I copy this same email and I say, "Tomorrow at 10:00 a.m., I should be booked on my calendar because on my calendar it says I have church." But let's see if that's true. So another message, "Can we talk about analytics?" in the same message, except I'm going to change this to 10:30 a.m. And so now when I send it, the assistant should check my calendar and see that I am busy and not allow that event to happen, but still want to do the discussion since it is about YouTube analytics, but I'm just not available at that specific time.
So, let me execute this workflow now and see if it goes down the proper meeting route and also says, "Hey, I want to discuss, but I'm busy." I'm going to execute the workflow. It searched my events. So, it should have that data in here about what I have going on the next day. And it looks like it went down the proper meeting route. And so, the response came back. As you can see, it labeled it "meetings," which is perfect. Two, "Hello at AI Foundations." Great. The uh from email and it says, "Hey, John, tomorrow at 10:30 a.m. works great. Looking forward to chatting with you about the channel's growth."
And the reason I believe that it accepted the meeting and said it works good even though I have something on my calendar at 10:30, which would be church, the reason that it accepted it probably was because this is a new NAN account and I haven't yet changed my time zone to EST. So whenever I go here it says today's date is and right now it says it's 5:45, when in reality it's only 1:45 for me. So the date is off by about 4 hours. Therefore, I would have been available 4 hours after 10:30 UTC time. So, uh that looked a little bit like a problem, but I can see now that UTC EST that was the issue we had here. So, you can change your time zone to ensure that the date now in your instructions matches your correct time zone on your calendar. But everything worked out great. I mean, the thread got labeled. We just have a little bit of a time zone issue, which is not a problem. And it replied with the draft, so I could send that off.
And the cool thing about agents is like you just keep adding on to these things, right? Eventually, you just have it hooked up to your Zoom, hooked up to your Google calendar, so it can schedule in events for you, create those Zoom meetings, add them to the Google calendar, invite the guest, and do all the preliminary stuff that you should not be spending your time on. I mean, even that agent alone, perfecting it, I'm sure you could spend hours just adding little things. And I recommend you try little things, right? Maybe add in another tool to that agent where it can actually create Google calendar events for you. And in similar fashion to the way that we did the search Google calendar events tool, maybe add in a create operation.
But nonetheless, we have built out our first agent. Not only can it read emails, respond to them based on our goals and on our calendar availability, but it can also label them as well. So, I hope you enjoyed this section of the course, and it's only going to get more fun as we keep progressing. Congratulations on building out your first agent. We now have such a good foundation that we're going to start being able to build these agents faster, communicate with them better, and get even greater results. So up next we have communication mediums and also multi-agent hierarchy. So other agents can talk to other agents and tell them when to run, or other agents can use automations as tools in your workflow. So I'm super excited to get into this. But without further ado, let's get into communication mediums. Well done on building your first ever agent.
Now the next thing we need to talk about is communication mediums. You might be wondering, "What am I talking about communication mediums? This sounds like some spiritual ritual or something." Well, what I'm actually referencing is how can humans talk to agents, right? What are the different channels that we can use in order to communicate with these things? Because yeah, it's cool setting things up on a schedule or setting things up on a trigger. So, like, okay, when I get a new email, then my agent will begin. But what happens when you want to actually communicate with these things and you want to talk to it or give it commands or ask it questions? Well, that's when you need to understand the methods of doing so.
All right, let's learn about communication mediums. This is going to be a quicker section because I'm just going to tap into the ways that you can begin speaking to your AI agent. I'm going to show you two of the ways. One of which has been used in the AI agent space for kind of a long time now. The next way that I'm going to show you is a little bit more complex, and I think it's going to become relevant in the next two to three years dramatically more than it is today. So I want to get you some insight into the future and kind of show you how I think option number two for communicating with agents is going to become more relevant to everybody rather than just developers. So we are entering a new era where humans are talking to agents more and more every single day. The question is how do we communicate with these agents? Well, the good news is there are multiple ways already existing and some ways in which you can actually create, which I'm going to show you a way that you can create. How can you create your own chat interface and dashboard to begin speaking with these agents? I'm going to show you that today.
So, here are some of the interfaces for human-to-agent communication. You have Telegram, number one; everyone's using Telegram, but then again, you have to be careful because sometimes the agent is public, and if people have your agent URL, then it's like they can speak with your agent and then use up all of your OpenAI tokens if that's what you have connected to your agent. Number two, WhatsApp. WhatsApp, a little bit more difficult to set up, but you can use WhatsApp to talk to your agent and get responses back. Slack. Again, Slack is a little bit more difficult to set up, takes a little bit more time, but there are methods of connecting it. Number four, native NAN chat node. So, you saw me use this earlier when we were testing out my agent. And this is essentially a chat window in NAN that you can use to communicate with your window. This is very, very useful for development projects where you're working on just getting the functionality correct in the back end. You could set up like a little chat UI in NAN, and it's it actually works very nicely, and sometimes that's like where I start my agent workflows is just entirely in NAN. I don't really try to do anything fancy. Number five is vibe coding, a unique interface. Now you might have heard of the word "vibe coding," but if you haven't, then I'm going to explain that a little bit later. So first let's learn how do we connect Telegram to an agent.
This is probably the easiest one to connect, and it's very nice because what you can do is you can use your cell phone when you're on the go, and you can text your agent if it's in the cloud. You can have it active and running at all times. So, it's pretty amazing what you can do, being able to speak to your agent on the go or being able to tell it to do something like, "Hey, can you add an event to my Google calendar?" Or, "Hey, can you search what I've got in my CRM for this person? I'm about to meet them; give me a quick briefing on everything I should know about them. Or do some data enrichment for their company that this person works for in my CRM and then bring that back to me because I've got a meeting coming up, and by the way, schedule my Zoom meeting, right?" Those are the things you can do from your phone on the go. And it just depends on what you want to do. Like you could have your agent do literally whatever you want. I'm always using the basic examples of Gmail, Google Calendar, CRM, you know, just because it's the easiest for you to visualize. But I've set up agents that are doing, you know, 10 to 15 minutes worth of deep research for me, going out and getting citations, printing them in a nice PDF, and then it delivers it to me in a PDF format. Like, those are some unique things that I've been doing, or a unique thing that I've been doing. So, it really just depends on what you want to build. And that's what makes agents so exciting is it allows people to be creative. Technology in general, one of the least regulated spaces, it allows humans to be super, super creative. So, you're going to have to let your creativity flow. But enough with the rant. We need to connect Telegram before we do so.
So, like I said, this is by far one of the most popular methods of communicating with agents. You can use your computer or phone, making it very useful on the go, like I was just talking about. So, let's learn how to connect it together. So, if you aren't already signed up for Telegram, I recommend just signing up real quick. The URL is telegram.org, or and you can even download it to your desktop whether you're using Mac or Windows, and it feels a little bit more local that way. So, I like doing it when I download it to my desktop rather than using the web app. And you can even download it to your phone and sign into the same account. But that's a preliminary step. Get signed in; it's just like any other account.
So, after you create an account for Telegram, the next thing that you need to do is you need to use one of the links in the description. I will provide it. It should say something like "botfather." Okay, we need to use this botfather bot in order to create our bot that we can talk to. So, get this ready, and we will get to this point in a bit. But what we need to first do is create our NAN automation before we connect the credential because right now we don't have anything to connect the credentials to. So, let's go get set up on the NAN side of things.
So again, we're on my NAN dashboard, and what we need to do is go down to our project, or we could just create the workflow here, but I want to keep things organized. And then I'll go in my agents, and I will create a workflow. I'm going to rename it in the upper left-hand corner. I'm going to click my workflow, and I'm going to rename it "Telegram bot." And then I can just add a tag for CM, communication medium, if I want to keep things really organized. Do this for a as well. Perfect. And what we need to do is we need to add a first step. And so that first step is going to be a Telegram node. So I'm going to type in "Telegram." And I recommend that you do this and follow along because at some point in your journey, you're going to need to connect an external application to communicate with your agent if you want to be taking full advantage of this. So Telegram is an easy way to get started. I'm going to select the Telegram node. And what we want is "on message." So this is going to begin on message. So I'll select "on message" here. And then here's where we need to actually create our credential. So I'm going to select "create credential" and "create new credential." And here we just need an access token. And remember when I told you to pull up the botfather like two minutes ago? Well, this is where we need the botfather. We need to create our credential. So if I forget to provide the link for whatever reason, it's telegram.me/botfather with a capital B and a capital F, no spaces. And when you sign in and download it to your computer, Telegram, you have the ability to hit "start bot" and then just select "open Telegram." And that should bring you to the botfather here.
So as you can see in the upper left-hand corner, we have the botfather. And now we need to hit this big blue start button down below. And so as you can see the botfather can do all sorts of things, but what you want to do is you just want to type in /newbot. And this is going to create a new bot for you. I'm going to select that. It says, "Please choose a name for your bot." So, what do we want to call our bot? Well, for now, we can just call it "communication medium." You'll probably have to name it something else because I don't think there can be two bots with the same name. I'll just put "test" for mine. And then I'm going to hit enter. "Communication medium test." And then it says, "Good. Now, let's choose a username for your bot." And this must end in "bot" like "Tetrisbot" or "Tetris_bot." So, I'm just going to copy my "communication medium test" over here behind my head in the bottom right corner. I'm going to paste it in and then I'm just going to add "bot" at the end and then I'm going to send it off. It says "done." Just like that, we have our bot. And here you want to be careful because this access token right here is something you just don't want to give out. Otherwise, people will be able to use your bot. And also if they get to your link in general. So, you want to make sure that you have a unique variable that you can pass if you're trying to make this go public to ensure that the people typing on your actual link for "communication medium testbot." Like, because if we open up this page right here, I could open up um this, and now we're in a message chat room with my communication medium bot. And so, if people get access to this, then they could be using your NAN workflow. So, you do want to be really careful. And um I'm going to go back for now and go back to the botfather because what we need to do first is we need to use this token to access functionalities with our bot. So I'm going to just select this. As you can see your mouse will change, and that will allow you to copy that, and it's this entire code underneath that line. But you can just select it, and it will copy it to your clipboard. Now we need to go back to NAN and paste that into our access token. And so right here after we hit "create new credential" on the Telegram trigger, we just need to paste in the access token, and we can rename this to whatever the bot name is just so we can stay consistent. And then I will select "save," and it should test successfully. And beautiful, connection tested successfully. Love it.
So what we have now is this workflow is going to begin on a Telegram message. And so now that we have this completely connected, what we can do is we can go find our bot over here. You can even click this t.me uh and then whatever your bot name is, you can click that link. And now when I hit "start," we can now start a conversation with this. So what I could do is I could just say "hello there." And when I send this off, if over here on the left I hit "execute workflow" since we're not active right now, what's going to happen is we're going to get two messages since we have this message come through and this message. So we can begin our automation using this data. And as you can see it says "two items." So when I click in, we just have all of this chat data in here. As you can see, we have "message" and the "message text." And the chat text is actually what we're looking for. So as you can see, we have "hello there," my message right there. Or I could even say "how you doing," and then I could execute this step again. And what you're going to notice is we get that text in here for "how you doing." So just like any other workflow, we can map this into an AI agent. But let me show you how to make this even more useful. So if we want to be able to accept like our voice in here instead of just text, we can do that by adding a couple of different nodes. Number one, we need to open up this nodes panel on the side and type in "edit fields," the set node. We want to make sure that we add this. And I'm going to tell you why in the future. But before we actually put this text into an AI agent and have it do things for us, we need to set it so that it comes in the same both with text and with voice. So when I connect this to the "edit fields" node, as you can see, we can configure the field names here, and we're going to do that in the future. But what I want to do right now is I want to add a route for taking in multimodality. So, let me just show you what I mean. I'm going to send a message here with my voice. So, what I'm going to do is I'm actually going to record a little test audio down here just so I can show you what's happening. So, I'm going to record. "Hi there. This is a test. Let's do this thing." All right. So, now we have that audio in here of me speaking. And what you're going to notice is when we hit "execute workflow" and we click into here, it's looking a little bit different, right? Like we have "file ID." We don't have any text. It just says "voice." Now there is a chat, but the chat is just like this little audio file right here. So what we need to do is we need to set up like an "if" node that tracks if "file ID" exists, then go down to the left. If it doesn't exist, just go up to the right. So we can do that by actually deleting that connection and then typing in "if." And we can select that. And so what this is going to do is when we connect it to the back of Telegram, this is going to be checking for a certain condition. So does "file ID" under "voice" exist? Right? If it does, then we need to transcribe that audio file that I just recorded because right now it's just in the form of a file. We don't have the text. So we need to complete the automation and complete the data flow of getting my voice to actual text. And we can do that by just adding in this little "if" node. And if this is false, automatically we can just go up to this "set fields" node. But if it's true, we want to transcribe that audio. So I'm going to double click into this "if" node. And this is just like the "switch" node except you only have two conditions like true or false. So it's really good for these boolean type values. So what we can do after we sent that test voice file in is we can actually go to "file ID." And this is only going to appear if you have tested with the voice this step. So like I'll delete that connection real quick. And what you have to do is you have to record your voice just like this. So I'm recording my voice right now. And then I can send that off. And then I hit "execute workflow," and that pulls in that voice file as a test. And you need to do that for this step. So we can connect that node to the "if" statement. And now where it says "file ID" under "voice," we can drag that into "value one." So this doesn't have to equal anything, okay? Because the file ID is going to be changing every time. We just need this to see like is it there? If it's not there, then it doesn't matter. Then the equation isn't true. So we can hit this little drop-down arrow and we can go to "string," and all we have to do is select "exists." And so there's no value to
To compare this up against. If voice.file file ID exist, then we go down the true route. So, let me test this now. I'm going to save this. And what I can do is I'll type a message real quick. Hey there. And then I'll send that off. Execute workflow. It should be false. As you can see, since file ID wasn't there, it went down the false route. And then I can send a little voice message again. Just testing out this voice message functionality. Beautiful. Sent it off. Execute workflow as a test. And it went down the true route. So now if voice then true, if text, then false. And we can do different things with these routes.
So on the true route, we need to transcribe the audio. So what I'm going to do is I'm going to hit this plus button on true. And then I'm going to type in once again Telegram because Telegram has this feature where it actually allows you to get a file and download that file if it's there. So I can use telegram and then under file actions right here in telegram I want to select get a file because we can use that file ID in order to receive it from telegram and then there's an option to download it in nadn. So I'm going to select get a file and as you can see it's connected now to the true route. So if we have voice we're going to get that file. I can drag and drop the file ID in here. So that thing that we used to uh check if it's a voice or not. I can drag and drop that file ID resource file operation get download checked on. This is going to download the file in NAN. So I'm going to hit execute step. So you can see what this looks like. Now we have this little file right here. And this is perfect because now we can even hit download and we have this OGA file which is a very interesting file extension. But don't really worry about that right now.
We have to add one more node. So after we get that file and download it, now that it's like in NADN as physical data rather than just an ID, we can use another node called transcribe. So that node is under Open AI. Remember how we connected the model earlier when we were building the agent? Well, we can use that exact same API key and account that we connected to earlier. So I'm going to select OpenAI and then I'm going to type in transcribe. And as you can see, we have this transcribe a recording option. So, I'm going to select that. And then when I click off, I want to connect that to the Telegram get a file and everything else is set up in here for you all ready to go. As you can see, this files name is data and that's pretty standard in NAD. So, the input data field name is data. So it's going to take in this data in this file and actually uh perform a transcription for us so that it puts voice to text. Credential to connect with. I'm going to use the one I set up earlier in the connection one full agents guide if you remember me setting that up when we were building the agent. Now we can leave resource on audio and action on transcribe a recording. You could also do translate audio into English language, which if you're a translator or you have any use case for that, uh, that would be pretty sweet. But for now, we can just execute the step to test to see if it brings my words into text. As you can see, it did. Just testing out this voice message functionality. Perfect.
And so now that's pretty much like good to go. And we could set up an AI agent now. And you might be wondering like what is this set node even for right now? Well, I'm going to show you what it's for uh in a second here, but for now, how about we set up our AI agent? So, I'm going to hit open up the nodes panel over here, and then I'm going to type in AI agent. I can select that. And now, as you can see, the source for prompt, we're not using a chat trigger node. A chat trigger node, that's what it defaults to, but that is this chat trigger right here that we used earlier. So you can open chat and actually type in a message. So this in a way is a communication medium the native nadn chat node and that's what this agent is automatically looking for because as you can see in source for prompt there's actually an option every time for that trigger node that chat node and the prompt is just the way that output is received into the agent. So this has a JSON object of chatinput and not every object has that obviously everything is different. So when I connect this as you can see the value goes gray. When I disconnect it the value is red. So we need to make sure the prompt is actually getting to the AI agent. So in order to do that we have to define below. And here we can map in the response each and every time. Or what we can do is we could leave it on connected chat trigger node and we can just make our fields called chat input with the set node. So I'll show you what that looks like because we can kind of fake it so that it looks like it's this chat input node coming in by changing the names of these two fields. So we can do that by using a set node. And so we can add our AI model here in a second. But after transcriber recording, what you can do is you can drag that into the set node. And then all incoming data can equal chat input. And so for manual mapping, first I will go to the open AI node on inputs. You can close up the if node and go to open AI. And you can just drag and drop that text in here. And we can just name this text as chat with a lowercase C and then input with a capital I. And so that will trick this node into believing that it's JSON.put just as if we had a chat trigger node connected. And then we can do the same for the if node as well. But first we have to send in some test data. So right now I'm going to play that. As you can see chat input coming in from the OpenAI node now. But now we have to test to see if that works coming in for this node, which it won't. So we're going to have to create another field and name it chat input. And so now when I connect this set node to the AI agent, as you can see, this value is accepted. If we named it anything else in the set node, since it was on text before, so if I open up this transcribe, as you can see, the name of this is text, the name of this JSON object. This is your key value pair. So think of it like a form. This would be like full name. And then you would list your name here, right? Or hobbies, you'd list your hobbies. Age, you'd list your age. This right here, this name over on the left is describing what this value is in a way. So all we're doing is just renaming the object here from text to chat input. If this were to be any other thing like chat inpecute that, now this would no longer accept that value in the AI agent node. So, we're just going to rename all of the values to have a chat input title, which is a very useful thing to understand in NADN is how to use this set node. I'm going to save this workflow. And now I need to send some more test data to this set node here. I'll disconnect the AI agent for now. And then I'm going to type in a message and just say, "Hello, how are you doing?" And then I can send that off. And then I'll hit execute workflow. And it should go down the false route. As you can see, it did. So, now we have the data we need in order to work with this and change its name. So, what I'm going to do is just drag in this text field under chat into this box right here. And then I'm going to rename this also to chat input. And now when I execute the step, chat input comes back with a value. So no matter what route I go, chat input will always have a value over here. And now when I connect it to the AI agent, that value is accepted in the prompt. And the prompt, remember, is just like you're using chat GPT right here. This is a prompt bar. So if there's no information coming into here, then the AI agent is not going to know what to do, what to say because it doesn't have any command, any question, any query. And if you want to get custom, that's when you add your system message, custom instructions. But now this thing is pretty much ready to start working with. I can drag this over here and we can test all of this to make sure that it works before we actually uh make it live. And I'll do that. But in order to actually test completely, what we need to do is we need to add a chat model. So just like before, I'm just going to be using OpenAI. I'm going to hit this plus button under chat model, type in OpenAI, and then select that. And now we can just leave it on GPT 4.1 Mini, but I'll change my connection to the one that I set up earlier, which if you're doing multiple different projects, you probably want to create different credentials so you can track the pricing on OpenAI's platform dashboard when you are building out these agents, especially if you're doing it for other people. But for now, this will work. And now in the uh system message, I can just get rid of that. And now it's just like we have chatgbt within NAND. And I can use telegram as the medium of communicating. So if I activate this and then hit got it. And then at the end of this AI agent, I can type in telegram. And what we need to do is we need to send a message back to our self. So I can put the message action of send a message. If I can find it. Yeah, send a text message right here. And now we need to map the chat ID and the response of the agent. So, we'll have to deactivate this, disconnect this, and get some data in here. So, I can actually just play this AI agent out. And now we have the data going to the Telegram node. So, now we can connect it. And this is going to be the response back to the Telegram chat. So, I'm going to double click into here. For chat ID, what you want to do, or what I like doing is going to the Telegram trigger and opening that up. and it's not update ID, but there is a chat ID that you'll see underneath the chat field. So, you can close all of those and underneath chat, you'll see this ID. So, you want to drag and drop that into chat ID. Now, it knows what chat to send this message to. So, you could have two bots set up where you're sending messages from one bot, it's talking to another bot, and then that bot starts another workflow. You could go absolutely insane with this. But what you want to do for text is just map the message of the AI agent, the output of the AI agent. And so then it will be like it's sending you a text message back with the output. Okay. So I'm going to hit save. And now this is ready to go. So I can make this active. I'll hit got it. And now if I'm in Telegram, um you're not going to be able to see this move on this tab. But if I go to the executions tab, you'll see that we can view all of this working. So, I'll just say, "Hey there, how are you doing today?" And then what I can do is I can uh send that off. And now we're actually going to get a response. And look how quick that was. And it says, "This message was sent automatically with NAND." If you don't want that there, what you can do, as you can see that execution came in, is go back to the editor and you can click in your last telegram node and then select add field and where it says append nadn attribution, you can select that and then turn it off. And so now it will no longer say this message was sent automatically with NADN. But I'm going to go back here, hit save. Now you can rename this if you want. Uh message to user sends message to user is perfect.
And so before we test out the voice route, one thing I do want to mention is that I think I've thought of a cleaner way to actually set up this whole part of the workflow right here with getting the message to the AI agent. And something that I kind of just thought of. So if you click into this set node, as you can see, we have two chat inputs. That's kind of sloppy. So what would be better is if we just transformed one of these routes. So the text route for instance into the same file as the voice route. So instead of changing both the names to chat input, we could just change the text input to text instead of message.ext. So we can honestly delete the voice route completely up here where it says chat input JSON.ext and we can just hit delete. And now for this, instead of naming it chat input, we could just name it text. And now this field will change to this name. And that is going to be on our false route. So now we don't even need this transcribe recording going into the edit fields node because this is already JSON.ext. So I can just delete that and then have this go like this. And we can just have the transcribe recording go directly into the AI agent. Now you might be wondering, Drake, we still have chat input right here. And if you're not wondering, that's okay. But what we can actually do is just define this below. So I'm going to select this and hit define below. This is honestly a better way of going about this. I'm going to make this an expression and then I'm going to do curly brace curly brace money symbol JSON all lowercase then.ext. And so now JSON.ext is going to be coming in both from the transcribe recording automatically because that's just the way it's set up. And now we're switching the chat route to be labeled as text. So it will be able to accept both routes rather than changing both names, just change one name and then define it differently below. So now we can test this out to see if that actually worked and to see if that's a better way of going about it. I think it's a little bit cleaner. Rather than trying to change two names, you just change one and then you change the incoming prompt. So what I can do is I can go in here and doing it this way you won't have any errors if you're trying to send a voice message and then the bottom value is coming back undefined and then it's not sending any message. So this is a much better way of going about it and I am sorry for um having you go down that first rabbit hole. But this is the correct way of doing it. So I hope you followed those changes. All we're doing is changing the name of the text route to match the name of the voice route. And then both of them since they're named the same thing, JSON.ext will be accepted by the AI agent. That's the end goal. So, let me try this right now. I'm just going to say yo, and then I will maybe add in a little emoji. And then I'll send that off. And I'll hit execute workflow. As you can see, was accepted. Hey, what's up? Adds that same emoji. Now, let me try it with the voice to see if that route gets accepted. What should I eat for lunch today? Salmon or steak. I'll execute that workflow. And it went through transcribing the recording, went to the AI agent, accepted. Everything is good. And then it gives me what I should eat for lunch today.
Now, this is pretty much ready to go. But there's one thing that you need to understand about AI agents and communicating back and forth with them. One more thing at least that's essential. Because right now I could message this thing back, but the only problem is it doesn't have any context into what we previously talked about since we haven't added this little thing called memory yet. So if I message this thing back because it's asking me what kind of flavors or meal experience are you aiming for. And then I could just put like spicy or something and then send it off and it wouldn't have any idea what I'm talking about because it doesn't have any memory. You can see it just says, "Could you please clarify what you mean by spicy? Are you looking for spicy recipes, spicy food recommendation, spicy facts, or something else? Let me know how I can help. So, in order to navigate this problem, what we have to do is we have to add a memory right here to the agent so it can retain contextual information about what it's previously uh spoken to me about. So, I'm going to hit this plus button under memory. And then I'm just going to for now add in simple memory. And instead of JSON session ID, this is what it's trying to pick up from. And that's because it is connected to the chat trigger node automatically. Again, what we need to do is just define that below. And here for the key, we can open up the telegram trigger node. And we need to find the chat ID because this is what it's going to be pulling past conversations from. So I'm going to drag and drop this ID into key. And this is how many past interactions the model will receive as context. So if you want it to look five messages back, 10, 20 messages back, do what you want. I'm going to do 10. I found that's a pretty happy medium. And now this agent has memory. Okay. So if we save this and we activate this workflow, what I can do now is I can just message this thing and it will feel like I'm messaging chat GBT because I pretty much am with this OpenAI model. So I'll go to the executions tab. As you can see, the most recent was at 11:265. So now I can just say, "What should I eat for dinner?" and send it off. As you can see, it's running now right here. What kind of flavors or ingredients do you like? Are you in the mood for something quick and easy, healthy, or maybe a bit more indulgent? I could say like, "I want healthy meal involving salmon." And what you're going to notice is it can now maintain context into the situation. And so if I say that and I send it off, it's going to know what I'm talking about and we're going to be able to keep this conversation going. And look how quick that came back. And it asks me, would you like suggestions for a sauce? All I have to say now is yes. And it understands what I'm talking about. And it gives me that sauce very, very quickly. So this is how to set up your first communication medium using something like Telegram. Kind of a a bit complex, but once you set it up once, now what we can do is we can just make this AI agent do whatever we want. Okay? We could have it create images for us, send it back to the chat, we could have it create blog posts for us, have us review the blog in the chat, send it off. Maybe you have an idea, maybe you want this to be like an idea arranger bot or something. You could just speak in your idea on your cell phone if you download Telegram and have it kind of enrich that idea or go deeper into thought on that idea or post for you about that idea on LinkedIn, Instagram, YouTube, whatever you want. So, I hope you're continuing to follow along. We've just set up our first communication medium and now it's time to get into a more fun way of connecting to NADN by vibe coding our own interface. So, we've already connected to Telegram. Good job following along if you did that. And I do recommend doing that and just following along trying to understand and decipher how data is moving before it gets to the AI agent node. That's a crucial step in understanding um just connecting things in general by using a set node, getting the names to match and going into the AI agent. But congratulations. Next, we need to understand what is vibe coding because we are going to be vibe coding our own unique user interface to communicate with agents. And this is truly the future, right? Vibe coding is a
New way to develop. It's a conversational style of development. You don't have to know code. You don't have to pretty much know anything. You can spin up an application as a non-developer with natural language. And that's the way that the world is moving, is in this more natural language patterns, right? You can build applications with your mouth. It's absolutely insane. But we're going to be vibe coding the communication medium together.
You don't have to follow along for this if you don't want, but I do recommend taking note of this keyword: vibe coding, because this is going to be huge in the future. And I recommend that you learn this because you have the power to create an application as a non-developer. And so you can turn your ideas into reality that people will actually pay for, or you can turn your ideas into things that you can use internally as a team, for yourself. Maybe you want a nice content dashboard that you program with your natural language, and um you could do that. So let's build a small private application together.
Now, vibe coding is something that we take very seriously in the AI foundations community. We actually just had uh Paulo Desonne, who is one of our team members, create a 50-module course on vibe coding where you turn your agents into apps. Naden is your backend, and then you can vibe code the front end and make a very unique interface, deploy it, sell it, and that's in our classroom under vibe coding agents into apps. As you can see in this video right here, he creates a very nice interface, and you can actually chat with NADN in the interface you create. So we have a 50-module course going over how to deploy these apps, how to integrate paid features using Stripe, so people can pay for pro tiers or just stay on the free plan.
But what I'm going to do is I'm actually going to stay in my Telegram bot because we will need this. And we can just have all of our communication happen through here. But what I am going to do is I'm going to select this plus button in the upper right-hand corner behind my head, and I'm going to add a new node. And that node is going to be a web hook. So a web hook allows you to send data through a URL to your NAD workflow. And we're going to need this when vibe coding. So I'm going to select this web hook. As you can see, we have a nice little web hook here. And for the HTTP method, I want to switch to post. You can think about get like that weather automation that we created. You were getting data. But here you are posting data to the workflow. You're saying here's the data. You're not trying to receive any data. So for path, I will change this to like agents to apps testing. So my URL looks a little cleaner. Respond immediately. And we want to change that to using respond to web hook node. And we will get more into that later. But first, we need to test out sending data to this URL right here to get information into our NADN workspace. So I'm going to save this and then I'm going to deactivate it for now.
And next, I'm going to go to a vibe coding platform called Lovable. And Lovable is a great app that allows you just to create apps and websites by chatting with AI. So I'm not sponsored by Lovable in any way. I just love the tool Lovable, and I just want to show you how you can create a project by, you know, just typing in what you want. Now, like I said, you could follow along if you wanted, but this is more so just to like show you into the future of what is becoming possible with AI and agents and apps and connecting them. So, I'm just going to type in a little project that I want to create. So, as you can see, all I said was I want to create a chat interface where I can communicate with my agent via post request web hook. I could probably say via web hook post request. Doesn't really matter. Then I say I want this to be a very clean chat UI. UI meaning user interface if you're not familiar with what that term is, in dark mode glassorphic style. And have a little loading sign for when the agent is in the process of responding. I then say here's my post request URL. And then I drop in my post request URL, which probably is not the best practice. Don't recommend doing this, but I just want for speed to show you how this is working. I'm going to send this off, and it's going to begin spinning up my preview and building my app. Just like this, we have a nice little window where we can preview what our app looks like, and then we can chat with Lovable down here in order to make changes to our application. And eventually, if we wanted to, we could use the guide and AI foundations to add Stripe into this to charge for your application. If you're making an application built around an NN agent that performs a specific action, like for instance, content creation, deep research, accesses any model, you can do pretty much whatever you want to do uh with this app right here. And I love how it says this. I'm excited to help you create a beautiful chat interface. This evokes modern messaging apps like Discord or Slack. So, I'm really excited to see what it comes up with. Honestly, this new way of development I'm enjoying because you don't have to spend uh years learning it. And so it looks like it was just uh created here, and it's loading up the preview right now. Let's see what it came up with.
Look at this beautiful interface that it came up with. It allows me to chat with my agent in here. And just look at the the animations in here. It's just insane. Okay. So, I'm going to try to send this message uh and just see if it like gathers data from my web hook. So, I'll go to my Telegram bot automation here, and then I'm going to hit execute workflow, and I'm going to uh it says waiting for you to call the test URL now. So, let me go back here and see if this works. Hey there, how are you? And then I can send that off. Okay, it says it's having trouble connecting right now. Let's see if it got anything. Okay, it says no respond to web hook node found in the workflow. Let me just add one real quick. So, I'll just add a respond to web hook. And again, like I said, you don't have to be following along. I'm just trying to show you some some cool things here in NADN and vibe coding. So, I'm going to execute workflow. And then I'm going to try it again. Hey, I received your message. Perfect. So, all we had to do is add this respond to web hook node. And if I go over here, we can see my message in the body. So now we could add another set node and hook it up to the AI agent. And if you've been following along, what would you guess I'm going to have to change this field name to right here where it says body message? Like I want you to think right now in your head, what do you think I would have to change that message to? Well, if you've been paying attention, I'm going to have to change it to text because that's what the AI agent is receiving. JSON.ext text. So, I'm going to duplicate this edit fields node. Then, I'm going to put it down here. And then, I'm going to connect actually not my respond to web hook node, but my web hook post request to the edit fields node. And I'm going to double click into there. And instead of this right here, I want to drag in the body. So, I'm going to close that headers. And under the body message, I'm going to drag in that. So, now it's changing body message just to JSON.ext. and that will be able to be accepted by the AI agent since it's using this as the prompt. So this is perfect. And now I can add a little if node at the back to determine whether it needs to respond to telegram or my web hook. So I'll add in an if node and I'll just make telegram the if false route and I'll make the respond to web hook node the if true route. And remember like I've been saying don't worry about what I'm doing right now. I just want to show you into the future a little bit. And so what I'm going to do now is I'm kind of going to go through here and just start activating everything here. It says reference node doesn't exist. And that's because the key here is based on Telegram. And what we needed it to be based on was this web hook. For now, what I'm going to do is just delete that memory and then just activate it. And now we can look at the variables. So if web hook maybe message for value one if it exists then we can go and respond to web hook. If it's false then we will send a message to the telegram user. And for the respond to web hook I'm going to make it respond with text and I'm going to have it respond with the output. So now if I save this we could add memory into this. So it would just be a little bit more complicated and it's probably better to do it in a separate project rather than having telegram and that connected. We could use a different memory node as well. But now what I could do is I could type in a message like uh maybe what should I eat tonight and get that prepared. Then I'll test this workflow. So I'll execute workflow and now it's waiting for me to call the URL. I can send off what should I eat tonight. As you can see it says agent is typing. Says having trouble connecting right now. So, where did it get stopped out at? Right here. Okay, so I ended up figuring it out. I actually just had to delete the respond to web hook node entirely and just change this setting to respond when last node finishes and change this to first entry JSON. It took me about 5 minutes, but uh it's very fun problem solving in NAND. And now I wouldn't even need to do this. Um or I could just leave it like this and this would work out perfectly fine. So now when I hit execute workflow, I can have a conversation with this. So I could say like, hey, what color shirt should I wear today? You could set this up to be production ready as well. You could change the UI. Doesn't just have to look like this always. And then it asks me what my plans are. So now I have this like custom interface all because of vibe coding. I wouldn't have been able to do this definitely not nearly as quick without this. And that's why at AI Foundations, we're leaning heavy into this style of development. So, I recommend if you are still on the fence, joining and learning this stuff. First, how to build agents and then how to put an interface on your agents.
But that has been the communication medium section. I hope that you've enjoyed and I hope this has given you more ideas into how you can begin communicating with agents. Now, we have one more section to go, and that is our multi-agent hierarchy section. How can you have agents call other agents to perform another task? Well, that's what we're going to be learning next. So, stick around. You've made it so far. And this next section, you are going to learn a lot of valuable information. So, keep on watching and keep on learning.
So, finally, we've made it to the last section, which is the multi-agent hierarchy. And this is honestly one of the most important sections because it lays the framework for what's next in your AI agent building roadmap. Now, when trying to master building AI agents, the best way to learn is not from a video, but there's two things that are seriously involved in learning that have helped me tremendously. Number one, the most important thing, it doesn't matter what you're doing, you need to be building something. So, you need to have an idea and you need to test that idea. And you're not going to have specialized videos for literally every single thing you do. uh what's what you're going to need to do is use AI in order to help you understand things. Give it your tools. Tell it that you're using NAND. You're trying to do X, Y, or Z, and you need help building it. Is it possible number one, and how do I do it? And when you come across new things that you're going to learn, which you will, you just need to keep on prompting and keep on asking because AI is honestly the best mentor. I had nobody to teach me this stuff. I just had to learn it all on my own. So that's step number one. Step number two is don't go through the struggle if you don't have to. Okay. Now, videos are very difficult to learn from, but a community, the AI foundations community in specific, like you can type in a question and ask it. And chances are hundreds of people have already been through the same problem that you're going through right now during your build. So, that's what a community is for. That's why we made the community was to have these positive interactions that give you much more return on investment than any other place online. You have like live feedback. You have assistance. You have pre-built agents that are ready to implement. You have live tech support calls. You have pretty much everything needed to succeed, and it's not going to let you down. So, I do recommend after this checking out and joining the AI Foundations community because we're going to help you get to the next level after you learned all of these basics. And we're also going to teach you how to apply, how to monetize, and really how to get the most out of your AI agent building experience. And that is the goal, and we teach you much more than just AI agents. So, make sure to check out that community using the link in the description after this course and after this video, but we're entering the multi-agent hierarchy step, and it's very important that you pay attention here because this is where agents really go to the next level. So, like I said, it is a crucial step. Learning how to build multi-agent hierarchies is going to be important. Remember, an agent works best when focused on one task or one area. Knowing this, we can create preliminary agents I call classifiers. So instead of having one agent try to accomplish everything in your life, everything in your business. Uh what you need to do is you need to create specialized agents. So create an agent that's just really good at doing the weather. If you have uh an agent that you want to do weather tasks with, have an agent that's just really good, not in the Google ecosystem, but just really good at sending emails, writing emails, reading emails, and doing everything with emails. If you want an emailing agent, make a dedicated emailing agent. Don't lump it with your CRM instructions or your CRM agent or your uh calendar agent, right? You want every single agent to be specialized in one area or focused on one task. And as AI gets better, I'm sure we're going to need that less and less and less. With the introduction of MCP, it's already looking like an agent will be able to perform and do more than just one thing. So that is great, but right now we kind of need to understand classifiers. And it's more than just agent to agent, but it's also agent to automation relationships as well. So classifier agents have one job, and that is to determine which type of agent is needed for the problem, the question or query presented by the user. You can think of it like an agent selector. Let me show you a visual example. So we went over the communication mediums already. And communication mediums, if you didn't watch that section, which I highly recommend, are just ways that you as a human can communicate with AI. and we hooked up Telegram and we even vibe-coded our own interface where I was talking to the agent and it was responding back to that chat thread. So, human-to-agent interaction crucial. But let's say you have a communication medium and you want to be able to ask it multiple questions and give it multiple commands. Well, you wouldn't want to have one agent just answer all the questions and all the commands because it would be inconsistent. It would hallucinate and it would do a bad job. So, let's say you want to ask just like a single chat thread, what's on my calendar for today draft? And you also want to tell it to draft an email to your buddy. Maybe you also want to tell it to add somebody to your CRM and add a note about them. Well, instead of having one agent answer this, just have one agent rather answer, what type of query is this? As you can see, I've color-coded these queries. So maybe the calendar is red, the emailing agent is green, and then the CRM questions and agent is yellow. What you could do is you could set up this agent to just determine like, okay, what what area or what agent do I need to send this to, right? That's what this agent's specialty is, is determining the agent that does that task best. So if I say add Drake to my CRM and add a note saying he likes cats more than dogs, we could have this query. Well, it's not like we can have this query. We can make this query um go around multiple agents before getting answered. So maybe that's where I start my conversation, right? I say add Drake to my CRM. Okay, that goes to the classifier agent. And now the classifier agent once it has that query of me giving a command saying add Drake to my CRM. Now, like I said, this agent's trying to determine, okay, what workflow, what automation do I need in order to make this happen? And you can actually connect agents as tools. Remember how we connected the tools to our first agent? You can do the exact same thing except you can connect agents as tools. Entire NADN workflows. So if I go back to my workflows in NAND, I could have these connected as a tool to another agent so that if I ever need anything done or even my automations like these are each called workflows and I could set these as tools for my agent. Let me show you a quick example. If I go to the agents and I go to the mini assistant, as you can see, we set up this emailing assistant with two tools, a CRM and a Google calendar tool that can just search events. We didn't even add a create events tool or anything like that. But if I hit this plus button under tool, you can select call naden workflow tool and you can instruct the agent that when a certain query is being presented within the prompt, then call this workflow and send the query to another workflow. So here, as you can see, we can hook it up as a tool and it works just the same. You can give this tool a name and a description. So we could name this workflow whatever the workflow is that we want to choose. And then we have a list of workflow and we get to select literally entire automations and agents within another workflow. And we can pass the query that came from, you know, the communication medium or the inbox down to that workflow and have that workflow run and also return a result back to this canvas. So if I select maybe the weather report and then I could just give it a description of like um gets details about the weather and then I could name this weather tool and I could set up this AI agent in the instructions in the system message that if the use I could say something like this, right? I could say like if the user ever talks about the weather, no matter what, always send the query to the weather tool and I could name it exactly how the tool is called in my tools list for my AI agent. So this is weather tool and we could have that agent pass the query. So maybe this isn't Gmail, but maybe I have like a connected chat node. uh we could have that pass that query to that weather tool and then that weather automation will run the weather report one that we created earlier from this automation. And so that's kind of the hierarchy that we're going to be building. But let me just kind of walk you through now that you know that you can call other workflows as tools what that might look like. So, like I was saying with this automation, uh I mean this classifier agent right here, I could say add Drake to my CRM and add a note saying he likes cats more than dogs. This classifier agent would go, okay, what area does this fit best? Maybe I have a
CRM area. Uh, well, then the agent could decide like, okay, since this is a question or a statement about the CRM, I'm just going to pass this query to that area. And once this tool is called, the CRM tool is called, it will activate another workflow based on my query. So now, all of a sudden, my query is traveling to the CRM space, and the CRM space accepts that query and then uses it to run an entirely new agent. So you can use an execute subworkflow node that I showed you or a uh, calling another NAND workflow tool. And this node right here will be execute a subworkflow. I'll show you what that looks like in a second. But now, all of a sudden, my query came to this workflow, the CRM agent workflow that is dedicated to my CRM only. So it can not only search my CRM, but it can update my client info. It can add notes about clients. It can remove people. It can add people. This agent and its instructions are dedicated to the CRM.
So why wouldn't I want to pass a query to an absolute specialist rather than somebody who's just kind of good at everything, right? That's why we do these classifier agents. So we can classify queries and send it to the right location. And that doesn't just have to be like areas of your life, but it could be specialized tasks within a certain industry or a certain realm of um, agents. For instance, this could be like a LinkedIn posting agent. And each one of these could be workflows that are good at each part of the process of posting on LinkedIn. For example, this could be like the copywriting workflow that generates amazing copy and then sends it back to this LinkedIn poster. This could be the scheduling workflow that handles all scheduling queries. And it could be an entirely different agent in NADN that that knows your posting schedule, that knows the posts you've previously posted, and so on.
So, like it doesn't just have to be about like areas, like agent to areas or agent to task, but like also like very granular. Like maybe you just want a LinkedIn posting agent, but you want it to be specialized in multiple areas rather than just okay at everything. Well, this would be another example of using classifier agents, like which type of task is needed right now. It's kind of like the orchestrator of the entire workflow. And so maybe actually, um, this just goes through my CRM agent, and the CRM agent would first search the CRM using that tool, which we could bake into the instructions of that CRM agent, and then it just finds me and then adds client notes. Like we could set something up to do that very simply. Maybe I have a query that's like, get me more information about Drake's company from the CRM. Well, if I send that into my classifier agent, then my classifier agent would call the CRM tool, and then that query would be passed here. It would go to the CRM agent, and then it would go, okay, if I want to find out more information about Drake's company, what might I want to do? What tool might I want to use? Well, you wouldn't be able to use many of these tools because this is already about existing information that the CRM agent knows. It's like, okay, it's a set task. Maybe it first uses the search tool, finds what information it already has about me, realizes it doesn't have any company data, and if that's my query is to get more company data about Drake, maybe it just says, okay, we need to run a completely new workflow, the data enrichment automation workflow, which could be linked to the CRM for enriching leads, and that could run an entirely new data enrichment agent that specializes in that specific thing. So this is kind of the multi-agent hierarchy that you can build and that you need to understand uh, how it works.
Now, obviously, I'm not going to be building out any complex classifying agent workflows. I'm going to show you how to pass data to different workflows and how to execute different agents, but this would take some time, like doing it right, and I don't want to lead you in the wrong direction. I mean, that could be another six, six-hour course in itself. So, if you guys want to see something like this, like building a multi-agent hierarchy, a full tutorial like this, let me know in the comments. But, let me give you an example of what that might look like as a personal assistant. Now, just so you can ingrain this in your head. Maybe you have a classifier agent that's communicating with you via Telegram. We can just call this like Telegram. And maybe you're communicating back and forth with this thing, and it returns responses to you like shown. This is very basic, kind of like what we built already, except we just built it with a single agent. Well, maybe you ask it a question about like, hey, what should I study for uh, for the Bible today, right? Maybe you're studying the Bible, and uh, the classifier agent would read that query and go, okay, that's a spiritual task. So, it would send it to the spiritual area. This is kind of like an areas thought rather than just like a task thought. So maybe you have different areas of your life, and you're creating this epic personal assistant. If I'm asking about my Bible plan, well then if I send it to my spiritual area, I could make this spiritual agent know everything and have all the tools needed in order to like guide me through a personalized study plan for years to come, and it would constantly be learning about my spiritual area. So whenever I have a question or query, my classifier would just send it to the spiritual area because that's the area that knows it best. Same with financial, business, and personal. This is a workflow. These are separate workflows. And a workflow, remember, looks like the ones that we've been creating already, similar to like these. These can be separate workflows calling other tools.
So, it might be difficult to comprehend right now what I'm talking about, but I think it's best if we just get in and build something. So, classifier agents, super important, and you can think of it like an agent selector. So, now that we know that it's like an agent selector, how about we just dive right in and we begin building? And I'm not going to be going 1,000% in depth because this is a process that takes time, takes a lot of instructing. So, what I'm going to do though is I'm going to show you how data should be flowing during this multi-agent hierarchy. So, in our own words, I can say I want a multi-agent personal assistant system that understands all of my Google calendar and all of my emailing needs. And then I have a nice little typo there. So, the reason that I'm doing Google Calendar and emailing all the time is because it's the easiest for beginners to connect. You don't have complicated connections with HTTP request and weird authorizations. All you need to do is sign into your accounts. So, let's build this multi-agent personal assistant that can do anything we need with a Google calendar and do anything we need with an email. It could draft up emails for us. It can create new events for us; it can create those events and then send an email invite. I just want this agent to be able to do everything. And in order to do this good, we're going to need this multi-agent hierarchy with a classifying agent. So, let's dive into NADN and get this started.
So, in my workflows, what I'm going to do is I'm going to go to my full agents guide, and then I'm going to create a folder, and I'm going to call this my personal assistant. I recommend that you follow along during this entire process, create a test Google account like I said earlier, and just follow along and internalize everything. I'm going to hit create, and then what I'm going to do is I'm going to click in that folder. I'm going to create another folder and call it tools, and then I will hit create. And now I'll just stay within my personal assistant folder. I'm not going to click into tools yet because first I want to create the classifier agent. So what I'm going to do is hit create workflow, and then I'm going to give it a name in the upper left-hand corner. I'm going to name it classifier agent. Then I could add a tag. Maybe I want to add this to the ma, the al, the multi-agent hierarchy uh, tag. We can call it ma. And then what I want to do is add my first step. So this is going to be my communication medium, like where everything is flowing to. In order to keep this simple, I'm going to use the chat trigger node. That way we don't have to go through the process of connecting Telegram. Once again, you saw that that was kind of intensive. But what you can do is you can actually just create a template, download the template in the upper right-hand corner and import it so that it's a lot easier to set up, and all you have to do is just import a file rather than build it every time if you wanted to be using something like Telegram, WhatsApp, or Slack often. So right now I'm going to add the first step, and I'm going to add that chat trigger. I recommend you do the same. Then we can go back to canvas, and now we have somewhere where we can chat with NADN throughout this entire process. So I'll rename this and just call it chat; it looks a little bit uh, cleaner that way. And next, what I want to do is I want to add the AI agent. This is the classifying agent. So, I'll hit that plus button, type in AI agent. Then, I'm going to select that. And now, we need to add a chat model. Since this is connected to the chat trigger node, it has our input all good in the prompt. So, whatever we type into there will automatically be fed into the AI agent. Going to connect the chat model. And I, like I've been doing this entire video, I'm going to use the OpenAI chat model. GPT-4 1 mini should work. I'll use my actual connection here. And then I will rename this to 4.1 mini just so I remember what model it is. And now we can get into instructing this AI agent on how to behave depending on my query. And the main point to keep in mind is you don't have to just put tools in here that are like existing actual tools like Air Table, Google Calendar, uh, spreadsheet tools, or whatever you're using. The goal here is we want to be able to call entire workflows as a tool so that it can run through something like this in another canvas from here, though. So, we want to instruct the agent what our goal is and when to use those other workflows.
So, what I'm going to do is click into the AI agent, add an option, and then I'm going to create a system message here. I'm going to make it an expression, and then open up that window. And now I'm going to give it all the instructions needed using my role, goal, guidelines, agent, input, output examples. So, I said you are a personal assistant, just stating the fact that this is the AI agent I want to be the main personal assistant. And then I say you are an expert at determining which tool is best needed for the job and then passing, I'll instead of pass, I'll put, and then passing user queries to those specific tools. The two tools you will have access to are Google calendar agent and emailing agent. So that's what we're going to name the workflows when we put them as a tool underneath our AI agent. Now I can kind of get into more of the responsibilities and more of the things that this agent will have to do. And these agents are going to be changing. These agent instructions will always be changing as we test and as we find mistakes, but after we refine this enough, it will be rock solid, and it will be basically like a Jarvis. I've now added the user will be giving commands or asking questions about either their email or Google calendar. Your job is to pass two variables to each of these tools: the user query and a description of the task needing completed. So, not only do I want it to pass like the raw user query, what I say to each of these other agents, which these will be entirely new agents on their own, but I also wanted to create a description of the task for this agent. So, these agents will be having two variables they receive every time in other workflows, my query and a job description task from this AI agent. I'm going to say you are to create the description to clearly define what the user needs so the other agents can interpret the user better. And then I can say that I want these two systems to work with one another because what I want is if I create an event and I want to email somebody about the event that I just created, then I want it to be able to pick up on that functionality. So I can just mention that I said, for example, if the user creates an event and wants to email someone about it, then you should coordinate the communication between the two agents, the emailing agent and the Google calendar agent. So now, before we start editing these instructions any further, how about we set up these two agents, and I'll start with just setting up the Google calendar agent and creating a separate agent outside of this classifier workflow that can handle any Google calendar task known to man. So I'm going to call this classifier and hit rename, and I'll save this. And for now, we can leave this classifier agent looking like this with our basic instructions. I'm going to go back to the personal assistant project folder. Then I'm going to click into tools, and I'll create the first tool, which is the Google calendar workflow. So I'm going to name this Google calendar agent. And then I'm going to add a first step. And the first step I want is execute. And then we can hit this execute subworkflow node. And the trigger is when executed by another workflow. So that's when we want this automation to start is when it's executed by our personal assistant. So when I select this, what you're going to see is we have to add some variables. And we can either use JSON to define that. We can accept all data, or we can do is just add fields. I think the easiest thing to do is just to add fields. So I'll add a field. I'm going to name the first field user, all lowercase, and then capital Q query. And then I'll add another field, and I'll name it job description, just like that with a capital D for description, lowercase job. We'll make that a string. And then I can click out of here. And then I'll rename this by hitting spacebar and then just call it personal assistant data. You can call it whatever you'd like. But then what I want to do is I want to add an AI agent node. So I'm going to select this plus button and type in AI agent. Just like that. And then what I'm going to do is add an option, system message. And I want to give some instructions to this agent. So I'll make it an expression so I can open up that big window. And then I can give it instructions. And remember this is the Google calendar agent. So these instructions are going to be geared towards creating Google calendar events and doing anything regarding Google calendar based on these two things coming in from the personal assistant. So, in my instructions, I'm going to be saying, you will be receiving a user query. You will be receiving a job description. Here's how you should use those two things in regards to creating Google Calendar events. And in my tools, I'm going to create all sorts of Google Calendar actions that it can take. So, I could create a Google Calendar uh, tool that creates events from my calendar, which I've signed into in previous automations in this full course. I could have it do that. For example, I could have it Google Calendar. If I hit Google calendar tool again, I could have it um, not only create events, but also just get many events. So, it can search all of the events from my calendar. Maybe I even have like a return all function. And then I could just keep on going with all of these little things that it can do. So, I'll make it really good at creating events, really good at searching events, updating events, deleting events. I'm going to give it access to all of the tools and then describe the tools in the system message. For now, I hope you didn't follow along with that. I'll just delete those, and I will start crafting some instructions. So, I'm going to click into here and then open that up since I'm in an expression, and then I'm going to start typing away.
So, here's what I have so far. I say you are an expert Google calendar manager. Your job is to take in, and then I spell it exactly how I spelled it in the execute subworkflow node, user query and job description, and then I say to determine which tool needs to be used in order to complete what is being requested. So I'm setting the framework; I'm saying you're going to be receiving these two things every time, and you have to determine which tool needs to be used in order to complete what's being requested. So I can list the tools, but what I want to show you is how data is passing into here. We're not going to have a connected chat node. We're going to have to define this below. And we're going to have to add these two variables as prompts for this AI agent. Let's add a chat model to this AI agent. I'm going to add my chat GPT 4.1 mini model. And then I'm going to save this. And for now, I'll just type in some dynamic, I mean some fixed information for the prompt just so we can have it actually save. And now that we have this, what we need to do is we need to connect it to the classifier agent in order to start sending some test data to this so that we can actually test the Google calendar agent itself. So I'm going to go back to my tools, going to go back to the personal assistant. And when I select classifier agent, I'm going to add a tool for this classifier, and I'm going to name it, remember, Google calendar agent. So I'll copy this, and then I will add a tool, and the tool that we want to add is call NADN workflow, and this is where the multi-agent hierarchy is taking place, with that execute subworkflow node, we have the ability to send data to that uh, automation to start it from here. So I'll hit call NADN workflow, and then for the name I'll paste in Google calendar agent, and I will give it a description, a very accurate description, of call this tool in order to do anything regarding Google calendar. And then where it says workflow, I can select that workflow we just created. So as you can see, we have all of these workflows in here that we've created throughout this entire tutorial. I will select the Google calendar agent workflow. And then since we set that up, it's automatically going to pull in those workflow inputs that we uh, set up in the Google calendar agent automation execute subworkflow node. And for both of these, I'm going to let the model define this parameter. And so now I can test this out. I'll hit save, and I will just open up the chat, and I will say, I want to create an event for tomorrow and have it be about eating pancakes. And so if I send this off, what this is going to do is it's going to send that query to the Google calendar agent. And so now if I click into this Google calendar agent, you're going to see something that says view subexecution since it actually ran a subexecution. It executed that workflow, that Google calendar workflow that we created earlier. So I'm going to select view subexecution. And what this is going to allow us to do is see how the data was pulled into that node that we created right here. And so right, right here it says personal assistant data. We want this data to be able to work with it in the AI agent node. So I'm going to copy this to the editor when we're in the executions tab of the subworkflow. So I'll hit copy to editor. And now this data will be pinned so we can use it when creating. And so it has the user query and job description in here because that was defined by the model. So in our classifier agent, we have the opportunity to either define what this variable is, user query and job description, or the beautiful thing about these agents is we can let the model define what both of these are. So that's what it did, and it just, it pulled in my
User query and then a job description. And if I wanted the exact user query, what I could do is I could just uh, not do from AI, but rather I could pull in my mapping from the chat input and pull that in directly. So that every time it says exactly what I say in the chat, whenever this tool is called, it will pull what I said in the chat right there. So now we have this, and we have the job description being defined by the model. So this is defined by me. This is defined by model. Perfect.
And so if I go back to my Google calendar agent, you we have all of this information pulling in now so we can use it. So if I save that automation, I close down that uh log, I can click into this AI agent now. And for the prompt, I want to map these things in. So I want to say user query because in the instructions we're telling it to use user query and job description to determine which, and then I can even say Google calendar tool needs to be used in order to complete what is being requested. And so I can dynamically map that user query by changing this to an expression and then dragging and dropping user query under user query. So now it looks like that: user query create an event tomorrow about eating pancakes. Beautiful. Enter down two times. Then I can put job description, and then I can paste in that job description by dragging and dropping it underneath that. And so now it has these two variables. So our prompt looks like this. And our system message or our custom instructions are saying to use those two things. And so now we need to start listing how it should use all of its tools.
Now the good thing about these agents is they require minimal instructions for tool calling. So, what we can do is we can actually just add the tools and see how it does right out of the gate. And we can kind of pull some certain things in if we see that it's struggling in a certain area. But I will say if you don't have sufficient information to complete the task, then ask the user for more details in the category you need more details in. So if I don't provide enough details, like I don't give a time, I don't give an event description, I don't give anything it needs to perform Google calendar tasks, instead of trying to create an event and guess, it's going to now message me and say, "Hey, I need this information. Let's get to it." Okay, so this is perfect. Now I'm going to click out of here. And while we're at it, I'll rename this Google Calendar agent. And then I will click out. And now I can save this.
And what I want to do is I want to add all of those Google calendar tools just as we did in uh previous parts of this video. So I'm going to select tool. Then I'm going to type in Google calendar. And then I want to consume the Google calendar API. So I've already connected my Google calendar account. If you haven't, you can hit create new credential. Sign in with Google. I recommend creating a test account. Um, that's what I have done right here. So I'll open that up also in a new tab so you can see. As you can see, I've created some uh arbitrary appointments, some morning routines, calls, things that aren't actually on my real calendar just to kind of fill it up. But this is a completely uh test environment. So, I can demo and show you how to do this. But let's say we want to do things like create events, search events, update events, delete events. And I think that'll be a good four if we can search, create, update, and delete. So we need to create a tool for each one of those tasks.
As you can see under operation, you have all the operations that you can perform. You can delete an event, you can create an event, you can get a specific event, you can get many events, and you can update events. I could actually make all of these different tools so that we have access to everything that we need to be able to do in Google Calendar. So I'll start off with the create event tool and I'll select my test calendar, tested AI foundations. And now for the start time, I'm going to let the model define this parameter. And then I'm also for the end time going to let the model define this parameter. And so how is it going to define a start and end time? Well, first we're going to need to go back to the custom instructions and we can add in something at the very top like today's date is, and then we can do two curly brackets like this. Then we can throw in a money sign and then type in now. And that's going to dynamically pull in the date like this and make sure that you have your time zone set on whatever um your time zone is in. So it can understand what to make the calendar events. So now that we're dynamically pulling in now to the second, what we can do is we can close out of there. And now it's going to understand like, okay, if I'm creating an event and Drake says tomorrow, I know when to put the start and end time or I know what to ask him when he does provide a time. And so what we need to do is we need to give this tool a good name. So I can instead of just Google calendar, I'm going to name this create_events. That'll be a good name. And for the description we want to provide an accurate description so the agent can understand when to use this tool. So I can say uh, yeah, create an event in Google calendar. That'll actually work. That's a pretty uh decent description there. So, this is perfect. Now, we have the ability to create Google calendar events. And this is our first tool.
And with these agents in this multi-agent hierarchy here, what you need to do is just build out systems like this. So, next we're going to just literally duplicate this event and connect it to a tool. And instead of create events, we're just going to name it search_all events. So that if we ever want to search all of our events, what we can do is we can keep it on resource event, change the operation to get many, and then we can just turn this on to return all, and we can let AI define these parameters for us. That's the beauty of agents. So I'm going to select this, select this, and now the after and before, we don't even have to think about it. It's being defined by the model. And instead of this description of create an event in Google Calendar, I can set automatically and then set manually. And it will say get many events in Google Calendar. And I'll hit a period. And now we have a search all events tool. And as you can see, this Google calendar agent is just becoming more powerful each time we add a new tool. And it's a dedicated agent for Google Calendar. We're not trying to lump this in with our email, our Google Calendar, our research tools, and everything under the sun. We're just creating one agent that's really good at multiple different tasks within its realm. And so now whenever we want to execute a workflow, it's already going to be able to create an event and search all events. So before creating events, it might have to search all events to see is that day even available. That's what this agent's really good at.
So let's go to the classifier agent first. I'm going to unpin this data. If you did that thing that I did when you were in the executions tab where you copied this to editor, what I want you to do is unpin that data now and save your automation. Let's go to the classifier agent and let's test this out. So, I'm going to say um, I'm going to open the chat. I'm going to reset the chat session and then I'm just going to ask it to create an event for tomorrow at 2 PM that lasts for an hour titled movie date, and then I can send that off and let's see if this works or if we need to tweak this agent at all. So now it's going through the process of creating that event and it's coming back to me with a response and it says, "I've created the event titled movie date for tomorrow at 2 lasting 1 hour. If you need any other details or want to make changes, please let me know." So if I go to my calendar, let's see if it created that event. Okay, so it did create the event, but it didn't give the event a title. So this is where we just keep on iterating. Let's go back to the Google calendar event and let's click into our create events and see why didn't it give this thing a title? Well, that's because we didn't have a property for the title. So, if I add a field in the create events tool and I select add a field, I can look for title. And the title is a sneaky field. The title isn't like title, event name. It's actually summary. That's what these event titles are called right here are summaries. So, I can add summary. And then I'll let the model define this parameter. I could even add other fields in here like repeat how many times, location, uh, inviting guests, and things like that. So, this is perfect. And now we should be getting the summary. So, I'll hit save now. And those are just kind of the little things you have to go through on your own and iterate through. But, we now have an agent calling another agent to do a certain task.
What I do want to do is add in memory and add in a simple memory so we can remember our past conversations. I'll just go 10 just like that. And next, what I can do is I can test this out one more time. So, what I'll do is I'll actually just hit reuse message. And then I'll just say for Friday, and I will send that off. And let's see if it actually titles it movie date. Now, it's going to run. Looks like it was just completed. And it says movie date has been created for the upcoming Friday at 2 p.m. and will last for 1 hour. If I go back, we have 2 p.m. Movie date. Perfect. So, the Google calendar agent is working. We could make this uh a lot more robust. How about we try our search events? Uh, maybe what do we have on Wednesday for our events? So, I could go to my classifier agent, ask what do I have on Wednesday on my schedule. I don't even have to mention Google calendar. It should be able to pick that up. I'll send that off and let's see if it does pick that up. Looks like it did. Going to my Google calendar now, acting pretty much as my personal assistant. Like I could hook this up to Telegram and you know I could have it even respond back to me if I hook it up to something like 11 Labs. But look at this. On Wednesday you have the following events scheduled. Morning routine from 7:00 to 8:30. AI mastermind from 400 p.m. to 7:00 p.m. If I go to Wednesday's events Wednesday right here, oops, didn't mean to create that new event on this Wednesday morning routine 7 to 8:30 AI mastermind 4 to 7. And so now I just go through and just like we have been, I can just keep creating tools for this thing.
And if we go to the executions tab, you'll really be able to see how data is flowing. So in that most recent query that we sent off in our classifier agent, as you can see, it came in, it said user query, what do I have on Wednesday on my schedule? And the job description, retrieve all scheduled events and appointments for the user on the upcoming Wednesday. This is being completely defined by the model. And then that gets passed to our Google calendar agent which accepts those values in the prompt and then is instructed to um take in those descriptions and then just complete our request and then I tell it if it doesn't have insufficient information then ask me. So I could just in my classifier agent test that functionality and say like create an event for tomorrow, and then I will send that off and it should come back and tell me like hey you don't have enough information. Let's see if it does. So it says to create an event for tomorrow I need some additional details. What time should the event start and end? What is the title and summary of the event? Can you please provide these? And so the agent is working and we would do the exact same thing for an emailing tool. And like I said, I could go into the Google calendar event. I could go under tools. I could uh go to my editor and I could just add a bunch of different tools for this agent to have access to. So I'll duplicate this event and I'll add another tool. And we will call this tool uh delete events or actually delete_events to keep it nice for the programs to read. I will make the operation delete. And then event ID, I will let the model define that. And then I will change this to automatically and then manually again. So we get that nice description. And now we have a tool that allows us to delete events. So I could delete certain events. Now it's that simple to set up a tool, uh especially when you have just one agent that's specialized in one thing.
Okay, I really want to hit that point home and the execute subworkflow node. That is kind of the main two things that you need to understand in the multi-agent hierarchy. And so I'll even just add another tool. Why not? I'll duplicate this. And instead of getting all events, I'll just get a single event. So if it needs to search for a single event, it can. I will uh change the operation to get. So it can only retrieve a single event. And then I will change this to get single_event. Perfect, and event ID can be defined by the model. And now we have like all of these Google calendar tools which is just amazing. So I'll even add another one and I'll just duplicate it like I have been. I'll rename this update_vents. I'll connect it to the tools and I will double click into here. And then for operation I'm going to change that to update. And then we have event ID defined by the model. And then we can add our updated fields. So maybe we just want to update the summary, the name of the event rather. We can add field. We can update the start time. We will let the model define the start time that we wanted to update. We can update the end time. We'll allow the model to define that. And when I'm hitting that little sparkle icon, I'm just telling AI like, you determine what we need. I don't really want to get programmatic. I don't really want to have to code in exactly the the start time. If it doesn't understand something, I told it to just ask me. So, if it asks me and I give it a time, it will put that as my new end time or my new start time or whatever uh these fields need. So, it'll ask me for a new title if I if I say to change the title because I instructed it to. I don't have to programmatically figure out what I'm doing here. That's the beauty of an agent.
So, now look at this. This Google calendar agent is absolutely insane. It can do anything I want in my Google calendar and I created this in about 10 minutes. Once you understand uh the operations, the tools, then you become really quick at building these things. It might take a little bit of time at first, but after a while, you will get the hang of it. And so now I could ask like actually what are my events on Friday? And then it will go and retrieve all of my events from Friday. Wait for it to return that information to the chat. It gives me everything I have on Friday. It says my movie dates from 2 to 3. So remember we scheduled that earlier. Now let me try out some of the other functionality of this agent. And so I could just say can you change the movie date to be an hour later? And then I can send that off. And let's see if it can update that event start and end time just by using that natural language. So I asked to change it to be an hour later. Let's see how it did. Says, "The event movie date has been updated to start at 3 and end at 4 as requested." So, if we go to my calendar, as you can see, it says 3 p.m. Now it's 3 to 4. So, very quick. It does things a lot faster than I would be able to do them. I would have to open up my calendar, find the event, click the event, hit the edit button, and I'm not kidding. These things take like time. And so if you can create these systems, these multi-agent hierarchies to do certain tasks for you, not even like personal assistant tasks, but like create me a blog post, upload it to LinkedIn, uh things that can actually give you positive ROI outside just time savings, like things that can actually earn you income, then that's where the real power lies.
Now, my task for you is I've been showing you how to do things this entire video, and I want you to set this system up, the system that I just created in the classifier agent. You can copy all of these instructions. You can take a screenshot. You can do whatever you need to do. You can set up your Google calendar agent exactly how I've set mine up. You can connect everything the exact way. But what I want you to do is I want you to add to the instructions of the classifier agent. This is your task to see if you've learned anything throughout this full course. Okay? I want you to add the emailing agent tool on your own. And I want you to comment and let me know if you run into any issues, if you have any problems or if you need help with anything or if you just had success. I want you to follow these exact same steps. And you might have to go back and watch again how I connected the personal assistant data, but do it the exact same way, add in a an execute subworkflow node as a trigger on your emailing agent. So instead of a Google calendar agent, what you're going to be doing is using the Gmail tool. You're going to provide instructions. You can set many different operations in Gmail. So choose ones like send and maybe even just like get. I would just do a couple of different tools. And that is my task for you to solidify your learning is doing something on your own. So add to the system that we've already built today together. And what I want you to do, like I said, is add a new tool. Call another NADN workflow. And that NADN workflow that you call from your list is going to be the emailing agent that you create. Give it a description, make it the name of what we put in the instructions, the emailing agent, and then use this system, try it out, and perfect it in your test environment until you're ready to make it public. But that's all I have for the multi-agent hierarchy. And the multi-agent hierarchy is beautiful because it allows agents to talk to agents. And in this agent, if I wanted to, I could even call another NAD workflow so that I have an agent calling an agent calling an agent. It gets very in-depth. But once you set it up once, it works like a charm. Now, if I ever want a new event, I literally can come in here and I could set this up on my phone. So, I could speak to my phone and have it run. All right, that is all I have for this full course. If you've made it to the end, congratulations. And this is just the beginning of your agent building career or your agent building journey. I know that the road ahead is going to be difficult. It's going to be filled with challenges. So, if you don't want to be going through the difficulties alone, you want to be able to ask questions, you want to be able to learn a lot deeper than what I've even taught you in this video today, then I recommend joining the AI Foundations community. I'm wearing the shirt. Oops. Right there. As you can see, I have the nice AI Foundations logo. We're serious in there. We have a team of five all working together in order to help you with agents. We have live calls, multiple live calls per week. We have courses. We have everything you need to succeed. We even have challenges and course content and calls on making money with AI as well. Especially if you are an annual member, you
Will get an extra making money call per month. So, I will leave the link down in the description if you want to join.
We have things like AI masterminds, vibe coding sessions, we have tech support, and we even have a support thread where we get to all of your questions about agent building and AI. And we have a classroom chalk full of courses in order to take you to the next level and in order to help you actually apply this stuff in your life. We're even running a nice little 14-day make money challenge in June to July. So, that's great. But yeah, this is the spot to be. We teach you everything you need to know about AI and get you up to speed on how to actually apply it to see real gain in your life. And when you get in here, make sure to go check out the wins so you can see how many things people have been completing. Holar here has been in the community for a year, been an amazing member.
But with that being said, please like and subscribe. I would highly, highly appreciate it and I cannot wait to see you in the community or to see your AI agent building skills in the comment section below. Let me know how you did on that multi-agent hierarchy. I'm dying to know.
But with that being said, that's all I have for this full NAND agent building course. I hope you enjoyed and I hope you learned a lot. This stuff, although it may seem boring and very tople stuff, it's like learning the fundamentals of basketball, right? If you can't learn how to dribble the ball properly and you're dribbling with your palm instead of your fingertips, then you're going to be all over the court. You're going to be sloppy. You're going to be messy. So, understanding the things that I've told you in today's video are absolutely crucial for your success. And the only way I know that is because I've personally coached thousands of people in the community who have came in not knowing anything and then went on to making money. So, if you want to be like that, then I recommend hammering in on the fundamentals, starting small, and then working your way bigger, building things on your own.
So, I hope all of this helps, and I hope to see you on the channel in the community in the future. So, like and subscribe if you enjoyed. And with that being said, I'll see you in the next