Transcript for:
Exploring N8n for No-Code Automation

Hey everyone, it's been a few weeks since I put out a video and that's mostly because I've been getting super deep into my new favorite tool, N8n. So N8n is kind of like a more advanced version of Make. It's a bit less... user-friendly, slightly more technical, but still definitely a no-code platform. And it's got agents functionality built right in. So you can build a lot of pretty complex stuff, and you can do it all within this one platform. So before, when I was starting to touch on agents a few weeks ago, I was building them out within Relevance AI. So the agents were being built in there and then I might have been building some more complex tools within make.com and then linking those together with webhooks. So with NAN you can do all of that within one platform and it works really really well and it's designed for this exact purpose basically. I still love make.com, I still love Relevance AI but for me I'm now going to focus purely on NAN. It's got a lot of benefits over using the two tools. One, it's open source. Two, it's cheaper. Three, it allows you to build at a more granular level. So with Relevan, you're obviously building on top of a like a they've built a lot of stuff which sits on top of the underlying code around agents so you're kind of building things within their parameters but here you're getting down to a much more base level and you're controlling a lot more of the smaller things and you can really build out exactly what you want and you've got a lot more control over it you So I'm going to talk through this agent that I've built. This is what I've been working on. This is kind of like a base level AI assistant agent, which I speak to with Telegram. Kind of similar to what I started building out in Relevance before. transformed it over to here, given it a bunch of tools and this is just I just wanted to put out a quick video to to run through this example to show the kinds of things that are possible. I'll demo the agent, I'll show how it works and then I'll speak a bit about what I see happening in the very near future and the other types of agents that we can build and I'll be putting out a lot more videos at a much higher frequency of all around building agents in NA10. Okay so we'll do a quick demo and I'll show you the agent in action. So let's bring up Telegram. And then I'm going to speak to him, I'm going to speak to the agent with voice. So let's just, for a quick example, let's say, hey, what's on my calendar today? So this is going to use the get events tool to tell me what I have on my calendar today. So I've one event on my calendar today, drinks with Norm Macdonald at 6pm. Not really, obviously, I wish. And then you can do a similar thing with creating events. So we'll just say, hey, can you add an event for today at 7 o'clock, which is to laugh at normal McDonald's jokes. So we'll go to the calendar and see there's the event. And then you should see this one being created in real time. There we go. So that's the kind of quick example of the calendar tool. We can do emails as well. I'll just do a very quick email. I'll do it in text. So we'll just do a quick example there. I've done that in text because I haven't yet set up a contact database. So you would then plug in, to make this truly more useful, you'd upload an entire contact database into either a simple Google Sheets. file or perhaps into even a vector database and then I could just say hey send a message to Neil asking if he's free for lunch and you'll then get that context and figure out you get the email correctly my address from the database anyway That should hopefully have arrived. There you go. There you go. There's the email. So that's those tools. And then I've got ones around a to-do list. So often I want to just... I use Todoist for a to-do list and often I just want to very quickly something comes up and I just want to say oh must do this. So what I've done is there's a separate workflow here so these are two different tools get today's tasks and create task so this is an example one this is a create task and so when it calls this tool it comes through here it uses the Todoist module and then sends it back to the agent so I can just say Hey create a to do for feeding the cats and that hopefully yeah it's added in feed the cats this is my to-do list for today a fictional to-do list film youtube video edit youtube video send invoice feed the cats so then let's go back and say hey what what tasks do i have today So it's just a very easy way of accessing your to-do list. There's a couple more tools here. So this is Create Flux Image. So I've just created a simple workflow which will generate an image using the latest Flux model. So I'll say, hey, could you please generate me an image of five cats watching television while all drinking milk? and I really have got to stop referencing cats when I do these images. This one should take a bit longer because it's going to an external service. So this is the workflow. It uses OpenAI to create a a prompt for Flux and then sends that prompt through using an HTTP. request to replicate which calls the flux model and sends it back to the agent and probably take around 20 to 30 seconds and when it's done it should send us a link to the image. So there we go. Let's have a look. I can only assume there's some kind of invisible television up here, or perhaps we're looking at it from the perspective of the television, but you get the idea. Again, the prompt is probably not developed particularly well. And I've got this last one called Create Nut. This is one that, again, if I'm out and about walking around, I might have some ideas for a YouTube video or a new automation to build or anything really, and I just want to get it down. like on paper effectively but it's easier to just talk to something so I can just open up my telegram app and speak and just I did this one earlier because I didn't want to subject you to a minute of my rambling so this is what it does is it takes the transcript from the Telegram voice message and then it passes it through an opening i module which puts it into a slightly more structured note. So here's an example one and it creates a notion file. So speak for a minute, you get this, and this is just refined down. It removes all the ums, all the filler stuff, but it stays true to what I've said. So this is basically, I was just rambling on for about a minute, and that's what it's come up with. So it's just a way of getting slightly more structured notes down in an effective way. And then the last thing I want to run through is the Pinecone Vector store. So I think this is cool, and this has got potential to be really interesting. So you can imagine a workflow that's a bit like this. So first of all, in the Pinecone Vector store, I've uploaded a PDF on expert copywriting tips for advertising. So, and... The agent has access to this vector store and it can then pull relevant information through based on semantic indexing. So I'm going to ask it for some tips on... Copywriting and it will It will understand the context of that and it will find similar things within the database and it will bring it back So this is called RAG, which is Retrieval Augmented Generation. So it's taking a chunk of information that's very relevant, putting it into the prompt to help it come up with a better response. So let's say, hey, can you give me three practical tips for writing good headlines for Google Ads? So it's taking that kind of... The kind of thing I'm asking, it's now looking for things that are very similar within there, within the Vector database. And it's retrieving that, and it's giving me this information. So here's the tips. And then because we've got this Windows buffer memory here, window buffer memory, it has access to previous chats that we've had. So I can reference previous things that we've said to each other, going back to like 10, I think. You can set that to different levels. So then I can say, okay. So based on the tips you've just given me, can you please come up with three headlines for my new product, which is a combined hammer and screwdriver? Not sure where that came from. So there's three headlines and then let's say right I want to actually put some ads out. I want to make some Google ads so I'll say okay can you get me some tips for writing the body copy to accompany headlines on Google ads. So now going back into the into the vector store to find some tips on writing body copy. I should spit these out fairly quickly. So there are some tips on writing body copy and then we'll combine that again and say okay so using those tips you've just given me and the three headlines you came up with before can you come up with three complete Google Ads that I can upload into the platform So we're kind of going step by step here and getting it to construct a Google ad for us using best practices in advertising copywriting. So there we go. Simplify your projects, meet the Hammer screwdriver duo. Say goodbye to cluttered toolboxes. Right, okay. Obviously a ludicrous concoction, but you get the idea. These are pretty reasonably well-written ads. And now, this is just an example here, but I could then say... Great, could you then pass these over to the marketing department and get them to publish them in Google Ads? So it's now going to pass this over down to the marketing department. Now, this is cheating slightly because I haven't actually built this. But I'll go into this in a second. Matamoros received, Google Ads have published them on the platform. There you go. But it hasn't actually because... Let's get into that now. So, these are examples of potential ways you could... Effectively, the whole point of this video is that you could build something which can run an entire business. So we've got an agent here. These are sub-agents of the main AI agent. We've got a marketing department, a sales department and a finance department. So we'll just go into the marketing department one. So you can see this marketing department agent has four sub-agents. So content, social media, design and paid ads. And then Imagine once you've built this out entirely, then within the paid ads agent has then got sub-agents. It's got a Facebook ads agent, it's got a TikTok agent, it's got a Google ads agent, Snapchat agent, everything. And each of those has tools like upload ad, create campaign, get ad stats, that kind of stuff. And then they can effectively do anything that a paid ads manager in your company would do. All it needs is the correct tools and to be given the correct information. So at the moment, the prompt for this marking agent just says, your agent who's in charge of the marking department. You'll be sent a message by your manager and you should not use any tools you should just act as if whatever he asks has been completed successfully. So that was just to show this example. So let's look at the last execution of this one. So you can see he went through to the agent, he's checked the buffer memory to get the previous messages and then he sent it to the marking department down here. So yeah, so that's that. You can imagine this, you could then speak in Telegram, you could speak to them, speak to the agent for anything and say, like, you know, please check, are all invoices... check all overdue invoices that need to be paid. Are there any that are more than 30 days overdue? If so, send an email chasing up for payment to the relevant companies. And then the agent would then send it down to the finance department agent, who would then give that to the invoice agent, who's got a bunch of tools. And then he would then execute all those things like checking QuickBooks or whatever for invoices, and then sending out emails. to come here to trace them. So this is very much an example of the kind of stuff that you could then ultimately go on and build. Okay so let's get rid of telegram and then I'll quickly go through this automation. So it starts with a Telegram trigger in the same way that we did with Relevance AI. You need to set up a bot using the bot father on Telegram. Then we've got a switch node here. So if voice file exists it goes through one branch and if not if text exists it goes through the other one so this just routes it. Text can go straight into the agent and obviously if it's a voice note it will have to be downloaded and then transcribed and then sent to the agent. We just want to make sure that we set a field here which is just called json.text so that they are both they're both going to be outputted as the same variable which is json.txt. So in the AI agent it can see the text input it gets is json.txt. Let's have a look at the agent. So this is the prompt. So this is one of the most important things in any agent system is the prompt. It has to be very clear and you have to outline all the things that it can do. So you give it generally, even this is quite simple, like compared to how you could do it. So all I'm doing here is basically saying what the role of the agent is. So you're a helpful personal assistant and your role is to take his input and help him get things done. And then I've listed out all the... the tools and agents at their disposal. So it's simply just a list of all the tools and a very quick description of what they all do. So Google Calendar, Get Events. This tool is used to get events on Neil's calendar using before and after date to filter. Send Email. This is used to send a text email from Neil. It requires an email address or email address to send to, subject, and a message. And then it's very important that you give it the ... time because a lot of things if I say like do this set this meeting up for tomorrow it needs to know when now is so that it knows when tomorrow is and what date to put it in and also make sure you get the time time zone right so you set your correct time zone within any time and also just just referenced it here as well to make sure that he gets the gets the time correct So then there's a few things you need to give these agents. Firstly, well firstly is the prompt and then you need to link up a chat model. So I'd always recommend using 4.0 for this. This is the most important part of the whole thing. It's the brain. So you want to make sure you give it the best model possible. So I always use 4.0. And I'll upgrade as and when opening iRelease more advanced models. And then Windows. buffer memory you don't have to give it this but it's strongly recommended because otherwise the agent wouldn't be able to recall back to things that were said in the previous messages so as you saw earlier I was able to say hey can you give me some info on this and I said right based on that can you do this but without window buffer memory it wouldn't know what the previous information was it would just be starting fresh And then it's tools one of which is a vector store tool and this is where you this is where we use pine cone to To store all the information that we want to the agent to have access to This is a very simple setup for now because I've only just I've just got one PDF in there. But in theory, what you would have in here is all your business information. So let's say that, let's say you're running a business, you want to have all, you want to have every point of data that is possible within this vector store. So you want your CRM data, you want emails, you want Slack messages. You want deal data, you want your company SOPs, everything in there so that whenever an agent needs to do a task, it can access the relevant part of that venture database and use that to better complete the task. We'll go into that in more detail in a separate video I think. In general this video is not going to be a super in-depth one on the individual parts of this build. I just want it to be a bit more of an in-depth video. intro into into n8n and then we've got the more regular tools so n8n recently uh upgraded itself so you can now before you had to call if you wanted to do um create an event in calendar you'd have to build a separate workflow like this and then call the node there and then send it back. But now they've given it so that you can, when you go to add a tool, it's got these tools that you can now add directly in as tools. So a limited number for now, but it keeps expanding them. So it will keep getting more and more powerful, the things that you can just link in that relate to the agent. So just a quick example of one, create event. You have to give it a quick description. So that this is what the description you're giving to the agent so it knows what this tool does So it says call this tool to create an event in Neil's calendar. It will just start Date time and then date time and title for the event. This is basically the same as what I said in the agent prompt itself And then down here this is the key part for these new parts of the new tools that you can use directly with the agents. You use a function called fromAI. There's some good documentation on this which explains it really clearly. But basically it just says, because this tool needs a start date and time. So normally you would just you would put that in like you'd select it but here we want the agent to based on based on what I tell it to do we want the agent to figure out what the start date and time should be and put it in there so Using this function from AI, we want it to put in a thing called start, and this is just a description. So it's start comma and then description, date and time that the event should start, and the same for end, and the same for summary. Again, I will go into all this in more detail in a follow-up video. I'm probably going to do a complete build from scratch of an agent like this, where I get much more granular into how to do it, so you can just watch along and build along. But that's going to be a long video. I don't have time to do it in this one. And these are just external. I've shown you these before, so let's have a quick look at the create flux image one. So when this tool gets called, it sends it into OpenAI. Hang on a sec, what's going on here? Okay this hadn't refreshed properly. Okay so the message comes in it goes into OpenAI and then we've got this prompt here so it's just saying so you're an expert image prompt crafter and then we just give it an outline of how to prompt well in Flux. Based on this come up with a prompt for Flux which will create a good image based on this query and then the query from the agent is inserted there and you only return the prompt and then it sends that prompt forward into this HTTP module This is calling the replicate API which I've got set up. Again I did this exact this exact setup in a previous model, a previous video using Relevance AI. So I've just basically copied everything across. It's the exact same JSON so we're just sending the prompt across here. You can see this is the request and it's taking the prompt it's sending to the API is being taken from the OpenAI. module here and then it's sending it back. It's sending back the output which is the URL of the image which it can then send back to me via telegram and these are just the subagents that I went through. They're basically just there to show an example. Yeah and then it just sends a telegram message back to me and that is how it all works. So this is obviously an example of one central agent which is kind of called on demand by a user using Telegram. In the real world, you're going to have a lot of different use cases. There's a lot of agents you'll build. which aren't called manually by a user by saying hey can you do this there'll be something like let's take a simple example that a lot of people are starting to use is an email sorting agent so So when a new email comes in, that's the trigger. So when the email is received, send the email to the agent. The agent will then categorize it in one of three or four different ways. Like, is it spam? Is it promotional? Is it an important email that needs a response? Is it a customer inquiry? And then it can route those in different ways. So if it's promotional, it'll file it away in a folder. Maybe it'll summarize it as well and just say, hey, here's the promotional emails. got this week and you can just have a very quick online summary of all of them and if you're interested in actually listening to what one of these cold emails has to say you can go and read it properly that kind of thing. Or it might be when a new lead comes in. We've got a lead qualification agent. So let's say you're getting 100. Let's say you're a business that gets 100 inbound leads a day. And you've got someone who's manually going and checking all these things, all their LinkedIn profiles, their websites. Are they a good fit? Are they right for us? You can build an agent that does all that. So when a new lead comes in. scrape the LinkedIn profile of the email address of the person that submitted it, research the company, do a Google search, search the company on LinkedIn you can do all kinds of different external API's to get information on this company, send it all in and then the agents got all the information and then you can say right here's our ideal customer profile Here's the parameters for the kind of business we want to work with. Is this company in person a good fit for us? If no, put them in a separate pile. Perhaps send an automatic response saying, Hey, thanks, but I don't think we're good. fit right now um if they're if they're a good fit then send a slack alert immediately to like an sdr or or or someone within the company that can then perhaps you know call them back straight away so you you've got a five minute window someone submits a lead and within five minutes you can get back to them and say hey come and buy our thing right so um these are examples of um it of systems that will just, you build them once, they sit in your business, and it just takes care of things as they happen. And you gradually remove these manual tasks from people who are having to do this. and these are the kind of tasks that need to be automated. No one wants to go through 100 leads a day, research on websites. That's not a fun part of anyone's job. People's jobs should be being creative, using your skills to do things that AI cannot yet do. And this is the power of these kind of agent systems. It will create... Thanks. Employees and people in businesses will have more freedom to make more of a difference and really focus on the really, really high value tasks rather than spend their time doing a lot of manual work. So yeah, before I get drawn on too much, like I said I just wanted to put this video out and just kind of do an introduction to NAN, show the kinds of things that are possible at a higher level and then And hopefully in very soon I'll start to release more and more videos on specific agents building some I'll build in real time and some I'll just I'll just Build and then I'll just show them and yet we'll explore explore business problems to solve and use using this tool if you want this template I'm going to make it available to everyone for free there'll be a link to link to my newsletter so you need to sign up for that and then all my subscribers will get free access to this to this template and all the other previous templates I've built and any future ones as well. Also if you're enjoying the content please do subscribe to the channel so that you can be first to see the new videos. Also let me know of specific agents you might want to see built. I'm always keen to hear suggestions along those lines. I'm really bullish on AI agents and the impact they're going to have on the business world over the next few years. And we're right at the start. Like this stuff only just started existing. So if you're starting to learn... about them now you're ahead of 99 plus percent of the world um and by getting a good grounding in this stuff right now you're going to be in a really good place to capitalize when more and more people start to take notice of the potential of this kind of thing remember this is as bad as ai agents are ever going to be and they're already pretty amazing So yeah, thanks for watching. I'll see you soon.