Free YouTube Transcribe

Video transcript

N8N Full Course: Build AI Automations in 2026 (For Beginners)

Michele Torti · 158,590 words · 721 min read

Want to search this transcript, jump the video from any line, or download it as TXT, SRT, or VTT?

Open in the transcript tool

Full transcript

Intro

0:00Welcome to the most comprehensive N8N

0:01course, where I take you from a real

0:03beginner in AI automation [music] to

0:05someone who's actually able to build

0:07automations and AI agents for themselves

0:10or for other businesses. And in case we

0:11haven't met, my name is Michele, and

0:13over the past 12 months, we've helped

0:15over 40 businesses implement AI and

0:17automations and taught over 20,000

0:19people in the process. All starting with

0:21zero technical knowledge. So, we're

0:22going to go through everything from

0:23understanding

0:24>> [music]

0:24>> what is AI automation to setting up your

0:26own N8N account, understanding how to

0:29build stronger and faster, more AI

0:31automations and AI agents, and finally,

0:34actually building systems step-by-step.

0:36[music]

0:36By the end, you'll be an AI automations

0:38and AI agents expert, and you'll know

0:40exactly how to build systems that drive

0:42real business value. So, the course

0:44itself is split into six different

0:46modules. Module one is getting started

0:48with N8N foundations. We'll go through

0:50exactly what automation even is to

0:52understanding how you can set up

0:53everything within N8N and build your

0:55first automation. Module two is [music]

0:57core N8N foundations, using automation

0:59logic and APIs, and walking you through

1:01exactly how automation really works in

1:03the backend. Module three is AI agent

1:05fundamentals, and really understanding

1:07how AI agents work. Module four is

1:09building smarter AI systems, using

1:11frameworks and prompts, which allow our

1:13automations and AI agents to make sure

1:15that everything that we build is

1:16actually scalable, tangible, and can

1:18actually be implemented into a business.

1:20Module five is real-world AI agent

1:22projects, end-to-end builds, showing you

1:24exactly different use cases within a

1:26business that you can implement [music]

1:28AI agents, and showing you how I build

1:30it step-by-step. And module six is

1:32real-world AI workflow projects,

1:34end-to-end builds, [music] where I show

1:35you exactly how we now not only just use

1:38AI agents, but use entire workflows to

1:40be able to implement into a business,

1:42and showing you how I build different

1:43use cases step-by-step. By the way, if

1:45you want access to all the resources

1:47that we're going to be talking about in

1:49this video, plus being part of a

1:51community of over 3,000 people who are

1:53actually building automations every

1:54single day and growing their own

1:56businesses, check the second link down

1:57below. I'm going to leave all the

1:59timestamps down below in case you want

2:01to skip through some modules or go to

2:03the direct part, or even come back to

2:04this video uh because I know it's really

2:06long. Um so, without further ado, let's

Module 1

2:09dive in.

2:12All right, before we jump into N8N,

2:14let's talk about what is automation.

2:16Automation is the process of using

2:17technology to do tasks without you.

2:20Whether it's AI agents, whether it's

2:21workflows, whether it's all this stuff,

2:23that's exactly what it is. It's using

2:25softwares

2:26to be able to do things without you.

2:28Now, every day, we all perform many

2:30regular ad-hoc tasks. Ad-hoc just means

2:32that it's repetitive. Whether you are a

2:33working professional, whether you are a

2:35business owner, whether that's in sales,

2:37marketing, operations, finance, or

2:39business management, we all have

2:41different parts of the business that we

2:43have to do because that's what drives

2:44the business forward. But the problem

2:46is, these tasks are repetitive, so they

2:49happen every single time. They're

2:50no-to-low brainer, so they're not that

2:52hard to do.

2:53They're low value addition, so you do

2:55them, but they don't add that much value

2:57into your day. And most importantly,

2:58they're effort and time consuming. So,

3:00you do them, they take a ton of time,

3:02you don't want to do them, they are

3:03repetitive, they're very easy, and so

3:05the solution is automation. Now, you

3:07might not be fully conscious of it, but

3:09automation actually plays a big role in

3:11our everyday lives. For example, when we

3:13have a meeting in our school community,

3:14so we have two weekly calls. One is a

3:16weekly huddle, the other one is a vibe

3:17coding session. When the meeting is 1

3:19hour away, then it sends a notification

3:21over email to my school members. Or

3:23Netflix. When you watch a certain type

3:26of movie, then Netflix recognizes that,

3:28so it says, "Hey, he watched this movie,

3:29that means he must like something else,

3:31right?" And it gives you a

3:32recommendation. That is automation,

3:34because it automates the process of you

3:36having to find the movie that you like

3:38in yourself.

3:39Or a coffee machine. And you might be

3:40asking yourself, how does a coffee

3:42machine even play a role in this? Well,

3:43just hear me out. Whenever a coffee

3:45machine finishes making the coffee, then

3:47the timer finishes. And lastly, ChatGPT,

3:50right? Because when you give a prompt to

3:52ChatGPT, then it gives you the output,

3:54right? Now, ChatGPT is a bit different

3:56just because it's non-deterministic. So,

3:59non-deterministic means that one series

4:01of input. So, you can say, "Hey, can you

4:03do this for me?" And it does something

4:04else. You can say the exact same thing,

4:06and it might do it differently next

4:07time, right? Because you can't determine

4:09the output that you get. But at the end

4:10of the day, everything is automation.

4:12Now, I don't know if you noticed the way

4:13that I was actually explaining these

4:15concepts, but we actually use a very

4:17simple principle, which is if this, then

4:20that. So, if we have X, then it goes to

4:22either A and B. If it's B, it goes to

4:24either E and F. If it's A, then it goes

4:26to either C and D. And that is exactly

4:28how automation works. Everything and

4:30everything is built on logic, right?

4:32Whether you're building code, whether

4:33you're using automations, whether you're

4:34using N8N, make.com, Zapier, Power

4:37Automate, all these tools, they're all

4:38built on logic. If this happens or when

4:41this happens, then you do this. And the

4:43question then becomes, what can

4:44automation do for you? Well, as a

4:46business owner or an individual, it

4:49increases productivity and efficiency,

4:50which means that you can do more with

4:52less, more leverage. You save time to do

4:54other things, right? Because automation

4:56for a business means that they can now

4:58focus on other areas of the business.

5:00Has an increase of availability, cuz

5:02automation doesn't need holidays, they

5:04don't need any emotional support,

5:05they're always there working 24/7. You

5:07can scale with less resources. And by

5:09the way, we've come to a point where

5:10automation allows us to be able to build

5:12a one-person company, as you might have

5:14heard. Uh but it's all because of the

5:16softwares and technologies that is out

5:17there. All because of automation.

5:20And it's more robust and less errors,

5:22especially when it comes to the

5:23repetitive tasks that you have to do

5:24every single time. Cuz if you are

5:26anything like me, when I do something

5:28over and over again, I get tired, and my

5:31quality of output goes down, right? And

5:33so, with automation, it's consistent.

5:35And with that said, let's jump into N8N.

5:38All right, so this right here is N8N.

5:40Now, all you have to do to get to this

5:42page is go to n8n.io, and you'll have

5:45this dashboard. Now, as you can see

5:46here, it's a flexible AI workflow

5:48automation for technical teams that

5:50allows us to be able to build

5:52automations without needing to know how

5:54to code. Now, the automation can vary,

5:56right? Depending on what you're using

5:57it. IT, security, dev,

6:00sales, you can do a bunch of stuff

6:01within this exact platform, and it

6:03allows us to have so much flexibility

6:05around what we build. As well as

6:06plugging it to over 500 integrations,

6:08which is a bit lower than other

6:10platforms, but it still allows us to be

6:12able to speak to different softwares all

6:14together. And also, it has the ability

6:15for us to code when you need it, the UI

6:18when you don't, which means that you can

6:20go either way, which is why I mentioned

6:21that it's flexible in what we do,

6:23because it's great for two kinds of

6:24people. All right, so if I go to pricing

6:26right here, I can see how much we

6:27actually have to spend to be using N8N.

6:30Now, N8N does not have a free plan on

6:32the cloud version, right? Cloud version.

6:35Now, if you're a beginner to N8N, you

6:37have probably heard about self-hosting

6:39versus cloud hosting. Cloud hosting just

6:41means that you just use N8N within the

6:43cloud. Literally just here. On Chrome,

6:46on Safari, whatever it is. But we do

6:48have the option to self-host, which

6:50means that we create our own server, and

6:52we self-hosted in our own server, so we

6:54don't have to pay. Now, don't worry, I'm

6:56going to show you exactly how to

6:57self-host as well in the next few

6:59videos, so you'll have that, too. Now,

7:01for the cloud hosting version, which is

7:02the one that most people use, we don't

7:04have a free plan, but we have a starter

7:06plan, pro, business, and enterprise.

7:09Now, most people use the 24 euro plan,

7:11which is, I believe, about 30 bucks. And

7:14the way that N8N actually prices us is

7:16through workflow executions, which I'll

7:18speak about in just a second. But we do

7:19have the ability for us to start a free

7:22trial with no credit card required,

7:24which allows us to test N8N for about 14

7:26days before we have to upgrade to a paid

7:28plan.

7:29And here, we have one shared project,

7:32five concurrent executions, unlimited

7:34users, 50 AI workflow build credits, and

7:37forum support, which is more than enough

7:39for what we need. Now, if you are

7:40building N8N for a bigger company and

7:42you want more workflow executions, then

7:44you're most likely going to be using the

7:46pro plan, which is 60 euros a month.

7:48Now, honestly, this is not super cheap,

7:50but when you think about the concept of

7:51how they actually price their

7:52automations, it is much better than any

7:55other platform that I've seen before.

7:56And same thing here, but it has a bit

7:57more stuff when it comes to the actual

7:59plan. All right, so for you, just press

8:01start free trial right here, then we can

8:03start filling out the form.

8:05And then you can press start a free

8:0714-day trial.

8:09Go through the onboarding questionnaire

8:11right here,

8:12where they ask you a few questions just

8:14so they get to know you a little bit

8:15more, okay?

8:18Podcast, submit. And you can also invite

8:20members into your workspace. Let's just

8:22press skip. And now our workspace is

8:23starting up. Now, I do really like the

8:25onboarding um sequence that N8N has.

8:28It's really, really quick, and it's

8:29really, really easy to follow. Now,

8:30because you're watching this video,

8:31there's no need to press this video

8:33right here, cuz I'll show you everything

8:35that you have to know. Uh but it is a

8:36pretty good starting video as well. And

8:38this guy is a legend.

8:40>> [laughter]

8:40>> All right, once the workspace is ready,

8:42just press start automating, which will

8:43take you to

8:45a dashboard that looks like this. So,

8:47welcome to N8N. Now, on the top, you get

8:49to see that you have 14 days left on

8:51your free trial, and you have 8,000

8:53executions, which is again the way that

8:54N8N charges you. And then on the top,

8:56you have upgrade now, which is a button

8:58to upgrade. I'm going to press X, and

8:59now we have this page. All right, so on

9:01the top right here, we have a dashboard

9:03that allows us to visualize the numbers.

9:05So, I can actually press inside each one

9:07and be able to see

9:08the different graphs. Now, production

9:11executions just mean that, "Hey, how

9:12many executions?" So, how many times did

9:14our automation run every single 7 days?

9:18How many times did the automation run,

9:20but it didn't work? Then out of all the

9:22executions that didn't run in the past 7

9:23days, how many of them did not work,

9:25which is this percentage right here? And

9:27then, how much time did you save, or how

9:28much time did the workspace save with

9:30these automations in place, which is

9:32good to have, but at the same time, it

9:33isn't super accurate, cuz to understand

9:35how much time you saved for a company or

9:37for yourself, N8N needs to know how much

9:39time did you take in the first place to

9:41do it, right? Because then you're saving

9:43them that much time. And lastly, run

9:45time. So, for how long are the

9:46automation running? Now, right here, and

9:48on the top as well, you have the ability

9:49to create a workflow, and this is how

9:51you start from scratch. This is how you

9:52start building. Now, before we get to

9:53that, we have workflows here, then we

9:55have credentials right here, which is

9:57the ability for us to be able to add

9:59credentials for the different software

10:01APIs. Now, if you have no clue what APIs

10:03are, it's how automations are basically

10:05happening, how they're

10:07existent. I'm going to go through APIs

10:09in much more detail in the later stages

10:10of the video, so don't worry. But here,

10:12we're basically adding the username and

10:14password for each software. So, we

10:16always have it here. We don't have to

10:18re-upload it again. It's always a

10:19repository of passwords.

10:21Then we have executions, so we can see

10:23all the executions, which is, "Hey, this

10:25automation just run." It logs it, so you

10:27have everything logged and uh secured

10:29here, which is great. And lastly, it's

10:31data tables. Now, I'm going to dive into

10:33data tables in this module, I believe,

10:35or next module, um where I show you

10:36exactly how you can use data tables, how

10:38they're powerful, how they're better

10:40than using tools like Google Sheets and

10:42Airtable or Notion. So, we'll dive into

10:44that. Now, without further ado, let's

10:46press start from scratch, or you can

10:47press create a workflow. All right, and

10:49once you get to this dashboard, you'll

10:51be introduced with two different

10:52options. The first one is adding a first

10:53step, which is adding a first step

10:55manually right here, trigger, which is

10:57the first step of the actual workflow

10:59automation,

11:01or you can start using build with AI.

11:03Now, build with AI is only something

11:05that, depending on when you're watching

11:06this video, it only came out about a

11:08month ago, but when I press this button

11:10right here, it takes me to this right

11:12page right here. Now, the good thing

11:13about n8n is that it has two different

11:16types of support. It has the support

11:18where you can ask any questions about

11:20anything, and you can simply type any

11:22message here, and it will give you an

11:23answer, sort of like an n8n coach that

11:26helps you when you're building your AI

11:27agents or automations.

11:29And then we have the feature, which is

11:31build. Now, build again is something

11:33that recently came out, but it allows us

11:34to actually give it a prompt, so we can

11:36tell it, "Hey, what would you like to

11:37automate?"

11:38And it actually builds the thing. I'm

11:40going to just do this real quick, so you

11:42get to see exactly uh how it looks. I'm

11:44going to say, "AI agent that drafts

11:47my emails." And we have only 20 credits

11:49a month to use.

11:51I'm going to press go. As you can see

11:52now, this is thinking.

11:54It's searching through the nodes. I'll

11:56explain exactly what a node is.

11:57Essentially, it's a step in an

11:59automation. It's getting the node

12:01details, so it's understanding exactly

12:03automations in n8n, understanding which

12:05steps to put together and what. On the

12:07left-hand side, you get to see that this

12:08is working.

12:09Now, you get to see that it's adding the

12:10different steps of the automation. And

12:12the best way to describe this is that

12:13it's searching through a puzzle.

12:15It's understanding exactly what pieces

12:17do I need for the puzzle, and then it's

12:19getting the pieces, and then it's

12:21putting the pieces together right here,

12:23and then it's connecting, making

12:24connections inside those pieces, which

12:26we have right here.

12:28And now we can start using the

12:29automation. Now, I'm going to delete

12:30this and start from scratch, because I

12:32want to show you exactly what it looks

12:33like without the build with AI. As you

12:35can see now, we have no option to build

12:37with AI. We just have the first step.

12:38So, when I press this, I can see that on

12:40the right-hand side, it asks us, "What

12:42triggers this workflow?" Now, a trigger,

12:43like I mentioned before, is the first

12:45thing that starts the automation. Now,

12:46in n8n, we have the ability to trigger

12:48manually, so we can manually trigger

12:50this. We just press this button right

12:52here, which is execute workflow, which

12:53means that we are starting the

12:54automation, and it executes manually.

12:57We're able to trigger from an app event.

13:00So, something happens within any of

13:02these apps, we can get notified,

13:04and then it starts the automation. And

13:06there's about 500 apps here, a bit lower

13:08than other platforms, but n8n is

13:10constantly adding it here, which is

13:11great. We have on a schedule. This is in

13:13case you want to start your automations

13:15maybe once a day, or you want to run it

13:17once a week, or every other Tuesday on a

13:19July, you can do this. You can do on

13:21webhook call. Now, a webhook is

13:23something that I'm going to explain in

13:25the later stage of the video, but it's

13:27something that we use when we want to

13:28get notified when something happens.

13:30We have on form submission, which is for

13:32us to be able to use forms inside of

13:34n8n, so that when someone submits the

13:36form, it then sends us the information

13:38inside the form, and then we can start

13:40the automation. Then we can do when

13:42executed by another workflow, so we can

13:43actually have a workflow that calls

13:45another automation, right? So, workflow

13:47calls another workflow and then brings

13:48it data back.

13:50Then we have on chat message, in case we

13:52want to create a chatbot within n8n.

13:54Then we have when running evaluation, so

13:56this is in case you want to test the

13:58performance of your workflow or of your

13:59AI agent. And then you can do other ways

14:01as well, which in this case, it's using

14:04other different service. Now, I will

14:05cover this in the later stages of the

14:06video, but understand that a trigger is

14:09just the first step of the automation.

14:11Because let's say we do it manually, now

14:12we have the ability to then add the next

14:15steps. And so, when we have the first

14:16step here, the way that this works is

14:17that we have this connected to another

14:19step right here, and I can choose the

14:21next step. In this case, we have the

14:23ability to use AI in our workflows. We

14:25have the ability to use any

14:26applications, so any softwares, the

14:28ability to transform any data right

14:30here, the ability for us to have some

14:33sort of routing, which means that if we

14:35send the automation one way if this

14:36happens, the other way if something

14:38happens. And again, all these things

14:41might look complex because you're new to

14:42n8n, but trust me, they're much easier

14:44when you actually put them into

14:45practice. We have core, which is using

14:47code, HTTP, webhooks, a bunch of stuff

14:50that you shouldn't worry about now, and

14:52human in the loop, which is another

14:53feature that I'll be explaining. So, we

14:55have the first step, then we have the

14:56next step. So, let's say I want to talk

14:59to Notion

15:00or Google Sheets. Let's say Google

15:01Sheets.

15:03Now, we are introduced with Google

15:04Sheets, and these are all the actions

15:05that we can do within that software,

15:08right? So, with every software that we

15:09have, let's say it's even Gmail. If I

15:11press on the actual software, I can see

15:13that all the actions that I can do

15:14within that software. I can add a label

15:17to message, delete a message, get a

15:18message, get many messages. I can do a

15:20bunch of stuff within each software,

15:22which is where automation truly shines,

15:24because it does the things that we don't

15:25want to do, or that we don't have to do.

15:27And so, let's say I wanted to go back to

15:29Google Sheets, I can just press Google

15:30Sheets here, action in app, which you

15:32find again right here, action in app.

15:36So, then

15:36I can go Google Sheets.

15:38I can choose the action that we want to

15:39take, which is append a row.

15:42And now we're introduced to this page

15:43right here. Now, every n8n node has an

15:46input,

15:47then has in the middle the

15:48configuration, which is, "How do we

15:50actually set the thing up?" And then the

15:52output, which is, "Okay, using the

15:54configuration here, what was the

15:55output?" All right, so I just made a

15:56Google Sheet here that has name, email,

15:58phone number, company, role, and

16:00address. Let me name this contacts. Now,

16:02here, if I go back to n8n, the first

16:04step to building any kind of automation

16:06with different steps in the flow, is

16:08connecting our accounts to these

16:10softwares. So, we're able to access them

16:13without us having to go to the actual

16:14software to do it. So, right here, you

16:15get to see on the top that we have

16:17credential to connect with, which is,

16:19just press here, you can create a new

16:20credential, which means that you're

16:21connecting your account, and you're

16:23introduced to this page. Now, if you see

16:25OAuth 2, service accounts, allowed HTTP,

16:27and you get overwhelmed, don't worry,

16:28just sign in with Google. It's just a

16:30simple login verification, and you're

16:32all good. I'm going to press the account

16:34that I want to connect to. You can press

16:36select all, so you're basically saying,

16:37"Hey, I trust n8n to have access to my

16:41Google Drive and my Google Sheets." You

16:42will get to this page, which is

16:43connection successful, and you'll be

16:44redirected here to n8n. I can make a

16:47name, so I can say Michele

16:49system

16:53account.

16:54So, I'm pressing save. And usually, what

16:56we have is also the date. And the reason

16:57why we add the name is because when you

17:00connect 20 to 30 accounts here, you want

17:03to know exactly what the account was.

17:05And so, the only way for us to know

17:06exactly what the connection is, is to

17:08name the actual connection. Once you

17:10have this here, now the resource is

17:11usually, "What is the thing that we're

17:13manipulating? What is the thing that

17:14we're taking and doing something with?"

17:16In this case, it will be a Google Sheet.

17:17The operation is always the action that

17:19we're taking. So, as you can see here,

17:21we have different options. We have

17:22create, delete, delete rows, get rows,

17:25update a row. You can do a bunch of

17:26stuff. And in this case, you have append

17:28a row, which is create a new row in a

17:29sheet,

17:30right here. The document, it's choosing

17:33the actual Google Sheet, which in this

17:34case is contacts, right here. See how I

17:37just right here. And also, what you

17:39could do is actually go to the ID

17:42or the URL

17:44of the Google Sheet, which I can find,

17:45if I go here, I can find in the URL

17:46here, and the ID is usually

17:49right here. And then the sheet, which is

17:51the sheet within the Google Sheet, which

17:53in this case is sheet one. That's a lot

17:54of sheet right there. Um and finally,

17:56you have this right here. And so, this

17:58is where you start to map columns. So

18:00again, what we're doing here is we're

18:01adding a row inside here. So, we're

18:03adding a row into name, email, phone

18:05number, company name, role, and address,

18:07which is why when I go back here, I can

18:08see that it's asking us, "Hey, what are

18:10the different values that you want to

18:11send?" In this case, for name, let's

18:13just put James Arthur. Let's do email,

18:16my email here, my phone number,

18:18my company, the role,

18:21and the address, so on. And now, leave

18:24everything else as is. These are just

18:26other options that you can um sort of

18:28play around with, but there's no need

18:29for that. And all we have to do now to

18:31actually run the automation is to be

18:35able to connect this

18:37to here.

18:38So, this is saying, "Hey, the first step

18:39now is connected to the next step." And

18:41so, if I press here execute workflow,

18:43this should now start the automation and

18:46do the action, append the row, like we

18:48mentioned, and adding these details in a

18:50new row.

18:51So, let's try it out. Let's say I go to

18:53execute workflow. I can see that the

18:54first step executed, and we know this

18:56because it was all green, check mark,

18:58and the second step as well. And if I go

19:00to my Google Sheet, I can see now that

19:02James Arthur, with his email, phone

19:04number, James Solutions, CEO, and Spain,

19:06was added to our database. And that

19:08right there was a full execution from

19:09the start until the end, workflow

19:11executions, from the first step until

19:13the last step. Now, we can add another

19:15step, which let's say is Gmail. I chose

19:17to type Gmail. I can choose the software

19:19here, and now I can choose the action.

19:21So, in this case, it can be send a

19:22message.

19:24And now we're introduced to this page

19:25right here, which is very, very similar

19:27to the one that we had on Google Sheets,

19:28but the only difference now is that we

19:30have access to the previous, we call

19:32them variables, right? Because they're

19:33different variables here.

19:35And now we can use these variables in

19:37the automation. And that's why we don't

19:38call them variables, what we call them

19:40dynamic variables, because they change

19:42every single time. Because when I put

19:43name somewhere here,

19:45and I run the automation again later, if

19:47the name changes, this automatically

19:49changes name. So, all I have to do here

19:51is do the same thing. So, I can send a

19:52message, which in this case is send an

19:54email. I can sign in with Google. I can

19:56choose my account, select all.

19:58Connection successful.

20:00And now [snorts] I can name this, press

20:01save. Correct. And now we've connected

20:03our account to n8n. So, now n8n is able

20:06to use our Gmail. The resource, which is

20:09what is the thing that we're

20:10manipulating, again, changing, is a

20:12message, which in this case is an email.

20:14And you can use draft, thread, label,

20:15you can do whatever.

20:16Operation, which is what is the action

20:18that we're taking? In this case, it's

20:19sending. We can do a bunch more stuff

20:21here, depending on what you want to do.

20:23And then it's asking us, who do we want

20:25to send the email to? What is the

20:26subject line of the email? And what is

20:28the message of the email, which is the

20:29email body. So, now, as you can see

20:31here, when I pressed on two, it gave me

20:33the ability to drag an input field from

20:35the left to use it here. So, now I can

20:37take the field from the previous step,

20:39drag this across over here,

20:42email, and have this be the variable

20:45that we use every single time, instead

20:47of putting the email here, right?

20:49Instead of putting the email manually.

20:51Get it?

20:52Get it? 25@gmail.com.

20:55Because if you do it this way, it's

20:56going to be fixed. But, if you take the

20:58variable from the previous step, and I

21:00drag this across here, then only are we

21:02able to change the variable dynamically,

21:04without us having to go here and change

21:06it manually ourselves. And so, what

21:08we're doing now is that we've just

21:08pulled in the variable here. We can do

21:10name. So, pull this name here,

21:13and say, "Welcome to the team." And

21:16also, one more thing that you start to

21:17see is JSON code, right? Now, this looks

21:20very intimidating for someone looking to

21:22get started with automations and going

21:24into n8n, but trust me, it's actually

21:26quite easy. Because this code right here

21:28is literally just the variable here that

21:30we just pulled across.

21:31So, you don't really have to know

21:32exactly what this is. But, in case

21:34you're wondering, we can actually

21:36hardcode it. So, we can do curly

21:38bracket, curly bracket. This opens this

21:39up. You can do JSON {dot} the actual

21:43step from the previous step. So, you can

21:45go to, let's say, email. And you when

21:47you press email, it automatically takes

21:49us back to the same place as if I were

21:51just to drag this across.

21:53And this is great for us in case we want

21:55to reference any variables from the

21:57previous steps, and there's a ton of

21:58variables, and we just want to reference

22:00them really, really quickly, we just

22:01manually hardcode it. But, most of

22:03times, you're just going to drag and

22:04drop. And then, we're going to ask the

22:06email type. So, in this case, let's just

22:07do text. HTML is just the way that you

22:10make your emails look pretty. We can

22:11say,

22:12"Hey brother,

22:14happy to work with" And let's do

22:17company. Company right here.

22:19So, now we're saying,

22:21"Hey brother, [snorts] happy to work

22:22with JSON variable, which is company,

22:24which is this name right here."

22:26We just don't see James Solutions

22:27because

22:29it's a variable right here. Now, the

22:30good thing about n8n is that we can

22:31actually see the output.

22:33So, we can see the actual variable

22:35before we run it, which is amazing,

22:36because now it this gives us the ability

22:37to visualize whether it's correct or

22:39not. So, James Arthur, welcome to the

22:41team. "Hey brother, happy to work with

22:43James Solutions." Which is great. Now,

22:45what I can do is go back.

22:47I can go back here. I can change the

22:48email to, let's say,

22:52this one here that I have,

22:54migdallahcalde5@gmail.com.

22:56And now, all I have to do is execute the

22:58workflow again from the start until the

22:59end.

23:01Right here.

23:03This now goes into Google Sheets, and it

23:04goes here. I can see now that I have the

23:06name, the email, and I guess the email

23:08changed, right? Because we changed it

23:10manually in n8n. The phone number, James

23:12Solutions, CEO in Spain. And as I showed

23:14you, it also sent the email. So, if I go

23:16to my email here, I can see that we had

23:18a new email called James Arthur,

23:19"Welcome to the team. Hey brother, happy

23:21to work with James Solutions." Which is

23:23the exact same email that we added into

23:25our n8n. And so, now that we've built

23:27this, I can explain exactly how the

23:28pricing works. So, from the start until

23:31the end,

23:32right? When you are testing, so when

23:34we're pressing this button and we're

23:36executing this,

23:37we're not paying for it. From the time

23:39that we want to set this live, so we

23:41don't have to manually do it every

23:42single time, we can turn this on by

23:44pressing this button.

23:45So, right now, the workflow, or the

23:47actual automation, is inactive, which

23:49means that the automation is only

23:51running when we manually run it. When we

23:53go inside the platform, when we manually

23:55press this button, and it goes here.

23:57But, in the case for clients that you

23:58want to set this live, it's sort of like

24:00this is just for testing. When you're

24:01building automations, you're testing

24:03here and there. And the live is when you

24:04want to actually set this live, it goes

24:06live. Now, it works by itself, and it

24:08runs through this at whatever interval

24:10that you want. And the good thing about

24:12this is that we're not paying for it

24:13when we're testing, which is great,

24:14because it allows us to be able to spam

24:16the testing as much as we we can,

24:18because the way that I they actually

24:19charge you is by workflow executions,

24:21which is from here to here. As you can

24:23see, we have the green check marks,

24:25which tell us that everything went good,

24:26which is awesome. Now, let's say

24:28something went wrong, right? So, if I go

24:30here, and I just create a new

24:31credential, and I just save it. So, I

24:35just put a fake credential. Close.

24:38Gmail account. This shouldn't work. So,

24:40now, if I execute the workflow, I can

24:42also execute it here, instead of going

24:44here, I can see that now in the bottom,

24:46you can't see it because my face is

24:47there, but if I just move myself here, I

24:50can see that I have problem in node

24:52here.

24:53Right? Which allows us to see that we

24:55have a problem in our automation. And

24:57so, this node right here, again, a node

24:59is just a square within n8n, is a step

25:01in our automation. We can see that we

25:03have an issue, and it tells us the

25:04actual issue, "Unable to sign in without

25:06access token." Which means that the

25:08authorization, the actual account, was

25:10invalid. And on the right-hand side, you

25:12can also see if something went wrong,

25:14what is it that went wrong. And you can

25:16also ask AI, which is amazing, because

25:19this AI is actually good. It's not some

25:20sloppy thing that they just added into

25:22the software. It actually works, and

25:24it's really good. With that said, make

25:25sure that when you build automations,

25:26you always save right here on the top.

25:28And up here, you have the ability to

25:30edit. So, this is where we edit our

25:32workflows. Executions is where we get to

25:34see all the times that this executed,

25:37that this ran, right? The first time it

25:38ran, the second time when we had more

25:41steps, the third time when we had even

25:43more steps, right? So, we get to see

25:45exactly the previous times that it ran.

25:47And then, we have evaluations in case

25:49you're running some more advanced

25:51evaluations, you're testing your your

25:52actual workflow. If you're building this

25:54for clients, you're most likely going to

25:56use this, but it is not necessary to

25:58start. Going back to editor right here,

26:00on the top right here, I have the

26:01ability for me to duplicate the actual

26:04workflow. So, if I duplicate this, I

26:06have to rename this, and I can press

26:07duplicate. And this will now make the

26:09exact same workflow here. Then, I have

26:11the ability to download. So, if I

26:13download it now, I get a JSON file. And

26:15so, the good thing about that is that

26:16this, in the back end, is all JSON,

26:18which is is all code. And so, I can

26:20simply just press download, like I

26:21showed you, and then you can press

26:23import from file, which allows you to

26:25import the automation into your own

26:26workspace. So, if I go to a blank

26:28workflow, I can simply press this button

26:30right here. I can import from file.

26:33And now, I can put the actual file that

26:35I need.

26:36And suddenly, I have the actual

26:37automation, which is imported into your

26:39my n8n account. And then, finally, we

26:40have change the owner, so you can change

26:42the owner of the actual automation. You

26:44can rename the automation this right

26:46here. And you can import from URL. So,

26:48in case you turn the file into a URL,

26:50you can simply import it there. On the

26:52right-hand side here, like we mentioned,

26:53we have the ability for us to add steps.

26:56We have the research, so we can command

26:58bar, so you can actually search through

26:59the different nodes that we have here.

27:01We have notes, which is a big part of

27:03n8n, because we can actually start

27:04documenting our automations. So, I can

27:06go in here,

27:07and I can say, "First step is

27:10manual."

27:12And I can delete all of this, and I can

27:13put this over the automation, which is

27:15great, because when I'm going to give

27:16the automation to someone, right? I can

27:18actually give them an explanation of

27:19exactly how it's working. If I go here,

27:21I can also say, "This

27:23step allows us to be able to manually

27:28trigger the automation."

27:31Right? And so, we have the text here.

27:32And you can start to see how bigger

27:34automations and bigger workflows use

27:36this. And it's something that I use all

27:38the time when I have to give workflows

27:40and AI agents to my community members

27:42who are looking to get them and then

27:43start using them right away. And now

27:45they have an explanation of what it is.

27:46Then, we have right here focus panel, in

27:48case you're doing some note stuff here.

27:50We don't really use this that much, so

27:51don't worry. Um and finally, we have the

27:53AI, which I mentioned is able

28:02or is able to assist us whenever we have

28:04any questions about automations. Now,

28:06you probably might be asking yourself

28:07this question, right? Which is, if you

28:10can build with AI, why are we learning

28:12this at all? It's because AI only gets

28:14you so far. When something doesn't work,

28:17how do you know if it doesn't work? How

28:18do you know if it's not good enough? How

28:20do you know if it's not efficient? Which

28:21is where understanding the fundamentals

28:23is very, very important, rather than

28:25relying on AI for everything. All right.

28:26So, now that you understand exactly what

28:28automation is, how you can set up your

28:30own n8n account, how n8n actually looks

28:33visually, plus building your first

28:34automation inside of n8n, now it's time

28:37to go a level deeper. Because in the

28:39next module, we'll dive into actually

28:40understanding how automations really

28:42work. We'll dive into APIs, webhooks,

28:45and how data flows within automations.

28:47We will look at credentials. We will

28:49look at transforming data, and also

28:51understanding error handling, so if

28:52something goes wrong, what do we do

28:54about it? And lastly, understanding the

28:57core 17 nodes that you need to know when

28:59you want to master n8n. So, by the end

29:01of this section, you will not only use

29:03n8n, but you will actually understand

29:05it.

Module 2

29:12If I had to learn just one skill for AI

29:14automation, it would be understanding

29:16how APIs work, because fundamentally,

29:18they are the things that allow softwares

29:20to speak with other softwares. And so,

29:22once you understand, really understand

29:23how APIs work, you'll be able to use

29:26n8n, Zapier, make.com, Power Automate,

29:28all with no problems, without getting

29:30stuck, and without any limitations. And

29:32the problem is, most people skip this.

29:34They go straight to the platforms to

29:35build automations step by step, and when

29:37something breaks, they have no clue why.

29:39So, in this video, I'm going to break

29:41down exactly how APIs actually work, how

29:43to read an API documentation without

29:46freaking out, and how to build your

29:47first real API request inside of n8n.

29:50Let's dive in. All right, so API stands

29:52for application programming interface.

29:55>> [music]

29:55>> A very fancy term that nobody even knows

29:57the meaning to. But what it means is the

30:00ability for softwares to speak with

30:02other softwares. Now, think of a waiter

30:03in a restaurant, right?

30:05This waiter has the chef, and he has the

30:07customers. And between the chef and the

30:09customers, there's a series of actions

30:10that happen, right? So, take the order,

30:12bring the order from the kitchen, they

30:13deliver the order, make the order.

30:15There's a whole repetitive loop that

30:16happens over and over again. And so,

30:18that is the exact same when it comes to

30:20APIs for softwares. Where we have one

30:23software here, one software here, and

30:25these two softwares communicate to each

30:27other through a series of requests and

30:29responses. So, request in this case

30:31would be the make the order, the

30:32response would be the actual order being

30:34delivered to their table. And that is

30:35the exact same when it comes to the

30:37softwares. And so, fundamentally, the

30:39waiter in this case is the API, and the

30:41chef is one software, and the customers

30:43are other softwares. And this right here

30:44is the thing that allows the softwares

30:46in make.com n8n to speak to each other,

30:48to be able to have a sequential order.

30:50So, we send data to a place and get

30:53something back, and that's how

30:54automations and AI agents are built.

30:56Now, what can APIs do with softwares?

30:59There's a few things that APIs can do.

31:01We call them requests. So, requests are

31:03just a way for the server, the API

31:05server, to send information to the

31:08actual software itself to then create an

31:10action. Now, the first thing it can do

31:11is post.

31:12So, this is when any type of new record

31:14is created in a software. So, this is

31:16like making a Google Sheet row. It's

31:18creating a contact on ClickUp, a contact

31:20on HubSpot. It's

31:22you know, sending information to OpenAI

31:24to make a LinkedIn post. This is a post

31:26request, which is sending information

31:27from one place to another. Then we have

31:30get. So, get is extracting any details

31:33from any record from the software. So,

31:35let's say someone filled out a form on

31:37your website, you wanted to get the

31:39information from that form, and then use

31:41it for whatever you want. Right now,

31:43you're getting information because the

31:44information is going from somewhere else

31:46to us. That's getting information.

31:49Then we have put or patch, which is

31:50updating records in a software. So,

31:52let's say John's name is not John

31:54anymore, it's James, then you use a put

31:56or patch request, right? So, updating

31:58information. And then we have deleting.

32:00So, you can't see this fully, but it's

32:01deleting a record from a software. So,

32:03let's say we had a Google Sheet, or

32:05maybe a contact, we just want to delete

32:07the row, or delete the Google Sheet, or

32:09we just wanted to delete the contact.

32:10That is a delete request. So again, post

32:13is to send information, get is to get

32:15information, then put or patch is to

32:16update information, and then delete is

32:18to delete information from somewhere.

32:20Now, I'll share a story here. So, I was

32:21on a call with a client a while back,

32:23and she asked to automate different

32:25parts of her onboarding process. And she

32:27used Zoho CRM as the CRM, which by the

32:30way is just a place for companies to

32:32store information, to be able to send

32:34information to Zoho to make a new

32:36contact whenever someone filled out a

32:37form. Now, the problem is I had never

32:40used Zoho CRM. So, I'd never used it. I

32:42didn't know exactly what you can and

32:44cannot automate with Zoho CRM, which is

32:46why we get to the next part, which is

32:47finding the information of what you can

32:49automate and cannot automate within a

32:51software. So, what I did is a simple

32:53Google search, and I searched up the

32:55software name.

32:56So, in this case, it can be Zoho CRM,

32:58Monday, it can be OpenAI, it can be

33:00whatever it is.

33:02API documentation. And this is where we

33:04get to the fundamental concept of an API

33:07documentation, which allows us to be

33:09able to see exactly what you can

33:11automate within a software and how to

33:13set everything up. Now, here's an

33:15example of an API documentation. This is

33:18Apollo's API documentation, and at

33:20first, you think this is way too

33:22complex, but the reality is, if you

33:24understand how this looks, all the

33:27others will be very, very easy because

33:29they all follow a very similar

33:30structure. So, the way that an API

33:32documentation works is that on the

33:33left-hand side, right here, you get to

33:35see all the types of requests. So, this

33:37is enriching people, it's searching

33:39people, searching organizations,

33:40creating an account. There's different

33:42things that you can do within Apollo's

33:43API, which means automatically without

33:46having to go to Apollo, right? And so,

33:48each action right here, so each thing

33:50that we can do has a corresponding type

33:53of request that follows through. [music]

33:54So, people enrichment, in this case,

33:56would be a post request because we're

33:58sending information to the server, and

34:00then it's enriching the person. Then we

34:02have, let's say, organization

34:03enrichment, which is a get request, or

34:05update an account, which is a put

34:06request, right? So, we have different

34:08types of request and different actions

34:10that we can do using Apollo

34:12automatically within our automations.

34:14And the only way to know is actually

34:15just looking here. Now, let's say we go

34:18to people enrichment. So, this will now

34:20look at what you can do within that

34:22specific request, which in this case is

34:24enriching people. And this request right

34:26here has the type of request, and then

34:28has a URL. Now, the URL is something

34:31that is very, very important in our API

34:33requests because they are the thing that

34:35allows us to be able to send the

34:37information the right way. It's sort of

34:39like going to google.com, right? The

34:41server knows that you want to go to

34:42google.com because

34:44because of the request, because of the

34:46URL. And so, this is the exact same

34:48because this allows the server to know,

34:49"Hey, he wants to use Apollo, and he

34:51wants to enrich people." Then in the

34:53middle here, it gives us a summary as to

34:55what it is, how it works, and so on. So,

34:57these down here are basically saying,

34:58"Hey, this is the type of request." So,

35:00right here,

35:01this is the information you have to send

35:03to the server to call the request, to

35:04make it happen. In this case, it's

35:06enriching people, and you have to send

35:08the first name and the last name, right?

35:10And those are the details that you have

35:11to look into understanding exactly what

35:14to send to the server. And on the

35:16right-hand side, you get to see the the

35:19actual setup. So, how can we set this up

35:21in our automation platforms? And quick

35:23side note, the reason why we look at the

35:25API documentation is because here, if I

35:27go to Apollo,

35:29I can't find it. Which means that now we

35:31have to set up the API request using the

35:33documentation. And so, the left-hand

35:35side is the type of request, the middle

35:37is to show you the exact request and

35:39sort of to give you a summary of what it

35:40is and what it looks like. And the

35:42right-hand side is saying, "Okay, we

35:43have the request, we have the summary,

35:45here's how you can set it up." Now, the

35:47main thing that we have to look at when

35:48we have to set up an API request through

35:51an API documentation is the curl. Now,

35:54the curl is the thing right here that

35:55you see,

35:56which basically gives us a heads-up or

35:58an understanding of how the request

36:01actually works. And if I go to n8n right

36:03here, and I go to HTTP request, which is

36:05the thing that we use to make the actual

36:07request, we can see that we have a

36:09button right here, which is import curl.

36:12And this will be the place where we

36:13import the curl, which is the one that

36:15we saw on the API documentation, and

36:17then this basically makes the whole

36:18request for us, which I'll show you in

36:20just a second. Now, this will make much

36:21more sense once we actually build the

36:23API request, which is super damn easy,

36:25so don't worry. Uh we'll go through it

36:27step by step. But now you get to see

36:29what a structure of an API documentation

36:31looks like. And this is for a software

36:33called Apollo. Now, if I go to the

36:34second API documentation, this right

36:37here is for a software called Instantly,

36:39which is a cold email software. As you

36:41can see, it follows the exact same

36:43structure. On the left-hand side, we get

36:44to see all the actions that we can take.

36:46On the middle, it tells us this is the

36:48summary, or this is what it is, and

36:50these are the different variables that

36:51we have to send to the server in order

36:53to make the action happen. And on the

36:55right-hand side, this is the way that we

36:57set it up through a curl, which is in

36:59code, right? But again, we don't have to

37:01know how to code. It's just telling us

37:03the way that we have to set things up.

37:05And usually, the curl in this case has a

37:06URL, which is the action that we're

37:08taking, telling the server, "Hey, we

37:10want to enrich leads, we want to send

37:12this information somewhere else." And

37:13then we have the headers, which usually

37:15are a way for the actual server to

37:17authorize that this is your account. And

37:19the way it does that is through

37:20something called an API key, which we

37:22use for tons of things. OpenAI API key,

37:25we use Claude API keys, Perplexity API

37:27keys. It's just sort of a way for the

37:29server to know, like a password, to say,

37:31"Hey, this is a key, it's only for me,

37:33for my account, so you can take action

37:35on my account, and you know it's my

37:36account if it's this key." And then we

37:38have content type application.json.

37:41Sometimes it's there, sometimes it's

37:42not. It's just a way for us to tell it

37:44to format the information in the right

37:45way.

37:46And then D, which is the body, which are

37:48these parameters, so these variables,

37:50which we send through to the actual

37:53server to make things happen. And if

37:55that confused you even more, then just

37:57wait until we build the API request cuz

37:59it'll be very, very easy. And then the

38:01last API documentation will be ClickUp.

38:03As you can see, I'm just showing you the

38:04example, so you get to see the

38:06reoccurrence in the structure of an API

38:08documentation, which is the one right

38:09here. On the left-hand side, we have the

38:11types of request. In the middle, we have

38:13the summary, the URL, the type of

38:15request, which is post, the title, and

38:17then here will be the parameters that we

38:19have to send through to the server to

38:22say, "Hey, here's what you have to do,

38:24here's how to do it," and so on. And on

38:26the right-hand side, this is the way

38:28that we set it up, which is the exact

38:29same. And as you can see, the thing that

38:31we really care about is the curl request

38:33because this is the right-hand side part

38:35of these API documentations, which allow

38:38us to be able to know exactly how we set

38:40things up. And if you read API

38:41documentations a lot of the times, or

38:43most of the times, you'll see something

38:45that looks like these. These are three

38:47random API documentations, and they all

38:49follow the exact structure. So, let's

38:51set up the API request. Let me give you

38:54a use case. Let's say we want to get the

38:55weather of a country or a location,

38:58right? If you go here to weather, we can

39:00do the OpenWeatherMap, but there's

39:02actually this other software, which is

39:04called the Weather API. So, if I go here

39:06to Weather API,

39:08there's this software right here, free

39:09weather API,

39:11which isn't listed here, right? And this

39:13is when we start using the HTTP request.

39:16Okay? So, HTTP request, again, like I

39:18mentioned before, is all the case where

39:22we can't find the exact software

39:24for the specific action that we're

39:26taking. So, we actually make our sort of

39:28custom API call, which is saying, "Hey,

39:31even though we might not have it in n8n,

39:33it doesn't mean it's impossible, right?

39:34We can still make the actual request,"

39:36which is where the HTTP request comes

39:38in. So, all I have to do is go here, put

39:41HTTP,

39:42and now we get to this page. The first

39:44thing is the type of request, whether

39:46it's a get, delete, head, options, path,

39:49post, put, which we went through just

39:50now. And we have options head, which

39:53I've never used, so probably not

39:54something that you should know about.

39:56Then we have the URL, which is the

39:58action that we're taking, which we get

40:00from the API documentation. Then we have

40:02the authentication, which we'll go

40:03through in just a second. And then we

40:05have the parameters, which I mentioned

40:06will be here. And then also the body,

40:08which is

40:09this right here, right? Or you can also

40:11use JSON, which we get from the API

40:13documentation. Now, we'll have to set

40:15one up so you understand. And let's go

40:17to the free weather api.com. We get

40:19here, and now I'm saying, "Hey, I don't

40:20have it within any 10. So, I really have

40:22to go to the docs." And usually you find

40:24this here.

40:25So, docs. All right, so this right here

40:27is the API documentation.

40:29And so, all we have to go is to the

40:31request, right? So, we have the getting

40:33started, we have the authentication, we

40:35have the request URL, we have a bunch of

40:37things, but the thing that we really

40:38care about is the bulk request, which is

40:41the request, which will be up down here,

40:44I believe. Yeah, down here. Which will

40:45be the request that we will use as an

40:48example

40:49for the actual API request that we do

40:52within any 10. So, all we have to do is

40:54copy this, go here, and set up an HTTP

40:57request, import curl, just paste it

41:00here. Now, we can see that everything

41:02was done for us. We have the post, we

41:03have the URL, we have the fields, the

41:05key, the queue, which in this case would

41:08be um

41:10We can see here, we can see that we can

41:12do the city name, we can do the US zip

41:14code, UK post code, and so on. Um

41:17which is required. And then we have the

41:19API key, which is the one right here,

41:21which is sort of a password that says,

41:22"Hey, this is my account. This is um

41:25related to me. Just use mine." And the

41:28body in this case, we actually don't

41:29need this because this is just an

41:30example.

41:32So, I can delete this. And we can just

41:34work with this. So, type of request,

41:35which is post, URL, which is the URL

41:37that we use. So, what is the action that

41:39we're taking? And then we have the key,

41:40which is the API key, which we find on

41:42my account. So, when you make a free

41:44account, you can go here

41:46to the dashboard, and up here

41:48you will copy the API key

41:50and paste it back here.

41:52And then the queue will be the city

41:54name. So, we can do London

41:56or whatever it is.

41:57And I press execute step, which will now

41:59execute the step. So, as you can see

42:01here, it successfully ran this. And I

42:03get the weather,

42:05so the current weather, the temperature

42:07of that specific place,

42:09which you can then use for whatever it

42:10is. Right, so now you got to see exactly

42:12what it's like to build an API request,

42:15an API call, which we [music] call. And

42:17this is exactly what you can then use in

42:19between your automation steps. So, let's

42:21say we had a next node, which would be

42:23let's do an edit fields, and we wanted

42:25to get the temperature.

42:28So, temp, temperature

42:31in Celsius, 9.3. Yeah.

42:34Thank god I'm not in London.

42:36I can execute the step, and this will

42:38now call the server, bring the data

42:40back, and then here you can see that the

42:41temperature was 9.3 because this is a

42:43variable that we found here. But again,

42:46the reason why we're using HTTP is

42:48because if I go here to free weather

42:49API, it's not listed here. It's not

42:51here, right? And any 10 only has about 4

42:54to 500. It has the main softwares, but

42:56sometimes softwares that we want here

42:58are not here, which is exactly why we

43:00have to then go to the API documentation

43:03and find or understand how we can set up

43:04the API request.

43:09In this video, I'm going to show you how

43:10you can master any 10 just by learning

43:1217 nodes. And these are the exact same

43:15ones that we use pretty much 80% of the

43:17time when building automations for

43:19clients. And honestly, these are

43:20probably the only ones that you'll ever

43:22need. So, the first one is the trigger.

43:24Now, the trigger is essentially the

43:25first step of the automation. Like, what

43:27is that thing that starts the automation

43:28for us to then do the next steps? In any

43:3010, we have different types of triggers.

43:32The first one is a manual trigger, so we

43:34can just execute the workflow manually.

43:36Now, this right here is something that

43:37we use most of the times just for

43:39testing. [music]

43:40Right? Because you want to test

43:41something, so there has to be a first

43:43step, and that's where we add a manual

43:45trigger. Now, the second one is a

43:47schedule trigger. So, this trigger right

43:48here is primarily used when you want to

43:51run the automation, let's say once a

43:52week, once a month, or at certain

43:54interval of time. So, if I go in here, I

43:56can see that I can run it

43:58in seconds, minutes, hours, days, weeks,

43:59months, and even custom. So, this is

44:01cron, which you can put your maybe every

44:032:00 p.m. on a Tuesday or every 3:00

44:05p.m. on a Friday of every month. And you

44:07have different settings that you can put

44:09so that you're able to

44:11to run the automation at a very specific

44:13time of the month, of the year, of the

44:14week, of the day, right? So, to give you

44:16a use case, let's say we had a content

44:18system. Let's say we wanted to generate

44:20content automatically every single day.

44:22What we would do here is we would go to

44:23trigger interval, which is days,

44:25one, midnight, [music] and trigger

44:27minutes zero. And this is where we put

44:29this as the first step of the automation

44:31so that it runs every one day at

44:33midnight of the week, right? So, we're

44:34able to run the automation without us

44:36having to manually trigger it. And this

44:38is for the time trigger. And then we

44:40have the Typeform trigger. Now, this is

44:42just to show you an example of a trigger

44:44that is not native to any 10. These two

44:46are native to any 10, which means that

44:48any 10 owns those nodes. But in this

44:50case, Typeform is not any 10, it's a

44:52different platform. And so, Typeform

44:53itself is a platform that generates

44:55forms. So, we can generate forms, and

44:57this trigger right here starts whenever

44:59someone fills out the hiring form in

45:01this case. So, I have the form pulled

45:02out here, which is a form that is

45:03connected to this Typeform trigger. And

45:05what happens is that whenever someone

45:06fills out the form, this sends a signal

45:09to this node because it's an on app

45:11trigger

45:12that will allow us to then be notified

45:14and start the automation. So, I'm going

45:15to press execute workflow. As you can

45:17see now, this is waiting for you to

45:18create an event in Typeform, which is

45:20waiting for me to fill out the form. I'm

45:21going to press submit. And as you can

45:23see here, this is now triggered. And we

45:25got the data, the name, the email, the

45:27phone number, and location as well.

45:29Right? So, this essentially is an on app

45:30trigger, which means that it triggers

45:32whenever an single app starts something

45:34or whenever something happens within an

45:36app that we can all find

45:38right here. Add another trigger, we have

45:40all these triggers, and the on app event

45:43is the one that you can use for whatever

45:45it is. So, these are all different

45:46softwares that can be the first step of

45:48the automation that triggers whenever

45:49something happens within that software.

45:51Now, the next part of the nodes are

45:53going to be storage solutions. Now,

45:54storage solutions is just a fancy way to

45:56say

45:57we use nodes that allow us to store

45:59information in them, right? And so,

46:01typically we use Google Sheets, we can

46:03use Airtable, we can use Notion, we can

46:05use any 10's new native data tables,

46:07which only came out a few days ago, in

46:08order to store information. And this

46:10could be a simple Google Sheet that

46:11looks like this, which has full name,

46:12email address, location, and phone. But

46:14it could also mean a data table within

46:16any 10, which has name, email, phone

46:18number, and location, which is the exact

46:19same. The only difference is that one is

46:22stored in any 10, and the other one is

46:24stored in Google Sheets. So, let me show

46:25you exactly what I mean here. Let me put

46:27the

46:28um manual

46:29execution here.

46:31And I can see that inside, I am adding a

46:34row. So, append row means I'm adding a

46:35row in the any 10 17 nodes, which is the

46:38name of the Google Sheet right here.

46:40And I'm putting the first name or the

46:42full name as Michele Torti, the email as

46:44this, and the location as this. I can

46:45press execute workflow, which will now

46:47run the step right here.

46:49And it will add the row

46:51into the Google Sheet, which will be

46:52Michele, email, and location as well.

46:55And I can also add the phone, which you

46:57can also add by refreshing.

47:00Let me add let's do 1 555 123 4567.

47:05And if I execute the step again,

47:07I can now see that I will have a new row

47:09that will be added here with email,

47:11location, and this as well. Now, the

47:12reason why it gave us an error is

47:14because Google Sheet doesn't like when

47:15you put plus signs or equal signs and so

47:17on because these are native equations

47:20within Google Sheets.

47:22But you get the gist here. You just

47:23store information into Google Sheet. The

47:25second one is within the any 10 data

47:26tables. So, let me connect this. And in

47:29this case, we do the exact same thing.

47:31It will be new people because that is

47:33the name of the database.

47:34And we're adding the first name or the

47:36name as Michele Torti, my email, my

47:38phone number, and location as well.

47:40And if I press execute step,

47:42I can see that now it was successful.

47:44And if I go here and I refresh, I can

47:47now see that the data was added here.

47:49Full name, email, phone number, and

47:51location as well. Now, the amazing thing

47:53is that once you master Google Sheets

47:55and any 10's native data tables, you can

47:57pretty much use Airtable, you can use

47:58Notion, you can use Asana, ClickUp. All

48:01these places where you store

48:02information, they're all very, very

48:04similar, right? So, if you understand

48:05one, the setup will be very, very

48:07similar for the other ones. All right,

48:08so now we get to the universal data

48:10processing. So, here is where we

48:12manipulate data, right? Manipulate data

48:14just means that we take some sort of

48:15data that comes in, and then we

48:17structure it in a way where it makes

48:18sense for us to structure it in. Now, in

48:20this case, I want to take the um manual

48:23execution here.

48:24I want to attach it here.

48:27And I can see that inside the edit node,

48:29if I execute the step, I can see that I

48:31have an array, which is basically a list

48:33of people's information. So, we have

48:35name, email, phone number, and location.

48:37David Smith, David Smith, Emily Chen,

48:39Carlos Ramirez, and Aisha Khan. And

48:41these are basically giving me the

48:43different pieces of information. Now,

48:44the only problem with this

48:46is that let's say we want to add this to

48:48our Google Sheet,

48:49we can't because this is an array, which

48:51means that it's inside

48:53this right here.

48:54So, this is where the split out comes

48:56in.

48:58So, what this means is that if you want

48:59to process each name individually,

49:01right? If you want to process this right

49:03here individually, then this right here,

49:05then this right here, and this right

49:06here, and this right here as well,

49:08then we have to split them out. We have

49:09to take them, as you can see by the

49:11diagram here, it's taking them, which is

49:12a singular thing, and then it's

49:14splitting them out based on the amount

49:16of items that are in that array. So, let

49:19me just show you. Let me just run this

49:20right here.

49:21And let me show you that now we have

49:23five items.

49:24So, as you can see here, it went from

49:26one item, which is the array, to five

49:27items. And so, what we're doing here is

49:29we're processing each person's details

49:31individually through the automation in

49:33the next steps. And this is splitting

49:35out. So, this is when you have an array

49:37and you want to split out each item of

49:39that array. Now, aggregate right here is

49:41the exact opposite. As you can see, the

49:43diagrams are opposites. And so, what we

49:45do here is just bring it back to the way

49:47it was before.

49:48Right? If I press execute step, I can

49:50see that now I have the array that is

49:52back there, which is one item.

49:54So, you can see we have one item, five

49:56items, and one item as well. Now,

49:57typically, you would use split out

49:59whenever you have cuz a lot of the times

50:00we get data

50:02all within the same array.

50:04We get a bunch of details, contacts, and

50:05so on, all within one singular item. And

50:08so, what we want to do is go inside that

50:10item and take them out of each one and

50:12process them individually. In case you

50:14want to add them individually to, let's

50:16say, a native data table or even a

50:18Google Sheet. Right? You have to process

50:20each one individually for it to actually

50:21make sense to add them to a database or

50:24whatever it is that you want to do.

50:25Whilst this node right here, basically

50:26when we have a lot of information that

50:28is a lot of items, and we want to put

50:30them all together, smash them all

50:31together, to then send them through to

50:33the next steps. Right? So, it's

50:34aggregating data, so it's not

50:36everywhere. It's not in different

50:37places. It's all within one place. Then,

50:39we get on to the logic, which is if. So,

50:42this is saying, "If this equals to this,

50:44then it's true. If not, it's false." So,

50:47if I say, in this case, let me just uh

50:50take this out. Uh there we go, right

50:52here. So, let me say, "If the name

50:55contains um contains

50:58Sarah,

51:00which it only be one name, then we send

51:02it through the true route." Right? So,

51:04if I go here, I can now see that only

51:06one went through here, and the other

51:08ones went through here. Now, this is

51:09great because automation, again, is

51:11logic. So, if you want to send the

51:13automation in different ways based on

51:15whether something is true or false, then

51:17you can use the if node right here. Now,

51:19the switch node is a bit different

51:21because it gives you more flexibility.

51:22Right? Let me show you exactly what I

51:24mean.

51:25Let me say right here, inside, I have

51:28options to basically root the

51:30automation. So, I can say,

51:32"If the name

51:34equals to Sarah

51:36Johnson,

51:37if the name equals David Smith,

51:39then we can rename the output to Sarah,

51:41rename the output to David."

51:43And what this will do is that it will

51:45run through every single one.

51:47And the ones that are Sarah,

51:49or Sarah Smith in this case, Sarah

51:50Smith, Sarah Johnson, it will send them

51:52through Sarah.

51:54And if it's David

51:55Smith, then it will send it through

51:56David. So, if I run this, I can see that

51:59we only have one item and one item here

52:01because those are the only ones that

52:02applied to the logic. And so, how is

52:04this different from if? Well, if only

52:06gives you the opportunity to add

52:08conditions, but don't add more than true

52:11or false options. Whilst here, you can

52:13put as many options as you want. And

52:15this is great because you could have a

52:17use case where you have emails. You can

52:19categorize the emails based on whether

52:20they're FAQ, whether they are uh

52:23promotional, whether they are just

52:24normal, whether they are something else.

52:26And an AI categorizes it, and then you

52:28can use a switch node to then say, "If

52:30the email is FAQ, then you send it this

52:33way. If it's something else, you send it

52:35this way. If it's something else as

52:36well." Because you can keep adding root

52:38rules. You can say,

52:40"If the this equals to whatever, just

52:42hello."

52:44You can rename it to FAQ.

52:46And this will be another option, right?

52:47And you can do as many options as you

52:49want, which is amazing because that

52:50allows us to be able to root the

52:52automation based on [music] the type of

52:54input or the output that we get in the

52:56previous step. All right, then we have

52:57the code node. Now, the code node is

52:59amazing uh because it allows us to

53:02be able to do a lot of things at once.

53:04And code is one of the things that,

53:06again, a lot of no-code platforms don't

53:07have because in the name no code. Uh but

53:10the fact that n8n added the code option

53:11here made it so much easier for us to be

53:13able to to transform information from

53:16unstructured to structured in the

53:17easiest way possible. And it's very,

53:19very fast. Yeah, so let's say we have

53:20the array here, which is the exact same

53:22as we had before, which are just a bunch

53:24of names that are all uh within the same

53:27array, and we can't process each one

53:28individually now. What we can do with

53:30the code node using code, and by the

53:32way, if you're asking, "How did you

53:33write the code?" I just said, "Split out

53:35the items from the array." And the array

53:37is this. And then, if I run this, I can

53:39see that now,

53:41really quick, it uh split out the items

53:43in five different um separately. So,

53:45then we can go through five items

53:46individually. Now, this did the same

53:48function as this, so this wouldn't make

53:50a lot of sense. But, if you have

53:51something a lot more complex, and you

53:53need the data to be transformed in a way

53:55where it would take you seven or eight

53:58different nodes, then you can do it all

53:59within the code node. Now, I'm not going

54:01to get into detail about this because,

54:02again, we're all here to not write code,

54:04right? Uh but just know that you have

54:06this option to be able to write code

54:07with n8n, and it makes it a lot easier

54:10to do more complex stuff. You won't

54:11really need them for most of the time,

54:13but just knowing that you have the

54:14option there to use gives us a lot more

54:16flexibility when we're building

54:18automations. And then, we have the merge

54:19node. So, let me actually set this up.

54:21All right, so for the merge node, what I

54:23did is I put two different fields. One

54:25is hello, yo, and then the other one is

54:26hello, ciao.

54:28And when I run this automation, it will

54:30run this one first, and then it will run

54:32this one. And let's say I put a wait

54:34node here.

54:35I can put two 2 seconds just for it to

54:37wait 2 seconds. I can show you that

54:39this right here will run first, and then

54:42it will run this one. Right? Now, let's

54:44say that we had an automation where we

54:45had to run this, and then we wanted to

54:48run this, and then we wanted to go,

54:50right? Without us having to go through

54:51here first and run your whole

54:53automation, and then run through here

54:54first. Now, let's say that we had an

54:56automation that we start here, and it

54:58goes to different ways, but then we want

55:00to aggregate the data. We want to send

55:02the data up in the same way as two

55:04different inputs, input one and input

55:05two, to then be able to take both pieces

55:07of information to then be able to go to

55:10the next steps. So, that's exactly what

55:12the merge node does. If I go here,

55:14I can see

55:15also I can add more inputs. So, if I

55:17press four, it basically uh it can it

55:19can intake more inputs at the same time.

55:21In this case, I can do two. I can

55:23execute the step, and now we can see

55:26that we got two items. One is yo, and

55:28one is ciao. So, what is doing here?

55:30It's it's aggregating both of them

55:32together. Now, there are other options

55:33as well um to combine, to then SQL

55:37query, so you can query different things

55:39or different data points. And then, we

55:40can also choose a branch. Now, honestly,

55:42the one that we're mostly going to use

55:44is going to be combine, and it's going

55:45to be append. Now, append in this case

55:47would be output each item individually,

55:50and combine is taking these two and just

55:52putting them all in the same sort of

55:53array that you can use for the next

55:54steps. Now, here's a system that I built

55:56that uses the merge nodes, three

55:58different ones. Uh and the way that with

56:00this works is that we have um

56:02the LinkedIn post, which is made, the

56:04Facebook post is made, and then we want

56:06to merge them. So, we have the Facebook

56:08post and the LinkedIn post. And then, we

56:09have the Twitter post, which is made,

56:11the article, which is made, and then

56:12we're merging these two together as well

56:14to then finally merge all four things

56:16together so we can directly send to the

56:19Google Sheet. And the reason why we're

56:20merging them is because if we run each

56:22one individually, then we would have to

56:24set up a new automation for each row at

56:26a single time to add them to the Google

56:28Sheet, which we can actually just remove

56:30by just merging them all together in the

56:32same sort of structured way, different

56:34items, to then send them to the Google

56:35Sheet. So, the next nodes right here are

56:37going to be connectivity and API. Now,

56:39API is the most important skill when it

56:41comes to automation. And if you haven't

56:42watched my video about fundamentals of

56:44API, just watch it up here. Um but it is

56:46the reason why apps get to talk to other

56:48apps. Right? It's the reason why

56:50this app right here

56:52can talk to n8n.

56:53But this app right here can talk to this

56:55one, right? Or we can just talk to each

56:56other um in different ways. So, in this

56:58case, the first node that we have to

57:00learn is the HTTP request. Now, this is

57:02one of the most powerful nodes in n8n

57:05because when we go here,

57:07and I go to action app, so this is

57:09taking an action within a single app, we

57:11can see that we don't have an infinite

57:12amount of nodes. Right? Like we can stop

57:14here, and then what? What if you have a

57:16software that we want to use, but we

57:18can't find it here? What do we do then?

57:20Well, in this case, we use the HTTP

57:22request. So, let's say I wanted to use a

57:24free weather API, which gave me the API

57:26of the weather.

57:27And if I go here to n8n,

57:29I can't see any app that's called free

57:31weather API.

57:32So, what I have to do is I have to set

57:34up the HTTP request all to the free

57:37weather API, which I can find in the

57:39documentation right here. By the way, I

57:40covered this in the API fundamentals

57:42video. So, if this makes no sense to

57:43you, please go watch that video cuz it

57:45will help a lot. Um but this right here

57:47is the API documentation, which is

57:49essentially a documentation which allows

57:50you to see exactly what you can automate

57:52and what you cannot automate within a

57:53software, and also how to set up the

57:55automation. And so, by looking at this

57:57documentation here, I was able to set up

57:59the um the automation of the weather

58:01API, which looks at the temperature in

58:03London right now. And if I execute the

58:05step, I can see that now I'm still able

58:07to actually run the automation. I was

58:09still able to use the software without

58:11having to use

58:13the softwares here, which are already

58:15pre-made by n8n. And you can see here we

58:17have the different outputs. So, London,

58:19[music] we have the temperature degrees

58:20in Celsius, Fahrenheit, and different

58:22other informations as well. Then, we

58:24have webhooks right here. Now, webhooks

58:25are a way for us to get notified when

58:27something happens. So, let's say someone

58:29fills out a form,

58:30well, it sends the data to the webhook.

58:32You remember this right here, the

58:33Typeform trigger? Well, behind the

58:35Typeform trigger is actually a webhook,

58:37which allows us to be able to get

58:38notified when something happens. Well,

58:40in that case, it's whenever the form is

58:42being submitted, it sends the data to

58:44the webhook through an API. Right? So,

58:47right here we have the test URL, which

58:48is used for testing, and production URL,

58:50which is used when the automation is set

58:51to active. And then, we have the

58:53different type of HTTP method, which,

58:55again, is very similar to here because

58:56we have post, we have all these options,

58:58and these are the same ones that we have

59:00here. And then, we have the path, which

59:02is just the way that we that we name the

59:03URL. And then, this right here is the

59:05thing that you would connect to the

59:07software itself to then be able to for

59:08us to get notified when something

59:10happens within a software. And respond

59:11to webhook will be the thing that will

59:13then respond back to the server that we

59:15got the information from. Now, to show

59:17you exactly how it works, what I'm going

59:18to do is use a software called Postman

59:21API, which allows us to send example uh

59:24test data to the webhook, right? I'm

59:26going to go in here, copy this. Make

59:28sure you change this to post request,

59:29and then I'm going to paste this here.

59:31Make sure this is a post request as

59:33well. And then the body will be what is

59:34the thing that we're sending the

59:35webhook. In this case, let's just do

59:37full name.

59:39My name.

59:40Let me run this here.

59:42I'm going to press send.

59:44This will now start the workflow, as you

59:45can see here. Now we started the

59:47workflow and we sent the full name here,

59:49which is the body, right? And this is

59:51how we send information from one server

59:53to another through a webhook. [music]

59:55Now let's say I had this connected. Now

59:57all I have to do here is I have to

59:58change this to using respond webhook

1:00:00node.

1:00:02And here,

1:00:03um, what we can do is

1:00:06we can just respond with

1:00:08workflow has finished.

1:00:13And so when I run this

1:00:15I send this here.

1:00:17I can see that now we get the data,

1:00:18workflow has finished.

1:00:20Now this is amazing when we are sending

1:00:22data to a software

1:00:24or to a webhook in this case and we want

1:00:25to get something back.

1:00:27So let's say we send the sign-up link to

1:00:29a user in some sort of software. He

1:00:31signs up, we get something back. Lastly,

1:00:34it would be the AI integration. So this

1:00:35is one of the ones that are most

1:00:37commonly used. First one is the AI node.

1:00:40So this is just to create something with

1:00:42AI. So in this case, we can say create a

1:00:45LinkedIn post

1:00:47about

1:00:48life. And here we have our OpenAI

1:00:50connected. The resource is text. The

1:00:52operation, which is the action that

1:00:53we're taking, is good. The model, it can

1:00:55be You have a list of models here.

1:00:57You can use GPT-4 or latest, or you can

1:00:59use whatever you want. And then you have

1:01:01the prompts right here. The prompts,

1:01:02there are three different prompts that

1:01:03you can write. The first one is the

1:01:05system prompt. The system prompt is a

1:01:06prompt that you tell the AI you give it

1:01:09an identity. So here you are a helpful,

1:01:10intelligent XYZ assistant. Then you have

1:01:13user. So user is when you tell it to do

1:01:16something. So your task is to do XYZ. An

1:01:18assistant [music] is when you give it

1:01:20some examples. In this case, let's keep

1:01:21it simple. I'm going to press execute

1:01:23step. And this will now create a

1:01:25LinkedIn post about life. As you can

1:01:27see, sure, here's a thoughtful and

1:01:29professional LinkedIn post about our

1:01:30life. And then it gives me a whole

1:01:31LinkedIn post that we can then use. Now

1:01:33this AI step is used whenever you want

1:01:35to have some sort of data or some sort

1:01:37of input sent to AI, just like we would

1:01:40on ChatGPT, automatically and then give

1:01:42us the output. For content, for any

1:01:44structured data that you want

1:01:45structured, for anything pretty much

1:01:47that you can think of AI playing a role

1:01:49in the automation, just as a linear

1:01:51thing, for it to do just that task in

1:01:52specific, only that task. And then we

1:01:54have the AI agent. If you haven't

1:01:56watched my AI agent 101 video, make sure

1:01:58to watch it up here. It explained

1:02:00exactly how you can build your first AI

1:02:01agent from scratch using n8n. But the AI

1:02:03agent is the reason, probably the reason

1:02:05why n8n blew up so fast is because it

1:02:08had now the opportunity for us to use

1:02:11something that was connected to AI that

1:02:13could think through or that could

1:02:14remember the different conversation we

1:02:16had but that was also hooked up to

1:02:19different tools. So in this case, if you

1:02:20scroll down we can see that we hook it

1:02:22up to Gmail. We can hook it up to

1:02:24Airtable. We can hook it up to or pretty

1:02:27much anything.

1:02:28We have all these different softwares

1:02:31that we can use to then be able to

1:02:32connect it to the AI agent for it to

1:02:34actually take action. And the good thing

1:02:36is that the Gmail tool

1:02:38can be connected and the Airtable tool

1:02:40can be connected and the let's say

1:02:43Notion tool can be connected

1:02:45and you can have as many connections as

1:02:46you want and this acts as a personal

1:02:48assistant that allow us to be able to

1:02:51take action on different things based on

1:02:53the input that we give it. So in this

1:02:55case, what it would look like is we

1:02:57would have a trigger, which would be

1:03:00usually it would be an on chat message,

1:03:02which means that we're chatting with the

1:03:03AI agent itself. If I open chat, I can

1:03:05now see that I can speak to the actual

1:03:06AI agent, something that you can't do

1:03:08with the AI step. So I can say, "Hello."

1:03:11What this will do is that it will then

1:03:12talk to its AI. It will remember the

1:03:14conversation and then bring it back.

1:03:16It's sort of like a person that we're

1:03:17talking to. And the good thing is that

1:03:19the person itself

1:03:20has access to our softwares.

1:03:23Which is amazing because now we can take

1:03:24action on our behalf based on the input

1:03:27that we give it. So if we say draft an

1:03:28email, it will then go to the Gmail tool

1:03:30and then do its thing. Same thing with

1:03:32Airtable and same thing with Notion. And

1:03:33the use case that you can think of this

1:03:35is pretty much anything, any task that

1:03:37you want a singular input data store. So

1:03:40you basically have, let's say, one chat

1:03:42message, right? We have one place and

1:03:44through a series of inputs, so through a

1:03:46series of sending Gmail, sending

1:03:48Airtable or create a Notion task or

1:03:50whatever it is it takes actions in

1:03:51different softwares without us having to

1:03:54create a new automation for every single

1:03:56action that we want to take.

1:04:00In this video, I'm going to walk you

1:04:01through everything that you need to know

1:04:03about data transformation and using JSON

1:04:06within your automations. Now I know this

1:04:08topic scares quite a few people and it

1:04:10scared me coming into automation as a

1:04:12beginner with no technical knowledge,

1:04:13but it actually is quite easy and very,

1:04:16very important to understand. All right,

1:04:17so JSON 101. JSON stands for JavaScript

1:04:21Object Notation. So if you see

1:04:22JavaScript here and there, it stands for

1:04:24JSON cuz it's JavaScript, so J S O N

1:04:27right here.

1:04:28What it is, it's a way for servers to

1:04:32store and transfer data. Right, it looks

1:04:34like text, but it's structured so

1:04:36computers can read it. Now the best way

1:04:37that I can describe JSON is English for

1:04:40computers. It's the language that

1:04:41computers use to speak to each other.

1:04:43Right? And that's why it's very, very

1:04:45important for us to understand it

1:04:46because pretty much everything is built

1:04:49in JSON. Right? APIs, which I spoke

1:04:51about in another video up here. Config

1:04:53files, databases, but also your favorite

1:04:55platforms like make.com, n8n or Zapier,

1:04:58they're all built on JSON. It's crazy to

1:05:01me that people still don't understand

1:05:02that cuz behind the nodes, the squares

1:05:04and the [music] the steps if you really

1:05:06look at it, it's all JSON. That's why

1:05:08it's very, very important to understand.

1:05:09Now we use a very basic structure in

1:05:12JavaScript. [music] When we write JSON,

1:05:13we use key-value pairs. So the keys are

1:05:16strings. They're always going to be in

1:05:17quotes. And the values can be string,

1:05:19can be my name, number, can be an age,

1:05:22boolean, which is true or false, null,

1:05:24when you get no data, it's going to be

1:05:25zero, zero data, object, which is

1:05:27basically a JSON inside the JSON, an

1:05:30array, which is a list of items, which

1:05:32I'll walk you through step by step. So

1:05:33these are all the different types of

1:05:35values that you can get using the key.

1:05:38Here's an example of a basic key-value

1:05:40pair. We have the key, which is name. We

1:05:42have the value, which is Michele in

1:05:44quotes because it's a text string.

1:05:46The age, which is key, which again is in

1:05:48quotes because it's always a string. The

1:05:51age, which is not in quotation marks

1:05:52because it's an age, so it's a number.

1:05:54Then student and then true. Which is

1:05:56boolean, which is true or false, right?

1:05:58So we have again name, key, key and key,

1:06:01and these are values, but they're

1:06:01different types of values. Now arrays

1:06:03are ordered in list inside of the

1:06:07brackets. Now let's say you go to the

1:06:08grocery store and you get the groceries.

1:06:11Right? The groceries isn't one thing.

1:06:12Groceries is a list of items inside the

1:06:15key, which is groceries. And so this is

1:06:17the same exact example when we have

1:06:19skills. So the key is skills and the

1:06:22value is automation, AI, Notion, which

1:06:24are my skills. And so why do we use

1:06:26these? Well, we use this when we have

1:06:27the same key, like groceries or skills,

1:06:29but we want to add multiple items in the

1:06:32array, right? The array is just the the

1:06:34list of things,

1:06:35um, to to explain the key, right? To

1:06:37explain skills, to explain groceries, to

1:06:39explain whatever it is.

1:06:40We have nested objects, which are JSON

1:06:43inside the JSON. And for example, we

1:06:44have the key, which is person. The key

1:06:47is also name, but the name is inside the

1:06:48person, so it's JSON in JSON. Um, and

1:06:51then we have contacts, which is email

1:06:53and phone number. So we have different

1:06:55pieces of information, but it follows a

1:06:57very clear hierarchy. Hierarchy just

1:06:58means what is the first thing that you

1:07:00should see and then what is the next

1:07:01thing and what is the next thing. Of

1:07:02course, the first thing is person. The

1:07:04next thing [music] is name. And we have

1:07:05contacts within the name and we have

1:07:07email and phone number. And then we

1:07:08close off with three curly brackets

1:07:10because we start with one, two and

1:07:11three.

1:07:12Right? So nested objects is usually the

1:07:14thing that we always [music] use and

1:07:16that n8n, make.com usually uses when

1:07:19they want to show different types of

1:07:20data inside the data. Right? So you

1:07:22might have a Google Sheet and the Google

1:07:24Sheet might show the ID of the sheet. It

1:07:26might show the sheet name. It might show

1:07:28the row values. It might show different

1:07:30types of things. And so to show those

1:07:32things, it uses the

1:07:34nested objects. And so JSON applying

1:07:37into APIs, and if you've never heard

1:07:39APIs, it's just basically how a software

1:07:41speaks to a software, how these

1:07:42softwares are actually able to work

1:07:44through APIs.

1:07:45This is a HTTP request, which is a

1:07:48request that we send to a server to do

1:07:50something. So in this case, we have a

1:07:51curl and a curl is just a bunch of JSON.

1:07:53Now don't worry about what this means,

1:07:55but this is a request. This is something

1:07:57that we send to the server saying, "Hey,

1:07:58can we get something? Can we Can we do

1:08:00something?" Right? In case you want to

1:08:01get new rows or you want to add a row to

1:08:03a Google Sheet or you want to add a

1:08:04contact on ClickUp or do something else,

1:08:07this is what you use. And then the

1:08:09response, which is always going to be in

1:08:10JSON, looks like this. So let's say

1:08:13we're looking for users in a software,

1:08:15let's say. And the output that I get is

1:08:17the ID of the user, the name of the

1:08:18user, the email, whether the user is

1:08:20active or not and [music] the roles of

1:08:22the user, which is an array because

1:08:24there can be different roles within the

1:08:26same person. And so we have the keys,

1:08:27which are all inside the quotation marks

1:08:29because they're all strings.

1:08:30>> [music]

1:08:30>> And we have the values. But the values

1:08:32can change based on whether it's a

1:08:33number, a string like this

1:08:36a boolean or just an array. So how does

1:08:39this now apply to n8n? So if I go to

1:08:41edit first step, I can add a manual

1:08:43trigger, which is just a first step of

1:08:45the automation manually. And let me add

1:08:47another node, which is edit fields.

1:08:50Now this node right here is very, very

1:08:52important and is something that we

1:08:53typically use to transform data, which

1:08:56is getting an input, which can be a

1:08:57name, it can be a bunch of values, then

1:08:59putting it here right inside the edit

1:09:02fields node, which transforms the input

1:09:04and then gives us the output. So if I go

1:09:05here to mode, I can see that I can do

1:09:06manual mapping. Let me zoom in. Or I can

1:09:09actually write things in JSON. And this,

1:09:12again, is the key value pair, key value,

1:09:15which is the exact same as the thing we

1:09:17spoke about. Now if I go to manual

1:09:18mapping, I can now start adding fields

1:09:20to set. So I can say my full name

1:09:23is Michele

1:09:24Sorti.

1:09:25Right? And I can see that this is a

1:09:26string. Why is it a string? It's because

1:09:28it's text. If I put number and I run

1:09:31this,

1:09:32this would be null because there is no

1:09:33number. It's just text. And it deletes

1:09:35it, right? And so, if you go back to

1:09:37string, put my name,

1:09:39what I can do here is execute the step,

1:09:42which will show me the output in schema,

1:09:43which is basically the way that we all

1:09:45look at it because it looks a bit messy

1:09:47in JSON, the table version,

1:09:49or JSON, right? So, if you've never

1:09:51pressed on this button JSON, this is

1:09:53what it looks like. We have an object

1:09:56right here. We have the key and we have

1:09:58the value

1:09:59right here.

1:10:01Now, let's say I wanted to do age

1:10:03and we do um 20.

1:10:07If I execute the step, now you can see

1:10:09that the object right here is increasing

1:10:12in the size because there's a new

1:10:14key-value pair. And bear in mind that

1:10:16this is text right now. It's not a

1:10:17number. So, if I wanted to change this

1:10:19to a number,

1:10:20look at the color of this, it changes

1:10:22the actual type of output. Right? So, it

1:10:24changes the type of output that comes

1:10:26here to 20. Let's say I wanted to do

1:10:28Boolean.

1:10:29This is true or false.

1:10:31I can say student

1:10:34false or you can do true.

1:10:36So, we're saying, "Hey, [music] his name

1:10:37is Michele Torti. He's 20 years old and

1:10:39he's a student, right?" And then you can

1:10:41also be adding an array, which in this

1:10:43case can be skills, like I mentioned

1:10:44before, and you do

1:10:47square bracket

1:10:48square bracket to end it. Then you put

1:10:50skills. You say notion.

1:10:53You finish it off, then and then done.

1:10:56Then make

1:10:58and then you do something else, right?

1:10:59But we are adding items inside the

1:11:01array, which is here and here. Two items

1:11:05right here. Boom.

1:11:07Now, if I press execute step, this will

1:11:08now show the skills like this. It will

1:11:11show the full name, it will show the

1:11:12age, the student, and the skills right

1:11:14here, which are wrapped up in square

1:11:16brackets right here.

1:11:18Notion, make, and so on.

1:11:19And finally, we have

1:11:22the object, right? And the object can be

1:11:25a summary. Let's call it summary and

1:11:26let's copy this full thing, this whole

1:11:28object, because this is an object again,

1:11:31from here to here.

1:11:33And I can paste this here.

1:11:35If I execute the step,

1:11:37this will now

1:11:38add the new object that we have, which

1:11:40is called summary,

1:11:41and we have it this again,

1:11:43which we just copied up here. Now, why

1:11:45am I showing you this? It's because

1:11:46typically when we get inputs from the

1:11:48previous node, the previous step, we

1:11:50send it here to then be able to change

1:11:52the data. So, let me show you an example

1:11:54here. Let's say I have Let me delete

1:11:55this. Let's say I have the full name and

1:11:57I wanted to get just the first name.

1:12:00So, let's say I run this

1:12:02and I have the output, which is full

1:12:04name. Let's say I add another edit node

1:12:07right here. I can go here. I can remove

1:12:09[music] this. And now, let's say I

1:12:11wanted to take the full name and I

1:12:12wanted to transform it into just the

1:12:14first name. What I do here is I press

1:12:16here. I can say first name.

1:12:19And if I go here to expression,

1:12:22I can put curly bracket curly bracket.

1:12:25And now inside here, it says anything

1:12:27inside the curly bracket curly bracket

1:12:29is JavaScript, which is JSON. Right? So,

1:12:31we're saying I can actually reference

1:12:33previous variables using this. So, I can

1:12:35say dollar sign JSON, which is the way

1:12:38that you start when you want to

1:12:39reference some sort of item here,

1:12:41dot

1:12:43full name,

1:12:44right? Which you got right here, full

1:12:46name. And so, that is how you can

1:12:48reference these variables from the

1:12:49previous steps to the next steps. And

1:12:52that's how dynamic variables work,

1:12:53right? Because they are dynamic, they

1:12:55change every single time. Cuz right

1:12:56here, if I run this, I would also have

1:12:59the first name, which is Michele Torti.

1:13:01But if I go back here

1:13:02and change it to James,

1:13:06and I run this again,

1:13:08this will now be James, right? Which is

1:13:09why it's dynamic, which is why

1:13:11automations are brilliant because they

1:13:12change data and you can automate the

1:13:14process so you don't have to do it

1:13:16yourself.

1:13:18So, okay. Let's say we have the full

1:13:19name here. Let me go full screen by

1:13:21pressing this button right here.

1:13:23And let's say I wanted to take this

1:13:24name. I just wanted to get James. Now,

1:13:26inside N 10 and the reason why I would

1:13:29say for a beginner it looks a bit

1:13:30technical uh because of this, because

1:13:32make.com doesn't actually show you this,

1:13:35but that's what it is in the back end.

1:13:37I can, after the whole variable, so full

1:13:39name, which again is this,

1:13:42what I can do is actually use some

1:13:43formulas. So, I can put dot, which now

1:13:46allows me to see different things that I

1:13:48can do with this full name. I can split

1:13:51the first name, which we're going to do.

1:13:52I can check whether the um the name

1:13:54includes something, right? So, you can

1:13:56see here whether the team includes T and

1:13:59it says true. And so, these are all

1:14:00formulas that you can use within your um

1:14:04the full name. Honestly, you'll probably

1:14:06use maybe five or six of these, so don't

1:14:08even worry about understanding each one.

1:14:10Um one of them that I use a lot is split

1:14:12because I usually want to split the full

1:14:14name so I can get the first name. So, in

1:14:16this case, what we're doing here is

1:14:18we're getting the full name, which is

1:14:19James Torti. What we're doing is saying,

1:14:21"Hey, let's split this name by the

1:14:23presence of a space so it gives me this,

1:14:26which is first name, and then last name.

1:14:29And then we want to get the first,

1:14:31first one, which is James.

1:14:34And that's the way that this works

1:14:35because everything in JSON is logic.

1:14:37Everything in code is logic. Right? So,

1:14:39if you put logic here into this

1:14:41automation, or not automation, in this

1:14:43variable, then you're saying, "Hey,

1:14:45let's split

1:14:47this by the presence of a space." So, we

1:14:49do the apostrophe here and we actually

1:14:52put the space in our keyboard. So, now

1:14:54we can see that we have the first one

1:14:56and we have the second one. And now,

1:14:58after we put split, then we want to put

1:15:00dot

1:15:01first

1:15:03because we're returning the first

1:15:04element of the array. Cuz you can see

1:15:06here, this is an array,

1:15:07right? Because it has this {comma} this

1:15:10{comma} that, right? So, let's say I had

1:15:12the full name being James Torti Arthur,

1:15:15it would then be James {comma} Torti

1:15:16{comma} Arthur. And so, after this, we

1:15:18want to put first

1:15:19>> [music]

1:15:19>> and this is how we get James. And that's

1:15:21how in emails you can turn the full name

1:15:23into a first name by using JSON and by

1:15:26using formulas within the JSON. Now, you

1:15:28looking at this right now, it probably

1:15:29looks very overwhelming and it was very

1:15:31overwhelming for me at the start as

1:15:33well. But when you understand the ones

1:15:35that actually do matter, cuz yeah, let's

1:15:37be honest, you're not going to be using

1:15:38all these,

1:15:40they work very well, right? Like if you

1:15:41understand split, for example, and

1:15:43understand that this is the formula that

1:15:45you use every single time to split a

1:15:47full name from something else, then

1:15:49you're pretty much set. That's it,

1:15:50right? And the good thing is that you

1:15:52have an AI

1:15:53on the right-hand side

1:15:55that you can ask any questions to, which

1:15:56can also help you. And so, that is how

1:15:59we can transform data. We can take some

1:16:01sort of full name, we can then use some

1:16:03formula, and then we can output the

1:16:06first name, right? From here

1:16:08to here.

1:16:09And that is data transformation. That's

1:16:11how we use JSON to be able to take an

1:16:13input and turn it into something that's

1:16:15an output. And quick side note here, if

1:16:17you're wondering what's behind this, I

1:16:18mentioned it's JSON, let me show you

1:16:20what I mean. I can copy this. I can go

1:16:22here and if I paste this, this will be

1:16:24JSON because these are nodes that have

1:16:27parameters, that have different stuff,

1:16:29which are all JSON. And the reason why

1:16:32this N 10 make.com works very well is

1:16:34because we don't have to see this. But

1:16:36just know that behind this

1:16:38is this, right? So, it's all JSON.

1:16:40That's why understanding JSON is very,

1:16:41very important because it gives you the

1:16:42understanding of how things actually

1:16:44work together and how the English

1:16:46language in computers actually works.

1:16:47Now that we have this, full name

1:16:49>> [music]

1:16:49>> and then going to the first name, now we

1:16:50can add some branching. So, we can add

1:16:52some some conditions.

1:16:54And we can add if. So, if is saying,

1:16:57"Hey, if this variable,

1:16:59which again we can get by doing curly

1:17:01bracket curly bracket,

1:17:03JSON dot first name.

1:17:06So, JSON dot the variable that's here,

1:17:08right? JSON dot first name

1:17:11equals to James, this will say true,

1:17:14true branch. And if I go outside of

1:17:15here, I can see that this is a true

1:17:17branch. This is a thing that is true.

1:17:19Then we can now send the automation one

1:17:21way if that specific criteria or

1:17:23condition is true. And if it's false,

1:17:25then we go down this way. And for

1:17:26example, if I change the the name to

1:17:29Michele,

1:17:30execute the step, now this will be a

1:17:31false branch. This will go down

1:17:33defaults. And again, behind this, what

1:17:35it does is that it uses this variable.

1:17:38It then says, "Hey, is this variable

1:17:40equal to this? If yes, [music] then it's

1:17:42true. If not, then it's false." Because

1:17:44again, everything lies on logic.

1:17:46Everything is logic in automations.

1:17:48Whether you have this or whether you

1:17:50have [music] this, conditioning into

1:17:51different paths. All right. So, right

1:17:52here I have an AI agent. So, we'll see

1:17:54how JSON actually applies within the AI

1:17:56agent. I can open chat and I can say

1:17:59hello.

1:18:01And what it's doing now is it's

1:18:04is it sending the information here,

1:18:06JSON, which is session ID, action, and

1:18:09chat input, which is the thing that I

1:18:10just told it to do. So, these are

1:18:11different items that we get as an output

1:18:13from the actual thing. It's transferring

1:18:15data, so what you see here, the line is

1:18:17actually just transferring the data

1:18:18here,

1:18:19to this AI agent, which is giving the

1:18:21chat input as an example in JSON here.

1:18:24Then,

1:18:25using the chat input, is then talking to

1:18:28the actual open AI by giving it JSON

1:18:30again, which is messages,

1:18:32right here.

1:18:33And then the output that we get using

1:18:35open AI is this. "Hello, how can I

1:18:38assist you today?" Which again is the

1:18:40output, which goes here. "Hello, how can

1:18:42I assist you today?" So, everything that

1:18:43you see within your automations, data

1:18:45here and data there, or some sort of

1:18:47variable going to the AI agent and then

1:18:48going to something else, it's all JSON.

1:18:51That's how data flows within different

1:18:52automations. And so, let's say now I

1:18:54wanted to take action on my email. I can

1:18:56say send an email

1:18:58to

1:18:59michele.torti5@gmail.com

1:19:01saying we have

1:19:04uh

1:19:05football tomorrow. I can press go. This

1:19:07will now send the data here. It will

1:19:08then call the tool

1:19:10and then it will send the email, right?

1:19:12And if I go inside here, I can see that

1:19:14this is the input. The messages is the

1:19:16input, the subject line and email body.

1:19:19And the output is the response, which is

1:19:22the email ID that I just made, the

1:19:24thread ID which is a thread of the

1:19:25email, and then the label ID telling us

1:19:28that this is sent. And this right here

1:19:30is an object. Right right here. The same

1:19:32way that it was person name, it was

1:19:34contact, it was whatever it is. All

1:19:36right, and lastly here we have a form

1:19:37that I just made.

1:19:39If I go to the form, I can see that I

1:19:40have the full name, the age, and the

1:19:41date. So I say Michele Torti.

1:19:44The age will be let's say 20.

1:19:46The date, let's say the date is today.

1:19:48The 20th. I can press submit.

1:19:51What this will now do is it will send

1:19:52the data to our automation.

1:19:55And we get back the full name which is a

1:19:57key

1:19:58value.

1:19:59Key, as you can see here this is a value

1:20:01but it's not in quotation marks because

1:20:02it's a number. And then everything else

1:20:04is a key value pair with this because

1:20:06it's all a string. It's all text. Now

1:20:08some fundamental rules to remember for

1:20:10JSON is that the keys must always be in

1:20:12double quotes. The keys right here,

1:20:14name, must always be in these two codes

1:20:16because it's always a string. If you

1:20:19don't put it that way, it'll break,

1:20:21right? The second thing is to understand

1:20:22the difference between string, number,

1:20:24boolean, null, object, and array, right?

1:20:27And how these sort of function because

1:20:28then you're able to understand JSON as a

1:20:30whole because it is just that. It is

1:20:32just strings which are text, numbers

1:20:34[music] which are just numbers with no

1:20:35quotation marks, boolean true or false,

1:20:37null no data, object which is JSON

1:20:40inside the JSON, and array which is a

1:20:42list of values. Then we have the third

1:20:44rule which is separating pairs with

1:20:45commas. So we have the key which is

1:20:47name,

1:20:48the actual value, comma, the next thing,

1:20:50comma, the next thing, and then the last

1:20:52one doesn't have a comma, the one

1:20:53nearest to the actual curly bracket

1:20:55which finishes off the JSON structure.

1:20:57And lastly is wrapping the whole thing

1:21:00in quotation mark if it's an object. And

1:21:02an object in this case is just a list of

1:21:04key value pairs, right? Key, value, key,

1:21:07value, key, value. And we wrap up the

1:21:09whole object using curly brackets here

1:21:12and curly brackets here to finish it

1:21:13off. And if you're someone who's serious

1:21:15about starting and scaling your AI

1:21:17agency, then you might want to check out

1:21:19the first link down below which is a

1:21:20video that walks you through our

1:21:21one-to-one mentorship program which is a

1:21:23program where we get to work with you

1:21:24one-to-one to help you start and scale

1:21:26your agency to 10K a month.

1:21:31Webhooks are by far one of the most

1:21:32powerful thing within automation. Yet

1:21:34most people still have no idea how they

1:21:36work. So today I'm walking you through

1:21:37exactly what a webhook is, how you can

1:21:39use it in real life, and how you can set

1:21:41it up within your own N and so by the

1:21:43end of the video you'll be able to use

1:21:45it within your own automations even if

1:21:47you've never touched it before. So let's

1:21:48dive in. So what a webhook is is

1:21:50essentially a URL that allows us to get

1:21:51notified when something changes within

1:21:53an app. So think of it as someone coming

1:21:55into your house and ringing your

1:21:56doorbell. As soon as they ring your

1:21:58doorbell, you instantly get notified,

1:22:00right? And we could usually refer to

1:22:02this as an instant trigger. That's

1:22:03exactly what a webhook is. As soon as

1:22:05something happens, we instantly get

1:22:07notified in the webhook. Now the

1:22:09business use case to this could be

1:22:11someone filling out a form. So as soon

1:22:13as the user fills out a form, whether

1:22:14it's in the website or something else,

1:22:16we instantly get notified so the webhook

1:22:18receives the data meaning receives the

1:22:19responses from the form and then starts

1:22:21the automation which is the one right

1:22:23here. All right, so let's jump onto N

1:22:24and right here real quick and we can add

1:22:26the first step. So adding the first step

1:22:27just asking us what is the trigger? What

1:22:29is a thing that starts the automation?

1:22:31As I mentioned, when someone fills out a

1:22:32form, the first step will be the webhook

1:22:34because that's the thing that allows us

1:22:35to actually start the automation. Now

1:22:37the webhook can be found here. So on

1:22:38webhook call, we can obviously trigger

1:22:39manually an app event on a schedule,

1:22:41form submission. We can do a bunch of

1:22:42stuff but the webhook itself is this one

1:22:44and it runs the flow on receiving an

1:22:46HTTP request. Now HTTP stands for

1:22:48hypertext transfer protocol, very fancy

1:22:51way of saying that data is passed from

1:22:54one app to another when we get notified,

1:22:55right? So when we tap on here, we get

1:22:58introduced to this page right here.

1:22:59On the left hand side is basically

1:23:01pulling in from the webhook so it's

1:23:02listening for new events. So when we

1:23:03press this button, it now the webhook

1:23:05itself it's listening for notifications

1:23:08coming from some server, some sort of

1:23:09server.

1:23:10So let's stop listening.

1:23:11And in the middle, this is the

1:23:13configuration and on the right hand side

1:23:15is the output. So when we get notified,

1:23:17the notification will show up here.

1:23:19So right here the first thing that we

1:23:20see is the difference between a test URL

1:23:22and a production URL. Now this is quite

1:23:24misunderstood between what they are but

1:23:26a test URL so if you look at the the

1:23:28actual thing, the actual URL in this

1:23:29case,

1:23:30it says test but production doesn't have

1:23:32test. Now when you want to deploy which

1:23:35means that you when you want to activate

1:23:36your automation, you typically want to

1:23:38use the production URLs. That's the main

1:23:39use case for this but you can use the

1:23:42test when you test and production is

1:23:43again when you want to activate your

1:23:44automation. Now right here you can see

1:23:46that you have a URL. So again, the

1:23:48webhook itself is URL that's accessible

1:23:50to anyone. It's literally it goes on the

1:23:51web. It's just a normal link that you

1:23:53can use for anything that you do. So if

1:23:55I press here, I can easily copy it and I

1:23:57can go to to Google and actually search

1:23:59it. But again, this is a thing that

1:24:00allows us to actually get notified when

1:24:02something happens and we also get this

1:24:05this long string. So this is the the

1:24:06unique part which is 3826BB2D9056

1:24:11and this is the path.

1:24:12This is what we call a path. Now the

1:24:13path can be changed to something else

1:24:15like hello.

1:24:16Like hello Michele, whatever it is.

1:24:19Or we typically want to have a long

1:24:20string. It doesn't really matter.

1:24:22But again, this can be this can vary.

1:24:23This can change, right? And it doesn't

1:24:25really matter what you put here.

1:24:26Now when it comes to the webhook itself,

1:24:29we have different types of method. Now

1:24:31when you want to get notified from a

1:24:32server, you typically want to use one of

1:24:33these different HTTP methods. So the

1:24:35HTTP method can be a get which is

1:24:38getting information, head, patch, post,

1:24:40put, and delete. Really the only ones

1:24:42that I've actually used after building

1:24:44hundreds of automation is get and post.

1:24:46So a server could say, "Hey, I'm sending

1:24:47you the notification but you need to be

1:24:50a put request or a post request or a get

1:24:53request." Right? So this is the thing

1:24:54that you put here. The path again I

1:24:55explained which is the last part of the

1:24:56webhook. Authentication is basically

1:24:58saying, "Do you want to add a password

1:25:00so only you only the people who know the

1:25:03username and password can actually

1:25:04access it." You can use it but I don't

1:25:06really use basic auth and header auth or

1:25:07JSON webhook token auth. It doesn't

1:25:10really matter like the difference

1:25:10between doesn't really matter but just

1:25:11know that they're used as a way for us

1:25:13to say, "Hey, don't breach across this

1:25:15point. You need to have a password to

1:25:16actually use it." So that's what we use

1:25:17authentication for but typically I would

1:25:19have it as none. And then for the

1:25:20response we have immediately, we have

1:25:22when last node finishes. So immediately

1:25:24just means like when this happens,

1:25:25immediately send the data here. We can

1:25:27have when last node finishes so return

1:25:29the data when the last node which means

1:25:30that the last step of the execution is

1:25:32finished, the last step of the

1:25:33automation, and then it sends the data

1:25:35back. And we can use a respond to

1:25:37webhook node which I'll show you in just

1:25:38a second, and then streaming as well

1:25:40which we don't really use uh so don't

1:25:41worry about it too much. And then we

1:25:42have different options. So for options,

1:25:44I would usually have the raw body so in

1:25:46case we need it. But for most of the

1:25:48times because we're getting notified

1:25:49because we're getting something, we

1:25:51wouldn't use any options but you can

1:25:53have the option to basically have some

1:25:55different options here that you can use

1:25:57for the different types of requests that

1:25:58you're getting. But typically we

1:25:59wouldn't put anything here. So with that

1:26:01being said, if you go here to webhook,

1:26:03when I spoke about the respond to the

1:26:04webhook, we also get a webhook response.

1:26:07Respond to webhook. So what this means

1:26:09is that when we get notified from the

1:26:10server, we can actually give it a

1:26:12response back to the server. So let me

1:26:14show you what I mean. So because this is

1:26:16accessible on the internet, I can copy

1:26:18this, I can listen for the test events.

1:26:20And let me just

1:26:21go like here.

1:26:23And then I can see that now the message

1:26:25says workflow has started. So if I go

1:26:27back here, I can see that [music] on

1:26:29here I get a bunch of output. So I get

1:26:31the user agent, Mozilla which is

1:26:33basically telling everything about my

1:26:34browser, a bunch of codey stuff that you

1:26:36don't have to worry about but just know

1:26:37that because we opened it on the

1:26:39browser, it's basically giving us a

1:26:40bunch of information that we then can

1:26:42use for the automation. So let me show

1:26:43you exactly what I mean by a respond to

1:26:45webhook. So let's say we add this here

1:26:47and I go in here and I say

1:26:50all incoming items.

1:26:51So we're basically saying, "Hey, I'm

1:26:53going to give you back everything that

1:26:55you gave me." So if I execute this

1:26:57workflow,

1:26:59I think I have to change this to yeah,

1:27:01you respond to webhook as well because

1:27:04this is the response.

1:27:05Execute the workflow and now I go here,

1:27:08I can see that I get a bunch of

1:27:09different text. So this is exactly what

1:27:11sent to us but because we're sending it

1:27:12back, we get everything here. So that's

1:27:14why it's sending us everything back. All

1:27:16right, so you understand what a webhook

1:27:17is now. You understand sort of the

1:27:18different things, the different

1:27:20settings. Let's actually put it to work

1:27:21and see how it actually works in a

1:27:23business case scenario. If I go here,

1:27:26let me just put in production mode and

1:27:27let me copy this.

1:27:29Uh the workflow that we're going to

1:27:31basically make is starting from a

1:27:32Typeform which is someone filling out a

1:27:34form and then we can add it to let's say

1:27:36a Google Sheet and then we can send an

1:27:38email back to the person that filled out

1:27:40the form.

1:27:41So let me go to Typeform. So this right

1:27:42here is the Typeform that we're going to

1:27:44use for this test right here. It all

1:27:45starts with full name, email, and what

1:27:47are you looking for? Very simple. You

1:27:48can obviously add more details like

1:27:49company name, budget, whatever it is

1:27:51that you have but let's start here. I

1:27:53want to show you exactly when we fill

1:27:55out this form, how does it send the

1:27:56information to N and N? So let me go to

1:27:58workflows.

1:27:59Let me go to webhooks right here. So you

1:28:02can connect with any app to send

1:28:03responses or trigger actions which is

1:28:05exactly what we want. We want to add a

1:28:06webhook

1:28:07which will take us to this page. We can

1:28:09add a webhook and then here is where we

1:28:12go inside and we actually what is it?

1:28:14Production URL. Let's copy this

1:28:16and let's put it into here.

1:28:20And we can save the webhook.

1:28:21Now once this is done, we can we

1:28:23typically want to send a test request to

1:28:25make sure that it does work. So let me

1:28:26go here.

1:28:27Go inside and listen for test events. I

1:28:30can send a test request [music] and now

1:28:31it's giving me an error. So let's see

1:28:33why it gives me an error. So below

1:28:35on the response, we can see the workflow

1:28:37must be active for a production URL to

1:28:40run successfully. You can't activate the

1:28:41workflow using toggle. Okay, so this is

1:28:43what I meant before. So if you go here,

1:28:45I just pasted the production URL. Let's

1:28:47do the test URL because again, the

1:28:49production URL only works when you

1:28:50activate the automation. So let's do

1:28:52test URL. Let me copy this.

1:28:54Let me go here.

1:28:56Let me replace

1:28:58webhook.

1:29:00And now

1:29:01we can

1:29:02test it again. So let me listen for

1:29:05event.

1:29:07And I can test the [music] request.

1:29:09In this case it's giving me another

1:29:10error. So let's see the response.

1:29:12And now it's telling me the webhook is

1:29:13not registered for post request. Did you

1:29:14mean to make a get request? So now this

1:29:17is goes back to the fundamental where I

1:29:18told you some servers ask us to do a

1:29:20different request. So in this case for

1:29:22the HTTP, they say, "Hey, this is not

1:29:24set up to do a post request." So all we

1:29:26have to do is set up to the to do a post

1:29:28request in this case. And then we can

1:29:30try again,

1:29:31go here and then send a test request and

1:29:33now it should be successful, right? 200,

1:29:35which means it's all good. The workflow

1:29:36has started. And if I go back to n8n,

1:29:39I can see that we have the output, which

1:29:41is successful, right? Which is

1:29:42everything. Okay, cool. Now, now we know

1:29:45that this works and we know that we get

1:29:46a request whenever this is post and it's

1:29:48test just to test until we set it to

1:29:50active,

1:29:51we can then fill out the form and see

1:29:53the data that we get. Go here, listen

1:29:56for events, go back to Typeform, and

1:29:58then I can activate this cuz we want

1:30:01this to be on every single time.

1:30:03I can copy the link to the Typeform and

1:30:05then I can start filling it out. So let

1:30:07me do Michele Torti,

1:30:09my name, or my email.

1:30:13And what are you looking for? I want to

1:30:15learn automations.

1:30:18And I can press submit and now this

1:30:20information will be sent to n8n right

1:30:21here with a different output. So we have

1:30:24headers, which is just a bunch of fancy

1:30:25stuff that you want to look at, but then

1:30:27what we actually care about is

1:30:29not the body, but the responses. Where

1:30:31is it?

1:30:33The answers. So Michele Torti, my name,

1:30:36the email is this, and the text, the

1:30:38third one, is this.

1:30:40So these are the ones that we're going

1:30:40to use for the next steps. The form

1:30:42submitted is sent the data to the

1:30:43webhook. It's like, "Hey, we have this

1:30:45data. Someone just submitted the form.

1:30:46Now use it for whatever you want to use.

1:30:48Here's a notification." Okay, once we

1:30:49have this, what we can do now is we can

1:30:52add it to our Google Sheet. So let's

1:30:54make a Google Sheet right now.

1:30:57Let's name it

1:30:59new form request.

1:31:03Let's do full name. These are the the

1:31:05variables that we had, email.

1:31:10Uh once. Let's just do once.

1:31:13So let's connect this to n8n. So I go

1:31:15here, I can press plus, I can go Google

1:31:18Sheets.

1:31:19And then what I need to do is append a

1:31:20row in a sheet.

1:31:23Connect it. All you have to do is go

1:31:24here, sign in with Google, very very

1:31:25simple.

1:31:27And then I can do sheet within a

1:31:28document, append a row, which means add

1:31:30a row. And the document will be new form

1:31:32request. There we go, the first one.

1:31:34And then the sheet will be one. We want

1:31:36to map each column manually because we

1:31:38want to do this manually. And then the

1:31:39full name will be

1:31:41the one here. Where is it? There we go.

1:31:43Text.

1:31:45Because this is [music] the text that we

1:31:46got.

1:31:47And you know this because these are the

1:31:48answers, right? You wouldn't put it here

1:31:50if it wasn't the answers. And then email

1:31:52would be the one here, so you just drag

1:31:53it across. And once will be the last

1:31:55thing, which is I want to learn

1:31:56automations. So it's always good to test

1:31:58because when you go here, how would you

1:31:59know this is the answers, right? I mean,

1:32:01it says answers right here, but it's

1:32:03much better if you test to get actual

1:32:04answers that you know you put, so you

1:32:06can just map them here. And this is all

1:32:08good, so I can just execute step, which

1:32:09means I'm just testing it. This is

1:32:10executing, so if I go here to the sheet,

1:32:12I can see that this is already added.

1:32:14Let me add this to bold.

1:32:16And then I know this works, so I can go

1:32:18to the last step, which is sending an

1:32:19email.

1:32:20So email in this case will be Gmail.

1:32:22Uh create a message. No, send an email.

1:32:25Yes, send a message. All I have to do to

1:32:27connect to Gmail to to n8n is go here,

1:32:29sign in with Google, very very simple,

1:32:30like Google Sheets. And then here I have

1:32:33to put message send because we're

1:32:34sending the message. And in this case,

1:32:36who are we sending the email to? We can

1:32:38either pull it from here

1:32:39or we can pull it from the actual form

1:32:41itself, which is the email, right? I can

1:32:44put it here. The subject line will be

1:32:46thanks for filling out

1:32:50the form.

1:32:52Then it's asking us for the email type.

1:32:53Now HTML is just the way that we make

1:32:55our emails fancy. We can leave this as

1:32:56text

1:32:58cuz we don't need to use HTML. We can go

1:33:00here, full screen. And then here I can

1:33:02say, "Hey,

1:33:03I can go down to my name." So hey

1:33:05Michele. And obviously, ideally we want

1:33:07to have just the first name and that

1:33:09goes into formulas. I don't want to get

1:33:10into this uh just for this video cuz

1:33:11it's a bit more complex, but I can say,

1:33:13"Hey Michele,

1:33:15just saw

1:33:20our team will get back to you

1:33:24as soon as possible.

1:33:27Thanks."

1:33:29All right, cool. So we said, "Hey,

1:33:30webhook name", which is a variable that

1:33:32we're pulling in from the form because

1:33:33again we're using dynamic variables, it

1:33:34changes every single time. We're also

1:33:36saying, "Hey, what do you want Who do

1:33:37you want to send an email to?" And

1:33:38that's about it for the step. So let me

1:33:39test it. Okay, I just realized that it

1:33:41was actually wrong. I put an extra O, so

1:33:44I I actually didn't send an email. Um

1:33:46but you should be getting the email when

1:33:48you send it through. I just had to put

1:33:50one O less, but that's how that's

1:33:52usually how it works. You just send it

1:33:53and you get this output right here. So

1:33:55let's test it from the start until the

1:33:56end. Let's execute the workflow and

1:33:58let's

1:33:59do a new form. So let's refresh. Let me

1:34:01go here and say James Low.

1:34:04Let me do my actual email

1:34:06without the extra O.

1:34:09Automations

1:34:10for lead generation.

1:34:13Submit.

1:34:14We go here.

1:34:15It's talking to Google Sheets to

1:34:16actually add it, but we got the the

1:34:18output here. So if I go here, I can see

1:34:20that the answers in this case was James

1:34:22Low,

1:34:23was email, and then it was automations

1:34:26for lead generation,

1:34:27which rhymes. Uh let me go to Google

1:34:29Sheet, which appends a row in the sheet,

1:34:30which means that it added. So if I go

1:34:32here, I can see that James Low was

1:34:33added. And obviously this would be a

1:34:35project management tool, it could be a

1:34:36CRM, whatever you have. Um

1:34:38but we added it here so you so you can

1:34:39keep track of all the different requests

1:34:41you're having.

1:34:42And lastly, we have the email, which was

1:34:44sent

1:34:45this time with the right email. So if I

1:34:46go to my email right here, I can see

1:34:48that I have an email from Michele which

1:34:50says, "Hey James Low, just saw you

1:34:52filled out the form on our website. Our

1:34:53team will get back to you as soon as

1:34:54possible." Of course you want to add

1:34:54more. And then it actually sends this as

1:34:57well, which is which we don't want. So

1:34:59all we have to do is go here

1:35:01and then we can go to append n8n

1:35:03attribution. We can turn this off so

1:35:05that whenever it sends us an email, it

1:35:06doesn't say this part, which we don't

1:35:08want.

1:35:09All right, so that right there is

1:35:10basically how you use webhooks on n8n. I

1:35:12want to quickly show you how it looks

1:35:14like on a different platform, which is

1:35:15make.com. So if I go to make.com,

1:35:18I can log in. This is just another

1:35:19automation platform like n8n. It's just

1:35:22between n8n, Zapier, and and make.com.

1:35:24Make.com is it's fairly easier to to get

1:35:26started with, but if I go here,

1:35:29I can see that to add the webhook to

1:35:31make.com, all you have to do is go here

1:35:34and this lists your webhooks here, and

1:35:35you can create a custom webhook,

1:35:37which is the same. So create a webhook,

1:35:39name it whatever you want. So Michele

1:35:42test. This will be the URL that we had

1:35:44before. So in n8n, it will be this,

1:35:47this

1:35:48URL right here. In make.com, it will be

1:35:50this. They all have their own like

1:35:52internal different names. In this case

1:35:54it's make.com

1:35:55and for n8n, it's n8n.cloud, right? So

1:35:58they have their own unique sort of way

1:35:59that they name their

1:36:01the webhooks. But on a high level, this

1:36:03is very very this is literally pretty

1:36:05much the same. Like it has the same

1:36:06functionality. All the webhooks are

1:36:08pretty much the same. It's just that the

1:36:09way they look is different because of

1:36:12the way that the this is set up. Press

1:36:14save.

1:36:15And this much. I don't want to get into

1:36:16make.com cuz that's more of a different

1:36:17video, but I just wanted to show you the

1:36:19how it looks like to actually make a

1:36:20webhook on a different platform. And

1:36:22lastly, I want to show you how to send a

1:36:25data point from not from a form, but

1:36:27from another scenario to a webhook,

1:36:29right? If I go to another scenario right

1:36:30here, so let me go out. Let me go here.

1:36:34Let me create a new workflow. And now,

1:36:36because we I spoke about HTTP at the

1:36:38start, but in order for me to have a

1:36:40workflow and then send the information

1:36:41from that workflow to the next workflow

1:36:43through a webhook,

1:36:44I can then actually use a HTTP request.

1:36:48So let me show you exactly what I mean.

1:36:49It will look it will actually be much

1:36:50more clear when I actually run this, but

1:36:52all I have to do is [music] copy this.

1:36:55And let me take this out.

1:36:58So I copy the webhook that I need.

1:37:00And now we will get data from from the

1:37:02previous workflow. So if I execute the

1:37:04workflow here, I can go here and then

1:37:06then I can send

1:37:07the URL, which would be basically

1:37:09saying, "Hey, I'm sending the data to

1:37:11you", right? And the webhook is getting

1:37:12notified. In this case, the method would

1:37:14always be post just because we're

1:37:16posting information cuz that's sending

1:37:17information from one place to another.

1:37:19Authentication is zero. And then we can

1:37:21also send a body. The body will be

1:37:24anything that you want it to do, so you

1:37:25can say

1:37:26uh full name.

1:37:28So actually let's do camel case.

1:37:31Full name, Michele.

1:37:34Camel case is just just wants the

1:37:36capital letters to be this.

1:37:38So this right here will send the

1:37:38information with it. So if I execute

1:37:40this step, first of all I have to run

1:37:41this.

1:37:43All right, so actually it's already

1:37:43running, right? Now it's waiting for

1:37:45this. So if I [music] execute the step,

1:37:47now

1:37:49it will send the information and I can

1:37:51see that we have in the body right here,

1:37:52we have full name, Michele.

1:37:54So imagine if you had a workflow right

1:37:56here, which could send different

1:37:57variables, so different things from one

1:37:59workflow to another, so you can split it

1:38:01up. And you have all the different

1:38:02workflows talking to each other because

1:38:04you have webhooks and because you have

1:38:05HTTP requests.

1:38:07This is a whole 'nother topic in itself,

1:38:09but I wanted to show you the overall

1:38:10sort of arcing thing of what a webhook

1:38:12is, how it can be used in a business

1:38:14sense, how it can be used, or what the

1:38:16fundamentals are, and how everything

1:38:17works together, how you can link it from

1:38:18automation to automation as well.

1:38:23In this video, I'm going to show you how

1:38:24you can handle any errors inside of n8n

1:38:27so your AI agents and your workflows are

1:38:29smarter, stronger, and make sure that

1:38:31they actually work. All right, so the

1:38:32first one here is retry when failure. So

1:38:34this happens when the workflow stops

1:38:37working because of some reason, and then

1:38:39we tell it to run X amount of times in X

1:38:41interval. And you know a node, you know

1:38:43a step has this exact error handling

1:38:45technique because you will see this

1:38:47right here, which says retry when fail.

1:38:49So if I go inside the HTTP request,

1:38:51which is a again a node, a thing that we

1:38:53used to send a request to some server in

1:38:55the internet asking for information,

1:38:57we can execute the step and basically

1:39:00what this is, it's a server where it

1:39:02allows me to get any images of any dog

1:39:04randomly.

1:39:05I got this dog right here, right? And I

1:39:07can keep going

1:39:08again and again and again. And as you

1:39:10You see, it's [music] successful. Why is

1:39:11because the status is success. And I

1:39:14also notice because there's a green

1:39:15check mark, right? Which tells me that

1:39:16everything went good.

1:39:18Now, what happens if something goes

1:39:19wrong? Well, if I remove the E,

1:39:22right? Cuz before there was image, now

1:39:24there's no image.

1:39:25>> [music]

1:39:25>> This will now stop working. This will

1:39:27say there's an error.

1:39:28As you can see, the resource you are

1:39:30requesting cannot be found.

1:39:32And if I go here, let's say you have a

1:39:34whole workflow behind it. It will stop

1:39:35here, right? And so, why is this bad?

1:39:37Well, it's because sometimes some

1:39:40service just stop working randomly,

1:39:41right? They stop working for 1 to 2

1:39:43seconds, maybe 3 to 4 seconds, which

1:39:45[music] is why we use the retry when

1:39:46failure. So, the way to set this up is

1:39:48to go to settings. You then have this

1:39:50setting turned on, retry on fail,

1:39:52which means that you're saying, "Hey,

1:39:54retry [music] this many times in this

1:39:56interval." So, it stops working, it

1:39:58tries once, then it waits 1,000

1:40:00milliseconds until it tries again.

1:40:02Wait, tries again, right? And so, it

1:40:04does it three times to make sure that we

1:40:06say, "If it doesn't work, that's cool.

1:40:08We'll try again after this amount of

1:40:09time." Right? And try back, try back,

1:40:11try back until it works. And so, if I go

1:40:13here and I run this, [music] input a

1:40:15manual trigger,

1:40:17I think I have this, manual trigger.

1:40:19There we go. I can execute the workflow,

1:40:21and as you can see, this is now looping

1:40:23around [music] because it's actually

1:40:25waiting or it's trying again after those

1:40:27many times in that interval. So, let's

1:40:29say I take this off,

1:40:32right? All I have to do now is execute

1:40:33the workflow, and it will instantly

1:40:35[music] error out. But by turning this

1:40:36on, retry when failure,

1:40:38it will wait, right? To try again and

1:40:41again and again, and at the end it will

1:40:42stop. But there's some process of them

1:40:44going through it, they're trying again

1:40:46um before it goes to the next step. This

1:40:48can be applied to LLMs because sometimes

1:40:50OpenAI, Claude, Gemini, they just stop

1:40:52working, and we have no clue why. And

1:40:54so, to make your automation more

1:40:56scalable, so that it just doesn't stop

1:40:58every single time something goes wrong,

1:40:59then make sure you have this. The second

1:41:01technique is called the continue when

1:41:03failed. Now, we allow the workflow to

1:41:05continue even when it fails. And so,

1:41:07theoretically, right? Logically, this

1:41:09step right here, where you would

1:41:10continue even if it fails, has to be

1:41:12something where if it fails, amazing, we

1:41:15still keep going. If it succeeds, we

1:41:17keep going. So, it can't be a step

1:41:18that's very, very important in the whole

1:41:20logic of the flow. It has to be

1:41:21something where if it's great, great, if

1:41:23not, then it's fine. And so, the way to

1:41:25set this up is you have to go to on

1:41:26error,

1:41:28and here we have three options. In this

1:41:29case, it would just be continue. And so,

1:41:31what we do here is it continues, and it

1:41:33actually sends the error output, right?

1:41:36The error message, to the next step. So,

1:41:38if I go here, I added an extra S, I can

1:41:41go here or extra F in this case, and I

1:41:43can see that this is the message that I

1:41:44get. Now, on the outside, everything

1:41:46looks great because you can see

1:41:48that this succeeds, right? There's a

1:41:49check mark. But on the inside, what we

1:41:52get is a message, right? We get this

1:41:54error message that we can then use

1:41:55[music] to give to the next step. If I

1:41:57go here to the next step, I can then

1:41:59pull the error message, put it over here

1:42:01like a normal variable. I can execute

1:42:03[music] the step, and this is the output

1:42:05that we get right here. The third

1:42:06technique is called split error route.

1:42:08Now, split error route is a technique

1:42:10that we use in a lot of our automations

1:42:12to split the automation based on the

1:42:14logic cuz everything is logic. What that

1:42:16means in the plainest of English is this

1:42:19step runs if this step actually

1:42:22succeeds, then it goes one way. If it

1:42:24errors out, so something goes wrong,

1:42:26then we go the next way. Now, typically

1:42:27this is great because with automations,

1:42:29because everything is built on logic,

1:42:31then we would typically have a route.

1:42:34So, if something goes right or

1:42:35everything goes right, then it goes one

1:42:36way and it continues the automation. If

1:42:38something goes wrong, then we notify our

1:42:40team saying, "Hey guys, something went

1:42:41wrong." And so, if I go inside here,

1:42:45I can see that now I have the same exact

1:42:47API that we had before,

1:42:48and this will now go through the success

1:42:50branch, not the error branch. But if

1:42:52there's an error,

1:42:54so extra F, I can execute the step, and

1:42:56I can see that now it goes to the error

1:42:57branch, which is

1:42:59this one here.

1:43:00And the way to set this up is if you go

1:43:02to settings,

1:43:03on error, so again, what happens when

1:43:05there's an error, you [music] can

1:43:06continue using error output,

1:43:08right? It passes the item to an extra

1:43:09error output,

1:43:11which means that it gives us two

1:43:12different paths to go [music] down with

1:43:13our automation, one here and one here.

1:43:16And if I go to my email, which in this

1:43:17case is a step that we have right after

1:43:19there's an error in a workflow,

1:43:21we can send the error message as an

1:43:24output, which in this case looks like

1:43:25this,

1:43:26right? And so, right here I have the

1:43:27workflow, and in this case, let's say

1:43:29it's a success, right? Just take the F

1:43:31out here.

1:43:33You can execute this, and it goes the

1:43:35next way.

1:43:37And if I go to my email, right? And I

1:43:38have this error here,

1:43:39no route or get XYZ. Now, honestly, this

1:43:43right here makes no sense to any normal

1:43:44human looking at this unless you know

1:43:46APIs and so on. We could delete all

1:43:49these things, all these lines, uh just

1:43:52to make it look cleaner. Um and yeah,

1:43:54you can have this, so you're notified

1:43:55when something happens. Now, there

1:43:56actually is a better way when it comes

1:43:58to uh using the notification when

1:44:00something errors out, which I'll show

1:44:02you in the last technique, but this is

1:44:04great because it gives us two options,

1:44:05right? It gives us the success option,

1:44:07and it gives us the error option, all

1:44:08within the same workflow. Next technique

1:44:10is actually within the AI agent. So, if

1:44:12I go to the AI agent and I go on chat,

1:44:14and I can say

1:44:16hello.

1:44:17What this does is that it talks to the

1:44:18brain, [music] right? Because again, we

1:44:20mentioned that the brain is the LLM,

1:44:22which means an AI that helps it think

1:44:24through what it needs to do,

1:44:25>> [music]

1:44:25>> new instructions, based on the prompt

1:44:27that we have inside. Now, this is all

1:44:29great until this stops working, right?

1:44:31There is a chance that this just errors

1:44:34out, but this LLM just errors out, which

1:44:36is where we add a fallback agent LLM.

1:44:39So, if I go inside here, I can see that

1:44:41I have an option here to enable fallback

1:44:43model. If I turn this off, that means

1:44:45that it removes the option for me to add

1:44:48a fallback agent LLM. As you can see,

1:44:50this is just [music] a glitch that n8n

1:44:52needs to fix, uh but you will have no

1:44:54option here as well. And so, the thought

1:44:56behind this is, okay, cool. If we run

1:44:58this and it goes here to the agent, then

1:45:00the agent called its brain because

1:45:02that's how it thinks, and it doesn't

1:45:03work, then we just break the whole

1:45:05[music] thing, right? And so, why don't

1:45:06we add a step

1:45:08in the middle where if it doesn't work

1:45:10here, it then uses [music] a different

1:45:12LLM to be able to try again. And so,

1:45:14that's where we go in here, we turn this

1:45:16on, and we start adding the fallback

1:45:18agent [music] LLM. Now, the fallback

1:45:19agent LLM, ideally, it would be a

1:45:21different LLM because if OpenAI doesn't

1:45:23work in that moment, it will probably

1:45:25not work in that moment as well. Um so,

1:45:27you want to make sure that you connect

1:45:28it to another LLM,

1:45:30and you will be able to then use this as

1:45:33a fallback. So, if I go here, rename

1:45:35this

1:45:36fallback,

1:45:38it will use this model right here in

1:45:40case this one doesn't work. So, right

1:45:41here, if I go inside

1:45:44and I go to my connection,

1:45:46and I just name it fail,

1:45:48save.

1:45:49Let's put an API key,

1:45:51fake one.

1:45:52Uh if I go out, I can see that now I

1:45:54have a fake credential called fail,

1:45:56which means that now it shouldn't work,

1:45:58right? And so, if I go here to open

1:46:00chat, I can say hello. This will now go

1:46:02here, there's an error, and see how it

1:46:04instantly talks to the next fallback LLM

1:46:06to then give you an answer. Now, this is

1:46:08great because a lot of the times, like I

1:46:10mentioned, LLMs don't work, right? And

1:46:12so, you want a some sort of fallback,

1:46:15some sort of agent that they can rely on

1:46:17if the first one doesn't work. It's sort

1:46:18of like you're playing sports, you have

1:46:20the main people and then the bench,

1:46:21right? Which is me when I was younger.

1:46:23And so, when we have the main guy who's

1:46:25playing, and the main guy gets injured,

1:46:27then it calls another guy, and then they

1:46:29call me. But in this case, they call the

1:46:30guy in the bench, and the guy in the

1:46:31bench is a fallback LLM. All right, the

1:46:33next one is called the error workflow.

1:46:35So, this is what I meant by the other

1:46:36way of doing this, [music] split error

1:46:38route, because we actually set up a

1:46:40completely new automation,

1:46:42which receives

1:46:44any error that comes from any automation

1:46:46in our workspace, and then we can do

1:46:47whatever we want. Now, this has to be a

1:46:49separate automation. So, this is just

1:46:51the automation that we're running now,

1:46:52right? But [music] this will be a node

1:46:55that we add in a different automation.

1:46:57Now, the way to set this up is we need

1:46:58to have a workflow. We have to activate

1:47:01this, right here.

1:47:03Once I activate this, all I have to do

1:47:05is go, make a new workflow like this,

1:47:07which has the error trigger. And again,

1:47:09you can't activate this because it

1:47:10doesn't let you, cuz this is already

1:47:12activated. And I'll go here. You want to

1:47:14go to settings. You then want to go

1:47:16[music] and choose the error workflow,

1:47:17which in this case is this, right? Which

1:47:19is the workflow where the error trigger

1:47:21node is here, and you just want to

1:47:23attach to it. So, in this case, for

1:47:24mine, it will be E with the R right

1:47:26here. I can press save, and now what

1:47:28happens is that I just connected this

1:47:30automation

1:47:32to the error workflow. So, that whenever

1:47:33something wrong happens here, it sends

1:47:35the data or sends a notification on the

1:47:37other workflow. So, [music] let me test

1:47:38it out. So, now let's say we go inside

1:47:40here and we execute the step.

1:47:42This should now work, right here. Should

1:47:44give us a picture of a dog.

1:47:46Right? Um and what we want to do here is

1:47:50we want to make sure that this will run

1:47:51now every 5 seconds. That's fine. Let me

1:47:54make sure there's an error here.

1:47:55It's a F.

1:47:58Let me run this.

1:47:59There's an error.

1:48:00Okay, cool. Now, if I press save, this

1:48:02will now run the workflow every 5

1:48:04seconds, and it should now send a

1:48:05notification to our workflow every 5

1:48:07seconds because there's an error here.

1:48:09So, if I go inside here,

1:48:11I go to editor again,

1:48:13just to refresh cuz you have to reload

1:48:15the actual automation, you go to

1:48:16executions.

1:48:18I can see now that we have new errors

1:48:21coming every single time. And on the one

1:48:23end, it's a error, right? But on this

1:48:25end, it's a success because that's what

1:48:27this job of the error node does. Now,

1:48:29because I'm actually paying for

1:48:31executions, I'm going to

1:48:32deactivate this.

1:48:34But as you can see here, we now have a

1:48:37bunch of different workflow executions

1:48:39that we can then

1:48:40>> [music]

1:48:40>> use to then be able to send ourselves an

1:48:42email, right? So, if I go in here,

1:48:44I can see that I have the URL of the

1:48:46workflow, the description,

1:48:48which actually makes sense in plain

1:48:50English,

1:48:51that we can now use to actually build

1:48:52out a workflow here. So, if I go to copy

1:48:54the editor,

1:48:56which means that it now pins the actual

1:48:57output that we got from that run.

1:49:00I can then go to Gmail.

1:49:02I can send a message.

1:49:04Obviously, connect to Gmail by going

1:49:05here, press sign with Google.

1:49:08And you'll be good to go. Message, send,

1:49:10let's do my email. Let's do subject

1:49:12line, which means

1:49:14>> [music]

1:49:14>> you can say error in workflow.

1:49:17And then the email type, let's just do

1:49:18text.

1:49:20Cuz HTML is basically saying, "Hey,

1:49:22let's make it look pretty." We don't

1:49:23have to. [music] Saying, "Hey, Michele.

1:49:26There was

1:49:28an error in this [music] workflow."

1:49:32So, URL.

1:49:35You can put the URL here.

1:49:36Error description.

1:49:40And you can put the description [music]

1:49:41here.

1:49:41And you can go

1:49:44level and you can do warning.

1:49:46Just saying, "Hey, to what extent do we

1:49:48have to worry about this?" You can just

1:49:49do warning. [music] And now, what I can

1:49:51do is I can run this. And in that case,

1:49:54it will error out and it will send me an

1:49:56email every single time with those

1:49:58variables that change. And if I go to my

1:49:59email, I can see here that I have error

1:50:01in workflow. Saying, "Hey, Michele.

1:50:03There was an error in this workflow.

1:50:04The error description is this. The URL

1:50:06is this." And if I actually go inside

1:50:08the URL, it will take me directly

1:50:11to the execution

1:50:13of the error of the workflow.

1:50:15Which is amazing, right? Because now we

1:50:17can go here, we can try this again,

1:50:20right? Where we basically tried it again

1:50:21with with something that actually works.

1:50:23>> [music]

1:50:23>> And now we can rerun the execution to

1:50:25make sure that we don't actually lose

1:50:26the data of this. It's all here. So,

1:50:28those are pretty much the only error

1:50:30handling techniques that you need to

1:50:31know inside of n8n to make sure that you

1:50:34have a way to handle errors. Because

1:50:36what you start to realize when you're

1:50:37working with clients is that building it

1:50:39for fun on a YouTube video like this and

1:50:42building it for a client is a tiny bit

1:50:43different. You want to make sure that

1:50:45these actually work every single time.

1:50:47Right? Because sometimes when we're

1:50:48building it for fun, we don't think

1:50:50about what if it goes wrong, right? We

1:50:51just actually build it, it looks cool,

1:50:53>> [music]

1:50:53>> it works in that moment. But what if it

1:50:55doesn't work? And that's when we use

1:50:56these techniques, depending on your use

1:50:58case, to be able to mitigate that error,

1:51:00to be able to uh be safe when something

1:51:02happens.

1:51:06Hey, so in this video I'm going to show

1:51:07you 30 n8n hacks that I wish I knew when

1:51:09I got started that will help you make

1:51:10your workflows at least three times

1:51:11faster and save a ton of money on

1:51:13execution. All these are hacks that I

1:51:14had to learn the hard way over the

1:51:16course of the past 12 months building

1:51:18and selling automation to businesses. If

1:51:19that sounds like something that you want

1:51:21to improve on and learn, then this video

1:51:22is for you. Let's dive in. So, the first

1:51:24hack is actually software updates. So,

1:51:26sometimes when you build automations on

1:51:28n8n, and a lot of times when you watch

1:51:30videos of people actually adding steps

1:51:31to the automation, they go here and then

1:51:33look in the app.

1:51:34Sometimes you don't have any new

1:51:35software. It's because n8n actually

1:51:37updates a platform so that they're able

1:51:39to add more and more nodes, more and

1:51:41more actual executions or or stuff to

1:51:43the platform so that you are able to

1:51:45make your workflows more efficient. And

1:51:47so, the thing you have to do, the way to

1:51:48update your your workflow or your

1:51:50account is to go to sign in. You'll be

1:51:53brought to this page. All you want to do

1:51:54here is you want to manage

1:51:56You're going to go here and you want to

1:51:57press the latest version. In this case,

1:51:59this is a beta, so you might want to

1:52:01press the one below or alpha or the

1:52:03latest stable in this case, which is the

1:52:05most stable version of n8n as of right

1:52:07now that will help you build your

1:52:08workflows in the current version. The

1:52:10second hack is deactivating workflow.

1:52:11So, let's say I have a workflow right

1:52:13here triggered manually, have a HTTP

1:52:15request, which talks to a server, and

1:52:17then step after this is edit or set

1:52:20fields. So, X equals Y.

1:52:23Right? And then here, let's say I have

1:52:26my website.

1:52:28So, if I press execute step, now this

1:52:29will scrape the website. Now,

1:52:32let's say I run this whole workflow.

1:52:33This will run this, this, and this

1:52:34successfully. But let's say I had a

1:52:36problem when I was running this. Let's

1:52:37say I add some more stuff.

1:52:39Now, if I execute workflow, this will

1:52:40stop right here. And when we're building

1:52:42automations on n8n and we want to

1:52:43execute this even if this fails, then

1:52:45all you have to do is press on the node

1:52:47and press D. This way it deactivates the

1:52:50node so that you're able to run even the

1:52:51next step without this without this

1:52:53influencing the decision itself. And

1:52:55this stops It doesn't even consider this

1:52:57node right here when it's running the

1:52:58automation. So, if I execute workflow,

1:53:00even though there's an error here, it

1:53:01didn't run it and it will go to the next

1:53:02step. The third hack is not really a

1:53:03hack, but it's more so the fact that n8n

1:53:05does not charge you for the amount of

1:53:07test executions that you do when you're

1:53:09testing the workflows. So, what I mean

1:53:10by this is that we tested this, this,

1:53:12and this. These are three different or

1:53:14this is one execution. But if I go to

1:53:16the admin panel, as you can see right

1:53:18right now I have zero.

1:53:19And if I run this across right now, I

1:53:22also have zero again. Right? So, when

1:53:24you're testing automations in n8n, the

1:53:27the actual amount of executions that you

1:53:28do or work for executions that you do

1:53:29when you're testing does not count to

1:53:31the amount that you have to pay every

1:53:32single month. So, to show you when you

1:53:33have to pay for something, I just added

1:53:35a schedule trigger. I'm going to

1:53:36activate this. So, now this is going to

1:53:38run every 10 seconds. If I go here, I

1:53:40can see that this is running right now

1:53:43for two, three, four seconds. It's

1:53:45successful. And if I go here to the

1:53:46admin panel, I can refresh

1:53:49and I can see that now I have one

1:53:50execution out of the 2,500 that I have

1:53:52every single month. So, this is more so

1:53:54how n8n actually charges you on the

1:53:55platform. Uh but just know that when

1:53:57you're testing the automations, you are

1:53:59not charged for the execution workflow

1:54:01executions that you do on a testing

1:54:02base. The next hack is actually pinning

1:54:04data. So, let me remove this. Let me put

1:54:06a trigger manually.

1:54:07We have this.

1:54:08Let's say I have to run this every

1:54:09single time. You see how this may take

1:54:1210 seconds, may take 15 seconds. And to

1:54:14test this step, let's say I wanted to

1:54:17to do all the data here.

1:54:19Let me drag this across.

1:54:21Now, if I drag this across, if I execute

1:54:22the workflow,

1:54:23the data here, the result that we get is

1:54:25a result from the previous step.

1:54:26And if I have to get these points of

1:54:28data, I have to rerun the whole thing

1:54:29over and over again. Well, not really,

1:54:31because n8n just added the feature of uh

1:54:33pinning data. So, you can go here and

1:54:35actually pin the data so that we're able

1:54:37to execute this workflow almost

1:54:39instantly right here

1:54:41without having to wait for these nodes

1:54:43to run because we have test data to work

1:54:44with. This is great when you have a

1:54:46100-node workflow, when you have a lot

1:54:47of steps. So, let's say I

1:54:49copy-paste this

1:54:51and have all these steps. So, let's say

1:54:52now we have a four-step execution. If I

1:54:55want to execute the workflow here, let's

1:54:57say I wanted to get the data from the

1:54:58HTTP without having to run it, I can use

1:55:00the test data that we have in order to

1:55:02actually get the data. In this case, the

1:55:04HTTP was not run because of the fact

1:55:06that it is pinned. But now when you want

1:55:08to activate the scenario and you want to

1:55:09get different data every single time

1:55:10using the HTTP request, you want to

1:55:13unpin this. And to do this, you can

1:55:14press P again. So, you can pin and pin.

1:55:16That's another hack. Another hack here

1:55:18is actually something that a lot of

1:55:19people underuse, which is the AI feature

1:55:21on n8n. If I go here to ask the

1:55:23assistant and ask it, "Hey,

1:55:25n you or hey, how can we build

1:55:27a human in the loop

1:55:30agent?"

1:55:31This AI assistant is one of the best

1:55:33that I've seen on any automation

1:55:34platform out there because what it does

1:55:36is that it thinks It actually thinks

1:55:37through what it needs to do, but then it

1:55:38consults through the community, through

1:55:40the documents first, and then the

1:55:41community that has full of people who

1:55:43actually uh engage with the community.

1:55:45And as you can see, it says answer in

1:55:46the community. So, it gives you three

1:55:48different places that it pulls

1:55:49information from. So, it gives you a

1:55:50very, very contextual answer. And it

1:55:52does actually help quite a lot when

1:55:53you're building automations. Another

1:55:54hack here is that when I go inside this,

1:55:56for example, and I want to remove this

1:55:57and I want to pull in data from the HTTP

1:55:59request, usually I would have to drag

1:56:01and drop this here.

1:56:03As you can see, this is actually code.

1:56:04So, if you can actually map this without

1:56:06having to drag this across. All you have

1:56:08to do is square bracket square bracket.

1:56:10I can go dollar sign. I can then look

1:56:12for the nodes that we have to reference.

1:56:14In this case, hey, I want to get

1:56:15information from the HTTP request node,

1:56:17the edit fields node, or the other edit

1:56:18fields node right here. Let's say I want

1:56:20to do HTTP request.

1:56:21I can then put dot and then I have this

1:56:24option right here to do the item, which

1:56:25is exactly the one that we want to do.

1:56:27In this case, I can now still get the

1:56:29output I got before without having to

1:56:30drag and drop this. So, the next hack is

1:56:32actually something that I've never seen

1:56:33anyone say out on YouTube before, which

1:56:35is the ability for us to add images on

1:56:38our notes. So, notes are a way to

1:56:39document your your automation. This I

1:56:41think is one of the best uh things that

1:56:42n8n actually put out, which is something

1:56:44that are lacking in the other automation

1:56:45platforms or the way that we have it set

1:56:46up here. So, let's say I have a note and

1:56:48I do

1:56:49image one.

1:56:51Now here, instead of putting text, which

1:56:53you normally would,

1:56:54right? You're not limited by text, but

1:56:55you can also add images. So, the way to

1:56:57add an image is to put an exclamation

1:56:59mark. You do a square bracket.

1:57:02This.

1:57:03So, again. And now, you would have to

1:57:05put the image URL right here. So, right

1:57:08here we have an image URL, which you

1:57:09have to put to then be able to see our

1:57:11image here. So, let me pull in an image

1:57:12that I have uh from the web. And so,

1:57:15what I did is I actually took a

1:57:16screenshot of this. I made it into a

1:57:17public URL so anyone can access it. And

1:57:19if I paste it, I can see now that I have

1:57:21the image of this automation here. You

1:57:23can imagine now this gives you a lot of

1:57:25possibilities when you're documenting

1:57:26things to actually add documents or add

1:57:28document pictures or pictures, whatever

1:57:29it is you have to put to add to the

1:57:31documentation that you're putting for

1:57:32other people to look at your

1:57:33automations. Also, the next hack is an

1:57:35error handling hack. So, if I go here,

1:57:37delete this.

1:57:38And let's say I have a set node behind

1:57:41or before this. Let me do

1:57:43copy and paste. Another hack right

1:57:45there.

1:57:47Paste this and I say I do I give it JM

1:57:49Solutions

1:57:51.com. So, now I want to pull this

1:57:52variable and put it in here.

1:57:55Drag this across.

1:57:56So, then now this is basically scraping

1:57:58whatever It's actually trying to access

1:58:00anything that I put here.

1:58:01Let's say I run this.

1:58:02Now, I get an invalid URL right here

1:58:05because this right here does not have an

1:58:07HTTP

1:58:08HTTPS, which which is which is what we

1:58:10need in order for us to actually run

1:58:12this. Now, let's say I go here and I go

1:58:14to executions. I can see that here we

1:58:17have an execution telling us, "Hey, you

1:58:18ran this. There was an error." So,

1:58:20there's two things we actually can do.

1:58:21The first one is debug in editor. So, we

1:58:23are able to access the way that the

1:58:25workflow was when it erred, which is

1:58:27great because now we can see exactly

1:58:28what it is that the input was, what is

1:58:30the output.

1:58:31But also, the thing we can do is press

1:58:33this button right here, which is retry

1:58:35with currently saved workflow. So, what

1:58:36this means is that you run a workflow,

1:58:37so you run an automation. In this case,

1:58:39it's this. Let's say it errors out. You

1:58:41want to try again with the same data

1:58:42that we had so we don't lose different

1:58:44things. Let's say we had a Google Sheet

1:58:45that was running every single day and it

1:58:47count the the most recent 100 rows.

1:58:49Let's say one row failed. You still want

1:58:51to execute that same row even if it

1:58:53failed because it is important to us

1:58:54because it's still a data point that we

1:58:55want to process. The next hack is

1:58:57actually a switch mode. Go here to edit

1:59:00node and I put X equals Y. This is just

1:59:03something that we put just to test. Now,

1:59:05the next step can actually be a switch

1:59:07node

1:59:08right here.

1:59:09So, a switch node allows us to do

1:59:10different things.

1:59:11The The first thing that allows us to do

1:59:13is to basically send the automation

1:59:14different ways based on where we want it

1:59:16to go and based on different criteria.

1:59:17So, in this case, we have routing rules.

1:59:19So, this means, "Hey, if this equals

1:59:21that, then send it this way. If that

1:59:22equals this, then send it this way." So,

1:59:24we say we had a very easy sort of thing.

1:59:27Add routing rule.

1:59:29The

1:59:30Or in this case, let's actually do a

1:59:31different step. So, let's say we had

1:59:33this

1:59:34equals to y

1:59:36and this

1:59:37equals to x.

1:59:39Right? So, in this case now, if I run

1:59:41this, and again, this is called the 01,

1:59:44I can run this, and it will send it this

1:59:45way because this is

1:59:47set to y. Right? And the second thing

1:59:50was y. So, there's actually one hack

1:59:51that we can do here because we can

1:59:53rename the output. So, right here,

1:59:55instead of having 0 and 1, we can have

1:59:58this is x

2:00:00or this is y in this case.

2:00:02And here, I can have this is x.

2:00:05So, that here, I can see that this is

2:00:07This is y, and this is This is x. Which

2:00:09is amazing when we're trying to uh Let's

2:00:11say we get emails. We get an email that

2:00:12we get. And let's say that if the email

2:00:15contained something in the subject line,

2:00:16it was a support email or a FAQ email or

2:00:19something email, then we would rename

2:00:20this with support, Q&A, or something

2:00:23else, right? And it's amazing because it

2:00:24allows us to visually see exactly what's

2:00:26happening in the workflow.

2:00:27All right. So, the next one is actually

2:00:29the N8N attributions. So, if I go to

2:00:31Gmail and I send myself an email, so

2:00:32let's do send a message.

2:00:34Let's put my email.

2:00:38Do hello.

2:00:40Hey there.

2:00:41And I run this,

2:00:42this will use my email to send my

2:00:43emails. So, if I go here, I can see that

2:00:45on the email itself, it says, "This

2:00:47email was sent automatically with N8N."

2:00:49Now, ideally, we don't have this or we

2:00:50don't want to have this when we're using

2:00:51it for businesses we're sending email to

2:00:53clients because you want it to feel more

2:00:54personal, and we don't want to exactly

2:00:56say this is an automation, right? So,

2:00:57what we do here is actually remove the

2:00:59uh N8N attribution. So, if I go back

2:01:01here,

2:01:02and I go to add options, I can see that

2:01:04I have append N8N attributions. If I

2:01:06turn this off,

2:01:07now if I rerun the automation, you can

2:01:09see they got another email from Michele

2:01:11James Solutions, but now there was no

2:01:13N8N attribution. There was no, "Hey, N8N

2:01:15sent this."

2:01:16So, that we can actually send emails

2:01:17that feel more personal that doesn't I

2:01:18don't tell them, "Hey, N8N sent this. We

2:01:20have an automation set up." Um so, you

2:01:22can actually use it for your own

2:01:23clients. So, the next hack is actually

2:01:24on N8N forms, and it's the way that we

2:01:26actually design the forms. So, if I go

2:01:27in here and I want to execute the

2:01:28workflow, and I want to Let's say test

2:01:30the form. We can see that we have this

2:01:32color right here. We have this font,

2:01:34this color, this layout, which is

2:01:36standard for N8N. But, what if you had a

2:01:38company that wanted something with their

2:01:39own brand colors that we can send to

2:01:40clients that makes the client feel more

2:01:43more aligned with or more in vision with

2:01:45with the company itself. We can actually

2:01:46customize it. So, to do that, we can add

2:01:48an option. We can go to custom form

2:01:50styling, and it gives you this code

2:01:51right here.

2:01:52So, if we copy this, and we go to

2:01:54ChatGPT, and we say, "Can you also or

2:01:56can you

2:01:58or this is the N8N

2:02:00um general

2:02:02styling

2:02:04form styling code. I want the

2:02:07general

2:02:08color and theme

2:02:10to be blue.

2:02:11To be light blue.

2:02:13Again, this you substitute this with

2:02:14anything that the client has like brand

2:02:16colors and so on.

2:02:18So, now we let ChatGPT run. And this is

2:02:20all within CSS, which is just a way of

2:02:22programming language that allows us to

2:02:23change the design of things. All right.

2:02:25So, it just finished. And by the way, uh

2:02:27this right here, when you see hashtag

2:02:29something something something, it just

2:02:30says blue color. White, blue, uh blue,

2:02:33and very light blue. These right here

2:02:35represent colors. So, if I copy this,

2:02:37and I go back to N8N,

2:02:39I can paste it here. And if I want to

2:02:41execute the step,

2:02:42I now see that the form is in my brand

2:02:44colors. It's blue. And you can do

2:02:45whatever you want with it. You can

2:02:46obviously customize the background and

2:02:47so on. But, this adds that little touch

2:02:49to us actually being able to customize

2:02:51the form for whatever we want for our

2:02:52brand colors. All right. So, the next

2:02:54hack is on a schedule trigger. So, we

2:02:56use the schedule trigger when we want to

2:02:57run the automation maybe once a day,

2:02:59once once a year, uh every second, every

2:03:01whatever it is. Right? But, now we can

2:03:03actually customize it even more as in

2:03:05the time triggers like when it actually

2:03:06runs. If you go here to trigger

2:03:09interval. So, this is you want to run it

2:03:10every second, minutes, hours, days,

2:03:12weeks, and months. We can actually do a

2:03:13custom cron. So, cron is a way that we

2:03:15express time. So, if I go here to

2:03:18documentation,

2:03:19I can see that now

2:03:21I have a lot more a lot more options.

2:03:23You can do a custom. So, we can do it

2:03:25every day at 2:00 a.m.

2:03:26And I can copy this, and then paste it

2:03:28here.

2:03:30And this signifies every day at 2:00

2:03:32a.m.

2:03:33And it tells you that second, minute,

2:03:34hour, day of the month, month, day of

2:03:36the week. And this right here is a very

2:03:37custom way that you can uh obviously run

2:03:39your automations. But, I think it's

2:03:40really really cool that we get to that

2:03:41we're able to run automations whenever

2:03:43we want in a very very custom order. I

2:03:44mean, we have a ton, right? We have

2:03:46every midnight, every Sunday, every

2:03:48Thursday, once a week. This gives us a

2:03:50lot more flexibility when we're building

2:03:51automations. All right. So, the next

2:03:53hack is actually on the workflow and the

2:03:54way that data actually moves in the the

2:03:55sequential order that it moves. So, an

2:03:57example here is when we have an execute

2:03:59workflow, and let's say we have a series

2:04:00of steps.

2:04:01But, we have two ways that the

2:04:02automation can go through it. And it

2:04:03will go through the two ways because we

2:04:05have no filter involved. But, which one

2:04:07does it do first? Well, in this case, if

2:04:09I execute the workflow,

2:04:10you can see that it goes up here first,

2:04:12and then waits 3 seconds cuz I wanted to

2:04:13show you that. Uh it then does

2:04:14everything. So, this runs the workflow

2:04:16that is actually on the top. So, if

2:04:18again, if I put this to the top, we can

2:04:20see that now it executes this first.

2:04:23And this applies for anything that you

2:04:24do. In case you have three, in case you

2:04:25have four, in case you have five. So, if

2:04:26you're wondering why your workflows are

2:04:27running the way they are in the

2:04:28sequential order, just know that it

2:04:30runs. The first workflow that it runs is

2:04:32the first uh is the one on the top, and

2:04:33then it goes uh obviously on a worker

2:04:35level on a lateral level until the end.

2:04:37All right. So, the next hack is actually

2:04:38on the webhooks. So, if I go here to

2:04:40webhooks,

2:04:42I can see that we have a test URL and a

2:04:43production URL. This is the exact same

2:04:45that we have on forms within N8N. And

2:04:47just know that the test URL is only used

2:04:48when you're testing the automations. And

2:04:50once you set them to active, so once you

2:04:52press this button right here,

2:04:54activate this. Now, this will now you

2:04:57have to change the production URL.

2:04:59Right? You have to change the URL that

2:05:00you're using for the external server

2:05:01that we have to use uh when you're

2:05:03putting it to active. So, just know that

2:05:04test URL is when you're testing,

2:05:05production URL is when the automation is

2:05:07active. All right. So, the next hack is

2:05:09actually calling another workflow within

2:05:10a workflow. So, let's say I have an

2:05:12automation right here, and then have x =

2:05:14y, right? It's good. And now, the next

2:05:17step can actually be calling another

2:05:18workflow to do something and then giving

2:05:19us the data. So, let's say I have

2:05:22execute uh sub workflow,

2:05:24which is the action that we want to do.

2:05:26Now, it's asking us to source the data

2:05:27as which is fine. And then it's asking

2:05:28us which workflow do you want to call in

2:05:30order to to send the data and actually

2:05:31execute before getting the data back.

2:05:34So, if I go here, I can actually create

2:05:36an uh sub workflow. So, I can go

2:05:37workflow, personal

2:05:39in this case. And now, I start from

2:05:40scratch. So, this right here,

2:05:42the trigger will be when executed by

2:05:44another workflow.

2:05:45Let's leave this to all

2:05:47accept all data, which means that it

2:05:47sends everything. And now, let's say I

2:05:49do

2:05:50edit field.

2:05:52Do hello.

2:05:54I say, "My name

2:05:55is Michele."

2:05:58Let's say I do wait.

2:06:00I wait 5 seconds before we send the data

2:06:01back.

2:06:02So, let me save this. As you can see, we

2:06:04already can't activate this because it

2:06:06always runs whenever it's called. But,

2:06:08here I can then Let me name this

2:06:11hello world.

2:06:14I can now go here, and I can choose

2:06:15hello world to be the workflow that's

2:06:18executed that sent the data to be for we

2:06:20get the data back. So, in this case, if

2:06:22I execute it, I can see that it's

2:06:23running

2:06:24because it takes 5 seconds, of course. I

2:06:25mean, we have this step right here, and

2:06:27then it waits 5 seconds, and then sends

2:06:28it back.

2:06:29I go here, I can see that we have the

2:06:30data back, which is My name is Michele.

2:06:32So, this right here, what it did is that

2:06:33it sent the data to the workflow, and

2:06:35then got it back, and now I can move on

2:06:37to the next steps.

2:06:38If I go here, I can see that executions.

2:06:40So, this was successful, and then it

2:06:41sent the data back. So, this is great

2:06:43when you're building automations because

2:06:44of the fact that when you build a linear

2:06:46workflow, which means that it follows a

2:06:47very specific process, and it's just one

2:06:48line, you can't actually add more

2:06:50automations here unless you actually

2:06:51call them, right? So, in this case, this

2:06:53sort of acts as an AI agent, um which is

2:06:56similar to make.com's AI agent in the

2:06:57sense that it actually calls workflows,

2:07:00uh predefined workflows, and it gets the

2:07:02data back. All right. So, the next hack

2:07:03is actually using a loop over items. So,

2:07:05in this case, we have an automation that

2:07:06starts with a list of YouTube channels.

2:07:08It then lists all the videos and it

2:07:09scripts the comments from these videos

2:07:10in order for us to actually be able to

2:07:12know exactly what people want and in

2:07:14order for us to have a database full of

2:07:15content ideas and hooks and outlines

2:07:17that we can use to generate content for

2:07:19us. By the way, if you want to watch a

2:07:20full video, check it out right here. And

2:07:21so, right here, when we go to Apify,

2:07:23Apify is scraping all the comments. But,

2:07:25in this case, it gives us 505 comments,

2:07:27which we then have to send to AI. Now,

2:07:29typically with AI, it doesn't actually

2:07:31take in or in this case, ChatGPT, it

2:07:33can't take so much context. It can't

2:07:34take everything at once. Because the way

2:07:36that N8N works is that we have different

2:07:38items. So, in this case, it's 505 items,

2:07:41which are different comments in this

2:07:42case.

2:07:43Right? Different comments. This will run

2:07:45through all the different comments at

2:07:46once. And so, what we do here is

2:07:48actually use a loop over items, which I

2:07:49can find

2:07:50right here. Loop over items. Split in

2:07:52batches.

2:07:53And we tell it, "Hey, only send 50

2:07:55through

2:07:56until and run this whole thing until

2:07:58here,

2:07:59and then send it back." So, we use this

2:08:01right here

2:08:02to loop it all back until we get the

2:08:04other 50, and we get the other 50, and

2:08:06the other 50 until the 505 is finished.

2:08:09This is great because we're sort of

2:08:10splitting the automation up into

2:08:12different items so that the automation

2:08:14can run the first step, go back, run set

2:08:18amount of items. In this case, it's 50.

2:08:19It can be 30. It can be 100, 150. Um

2:08:22but, in this case, we want to keep it at

2:08:2250 so that AI is actually able to uh to

2:08:25cover all of those. All right. So, the

2:08:26next hack is actually within testing AI

2:08:28agents because whenever you want to test

2:08:30any agent, you assume that you need to

2:08:32get have an input. There has to be an

2:08:33input for the agent to think through

2:08:34what you just asked it and then give you

2:08:35an answer back. But, what if I wanted to

2:08:37test only this part, and I didn't want

2:08:38to chat with it every single time in

2:08:40order for it to actually run? Well, in

2:08:41this case, let's say I do hello.

2:08:43You see how now, because of the input,

2:08:45it then does its thing. If I go here, I

2:08:47can now pin the data so I don't have to

2:08:49keep chatting to it every single time in

2:08:50order for the actual agent to run. But,

2:08:52bear in mind the data that goes through

2:08:54the input will be the chat input, which

2:08:56is hello.

2:08:57Another hack that you can do is actually

2:08:58press this button right here, so you can

2:09:00manipulate the input. In this case,

2:09:01let's do how's the weather

2:09:04in Rome?

2:09:06And save it. So, now the input changed,

2:09:08and that's what it's going to be fed

2:09:09into the agent every single time. So, if

2:09:11I go here, I cannot only test this step

2:09:14because this is pinned. I don't have to

2:09:15chat with it every single time, which

2:09:17makes testing so much easier. The next

2:09:19hack is actually something that I was

2:09:20wondering when I was building AI agents

2:09:21myself because I thought, "Okay, we we

2:09:23chat with it on N8N right here, but what

2:09:25if I want to activate this to a client?"

2:09:28Right? Do I have to always use Telegram

2:09:29or WhatsApp or Slack, whatever it is?

2:09:31Can't I just use something inside of

2:09:33N8N, a link that someone can use for a

2:09:34chatbot? Well, the answer is yes.

2:09:36Because if I go here,

2:09:38and I go to make chat publicly

2:09:40available, if I copy this, and by the

2:09:42way, you have to activate that scenario

2:09:43first, so you have to activate this.

2:09:45Activated.

2:09:46And I paste this in the web. Now, I can

2:09:48actually chat to the AI agents. If I

2:09:50say, "Hello."

2:09:52What it will do is that it will think

2:09:53through the AI agents. So, if I go back

2:09:55here, I go to executions, I can now see

2:09:58that we just chatted with, and the input

2:10:00was hello, right? And and so, you can

2:10:03actually chat to this. This would be the

2:10:04link that you share with the client

2:10:06whenever they have to talk to it, or

2:10:07whenever you have to talk to it as a way

2:10:09to have a personal assistant without

2:10:10having to rely on Telegram or Slack or

2:10:11WhatsApp, whatever it is. So, the next

2:10:13hack is actually being able to connect

2:10:14an AI agent to another AI agent. So,

2:10:16let's say I go to tool, and I go to

2:10:18agent AI agent tool, I can now see that

2:10:20I have the a possibility to connect the

2:10:22AI agent to another AI agent right here.

2:10:24This right here is an example of a

2:10:26workflow, an assistant that I built that

2:10:28uses this exact feature of calling

2:10:30sub-agents within the main agent. Sort

2:10:32of like this is the CEO of the company,

2:10:34and these are the head of departments,

2:10:36and the head of departments talk to the

2:10:37employees which actually do the exact

2:10:38task. But, this is great because

2:10:40previously we actually had to make an AI

2:10:42agent somewhere else, and then be able

2:10:43to call it on a different workflow, and

2:10:45then send the data back. But, in this

2:10:46case, we can all do it in the same

2:10:47place. And again, the way to set it up

2:10:49is to go to tool, put the AI agent tool,

2:10:51and then you can simply do the same

2:10:52thing that you do here. You can put a

2:10:53chat model. In this case, let's do

2:10:55OpenAI.

2:10:57You can do the memory. This is this

2:10:58here. And now you connect it to any tool

2:11:00that you want, right? In this case, it

2:11:01can be whatever. It can be Gmail

2:11:03here, and so on.

2:11:05And the way to actually know whether it

2:11:06sends it here is to be able to give it a

2:11:08prompt.

2:11:10You tell it, "Hey, only execute this, or

2:11:12this is the data that you're going to

2:11:13get, and do XYZ."

2:11:14Just like a general agent would. All

2:11:16right. So, the next hack is actually

2:11:17prompting the AI agent in a very

2:11:19specific way. So, if I go here, I know

2:11:21that every AI agent has a system

2:11:22message, which is a message or prompt

2:11:24that we tell the AI agent whenever we

2:11:26want to give it instructions. So,

2:11:27typically the way they would look is we

2:11:28have

2:11:30overview,

2:11:31which is an overview of what it needs to

2:11:32do. Then we have tools. And the way the

2:11:34reason why we actually use these

2:11:36hashtags is to give it a It's called

2:11:38markdown formatting. So, this is heading

2:11:39two, this is heading one, this is

2:11:41heading three. In this case, we can

2:11:42leave it at heading two.

2:11:44And then we also have rules.

2:11:46And something that people don't even put

2:11:47whenever they're using AI agents. Let's

2:11:49say the AI agent was connected to a

2:11:50calendar, and we say, "Hey, can you make

2:11:52an event for tomorrow?"

2:11:53How does it know today's date? Well,

2:11:55that's the thing about AI because it

2:11:56doesn't actually remember today's date.

2:11:57Let me show you. So, if I go here, and I

2:11:59have no prompt in this case,

2:12:02and I ask it, "Hey,

2:12:04what's today's date?"

2:12:08You see that it says, "Hey, today's date

2:12:09is April 27th, 2024." Well, today is

2:12:11actually 4th of September, 2025. So, we

2:12:14know that AI is actually not that good

2:12:15remembering dates, which is crucial

2:12:17because usually we have tools like

2:12:19Google Calendar or Gmail, and when we

2:12:21have to say different dates, let's say

2:12:23we say, "Hey, send a meeting for

2:12:24tomorrow." or "Schedule a meeting for

2:12:26next week." We want to be able for the

2:12:27AI agent to know when today's date is so

2:12:29that it can contextualize it when we say

2:12:31it tomorrow or next week, whatever it

2:12:32is. So, to actually fix that, we go here

2:12:34to the system message.

2:12:36We say,

2:12:37"Today's date." This is going to be at

2:12:39the end of the each prompt. So, we have

2:12:40the overview, we have the rules, tools,

2:12:41and all that stuff. And then we say,

2:12:42"Today's date." Then you put curly

2:12:44bracket, curly bracket, you put a nest

2:12:45dollar,

2:12:46and then you put now right here. Now,

2:12:48this right here is going to be fed into

2:12:50the AI agent every single time as an

2:12:51extra so that it remembers today's date.

2:12:53So, now if I ask it,

2:12:55"Hey,

2:12:56what is today's date?"

2:12:59Because it knows the date, it can say

2:13:01September 4th, 2025. So, this makes a

2:13:02difference because again, when you have

2:13:04calendar tools, you want to know exactly

2:13:05when today's date is to be able to

2:13:06contextualize it for next week or next

2:13:08month, or whatever. All right. So, the

2:13:09next hack is actually using a GPT that

2:13:12Chris Roberts, I don't know who he is,

2:13:13uh but he made a GPT that actually works

2:13:15pretty well when you want to debug or

2:13:17need help with automations. Now, I

2:13:18mentioned that you can go and talk to

2:13:19the AI right here, the AI assistant,

2:13:21which pulls from the community, which

2:13:23pulls from from different places, which

2:13:24is amazing, but it doesn't actually

2:13:26solve everything. So, in this case, I

2:13:28use this GPT, I give it a picture,

2:13:30whatever it is, some sort of voice, even

2:13:31if you want to ask it, "Hey, I want to

2:13:32build this automation." It actually does

2:13:34a pretty good job. Now, I'm going to

2:13:35leave the link down below. Again, this

2:13:37is not mine. I'm not affiliated with

2:13:38anything here. I actually genuinely use

2:13:40this, and I think this is actually

2:13:41pretty good GPT. All right. So, the next

2:13:42hack is actually within the HTTP request

2:13:44and the way that we actually set up

2:13:45APIs. So, sometimes when we want to add

2:13:48an app, let's say I go to on app event,

2:13:50and I want to look for an app, but it's

2:13:51not here. I then have to go to Google

2:13:53and search up the app name, the software

2:13:55name. Let's say ClickUp, and we search

2:13:56up ClickUp API documentation. And we get

2:13:59on this page. Now, this page is an API

2:14:00documentation. It's a very follows a

2:14:02very standard way of that it looks. We

2:14:05have different requests, we have the

2:14:06summary of the request, and then we have

2:14:07something called a curl. And this curl

2:14:09right here is something that previously

2:14:10we had to manually paste into the HTTP

2:14:12request because we have the URL, which

2:14:14in this case is the one here.

2:14:17We have the headers, which is the one

2:14:19here.

2:14:20Send headers.

2:14:21Uh and we have the body in this case,

2:14:22which is not here. But, now we can

2:14:25actually copy this, and we can go back

2:14:26here, and we can import curl, we can

2:14:28paste this, and we can import it.

2:14:30So, then now we don't have to know

2:14:31exactly where things have to go at each

2:14:33time. We can just worry about sending

2:14:35the data that we actually need to send,

2:14:36and not setting things up on HTTP

2:14:37request. Now, one more thing is that a

2:14:39lot of the times when you have to use a

2:14:40software like ClickUp or other softwares

2:14:42as well, we have to use something called

2:14:43an API key. Now, this is a key that we

2:14:46use to say, "Hey, this is my access

2:14:48token. This is my password. You can

2:14:50access it." Right? And most of the

2:14:52times, the way that we actually use API

2:14:53keys is by adding them here. So, we do

2:14:55API key, and this is not always

2:14:57standard. And then we have to put some

2:14:59long code that, you know, signifies a

2:15:02password. But, in this case, instead of

2:15:04putting it here every single time, or

2:15:05here, you can go to generic credential

2:15:06type, we then can go to bearer off right

2:15:09here,

2:15:10and we can create a new credential. In

2:15:11this case, it can be the actual API key

2:15:14that you're using

2:15:15right here.

2:15:16And now you can name it whatever you

2:15:17want.

2:15:19ClickUp.

2:15:20Let's save.

2:15:21And now you're able to actually access

2:15:23the API key every single time, or the

2:15:24HTTP request is able to access the API

2:15:27key here. Uh and whenever you have to

2:15:28use ClickUp, all you have to go is here.

2:15:30You can use ClickUp, and you don't have

2:15:31to re-add the API key here. Now, the

2:15:34next hack is actually batching. So, a

2:15:36lot of the times when we do HTTP request

2:15:37to a server, uh the server actually has

2:15:40limits. So, let's say Airtable has a

2:15:41limit of I think it was 100 requests per

2:15:44minute or something like that, and the

2:15:45HTTP request sometimes can go over that.

2:15:47So, for us to actually limit the amount

2:15:49of requests that we send to the server

2:15:51for a amount of time, we can go down

2:15:52here,

2:15:53add options, we can go to batching, and

2:15:55now we can add we only want to send 50

2:15:57items per this interval. In this case,

2:15:59it's 1 second. 50 items per 1 second.

2:16:02And so, you have to obviously look at

2:16:03the limit uh the API limit of that the

2:16:06platform has, but this allows us to be

2:16:07more flexible and navigate errors

2:16:10because a lot of the times we know

2:16:11there's errors when we send too many

2:16:12requests to the to the actual platform

2:16:14cuz they have a restriction. And in this

2:16:15case, we say, "Hey, only send 50 through

2:16:17at once every second." And we can change

2:16:19this. This can be 10 10 million, right?

2:16:22Whatever it is that you want to do, and

2:16:24you can change the time from it, you can

2:16:25change the amount of items that will go

2:16:26through the API request at each time.

2:16:29All right. So, the next hack is actually

2:16:30within error handling itself. Uh now,

2:16:32let's say we had a workflow that looked

2:16:33like this. We have the schedule trigger

2:16:34which runs every 10 seconds, and then we

2:16:36have a HTTP request that we're calling.

2:16:38In this case, it's my website, so if I

2:16:40execute this step, this gives me the

2:16:41whole code. But, let's say now I

2:16:43activated this,

2:16:44which runs every 10 seconds. So, now

2:16:45it's calling the API every 10 seconds,

2:16:47and I wanted to Let's say I changed

2:16:49something like this, or added some more

2:16:50stuff here. And I press save. So, we can

2:16:52see here that we got an error

2:16:54because of the fact that again, we put

2:16:56an invalid URL, and this is not work.

2:16:58Now, the good thing about error handling

2:16:59is that we have debug and error chain,

2:17:00we have go back to the same data before

2:17:02that I showed you.

2:17:03We also have something called an error

2:17:05workflow. And this just means that

2:17:06whenever a workflow stops working

2:17:08because there's an error, we call or we

2:17:10send the data to another workflow to

2:17:11then do whatever it needs to do. But,

2:17:13let me show you exactly cuz it it makes

2:17:14much more sense once I show you. All

2:17:16right. If I go here, another workflow,

2:17:18the personal,

2:17:20I can add

2:17:21something called an error trigger.

2:17:24So, this error trigger basically works

2:17:26so that it receives all the errors from

2:17:28any workflow that you connect it to, and

2:17:30then it does whatever. So, let's say I

2:17:31do Gmail,

2:17:33and I want to send myself an email

2:17:34whenever I receive an error from any

2:17:35workflow. Okay, so now I'm going to

2:17:36email right here. There was an error in

2:17:38the workflow. Let me do

2:17:40uh exclamation mark. Go here, I can

2:17:41press save. Now, if I go back to the

2:17:43original automation, I have to go to

2:17:46settings

2:17:47right here,

2:17:48and then I have to go to error workflow

2:17:49so to notify the error. So, in this

2:17:51case, let me name this

2:17:53error

2:17:54right? So, I know that it is this

2:17:55workflow right here. And now I can

2:17:56choose the workflow to send the data to

2:17:58when it errors. In this case, it will be

2:18:00error, as you can see here, and I press

2:18:01save. Now, let's execute this every 5

2:18:04seconds.

2:18:07And I press save. Let me press active.

2:18:10So, this right here should now, when it

2:18:12executes, it's going to error up again,

2:18:14like here, as you can see.

2:18:16There is a every 5 seconds. And if I go

2:18:18here, I can see in the executions that

2:18:20this was successful as in it's getting

2:18:21the data because it there was an error

2:18:23in the workflow. If I go to my email,

2:18:26I can now see that I have a bunch of

2:18:27emails saying there's an error, there's

2:18:28an error, there's an error. Now, this is

2:18:29great because Let me actually turn this

2:18:30off cuz I don't want a bunch of emails

2:18:32here.

2:18:34This is great when you have different

2:18:35automations. So, we have a bunch of

2:18:37automations. Let's say we have 10 or 20

2:18:38within the workspace. We all connected

2:18:41this, we all connect all the different

2:18:42automations to the error trigger so that

2:18:44we know exactly every single time, and

2:18:46it does the same thing.

2:18:48Right? Which is amazing because then we

2:18:49have everything centralized, and we have

2:18:50everything within one workflow to be

2:18:52able to notify us when there's an error.

2:18:54I said the next hack is actually called

2:18:56a human in the loop. So, let's say I had

2:18:57a simple automation like this. I can go

2:18:58here, [clears throat]

2:18:59I can go go to human in the loop, and

2:19:00this is across multiple different

2:19:03platforms. So, let's say I use Gmail and

2:19:04I SMS out the email and I execute

2:19:06previous nodes. This is an example. In

2:19:08this case, there's an error, so I can't

2:19:10do that, but I'll say hello.

2:19:12I say this.

2:19:14Hello.

2:19:16How's it going? Let's say I pull

2:19:17something from before, previous step.

2:19:20And then we have the response step,

2:19:21which is essentially saying, "Hey, when

2:19:22I send you the email for you to to check

2:19:24or something, submit something, do you

2:19:26want it to be an approval so you can

2:19:27approve or disapprove? Do you want it to

2:19:29be free text so you can actually give me

2:19:30feedback, or do you want it to be a

2:19:31custom form?" So, in this case, let's do

2:19:33approval.

2:19:34Let's say I

2:19:36already sent the email.

2:19:38I can get this and I can approve right

2:19:40here. And this sends the data back right

2:19:41here. And then we got the approval. I

2:19:43approved equals true. And now, this is

2:19:45great in case you're building

2:19:45automations like these. And by the way,

2:19:48this is a human in the loop AI sales

2:19:49agent that basically starts with the

2:19:51form, right? Let me execute it actually

2:19:52to show you. Uh which has different

2:19:55fields. So, James, email, company name,

2:19:57intent, budget, project description, and

2:19:58timeline. Let me talk to we add it to

2:20:00the sheet. We talk to the sales agent to

2:20:02make a sales email, which then is being

2:20:03sent to us for us to say, "Hey, approve

2:20:06or deny." Or actually get feedback. Then

2:20:08when we give it feedback, the text

2:20:09classifier classifies whether this is

2:20:11good feedback or bad feedback. If it's

2:20:12negative, then it uses feedback to

2:20:14rewrite the email, and it goes through

2:20:15the whole thing over and over again

2:20:16until we give it a positive feedback

2:20:18saying, "Hey, all good." And then it

2:20:20actually sends the email to the lead.

2:20:25Hey, so in this video, I'm going to show

2:20:26you exactly how you can set up your own

2:20:27Google credentials so you can connect

2:20:28with Gmail, Google Drive, and Google

2:20:30Docs to N8N and get going right away.

2:20:32Let's step in. All right, so if I go to

2:20:34N8N right here, I can see that if I go

2:20:36to Google Sheets and I want to connect

2:20:38my Google Sheets to N8N, I can see that

2:20:40I can simply just sign in with Google.

2:20:41If I press this button, it will take me

2:20:42to this page. I can choose an account.

2:20:45I will then press continue.

2:20:47And the connection is successful. Now,

2:20:48this is great because N8N previously did

2:20:51not have this, but now they implemented

2:20:52this so you only have to sign in with

2:20:53Google. This is the same exact case when

2:20:55you want to sign in with Gmail. I'm

2:20:56going to go here, create a new

2:20:58credential, and you can sign in with

2:20:59Google. This is the exact same process,

2:21:01and it's amazing because it allows us to

2:21:02not have to do any authorization or

2:21:04anything like that. We just have to

2:21:05press the button, choose the account,

2:21:06and that's it. But now, if I go to

2:21:09Google Drive right here,

2:21:11I can see that I want to press create a

2:21:13new credential, I have to add the client

2:21:15ID and client secret. So, how is it that

2:21:18we have to do this?

2:21:19And if I go to Google Docs,

2:21:21I can see that it's pretty much the

2:21:22same. So, if I go here,

2:21:23create a new credential, I have to add

2:21:25the client ID and client secret as well.

2:21:27So, in order for us to

2:21:29generate the client ID and client

2:21:30secret, let me go here.

2:21:32I have to go to the documentation.

2:21:35I have to scroll down.

2:21:37The first step is create a Google Cloud

2:21:38Console project. So, I have to go log in

2:21:40to Google Console Cloud or Google Cloud

2:21:42Console. I have to go right here on the

2:21:44top, and I have to press new project.

2:21:48You want to name the project. In this

2:21:49case, we can name it Google Auth

2:21:51tutorial.

2:21:54There it is. I'm going to press create.

2:21:56And now, the project is actually

2:21:58creating for you. I'm going to press

2:22:00right here, select project, and you know

2:22:01that you're in the right project when on

2:22:03the top left, you can see the Google

2:22:04Auth tutorial.

2:22:06Now, the first thing you want to do,

2:22:07you're going to go to API and services.

2:22:10And you want to search up for the apps,

2:22:11for the softwares that you actually want

2:22:12to connect your automations to. So, in

2:22:14this case, if I go back to N8N, I can

2:22:16see that I want to connect my Google

2:22:16Drive, but also my Google Docs. The

2:22:18first step I have to do is search up

2:22:20Google Drive.

2:22:22Google Drive API.

2:22:24And I want to enable this.

2:22:26It's the same here. Let's enable the API

2:22:27so we can use it in the automation.

2:22:30All right, cool. So, you have to do the

2:22:32same and want to do the exact same for

2:22:34Google Docs.

2:22:36Press Google Docs.

2:22:39Google Docs API.

2:22:40I press here.

2:22:43And you want to enable this.

2:22:45Amazing. So, now that we have both APIs

2:22:47enabled, all we have to do is go to

2:22:49OAuth consent screen.

2:22:52We have to get started.

2:22:55Put the app name, so let's do test N8N.

2:22:58User support email, this will be your

2:22:59email. Next, you can put external.

2:23:03Just fine.

2:23:04The email address, put your email

2:23:05address for mine.

2:23:08For next, agree, continue, and create.

2:23:11All right, so once this is done, we can

2:23:13go here to create OAuth client.

2:23:16This will take us to this page, and we

2:23:18can choose the application. In this

2:23:19case, it will be web application. Then

2:23:21the client can be let's do killer test.

2:23:25Now, it's asking us for two different

2:23:26things. It's asking us, do we want to

2:23:28add an authorized JavaScript origins or

2:23:30authorized redirect URIs? So, this right

2:23:33here, we leave blank, but if I go back

2:23:34to N8N, I can see that they said in

2:23:36Google Drive, it used the URL above when

2:23:38prompted to enter an OAuth callback or

2:23:39redirect URL.

2:23:41So, what we want to do here is want to

2:23:42copy this URL, go back to the OAuth

2:23:45client ID, and you want to add it to the

2:23:47authorized redirect URLs.

2:23:49Press add URLs. I'm going to paste this,

2:23:51and you want to press create.

2:23:54Once this is done, we have the client

2:23:55ID. Make sure to not share the client ID

2:23:57with anyone uh because this is

2:23:59confidential. I'm going to press this,

2:24:00copy, go back,

2:24:03paste it here,

2:24:04and now we have the client ID. To get

2:24:06the client secret, all we have to do is

2:24:07go back here.

2:24:08Press okay.

2:24:10I'm going to go here to make it test.

2:24:12The client secret will be this one right

2:24:14here, client secret. I'm going to copy

2:24:15this.

2:24:17You want to now go here, client secret,

2:24:20and you'll see the option to sign in

2:24:21with Google. So, let's say I sign in

2:24:22with Google.

2:24:24This will give me this option. I can

2:24:25press the account that I have, but now

2:24:27it will block me. Access blocked. N8N

2:24:29Cloud does not have complete Google

2:24:30verification process. So, once we get

2:24:32this, we know that we have to publish

2:24:34the app. So, to do this, I can go to

2:24:36audience.

2:24:37I can go to publish app.

2:24:39Confirm.

2:24:41Now, the app is published. So, we can

2:24:43then go back to N8N.

2:24:45Sign in with Google.

2:24:48Choose the account.

2:24:50It will send me to this page. I can go

2:24:51to advanced right here.

2:24:53I can go to n8n.cloud.

2:24:56And now, I can select all the different

2:24:58things that we want to do. In this case,

2:24:59it's edit, view, and create.

2:25:01I can continue.

2:25:03And the connection is successful.

2:25:05I can see that the connection is

2:25:06created.

2:25:07Go here. Select connection.

2:25:10And I can press save.

2:25:12If I go here, let's say I want to create

2:25:14a file from text. Let's say I say hello.

2:25:18I press execute step. I can see that now

2:25:20the connection was successful.

2:25:22I go back to Google Docs.

2:25:24We have to pretty much do the same

2:25:25thing. So, in this case, I can create a

2:25:26new credential.

2:25:27Go here.

2:25:28You can go to clients.

2:25:30Make it a test. Well, actually, we can

2:25:32copy the client ID from here. So, copy

2:25:33this.

2:25:34Paste it here.

2:25:37Go back. Go to the

2:25:38software,

2:25:39the account. In this case, you can copy

2:25:41the client secret again.

2:25:43And you can paste this.

2:25:45Now, we can sign in with Google.

2:25:47Go here.

2:25:49Advanced.

2:25:51Go to n8n.cloud.

2:25:53Select the different things you want to

2:25:54do. Continue.

2:25:56And the connection is successful.

2:25:58Go back. I can name it.

2:26:00Save.

2:26:02Now, if I want to, let's say, create a

2:26:03document for my drive. Folder name is an

2:26:05invoice N8N. Now, I press say I say I

2:26:08can go to execute step.

2:26:10Now, the step is executed. And we can

2:26:12see that everything works fine. So far,

2:26:13you've built a solid foundation. You

2:26:15know exactly how to connect apps, how

2:26:17automations actually work, how to use

2:26:19webhooks, and how to clean up data. But

2:26:21automations can only get you so far. The

2:26:23real magic is when you build automations

2:26:26and pair them up with AI. So, in the

2:26:27next module, we'll dive into the hottest

2:26:29topic of N8N, which is AI agents. You'll

2:26:32learn exactly what they are, how you can

2:26:34use them, what is the difference between

2:26:35an AI agent and a workflow, and finally,

2:26:38how you can start building it from

2:26:39scratch inside of N8N. And this is where

2:26:41your automation doesn't just turn into a

2:26:43simple workflow, but turns into a

2:26:45virtual employee. With that being said,

2:26:47let's dive in.

Module 3

2:26:54If you're someone who's been finally

2:26:55wanting to understand AI agents, but

2:26:57you're getting lost in all the technical

2:26:59terms, and you're getting way too

2:27:00overwhelmed, well, this video is for

2:27:02you. Because I'm going to be breaking

2:27:03down the fundamentals of AI agents as if

2:27:06I'm teaching it to a five-year-old

2:27:07>> [music]

2:27:07>> so you finally understand what this

2:27:09whole hype is about. All right, so we're

2:27:10going to cover the fundamentals of AI

2:27:12agents and the different types of AI

2:27:13agents. And by the way, if you want to

2:27:15see the difference between AI agents and

2:27:16workflows, check out this video up here.

2:27:18Um but this is the simplistic version of

2:27:21what an AI agent does. We have an input

2:27:24and we have an output. Between the input

2:27:25and the output, there's an agent,

2:27:27there's someone who is prompted with

2:27:29instructions. So, he has instructions

2:27:31saying, "Hey, you have to do XYZ if this

2:27:32happens." And the AI agent, so the

2:27:35actual thing, the the boss, uh which has

2:27:38instructions, is connected to its brain,

2:27:40and its brain is AI, so ChatGPT or

2:27:42Claude or Gemini,

2:27:44and it has a memory because as a normal

2:27:46human, you remember the previous

2:27:47conversations, so you have this context.

2:27:49And then, it has tools. So, these are

2:27:52the different things that it uses to

2:27:54take action on something. So, in this

2:27:55case, let's do an example. If the input

2:27:58is send an email, what it will do is

2:27:59that it will think through all the

2:28:01system prompt instructions that it was

2:28:02given saying, "Hey, if the user says

2:28:04send an email, then call then use the

2:28:07tool, which is Gmail." And that's how

2:28:08the logic usually goes. And so, if you

2:28:10have multiple tools, then the AI agent

2:28:12is able to take actions on multiple

2:28:15softwares, which means that it has

2:28:17actions, it can send emails, it could

2:28:18also schedule calendar events, it can

2:28:20get calendar events. It all depends on

2:28:22the different tools that you connected

2:28:23to the AI agent that now it's able to

2:28:25take action. Okay? So, input, send

2:28:28something or do something, whatever it

2:28:29is, agent will think through what it

2:28:31needs to do with its brain, which is

2:28:33ChatGPT or Claude or whatever it is. It

2:28:35remembers the conversation, and then it

2:28:37takes action on what we told it to do

2:28:40based on the tool that is connected to.

2:28:41And then, it will give us the output,

2:28:43which is, "Yeah, everything was good.

2:28:44You're good to go." And the beautiful

2:28:45thing about this is that one AI agent

2:28:48can be connected to five to 10 different

2:28:49tools. So, one input can lead in a

2:28:52series of outputs. It can lead to

2:28:54multiple actions in multiple softwares.

2:28:56Now, what does an AI agent actually look

2:28:58like? We're going to use N8N as an

2:28:59example just because it is the the

2:29:01widely known AI agent feature. But, the

2:29:04way that it looks like is we have a

2:29:06chat, which is the input. So, this is

2:29:07the thing that goes into the AI agent.

2:29:09In this case, you can chat to it using

2:29:11the native N8N chat node, which looks

2:29:13like this.

2:29:14You can say hello, right? Um

2:29:18you can also use Telegram.

2:29:19Telegram is sort of like a like a

2:29:20WhatsApp. You can use Gmail, so it can

2:29:23send conversations to the AI agent using

2:29:25email.

2:29:26And now, the information will pass

2:29:28through

2:29:29all the way to the AI agent. So, this

2:29:31line means that it the information goes

2:29:32through to here. Now, this is where the

2:29:35agent is prompted. So, if I go in here,

2:29:38this AI agent is consisted of three

2:29:39different things. The first one is the

2:29:41source for prompt. So, prompt is

2:29:43basically saying, "Hey, what is the

2:29:44thing that we're actually giving the AI

2:29:46agent for it to do?" Right? What is what

2:29:47is this thing? What is the input? What

2:29:49is the chat? What is the email? And so,

2:29:51we connect this So, we say connected

2:29:53chat trigger node because currently the

2:29:55AI agent is connected to the chat

2:29:57trigger node. This is what it's called.

2:30:00And then, the prompt user prompt

2:30:01message, which is what is the thing

2:30:02that's going inside. In this case, it

2:30:04would be the JSON chat input because

2:30:07this is the thing that's going through

2:30:08here. Let me show you an example.

2:30:10Let me disconnect this.

2:30:14There we go.

2:30:15Let me go here. Let me say, "Hello."

2:30:18And now, the information will pass

2:30:19through to here. Now, it gives an error

2:30:22because this AI agent must be connected

2:30:24to an AI in order to think through. But,

2:30:27you can now see that the chat input,

2:30:30which is this one, is hello.

2:30:32Is the input that we gave it.

2:30:34Now, the second thing here is the system

2:30:37message. So, the system message is the

2:30:39instructions that we give it. So, sort

2:30:41of like you have an employee, and you

2:30:42tell the employee, "Hey, if this

2:30:43happens, call this. If that happens,

2:30:45call this." You're training them on what

2:30:47they're meant to do. Now, usually when

2:30:49it comes to the prompts or the the

2:30:50instructions that we give to the AI

2:30:52agent, it consists of an overview. So,

2:30:55saying, "Here, we're a helpful

2:30:55intelligent XYZ assistant that does

2:30:57XYZ."

2:30:58And then, the tools. Now, the tools, you

2:31:00basically explain the different

2:31:02softwares that are connected to the AI

2:31:03agent. So, it has context as to what it

2:31:06can do, what tool it can do, what

2:31:07software it can uh it can take action on

2:31:10based on the ones that are connected to

2:31:12it. And then, we have rules, which are

2:31:14different rules. So, it can be when a

2:31:15task requires using one or more tools,

2:31:17make sure to identify which tool is the

2:31:19most appropriate, pass along the

2:31:20relevant details, and execute the

2:31:22actions needed to complete the task.

2:31:25So, these are different rules that we

2:31:26tell the AI agent to make sure that the

2:31:27quality of output is increasing. Because

2:31:29sometimes, with the fact that it's AI,

2:31:32it can hallucinate. It can make up some

2:31:34stuff. It can do its own thing, and we

2:31:36basically want to restrict it to doing

2:31:38only the things that we want it to do.

2:31:39So again, we have overview, tools, and

2:31:41rules. And then, we also give it the

2:31:43date and time because let's say we tell

2:31:45it, "Hey, can you tell John that we have

2:31:46a meeting tomorrow?" Well, the thing

2:31:48about AI is that it's not the best at

2:31:49remembering dates. So, we always want to

2:31:51give it a date, which in this case, you

2:31:54can simply do by

2:31:55putting curly bracket, and then put now.

2:31:58Right? So, now it will give it today's

2:31:59date, and then we format it in a way

2:32:01where it looks like this.

2:32:03Right? Which is good.

2:32:04And now, the AI agent will always have a

2:32:06dynamic variable. So, it will always

2:32:08have this, which changes every single

2:32:10day based on what day it is. And it uses

2:32:12that as context

2:32:13when taking the action that it needs to

2:32:15take. Now, obviously, this is not used

2:32:16always, but when it makes a calendar

2:32:18event, when it sends an email asking for

2:32:20a specific time, uh this is very very

2:32:22useful.

2:32:23So, again, we have the chat input, and

2:32:24then we have the system prompt, which is

2:32:26the instructions that we give to the AI

2:32:27agent when it needs to take action on

2:32:29something.

2:32:30Then, [snorts] we have the LLM plus

2:32:31memory. The chat model here is the brain

2:32:34of the AI agent. Now, I can

2:32:36connect this to the model, right? So,

2:32:38this is the um the line that allows the

2:32:40AI agent to then pass through the input

2:32:42to its brain using its instructions and

2:32:45actually think. And in order for us to

2:32:48actually connect the AI agent to OpenAI,

2:32:50all we have to do is go here, create a

2:32:52new credential, and you want to go to

2:32:54platform.openai.com.

2:32:57Log in.

2:32:58You can go to dashboard.

2:33:00You can go to API keys. And we're

2:33:02basically making a password that N8N AI

2:33:04agents can use when actually thinking

2:33:06through its LLM. LLM just means ChatGPT

2:33:09or Claude

2:33:10uh in actually thinking through the

2:33:11instructions. So, you can press this

2:33:12button. You can say AI agent.

2:33:16Create a secret key.

2:33:17And make sure to copy this,

2:33:20which we'll then paste right here.

2:33:23And then, you can call this AI agent

2:33:25test

2:33:273rd October.

2:33:29Press save. And bear in mind that this

2:33:30is not free, so you would have to go to

2:33:32your profile,

2:33:34and you would have to go to billing

2:33:36uh right here, and make sure to add some

2:33:37money because AI requires you to have

2:33:40credits, and credits require money, uh

2:33:42but it is very very cheap when we're

2:33:43talking about a few cents per execution.

2:33:46All right. So, now that we connected AI,

2:33:48we have ChatGPT as the brain. All we

2:33:50have to do now is connect the model.

2:33:52Right? So, we're choosing the model that

2:33:54the AI agent uses when it's thinking

2:33:56through what it needs to do. So, now

2:33:57that we have AI connected to it, let's

2:33:59actually chat to it. Let's say, "Hello."

2:34:02And now, you can see is that the input

2:34:03went here. What it did is that it

2:34:05automatically talked to its brain, which

2:34:08is in this case, it's OpenAI, and then

2:34:10it gave us an answer. So, the answer in

2:34:11this case is, "Hello, how can I assist

2:34:13you?"

2:34:14And this is as if we're talking to the

2:34:15actual ChatGPT interface on ChatGPT, but

2:34:18we're connecting it using the API

2:34:20version. So, the automatic version.

2:34:22Now, we have memory. Now, memory right

2:34:24here is when the AI agent when you want

2:34:27the AI agent to remember previous steps

2:34:29or conversations

2:34:31uh when you're doing something. So, this

2:34:33is useful when you're basically creating

2:34:35a draft in email to John, and then um

2:34:38the AI agent already knows who John is,

2:34:39and you say, "Can you also schedule

2:34:41calendar event?" So, now it has context

2:34:43as to who John is for them be able to

2:34:45take the next action without you having

2:34:47to state who John is in the first place.

2:34:49But, on a simple term, I can say,

2:34:50"Hello.

2:34:51How are you?"

2:34:54And now, I can also ask it, "What did I

2:34:56just

2:34:58ask you?"

2:34:59If I ask this, I can now get the answer,

2:35:01which is

2:35:02probably, "Hello, how are you? Uh you

2:35:04asked me, 'Hello, how are you? How can I

2:35:05assist you today?'" Now, as you can see

2:35:06here, the logs, these are the different

2:35:08steps that the AI agent took in order to

2:35:10get to the output. Right? So, in this

2:35:12case, what it did is that the AI agent

2:35:14went through the simple memory. So, it

2:35:16remembered exactly the conversation that

2:35:18I had using the context.

2:35:20Then, it uses AI to think through its uh

2:35:23instructions, and then what it did is

2:35:25that it used the memory tool again to

2:35:27give us the actual answer. All right.

2:35:28So, now that we have the LLM connected

2:35:30to this and the memory, this tool right

2:35:32here, so this is how the AI agent

2:35:34actually takes action.

2:35:35And we can connect this to Gmail and

2:35:37calendar. And inside the Gmail, we set a

2:35:39series of instructions and different

2:35:41details to allow the AI to define what

2:35:44the subject line is, what the message

2:35:45is, and who are we sending the email to.

2:35:47And same thing with the calendar.

2:35:49This is going to be another tool that

2:35:51the AI agent has access to in order to

2:35:52take actions for us.

2:35:54And we give it the before and after of

2:35:56the event that we want to schedule, or

2:35:58in this case, we want to get the event.

2:36:00Um and now, if I speak to the AI agent,

2:36:02this is prompted. If I go here, this is

2:36:04prompted with the two different tools.

2:36:06So, Gmail will be used to draft an

2:36:08email.

2:36:09Uh calendar will be used to get calendar

2:36:11events. Right? So, it knows exactly when

2:36:13to use each tool. And when I say,

2:36:16"Hey, can you send an email?"

2:36:20This should now send back

2:36:21or should ask me who I'm sending the

2:36:23email to.

2:36:24I say, "Hey, I can help you draft an

2:36:25email. Can you provide me with the

2:36:26details of the email, such as the

2:36:28recipient email address, the subject

2:36:29line, and the message you'd like to

2:36:30include?" So, I said, "Send an email to

2:36:32Mikkel uh at work t at gmail.com saying

2:36:35we have dinner tomorrow."

2:36:37What this will now do is that it will

2:36:38take action on the draft. As you can

2:36:40see, it just called the tool. So, it

2:36:41just sent a signal to the tool saying,

2:36:42"Hey, I just got received instructions

2:36:44to do XYZ. Can you do it?" As you can

2:36:46see, we went through step by step right

2:36:48here. And now, it says we have drafted

2:36:50the email to Mikkel. So, if I go to my

2:36:52email right here, I can see in the

2:36:53drafts that we have dinner tomorrow to

2:36:55this person right here. Obviously, you

2:36:57can improve the prompt to make the email

2:36:58actually more contextual or

2:37:00I guess more sauce in the email, but

2:37:02just know that it called the exact tool

2:37:05that we wanted to call to take the

2:37:07action that we wanted to take. Right?

2:37:09Without us having to go to the Gmail

2:37:10tool. And it did it within seconds. Now,

2:37:12for my calendar, let's do an event um

2:37:14lunch,

2:37:16and let's do

2:37:17dinner.

2:37:19Right? We have one on Friday and one on

2:37:20Sunday. If I go to N8N, let me ask it,

2:37:23"Can you grab the events

2:37:25from this week,

2:37:27please?"

2:37:29What this will now do is it will go

2:37:30here. It will think through what it

2:37:31needs to do. It will then call the

2:37:32appropriate tool to then give us an

2:37:34answer back, which should give us lunch

2:37:36and dinner.

2:37:37Um as you can see here, we have Q&A with

2:37:39Shaz, which is something that I did

2:37:40before, lunch, and dinner as well.

2:37:43Because these were the three events we

2:37:44have. Q&A with Shaz, lunch, and dinner.

2:37:48And that's how fundamentally a simple

2:37:49version of an AI agent looks like. It's

2:37:51connected to an input. It thinks through

2:37:53its LLM uh cuz that's how it's its brain

2:37:55works. It It remembers the

2:37:56conversations, and it takes action on

2:37:59the the things that we want it to do

2:38:00using different softwares. Now, this is

2:38:02called a simple AI agent. Now, we can

2:38:04get onto the multi-step AI agent. So,

2:38:06this is an AI agent that is connected to

2:38:08more AI agents and more tools. Right? As

2:38:11you can see, it's more complex than just

2:38:13a simple walk-through. And by the way,

2:38:14if you want to see the full walk-through

2:38:15of this AI agent, check out this video

2:38:17up here. But, essentially, the way that

2:38:19this works is that we have an input, and

2:38:21we have an output. This is always the

2:38:23case with AI agents. It doesn't change.

2:38:25Now, the only difference here is that we

2:38:27still have the system prompt

2:38:28instruction. This is still the exact

2:38:30same. Uh it still has a brain, which is

2:38:32LLM. It still has a memory.

2:38:34But, the only um change is that we're

2:38:35not calling tools

2:38:37as a first step. We're calling other

2:38:38agents in the first step. So,

2:38:40fundamentally, this is why.

2:38:42Because the most important thing here

2:38:43that matters it's not so much the tools,

2:38:46it's the prompt that we give the AI

2:38:47agents. Because the prompt is the

2:38:48instructions.

2:38:49>> [music]

2:38:49>> And so, if we instruct an AI agent to

2:38:52take action on 55 different tools like

2:38:55these,

2:38:56well, the chances that it would actually

2:38:57succeed are pretty low even though we

2:38:59have the best prompt in the world

2:39:01because of the fact that

2:39:04it being non-deterministic, right? It

2:39:06can fail, right? Cuz it's AI. And so,

2:39:08what we do here is you want to minimize

2:39:10the failure rate of an AI agent. So,

2:39:12what we do is we add more AI agents. And

2:39:14so, the way to think about this use case

2:39:16is as if you have a company. So, a

2:39:18company, right, will be the customer,

2:39:20which is the input. It then tells the

2:39:22the CEO, "Hey, can you can you maybe

2:39:25check the finances that we have in our

2:39:26company?" And now the CEO is presented

2:39:29with head of departments. So, in this

2:39:30case, we have the head of calendar, head

2:39:31of email, head of blogs, and head of

2:39:33contacts.

2:39:35And the head of contacts and blog and

2:39:37email and calendar have access to tools

2:39:39which are employees,

2:39:40right? And so, why do we have head of

2:39:42departments and not just have employees

2:39:44connected to the CEO? Because if the CEO

2:39:46had access to 100 employees and he was

2:39:48given a task from his client, it would

2:39:50be hard for him to know exactly who to

2:39:52assign it to. He would get it wrong on

2:39:53most of the time, or some of the time.

2:39:55And so, when we want to minimize errors,

2:39:57we want to assign a head of department

2:40:00for that specific role and let him

2:40:02figure out who to give it only for the

2:40:04employees in his department, right? So,

2:40:06the tools are only connected to the

2:40:07calendar agent for the calendar tools.

2:40:09Same thing with emails, blogs, and

2:40:11contacts as well. And so, what ends up

2:40:13happening here is that we have a big AI

2:40:15agent and all of these are subset of

2:40:18this. So, this is one, which is the same

2:40:20thing as this. This is one, which is the

2:40:22same thing as this. This and this as

2:40:23well. The only difference is that the

2:40:25memory is only connected to the main AI

2:40:27agent.

2:40:28And so, here we have Telegram, which is

2:40:30the input. So, we can give it a voice

2:40:31message or even a text. All right, so

2:40:33here we have Telegram, which is the

2:40:35input. And we have the whole AI agent.

2:40:37And let's say now I wanted to uh send an

2:40:40email

2:40:41and schedule a calendar event.

2:40:44As you can see, we also have the contact

2:40:46agent, which in this case we instruct

2:40:48the main agent to always look at the

2:40:49contact agent before sending the email

2:40:51and before making the calendar event

2:40:53because this contains the detail of the

2:40:54person that we're doing all this for. As

2:40:56you can see here, the contact database

2:40:57consists of Michael James, John Laurie,

2:40:59and James Low. So, we can first run

2:41:01this.

2:41:02So, now it's waiting for the messages to

2:41:03come through.

2:41:05And now with Telegram, we can say, "Send

2:41:07an email to Michael James uh telling him

2:41:09that we have dinner tomorrow at 5:00

2:41:10p.m. And can you also put that on the

2:41:12calendar and invite him as well?" Um

2:41:14yeah, that's it. All right, so now we

2:41:15give it an input. Let's press enter.

2:41:17What this will now do is it will then go

2:41:19to the AI agent, it will then talk to

2:41:21the contact agent because we instructed

2:41:23it to use the contact agent first before

2:41:25doing anything else.

2:41:26And now it will take action on the

2:41:27email.

2:41:28As you can see, it used this tool, which

2:41:29is send an email, and then it sent it to

2:41:31calendar agent at the same time to

2:41:33create an event. Now, if I go to my

2:41:35email right here, I can see that I have

2:41:36dinner tomorrow.

2:41:37Yeah, dinner tomorrow at 5:00 p.m. And

2:41:39my calendar, I can see that I should

2:41:41have dinner with Michael James at 4:00

2:41:43to 5:00 p.m. And it also invited his

2:41:46email as well,

2:41:47which is nuts. So, why is this any

2:41:50different from the previous one? Well,

2:41:52this is a very very simplistic version

2:41:54of an AI agent, whilst this is more

2:41:56advanced, has more features, and it

2:41:59breaks down the different steps step by

2:42:01step, right? As I mentioned, we have the

2:42:02CEO and we have the head of departments.

2:42:04And the head of departments are

2:42:05connected to different tools. And these

2:42:06tools are employees, right? Instead of

2:42:08giving all the employees and hooking

2:42:10them all up to this tool. Because then

2:42:12it will overwhelm the AI agent. It has

2:42:14to way too many options. The prompt will

2:42:15be way too big. And so, we basically

2:42:17want to construct it or deconstruct it

2:42:20and break it apart for it to actually

2:42:21have room for thinking when it's taking

2:42:24the action that it needs to take. And

2:42:25so, this is really really powerful

2:42:26because just by having this one input,

2:42:29it can lead to what over over 10, 12

2:42:33actions, right? Which is nuts, which is

2:42:35why AI agents are really really powerful

2:42:38when you want to have something that's

2:42:39autonomous. That's what they say it's

2:42:41your virtual employee because your

2:42:43virtual employee in this case is

2:42:44connected to different tools, which are

2:42:46different actions, and it can do

2:42:47different things for you. But bear in

2:42:49mind that if you want the AI agent to do

2:42:50more things than you have right now,

2:42:53then you have to connect it to more

2:42:54tools and more softwares, right?

2:42:56And what I always think about when I'm

2:42:58building AI agents is

2:42:59that we never want to overwhelm the the

2:43:01AI agent, right? Because if you give it

2:43:03a prompt that's super super long, it's

2:43:05still AI, right? Like there's no 100%

2:43:07fact or no 100% um

2:43:09guarantee that it will always do the

2:43:10same thing, and which is great, which is

2:43:12fine when you're testing, but when

2:43:13you're putting it into an actual

2:43:14business, like the margin for error

2:43:16needs to be very very very very small.

2:43:18I'm talking like 0.0001%

2:43:20>> [music]

2:43:20>> chance it fails. Uh because it's in

2:43:22production mode, businesses need to

2:43:24actually operate, and so you don't want

2:43:26something that sometimes work, that most

2:43:28times works. You want something that

2:43:29pretty much all the time works. By

2:43:31pretty much, I mean like 99.99% of the

2:43:33time works. Um but there's still

2:43:35obviously that that thing of like AI not

2:43:36being able to do everything, right? But

2:43:39it's great that we can now chat to it

2:43:40and it can now take action on everything

2:43:42that we want. So, this right here is the

2:43:43fundamentals of AI agents. Let me show

2:43:45you another example of AI agents and

2:43:46where these can come from. I can simply

2:43:48go to ChatGPT and I can just search up

2:43:50agent mode. So, agents are pretty much

2:43:52everywhere because a lot of these

2:43:53software tools, they're implementing

2:43:55these sort of autonomous systems where

2:43:57you can just say,

2:43:58"Can you

2:44:00go to Google

2:44:02and find the top five marketing agencies

2:44:06in

2:44:07Ontario, Canada?" And just by this

2:44:09prompt right here, what it does is that

2:44:11it thinks through. So, it thinks through

2:44:13the actual task, and then it takes

2:44:15action on the thing that we told it to

2:44:16do. So, now it's thinking,

2:44:18which is the exact same with As in, it

2:44:20has a brain that it thinks through. So,

2:44:22as you can see now, it's cross-checking,

2:44:23it's doing a ton of research uh for us.

2:44:26And the good thing is that we can see it

2:44:27live what it's doing, which is amazing.

2:44:29And one step above of this is I can

2:44:31actually take actions on our softwares.

2:44:34>> [music]

2:44:34>> So, this right here is obviously going

2:44:35to Google on its own, but we can say,

2:44:37"Hey, go to my Notion and create a

2:44:38task." Or go here and do something else.

2:44:40All right, as you can see here, we got

2:44:41the different agencies, the location,

2:44:43the key specialties, and the evidence as

2:44:44well with all the different sources

2:44:47and the summary as well,

2:44:48which is crazy. As in, we gave it a

2:44:50simple prompt, "Can you go to Google and

2:44:52find the top five marketing agencies in

2:44:53Ontario, Canada?" This is something that

2:44:54you give to an employee,

2:44:56and it just did it for 2 minutes. And it

2:44:58did a ton of research as well.

2:45:00All right, so that's exactly why AI

2:45:01agents are so powerful because whether

2:45:02it's ChatGPT, whether it's Any AI

2:45:05agents, whether it's Relevans, whether

2:45:06it's Lovable, whether it's Gemini

2:45:07Canvas, right? Like we all have

2:45:09different uh the AI agent fundamentals

2:45:11don't change.

2:45:12They don't change because they all have

2:45:13an input, they all have an output, and

2:45:15the middle part is the thing that really

2:45:17drives the value because it takes action

2:45:19on us without us having to be so

2:45:21explicit with the instructions or with

2:45:23the input that we give it. If you're

2:45:24enjoying this course so far, then you're

2:45:25going to love the community that we have

2:45:27right here, which is the AI Automation

2:45:29Circle. It's a space with over 3,000

2:45:31individuals or legends looking to learn

2:45:34AI automations from zero either to apply

2:45:37it in their own business or start

2:45:38selling it to businesses or start their

2:45:41AI automation agency. People introduce

2:45:42themselves every single day, they ask

2:45:44questions, they share wins. We have

2:45:46unlimited tech support, we have all the

2:45:48YouTube resources, and people looking

2:45:49for jobs and partnerships. And if I go

2:45:51to classroom, we also have a AI

2:45:53Automations 101 course, which is a mini

2:45:55course on AI automations, very similar

2:45:57to this one, but that dives deeper into

2:45:59more frameworks that we use when we're

2:46:01applying automations to businesses. We

2:46:03have templates vault, which is a library

2:46:05of all the different automations that we

2:46:07built so far on YouTube, as well as the

2:46:09blueprints as well. We have weekly

2:46:11recordings because we have two calls a

2:46:12week, and you have all the recordings

2:46:14here, and you also have over $20,000 in

2:46:16discounts with softwares across no-code

2:46:19automations, across project management,

2:46:21across AI tools, across marketing, LLM,

2:46:24and other tools as well. As I said, you

2:46:25have two calls a week, and our members

2:46:27are spread out everywhere in the world,

2:46:29which is literally awesome to see. If

2:46:31you want to join, check the second link

2:46:32down below.

2:46:36So, in this video, I'm going to show you

2:46:37step-by-step everything that you need to

2:46:39know about building your first AI agent

2:46:41on Any. So, today you're not just

2:46:43watching me build it, but I'm walking

2:46:44you through my thinking, showing you the

2:46:45shortcuts and the mistakes. So, by the

2:46:47end, you'll be able to build your own AI

2:46:49agent with confidence. Let's dive in.

2:46:51All right, so before we get to the

2:46:52actual build and showing you Any, on a

2:46:54high level, what an AI agent is

2:46:56something that has an input and has an

2:46:58output. In between the input and the

2:46:59output, it does a series of actions. So,

2:47:01for example, the input could be, "Can

2:47:03you draft an email?" Right, you send

2:47:04that input over to the AI agent, which

2:47:07has instructions, has a system prompt,

2:47:10and based on what you tell it, so let's

2:47:11say draft an email like I mentioned, it

2:47:13consults with the brain and LLM based on

2:47:15the instructions it was given, "Okay, he

2:47:17just told me to draft an email, um what

2:47:19do we do?" And then based on the

2:47:20instructions and based on what it has to

2:47:22do, so for example, if he says draft an

2:47:23email, then talk to Gmail. If he says

2:47:26check all the calendar events, talk to

2:47:27Google Calendar, right? Based on the

2:47:29obviously the instruction it was given,

2:47:30it will then talk to the tools. It will

2:47:31send a request to the right tool that it

2:47:33needs. In this case, it will be Gmail if

2:47:35it has to be draft an email. So, it will

2:47:36send a request to tools, to Gmail, and

2:47:39then from the Gmail, it will get a

2:47:40response, which would be like, "Hey,

2:47:41200," which means successful, and it

2:47:43will then give us the output, which is,

2:47:45"Hey, it was all good. I was drafted.

2:47:47Check your inbox or whatever," right?

2:47:48So, input, output, uh system prompts,

2:47:50instructions that we tell it every

2:47:51single time like, "Hey, if this happens,

2:47:53do this. If that happens, do that."

2:47:54Brain LLM is essentially what the AI

2:47:57agent is using to think, right? The

2:47:59OpenAI or Claude or whatever it is. And

2:48:01then the memory itself basically is

2:48:03important because it actually remembers

2:48:05the previous questions that we asked it.

2:48:06So, let's say the first question is,

2:48:07"How are you?" Then we ask it, "Hey, uh

2:48:09can you draft an email for me?" On the

2:48:11third try, we ask it, "Hey, what did I

2:48:12ask you on the first on the first

2:48:13question?" It will remember because it

2:48:15has a context window. That's what we

2:48:16call it. That's what the memory is. So,

2:48:18input is, "Hey, can you do this?" AI

2:48:20agent thinks through the instructions

2:48:21that we will give it through the system

2:48:22prompt. It will then talk to the AI

2:48:24because that's how it thinks, that's his

2:48:25brain. And then it will use any tool

2:48:28that is connected to it that it needs to

2:48:30use for that specific task. It also has

2:48:32a context window. And it will give us

2:48:33the output. Okay, so that's on a high

2:48:34level what an AI agent is. So, the first

2:48:36step to building an AI agent is going to

2:48:38n8n and pressing sign in. You'll have to

2:48:40make an account. There is a free

2:48:41account, but I believe it's 14 days free

2:48:43trial. So, after 14 days you're going to

2:48:44have to pay. That's the way they have it

2:48:45set up. Not really a big fan. Much

2:48:47rather have Zapier or make a account.

2:48:48Definitely has a free plan to start.

2:48:50But, um n8n right here, you will come to

2:48:52this page when you sign up. All you have

2:48:53to do is press open instance.

2:48:56And you'll come to this page right here.

2:48:57Now, this page is essentially the

2:48:58dashboard of n8n. This is what n8n looks

2:49:00like. Uh right here on the left-hand

2:49:01side you get to see home, personal,

2:49:02which is in case you want to divide

2:49:04different things in different folders.

2:49:05Uh you have your different automations

2:49:07here, credentials, executions. Uh these

2:49:10are some different metrics that they

2:49:11track. Um just you know exactly what

2:49:13you're doing within your workspace. And

2:49:14then, right here, this is where you want

2:49:16to press create workflow because this is

2:49:18the canvas for n8n. This is where

2:49:20everything starts. The automation starts

2:49:21here.

2:49:22On [snorts] the down hand side, we have

2:49:23this right here where we can basically

2:49:25move the automation around. We have

2:49:26zoom, we have um zoom out. We have go

2:49:30back, we have basically if the

2:49:32automation's here, it brings it all back

2:49:33to the center. So, that's what this

2:49:34button does. It's tidy tidy up here,

2:49:36which also has keyboard shortcuts. Then

2:49:38we go to editor right here, which is

2:49:39where you can edit the automation,

2:49:41executions, where you can see all the

2:49:42different executions that you've done.

2:49:44So, execution just means you run the

2:49:46automation from start to the end. You

2:49:48can see all the executions here. And

2:49:49then, evaluations is just for some

2:49:50testing. I don't use it that much, so

2:49:52don't worry you worry about that. Then

2:49:53you have this button right here where if

2:49:54you toggle this on, it will activate the

2:49:56automation. And what it means is that

2:49:58when you build an automation from start

2:49:59to the end, um you can activate it so

2:50:01you don't have to run it once every

2:50:02single time. Right, it's production. It

2:50:04happens every single time without you

2:50:05having to go to n8n.

2:50:06>> [clears throat]

2:50:07>> Then share, you can share, save, you can

2:50:08save the automation. Then right here,

2:50:09you can actually download the

2:50:11automation. Uh and you can import from

2:50:13file. So, let's say I download this

2:50:14automation, I then give it to you and

2:50:17you import it into your own n8n, you'll

2:50:18have the automation done for you and you

2:50:20don't have to worry about it. So, that's

2:50:21how n8n automations and n8n workflows

2:50:23really work. Then, right here you can

2:50:24see that you have plus, which is

2:50:25basically where you can add the

2:50:28different steps to the automation.

2:50:30Then we have this right here, which is

2:50:32add sticky notes in case you want to add

2:50:33sticky notes right here. And you want to

2:50:36sort of walk you through. That's good

2:50:37for documentation in case you're

2:50:38building an automation, you want to

2:50:39explain to someone who hasn't really

2:50:41seen the automation how it works, you

2:50:42can just put sticky notes here.

2:50:44And then here, you can have the side

2:50:46panel. And then here, you also have the

2:50:47AI assistant, which is one of the best

2:50:49I've seen so far uh within n8n. Um and

2:50:51it actually answers most of the

2:50:52technical questions that you have. All

2:50:53right, cool. So, now that we got through

2:50:55all the part, let's start with adding

2:50:56the first step. So, this right here is a

2:50:57node. Like this square right here is a

2:50:59node.

2:51:00When we press on this node, we get this

2:51:02panel right here. Now, in order for us

2:51:03to build an n8n agent, we ideally want

2:51:05to talk to the agent itself, right? We

2:51:07want to chat with it. So, the trigger it

2:51:09basically means what's the first thing

2:51:10that actually starts the workflow? Like

2:51:12what is that thing that activates, that

2:51:14starts everything? So, in this case we

2:51:15can trigger manually, which means that

2:51:16you can, let's say you go here, you can

2:51:18execute workflow, which means that it

2:51:19starts the automation. And this just

2:51:21executes the automation, starts the

2:51:23automation from scratch. But, this isn't

2:51:25really best for us when using an AI

2:51:27agent because we have to trigger

2:51:29manually every single time.

2:51:31Then we have on app event, uh on a

2:51:33schedule, which means you can run it

2:51:34every day or every hour. This is based

2:51:35on apps. Then we have a webhook here,

2:51:37which is where you can use webhooks to

2:51:39get notified. We can use a form, we can

2:51:41use when executed by another workflow,

2:51:43and then we can have chat message or

2:51:45running evaluation and other ways as

2:51:46well. Now, for AI agents specifically,

2:51:48we're going to use on chat message,

2:51:49which means that you can actually talk

2:51:50to the AI agent itself. So, let's say I

2:51:52open the chat, I can then start talking.

2:51:54This is basically what's going to start

2:51:56the automation. So, let's say again, I

2:51:57just put hello,

2:51:59it will start the automation. So, the

2:52:00node executed successfully. This means

2:52:02everything was good. And you can see the

2:52:03green mark, which means that

2:52:04everything's good. All right. So, in

2:52:06order for us to then connect this chat

2:52:08message because ideally we want to talk

2:52:09to the AI agent. We don't just want to

2:52:10talk to n8n, right? We want something

2:52:12out of it. We want to press plus.

2:52:14And then,

2:52:16we have different options here. Now, the

2:52:17options are AI, which is what we're

2:52:19going to use, action in apps, so you can

2:52:20actually scroll through all the apps

2:52:22here and you can add any apps here. Data

2:52:24transformation, flow, core, human in the

2:52:26loop, and another trigger, which are

2:52:27cool things that you actually can use.

2:52:28But, for the sake of this video and AI

2:52:30agents, we're not going to go into that.

2:52:31But, let's say we press AI.

2:52:33We then have different options. We want

2:52:35to press AI agent. Now, you can simply

2:52:37talk to Anthropic, which is Claude. You

2:52:38can talk to OpenAI individually or

2:52:40Gemini. But, for this case, the AI agent

2:52:43uh node is exactly what we want.

2:52:45So, when we press the AI agent node, uh

2:52:48which is obviously the node is just a

2:52:49square, this thing will come up. Now,

2:52:51the way that n8n is actually set up,

2:52:52which is probably one of the best

2:52:53platforms that I've seen,

2:52:55they have the input here, which is the

2:52:57steps from the previous

2:52:59so, the variables or the things, the

2:53:00output from the previous step. Then

2:53:02here, so this is the input. Then we have

2:53:04here the configuration of the AI agent.

2:53:05This is how we set everything up. And

2:53:07then here is the output. So, what is the

2:53:09output of the AI agent? So, going here,

2:53:11we have, again, by the diagram that I

2:53:12showed you at the start, you have three

2:53:14different things that you have to

2:53:15connect the AI agent to. The first one

2:53:16is a chat model. So, what chat model, so

2:53:19in this case what LLM, OpenAI, Claude,

2:53:20whatever it is, uh do you want to

2:53:22connect the AI agents to? What memory do

2:53:24you want to connect it to? And what

2:53:25tools do you want to connect it to? So,

2:53:27in this case, for chat model, I can just

2:53:28press plus.

2:53:30I can then have a choice of few future

2:53:33models. In this case, we just go safe

2:53:34with OpenAI. So, I can go here, OpenAI

2:53:36chat model.

2:53:37You'll have this page. All you have to

2:53:39do to actually connect the OpenAI chat

2:53:41model is go here to credentials.

2:53:44Create a new credential. Now, in order

2:53:45for us to actually connect OpenAI to

2:53:47n8n, we need an API key. Now, API keys

2:53:50API stands for application programming

2:53:52interface. It's the way that a lot of

2:53:53softwares talk to each other or how

2:53:54softwares talk to each other. Uh and the

2:53:56key itself allows us to authorize that

2:53:58this is our account and we can actually

2:54:00use it. So, in order for us to get the

2:54:01API key, all we have to do is open the

2:54:03docs. You can simply talk to the the AI

2:54:05assistant in n8n. But, in this case we

2:54:07can just press open docs. This will open

2:54:09the documentation for n8n, which is

2:54:12where we can look at this. Now,

2:54:14it says refer to the OpenAI API

2:54:16documentation. Uh API keys Okay. So, all

2:54:19you have to do is log in to OpenAI

2:54:20account, which is essentially platform

2:54:23.the openai.com.

2:54:26You'll have to make an account. So, sign

2:54:27in with Google. And by the way, just

2:54:29because you pay for ChatGPT, does not

2:54:30mean that you can use this. Different

2:54:32things, right? Different things. One is

2:54:34for the web and one is for APIs. So,

2:54:36once you log in, you'll have you'll come

2:54:37on this page. All you have to go to is

2:54:39dashboard. On the left-hand side, you

2:54:41have to go to API keys. And this is

2:54:42where we can create a secret key.

2:54:44So, go here.

2:54:45Let's do test YouTube.

2:54:49And I can create a key. So, leave this

2:54:50all here, owned by me, all restrictions.

2:54:52Project is fine. Let's create a secret

2:54:54key.

2:54:55I want to copy it

2:54:58and then paste it in n8n right here.

2:55:01Paste it here.

2:55:02And if I press save,

2:55:04this will save.

2:55:05Right, connection tested successfully.

2:55:07So, now the OpenAI is actually connected

2:55:09to this. Now, for the model itself, I

2:55:11want to leave this to GPT-4.1.

2:55:13You can use a bunch of models. Now, bear

2:55:15in mind that not all models work with AI

2:55:16agents. They might work with a normal AI

2:55:18node that you can use AI in the process

2:55:21for a workflow. But, for AI agents, not

2:55:22all of them work. So, in this case,

2:55:23leave this as GPT-4.1 mini. Uh and then

2:55:26we go. Okay. So, in this case, now we

2:55:28connected the OpenAI chat model to the

2:55:29AI agent. And then we go on to memory.

2:55:31Now, memory is basically saying what

2:55:32memory do you want to implement in the

2:55:34AI agent so that it remembers the

2:55:36conversation that we're having. So, if I

2:55:37press simple memory right here, you'll

2:55:39have you'll come on this page and you

2:55:41have the session ID, which just leave

2:55:43this as this because we want it to

2:55:44connect to the chat trigger node. Uh the

2:55:46session key from previous node, leave

2:55:48this as is. You don't need to modify

2:55:49this. Well, I mean, we can't in the

2:55:50first place. And then it's asking us for

2:55:52the context window length. Now, the

2:55:54context window length just means how

2:55:55many past interactions does the model

2:55:57receive as context? Now, what does this

2:55:59actually mean? Let's say we say hello

2:56:00and then it says, "Hello, how are you?"

2:56:03Good. That's four different uh

2:56:05interactions that we've had, right? So,

2:56:06four different things, four different

2:56:08messages uh as a total. So, you want to

2:56:09make sure that the context window is a

2:56:11bit larger in in cases where you want

2:56:13the AI to actually remember the previous

2:56:15conversation, in case you want to change

2:56:17some things. Um so, that's what the

2:56:18context window length is for. Now, I

2:56:20want to leave this at five just to keep

2:56:21it simple. Again, don't change any of

2:56:23these, just put five here and that's all

2:56:24good. And now the AI agent can actually

2:56:26have a memory. And then we have tools

2:56:28itself. Like tools are essentially

2:56:30softwares that we connect to the AI

2:56:32agent so when we say draft an email, it

2:56:35will go to the software and actually do

2:56:36it. But, it needs to be connected to the

2:56:37software in the first place. So, for

2:56:39today,

2:56:40let's uh let's make an AI agent that can

2:56:43draft an email and that can get calendar

2:56:45events. I think that's the pretty the

2:56:47most straightforward one. So, all we

2:56:48have to do is to connect the tool is

2:56:50first, for email, we have to connect

2:56:51Gmail. And for calendar, we have to

2:56:52connect Google Calendar.

2:56:54So, we press plus.

2:56:56And now it's going to ask us to do

2:56:57different things. In this case, we just

2:56:59want to connect it to other tools. So,

2:57:01in this case we have a lot of

2:57:02integrations, a lot of softwares.

2:57:04We can see we have Asana, Apify, Claude,

2:57:07Airtable. In this case, let's search for

2:57:09Gmail.

2:57:10And we have Gmail tool.

2:57:12When we get to the Gmail tool, this is

2:57:13how you connect Gmail to n8n. I go here

2:57:17and I can press create a new credential.

2:57:18When I press create a new credential,

2:57:19it's very very straightforward. It used

2:57:21to be harder before. All you have to do

2:57:22now is actually just sign in with

2:57:24Google. When you sign in with Google, it

2:57:25will take you to this page right here.

2:57:27You can choose which one you want. In

2:57:28this case, let's just do this one here,

2:57:30our work email. It will say connection

2:57:32successful. Now, we can go back to n8n.

2:57:34And you can see that the account was

2:57:35connected. Now, name it whatever you

2:57:36want and that's the name in there and

2:57:38you can save it. Okay, that's how you

2:57:39connect your Gmail to n8n.

2:57:42So, once you have this, you can then put

2:57:43tool description as set automatically,

2:57:45that's fine. Then resource, let's just

2:57:46put draft because you want to draft an

2:57:49email, not actually send an email. And

2:57:51then, for operation, you can put create,

2:57:53that's fine. You're creating a draft.

2:57:55And then, for the subject and the

2:57:57message, which this is the subject of

2:57:58the email and the message of the email,

2:58:00we can press this little button right

2:58:01here, which means that we let the model

2:58:02define their favorite. So, we let the

2:58:04model say, "Hey, based on what you've

2:58:06given me, using AI, this is exactly what

2:58:09the subject line's going to be." So, in

2:58:10this case, let's just put this button

2:58:11right here, which means that the

2:58:12it will be defined automatically by the

2:58:14model. And also this button right here.

2:58:16So, that way when I tell it to draft an

2:58:17email, I don't have to tell it exactly

2:58:19what the subject line needs to be and I

2:58:20don't have to tell it what the message

2:58:22needs to be, right? Everything is just

2:58:23straightforward, it does it on its own

2:58:25based on the context that we give. Okay,

2:58:26cool. And then leave this as text. Uh

2:58:28you can use HTML, which is just a way to

2:58:30make the emails fancy. Um and that's

2:58:33fine. And then here, I think, yeah, we

2:58:35have to add to email. So, to email

2:58:36essentially, who are we sending the

2:58:38email to that we're drafting? So, in

2:58:39this case, you also want to put this

2:58:41right here, let the model define the

2:58:43parameter, because the AI agent actually

2:58:45decides or knows the email, or it's

2:58:48going to ask us the email that we need

2:58:49to draft the email for. So, it will add

2:58:51it here as well. And then we want to put

2:58:52create a draft in Gmail, that's fine.

2:58:54All right, cool. So, now we connected

2:58:55Gmail to the AI agent. Now, let's do

2:58:57calendar. So, go here, press plus,

2:58:59and look for Google Calendar.

2:59:03Google Calendar tool. To connect it, I

2:59:04already connected, you can see

2:59:05everything. But in this case, let's just

2:59:07put create a new credential.

2:59:08Sign in with Google again. Do the same

2:59:10thing we did for Gmail, and it will

2:59:11bring it all back.

2:59:13You can close it. I think, yeah. Close

2:59:15it. All right, so now that we connected

2:59:17our account, all we have to do is set

2:59:19this automatically, which is fine. The

2:59:20resource will be event.

2:59:22The operation will be get many, because

2:59:24we're getting many events. You can see

2:59:25here, you can retrieve many events from

2:59:27a calendar, which is exactly what we

2:59:28need. The calendar, which is mine, which

2:59:30is fine. The limit will be 50, so 50

2:59:32events can be retrieved at the same

2:59:34time. And then it's asking us, what is

2:59:36the time frame before and after?

2:59:39In this case, because it's not fixed, we

2:59:41just want AI. We want to let the model

2:59:44define this, so based on what we tell

2:59:45it. So, let's say we tell it tomorrow,

2:59:47it will know that it's after yesterday.

2:59:51So, after today, sorry, after today,

2:59:52then before tomorrow or before in 2

2:59:54days, right?

2:59:55That's like the time frame between each

2:59:57one. So, that's that's thing we want to

2:59:58let the model do. All right. So, that

3:00:00right there is how you connected the

3:00:01different tools to the AI agent. So, we

3:00:03have the chat model, we have the memory,

3:00:04we have the tools, and now on to

3:00:06probably the most important part is the

3:00:07actual prompt, the system instructions

3:00:10that we tell the AI agent. So, if you go

3:00:11here, we have to add an option, which is

3:00:13the system message.

3:00:15So, the system message is essentially, I

3:00:16mean, like this example, we're telling

3:00:18the AI agent what it needs to do. So,

3:00:20for the system message, I actually have

3:00:21a structure that I use every single

3:00:22time, which is this right here. First,

3:00:25we say, you are a identity, so you are a

3:00:28helpful intelligent assistant AI agent,

3:00:31designed to handle various tasks

3:00:32efficiently. Your primary role is to

3:00:34task, so do to do the different tasks

3:00:35that we have. In this case, it's draft

3:00:36an email and get calendar events. You

3:00:38have access to how many number of tools.

3:00:40In this case, it's two, to help you

3:00:42fulfill um requests. The first tool is

3:00:45draft an email. So, what do you what

3:00:47does it do? In this case, it will draft

3:00:48an email. Second tool is calendar. In

3:00:50this case, we have to get calendar

3:00:51events. And then you say, when a task

3:00:52requires you to use one or more tools,

3:00:54make sure to identify which tool is most

3:00:56appropriate, pass along the relevant

3:00:57details, and execute the actions needed

3:00:58to complete the task. Your goal is to be

3:01:01proactive, precise, and organized in

3:01:03managing these resources to provide a

3:01:04smooth experience for the user. And then

3:01:06we say, here is the current date and

3:01:08time. Now, why do we say this? We say

3:01:09the date and time of today, because AI

3:01:11is actually not the best at guessing

3:01:13what date it is today. So, we always

3:01:15want to put this, especially when you're

3:01:16including any any times into your emails

3:01:19or any times into the calendar. Because

3:01:20if we say tomorrow,

3:01:22usually, it might mess up in knowing

3:01:24what today is, right?

3:01:26So, definitely it will get tomorrow

3:01:27wrong. All right, so this is the prompt

3:01:28that we have. Let's copy this. And by

3:01:30the way, I left all the resources down

3:01:31below, so you can copy this.

3:01:34Want to go to N and N, and then I'm

3:01:36going to delete this. I'm going to paste

3:01:37this.

3:01:38And I'm going to press this button right

3:01:39here, which basically puts everything um

3:01:41on a wider scale, so I can actually see

3:01:43it. All right, so we have identity. So,

3:01:44you are a

3:01:46helpful

3:01:51intelligent

3:01:57intelligent executive assistant. Now, AI

3:01:59agent designed to handle various tasks

3:02:00efficiently.

3:02:03Let's delete this and put

3:02:05draft emails and

3:02:08get calendar events.

3:02:11You have access to two tools.

3:02:14And then first tool is

3:02:16Gmail.

3:02:17Explanation is

3:02:19Gmail will be used

3:02:21to draft an email.

3:02:24First

3:02:25step is identify

3:02:28what email we are

3:02:31drafting the email to.

3:02:34Then understanding

3:02:38the context

3:02:40of the email.

3:02:43And then actually drafting it.

3:02:47And then second tool will be

3:02:49the calendar,

3:02:52which will be

3:02:53uh this tool

3:02:57will be used to get calendar events

3:03:02for any given time frame.

3:03:05First,

3:03:08understand

3:03:10what the time frame is, and then

3:03:13understand

3:03:15what kind

3:03:17of uh mm

3:03:19then return

3:03:22the calendar events.

3:03:27Okay? So, why am I saying what I'm

3:03:29giving extra instructions? So, I say the

3:03:30first step is this, second step is this,

3:03:32third step is this. It's because the

3:03:33only downside to an AI agent is that

3:03:35we're relying on a prompt to do things

3:03:36for us. So, for us to actually implement

3:03:38it and actually working 100% of the

3:03:40time, we want to make sure that we give

3:03:41it as clear instructions as possible.

3:03:43So, in this case,

3:03:45tools to get calendar events, and then

3:03:46we leave this as here. Okay? And we go

3:03:48here. All right, so this prompt is done.

3:03:50All right, so the AI agent is

3:03:51successfully set up.

3:03:52Right, we have the prompt, the chat

3:03:54model, the memory, so it remembers the

3:03:56conversation, the Google Calendar, which

3:03:58we can use to actually get events,

3:04:00creating a draft using Gmail, and then

3:04:01we can now actually test it. So, let's

3:04:04go here.

3:04:05Let me

3:04:06go here.

3:04:08Let me actually talk to it. Let me say,

3:04:10hello, how are you?

3:04:13It usually never likes this question.

3:04:15It will talk to the chat model. It will

3:04:16think through the things that I told it,

3:04:18and it will say, hey, he just asked me

3:04:19how I am. I'm not going to use any

3:04:21calendar events or draft, because that's

3:04:22not the instruction that was given. So,

3:04:24this is the the thing about AI agents,

3:04:25they're smart enough to understand. Let

3:04:27me ask it, so you can see the memory.

3:04:29What was the first question I asked? The

3:04:33first question you asked was, hello, how

3:04:34are you? So, you see how it remembers

3:04:35previous ones?

3:04:37That's the memory that it has. It has

3:04:38the context window, like I mentioned.

3:04:40All right, so now let's actually put

3:04:41this to test. Let's create a draft on

3:04:42the email.

3:04:44Let's say, I want to create a draft

3:04:48email draft.

3:04:52So, it will think through this. Do I

3:04:53have enough context to actually create

3:04:55the email? And then it will ask me, hey,

3:04:56the recipient email address, it needs a

3:04:58subject line, it needs the message or

3:04:59content you want to include in the

3:05:00email. So, in this case, I'm going to

3:05:01give it a email address. So, the email

3:05:03address will be my email.

3:05:05So, this is the email address right

3:05:06here. And then in the email, just say

3:05:10that I'm happy

3:05:12you

3:05:14are building automations

3:05:16on N and N.

3:05:18And that you are going

3:05:20to take over the space.

3:05:22There you go. Right, so we say this.

3:05:24What it does is that now it has enough

3:05:26context to actually draft the email. It

3:05:28will send back an email saying, hey, or

3:05:30send back a message saying, hey, I've

3:05:31created a draft for you with the message

3:05:33expressing the happiness about building

3:05:34automations in N and N and comp. So, if

3:05:36I go to my email now, right here, I can

3:05:38see that I have drafted an email saying,

3:05:40hey,

3:05:41great to see your work on N and

3:05:43automations. How many calendar I'm happy

3:05:44you're building automations on N, you're

3:05:45going to take over the space. Best

3:05:46regards.

3:05:47Right, and this was done using AI.

3:05:49I just told it to the overall context of

3:05:52the email, and it showed it did it did

3:05:54the subject line, and it did the body of

3:05:56the email, and it sent it to the email

3:05:57that I told it to.

3:05:59So, that right there is for the Gmail.

3:06:01Like, thanks.

3:06:02Thanks a lot.

3:06:05All right, so let's do the calendar

3:06:06events. So, let's say I Let's go to my

3:06:08calendar. Let's see what I have on this

3:06:09week. Okay, so this week I have

3:06:11groceries tomorrow, and then I have

3:06:12strategy session with James on the 21st.

3:06:15These are all connected to different

3:06:16accounts. So,

3:06:18if I say, theoretically, can you get all

3:06:20the calendars that I need

3:06:21for or give me all the events that I

3:06:23have on this week, it will say I have

3:06:24Outschool,

3:06:26I'll have strategy session, and I'll

3:06:27have groceries.

3:06:28Let's go here.

3:06:30So, now I'm going to ask it, can I have

3:06:33all

3:06:34of the events I have going on

3:06:37this week?

3:06:39So, now what it does is that it talks to

3:06:40the AI, goes to Google Calendar, pulls

3:06:42it back. It takes a while because I have

3:06:44three events or four. And it tells me

3:06:46every single thing. So, I have Outschool

3:06:48on August 14th, groceries on August

3:06:5019th, strategy session with James on

3:06:51August 21st,

3:06:53uh and Outschool on August 24th. Now,

3:06:55Outschool is something that I had today,

3:06:57like this morning at 1:00 a.m.,

3:06:59um which is why it tells it as well. Um

3:07:00so, that's why it says the next day.

3:07:03And it gives me all the events right

3:07:04here. Right, so I don't have to go to

3:07:05calendar. I can have an AI agent

3:07:07actually pull this for me. Now, this

3:07:08right here is a very very elementary

3:07:09example. I just wanted to show you

3:07:10exactly how you can build one step by

3:07:12step, and we only have Google Calendar,

3:07:14and we only have create a draft in

3:07:14email, but we can add hundreds of more

3:07:18softwares to this, which makes AI agents

3:07:20incredibly powerful to use for

3:07:22businesses, because it saves them the

3:07:23time to have to go to the software to

3:07:25find something, right?

3:07:27So, very very good. Now, the most

3:07:29important thing when it comes to the AI

3:07:30agent is not the tools itself, is not

3:07:31the memory or the model. It's the actual

3:07:34prompt that you tell the AI agent to do,

3:07:35because once you have 20 tools hooked

3:07:37up, right, like these, once you have 20

3:07:40or even 30 tools hooked up to the same

3:07:42AI agent, it makes it incredibly

3:07:43powerful, but it also increases the

3:07:46error or the chance that it actually

3:07:47errors out. Errors out just means that

3:07:49it doesn't do what you want it to do.

3:07:51Right, so you want to make sure that the

3:07:52prompt itself is so so like 90% of your

3:07:54time or 80% of your time should be spent

3:07:56towards the prompt. Because you saw that

3:07:57setting things up on Google Calendar and

3:07:59Gmail is actually not the hard part.

3:08:00Right, you want to make sure that what

3:08:01you tell the AI agent to do, it actually

3:08:03does it, so that's what the prompt it

3:08:04does for you. Congrats on now being able

3:08:06to understand and build your first AI

3:08:08agent inside of N and N. In the next

3:08:10section, we're actually going to make it

3:08:11smarter. We'll dive deep into how you

3:08:13can actually build high-performing,

3:08:15scalable AI agents using advanced

3:08:18frameworks and prompting techniques.

3:08:20You'll discover how you can structure AI

3:08:22agents using data tables, integrate them

3:08:24with thousands of AI models, all within

3:08:27one tool, and apply practical frameworks

3:08:29that will make them 10 times smarter.

3:08:31So, by the end you'll not only be

3:08:32building agents, but you'll build actual

3:08:34systems.

Module 4

3:08:41In this video, I'm going to show you

3:08:43eight N8N AI agent hacks that I wish I

3:08:45knew when I got started that will help

3:08:47you build AI agents at three times the

3:08:49speed and make them way more powerful.

3:08:51All right, so here we have an agent in

3:08:53N8N and the first hack is a you can

3:08:55actually chat with, but you can make the

3:08:57chat public available. Cuz tons of times

3:08:59you can actually speak to the AI agent

3:09:00like this, but what if you don't want to

3:09:02go into N8N? What happens then? Do you

3:09:04have to use Telegram? Do you have to use

3:09:06WhatsApp? Well, in this case you can

3:09:07actually get a link

3:09:08using this button right here. You can

3:09:10copy it. You can then make the actual

3:09:13agent active, which means that you can

3:09:15use it now. And if I paste it here, I

3:09:17can see that now I can actually chat to

3:09:18it as if it's a chatbot. Something that

3:09:20most people don't know because that

3:09:21hence why they connect this to a

3:09:23Telegram or something else. Well, you

3:09:24can actually just use this URL, which is

3:09:26public, that you can chat with. Say,

3:09:28"Hello."

3:09:30And this will execute, right? If I go to

3:09:32executions,

3:09:33I can see that we just executed the

3:09:35workflow.

3:09:37Right? It went here. It used the

3:09:38OpenRouter, which is the LLM, which is

3:09:40its brain, and it gave us, "Hey, how can

3:09:42I assist you today?" And let's say I

3:09:43wanted to send a message in Gmail. I

3:09:45said, "Send an email to

3:09:46michele.035@gmail.com."

3:09:48And I press go.

3:09:50So, we sent it a message.

3:09:51And now it's asking us, "Sure, what

3:09:53would you like the subject and message

3:09:55email to be?"

3:09:56As you can see here, again it ran. So,

3:09:58if I refresh,

3:10:02I can see that it ran again.

3:10:06And the input was, "Send an email to

3:10:08michele.035." And if I say that we have

3:10:12dinner tomorrow,

3:10:14I can go. This will just ask me the

3:10:15subject line because of the fact that we

3:10:17didn't prompt it, right? But let's say

3:10:19it's dinner at 7:00 p.m.

3:10:23And now you can see that the email about

3:10:24having dinner at 7:00 p.m. has been

3:10:26sent. So, if I go to my email,

3:10:29I can see that we have dinner at 7:00

3:10:31p.m. right here. All right, the second

3:10:32set of hacks is within the brain of the

3:10:35AI agent, which in this case is

3:10:36OpenRouter. And in case you want to

3:10:37watch how to connect OpenRouter to N8N,

3:10:40check out the video up here. As you can

3:10:41see here, we have all the models we can

3:10:43think of, Gwen, Grok, ChatGPT, DeepSeek,

3:10:45all that stuff. But the hacks is within

3:10:48the options. So, we have all these

3:10:50options that most people don't use

3:10:51because they have no clue what they are.

3:10:53So, the first one is frequency penalty.

3:10:55So, the frequency penalty can either go

3:10:56to, I believe, two

3:10:58and it can either go to -2, right? So,

3:11:01from -2 to 2. A lower value

3:11:04tells ChatGPT, "Hey, can you make the

3:11:06actual thing more repetitive?" Which

3:11:07means whatever you're saying, use the

3:11:09same kind of words. Whilst if I put two,

3:11:11a higher value, it's more creative. So,

3:11:14we're giving ChatGPT or the I'm saying

3:11:15ChatGPT because we're using OpenAI, but

3:11:18we're giving the brain or the AI agent

3:11:19the ability to change how repetitive it

3:11:22is with the answers that it gives us.

3:11:24Then the second one is maximum number of

3:11:26tokens. And so, a token is actually four

3:11:27characters. So, if I put a token limit

3:11:29of, let's say, 200, this would be

3:11:32roughly 800 characters. Which means that

3:11:34it will cut the actual text, the output

3:11:36that the LLM in this case gives us. This

3:11:39is great if you want to set a limit on

3:11:40the amount of words that you want the

3:11:42AI, in this case the brain, [music] to

3:11:44give you to actually save money on

3:11:46credits for the ChatGPT, Claude, Grok,

3:11:48anything like that. The next one is

3:11:50response format. So, we have text and we

3:11:52have JSON. So, usually you would have

3:11:54text, but JSON is great in case you want

3:11:56to take some sort of input and structure

3:11:58it in a way where we have variables come

3:12:01out. All right, so let's say we have a

3:12:03block of text which contains first name,

3:12:04last name, and email, right? But it's

3:12:06not structured, it's all within one

3:12:07place. We use JSON to actually structure

3:12:10it, so we can divide the first name,

3:12:12divide the last name, and divide the

3:12:13email. But usually we use text just

3:12:14because of the fact that we also have

3:12:16another hack, which allows you to do

3:12:18that structuring thing that I just told

3:12:19you about. Then we have presence

3:12:20penalty. So, instead of words, in this

3:12:23case it's the topic itself. So, if you

3:12:25put a higher number, then it's more

3:12:27creative. A lower number is more

3:12:28repetitive. Then we have sampling

3:12:30temperature. So, a lower temperature in

3:12:31this case is more predictable and the

3:12:34higher temperature is more creative. So,

3:12:35we give AI the ability to be more

3:12:37creative when giving us the output. Then

3:12:39we have timeout. So, sometimes the AI

3:12:41agent actually runs and the OpenRouter

3:12:44starts running and it doesn't work,

3:12:45right? It keeps on running and running

3:12:46and running. Maybe there's some problem

3:12:48with the server. So, what we say here is

3:12:50we say, "Hey, you have 360,000

3:12:53milliseconds, I assume?"

3:12:54Maximum amount of time request, yeah,

3:12:56milliseconds. Then we say, "Hey, you can

3:12:58only go until this long and after that

3:12:59just stop." It's just easier when you

3:13:01want to error handle. Which means that

3:13:02when something goes wrong, just stop the

3:13:04workflow when it runs past a certain

3:13:06time period. In this case it's 360,000

3:13:08milliseconds

3:13:09and we just stop. The next one is max

3:13:11retries. So, sometimes you use

3:13:13OpenRouter, the LLM, but it doesn't

3:13:14work. So, you say, "Hey, if something

3:13:16doesn't work, just try again this many

3:13:18times." So, if you put 10,

3:13:20then it will try again 10 times. Then we

3:13:22have top P. As you can see here, if I go

3:13:23hover, it says controls diversity. So,

3:13:26it's controlling the diversity of the

3:13:28output that we get from the LLM. All

3:13:29right, the next hack is actually the

3:13:31ability for AI to be able to enable a

3:13:34fallback method. So, enable a fallback

3:13:35method means that if this doesn't work,

3:13:38we can actually add a new LLM as a

3:13:40fallback, right? So, if I put OpenAI

3:13:42here, that means that it will first try

3:13:44here

3:13:45and then it will try OpenAI. So, let's

3:13:47say I go here and I add

3:13:49a fake connection.

3:13:51I do

3:13:52michele. So, just do test.

3:13:55Save. Let's do this. Test. Right, so

3:13:58this is a fake credential. It shouldn't

3:13:59work. If I go here and I chat to it,

3:14:03hello.

3:14:04What this will now do is that it will go

3:14:06here, has an error, but it will try

3:14:08again because it has a fallback LLM. And

3:14:10so, that's amazing because sometimes the

3:14:12first one doesn't work, but the second

3:14:13one does. All right, the next one is

3:14:14within the actual memory. So, if I go

3:14:16inside, I can see that we have a context

3:14:18window length. Which most people still

3:14:19have no clue what it means. What this

3:14:21means is that five this is the amount of

3:14:24past interactions. So, let's say you

3:14:26say, "Hey, how are you?" That's the

3:14:28first interaction. It responds. [music]

3:14:29Then you ask another question, which is,

3:14:31"Can you send an email to John?" And

3:14:33then, "Can you add a Google Sheet? Can

3:14:34you add XYZ?" Right? Then it will get

3:14:36the past interactions, which is your

3:14:38questions, as context for the next

3:14:41output. Right? So, if you put 10 or if

3:14:44you put 15, then it will take more

3:14:46interactions in the past that it will

3:14:48use as context. Now, why do we want to

3:14:50restrict this to about five to 10? It's

3:14:53because the more interactions, the more

3:14:56how would you put it? The more context

3:14:57you give it, the more it can pull, the

3:14:59more credits you use. And so, five I

3:15:01think is a suitable amount of

3:15:03interactions that we can use within the

3:15:05AI agent. But you can increase or you

3:15:07can decrease. The next hack is actually

3:15:08within the tools. If I go here and I put

3:15:11think,

3:15:12I can see that I have a think tool,

3:15:13which invites the AI agent to do some

3:15:15thinking.

3:15:16So, in theory the AI agent typically

3:15:18thinks through what it needs to do using

3:15:20its prompt or its LLM. In this case it

3:15:22would be OpenRouter.

3:15:23But we give it an additional tool, the

3:15:26think tool, which allows it to think

3:15:27even more. As you can see here, we have

3:15:29a predefined prompt, which is prompt

3:15:31that we never put before. It's already

3:15:32here. Which has use a tool to think

3:15:34about something. It will not obtain new

3:15:35information or change the database, but

3:15:37just append a thought to the log. Use it

3:15:39when complex reasoning or some cash

3:15:41memory is needed. And so, this right

3:15:43here is the ultimate assistant AI agent

3:15:44that I built, which is connected to a

3:15:46contact agent, email agent, calendar

3:15:48agent, and content creation agent. And

3:15:50so, by feeding it the tool, which is the

3:15:52think tool, it gives it the ability to

3:15:55have a another step of reasoning.

3:15:57Reasoning just means to think through

3:15:58what it needs to do to then be able to

3:16:00actually take the right action in the

3:16:02right order. As opposed to not having

3:16:03this and [music] just using the prompt

3:16:05and using AI. Right? Sort of like that

3:16:07extra step. And the next hack is

3:16:09actually the ability for us to be able

3:16:11to connect AI agents within the tools.

3:16:13Cuz most times what you do is just

3:16:15connect it to the software. So, Gmail

3:16:17or you can connect it to an external

3:16:19workflow. So, you say sub-workflow.

3:16:21So, where is it? Sub

3:16:23uh workflow

3:16:25calling N8N workflow right here. Which

3:16:27basically calls another workflow to take

3:16:29action. But what if the workflow was

3:16:32inside this workflow? Right? And well,

3:16:33in this case, we have access to the

3:16:35contact agent, which is another AI

3:16:36agent, which is connected to more tools.

3:16:38And the same thing with email agent,

3:16:40calendar agent, and content creation

3:16:41agent. This gives us the ability to be

3:16:43more flexible in the

3:16:46I guess AI agents that we build and have

3:16:47that extra feature of not having to

3:16:49build another AI agent in another

3:16:51workflow and just have it all within

3:16:53here. All right, so the next one is

3:16:54actually within the tool softwares. So,

3:16:56if I go in here to send a message, we

3:16:58have to make the connection, we have to

3:16:59do set automatically the action, the

3:17:01thing that we're doing. And now we're

3:17:02introduced to three different variables

3:17:04that we have to do as an input. You can

3:17:07put your email here, you can put the

3:17:08subject line, and you can put the

3:17:10message. But because of the fact that

3:17:12it's a chatbot, so the input changes

3:17:14over time, what we can do is press this

3:17:16button right here, which lets AI in N8N

3:17:19define the input. So, it defines what

3:17:21goes in here so that you don't have to

3:17:24put it manually. Right? You give AI the

3:17:26ability to choose what goes in there as

3:17:28an input for you to do it. And this

3:17:30makes it so much easier for us to be

3:17:32able to make AI agents because all we

3:17:34have to do is literally just press this

3:17:35button

3:17:36for any parameter that comes through.

3:17:38All right, the next hack is actually the

3:17:39ability for multiple AI agents to be

3:17:41connected to the same exact model. All

3:17:44right, which you can see right here. We

3:17:45have one step right here, which is not

3:17:47an AI agent, it's just an AI step, which

3:17:49is connected to a model and we can see

3:17:51that all the AI agents are all connected

3:17:54to the same exact thing. All right, so

3:17:56the next hack is actually the ability

3:17:57for us to use the structured output

3:17:59parser, which allows us to be able to do

3:18:01the thing that I mentioned before, which

3:18:03is using JSON to take an unstructured

3:18:06input. So, it can be a block of text,

3:18:08can be whatever it is, and we structure

3:18:09it in a way where it actually makes

3:18:11sense. So, a variable. In this case we

3:18:13have a human in the loop sales agent,

3:18:15which drafts sales emails for us. So, I

3:18:17put my name, my email, my company name,

3:18:19intent, budget, project description, and

3:18:21timeline. I can press submit. And what

3:18:23this will now do is it will send it to

3:18:24the Google Sheet. It will add it there

3:18:26to our CRM. It will then talk to the

3:18:27sales agent, which will speak to, first

3:18:30of all, Claude, which is its brain, and

3:18:32then it will then speak to the

3:18:34structured output parser because that is

3:18:36a thing that is going to help it to be

3:18:38able to make the subject line and the

3:18:40body of the email, which is then going

3:18:41to be sent to our email. And if you go

3:18:43right here, I can see that this was the

3:18:46input, which is a block of text, and the

3:18:48output was the email body and the

3:18:50subject line as well. And if you're

3:18:52wondering how we wrote this, you can

3:18:54simply go to ChatGPT and ask it, "Hey,

3:18:56can you draft me a input schema using

3:18:58JSON that allows me to have a subject

3:19:01line and the email body of the email?"

3:19:03And that's exactly what you paste here,

3:19:05and that's what the AI will use to then

3:19:07give you the output that looks like this

3:19:09from an input that looks like this. So,

3:19:11that marks the end for the eight and a

3:19:1210 AI agent hacks that I wish I knew

3:19:14when I got started that makes your build

3:19:17of AI agents much faster and way more

3:19:19powerful.

3:19:23Hey, in this video, I'm going to show

3:19:24you four agentic frameworks that can

3:19:25make your AI agents inside of AnyTask

3:19:28faster, smarter, and way more scalable.

3:19:30You see, most people try to build one

3:19:31big agent that does everything, but

3:19:33that's why it breaks, it slows you down,

3:19:35and honestly, it's impossible to scale.

3:19:37So, I'm going to walk you through each

3:19:38framework step by step, show you exactly

3:19:40how it works, when to use it, but also

3:19:42when you can apply it within your

3:19:43automations. With that being said, let's

3:19:45dive in. All right, so the first

3:19:46framework is the prompt chaining. So,

3:19:48what this means is that you are using a

3:19:50AI agent, and you're prompting it in a

3:19:52chain. So, you're saying, "Hey, let's

3:19:54use the AI agent for to do this first."

3:19:56Then you chain it. Chain it just means

3:19:57you connect it to the next AI agent,

3:19:59which does another thing, and then chain

3:20:01it to another AI agent, which does

3:20:02another thing, and then you do whatever

3:20:04you have to do. All right, so this right

3:20:05here is what we call sequential

3:20:06reasoning, where each AI agent um builds

3:20:09on the previous output to refine

3:20:10accuracy and context. So, this right

3:20:12here is based on the output of this.

3:20:14This right here is based on the output

3:20:15of this, and so on. And this framework

3:20:17is great for multi reasoning, um but I

3:20:19want to show you exactly what that looks

3:20:20like. So, right here we have a form,

3:20:22which leads into the first AI agent, uh

3:20:24which writes the outline for the blog.

3:20:26Then it goes to the second AI agent,

3:20:27which looks at the outline. It evaluates

3:20:29how it is, and it changes it up. And

3:20:31then we give it to the third AI agent,

3:20:32which actually writes the blog before

3:20:34putting the blog into a Google document

3:20:36that we have access to. And so, if I go

3:20:38here to execute workflow, I can put AI

3:20:41in finance or whatever topic you want to

3:20:42talk about. I can press submit. What

3:20:44this will now do is that it will send

3:20:45the data to the first AI agent. Right,

3:20:48this is chaining prompts because we have

3:20:50one prompt here, which does its own

3:20:52output. Then it goes to the second one

3:20:54to do its second output. And then

3:20:56finally, it goes to the third AI agent,

3:20:58again, prompt chaining. We're chaining

3:21:00different prompts

3:21:01um because these are a series of

3:21:03different prompts. Right, this prompt is

3:21:04just to make the outline. This prompt is

3:21:05just to evaluate the outline. Whilst

3:21:07this prompt is to actually make the full

3:21:09blog based on the outline. Right, three

3:21:11different prompts, but we're chaining it

3:21:12together. And then finally, we will add

3:21:14it to our Google document. As you can

3:21:15see, we're finished. If I go here, this

3:21:17is the blog that we get uh with all the

3:21:19information from these different agents.

3:21:22Now, don't get too fussed about the

3:21:24actual quality of the blog. I just

3:21:25wanted to show you exactly what the

3:21:26framework is. But going inside here, for

3:21:28example, we have the same prompt. So,

3:21:29system message, this is one prompt with

3:21:32the user message because the user

3:21:33message is the thing that we actually

3:21:34give it. The system message is basically

3:21:36giving the AI agent context what it

3:21:39needs to do in general,

3:21:41which is then changed to the second

3:21:43prompt, which is a different prompt

3:21:44right here.

3:21:46Right right here with a user prompt as

3:21:48well.

3:21:49And then we have the third AI agent with

3:21:52another prompt,

3:21:53which is the one right here. And yes,

3:21:54these are very very small prompts just

3:21:56to show you an example uh with the user

3:21:57prompt as well,

3:21:59which are all chained together. And one

3:22:00main advantage to this framework as well

3:22:03is that when you prompt chain, when you

3:22:04add one step after the step after the

3:22:06step as well, it's much easier to debug.

3:22:08Debug just means that if something goes

3:22:10wrong, how can you fix it? How can you

3:22:12go there and fix it? Well, it's much

3:22:14easier here because it's a linear.

3:22:15Right, linear just means that it's one

3:22:17line. Right, this is one line. It

3:22:18doesn't go up and down. And so, when

3:22:20there's a problem, it's much easier to

3:22:21go here and fix it because you know

3:22:23exactly what step it came from. The next

3:22:25framework is called parallelization.

3:22:26It's a big fancy word, uh which

3:22:28basically means that we have multiple

3:22:30agents. So, you can have three, four,

3:22:31five, 10, 11, uh which are all working

3:22:34simultaneously, which means at the same

3:22:35time, on different tasks. Right? And so,

3:22:38let's say we have a AI agent, which

3:22:41allows us to create the LinkedIn hook,

3:22:42then the LinkedIn body, then we merge

3:22:44them, and then you send it to the final

3:22:46agent to make the final post. So, let's

3:22:48say I say, "Write a post about how AI is

3:22:50going to impact agencies." I can press

3:22:52go. And now, what this will do is that

3:22:54it will send the information to the

3:22:55first AI agent to write the hook, then

3:22:57the second AI agent to write the body,

3:22:59and then we merge them together. We put

3:23:01them all in the same paragraph, which

3:23:03then goes and feeds into the final AI

3:23:05agent to write the LinkedIn post, and

3:23:07then it gives it to us on here.

3:23:09So, our AI agency is ready to for the AI

3:23:11revolution. The tools we once to use are

3:23:13evolving fast. And it gives us the whole

3:23:15body. Again, don't look at the quality,

3:23:17just look at the fundamental theory

3:23:18behind this AI agent and how it works.

3:23:20>> [music]

3:23:20>> And

3:23:22as you can see, we have the output right

3:23:23here.

3:23:24The first output. This is the hook. Then

3:23:26we have the second output

3:23:28right here. And the way that this

3:23:29fundamentally works is that we have the

3:23:31data going here,

3:23:33and then we have also the data going

3:23:35here. But it this doesn't go through

3:23:36until

3:23:38this finishes as well because they're

3:23:39all connected to the merge node. And the

3:23:41merge node makes it so that we say,

3:23:43"Okay, cool. Go to the LinkedIn hook and

3:23:45write the LinkedIn hook, then send me

3:23:46the input, the first input, which is

3:23:48input one. Then go to the LinkedIn body

3:23:51and send me the second input. And only

3:23:52once when I have both inputs together,

3:23:55then I go to the next steps." Right,

3:23:57which is great because now we get two

3:23:59items,

3:24:00which is right here. One item and one

3:24:02item

3:24:03that we can then use the aggregate

3:24:05module or node. As you can see here by

3:24:07the diagram, is that we take multiple

3:24:09series of items and we put them all in

3:24:11in one.

3:24:12And if I go here, I can see that I have

3:24:14the output one and the output two,

3:24:16right, which is the hook and the body,

3:24:18before feeding it into the final agent

3:24:20right here to write the LinkedIn post,

3:24:22which is the output right here. Right,

3:24:24and so, we give it the output, which is

3:24:26the called an array. An array is just a

3:24:28way for us to store different pieces of

3:24:30information.

3:24:31And so, that's really how the

3:24:32parallelization works. Now, the reason

3:24:34why we would use this over the others is

3:24:36because it is faster at processing

3:24:38information.

3:24:39Um as you can see here, it goes here,

3:24:41and then it automatically goes here, not

3:24:43automatically, but in a faster way

3:24:45rather than the other frameworks. And

3:24:46then we can merge them all together

3:24:47before sending it to the agent. And it's

3:24:49very very structured in a way where we

3:24:51go to the first one, then the second

3:24:52one, then the third one, then the fourth

3:24:53one. That way you can keep track of all

3:24:54the single steps. And one more thing it

3:24:56can do is that it reduces the bias or

3:24:58error uh from a single model because we

3:25:00have these different agents giving their

3:25:03own perspective or or the output in this

3:25:04case. And this right here, typically we

3:25:07would use it for research

3:25:08uh or multi-domain inputs where speed

3:25:10and diversity matters. And the use case

3:25:12of using this type of framework is when

3:25:15we are doing research. When we're doing

3:25:17research, we typically want to split it

3:25:18up in a way where we do one sort of

3:25:20research first, then we go to the second

3:25:21one, then we go to the third one, and so

3:25:22on. So, that way you're splitting it,

3:25:24and then you're merging it all together,

3:25:26and then you're aggregating it, and then

3:25:28you're doing something else. The third

3:25:29[music] framework is called the routing

3:25:31framework. Now, this dynamically directs

3:25:32the data. So, this sends the data to the

3:25:35appropriate agent based on

3:25:37>> [music]

3:25:37>> a classifier. Let's say we receive an

3:25:39email. Then we have the step right here,

3:25:41which is classifying the email based on

3:25:43whether it's in high priority, customer

3:25:45support, promotions, or finance and

3:25:46billing. And based on the answer, so

3:25:49based on the classification of the email

3:25:50that we receive, we send it to the

3:25:52appropriate agent. We go here to the

3:25:55high priority agent, customer support

3:25:56agent, promotion, and finance as well.

3:25:58And then they can execute their own

3:26:00tasks, which means that they can do

3:26:01their own action, create their own

3:26:02emails, and so on um

3:26:04by their own. Right, and they're all

3:26:05rooted by the output that we get from

3:26:08the previous step. And so, this is great

3:26:10because it makes our AI agents and

3:26:11workflows much more adaptive, right? And

3:26:14we are only using the right model or

3:26:16logic when we have a certain use case.

3:26:19Right, so in this case, when we want to

3:26:20add a new step, all we have to do is go

3:26:22in here,

3:26:23add a category, so we can say love.

3:26:26Hello.

3:26:28And now, we have a new

3:26:30filter right here, which you can then

3:26:31add another AI agent. So, agent,

3:26:34and we have this here.

3:26:36And you can easily add more and more

3:26:37options based on the output that we get

3:26:39here. And this is great again because

3:26:41when we have

3:26:42a input

3:26:44and we want to classify the input based

3:26:46on whether it's X, Y, and Z, then we can

3:26:48have a logic that says, "Okay, if this

3:26:51is something that we send it here, if

3:26:52that is something else, then we send it

3:26:53here." And so on. And then you go

3:26:55through the logic as well. And so, let's

3:26:56say I send myself an email right here. I

3:26:58can execute the workflow. This will then

3:27:00be able to classify the email based on

3:27:02whether it's all of these. In this case,

3:27:04it saw that it's promotions. And what it

3:27:06did is that it spoke to the AI agent to

3:27:08then create the email that we can then

3:27:10have in our draft. And if I go here,

3:27:13I can see that it drafted the email back

3:27:15to the email that we got here. Of

3:27:16course, this is a spam email, not spam,

3:27:18but promotional from Wise. Um

3:27:21but as you can see, the AI agent drafted

3:27:23a very very insightful email

3:27:26um

3:27:26using the prompt. Right? And so, that's

3:27:28essentially what it does. Very very

3:27:30easy. Only use this framework really

3:27:31when you want to be able to root to the

3:27:34appropriate agent based on the input

3:27:36that we get. And the best use case that

3:27:38I can think of when it comes to this

3:27:39framework is just this, right? Getting

3:27:41emails, classifying them, and then

3:27:42sending them to the right agent uh based

3:27:44on the type of the email. The last

3:27:47framework is called the optimizer. If

3:27:48you haven't watched the full video of me

3:27:49building out this human-in-the-loop AI

3:27:51sales agent, watch it up here. But the

3:27:53way it works is that we have a form

3:27:55right here,

3:27:57which has different details that the

3:27:58customer or the lead in this case would

3:28:00fill out. So, let's say I put my name,

3:28:02email, company name. I'm looking for a

3:28:04lead generation service. My budget is

3:28:06less than a thousand. My project

3:28:07description is that we want a system

3:28:09that can generate more leads, and we

3:28:10want it within a week. If I press

3:28:12submit, what this will now do is that it

3:28:14will add it to our CRM. In this case,

3:28:16CRM is just a way that we store

3:28:17information about each client or leads.

3:28:19Then it talks to the first AI agent

3:28:21which writes the sales email we can send

3:28:23back. What it does then is that it sets

3:28:26a variable. In this case the variable

3:28:27would be subject and email body, which

3:28:29is subject here and email body.

3:28:31Which will send it to our internal team.

3:28:33You can see here we have the action

3:28:34required new lead with budget of less

3:28:36than 1,000.

3:28:37And a team member from our team before

3:28:39sending it to the actual customer. We

3:28:41can respond. So I said don't ask him a

3:28:43question. Just tell him we're available

3:28:45at Tuesday 3:00 p.m. tomorrow because as

3:28:46you can see here it asked them a

3:28:48question of whether they are available.

3:28:50I press submit. So I give a feedback.

3:28:52What this does is that it then

3:28:53classifies the feedback whether it's a

3:28:55positive feedback or negative feedback.

3:28:57If it's negative what this does is that

3:28:59it roots it to the next step which

3:29:01actually based on the feedback that we

3:29:03gave it rewrites the actual email using

3:29:05the next agent right here.

3:29:07And it gives us a new email.

3:29:10Which we then send back here.

3:29:12Because again the

3:29:13name of the variables is the same

3:29:15whether it comes from here or from here.

3:29:17Which we are able to then send it back

3:29:19to our team.

3:29:20Right here.

3:29:22For another revision. I can press

3:29:24respond. I can say as you can see here

3:29:26we have we actually have the the revised

3:29:27version. So Tuesday at 3:00 p.m.

3:29:30And I can say yes, all good.

3:29:32When I press yes all good and I submit

3:29:33it, what this will now do is that it

3:29:35will send the email because now it's

3:29:37it's approved it's positive feedback. To

3:29:39the customer. So if I go here I can see

3:29:41that I'm obviously I'm the customer and

3:29:42I'm team member here. But this is what

3:29:44the customer will get. They will get a

3:29:45fully sales optimized email.

3:29:47Obviously with results and everything.

3:29:49That responds to their inquiry from the

3:29:52website. And so this framework right

3:29:54here is amazing. It's actually one of

3:29:56the best frameworks that I've used so

3:29:57far within AI agents when it comes to

3:29:59adding a feedback loop. Right? Because

3:30:01what we're doing here is that we're

3:30:02writing the sales email and you can

3:30:03apply this to content or whatever it is.

3:30:06But we're writing something then we're

3:30:07sending it for revision to our team.

3:30:09Then the team gives us feedback. Then

3:30:11based on the feedback we categorize

3:30:12whether this is positive feedback or

3:30:14negative feedback. If it's negative then

3:30:16we send it to another AI agent. So as

3:30:18you can see here we have two options

3:30:19approved or denied. And we give it the

3:30:21description of what approved is and what

3:30:23denied is.

3:30:24And based on the appropriate output so

3:30:26whether it's actually approved or denied

3:30:28we send it two different ways. Again

3:30:29denied will go to the AI agent which

3:30:31revises the email. And so this is

3:30:33prompted to to know that this needs to

3:30:36update the sales email based on provided

3:30:37feedback. And this is the email that we

3:30:39get.

3:30:40Which we send back here.

3:30:42Which then sends it to our team again

3:30:43for human in the loop. And this is a

3:30:45whole repetitive process over and over

3:30:46again. Now this is great because it

3:30:49enables

3:30:50the AI agent to have continuous

3:30:51learning. Right? Because most of the

3:30:53times not most of the times actually

3:30:55sometimes the AI agent will not spit out

3:30:57something that we're actually happy to

3:30:58send to the client.

3:31:00And so instead of sending it to the

3:31:01client directly what we do is that we

3:31:03have a repetitive process. As you can

3:31:05see this is a circle. What's a what

3:31:07Whatever you

3:31:08rectangle. All right? But the concept is

3:31:10that we have a loop. Right? Human in the

3:31:12loop. The human is always in this loop.

3:31:14We're able to give it feedback and

3:31:16iterate on the feedback again and again

3:31:18until we give it positive feedback.

3:31:20Saying yeah all good or yeah no changes.

3:31:23And then it sends it to the client

3:31:24itself. And then it does its own thing.

3:31:26Now this is great for systems that

3:31:27require quality assurance which means

3:31:29that they require someone to give some

3:31:31sort of input or feedback based on the

3:31:33output that AI gave. Um this can be

3:31:35applied to again sales outreach or

3:31:36customer support because those are the

3:31:38ones that interact with a customer. And

3:31:40so between the AI making something and

3:31:42the customer receiving that something

3:31:44there has to be an intermediate step of

3:31:46us giving a feedback. And usually that's

3:31:48having another person. Right? And so in

3:31:50this case this allows us to have a

3:31:51repetitive loop feedback loop to

3:31:54generate different things. And that's

3:31:55where we would use the optimizer

3:31:56framework.

3:32:00In this video I'm going to show you

3:32:01exactly how to prompt your AI agents

3:32:03inside of n8n so they actually do what

3:32:06you want with less errors and more

3:32:08accurate results. I'll break down the

3:32:09main types of prompts, show you exactly

3:32:12how to structure them, and explain how

3:32:14to write prompts that actually get

3:32:15results. All right, so to quickly recap

3:32:17what an AI agent is we have an input, we

3:32:19have an output, and in the middle the AI

3:32:21agent is instructed right which is the

3:32:23prompts that we're going to go through

3:32:24today. Uh and based on the instructions

3:32:27it then uses its brain which is LLM

3:32:30which is just an AI which thinks through

3:32:32the instructions and then takes action

3:32:35on the tools based on the instructions

3:32:37that it was given. So it's [music]

3:32:38exactly the same as an employee. It's

3:32:40only AI. And the instructions that you

3:32:41give it are going to be in a prompt

3:32:43format in an actual text. So this right

3:32:45here is what it actually looks like.

3:32:46This is the most basic version of an AI

3:32:48agent inside of n8n. The first thing we

3:32:50have is a chat. So I'm going to go here

3:32:52and talk to it. I'm going to say

3:32:54hello.

3:32:56What this will do is that it will send

3:32:57the input over to the AI agent. It will

3:32:59then call its brain because that's how

3:33:01it thinks. And it will call the memory

3:33:03tool because we also have the ability to

3:33:05remember uh the conversations that we

3:33:07had. Now inside the AI agent we only

3:33:10have two types of prompts. Only two.

3:33:12Right? The first one is a user message.

3:33:14And the next one you can find right here

3:33:16is a system message. So in this case if

3:33:18you have an employee right you tell the

3:33:20employee a task. You say hey can you do

3:33:22this for me? That is a user message.

3:33:23[music]

3:33:24Then the instructions that you gave the

3:33:25employee before that is a system

3:33:27message. So two different types of

3:33:28prompts for two different types of

3:33:30reasons. And so right here we have two

3:33:32different options for source for prompt.

3:33:34Source for prompt just means hey where

3:33:36are we getting the input? Like what is

3:33:37that thing that we're receiving and

3:33:38where is it coming from? We have

3:33:40connected chat trigger node. And we have

3:33:42define below.

3:33:43Now if I go out of here I can see that

3:33:45right now the AI agent in this case is

3:33:47connected to this node right here. A

3:33:48node is just a is a square. That's what

3:33:50they call it. And this right here is a

3:33:52chat trigger node. It's one that is

3:33:54native to n8n which means that n8n owns

3:33:56it. And typically that is what we use to

3:33:58be able to speak to the AI agent. Right?

3:34:00And so the input comes from here. So if

3:34:02I go inside I can see [music] that we

3:34:04chat to the AI agent through the chat

3:34:06node. So through here.

3:34:08I go here open chat and I say so where

3:34:10are you from? All right?

3:34:12And so right now what this does is that

3:34:14it takes this input. Right? Where are

3:34:16you from?

3:34:17It sends it over here. And this will now

3:34:19be the user message. Right? So this JSON

3:34:22fancy thing that you see which is code

3:34:24because again everything is code behind

3:34:26the no-code platforms. The irony there.

3:34:28Um but that is a thing that the AI agent

3:34:31uses as sort of an input to then take

3:34:34action. Right? The second part is define

3:34:36below. So there are times where we're

3:34:38not connected

3:34:40to the chat trigger node. So every

3:34:41single time that we're not connected to

3:34:43this node right here we have to use

3:34:45define below. Because we have to define

3:34:47the input based on where it comes from.

3:34:49So for example if we have an AI agent

3:34:51that looks like this and the input comes

3:34:52from Telegram which is just a platform

3:34:54where you chat

3:34:55um sort of like WhatsApp. If I go inside

3:34:57here I can execute the step and now it's

3:35:00going to wait for someone to send a

3:35:01message to Telegram. And right here I

3:35:03have a new chat pulled up. And when I

3:35:04press start it automatically sends a

3:35:05message which is {slash} start. And that

3:35:08is a trigger

3:35:10right here.

3:35:11Which is text start. And now this is a

3:35:13thing that then goes into the AI agent.

3:35:16And now we use define below. Because

3:35:18this [music] right here chat trigger

3:35:20node like I mentioned is only for that

3:35:21specific node. And the node changed to

3:35:23Telegram. And so we have to change the

3:35:25input that comes in. And how we do this

3:35:27let's say this is empty. We just take

3:35:28the input which in this case would be

3:35:30text right because that's the text that

3:35:32we get.

3:35:33And we drag it across here.

3:35:35Or alternatively you can curly bracket

3:35:37curly bracket dollar sign JSON

3:35:41dot

3:35:42message.

3:35:44dot

3:35:45chat. And so let's say now I execute the

3:35:47workflow.

3:35:48And I just talk to Telegram and I say

3:35:50hey how's it going?

3:35:53What this will now do is it will send

3:35:54the input over here.

3:35:55It will then talk to its brain.

3:35:57And then based on its brain and based on

3:35:59the instructions that we give it which

3:36:00I'll show you exactly how to write that

3:36:01instruction then it will do its thing.

3:36:03It will give us the output and the

3:36:04output will be in Telegram which in this

3:36:07case it's hi I'm ready to assist you.

3:36:09How can I help you today? And so that's

3:36:11where we would use the define below

3:36:14rather than the chat trigger node.

3:36:16And this is the one that we mostly use.

3:36:17Because again we chat trigger node I

3:36:18feel like we only use it when we test

3:36:20uh rather than anything else.

3:36:22So I'm going to say hello here just to

3:36:24put this as an example. And now we're

3:36:26going to go on to the most important

3:36:27prompt which is the instructions. So

3:36:29that's system message.

3:36:31So if I go to system message and I go to

3:36:33expression and I go to full screen.

3:36:35Now this is the playground. This is

3:36:37where we write the actual prompt. And so

3:36:39I'm going to paste a structure of prompt

3:36:40that we typically use right here. Now

3:36:43the first thing is the actual

3:36:44formatting. So we use something called

3:36:46markdown formatting. So if you see

3:36:48uh these sort of hashtags or sometimes

3:36:50you even see this

3:36:52right here.

3:36:54What this is is let's say I go to a

3:36:55Google document. If I write hello

3:36:59right? And I go to right here heading

3:37:01one.

3:37:02I can also write hello.

3:37:05And then

3:37:06this turns to heading one.

3:37:08And so what this means is that this is

3:37:10heading one.

3:37:12This is heading two.

3:37:14This is heading three.

3:37:16Right? And so why do we do it? It's

3:37:18because then the AI knows

3:37:20the hierarchy. Right? Sort of like

3:37:21you're doing an essay. If the essay does

3:37:23not have a title, subtitle, uh the text

3:37:25description, all that stuff then it's

3:37:27very hard to understand. And so you are

3:37:29using these using hashtags. Right? In

3:37:32this case this is one. In this case it's

3:37:34two. In this case it's three. And you

3:37:35can go to four as well. Then the AI

3:37:37knows exactly okay this is the main

3:37:39thing to look at. Then this is the one

3:37:41below it. And then this is the one below

3:37:42it. And so when we look at this

3:37:45we're saying hey this is the title of

3:37:47the first thing and then the text. Title

3:37:49text. [music]

3:37:50Title text and so on. And if you add

3:37:52things like these then this would bold

3:37:54it. So something like this on a Google

3:37:56document so that within the text it

3:37:58recognizes that this is an important

3:37:59word or an important phrase.

3:38:01>> [music]

3:38:01>> And it does the exact same thing for all

3:38:03of them. Now let's say that you wanted

3:38:05the overview to be the title. This as

3:38:07well. This as well. But you realize that

3:38:09examples aren't that important to be a

3:38:11title. All you have to do is just put

3:38:13another hashtag so that this becomes

3:38:14heading two and so AI understands,

3:38:17right? Based on the logic, heading one,

3:38:19two, three, that this is less important

3:38:21than this. And so it will prioritize

3:38:23looking at this before looking at this.

3:38:25Now, the first thing of the prompt

3:38:28is an overview, right? So you are a your

3:38:30purpose is to. Now, if you're watching

3:38:32this video of prompting, then you've

3:38:33probably been seeing prompts that look

3:38:34like you are a helpful, intelligent

3:38:37content writing assistant. You are a

3:38:38helpful, intelligent something something

3:38:40assistant. The reason why we do that is

3:38:42because we're giving AI an identity,

3:38:44okay? And by giving AI an identity, then

3:38:48we're saying then what it does is it

3:38:50allows AI to psych itself to to make it

3:38:53think that it actually is that identity,

3:38:55so the output will be higher. And so

3:38:57here we start by saying, you are a

3:38:59helpful, intelligent

3:39:01personal assistant. Uh the only tool

3:39:03that we have connected to it is send a

3:39:04message, so that's fine.

3:39:06>> [music]

3:39:06>> And now we say your purpose is to and

3:39:08then describe what the AI agent actually

3:39:10does. And so here it would be your

3:39:12purpose is to

3:39:14send emails based on just send emails,

3:39:17actually.

3:39:18Yeah, your purpose is to send emails

3:39:20to

3:39:22customers.

3:39:23And so that is it. That's the overview.

3:39:25Now, of course, if it's a bit more

3:39:27complex, then you have different tools,

3:39:29then your purpose is going to be longer

3:39:31because the purpose is different things.

3:39:33And so this obviously depends on the

3:39:34complexity. Now, I'm going to go through

3:39:36a complex agent at the end, so don't

3:39:37worry, you'll see exactly what it looks

3:39:39like. But that right here is the first

3:39:40part. The second part is the tools. So

3:39:43right now in this AI agent, we are I

3:39:45believe we're only connected, yeah, to

3:39:46send a message.

3:39:47And so that is the only tool. Now again,

3:39:49a tool is a software is a thing that the

3:39:52AI agent uses to take action. And so the

3:39:54first thing is adding the full name.

3:39:56So we say, "Hey, heading one, tool."

3:39:59And the first thing we write is the tool

3:40:00name, send message. And bear in mind

3:40:02that the tool name, make sure it's the

3:40:04exact name of the actual tool, not an

3:40:06extra e, not an extra r, right? Exact

3:40:09name. And now we have to add the

3:40:10function and when to use it. So this

3:40:12tool

3:40:14will be used

3:40:16when sending emails

3:40:18to customers.

3:40:19That's it.

3:40:20And then And so if you have more tools,

3:40:22then you have more names,

3:40:25tool

3:40:26name

3:40:28and then tool description.

3:40:30description. That's it. And the more

3:40:32tools you have, the more you add right

3:40:34here, right? And you keep going on and

3:40:35on and on. And then we have rules. So

3:40:37rules are great to then be able to give

3:40:40it guardrails. So guardrails just means

3:40:41that Let's say you're in the bowling

3:40:43alley. You know, when you're at

3:40:44bowling and they add the the little

3:40:46sides on the

3:40:47the little things that they put on the

3:40:48sides cuz you're completely horrible.

3:40:50It's only because by putting those

3:40:51guardrails, there's a good chance that

3:40:53you'll hit the target, right? If you're

3:40:55anything like me at bowling, when I

3:40:57throw the ball, it goes out, right? And

3:40:58so by putting those those walls, it

3:41:00makes sure that it actually hits the

3:41:01thing.

3:41:03And so that's exactly what we're doing

3:41:04here. We're saying, "Hey, these are the

3:41:05rules." And saying, "Always do this,

3:41:07never do this, if unsure, do this." Now,

3:41:10these three are obviously optional. It

3:41:12depends on what rules you want. But in

3:41:14this case, you can say, "Always make

3:41:16sure to have an email address

3:41:21before sending an email."

3:41:24Right? Because we want to make sure that

3:41:25we're actually sending the email to the

3:41:26right person or a person at all. Then

3:41:29you can say, "Never send an email

3:41:32if you don't have

3:41:35an email address.

3:41:38If unsure, just ask the user

3:41:41to clarify."

3:41:43Simple as that. Obviously, it depends on

3:41:45your use case, right? Again, it depends

3:41:46on your use case, so the rules might

3:41:48change. But for this specific use case

3:41:50where we're just sending emails, then

3:41:52this is fine. [music]

3:41:53And then lastly, we have output format

3:41:55and examples. Now, this is optional. I

3:41:57wrote this as an option because it

3:41:58depends on your use case. If I'm doing

3:42:00something like an email send a message

3:42:01assistant, there's no need to put output

3:42:03format or examples, right? But what

3:42:06these do is you tell it to basically

3:42:08give you the output in a specific

3:42:10format, so JSON or bullet list or

3:42:12whatever it is, and it actually does it.

3:42:14So in this case, what we could do is we

3:42:16can say, "Format all responses as a

3:42:18short, concise

3:42:21sentence, right?" Or you could say, "A

3:42:23bullet list

3:42:25full

3:42:27of

3:42:28points, right?" It depends on your use

3:42:30case. It kind of depends on what you

3:42:31want.

3:42:32>> [music]

3:42:32>> Uh for this case, we can just keep it

3:42:34very, very short and sweet. It's fine.

3:42:36And then examples here. So examples in

3:42:38this case, we wouldn't use it, right?

3:42:40But for something a bit more complex

3:42:42where it has different steps, where we

3:42:43wanted to give it more guardrails

3:42:45because again, giving it examples, it is

3:42:47literally just giving it rules, right?

3:42:48We're saying, "Hey, do it this way. Here

3:42:50are some examples to guide you in the

3:42:52right direction." So adding more

3:42:53guardrails. Only because AI agents are

3:42:55great, right? They're they're amazing.

3:42:57They do really good stuff, but the

3:42:59margin of error needs to be very, very

3:43:01small when you're actually giving it to

3:43:02clients. And so if you add more

3:43:05guardrails, if you add more examples,

3:43:06then the chances that it will error out,

3:43:09which means that something goes wrong,

3:43:10are very low. And the way that examples

3:43:12usually work is we have the user.

3:43:14>> [music]

3:43:15>> So we say, "This is the input." So let's

3:43:16say I say, "Send an email

3:43:18to

3:43:20Or actually, let's say I say, "Make a

3:43:23LinkedIn post

3:43:25about life."

3:43:27And then you give it the uh the answer.

3:43:30Right? You say

3:43:31you actually give it the LinkedIn post.

3:43:33So it can use the LinkedIn post as a

3:43:35reference when actually giving the

3:43:36output. And so why do we do this? It's

3:43:38because again, with guardrails, the AI

3:43:41agent knows what good looks like. It has

3:43:42expectations. And by giving someone

3:43:44expectations, they will get closer to

3:43:47the actual goal because it aligns with

3:43:49the expectations that you have. And so

3:43:51that right there is a full structure of

3:43:52prompt that we use. Obviously, some

3:43:53things you add, some things you remove

3:43:55depending on your use case, but this is

3:43:56what it looks like.

3:43:58And so when you pair up the user message

3:43:59with a system prompt, the user message

3:44:01is the input, so what do we get from the

3:44:03user? And the system message is a thing

3:44:05that it uses to actually think through

3:44:07what it needs to do. Now, I'm going to

3:44:08go through a single agent step prompt

3:44:10and a multi-agent step prompt. So a

3:44:13single-agent step prompt just means that

3:44:14we just have one step before it goes to

3:44:17the tools, right? And so if I go inside

3:44:19here, the chat input will be the one

3:44:21from Telegram, which is the text below,

3:44:23which is what we covered before. And the

3:44:24system message will be an overview, not

3:44:26a personal AI assistant integrated with

3:44:28Telegram. Your purpose is to help the

3:44:30user manage communications efficiently

3:44:32by retrieving the correct contact and

3:44:34sending accurate, well-formatted emails

3:44:36on command. As you can see, the purpose

3:44:37changed because now we're also saying

3:44:39you have to retrieve the correct contact

3:44:41and sending accurate, well-formatted

3:44:43emails on command. And now we're giving

3:44:45it the tools. So the first tool is get

3:44:47contacts,

3:44:49right? We put this to bold it to say,

3:44:50"Hey, this is important. This is the

3:44:52name."

3:44:52And the description is retrieves contact

3:44:55details, name [music] and email, right?

3:44:56So this AI agent in this case is

3:44:58connected to two different tools.

3:45:00It's connected to the get contacts,

3:45:02which is a contact database, which is

3:45:03the one right here, which has name,

3:45:05email, and phone number.

3:45:06And it's connected to send email, which

3:45:08is another tool, right? And so that's

3:45:10why we have get contacts to retrieve

3:45:11contacts and we give it a rule. We also

3:45:13say, "Use this first to verify the

3:45:15recipient or retrieve missing contact

3:45:17information." Because if you think about

3:45:19it, what if I say I want to send an

3:45:21email to, let's say, Michael James,

3:45:24right? [music] How does it know the

3:45:25email of Michael James? Which is why it

3:45:26has to call this tool first and then it

3:45:29can call the next tool. And then we have

3:45:31send emails, send emails to contacts.

3:45:33And the rules is never assume missing

3:45:35details. Always ask for clarification.

3:45:37If unsure, respond with, "Can you

3:45:39confirm who I should send this email

3:45:40to?" Keep the message short, clear, and

3:45:42structured when replying on Telegram.

3:45:44And so this right here is a very short

3:45:45prompt that we give it because again,

3:45:47the AI agent is pretty simple. We just

3:45:49have it get contacts and we have send an

3:45:50email. And now if I go here, I can wait

3:45:53for the input.

3:45:54So on Telegram right here, I can say

3:45:55send an email to Michael James. I can

3:45:57press go.

3:45:59What this should now do is it should

3:46:00call the contacts uh tool. Then it gives

3:46:02us the output. And the output in this

3:46:04case is, "Can you please provide the

3:46:05subject and the email body uh of the

3:46:07email that you want to send it to

3:46:08Michael James?" So even though I told it

3:46:10Michael James and it knows the email, I

3:46:12didn't give it what the email was about.

3:46:14And so now what I can say is,

3:46:16"Send an email to Michael James

3:46:18about uh and say we have dinner

3:46:21tomorrow."

3:46:22Now, you probably noticed that I

3:46:25should execute this first. Uh that I

3:46:28copied and reprompted this again.

3:46:30Why did I do that? It's because in this

3:46:31case, the AI agent doesn't have memory,

3:46:34right? And so I have to reprompt it and

3:46:36say, "Hey, send an email to Michael

3:46:37James and say we have dinner tomorrow."

3:46:39And now if I go to my email, I can see

3:46:40that I have dinner tomorrow. Hi Michael

3:46:42James, we have dinner tomorrow, best

3:46:43regards, right? All within just telling

3:46:46it a single prompt. But none of this

3:46:48would have happened if I didn't prompt

3:46:49it right. Because the AI agent, even

3:46:51though it's hooked up to these tools, it

3:46:52doesn't know that it should do this

3:46:54first and then this, right? Which is why

3:46:56it's all based on the instructions. I

3:46:58mean, in, out, right? Let's be

3:47:00honest. And it's the exact same as an

3:47:01employee. You give an employee

3:47:02instructions, you say, "Hey, when you

3:47:04have to go to file taxes, do it in this

3:47:06way." He does file taxes, he does it in

3:47:08that way, and then he brings it to you.

3:47:10If you say it's bad, it was not his

3:47:12fault. It's the instructions, right? And

3:47:14so you want to make sure that the

3:47:15instructions are very clear and precise

3:47:18so that the AI agent can actually do

3:47:20what you want it to do.

3:47:21And that right there is a single-agent

3:47:23step prompt, which means that we only

3:47:24have one step between here and the

3:47:27tools.

3:47:27>> [music]

3:47:27>> And here we have a multi-agent step

3:47:29prompt. Now, this agent looks

3:47:31ridiculously big um right here, but it

3:47:33is a video that I made about building a

3:47:35personal assistant, which you can watch

3:47:36up here. And the way it works [music] is

3:47:37the exact same as the previous one right

3:47:39here.

3:47:40But in this case, we have Telegram,

3:47:42which is the input.

3:47:43We send it here. We also have the option

3:47:44to do a voice message.

3:47:46And then inside here, if I go inside,

3:47:48the input is still JSON.text because it

3:47:49comes from Telegram

3:47:51and is defined below again because we're

3:47:53not using chat trigger node. And if I go

3:47:55to the system message, I can see that it

3:47:57follows the same exact structure. It has

3:47:59overview, tools, rules, and

3:48:01instructions. And it also has final

3:48:02reminder, which I'll explain exactly why

3:48:04that's there.

3:48:05So the first one is the overview. So

3:48:07you're are the ultimate personal

3:48:08assistant. Your job is to send the

3:48:09user's query to the correct tool.

3:48:11And so, in this case, we call it a

3:48:12multi-step agent prompt because this

3:48:15right here calls a tool, but the tool is

3:48:18actually another AI agent. So, it

3:48:19doesn't actually call the tool that

3:48:20takes the action like to send an email

3:48:22or get contacts. It calls

3:48:25different agents. So, contact agent,

3:48:27email agent, calendar agent, content

3:48:29agent. Why is that? It's because when we

3:48:32are doing something this complex, not

3:48:34complex, but we're doing a ton of tasks.

3:48:36We have 1 2 3 4 5 6 7 8 9 10 11 12 13

3:48:4014. 14 tasks that the AI agent has the

3:48:43ability to do. If we write all those 14

3:48:45tasks

3:48:46and we just connect it all to the same,

3:48:48the main AI agent, there's a very high

3:48:50probability that it will break. And so,

3:48:52we break it down into a multi-step agent

3:48:54prompt where we say, "Hey, these are the

3:48:56agents that are connected to you.

3:48:58If you get some sort of contact thing,

3:48:59just send it to here. If you're asked to

3:49:01take action on email, then call this

3:49:03agent here.

3:49:04Uh if you have to do anything within

3:49:06calendar, call the calendar agent. And

3:49:07the same thing with content. And then we

3:49:08give it rules. Right, some actions

3:49:10require you to look up contact

3:49:11information first, which is the exact

3:49:13same as we did before. We say, "Hey,

3:49:15sometimes you need to go to the contact

3:49:16agent first to get the contact and then

3:49:18send the email." That's a step-by-step

3:49:20process that it has to do. And then

3:49:21instructions, call the necessary tools

3:49:23based on the user's request. And we give

3:49:25it some instructions to then give it

3:49:26more guardrails, right? And finally, we

3:49:28give it the current date and time. So,

3:49:30the final reminder is just final things

3:49:32that you want to add. In this case,

3:49:33we're adding the current date and time

3:49:35because AI, unfortunately, isn't the

3:49:37best with dates and times. And so, with

3:49:39AI agents, if we ever connect it to

3:49:40something that has to do with time, like

3:49:43calendar or

3:49:44send an email for dinner tomorrow, it

3:49:46needs to know what today is in order to

3:49:48know what tomorrow is, right? And so,

3:49:50that's why we add this formula right

3:49:52here. And so, this right here is the

3:49:53exact same as the other ones. User

3:49:54message is like the one before.

3:49:56And now we can go on to the next tools,

3:49:58right? And so, from here it calls the

3:50:00contact agent or the email agent. And

3:50:02the best way that I can think about this

3:50:04is like a CEO. A CEO doesn't actually

3:50:06talk to each employee directly, right?

3:50:08He talks to the head of sales, head of

3:50:10operations, head of marketing. And then

3:50:12the head of marketing talks to the

3:50:13employees to take action. Why isn't it

3:50:15the other way? Well, it's because if the

3:50:16CEO had to talk to every single

3:50:18employee, he would go crazy. And there's

3:50:20a good chance he would get the employee

3:50:21wrong because there's so many employees,

3:50:23right? And so, right here, if I go to

3:50:25contact agent, which is the head of

3:50:27contacts, head of department, we just

3:50:29have an overview and then we give it

3:50:30tools, right? Get contact, add or update

3:50:33contact, which is the tools

3:50:36that we give right here.

3:50:37Get contact and add or update contacts.

3:50:40Same thing with this, email agent, we

3:50:42have this, overview, tools, and some

3:50:44rules as well, final reminder.

3:50:46Same thing with calendar. I can see the

3:50:47overview, tools, final reminder, and the

3:50:50blog as well. Just because the contact

3:50:51agent doesn't have to know today's date

3:50:53and time to to get contacts, but these

3:50:55do.

3:50:56>> [music]

3:50:56>> Uh overview, tool, and rules, right? And

3:50:58so, that's it. The input here, the

3:50:59prompt user message in this case would

3:51:01be AI defining. And also, the only

3:51:03difference from the single-step AI agent

3:51:06to the multi-step AI agent is also the

3:51:08user message, right? Because if I go

3:51:10here, right? The user message here will

3:51:13be Telegram. But if I go inside one of

3:51:15these,

3:51:16then I can see that this is now defined

3:51:18automatically by the model. We say,

3:51:19"Hey, the AI agent is given a task."

3:51:21Right? This is the CEO. Then the CEO,

3:51:24we're letting AI define what the CEO

3:51:26tells the head of department,

3:51:28right? Which is the prompt user message.

3:51:30And we give it a description as well.

3:51:32And then, based on the prompt, based on

3:51:34the instructions, and based on the tools

3:51:36that the head of department is connected

3:51:37to, it will prompt each tool correctly.

3:51:40And so, best practices for prompts is be

3:51:42direct and explicit, right? The more

3:51:43direct you are, the better it is.

3:51:45Put critical info at the top or you can

3:51:47put it with um markdown formatting to

3:51:50make sure that it knows, "Hey, this is

3:51:51title one, heading two, and heading

3:51:52three." Keep it concise, no filler,

3:51:54which means that the more stuff you add,

3:51:56the more chances it will break. And that

3:51:58is just a truth, which is why we're not

3:52:00giving it a huge prompt, right? For the

3:52:02multi-step AI agent, we're giving it one

3:52:04prompt and then that goes to the next

3:52:06and then the next, right? Only include

3:52:07what improves performance. So, don't

3:52:09include stuff just to include stuff

3:52:11because again, the more context, the

3:52:12more it needs to think, and the more

3:52:14someone needs to think, the more chances

3:52:16we have or the more likely it is for

3:52:17actually stop working. And if you're

3:52:19someone who wants to start and scale

3:52:20your AI automation agency and work with

3:52:22me personally one-to-one, then check the

3:52:24first thing down below.

3:52:28Hey, in this video I'm going to show you

3:52:29step-by-step how you can connect over

3:52:31500 AI models to your [music] N 10 AI

3:52:34agents using OpenRouter. And I'll also

3:52:36show you how I built a full AI agent

3:52:38that actually decides what model to

3:52:40choose based on the question that it was

3:52:42given. With that being said, let's dive

3:52:44in. So, if we go to N 10 right here, the

3:52:46way that the AI agent works is that we

3:52:48have an input.

3:52:49We then have the actual AI agent, which

3:52:51has instructions. This is the prompt

3:52:53saying, "Hey, if you you are helpful

3:52:54intelligent XYZ, you [music] do this and

3:52:56you do that based on the input that

3:52:58you're given."

3:52:59And then what it has is it's connected

3:53:01to its brain, which is an LLM, which is

3:53:03the one that we're going to be changing

3:53:04today.

3:53:05The memory and the tools. And then it

3:53:07gives us the output.

3:53:08The only thing with this is that the

3:53:09brain itself, when we go to N 10

3:53:12chat model, this is the brain,

3:53:14and I look for the software itself, we

3:53:16can see that these are individual

3:53:18softwares. These are individual LLMs.

3:53:19So, if I want to connect Claude, that

3:53:21means now I have to go to Claude and

3:53:22make an API key and then choose a model

3:53:24from here. But if I want to choose

3:53:26OpenAI, then I have to go to platform

3:53:28OpenAI, add money there, and do this

3:53:30exact same thing for every single chat

3:53:32model there is. But the question

3:53:34becomes, what if there was just one

3:53:37thing that we had to connect to the AI

3:53:38agent that we can then use to access all

3:53:41the models all together? Well,

3:53:43welcome to OpenRouter. All you have to

3:53:44do is go to openrouter.ai. Um I'm going

3:53:47to leave the link down below in case you

3:53:48want to check it out. And then we see

3:53:50here on the top right that we have

3:53:52different uh places that we can go. So,

3:53:54if you go to models, this will basically

3:53:56show us all the models that we have that

3:53:59we are able to connect with OpenRouter

3:54:01to then be able to access in our

3:54:02automations, right? We have DeepSeek.

3:54:05I don't know what this is. Um

3:54:07there's tons of them. More than more

3:54:08than you probably know, right? There's a

3:54:10whole list, 500 models, which is crazy.

3:54:12Then we have chat,

3:54:14which is where we can actually

3:54:16test or we can actually talk to all the

3:54:17different models.

3:54:19And then we have rankings, which is

3:54:20actually an interesting feature because

3:54:22we can see the leaderboard of which

3:54:23models are the best. In this case, top

3:54:25this week will be Grok.

3:54:26And then if I go below to market share,

3:54:29uh but below here to categories, we get

3:54:30to see which model is the best by what

3:54:33category. So, marketing for example,

3:54:35I can see that Gemini 2.5 Flash is the

3:54:37best for marketing. And if I go to sales

3:54:40or whatever it is, science,

3:54:42I can see that we have

3:54:45Gemini 2.5 Flash. Right? And so, you get

3:54:47to see exactly which models, this is a

3:54:49live representation of which model is

3:54:51the best for what specific use case that

3:54:53you can then use, right? But for this

3:54:55video, I'm not going to show you which

3:54:56model is the best. I'm just going to

3:54:58show you how you can connect it to N 10.

3:54:59Uh the first step here is to make an

3:55:01account.

3:55:02Once you made an account, you go to

3:55:03profile and you go to keys.

3:55:05When you go to keys, this is like the

3:55:07exact same thing that we did for Claude,

3:55:09OpenAI, Grok, Gemini. We have to create

3:55:11an API key. The only difference with

3:55:13this API key is that we only have to

3:55:15create one key to access all the models

3:55:17instead of creating one key per model,

3:55:19right? We press here.

3:55:21Let's name it

3:55:22all models key.

3:55:25Uh reset limit every

3:55:26choose how often the limit should reset.

3:55:27No, NA is fine.

3:55:29No limit.

3:55:30Press create and now you have this key

3:55:32right here,

3:55:33which you can copy.

3:55:35You can then go to N 10

3:55:36chat model,

3:55:38look for OpenRouter right here.

3:55:41And then to connect your OpenRouter

3:55:42account,

3:55:43you can create a new credential,

3:55:45paste the API key that we just had,

3:55:47and name it all models. Okay.

3:55:50And press save.

3:55:52And now you have access to this API key.

3:55:55Now, of course, this is not free. So,

3:55:56the next step you have to do is add

3:55:58credits into our account so we're able

3:55:59to access all the LLMs and use them.

3:56:02Uh I'm going to go here, profile,

3:56:04to credits.

3:56:06And yeah, also credits here. And now you

3:56:08get to add credits here. Now, the thing

3:56:10is you would add credits anyways cuz you

3:56:12would have to go to ChatGPT, Claude,

3:56:14Gemini, Grok. You have to make an API

3:56:16key, but even those softwares are not

3:56:17free. And so, this just allows you to

3:56:19make it so much easier for yourself to

3:56:22just add money in one place so that

3:56:24you're able to actually access all the

3:56:25models. And quick note here, when you're

3:56:27working with clients and actually

3:56:28implementing these automations and AI

3:56:30agents into their system, sometimes you

3:56:32would use more than two LLMs. Maybe one

3:56:35for writing content, maybe one for

3:56:36structuring data, maybe one for

3:56:38reasoning, right? And so, this right

3:56:40here gives us the ability to tell the

3:56:42client, "Hey, just make an account on

3:56:44one place. You don't have to go to every

3:56:45single LLM to make an API key to add

3:56:47credits," which makes it so much more

3:56:49structured in the long run. Once we have

3:56:51the credits down, we can go to N 10. We

3:56:53can see that now

3:56:55we have access to all these models right

3:56:57here.

3:56:58Perplexity, Qwen, OpenAI,

3:57:00Claude,

3:57:02there's a Grok, right? There's a ton of

3:57:04different models that we can access

3:57:06through the API version, which is

3:57:08insane.

3:57:09And this would be the exact same as just

3:57:10adding

3:57:12in this case, OpenAI

3:57:144.1 Mini, right? Because we're using 4.1

3:57:16Mini here, but we're also using it here.

3:57:19Right? If I go here, then I can chat to

3:57:21it. So, let's say

3:57:23say hello.

3:57:24I can see that now it's calling

3:57:25OpenRouter

3:57:27and it's giving us an answer. How can I

3:57:28help you today? All right. So, now that

3:57:30we connected the OpenRouter to our N 10

3:57:32AI agent, now let's make an AI agent

3:57:34that basically gets the input, which is

3:57:36the question, gives it to the first AI

3:57:38agent, which will decide what model to

3:57:39use, and then it will use the model that

3:57:42it needs to use based on the question

3:57:43that it was given, okay? Now, the

3:57:45fundamental concept here is that when we

3:57:46go to OpenRouter

3:57:48and I go to the model, if I press

3:57:50expression,

3:57:51this means now I can hardcode, which

3:57:53means I can actually type the model that

3:57:55we want, right? Which comes from this

3:57:57list. So, I go to GPT-4 Turbo. I have

3:58:00this. Now, this is the name of the

3:58:01actual model. This is the way that the

3:58:03API recognizes that we want to use GPT-4

3:58:05Turbo. And so, in theory, when you think

3:58:08about it, if you want an AI agent that

3:58:10decides what model to choose, we need to

3:58:13give it this text right here,

3:58:15right? And then, it uses that model that

3:58:17it we give it will be able to answer the

3:58:19question.

3:58:20And so, I map this out here.

3:58:22This is a two-step uh AI agent. We have

3:58:24the first one to choose the LLM, which

3:58:25is LLM just means OpenAI, Claude,

3:58:27Gemini. And then we have the second AI

3:58:29agent to give the answer to the question

3:58:32based on the LLM that the first AI agent

3:58:33chose. So, [music] if I go here, I can

3:58:35delete this now.

3:58:37Let's go to the first one, agent.

3:58:40Let's do LLM

3:58:43router.

3:58:44Keep the input the same. Now, the input

3:58:46is chat input, which is this.

3:58:49Then, we're going to need this as well.

3:58:51I'm going to show you exactly how you do

3:58:52it. You can go to system message,

3:58:56expression, and then I'm going to paste

3:58:58the message or the prompt that I already

3:58:59had. Go here, paste it. And so, this

3:59:02prompt right here basically is giving

3:59:03the AI agent an overview of what it is.

3:59:05In this case, it's an AI agent that

3:59:07decides an LLM model. It gives us the

3:59:09name of the LLM model based on the

3:59:11question that it was given. And then we

3:59:12give it context. So, we say, "Hey, you

3:59:14have access to Perplexity Sonar, which

3:59:16is good for extended reasoning in this

3:59:19and this.

3:59:20You have access to OpenAI O3 Mini High,

3:59:22which is a cost-efficient model that

3:59:23does this.

3:59:24You have access to Anthropic Claude 3.5

3:59:26Sonnet, which is good for this.

3:59:28Right? Your task is to

3:59:31respond only in the following JSON

3:59:33format, clearly stating the user's

3:59:35original query and the selected model.

3:59:37Right? So, this will be the output that

3:59:38we want.

3:59:39We want the Let me take this out,

3:59:41actually.

3:59:42Cuz it will give it to me like that. Uh

3:59:44but we want the user query, which is the

3:59:45user's question,

3:59:47and then we want the model.

3:59:49So that the next AI agent is given the

3:59:50model that it needs to use and the

3:59:52question that it was it was given by the

3:59:54user.

3:59:55And so, we also give it a few examples

3:59:57cuz it's always good to give the AI

3:59:58examples. So, for example, if you find

4:00:00the real-time stock price and latest

4:00:01news on Tesla, we know that Perplexity

4:00:03Sonar is great for research, and so it

4:00:05will use the output will be Perplexity

4:00:07Sonar. Same thing with craft a full

4:00:09business strategy for a startup, it will

4:00:11be OpenAI O3 Mini High, and then write

4:00:13Python code to build a snake game,

4:00:15Anthropic Claude 3.5 Sonnet. And at the

4:00:17end of the video, I'll show you how you

4:00:18can get the whole system for free, so

4:00:19don't worry. Um but this is what we use

4:00:21to give the AI agent. Now, we're going

4:00:23to require a specific output format

4:00:25because of the fact that we are asking

4:00:27what we are asking the AI agent to give

4:00:30us the output in JSON.

4:00:32Right? And so, I'm going to copy this.

4:00:35I believe

4:00:36this will be the right way to do it. Um

4:00:38require specific output format. This is

4:00:40good. So, I'm saying, "Hey, let's

4:00:42connect this to OpenRouter."

4:00:45This isn't the AI agent that will choose

4:00:46its model. Let's just use 4.1 Mini, and

4:00:48that's fixed. That doesn't change.

4:00:50And then,

4:00:52the output parser,

4:00:53cuz there's memory,

4:00:55which is simple memory, which will be

4:00:57the thing that the AI agent uses to

4:00:58remember its conversation. The tools,

4:01:01we're not going to need any tools here.

4:01:02And then output parser, we can use

4:01:05structured output parser right here.

4:01:07And we can say

4:01:08define JSON schema,

4:01:11and we can say, I believe,

4:01:14that it will be

4:01:18Oh, is it?

4:01:19Properties. Oh, user query, and then

4:01:21model. I think this might be it.

4:01:25Yeah, I think this might be it. So, we

4:01:26say, "Hey, use this JSON." JSON is just

4:01:29a It stands for JavaScript Object

4:01:30Notation. It's just the way that

4:01:32computers speak to each other. It's like

4:01:34the English for computers. And so, we're

4:01:36saying, "Hey, I want the user query as

4:01:38one property,

4:01:39and I want the model to be another

4:01:41property."

4:01:42So, what I'm going to do now is I'm

4:01:43going to run this.

4:01:45I'm going to go here and say, "Can you

4:01:47research

4:01:48Tesla news?"

4:01:51So, now it should give me the output.

4:01:53What is it? There we go.

4:01:55Model, Perplexity Sonar, and the user

4:01:57query, "Can you research Tesla news?"

4:02:01Which is great. Um so, now I can give

4:02:03this to the next AI agent to actually

4:02:05answer the question using this model.

4:02:08But I'll show you here. If I go here and

4:02:09I say,

4:02:10"Can you

4:02:12generate code for a snake game?"

4:02:16This should now use Claude. Right? So,

4:02:18it should now give me the output of

4:02:19Claude.

4:02:21And so, that's how you dynamically

4:02:22change the model in the next AI agent

4:02:25based on the input that we gave. And so,

4:02:26the next step is an AI agent again,

4:02:30and the input will not be connected to

4:02:33the chat trigger node. It will be

4:02:34defined below,

4:02:35because the input will be user query.

4:02:39And if I go here to

4:02:41um the chat model,

4:02:44and I go to OpenRouter,

4:02:47zoom out. I can now go to expression

4:02:50because now I'm going to dynamically I'm

4:02:52not going to choose this, because if I

4:02:54choose this model right here, it will

4:02:55always choose this model. It doesn't

4:02:56change. So, I'm going to go to

4:02:58expression, which allows us to change

4:03:00the actual model by text, and I'm going

4:03:02to paste Not paste. I'm going to bring

4:03:04this across so [music] that it uses

4:03:05this,

4:03:06which changes every single time based on

4:03:09the answer that we get from this AI

4:03:10agent. Okay? So, I'm going to go here,

4:03:12and then I believe this is it.

4:03:14Yep.

4:03:16And then AI agent.

4:03:18>> [music]

4:03:18>> That's cool. So, let's see how it works.

4:03:19I'm going to go here, and I'm going to

4:03:21paste this again. Let me actually rerun

4:03:23this.

4:03:24I rerun this. Can you generate code for

4:03:26a snake game? Now, it's using the model.

4:03:28It's going here.

4:03:29It's choosing the actual model that we

4:03:31get. So, in this case, it would be

4:03:32Anthropic/Claude

4:03:343.5 Sonnet. And now it's using Claude

4:03:37to generate the answer

4:03:39because this is the output here.

4:03:41And we get

4:03:43the code right here

4:03:46using Claude. And then right here we

4:03:47have the logs, which is essentially what

4:03:49is the step-by-step process that we just

4:03:51went through from the start until the

4:03:52end.

4:03:53And so, what we did there is that we

4:03:54have the model, and we have the user

4:03:56query. Then it goes to the second AI

4:03:57agent. And if I go here,

4:04:00I can see that it used this model

4:04:02to be able to give us this answer.

4:04:05If I go here, I can see that this will

4:04:07be the answer. Right? Now, let's change

4:04:09it up. Can you do

4:04:10research on the top AI news in the US?

4:04:14When I press go,

4:04:15and now it should be using Perplexity, I

4:04:18assume. Yeah, Perplexity Sonar.

4:04:20It's going to send the model to this

4:04:23OpenRouter chat cuz it dynamically

4:04:24changes every single time, and we get

4:04:26the output,

4:04:27which is the top news.

4:04:29Which is crazy, to be honest, because

4:04:30now you have the ability to literally

4:04:32choose which model you want to use,

4:04:33right? Based on the input. And the model

4:04:35that we use here is Perplexity Sonar.

4:04:37And then it changes every single time.

4:04:39And one thing you could do here is you

4:04:40can add more and more models. As in, you

4:04:42can give it more context to more models.

4:04:44This is only three models, right?

4:04:46Anthropic, OpenAI, and Perplexity. But

4:04:48you can have over 200. Of course, not

4:04:50recommended uh to honestly because it

4:04:53will kind of trip up, and it might get

4:04:54the name wrong. And if it gets the name

4:04:55wrong, then this obviously wouldn't

4:04:57work. Uh but you can definitely add more

4:04:59than three here. So, it has access to

4:05:01more models in that case.

4:05:05In this video, I'm going to show you the

4:05:06top three ways that you can scrape any

4:05:08website inside of n8n in just a matter

4:05:11of minutes. I'll show you exactly the

4:05:12fastest way and the most scalable way

4:05:15and which one you should probably use. I

4:05:17So, before we get to the actual method,

4:05:18let's talk about scraping. So, when

4:05:20someone says, "I want to scrape a

4:05:21website," what they mean is that they

4:05:22want to go inside a domain, a public

4:05:24domain, right? Which is accessible, and

4:05:27they want to extract all this

4:05:29information right here.

4:05:31Now, if you don't know, each website is

4:05:33actually if I go to inspect,

4:05:35it's consisted of all this code. Now,

4:05:37luckily, we don't have to know any of

4:05:38this, right? But just know that this is

4:05:40called HTML. So, HTML is a thing that

4:05:44websites are written in, which allows it

4:05:46to have an image, have this button

4:05:47that's red, have this video, have this

4:05:49number, and so on. It makes websites

4:05:51look pretty. And so, when we say scrape,

4:05:53we're scraping all the information here,

4:05:55but realistically, we're scraping this,

4:05:57right? We are scraping if I go to

4:05:58inspect this code, which you can then

4:06:00use to send emails, to maybe reply to

4:06:02messages, maybe to customize a message

4:06:04based on the website, and so on. And so,

4:06:06that's what scraping websites mean. Now,

4:06:08the first way is using a HTTP request.

4:06:10Now, I covered this node in much more

4:06:12detail in my API 101 fundamentals video,

4:06:15which you can check up here. But right

4:06:16here, we introduce to two different

4:06:18fields, the method and the URL. So, the

4:06:21[music] URL in this case would literally

4:06:22just be the website of the actual thing,

4:06:25which is in this case,

4:06:26jamesolutions.twooses.com.

4:06:28And the method in this case is either

4:06:31get, delete, add, options, patch, post,

4:06:33put. Now, these are all methods that we

4:06:36use when we make a request. A request

4:06:37just means we're saying, "Hey server,

4:06:39can you do something for us and give us

4:06:40back the information?" In this case, we

4:06:42have to use get because we want to get

4:06:45information. So, now all I have to do is

4:06:47put get, put the URL, and leave

4:06:50authentication as none, and leave all of

4:06:51this blank. And if I press execute step,

4:06:54you can see here that it's going inside

4:06:56the website, and it's extracting

4:06:59all the HTML, the whole code,

4:07:02which you can see here, which is very,

4:07:04very, very long, right? And this right

4:07:06here is what's behind this. We just

4:07:08extracted this code right here

4:07:10inside this, right? Which you can then

4:07:12use to do something else. Now, the only

4:07:14problem here is that the HTTP gives us

4:07:17the whole HTML, which is way too large

4:07:19for us to feed it into maybe an LLM like

4:07:21OpenAI, to maybe generate emails or

4:07:24generate messages. So, what we do here

4:07:26is turn the HTML, which is the whole

4:07:28long code of the website, into text,

4:07:30which is now readable to someone. So, I

4:07:32can go here to plus. I can look for HTML

4:07:35uh right here. So, work with HTML. I can

4:07:38press on this,

4:07:39and I can do extract HTML content,

4:07:42which means that it's extracting the

4:07:43text from the actual thing. And now, we

4:07:46can extract HTML content. The source

4:07:48data will be JSON because this is JSON.

4:07:50Um well, like this. This is all JSON.

4:07:52And if you're wondering what JSON is,

4:07:54video up here.

4:07:55Uh and then the property will be data

4:07:57because this is called data. And the

4:07:58key,

4:07:59will let's call this website

4:08:02text.

4:08:04And let's do to

4:08:06body.

4:08:07And now if execute the step,

4:08:09I can see [music] that we actually get

4:08:10the text of the website. So, we got from

4:08:13the HTML that we got, which is just a

4:08:15ton of stuff, which is all of this,

4:08:17right? All these letters and colors and

4:08:18images and videos, which you typically

4:08:20don't want. We just want the text. We're

4:08:22saying, "Okay, just extract the text

4:08:23from here." And as you can see, this is

4:08:25much shorter than this one,

4:08:27>> [music]

4:08:27>> which is way longer than this, right?

4:08:29And now this is something that you can

4:08:31add to an AI

4:08:32for it to draft emails or do something

4:08:34else. And we also use this node right

4:08:36here to be able to set up API requests.

4:08:38Now, API request, I actually mentioned

4:08:40this in my API 101 video, which you can

4:08:42find up here. If you go to any of them

4:08:44right here on App Event,

4:08:46there'll be tons of apps, right? But not

4:08:47everything is here, right? And so, how

4:08:49do you automate something within an app

4:08:51that you can't find the app here, right?

4:08:53And so, let's say I want to use

4:08:54PandaDoc, but PandaDoc is not here. It's

4:08:57unlisted here. But I know for a fact

4:08:59that you can actually automate things

4:09:00within PandaDoc, which is where we have

4:09:02to make our own app using a HTTP

4:09:04request. And then we typically use the

4:09:06HTTP node when the website is static, no

4:09:09JavaScript, which means that it doesn't

4:09:10actually change over time, and you're

4:09:11testing or building a simple automation.

4:09:13So, we typically use this for testing or

4:09:15to build something quick. Now, the pros

4:09:17is that this is fast and it's free,

4:09:18completely free. There's no extra setup

4:09:20or accounts needed. You just literally

4:09:22need to put a URL and run it. And it

4:09:24works great for APIs or plain pages. So,

4:09:26APIs, like I mentioned, is just the way

4:09:28that softwares talk to each other. So,

4:09:30if you can't find a software in any of

4:09:31them, you have to set up your own sort

4:09:32of app to make it happen, which is where

4:09:34you use a HTTP node. And plain pages,

4:09:37again, is this. The website is static.

4:09:39So, there's just that, just the text. It

4:09:41doesn't change over time. It's same.

4:09:43Now, the cons of this is that it gets

4:09:45messy and unreadable HTML. So, as you

4:09:47saw here, this right here gives me the

4:09:49whole HTML, which isn't really readable,

4:09:51which is why we have to use something

4:09:53like this. But if it wasn't for this,

4:09:55then we would just have to deal with the

4:09:56HTML that makes no sense to anybody.

4:09:59Then in terms of web scraping, it can't

4:10:01handle JavaScript heavy sites. So, sites

4:10:02that are changing over time that are a

4:10:04bit more complex, it cannot handle

4:10:05those. And it's very, very easy to get

4:10:08IP blocked if scraped a lot. So, if you

4:10:10scrape this website continuously over

4:10:12and over again, you will get blocked,

4:10:14right? There's a good chance you will

4:10:15get blocked. And on top of that, we can

4:10:17actually scrape every website. So, if I

4:10:18go to my LinkedIn here,

4:10:20and I just copy the URL and I paste it

4:10:22here

4:10:23inside,

4:10:25LinkedIn isn't a platform that you can

4:10:27actually scrape on a public level,

4:10:29right? So, in this case, what this did

4:10:31is that it just literally went to

4:10:32LinkedIn.

4:10:33It just scraped this. It tried to scrape

4:10:35it. And LinkedIn said, "No, we have a

4:10:37wall between you and me, and the wall is

4:10:39an encryption. It's a password that we

4:10:41have to go through." Which is why we

4:10:42can't use HTTP requests for everything.

4:10:45All right. So, the next method is using

4:10:46Firecrawl. So, if you just type

4:10:47Firecrawl right here,

4:10:49you can go to Firecrawl, the web data

4:10:50API for AI. And this website, the server

4:10:53is great if you just want to scrape

4:10:55websites. That's what it's meant to do.

4:10:56And so, when you make an account, just

4:10:58go to your dashboard,

4:11:00and you are able to then go to API keys,

4:11:03copy this key,

4:11:04and then if you go back to n8n, you can

4:11:07download this. So, you can go to

4:11:08Firecrawl.

4:11:10You have to install the node. So,

4:11:11there'll be a button here that says

4:11:12install. And then you have different

4:11:14options right here. But when you press

4:11:15any options that say scrape a URL and

4:11:17get its content, you will get introduced

4:11:19to this page right here. All you have to

4:11:20do is connect your account by adding the

4:11:22API key, press save, and once this is

4:11:25connected, you now have the operation

4:11:27which you have to pick, which is what is

4:11:28the action that we're actually doing.

4:11:30And there's different options. So, the

4:11:31first one is search and optionally

4:11:33scrape search results. Now, what this

4:11:34means is that you're asking Google to

4:11:36look something up for me. Then we have

4:11:38map a website and get URLs. So, this

4:11:40goes inside a website and gets all the

4:11:41URLs, like the about section, the

4:11:43services, the homepage, all that stuff,

4:11:45all the URLs that you might need. Then

4:11:47we have scrape a URL and get its

4:11:48content, which is literally just

4:11:50scraping the URL and getting its

4:11:52content. So, you're going inside the URL

4:11:54and getting everything back, so the

4:11:55text.

4:11:56And I'll show you how this is different

4:11:57from the HTTP that we just used. Crawl a

4:12:00website is a bit more advanced than this

4:12:02right here. Um, but it still scrapes

4:12:03websites. Then we have get crawl status,

4:12:06which is you being able to get the

4:12:08status of whether this is done or not.

4:12:10So, you send a request. You're saying,

4:12:12"Hey, can you just go inside this

4:12:13website and get absolutely everything

4:12:14that you that you have?" And this is

4:12:16saying, "Okay, the status is approved.

4:12:18Everything's good. You can move

4:12:19forward." Then we have extract data. So,

4:12:21in case we want to tell it, "Hey, go

4:12:22inside the website and extract the

4:12:24email, extract whatever it is." Then we

4:12:26have get extract status, because the way

4:12:28that these work is that you send the

4:12:29request at first and then you get the

4:12:31status. So, send the request and get the

4:12:32status. And then custom API calls, which

4:12:34is not going to in case you want to do

4:12:36some more complex stuff.

4:12:37So, in this case, we're just going to

4:12:39use scrape a URL and get its content.

4:12:41So, I'm just going to add my website. Go

4:12:42here. Let me delete this.

4:12:44Looks crazy. Um,

4:12:47and I'm going to press execute step.

4:12:49And what this will now do, if you go to

4:12:51schema, is it would actually

4:12:54extract the text. So, in comparison to

4:12:56the HTTP node that we just used, this

4:12:58doesn't give us the HTML, but it

4:13:00automatically

4:13:02does the job that these two do, right?

4:13:04It goes inside the website and it gives

4:13:06me the text, not the HTML. So, it's

4:13:08condensed. So, you can see here, right?

4:13:10Zoom out.

4:13:12This is the text of the website. Plus,

4:13:14we also get the metadata. So, we get the

4:13:16description, and we get a bunch more

4:13:18stuff that we can use for whatever it

4:13:20is. And bear in mind that this

4:13:21Firecrawl, I believe it's free.

4:13:24Uh, they give you free credits every

4:13:25month. So, you have about 525 credits. I

4:13:28believe that each scrape is about two

4:13:31two credits per scrape. But as I

4:13:32mentioned, if you want to do something

4:13:33more complex, you can also extract the

4:13:35data, which allows you to put a prompt

4:13:37saying, "Hey, can you extract this for

4:13:38me from the website?" And then you can

4:13:40put a URL here, and that extracts the

4:13:42exact thing that you asked it to

4:13:43extract. But in theory, what this would

4:13:45look like is you have the URL, so you

4:13:47would scrape it. You would do this whole

4:13:48thing. Then you add the markdown, which

4:13:51is just a way that you write English for

4:13:52computers, per se.

4:13:54And then you add this to an AI step to

4:13:57extract the data that you want, to

4:13:58extract maybe what the offers of the

4:14:00company, uh, who are they targeting, for

4:14:02whatever use case you have. Now, if

4:14:04Firecrawl is great if you want a clean

4:14:06readable website content. As you

4:14:07mentioned,

4:14:09we are doing the job of these two just

4:14:11by using one node. You're also able to

4:14:13scrape modern uh, slash dynamic

4:14:15websites, which are websites that change

4:14:17over time,

4:14:18which is great. And if you want data

4:14:20safe from bans and errors. So, there

4:14:22isn't really any IP banning like HTTP,

4:14:25because behind this node right here,

4:14:28there's a ton of code that happens in

4:14:29the back end, which allows you to be

4:14:31more safe when you scrape. And the pros

4:14:33here is handles JavaScript sites easily,

4:14:34like I mentioned, so modern and dynamic

4:14:36websites. It returns clean markdown or

4:14:38JSON, which is not the full HTML, but

4:14:40the thing that we actually want from the

4:14:42website, which is the text. It uses

4:14:44random proxies to avoid bans. Uh, so

4:14:46when you hear proxies, it just means

4:14:47that it's like sort of some things in

4:14:49the back end, in the code behind this

4:14:51website, uh, when it actually scrapes,

4:14:53that make it safe for you to actually do

4:14:55it, right? So, you don't actually get

4:14:56banned.

4:14:58And can map, search, or extract data at

4:15:00scale. So, this is scalable, much more

4:15:02scalable than this, because this only

4:15:04works for a few sites and then you get

4:15:05banned or something bad happens. But in

4:15:08this case, because it's safer, it's also

4:15:09more scalable over time.

4:15:12The only cons of this is that it needs

4:15:13an API key plus a small cost per crawl.

4:15:16So, as we saw, this is not free. I mean,

4:15:18it is free,

4:15:19but if you want to go above this, then

4:15:21you're going to have to pay. And I

4:15:22believe that if I go to the website,

4:15:24I go to pricing,

4:15:27then we have per credits, right? So, we

4:15:29have 500 credits for free.

4:15:32And if you want

4:15:343,000 credits, you have to pay $16 a

4:15:36month, 16 euros a month,

4:15:37which is not bad. Um, but it only

4:15:39depends of how many credits you need.

4:15:41All right. And each scrape takes about

4:15:43two credits.

4:15:44You can scrape about 1,500 websites, um,

4:15:46using 3,000 credits, depending on the

4:15:49website and depending how complex it is.

4:15:50And then it's slightly slower than a raw

4:15:52HTTP request. So, this takes a bit more

4:15:54time uh, just because there's more stuff

4:15:56in the back end. As you can see here, if

4:15:58I go to execute step, one, two.

4:16:01Well, actually pretty fast. Uh, and

4:16:03here,

4:16:05if I just go to Gen Solutions,

4:16:08it's much faster, right? Like maybe half

4:16:10the time. And the third method is Apify.

4:16:13Now, I've made a full masterclass on

4:16:14Apify, exactly how it works and

4:16:16different use cases that you can use

4:16:17with Apify. You can check it out up

4:16:19here. But if I go to Apify platform,

4:16:21apify.com, the way that I would describe

4:16:23this is the Amazon for scrapers. So,

4:16:25just like on Amazon, people sell

4:16:27something and others buy something.

4:16:29There's consumers and there's sellers.

4:16:30In this case, the consumers is us. We're

4:16:32going inside the platform to say, "Hey,

4:16:34I want to scrape some Instagram

4:16:36profiles."

4:16:37And on the seller side, it's like, "Hey,

4:16:39I just built a scraper that you can use

4:16:41to scrape Instagram profiles, but you

4:16:42have to pay me or you have to do some

4:16:44sort of exchange of of credits or

4:16:46something like that." And so, when you

4:16:47make an account on Apify, you can go to

4:16:49console,

4:16:50and important thing here is that on the

4:16:53bottom, you see that we have 8 gigabytes

4:16:55of RAM, which is memory, and we have $5

4:16:58for free every single month. Now, if you

4:17:00do the math here, depending on which

4:17:02scraper you use, it's free, right?

4:17:04Depending on how much you use it. And

4:17:06so, this is great because it allows us

4:17:07to scrape tons more stuff than something

4:17:10like Firecrawl or definitely HTTP,

4:17:12because now we have the ability to

4:17:13scrape Google Maps, Facebook, TikTok,

4:17:15tons of stuff that you just simply can't

4:17:17do with Firecrawl or HTTP.

4:17:20But in this case, let's just do the

4:17:22website content crawler, right? So, the

4:17:23first step is actually connecting n8n to

4:17:25Apify. So, I'm going to go to the run an

4:17:27actor, which you can find Apify here.

4:17:30You can do run an actor.

4:17:32Actions, run an actor.

4:17:34And by the way, actor is just the the

4:17:36scraper. So, we call them scraper. Like

4:17:37the Amazon product is called in this

4:17:39case an actor.

4:17:41The way to connect it is go here, press

4:17:43plus, then go back here, go to settings,

4:17:46I believe. Yes. And then go to API

4:17:48integrations, and you You copy this.

4:17:51Bring it back.

4:17:53And go to API key. And save.

4:17:56And name it whatever you want. Press

4:17:58save. And now you have your account

4:17:59connected. And now the resource is

4:18:01actor. The action that we're taking is

4:18:03run an actor. The actor source is

4:18:05recently run actors. And the actor in

4:18:07this case, you can choose

4:18:09Um in this case you want to use the

4:18:10website content crawler. Which you can

4:18:12find right here. You can go to Apify

4:18:15Store.

4:18:16Go to website. Well, in this case you

4:18:17can see it here.

4:18:19And let's say you didn't see that. You

4:18:20can go website content crawler.

4:18:23Press here. And now you can start using

4:18:26this scraper right away. And like I

4:18:27mentioned, this scraper, what it is,

4:18:29it's something that Well, in this case

4:18:31it was built by Apify itself, the

4:18:33platform. But usually we have

4:18:35random people like Let me show you.

4:18:37We have Compass. We have API Dojo. We

4:18:40have Clockwork.

4:18:41We have Curious Coder and some other

4:18:43people who actually build these scrapers

4:18:45and make money out of them. So as you

4:18:46can see here, the pricing is pay per

4:18:48usage. So you pay per run. But since we

4:18:51have $5 of free credits, each run I

4:18:53believe is a few cents. We'll see when

4:18:55we actually run it. Um but it's very

4:18:57very cheap. So in this case, you just

4:18:58want to just test it. Just press start.

4:19:00This will be an automatic thing that

4:19:01will be there at default.

4:19:03When you press start, what this will

4:19:05look like is that it will start running.

4:19:07We'll show you that it's running.

4:19:09And here it will show you the results.

4:19:11The request, the amount of usage that it

4:19:12takes to script the website, and the

4:19:14duration, and also the date. And down

4:19:16here you can see the actor getting the

4:19:18data. Now an important thing here is

4:19:19that we currently just used Apify's

4:19:22platform to scrape. But ideally we want

4:19:24to use it within our automations. And so

4:19:26right here, we can see that we have the

4:19:27full text of the website, which is

4:19:29great.

4:19:30And now in order for us to set this

4:19:32scraper up, all we have to do is go back

4:19:34to n8n. I can choose the website content

4:19:36crawler. And now we need an input JSON.

4:19:39So an input JSON is something that you

4:19:40can find right here.

4:19:41>> [music]

4:19:42>> And right here, there's two different

4:19:43ways that you can run it. The first way

4:19:44is manual, where you can start adding

4:19:45the URL of the website, the different

4:19:47types of crawlers, which is optional,

4:19:49but you have different types. So adapt

4:19:51to switching between browser and raw

4:19:52HTTP, which by the way makes no sense to

4:19:55anybody. And then we can use the crawler

4:19:56type, which is the type of thing or the

4:19:59type of way that we actually crawl the

4:20:01website. Crawl just means extract all

4:20:02the data that you can then apply to the

4:20:05actual [music] scrape.

4:20:06And then there's also stuff like crawler

4:20:07settings, HTML processing, output

4:20:10settings, and run options, which are all

4:20:12things that we can change. But to keep

4:20:13it simple, we will not change anything.

4:20:15All we have to do is go to JSON, which

4:20:17is the way that we actually use this in

4:20:19the automation.

4:20:21All I have to do is copy this.

4:20:24I have to go back to n8n.

4:20:26I can delete this. I can paste the URL.

4:20:29Well, not the URL, the JSON.

4:20:31And now all I have to do is change the

4:20:33website, right? With the URL. In this

4:20:35case, let's leave this right here. I can

4:20:37now press execute step.

4:20:39If I go back, I can see in the runs

4:20:41this is now running.

4:20:43So we have a new thing running

4:20:44automatically, right? Without going into

4:20:46the actual platform,

4:20:47which is how you use it within your

4:20:48automations. All right. So I realized

4:20:50there was an issue here. And the issue

4:20:52was that I actually exceeded my memory,

4:20:53even though it doesn't say here, but

4:20:55I've been using this a lot more than you

4:20:56think. Um but if you're new to this, you

4:20:58will not have that problem. So I'm going

4:20:59to sign out and log in with a different

4:21:01account. So what I did here is I just

4:21:02changed account cuz the other one was

4:21:04maxed out. And now the actor is running.

4:21:06So we can wait for the information here.

4:21:08All right. So it just finished running.

4:21:09And we get this data right here. As you

4:21:11can see, I told you that we don't

4:21:12actually get the text of the website.

4:21:14What we get is something called a

4:21:16default data set ID, which I can copy.

4:21:20And then Well, not copy, but go to the

4:21:21next step. So let me just pin this.

4:21:23Press P so I don't have to rerun this

4:21:24again.

4:21:25And right here, I can go to schema. I

4:21:29can look for the default data set ID,

4:21:31which is right here.

4:21:33And I can give it as well.

4:21:36And make sure that your connection is

4:21:38correct. And now if I press execute

4:21:40step, I can see that I have the whole

4:21:41JSON here. And down here I have the text

4:21:45of the website, which I can then use for

4:21:47the next steps. Now you should only be

4:21:48using Apify when when you're doing

4:21:50large-scale scraping or complex projects

4:21:52like LinkedIn, Amazon, because Apify is

4:21:54known not for scraping just websites,

4:21:57but for scraping Instagram profiles or

4:21:59TikTok profiles or Facebook or LinkedIn.

4:22:01If I go to here, LinkedIn, a platform

4:22:03that natively does not want to get

4:22:05scraped, um you can see that we can

4:22:07scrape it using this stuff using these

4:22:09different scrapers. And we have tons of

4:22:11options as well. And also when you need

4:22:12to use pre-built scrapers or browser

4:22:14automation, because these right here are

4:22:16all pre-built scrapers that we can use

4:22:19to do whatever it is that we wanted to.

4:22:20And we have a big variety of different

4:22:22scrapers that we can use for different

4:22:24use cases. Like I mentioned, social

4:22:25media is a big one, uh which is where we

4:22:27use Apify for a lot of these things. Uh

4:22:29but there's tons more as well. Now the

4:22:31pros is that we have a huge library of

4:22:32pre-made scrapers, actors. It's

4:22:34cloud-based, so there's no setup. It

4:22:36handles login-based or complex sites,

4:22:38which is very good, like LinkedIn,

4:22:39something that with a HTTP node, you

4:22:42just can't do because there's an

4:22:43encryption, there's a password. And so

4:22:45what they have is they have proxies that

4:22:47go around the password. They make it

4:22:49seem like they're an actual user to then

4:22:51script the data. And the cons is that it

4:22:53can get quite expensive at scale,

4:22:54depending on the scraper that you use,

4:22:56depending on the actor.

4:22:57More setup steps for custom logic, and

4:23:00overkill for small simple scripts,

4:23:02right?

4:23:03So if you're using something really

4:23:04really simple, you're better off going

4:23:06with something like Firecrawl, which is

4:23:08simple, is very easy to set up, and it's

4:23:10just made for websites. So now that you

4:23:12have the skills to build workflows with

4:23:14AI agents, let's focus on building just

4:23:17AI workflows. Now don't get me wrong, AI

4:23:19agents are extremely powerful when you

4:23:20have to build them for businesses. But

4:23:22the reality is that most of the times we

4:23:25simply don't want an AI agent inside the

4:23:27workflow because it's much easier just

4:23:29to have a simple workflow. And tons of

4:23:30businesses just need something simple

4:23:33rather than anything complex that will

4:23:34just make it harder, that is not

4:23:36scalable, and that we simply just can't

4:23:38put to production. And so in the next

4:23:39module, we'll look at real-world AI

4:23:41workflows, projects that we build step

4:23:43by step for businesses. We'll look at

4:23:45everything again from finance,

4:23:47operations, sales, and marketing. So

4:23:48you'll be able to build AI agents and

4:23:50workflows at the same time.

Module 5

4:23:58I built no-code rag agent inside of n8n,

4:24:01which allows me to search through

4:24:02hundreds of documents all within

4:24:04seconds. All right. So this agent is

4:24:05split up into two different steps. The

4:24:07first step is new document into

4:24:08Superbase. So if I go here to the SOPs,

4:24:10which ChatGPT made a quick one, I can

4:24:12see that I have an SOP for a creative

4:24:14agency. All I have to do right here is

4:24:16go to file. I can download it as a PDF.

4:24:19And this is a thing that I have to

4:24:20upload into Google Drive. As soon as I

4:24:22upload it into Google Drive, it will

4:24:24download here. And I just have to press

4:24:27execute workflow. Of course, this

4:24:28workflow will automatically be will be

4:24:30executed every on a polling trigger, so

4:24:31every day or every hour, whatever it is.

4:24:33And now this file is stored in our

4:24:35Superbase, which is the vector database

4:24:37that we have here. And now all I have to

4:24:39do is go to our next agent, which is the

4:24:41agent that you'll be using, and go to

4:24:43open chat and ask any questions we have.

4:24:45So if I go to SOPs, I can see that one

4:24:47of the questions one of the things that

4:24:48I mentioned is that ClickUp or Asana or

4:24:50Notion are used as a project management

4:24:52tool. So if I go here and say What tools

4:24:56do we use

4:24:58for our project management?

4:25:01What it's doing now, it's it's querying

4:25:03the agent. So it's querying the actual

4:25:04database that we stored the information

4:25:06in. And it's going to give us an answer.

4:25:07In this case, it's ClickUp. All right.

4:25:09If I go here, the answer was ClickUp.

4:25:12All right. So that's exactly how the

4:25:13agent works. And if you have hundreds of

4:25:14documents, it will scan through hundreds

4:25:16of documents and it will give you a

4:25:17concise answer based on what it found.

4:25:18All right. So let's go to Miro and let

4:25:20me show you exactly how it works and

4:25:21what the whole thing's about. So the

4:25:23source data is essentially what is that

4:25:24thing that we give the agent? What is

4:25:26that thing that we give the database for

4:25:27it to pull information from when we ask

4:25:29any questions? Uh in this case, it can

4:25:31be in the form of video, audio, image,

4:25:33or text.

4:25:34We use PDF, but you can use any of

4:25:36these. Now for the source data, for the

4:25:38data, for the file, whatever you're

4:25:39using, uh to be added to the database,

4:25:42again for the agent to pull information

4:25:43from, it needs to be transformed into an

4:25:46embedding. Now what the embedding means

4:25:48is that it takes the file and turns it

4:25:49into these numbers, into vectors, right?

4:25:51Which gives me a bad bad um memory of

4:25:54high school. Uh but the embeddings right

4:25:56here are 0100100.

4:25:59It's just a bunch of numbers that

4:26:00represent the file that we gave it. And

4:26:02then these vectors, so this is a vector

4:26:04for a specific file, will be stored into

4:26:06a vector database, which is a database

4:26:09which has different vectors for

4:26:10different files. And that's the thing

4:26:12that the agent is going to query, is

4:26:13going to ask when it needs to find

4:26:15anything that we asked it. And

4:26:17fundamentally, that's how a file gets

4:26:19turned into a vector, which gets stored

4:26:21into a vector database. It might sound

4:26:23complex, but it's actually very very

4:26:24easy because a file is a vector and

4:26:26database is just full of vectors, full

4:26:28of files. Now, how does it work when you

4:26:30actually ask it a question? How does it

4:26:31pull information from the vector

4:26:32database to give us an answer? Well, the

4:26:34question that you asked it is in text.

4:26:35You say, "Hey, what is that XYZ?" Now

4:26:38those different letters that you asked

4:26:40those sentences that you give or that

4:26:41question gets turned into an embedding,

4:26:44which gets matched to the embeddings

4:26:45here. And that's how it gives you an

4:26:46answer cuz it matches the different

4:26:48numbers. All right. So let's go to n8n.

4:26:49Let me go here and we can actually build

4:26:51one from scratch.

4:26:53So the first one, as I mentioned, is

4:26:55pulling data

4:26:57from a Google Drive. And that will be

4:26:58the thing that will be stored into the

4:27:00Superbase. So ideally your team will

4:27:02just drop files in Google Drive and the

4:27:04automation just runs every every so

4:27:06often, every 1 hour, every day, whatever

4:27:07it is. So first step is actually making

4:27:10the drive. So we made a drive. We called

4:27:12it rag example. And that's the thing

4:27:13that you want to do on a Google Drive

4:27:14because that's the place that we use to

4:27:15just drop the documents for it to go to

4:27:17the Superbase.

4:27:18And then we go here. And one of the

4:27:20first steps here is watching every new

4:27:22file that is created because that's the

4:27:23thing that starts the automation, right?

4:27:24We don't want to automatically or we

4:27:26don't want to manually run the

4:27:27automation every single time. We want

4:27:28the automation to be smart enough to

4:27:30know when a file is created in the drive

4:27:32so that it pulls it to the database. So

4:27:34the first step here is Google Drive.

4:27:37And the action is

4:27:39on changes involving a specific folder.

4:27:43So what this is is you're watching a

4:27:44specific change within a folder. And the

4:27:46to change itself is a new file being

4:27:48created. So, all you have to do to

4:27:49connect Google Drive to your N8N is go

4:27:52here and you need a client ID and client

4:27:54secret. I would recommend watching or

4:27:56asking the assistant exactly

4:27:57step-by-step what you can do. It's more

4:27:59of a longer process, um but it's very

4:28:01very easy. Let me know down below if you

4:28:03want a full tutorial where I can show

4:28:04you exactly how you can do it. Uh but

4:28:06once you connected your Google Drive,

4:28:08let me go here,

4:28:08>> [music]

4:28:09>> you'll have this.

4:28:10Then it's asking you poll times. This

4:28:12means how long or how often do you want

4:28:14to run the automation? So, in this case,

4:28:16we can do every minute, which is fine.

4:28:18And trigger on changes involved in the

4:28:20folder. Okay, that's fine because we

4:28:21want to change we want to watch changes

4:28:23inside the folder. The folder itself

4:28:24will be rag example, so rag example.

4:28:28So, here. And then what are we watching

4:28:30for? In this case, we're watching for a

4:28:31file being created, right? So, let me

4:28:33actually test this. Let me fetch test

4:28:35event.

4:28:37In this case,

4:28:39I think the file was the one I put it

4:28:41before, but let me do another one. So,

4:28:42let me delete this

4:28:45with the trash.

4:28:46And let me

4:28:47put it back here. So, I delete when one

4:28:49is here. Every minute it runs and it

4:28:50checks that it any document has been

4:28:52added. So, I can go here, fetch test

4:28:53event, and this right here has been

4:28:55added and this will be

4:28:57the file. So, let's see if that's the

4:28:59file that we have.

4:29:01Agency SOPs to PDF, [music]

4:29:03which is this one.

4:29:05Right, and that's the one that we're

4:29:06going to be adding to the actual

4:29:08database. All right, so now we have an

4:29:11automation set up where it triggers

4:29:12whenever a file is created inside of

4:29:14Google Drive. But how do we actually

4:29:15send a document from Google Drive to the

4:29:17vector database? Right? Well, in this

4:29:19case, to send any documents there, we

4:29:20have to download the file first because

4:29:22the vector database only

4:29:24gets or only intakes binary, which I

4:29:26will explain in just a second. But the

4:29:28way that we have to send a document in

4:29:30the vector database is in a very very

4:29:31specific format, which is in the binary

4:29:33format. So, all we have to do here is

4:29:35actually download the file before we

4:29:36send it to the vector database. And to

4:29:38download the file, you have to press

4:29:39plus, go to drive, and then you can

4:29:41download a file right here.

4:29:44Connect it, which is the same. File

4:29:46download, and then the file we don't

4:29:48want to select the file because we want

4:29:49it to be dynamic. We want it to change

4:29:50every single time,

4:29:51and we can do ID, and the ID of the file

4:29:54will be the one here. So, let me go

4:29:57down to the ID. There we go.

4:29:59And this is the ID of the file that

4:30:00changes every single time because it's a

4:30:02new file that we're doing. And that's

4:30:03the thing that's going to be added to

4:30:05the vector database.

4:30:07And if I go here, let me just pin this,

4:30:09which means that I'll already have this

4:30:10input. I can I don't have to rerun this.

4:30:12I can just use this as test data. I can

4:30:14add it to the step,

4:30:16and I can see that we have binary right

4:30:18here.

4:30:19This is exactly the type of input or the

4:30:21type of thing that goes into the vector

4:30:23database,

4:30:24which you don't get in the previous one.

4:30:26So, we have to download it first.

4:30:28All right. Now, once we downloaded it,

4:30:29we can go to Superbase because that's

4:30:31the software that we're using to

4:30:32actually add a document to. Superbase

4:30:34vector store.

4:30:36Add documents to vector store because

4:30:37we're adding a document,

4:30:39and you'll come on this page.

4:30:40Now, once you come on this page, in

4:30:41order for us to connect your Superbase

4:30:43vector store, I'm going to go through

4:30:44everything step-by-step. So, we go here,

4:30:47create new credential,

4:30:48and then the service role secret will

4:30:50should be the thing in Superbase. So,

4:30:52let me go here. Let me actually log out

4:30:54and make a new account so you guys can

4:30:55see exactly what it looks like. Let's

4:30:56sign up now, actually.

4:30:59Let me do my email,

4:31:04and then my password.

4:31:08Got

4:31:09which is the same password I use for

4:31:11every single email, which is not good.

4:31:12Uh sign up.

4:31:15Check your email notification. So, this

4:31:17is the email that I got. Confirm email

4:31:18address, and this will be the account

4:31:20that is just made for Superbase.

4:31:24All we have to do is organization,

4:31:26personal. There you go. Create

4:31:27organization.

4:31:29And that's I just want to walk you

4:31:30through step-by-step because that's

4:31:31exactly what you have to do when you do

4:31:32this.

4:31:33And you can create a new project. Uh let

4:31:35me just

4:31:36let me just cancel. [music] That's fine.

4:31:38So, that's it. So, now actually we can

4:31:40create a new project because we actually

4:31:41need this.

4:31:42Uh let me do N8N

4:31:44YouTube rag agent.

4:31:47The password is

4:31:51not strong enough.

4:31:52Create a new project, and now we have

4:31:54the project that is being added to

4:31:56Superbase. All right, cool. So, once you

4:31:58get to this page, there's a few things

4:31:59we have to do. Now, the first thing we

4:32:00have to do is we have to connect our

4:32:03Superbase to N8N. And then the second

4:32:06thing we have to do is actually make the

4:32:07database that we add the document to.

4:32:09So, in order for us to connect N8N, we

4:32:11have to have a service role secret. In

4:32:14order to have the service role secret,

4:32:15we have to go, I believe, to project

4:32:16settings, API keys.

4:32:19There we go. Service role secret. So, we

4:32:21can reveal. Let me just copy this,

4:32:24and this is the thing that you want to

4:32:25paste into N8N.

4:32:27>> [music]

4:32:27>> So, on here.

4:32:28And you can save it.

4:32:31Couldn't couldn't connect with these

4:32:32settings. Let's see why. Okay, and so

4:32:34the reason why it says couldn't connect

4:32:35settings because I'm missing my host,

4:32:36which I didn't even see. Uh now, so to

4:32:38connect this host, you have to go to

4:32:40Superbase.

4:32:41You have to go to, I believe, project

4:32:43overview. Yeah. And then down here,

4:32:46there should be a project URL, which is

4:32:47this one right here.

4:32:49So, you should copy, go back to N8N,

4:32:52paste it, and now you can save it.

4:32:54And now the connection is tested

4:32:55successfully. Let me do N8N YouTube

4:32:59uh

4:33:03Name your connections right cuz don't be

4:33:05like me. Save it. Okay, so now that we

4:33:06connected our N8N to Superbase, we have

4:33:09to put operations mode, which is insert

4:33:11document because that's the thing that

4:33:12we're doing. We're inserting a document

4:33:14into a database. But the problem is

4:33:16there's no database to add the documents

4:33:18to. So, the next step is this.

4:33:20All we have to do to connect or to add a

4:33:22database is to go to docs,

4:33:25scroll down

4:33:26to

4:33:27uh where is it? Yeah, this one here. So,

4:33:30a quick start for setting up your vector

4:33:31store. Press this,

4:33:33>> [music]

4:33:33>> and you'll come on this page. All you

4:33:34have to do here, just have to copy this,

4:33:37right? Don't get overwhelmed. Just

4:33:38follow me step-by-step. You go to

4:33:40Superbase, and then you have to go to

4:33:42this right here, SQL editor.

4:33:45Just paste this here.

4:33:47Paste it. There you go, like this.

4:33:49Let me zoom out. And now you will have

4:33:51this code here. Now, all you have to do

4:33:53is run it.

4:33:54Once you run it, on the bottom right,

4:33:57it should say success, no rows returned.

4:33:59[music]

4:34:00Okay, so once that's done, once you

4:34:02actually made this, on the table editor,

4:34:04you can see that we just made a table

4:34:05called documents. And this right here is

4:34:07the database that we're going to be

4:34:08adding document to. So, if I go back to

4:34:10N8N, I can now choose

4:34:13refresh. Let's refresh, actually,

4:34:15cuz sometimes it trips out.

4:34:17And it takes a while to actually update.

4:34:18I'm going to go here,

4:34:20and I'll have documents now from the

4:34:21list. And so, that's document that's the

4:34:24the place where we actually get to store

4:34:25the document in. If I go to options,

4:34:28can match the options, map documents,

4:34:30and leave this as is. And the embedding

4:34:31max size is 200, which is fine. And now,

4:34:34in order for us to actually make it

4:34:36work, we have to connect two different

4:34:38things. The first one is the embedding,

4:34:40which is what is that AI or I mentioned

4:34:43before that we have to take the file and

4:34:44turn it into different numbers. So, we

4:34:45have to use AI for this, which in this

4:34:46case, we could use OpenAI right here.

4:34:49And we can leave this as text embedding

4:34:51three small. Again, to connect your

4:34:53OpenAI to N8N, all you have to do is get

4:34:55the API key, which you can find on

4:34:57platform.openai.com.

4:34:58Let me go here. Let me actually show

4:34:59you.

4:35:00platform.openai.com. You log in.

4:35:02Dashboard. On the left-hand side, you

4:35:04have API keys.

4:35:06Create a secret key. Name it whatever

4:35:07you want. So, let's do N8N test.

4:35:11YouTube.

4:35:13Secret key. Copy this.

4:35:16And now

4:35:17we can go to N8N. We can paste this.

4:35:20Name this

4:35:22test August 19th.

4:35:24Oh god.

4:35:25Test August 19th.

4:35:28We can save this, and now the

4:35:29connection's done. Okay, that's how you

4:35:30connect your OpenAI to N8N.

4:35:32Um and now for the model itself, you

4:35:34want to connect this to a text embedding

4:35:36three small. It doesn't really matter.

4:35:37Um just do this one. This is the fastest

4:35:39and uh probably the most efficient for

4:35:41now.

4:35:42And this is the thing again that's going

4:35:43to take the file, turn it into numbers,

4:35:45to then add it to the database. And now,

4:35:47for us to actually add a document, we

4:35:49have to do the default data loader. So,

4:35:51loads data from previous steps into the

4:35:53workflow. So, let me go here. I can

4:35:55press this.

4:35:55>> [music]

4:35:56>> And in this case, we don't want to do

4:35:57JSON, but I mentioned before that we

4:35:58want to do it as a binary, which means

4:36:00that it's asking us what is that type of

4:36:02file? What is the type of input that we

4:36:04give you? In this case, it's binary. So,

4:36:05load all data input. Yes, that's fine.

4:36:08Automatic detect my own data.

4:36:09Yes, that's fine.

4:36:11And simple is fine. That's all good.

4:36:14Is there anything else that we want? No,

4:36:15that's it. Okay, so in this case, data

4:36:17format automatically detected my data.

4:36:18Text splitting is simple, and that's all

4:36:20we have to do. Now, this right here just

4:36:21means it splits every 1,000 characters

4:36:23within a 200 character overlap. So,

4:36:25before if you saw, the PDF was actually

4:36:28stored into 10 different rows, 11

4:36:30different rows. It's because it actually

4:36:32split it up. So,

4:36:34this right here is used. Then it goes

4:36:36here to embeddings, turns the file into

4:36:38the embedding, and then in order for us

4:36:40to actually store the document, we have

4:36:41to use this one right here.

4:36:43So, let's test this. Let's test this one

4:36:44right here. Let me go to unpin this.

4:36:48Let me go to Google Drive.

4:36:50Let me just

4:36:50>> [music]

4:36:51>> re-put another one.

4:36:53SOPs.

4:36:54Replace.

4:36:56That's replacing the file. I can go back

4:36:58to N8N.

4:36:59And now if I execute the workflow,

4:37:02it should work. Let me go here,

4:37:03downloads the file.

4:37:04It goes here.

4:37:05Okay, everything was successful. And if

4:37:07I go to N8N YouTube agent, I can see

4:37:10that the data was stored here. And the

4:37:11data has the ID, which is just the rows,

4:37:14right? Every new Every new Every new

4:37:16Every new entry is one.

4:37:17And then content, which is this, which

4:37:19is a bunch of text. Metadata, which is

4:37:21JSON,

4:37:22which is a bunch of stuff as well.

4:37:24Embedding, which is again the thing that

4:37:25I mentioned,

4:37:27which is different numbers. These are

4:37:29the vectors, which might look a bit

4:37:30intimidating at the start, uh but these

4:37:32are the series of numbers that we have

4:37:33that are stored in the vector database,

4:37:35which is the thing that's going to allow

4:37:36us to actually ask it questions.

4:37:38All right, so once this is done, we have

4:37:39to to here, and we can get on to the

4:37:42second agent because the second agent is

4:37:44what the real sauce is about because we

4:37:46can actually ask it any questions about

4:37:47the document.

4:37:49So,

4:37:50we can keep this on the same workflow.

4:37:51So, let me save this.

4:37:53Right here we have uploaded document,

4:37:55downloaded and then added it to the

4:37:56database. Now, we can start by actually

4:37:58querying the Superbase. So, for us to

4:38:01actually create a Superbase, if you

4:38:02really think about it, we have to text

4:38:04the agent. In order for us to make a

4:38:05text agent, we have to just have to add

4:38:07an AI agent.

4:38:08Which will

4:38:10go here and then we just have to connect

4:38:12it to a chat trigger. Which means

4:38:16that we have a chat connected to the

4:38:17agent. So, we can talk to the agent.

4:38:20All right. So, there's a few things. Uh

4:38:22the chat agent, so this right here,

4:38:24I can just talk to it.

4:38:26Right? And it will send the information

4:38:27and it will send it here. It will do

4:38:28whatever.

4:38:29And then we have the AI agent. In the AI

4:38:31agent,

4:38:32the source or prompt, meaning what is

4:38:34the input? In this case, it's just

4:38:35connected to the chat trigger node

4:38:37because this is the chat trigger node.

4:38:40We can leave this as is. The prompt is

4:38:41fine. Uh require specific output format?

4:38:43No, we don't. And now it's asking us to

4:38:46do a system message. So, that's the

4:38:47thing that you want to add to the AI

4:38:48agent.

4:38:50Let me go here, expressions. I can do it

4:38:52full screen. And now I can start adding

4:38:54the prompt. Now, for the prompt itself,

4:38:55we usually use a structure, which is

4:38:57overview,

4:38:59tools,

4:39:03and then rules.

4:39:07Right? For overview, we can say, "You

4:39:09are a

4:39:11helpful, intelligent

4:39:14uh information

4:39:16extracting

4:39:17I don't even know if that makes sense,

4:39:18but extracting assistant that helps me

4:39:22to

4:39:23answer or

4:39:26that answers

4:39:29any queries

4:39:34that come to you."

4:39:36Okay, that's fine. For the tools itself,

4:39:39um we have to add.

4:39:41And then for the rules, we can add as

4:39:42well later. So, overview, you're a

4:39:44helpful, intelligent information

4:39:44extracting assistant answers my any

4:39:46queries that come to you. And then

4:39:47tools, we can add the tool. In this

4:39:48case, we only have one, which is

4:39:50getting the uh Superbase for the vector

4:39:52database. And then we have the rules.

4:39:54If I go here,

4:39:55we can now connect this to a chat model,

4:39:57which in this case we can do Open AI.

4:40:00You can't see it right now cuz my face

4:40:01is there, but Open AI chat model is

4:40:03here. You can press this. And now again,

4:40:05we already connected Open AI to NNN, so

4:40:07we just have the connection here. In the

4:40:09model, leave this as 4. from One Minute.

4:40:11We don't have to connect memory. Well,

4:40:13actually no, we have to. We can, right?

4:40:15We can. Uh for simple memory, just so

4:40:17that it actually remembers the previous

4:40:19questions that we asked it.

4:40:20We can leave this as this. This is fine.

4:40:22And now this is asking, "How many past

4:40:24interactions does the model receive as

4:40:25context?"

4:40:26Five is fine. You can add more if you

4:40:27want.

4:40:28In case you're having longer

4:40:29conversations where it needs to remember

4:40:30what you said before.

4:40:32And now for the real sauce of the AI

4:40:33agent, it's the Superbase. So, if I go

4:40:35here, Superbase vector store,

4:40:38you can see that now the tool is this

4:40:39one here.

4:40:40So, that's the first Let's rename this

4:40:41to vector

4:40:44store.

4:40:47Rename.

4:40:48If I go in here, I can then have

4:40:50different settings. The first setting is

4:40:51obviously the connection, which we

4:40:52already made before. Then the operation,

4:40:54which is what is that thing that we're

4:40:55doing? In this case, it's retrieving

4:40:56documents as tool for AI agent, which is

4:40:58fine.

4:40:59Again, we previously we had insert

4:41:00documents.

4:41:02The description is

4:41:03You can just leave this as work with

4:41:05data

4:41:06from the Superbase

4:41:09vector database.

4:41:11Right?

4:41:11>> [music]

4:41:11>> And now the table The table is a

4:41:13database, right? That is the thing that

4:41:15we just made, this one here. So, if I go

4:41:17here

4:41:18and I go to it only gives me one option

4:41:20because we only have one table,

4:41:21documents. The limit is fine. Include

4:41:23metadata.

4:41:25Actually, I don't

4:41:26This says, "Number of top results to

4:41:27fetch the I don't think we need a limit.

4:41:29I think we can just not have a I not

4:41:31have one because it can pull any any any

4:41:33number of results.

4:41:34Include metadata.

4:41:36What is this? Whether or not to include

4:41:37my document metadata. It's fine. All

4:41:39right. So, now we can connect this to an

4:41:41embedding because just like we did this

4:41:43above, we need to embed, which means

4:41:45that we need to turn our question into

4:41:47numbers so that it can ask it any

4:41:50questions on a vector database. So, we

4:41:52can go here,

4:41:53embedding. And by the way, you can

4:41:54connect this to the same one, right? But

4:41:57to make it less complicated, we just

4:41:58have our own. Uh so, let's go here,

4:42:00embedding is Open AI.

4:42:02Leave this as before, which is fine. And

4:42:04now this is embedded. So, in theory now,

4:42:07when we ask any questions, it will go to

4:42:08the AI agent. It will think through its

4:42:10its uh its brain, which is the LLM.

4:42:12It will remember any conversation that

4:42:14we had, but most importantly, it will

4:42:15send the information here.

4:42:17First, it will embed it, so it will turn

4:42:18it our questions into numbers. It will

4:42:20then match it up against any numbers

4:42:22that we have, any vectors that we have

4:42:23in the vector database. It will then

4:42:25send us back uh an answer in natural

4:42:27language, right? Like before, [music]

4:42:28like I showed you.

4:42:30Now, one thing I need to finish is the

4:42:31prompt. So,

4:42:33let me go here. Let me go here. And now

4:42:35for the tools, we have vector store.

4:42:38Very important that you name the tool

4:42:40the same as the tool that you actually

4:42:42have.

4:42:43What I mean by this is like vector store

4:42:44needs to be the same name as this.

4:42:47If I rename this to something else,

4:42:48like vector store, make sure to update

4:42:50that into the prompt.

4:42:53Especially when you have more tools.

4:42:55So, vector store,

4:42:56this will always

4:43:00be used when

4:43:04answering

4:43:05any questions

4:43:07that the user

4:43:10might have.

4:43:12Now, rules. The only rule I have is

4:43:15Actually, I have two rules. The first

4:43:16one is you must always

4:43:19pull

4:43:20information

4:43:22from this from the vector store.

4:43:26That's it. And then your answers

4:43:30need to be concise and to the point.

4:43:34Uh okay. So, why do I say this will

4:43:36always be used? Because previously when

4:43:38I actually made the

4:43:40this agent, uh I was asking it a

4:43:42question. It was using like the natural

4:43:43LLM to actually answer it, like what it

4:43:46what is a project management tool that

4:43:47we're using? It would use the LLM to

4:43:49search in the internet or search through

4:43:51like its own its own storage. But in

4:43:53this case, we only wanted to pull

4:43:54information from the vector store. Okay,

4:43:56that's why we're saying this. And then

4:43:58we always we always want the answer to

4:43:59be concise cuz I don't want it to give

4:44:00me a full paragraph um

4:44:02or a long long paragraph that we can't

4:44:03read.

4:44:04All right. So, I think that's it. Now,

4:44:06we can test this and if it goes wrong,

4:44:07we can

4:44:09we can obviously change it. So, let me

4:44:10go here.

4:44:11Let me say Let me go here. Let me

4:44:13>> [music]

4:44:13>> get something specific.

4:44:15What are the things that are included in

4:44:17the

4:44:18content production? [music]

4:44:20That's it.

4:44:21And it should say video, social media,

4:44:22copywriting.

4:44:24Let me go. What is included

4:44:28in our

4:44:29content production?

4:44:31So, what it's doing now, it's it's going

4:44:33to embed our answer. It's then going to

4:44:34query with the vector database,

4:44:36give us back an answer. And now it says

4:44:39that we have video production, social

4:44:40media, and copywriting. And if I go

4:44:41here, again I can see

4:44:43video, social media, and copywriting.

4:44:47So, there we go. Let me ask it another

4:44:47question. So, let's say I want to ask

4:44:49it,

4:44:50"What is inside content I mean, the

4:44:52social media?"

4:44:54So, say, "What is inside

4:44:58social media?"

4:45:02What it should say now is that we have

4:45:04content calendar managed in Notion, post

4:45:06schedule one a week.

4:45:08Content calendar is managed in Notion,

4:45:10post schedule once a week. As I said,

4:45:12this is insane, especially if you have

4:45:13hundreds and hundreds of documents

4:45:14inside the vector database, which allow

4:45:17you to pull information from these uh

4:45:19documents in in a matter of seconds. Cuz

4:45:22typically when I work with agencies,

4:45:23especially creative agencies or any

4:45:25other type of agencies, we work with a

4:45:26lot of them, they store their SOPs into

4:45:29a Google document, into multiple Google

4:45:31documents with tabs. And in order for

4:45:33them to actually ask any questions about

4:45:34the actual document, they have

4:45:39In this case, we just have a chat

4:45:41AI agent

4:45:42queries itself and then gives us back an

4:45:44answer in very, very simple way in just

4:45:46seconds. So, that right there is a full

4:45:47build for the rag agent inside of NNN

4:45:50that allows us to search through

4:45:51hundreds of documents that we have. In

4:45:52this case, I only used one, but imagine

4:45:54you can add multiple hundreds of

4:45:56documents inside a Google Drive, which

4:45:57will pull it into the vector database

4:45:59and then you can just ask it any

4:46:00questions that we want.

4:46:04Hey, in this video I'm going to show you

4:46:05how I built an AI support agent for an

4:46:08e-commerce store that automatically

4:46:09pulls in queries, classifies the query,

4:46:11then searches through our vector

4:46:12database for answers, drafts an email

4:46:14reply before learning our team to review

4:46:16the email and send it. Now, for

4:46:17businesses who receive a large amount of

4:46:19emails from customers asking questions,

4:46:21at least 90% of them are the same. These

4:46:23systems are amazing just because they

4:46:24save that time that you can now devote

4:46:25to actually growing the business. All

4:46:27right. So, I'm actually going to test it

4:46:28before I even explain exactly what

4:46:29everything does, just so you get to see

4:46:31the final outcome. So, I'm going to send

4:46:33myself an email saying,

4:46:35"Question

4:46:36about the return policy."

4:46:38>> [music]

4:46:38>> All right. So, I asked it the return

4:46:39policy plus the shipping location.

4:46:42Uh I'm going to say, "Thanks in

4:46:44advance."

4:46:45And you press send.

4:46:46Now, this right here will send it to the

4:46:48base email. So, this will be in theory

4:46:49the email that receives all the incoming

4:46:51queries from my customers.

4:46:53As you can see, we just got the email. I

4:46:54go here. I want to execute the workflow.

4:46:56So, this is going to run.

4:46:58It's then going to classify the email.

4:47:00It's going to then pull the answer from

4:47:01the vector database.

4:47:03It's going to drop an email.

4:47:04And then it's going to send us a message

4:47:05on Telegram informing us that a new

4:47:07inquiry came through. We have to review

4:47:08it and actually send the email. As you

4:47:09can see in Telegram, it says new inquiry

4:47:11received from the name.

4:47:13About is the question of the actual the

4:47:15subject line. And then the action is

4:47:17email drafted to your email. So, they

4:47:18know exactly that they have to go to the

4:47:19email and actually look at the email

4:47:20before sending it.

4:47:22And if I go to my email here, I can see

4:47:23that on drafts, I have one new draft.

4:47:25You can see that we have the return

4:47:26policy. We have the shipping locations

4:47:28and James at Novel Mart customer service

4:47:30team. All right, perfect. All right,

4:47:32cool. So, let's go through the whole

4:47:34process step by step. Now, you have an

4:47:35idea of what it actually does. Takes

4:47:36emails or takes emails with questions

4:47:38and then looks through our vector

4:47:39database, which is a database that has

4:47:41different

4:47:42the different documents and then sends

4:47:44back an email reply and then informs the

4:47:45team [music] to then go in drafts and

4:47:47actually send it to the customer. All

4:47:49right, so the first step here is

4:47:50actually incoming emails. So this will

4:47:51be the trigger on any incoming emails

4:47:53that come through. In this case, we have

4:47:54an inbox and for any businesses really,

4:47:56they have inboxes like

4:47:58a company name support.com and that's

4:48:01the inbox that they use to answer any

4:48:02incoming FAQs. So we will have this and

4:48:04this will be the domain or the actual

4:48:06inbox that we use to collect and then

4:48:08run the automation for the first step.

4:48:10So in order to connect our Gmail, we

4:48:11have to go here. Obviously choose the

4:48:13Gmail trigger.

4:48:15Create a credential and then you can

4:48:16sign in with Google and it'll take you

4:48:17through the whole process. It's very

4:48:18very easy. Just as a regular sign in

4:48:20with Google sort of thing. And then it's

4:48:22asking us for the poll times. The poll

4:48:23time says, "Hey, we're looking at your

4:48:25email, but how often do you want us to

4:48:26go through your email to make sure that

4:48:28we have all the questions?" In this

4:48:29case, you can put minute, hour, day,

4:48:31week, month, every X, custom. But I

4:48:34think every minute is fine. It depends

4:48:35on the amount of queries that they get.

4:48:37So I would ask the business, "Hey, how

4:48:38many queries do you get a month? How

4:48:40many queries do you get a day?" If they

4:48:41say, "Hey, we get about 1,000 a day or

4:48:43100 a day, whatever it is." Maybe we can

4:48:45run it every hour or every every 5

4:48:47minutes, right? But speed speed to lead

4:48:50and speed to questions is important

4:48:51because that builds up the brand and it

4:48:53just makes a part of better impact on

4:48:55the customer as well. So we can

4:48:56obviously do every minute, every hour

4:48:58and what so on. So again, it depends on

4:48:59on the amount of inquiries that they

4:49:00get. Then we have the event. So the

4:49:03event is, "Hey, what has happened?" Like

4:49:04what is the thing that we're watching

4:49:06for? In this case, is a message

4:49:07received. [music]

4:49:08Which is the only option here, right?

4:49:10And then simplify, just fine because we

4:49:12just want to keep it simple with with

4:49:14the way that the [music] the actual node

4:49:16is set up.

4:49:17Once this is done,

4:49:18right? Which is the again the email

4:49:20trigger. So I can actually fetch test

4:49:22event. I believe that we have Yeah, we

4:49:23don't have any emails anymore.

4:49:25Let me actually send myself an email so

4:49:26we can we can test this. 100. Hello.

4:49:30Hey,

4:49:31I need to know

4:49:33the shipping

4:49:35policy

4:49:36you have.

4:49:38I send it. Now I have to wait. Of

4:49:40course, when you have to run this for a

4:49:41customer, you have to automatically run

4:49:44this every 1 minute. But for this case,

4:49:46we just have to test. So I'm just going

4:49:48to send it to myself and wait for the

4:49:49email to come back. As you can see, we

4:49:51got the email here. I'll go here and I

4:49:52can fetch test event and we get the

4:49:54snippet, which is the email body, which

4:49:56is in this case is, "Hey, I need to know

4:49:58the shipping policy you have."

4:50:00And that's the thing that's going to be

4:50:01sent to the next step to actually

4:50:03classify whether this is a promotional

4:50:05thing or an actual FAQ. So,

4:50:08the next step here, actually before we

4:50:10get to this point, is we have to set the

4:50:12variable. Now, why we do this is because

4:50:14when we look at all these, we can get a

4:50:16bit overwhelmed and we don't really know

4:50:17where the where the actual text is. So

4:50:19we just want to basically make it as

4:50:21simple as possible for the next steps to

4:50:23pull in information from Gmail. So we

4:50:25add in a set node, which you can find

4:50:27here.

4:50:29So set on edit field set.

4:50:31This allows us to just pull in variables

4:50:32from a list of variables. In this case,

4:50:35it's just snippet and we call this email

4:50:36body. And call it whatever we want,

4:50:37basically. This makes it so much easier

4:50:39for the next steps to actually pull in

4:50:40information from Gmail without having to

4:50:42go through all these different pieces of

4:50:44information. Once this is done, we go to

4:50:47classify emails. Now, we have to have

4:50:48this step because not all emails are

4:50:50FAQs. Some are promotional, some are

4:50:52just general emails.

4:50:54In this case, we just wanted to check

4:50:55whether they are promotional or support

4:50:57service. So if I go in here, and this by

4:50:59the way is text classifier.

4:51:02Right here, text classifier. This allows

4:51:04us to classify text based on specific

4:51:07you know, rules. So you go in here.

4:51:09Text classifier will be the JSON email

4:51:11bodies. So let me actually run the

4:51:12previous steps. Let me go here and pin

4:51:14so I don't have to rerun the whole

4:51:16email.

4:51:17Let me actually execute step.

4:51:19As you can see, we have, "Hey, I need to

4:51:21know the shipping policy you have." And

4:51:22this will be the thing that we then pull

4:51:24here saying, "Hey, classify this text."

4:51:27Now, here's where we start adding the

4:51:29categories. So the category is like,

4:51:31what are we classifying it for? Like

4:51:32what are what are the what are the rules

4:51:33and what is what's the logic here? In

4:51:34this case, we have promotional, we have

4:51:36support service. Now, to add a category,

4:51:38you have to press this button right

4:51:39here. You can put the name. So in this

4:51:41case, let's do support service. And then

4:51:42description is, "Hey, this is the name

4:51:44of the of the actual rule or the

4:51:46category. This is the description of

4:51:48what it is." So in this case, for

4:51:49promotional, we said marketing offers,

4:51:51discounts, sales pages, newsletters,

4:51:52which are typical sort of promotional

4:51:54emails. And then we have support

4:51:55service, which is customer inquiries,

4:51:57troubleshooting, complaints, or help

4:51:58requests. That's the only two categories

4:52:00that the classify email node or the text

4:52:03classifier will take into account. It

4:52:04needs to look at the the inquiry that

4:52:07came through from the customer and

4:52:08classify as to whether they are one or

4:52:10the other.

4:52:11Then we have options, a system prompt,

4:52:13which is basically saying, "Hey, please

4:52:14classify the emails provided by the user

4:52:16into one of the following categories."

4:52:17Categories right here just so it knows

4:52:19that these are the categories. And use

4:52:21the provided formatting instructions

4:52:23below. Don't explain it, only output the

4:52:24JSON. I believe that this is a standard

4:52:27prompt. Yeah, it is a standard prompt.

4:52:29So you can just add this.

4:52:30But this allows the the actual node to

4:52:32be more strict in understanding exactly

4:52:34what it is.

4:52:35Now, in order for this to actually work,

4:52:37this doesn't just work on its own. It

4:52:38works through the AI. So you have to go

4:52:40here, the model. You have to choose a

4:52:41model here. And we have all these

4:52:42models. I typically go for the OpenAI

4:52:44chat model because it is the

4:52:46I go for quality plus

4:52:47plus price. I think this is fine.

4:52:49Connect it. To connect to your OpenAI,

4:52:51you just have to go to

4:52:52platform.openai.com.

4:52:55Go to the dashboard.

4:52:57Go to the API keys.

4:52:59Create a new secret key and then you can

4:53:00put your name and then create a secret

4:53:01key and then bring it back here to paste

4:53:03it. Don't worry about the organization

4:53:05ID, you don't need it. And as well, this

4:53:07don't worry about this. One important

4:53:08thing here is that for a company to run

4:53:10this, they do have to pay for the

4:53:11credits, which you find in your profile.

4:53:14Billing.

4:53:15And you find it here.

4:53:17But I obviously would look into how many

4:53:19inquiries they get and then make the

4:53:20price based on that. But the price is

4:53:21like 1/10 of a cent per per run. All

4:53:24right, and now that we connected AI,

4:53:26what does happen? So how this works is

4:53:28we have the email body, which is

4:53:29incoming emails. It will then go here

4:53:31saying, "Hey, can you classify this

4:53:32using AI?" Right? It will have

4:53:34categories. It will have strict rules.

4:53:36It will talk to the AI to make sure that

4:53:37that's how it thinks. That's that's

4:53:39that's the actual like program.

4:53:40And then based on the the two different

4:53:43sides, we have promotional and support

4:53:44service. In this case, we actually

4:53:46didn't put anything for promotional. So

4:53:47if something is promotional, it just

4:53:48stops there cuz we we don't want to

4:53:50really do anything with it. We only want

4:53:52to send it through if it's a support

4:53:53service. So that's why we drag this

4:53:55across and we put it to the next node,

4:53:58which in this case is an AI agent, which

4:53:59is really the the main source of the

4:54:01whole system. And so once we classify

4:54:03the emails, we say, "Hey, okay, this is

4:54:05an FAQ. This is like actually something

4:54:06that we can answer. Let's go out and

4:54:08actually review and draft an email for

4:54:10the customer using the data that we

4:54:12have." Now, if you haven't checked out

4:54:13my AI rag agent system, then make sure

4:54:15to check it out right here on the top or

4:54:16below. It'll show you exactly how we set

4:54:18this up step by step so you get to see

4:54:20the whole process. But essentially what

4:54:21it is, it's an AI agent that

4:54:24gets incoming emails. In this case, it

4:54:26gets the the inquiry from here, which is

4:54:28the same input as this. But now we know

4:54:30that it's support service because we

4:54:31went through the step. And what it will

4:54:32do is I will go through a vector

4:54:33database. Now, a vector database is

4:54:35something that looks like this, which is

4:54:36composed of different rows. These rows

4:54:39come from this document. Cuz we have a

4:54:41document, which is essentially where all

4:54:43the information stored. So account

4:54:44logins, all the different FAQ questions

4:54:46that people usually ask, which is

4:54:47typically what a company would have in

4:54:49the first place. And then now we

4:54:50basically transform this into vector

4:54:53database so embeddings, in this case we

4:54:54call them.

4:54:55That will allow the the program to

4:54:57actually take the question that's coming

4:54:59through, match it up against any of

4:55:01these embeddings, and then give us back

4:55:02an answer in the simplest way.

4:55:04So the way to do this is we have an AI

4:55:06agent.

4:55:07Right here, the prompt, which is the

4:55:08user message. This right here will say,

4:55:10"Hey, what is the thing that we're

4:55:11feeding into the AI agent?" In this

4:55:13case, it's email received, which you can

4:55:14find from the email body. Right here. So

4:55:17this right here will be the the from

4:55:19because when we actually have to draft

4:55:21the email, we have to know who the email

4:55:22is coming from and the name as well just

4:55:24so we can personalize the email plus

4:55:25send it to the right person. And that's

4:55:27about it for the user message. In this

4:55:28case, we don't require any specific

4:55:30output format. We don't enable any

4:55:31fallback method. This just means do you

4:55:33want it in a very in a in a specific

4:55:35format like JSON or anything like that?

4:55:37We don't want to do any of that. And

4:55:38also, do we want to enable a fallback

4:55:39method? This means that if OpenAI does

4:55:41not work, do you want to use another AI

4:55:44to to test? In this case, you could or

4:55:46could not put this on. I mean, typically

4:55:47I wouldn't have it on

4:55:49because the chat model right here works

4:55:51fine.

4:55:52But you can have it on even to be more

4:55:53safe. Now, the system message here is

4:55:55the system or is the message that we

4:55:57tell the system, "Okay, you are a

4:55:58helpful intelligent XYZ that does a few

4:56:01things." So the prompt for the AI agent

4:56:04follows through a very very specific

4:56:05structure that we use for most of the AI

4:56:06agents that we build. In this case, it

4:56:08has an overview. So you are a helpful

4:56:09assistant that answers any inquiries

4:56:11from our e-commerce store called

4:56:12Novamart. You'll [music] be drafting

4:56:13email replies for the incoming queries

4:56:14that come through. And then tools, this

4:56:16will be the tools that the AI agent is

4:56:18connected to. In this case, it's two.

4:56:20The first one is pulling in information

4:56:21from the document

4:56:23that we have, which is the one right

4:56:24here.

4:56:25Which now right now is stored in the

4:56:26vector database in Superbase.

4:56:28And the second one is the email draft,

4:56:31right? Because this tool will be used to

4:56:33draft any emails back to the user to

4:56:35make sure that they have the

4:56:36corresponding answers based on the

4:56:37information that comes from the vector

4:56:39store. Some rules here is we have to

4:56:41always use the vector store before

4:56:42answering any questions and drafting any

4:56:44emails. This is very very important

4:56:46because sometimes what the AI could do

4:56:48is that it can draft the email, but it

4:56:49will not have any context or any

4:56:50information that's actually valuable for

4:56:52the end user to give them an answer. So

4:56:54it's sort of saying, "Hey, what is the

4:56:55return policy?" I reply to you first and

4:56:57then I go out and look for the

4:56:58information. We have to make the order

4:57:00actually make sense, which is why we

4:57:02tell it, "Hey, look for the information

4:57:03first and then you can go out and draft

4:57:05the email." And then some extra

4:57:06information, my name is James. Make sure

4:57:08to include that when drafting the email

4:57:09because at the end,

4:57:11what it did basically in the email it

4:57:12said, "Hey, thank you. This comes from

4:57:15at your name." Like bracket at your

4:57:17name. And then it will put the put the

4:57:19actual company name. In this case, we

4:57:21want to put James because again, that's

4:57:22that's the reality of what emails look

4:57:24like. They put names instead of just

4:57:25adding variables. So we give it that

4:57:27context as well. All right, once this is

4:57:29done, then we have the chat model. In

4:57:30this case, we can add here.

4:57:32Same way as we did before, we can go to

4:57:34open AI and we have to connect to our

4:57:36account and use 4.1 mini. Again, this is

4:57:38perfect perfectly fine for for this use

4:57:40case. Now, what we have to do is connect

4:57:42tools. Now, the way that an AI agent

4:57:44works is that it gets it gets the

4:57:46inquiry. So, it gets an input like "Hey,

4:57:47draft an email." or "Hey, look for this

4:57:49information." or "Do something." and it

4:57:51will then think through what it needs to

4:57:52do using its model. And then, to take

4:57:55action and what it actually needs to do,

4:57:57it uses tools. So, in this case, because

4:57:59we have two tools, again one for the

4:58:00draft and one for the back to database

4:58:01that actually looks for the information,

4:58:03we connect these tools to the

4:58:04corresponding softwares.

4:58:06>> [music]

4:58:06>> In this case, to connect to the vector

4:58:07store, we have to go here. In this case,

4:58:09well, I mean it's vector store, so

4:58:11you will have to press plus. Let me see

4:58:12if I can move this. There you go.

4:58:14Uh Superbase.

4:58:16Superbase vector store.

4:58:18And you come to this page.

4:58:19Once you get to that page, let me delete

4:58:21this.

4:58:22You will be here. The first thing you

4:58:23have to do is create a new credential.

4:58:25Again, you should have a service role

4:58:27secret and a host, which you can find

4:58:28here. And then, we have this page right

4:58:30here. The first thing you have to do is

4:58:32obviously make the account. Then, you

4:58:33have to make the database and again, I

4:58:35put a whole video on how to do this down

4:58:37below, so make sure to check it out. And

4:58:38now, we have to go back here, go to the

4:58:41API keys and [music] you can then

4:58:42reveal, copy the secret and paste it

4:58:44here and then you can press save and

4:58:46then you're done.

4:58:47All right, cool. So, once we are done

4:58:49with this, we can then use the operation

4:58:50mode. Again, operation in and its end

4:58:52just means what is the thing that we

4:58:53want to do. In this case, it's retrieve

4:58:54documents.

4:58:56As tool for AI agent, there's a

4:58:57different options here.

4:58:58And now, the description is work with

4:59:00data inside the vector database to

4:59:02answer any questions, which is fine. Let

4:59:04me delete the extra e

4:59:05>> [music]

4:59:05>> right here.

4:59:06Um and then, the table name, which will

4:59:07be the table here, right here, table

4:59:10editor.

4:59:11Yeah, this will be the one that's

4:59:12containing different information. As you

4:59:13can see, we have number marked

4:59:14e-commerce, general information, we have

4:59:17go to your cart, XYZ, all the different

4:59:19information that it needs to use in

4:59:21order to then answer any incoming

4:59:22queries. Once [music] that's done, we

4:59:24have the limit. Again, actually I don't

4:59:26know why I put this to four. Uh this

4:59:27basically says number of results fetched

4:59:30from the vector store. I typically

4:59:31really be blank. Uh in this case, of

4:59:33course, if you have a really really

4:59:34large vector database and you don't put

4:59:36a limit, it will basically use [music]

4:59:38more credits than if you put a limit on

4:59:40X amount. Uh so, that's why we add a

4:59:42limit here.

4:59:43And then, we include metadata. And then,

4:59:46we have to put the query name, which is

4:59:47match underscore documents, which is the

4:59:50database that we're using. All right,

4:59:51then we have the embeddings, which are a

4:59:52way for open AI to take the incoming

4:59:54query like, "Hey, what's the return

4:59:55policy?" turn that into numbers so that

4:59:58it can match them to the embedding.

5:00:00Again, this will make much more sense

5:00:01once you see the video uh of mixing the

5:00:03AI rag agent and the fundamentals behind

5:00:05what it is. But, in a very simple way is

5:00:07that text is turned to numbers, numbers

5:00:08will match numbers to give you an

5:00:10answer. Um so, to do this, we have to uh

5:00:13put the embedding, which in this case is

5:00:15another LLM and we can use open AI.

5:00:18Connect your open AI and you can leave

5:00:19the model to text embedding three small.

5:00:21All right, once the vector store tool is

5:00:22finished and we now can look for the

5:00:24information in the vector database, we

5:00:26can now connect the second tool, which

5:00:27is the email draft. Because again, the

5:00:29sequential order goes in the vector

5:00:31database to find the email to find the

5:00:32information in this case, sorry, and

5:00:34then go to the email to then draft the

5:00:35email to give an answer to the customer.

5:00:37So, in this case, we have to use an

5:00:38email draft. We can go here.

5:00:41Gmail tool.

5:00:42And you come to this page.

5:00:44You have to connect your email.

5:00:46So, it's the same exact process as the

5:00:47one before. Create a new credential and

5:00:49then you can sign in with Google.

5:00:51And then, you have to use the tool

5:00:52description. So, the tool description,

5:00:54you can set automatically. The resource,

5:00:55which would be uh what is the thing

5:00:57we're doing? In this case, it's not

5:00:58label, it's not message, it's not layer,

5:01:00it's draft. And then, the action that

5:01:01we're taking is we're creating a draft.

5:01:04And the subject line, something good at

5:01:06n8n has is that we can actually let the

5:01:07AI define this define this parameter,

5:01:10which is the subject line of the email.

5:01:12And then, the email type, which would be

5:01:13text. Then, we have the message, which

5:01:14is the email body. And we can also press

5:01:16the button right here, which will let

5:01:17the model define this parameter, which

5:01:19is amazing because you don't have to do

5:01:20anything. And also, on top of that, we

5:01:21also have to send the email to someone.

5:01:23So, we have to press to add option,

5:01:25[music] to email, so whoever you're

5:01:26sending the email to.

5:01:28And then, the info example.com will be

5:01:30replaced by the email that we mentioned

5:01:31that we're giving the AI agent to take

5:01:33action. So, we can just press this and

5:01:35now the AI will already have be smart

5:01:37enough to be able to think about who are

5:01:39we sending the email to based on the

5:01:40input that it was given. All right.

5:01:41[music]

5:01:42So, let's put this to test. Let's see

5:01:44how it actually works.

5:01:45Um I think we can just I think we can

5:01:47just test this.

5:01:49Yeah. Let me go here. I'm going to press

5:01:50this button right here, which just test

5:01:52this right here. It will classify it.

5:01:54We'll say it's a poor service. Now, what

5:01:56it will do is it will look through the

5:01:58vector store. But again, first of all,

5:02:00the first step is it will think through

5:02:01its memory or its LLM um its brain to

5:02:04then think about what it needs to do.

5:02:05So, the first step is finished.

5:02:07And then, the second step is drafting an

5:02:08email. And then, it goes back and it

5:02:10thinks through and before it gets to the

5:02:11next steps, which is Telegram in this

5:02:13case. But, before we get to that, let's

5:02:15look at the draft of the email. Let me

5:02:17go here.

5:02:18Go to drafts.

5:02:19Refresh.

5:02:21And the shipping policy tells me all of

5:02:22this. Now, one thing we want to change

5:02:25ideally is maybe the size of the length

5:02:27of the email. I think this is pretty

5:02:28long. Uh so, to do that, to make any

5:02:30changes, you can go here. And then, the

5:02:33rules

5:02:34uh

5:02:35make the email

5:02:37draft

5:02:39a medium length

5:02:41keeping

5:02:42it concise [music]

5:02:44with a good structure.

5:02:47So, let me test this again. Let's see if

5:02:48anything changed. And this is how you

5:02:50usually go about iterating and and

5:02:51making sure that the AI agent does what

5:02:53you want it to do in the in the best way

5:02:55possible. Now, if we go back here, you

5:02:58can see that we made another email,

5:03:00which is more structured.

5:03:02Maybe the size isn't it's not shorter,

5:03:04but the structure is better, I'd say.

5:03:06So, now we can say

5:03:08and we can leave this as this, to be

5:03:09honest. If I was a if I was a customer,

5:03:11I would want some sort of answer like

5:03:12this.

5:03:13That would give me the best information

5:03:14with all the prices and stuff.

5:03:16Cool. All right. Um

5:03:18and again, all the information comes

5:03:19here. So, the shipping policy and

5:03:21options comes from here, which it pulls

5:03:24the information from. All right, now

5:03:25once this is done, we can then go to the

5:03:26last step, which is basically informing

5:03:28the team. Now, why do we do this? It's

5:03:29because the email, again, you saw it

5:03:31wasn't it wasn't sent to the customer.

5:03:32It was drafted. We have to notify

5:03:34someone that they have to go to the

5:03:35inbox and actually send the email to the

5:03:37customer if they like it. So, that's

5:03:39where the last step is Telegram, which

5:03:40is send a text message, which you can

5:03:41find right here.

5:03:43Telegram.

5:03:44Send a text message right here. And

5:03:46then, to connect it,

5:03:48you have to create a new credential.

5:03:50You have to get the access token.

5:03:52If I go to ask AI, start a new session,

5:03:54now this will tell me the step-by-step.

5:03:56And I recommend you guys always use this

5:03:57sort of feature when you're not really

5:03:58sure as to how to do it uh cuz it is

5:04:00better than ChatGPT because what this

5:04:02does is that it actually looks at the

5:04:03n8n community, it looks at the different

5:04:05questions and it will give you a

5:04:06step-by-step as to how to do it. So, the

5:04:08first step is start a chat with the bot

5:04:09father and then you do different steps

5:04:11until you get the actual

5:04:12access token. All right, so once you

5:04:13connect to your Telegram, you can go

5:04:15here. The resource again is message

5:04:16because

5:04:17we're not drafting or chat or fallback

5:04:19or file, we're just sending a simple

5:04:21message.

5:04:22The operation is what is the action that

5:04:23you're taking? In this case, we're

5:04:24sending a message. The chat ID is

5:04:26something that you can actually take

5:04:28um so, let me let me show you. Let me

5:04:30execute the step.

5:04:33Right here. So, executed the step. Now,

5:04:34if I go to Telegram, I should see the

5:04:36message. Let me show you. Right here. I

5:04:38just got another message

5:04:40at 3:50.

5:04:42And now, in theory, this will give me a

5:04:44chat ID. So, if I go here, chat ID,

5:04:47this is the chat ID that will be used to

5:04:48then send the

5:04:51the text to. This is great because the

5:04:52chat ID allows it to give us [music] the

5:04:54the answers in the same thread of

5:04:56information or or or conversation in

5:04:58this case. All right, and now once this

5:04:59is done, we have the chat ID. Now, we

5:05:01have to put the text. So, what is the

5:05:02thing that we're putting in the message?

5:05:04Well, in this case, I thought that it'd

5:05:05be good to add new inquiry received from

5:05:07the name of the person and also the

5:05:09about, which is the subject line.

5:05:11Uh you could in theory change this and

5:05:13add more stuff, but I thought that this

5:05:15would be the most relevant to have for

5:05:16this agent uh as a text message. Um

5:05:20So, we have new inquiry received from

5:05:22name about subject line here. And then,

5:05:24the action is says email drafted to your

5:05:26email. So, again, if you saw on Telegram

5:05:28that the message itself was email

5:05:29drafted, go to the email informing

5:05:31someone they know the name, they know

5:05:32the about, like the actual question and

5:05:34they can then go and send the email.

5:05:39Hey, I'm about to build a live invoicing

5:05:41parsing system right in front of you

5:05:42that grabs invoices from a Google Drive,

5:05:44uses AI to extract all the key data,

5:05:46stores it in a Google Sheet before

5:05:48sending an email to our billing team

5:05:49once it's done. Now, this kind of system

5:05:51can actually save companies hundreds of

5:05:52hours of processing documents. In this

5:05:54case, it's invoices, which they can now

5:05:55devote to actually growing the business.

5:05:57So, today I'm going to build the whole

5:05:58system from scratch using a platform

5:06:00called n8n. I'm going to show you all

5:06:02the mistakes, all the details I make

5:06:03that you get to see what an actual

5:06:05development process for a real client

5:06:06project actually looks like. so this

5:06:08right here is the n8n workflow that

5:06:09we're going to work with. Uh we start

5:06:11with a Google Drive. So, in this case, I

5:06:12go to my Google Drive, I drop in an

5:06:14invoice that I have, one of the hundreds

5:06:16that I have right now. I go to the

5:06:17invoice, I can see that I have different

5:06:19fields in the invoice. Company name, uh

5:06:21address, email, line item, price,

5:06:24currency, payment method, invoice

5:06:26number, date, and status, right? So,

5:06:27these are different fields that I have

5:06:28within the invoice. If I go here to the

5:06:30first Google Drive, I'm here to execute

5:06:32the workflow.

5:06:33What this will do is it will take the

5:06:34invoice that we just gave it. It will

5:06:35then extract the text from the invoice.

5:06:37It will give it to an AI, which will

5:06:39extract different variables that we need

5:06:40from the invoice like client name,

5:06:41address, all that sort of stuff. It adds

5:06:43it to a Google Sheet database. It then

5:06:45drafts an AI so, drafts an email using

5:06:47AI and then sends it to us as well. If I

5:06:49go to my Google Sheet database, I can

5:06:51see that now the invoice is parsed. So,

5:06:53the different variables have been

5:06:54extracted. If I go to my email right

5:06:55here, I can see that I got an email

5:06:57saying, "Dear billing team, you have

5:06:58received a new invoice." and it gives

5:07:00you the different details. It says the

5:07:01system has added the fields in the

5:07:02Google Sheet database, which you can

5:07:04also view here. If I go here, takes me

5:07:05to the Google Sheet database with all

5:07:07the line items there. All right, so that

5:07:08right there is for the system we're

5:07:10going to build from scratch. Again, I'm

5:07:11going to start from zero, completely

5:07:12zero. So, I'm going to show you the

5:07:13whole development process. Let me go to

5:07:15a new

5:07:17a new workflow right here. We can start

5:07:19from scratch.

5:07:21The first thing we have to do is

5:07:22actually map out the process of the

5:07:23automation on a platform called Miro.

5:07:25You can use any other platform for this.

5:07:27Um, but I like using Miro uh because it

5:07:29is very very easy. All right, so the

5:07:31first part or the first The thought

5:07:33process here is we have a bunch of

5:07:34invoices, then we have to So, let's do

5:07:37invoices.

5:07:39Then we have to basically extract the

5:07:41text or extract different variables.

5:07:43Extract variables

5:07:45from invoice. And by variables, we mean

5:07:47client name, client address, all that

5:07:48sort of stuff.

5:07:50And then we want to add it

5:07:53to a database. When someone says

5:07:56database, they just mean a Google Sheet

5:07:57or an Airtable, Notion, ClickUp,

5:07:59whatever it is.

5:08:00And then after we add it to the

5:08:01database, we want to send an email. So,

5:08:03send email

5:08:05to billing team

5:08:06confirming

5:08:07invoice.

5:08:09All right. I mean, it is a four-step

5:08:10process. As you saw, it was more than

5:08:11four steps just because of the way that

5:08:13we had to set up. Uh, but this is

5:08:14fundamentally what it is that we're

5:08:16doing, right? We're watching new

5:08:17invoices from somewhere. We're

5:08:19extracting the variables. We're saying,

5:08:20"Hey, okay, what is the client name?

5:08:21What is the client address? What is the

5:08:22price? What is the currency?" All that

5:08:23sort of stuff. And then we're adding it

5:08:25to a database. And then we're sending

5:08:26the billing team We're sending an email

5:08:27to the billing team confirming the

5:08:28invoice. Now, typically when I do

5:08:29something like this, I will think

5:08:31through how to structure it. So, the

5:08:32first step is invoices. As you saw, we

5:08:34used the Google Drive because that is

5:08:36the easiest to get started with. So, we

5:08:38can say watch invoices

5:08:41from Google Drive.

5:08:44And what this could look like is we run

5:08:45the automation maybe once a day or once

5:08:47an once a minute uh every minute, I

5:08:49mean, every hour or every week, and we

5:08:51watch new invoices that have been added

5:08:53so that we It's a continuous thing.

5:08:56Uh, and that's always good because we

5:08:58don't want to have a system where there

5:09:00has to be a manual step of running the

5:09:01automation every single time. We want it

5:09:02to be automatic so that they can just

5:09:04drop invoices and every so often it

5:09:06takes invoices and then does the whole

5:09:07process. Uh, then extract the variables

5:09:09from the invoice,

5:09:10add it to a database, uh in this case,

5:09:13Google Sheet, add variables

5:09:17to Google Sheet.

5:09:20And then send the email to the billing

5:09:21team confirming the invoice. All right,

5:09:23so the first step is Google Drive. So,

5:09:25what is the first step is always the

5:09:26trigger. So, what is the thing that

5:09:27actually starts the automation? In this

5:09:28case, every new client that has or every

5:09:30new file that has been added every new

5:09:32invoice that has been added every so

5:09:33often will be the thing that starts the

5:09:34automation.

5:09:35Um, so if I go to Google Drive

5:09:38and I go to on changes to a specific

5:09:39folder because we're adding

5:09:41invoices to a folder,

5:09:43I can see that the change that we want

5:09:45to make is actually when a file has been

5:09:46created, when a file has been added. Um,

5:09:48so first The first thing you have to do

5:09:50is go here,

5:09:51create a credential, and you have to um

5:09:53connect your Google Drive to an N

5:09:56Now, I'm not going to dive into this

5:09:57whole process right now, but I actually

5:09:58made a full step-by-step video on how

5:10:00you can do it within less than 5

5:10:01minutes. Uh, you can check it out on the

5:10:02screen right now. Uh, but once you

5:10:04connect to your Google Drive, you'll

5:10:05have a connection right here, which is

5:10:07good. The poll time is just means how

5:10:09many times or how often do you want to

5:10:10run the Google Drive? In this case, it

5:10:12can be every minute. Then the trigger on

5:10:14just means what do you want the trigger

5:10:16to be? Do you want it to be just changes

5:10:18involving a specific folder or a file?

5:10:20In this case, it will be a folder

5:10:21because we need a folder to include the

5:10:23invoices in. And then we have to make

5:10:25the folder. So, let's go to Google

5:10:26Drive. I can go here.

5:10:28I can make a new folder.

5:10:31I can call it invoices test

5:10:35YouTube. Create.

5:10:37And now this created a folder, which I

5:10:39can find here.

5:10:40Now, this is a place where we're going

5:10:41to store all the invoices to be

5:10:43processed every every so often. Uh,

5:10:45okay, cool. So, now uh obviously make

5:10:48sure that your connection is correct. In

5:10:50this case, it actually should be James

5:10:51Solutions, not the killer connection.

5:10:53It's a different uh account. And the

5:10:55folder in this case is invoices test

5:10:57YouTube. So, invoices test YouTube.

5:11:00Okay, and then it says, "What are we

5:11:01watching for?"

5:11:02In this case, we're watching for a file

5:11:04to be created, updated, created, uh

5:11:06folder created, folder updated, watch

5:11:08folder updated. Well, in this case, we

5:11:10want to do when a folder is created

5:11:12within a folder. So, when a file is

5:11:13created within a folder. So, in this

5:11:14case, it'll be when a file is created in

5:11:16the watched folder, which is this folder

5:11:18right here.

5:11:19So, let me go here. We do file created.

5:11:21So, now this watches every new file that

5:11:23has been added. So, let's try it out.

5:11:25Let's test because part of automation is

5:11:27testing. I'm going to have an invoice

5:11:29that I have right now. So, that you can

5:11:30drop your invoices here.

5:11:31And I'm going to test if uh now that I

5:11:33add it here, if I execute workflow. So,

5:11:35in this case, if I fetch test event,

5:11:38I'll create it.

5:11:39Will this catch the invoice that has

5:11:40been added? Well, in this case, yes. So,

5:11:41this is the output. If I scroll all the

5:11:43way down, I can actually find the link,

5:11:46which is the web view link, of the

5:11:48invoice that has been added, which is

5:11:49correct, which is the same one that has

5:11:50been added here because it basically

5:11:52caught all the files from there that has

5:11:53been added. It only one. All right,

5:11:55perfect. So, we know it works. Um, so

5:11:56the first step is done. Right right here

5:11:59is finished.

5:12:01We watched invoices from Google Drive.

5:12:03That's good.

5:12:05Now, the next step is to extract

5:12:09text from a file. So, let me go here.

5:12:12Extract from file. Extract from PDF

5:12:14because the invoices itself are on PDF

5:12:16version.

5:12:18So, it depends what kind of PDF or kind

5:12:19of file you have. Now, here says extract

5:12:22from PDF, which is the thing that we

5:12:23have to do uh because that's the action

5:12:25that we're doing. But then it says the

5:12:27input. So, the thing that's going in to

5:12:29this node right here, which extract text

5:12:31from PDFs, has to be in a form of

5:12:33binary.

5:12:34>> [music]

5:12:35>> Now, in order for us to get the file to

5:12:37be added here, we have to do an

5:12:39additional step, which is actually

5:12:40downloading the file to then be adding

5:12:43it to the to this node right here

5:12:45because it only likes binary format, and

5:12:47the only way to get binary format is to

5:12:48download the file. So, if I go here to

5:12:50Google Drive,

5:12:52I can now download a file. Press it down

5:12:55right here. Make sure you have the right

5:12:56connection.

5:12:58File download, that's fine.

5:13:00Uh, and now we want to actually do it by

5:13:03the ID

5:13:04because if you do it by the list, then

5:13:06you only have access to one file. We

5:13:07don't want to keep downloading the same

5:13:08file. We want to change the file that

5:13:10we're downloading. So, the file itself

5:13:12will have an ID that's unique. So, if we

5:13:14map the ID, if we put the ID that's

5:13:16different every single time, it will

5:13:17download every single file differently,

5:13:19which is exactly what we need.

5:13:21I'll go here. I can put ID.

5:13:23You can find the ID. And now the ID will

5:13:25actually be here.

5:13:26It always It usually starts with one uh

5:13:28Y. You can see here ID. Um, one Y,

5:13:31whatever. So, this will be the one that

5:13:33we map to be added here to be able to

5:13:36download it. Now, if I just execute the

5:13:38step, I can now see that I got binary

5:13:41format data, which is the thing that we

5:13:42need in order to add it to the next

5:13:43step. And this is the data we got. Okay?

5:13:46So, you always need that additional step

5:13:47when you're actually doing something

5:13:49with Google Drive folder. It's usually

5:13:51downloading it and then turning it into

5:13:52a binary format when you have to do

5:13:54something with it.

5:13:55Now, in this case, um the input binary

5:13:58format field is fine, data, because this

5:14:00is equal to data. So, that's fine. We

5:14:02can execute the step. We're actually

5:14:03testing.

5:14:05As you can see here, there's a lot of

5:14:06fields. The one we really care about is

5:14:07text right here,

5:14:09which gives me the

5:14:10company name, invoice number, customer

5:14:13name, date, company name, all that sort

5:14:14of stuff that we need in order to

5:14:15actually split it up and add it to the

5:14:17Google Sheet. So, the next step is

5:14:18actually extracting the variables within

5:14:20the text. Because there's a block of

5:14:21text, how do we split it up so we get

5:14:23the customer ID, the customer name, the

5:14:25email, the address, all that sort of

5:14:26stuff that we actually need in order to

5:14:28add it to the Google Sheet. Well, in

5:14:29this case, you can press plus.

5:14:30We have to go to information extractor.

5:14:34Now, what this does is that it receives

5:14:36text to the actual thing. It then thinks

5:14:38through what the text is about. And then

5:14:39based on the descriptions of the line

5:14:41items or variables that we tell it to to

5:14:42give us, it will then split up the text

5:14:44so it gives us the the customer name,

5:14:45the address, the the invoice ID, all

5:14:47that sort of stuff that we need. Um,

5:14:48okay. So, the text here will be the text

5:14:50from the previous step. So, I can

5:14:53look across right here. And again, you

5:14:55can also see the result, which is

5:14:56something that N8N actually does really

5:14:58well. Uh, you can see the output before

5:15:00you can test.

5:15:01The schema type will be from attribute

5:15:03descriptions. Don't worry about this.

5:15:04You can leave it as as it is. And now we

5:15:05have to add attributes. So, attributes

5:15:07just means what is that thing that we

5:15:09want to extract from the text? In

5:15:10[music] this case, there's a few things.

5:15:12So, if I go here and I look at the

5:15:13invoice,

5:15:15again, this will be different for sort

5:15:16of every company. It's sort of similar.

5:15:18You still have the price, the invoice

5:15:19number, all that sort of stuff. Uh, but

5:15:21sometimes we do have something called

5:15:22statuses or payment methods um

5:15:25that we want to account for. In this

5:15:27case, it would be com- customer name.

5:15:29So, we can do

5:15:30customer name.

5:15:32This is the name of the customer.

5:15:36So, right here it's asking us what type

5:15:37of output is it? Is it a string? Is it a

5:15:40Boolean, which is true or false? Is it

5:15:41date? Is it a number? In this case, a

5:15:43string is just text, like the normal

5:15:45version. So, leave it as it is. And then

5:15:46description is us giving it a

5:15:48description so it actually helps it in

5:15:50thinking what is the customer name um

5:15:52and so on. And then we can put it

5:15:53required. So, it needs to give us the

5:15:55output.

5:15:56Then we have uh from here company name,

5:15:59address, and email.

5:16:00So, company

5:16:04name.

5:16:05This is the name of the company.

5:16:08Required.

5:16:10Email.

5:16:12This is the email of the customer.

5:16:16Address as well.

5:16:19So, address.

5:16:23This is the address

5:16:24of the customer.

5:16:26Required. Then we have invoice number,

5:16:28date, and status.

5:16:32Invoice number.

5:16:36Date.

5:16:38Status.

5:16:41Invoice number is this is the

5:16:45number of the invoice.

5:16:47Required. Now, this right here for date,

5:16:49we can actually turn it into a date

5:16:50format. Um, we say this is the date of

5:16:53the invoice.

5:16:55Required.

5:16:56And then status will be this is the

5:16:58status

5:16:59of the payment. Required.

5:17:02And then we have

5:17:05line items. So, line items, this is like

5:17:06the description of the payment, the

5:17:08price, and payment method.

5:17:10Price and payment method. Uh, line item.

5:17:15This is the line item of the invoice.

5:17:19Price.

5:17:20The total amount.

5:17:23This is

5:17:26total amount

5:17:27of the invoice.

5:17:30And then payment method.

5:17:34This is the payment method

5:17:41of the

5:17:42invoice. All right, so I just finished

5:17:44filling out all the forms. Uh all the

5:17:45details in the in the actual invoice. We

5:17:47have customer name, we have a company

5:17:49name, we have email, we have address, we

5:17:50have invoice number, we have date. And

5:17:52again, we turn this to date because it

5:17:54is a date format. Um [music] status,

5:17:57line item, total amount, payment method,

5:17:59and so on. Okay? All right, now what we

5:18:01have to do here is we have to do two

5:18:02things. The first thing is to give it a

5:18:04system prompt template. In this case,

5:18:07it's you are an expert extraction

5:18:08algorithm. You only extract relevant

5:18:10information from the text. If you do not

5:18:11know the value of the an attribution

5:18:12asked to extract, um you may omit the

5:18:15attribute's value. I think this is

5:18:16pretty good. I think we don't need to

5:18:18give it any more context. Now, one more

5:18:19thing we have to do it because this is

5:18:21not run on its own. This runs through

5:18:23AI. So, we have to connect a model to

5:18:25it. So, if I press here,

5:18:27I have a list of models that I can

5:18:28choose. In this case, I'm choosing Open

5:18:29AI chat model.

5:18:31And I will come to this page. The way to

5:18:33connect your Open AI to N 8 N, you can

5:18:35go here,

5:18:36create a new credential. You can go to

5:18:38platform to Open AI because you have to

5:18:40get an API key.

5:18:42Dashboard,

5:18:43API key,

5:18:45create a new secret key, name it. So,

5:18:47you can do invoice system.

5:18:50Create a secret key.

5:18:51You can copy this,

5:18:53go back,

5:18:54paste it here,

5:18:55and then name this whatever it is. So,

5:18:595th September

5:19:01connection. Save it. And now you will

5:19:04have your Open AI connected to N 8 N.

5:19:07Bear in mind that this is not free as in

5:19:08you still have to pay for this in a

5:19:10sense. So, you go to your profile and

5:19:11you go to billing.

5:19:13You have to add $5 because we're using

5:19:15API credits and API credits cost money.

5:19:17Uh but it's very very minimal as in I

5:19:20think I used $5 in 6 months. Um and I

5:19:22was using it quite a bit. So, obviously

5:19:24it depends what you use it for as well.

5:19:26But, it's relatively cheap. So, you can

5:19:27add $5 and you'll have that last you for

5:19:29a while. All right, so now that we have

5:19:30that, the model can be 4.1 mini. It's

5:19:33good, good quality, and good speed.

5:19:35We can actually extract this. So, let me

5:19:38run this.

5:19:40This uses the previous steps to test

5:19:41only this step. I go here, I can see

5:19:43that I extracted uh the customer name,

5:19:45the company name, the email, the

5:19:46address, the invoice number, date,

5:19:48status, line item, total amount, and

5:19:50payment method, which is amazing.

5:19:52Which is exactly what we need. Perfect.

5:19:54All right, the next step. So, we did

5:19:56this.

5:19:57Done. The next step is actually to add

5:19:59it to the sheet. So, if I go here, I

5:20:01actually made the sheet. So, the

5:20:02variables that I have,

5:20:04uh let me just fill this out so you can

5:20:05see. Go right here.

5:20:07I have invoice number, client name,

5:20:09client email, address, description,

5:20:10total amount, invoice date, status, and

5:20:11payment method. Now, this is right here

5:20:13is just a way for us to actually store

5:20:14the invoice uh cuz there has to be some

5:20:16place for us to store all the

5:20:17information. Um typically a company

5:20:20they probably wouldn't have cool sheets.

5:20:22They would have maybe a Notion, uh maybe

5:20:25some sort of custom software they have.

5:20:27Or but they always have a database,

5:20:28right? They always have a place where

5:20:29they actually have to store information.

5:20:31So, this is what we're going to use.

5:20:31Let's name this invoice

5:20:34uh system.

5:20:36N 8 N YouTube.

5:20:38And now if I go back here to

5:20:42uh here, I have to add a next step,

5:20:44which is add the invoice to the Google

5:20:47Sheet. So, if I go here, I can go to

5:20:49action and app. Sheet, Google Sheets.

5:20:52And then I can a append a row in a

5:20:54sheet, which means add a row.

5:20:56Connect your account. All you have to do

5:20:58is create a new credential. You don't

5:20:59have to do the same thing you did for

5:21:00Google Drive. You can just sign in with

5:21:01Google, which will take you to a page

5:21:03like this. Choose your account.

5:21:06Continue.

5:21:07And then it's successful.

5:21:09And you go back

5:21:11and name it whatever you want.

5:21:13Press save.

5:21:15All right, now that you connected your

5:21:16Google Sheets, uh it is going to be a

5:21:17sheet within a document. You want to

5:21:18append a row because operation again is

5:21:20a thing that you're actually doing. And

5:21:21then we want to look for invoice system

5:21:23N 8 N YouTube, which is the first one

5:21:24that comes up. The sheet will be sheet

5:21:26one because again, this right here sheet

5:21:29one.

5:21:31And now we want to be able to map the

5:21:33fields. So, mapping just means that you

5:21:35have different columns. You want to add

5:21:37the variables for each column to make

5:21:39sure that when we run the automation,

5:21:41they actually show up. Um so, it would

5:21:43be invoice number,

5:21:45which is invoice number.

5:21:47Client name,

5:21:49so customer name.

5:21:50Client email, so email.

5:21:52Address,

5:21:53address.

5:21:55Description,

5:21:57and in this case it's line item.

5:21:59Total amount is this.

5:22:01Invoice date, it's here.

5:22:04Status

5:22:05is here. Payment method is right here.

5:22:09I believe that's it. Do we have to do

5:22:10anything else? No, that's all good. Um

5:22:12okay, so let's test this. Let me execute

5:22:13step.

5:22:16Now it's running. If I go here, I can

5:22:17see that the first run did well. Uh we

5:22:20have the line items, we have invoice

5:22:22109, Lucas Martin, the email, address,

5:22:24description, total amount, invoice date,

5:22:26status, and payment method. Let me just

5:22:27freeze this row right here.

5:22:29So, when I go here, it doesn't I doesn't

5:22:31actually take it with it.

5:22:33And the next step is finished, so this

5:22:35can go green.

5:22:36You see how I'm just checking things off

5:22:38as I actually do this because it is a

5:22:39whole process. I'm planning it out. And

5:22:41now the last one is to send an email to

5:22:43the billing team confirming the invoice.

5:22:45So,

5:22:46the next step is using AI because to

5:22:47send an email to the billing team,

5:22:49you typically want to use AI uh

5:22:50depending on the the email, of course.

5:22:52Um but in this case, we want to let AI

5:22:54actually do the email and we just um set

5:22:56up the email the Gmail after. So, let's

5:22:58add plus.

5:23:00Let's do AI.

5:23:02Let's look for an Open AI node, which

5:23:04just means hey, we're talking to a GPT

5:23:06like can you do this and it gives us the

5:23:08output. We are messaging model.

5:23:11Uh the again, the way to connect your

5:23:12Open AI, I showed it before. Uh go to

5:23:14get the API key. And it's the same exact

5:23:16connection. If you connected it before,

5:23:17you'll have it here. The resource is

5:23:19text. Operation is messaging model

5:23:20because that's the action that we're

5:23:21doing. The model will be let's do 4.1

5:23:25mini. I think that's [music] more than

5:23:26good.

5:23:27That's fine. And the prompt is

5:23:30going to be first a system, right? And

5:23:33then we're going to have a user prompt.

5:23:35So, the system prompt, I'm going to copy

5:23:36it from the other automation. I go here.

5:23:38It will be you are an email expert for

5:23:40JM Media named Jenny. You receive

5:23:42invoice information. Your job is to

5:23:43notify the internal billing team that an

5:23:44invoice was received or sent. In the

5:23:46email, make sure that to include the

5:23:48system that has been added to the

5:23:49fields. So, you say okay. So, in the

5:23:51actual email itself,

5:23:53we want to give them a

5:23:56this right here. So, anyone with the

5:23:57link,

5:23:58copy the link.

5:24:00We want to give them access to the

5:24:02Google Sheet

5:24:03because I want them to actually have

5:24:05access to it if they want to look at it.

5:24:06Uh they get a notification saying here

5:24:07everything's good. By the way, if you

5:24:09want to look into this further, you can

5:24:10obviously look at it in the Google

5:24:11Sheet. Your output should be in the

5:24:12following JSON format. Uh so, we tell it

5:24:14this because

5:24:16when we want to make an email, the email

5:24:17is composed of two different things.

5:24:18It's composed of a subject line and it's

5:24:20composed of a email body. In this case,

5:24:22because they're both custom, we want

5:24:24them to split into two different

5:24:25variables. So, that's why we use JSON to

5:24:28then split the email body and the

5:24:30subject line.

5:24:31And the rules is don't use any markdown

5:24:33formatting uh because Gmail does not

5:24:35like any markdown. It doesn't actually

5:24:36recognize it. And then it actually

5:24:38recognizes HTML, which I'll speak about

5:24:40in just a second what it is. Uh so, we

5:24:42use we tell it that. We say hey, talk to

5:24:45talk talk in the way that Gmail actually

5:24:46likes that you're talking to. Um and

5:24:48that's fine. Now, the user prompt is

5:24:50going to be this. User prompt is going

5:24:51to be the variables.

5:24:54So, in this case, we need to add all the

5:24:56different variables so it can be invoice

5:24:58number. I'm going to cut to me actually

5:25:00finishing this cuz it's going to take a

5:25:01while. All right, so we have invoice

5:25:02number, client name, email, total

5:25:04amount, and invoice date. Now, we can

5:25:06map this. So, invoice number right here.

5:25:08Client name right here.

5:25:10Uh email,

5:25:11total amount, and invoice date.

5:25:15Yeah, let me do status as well.

5:25:18And we can also add payment method at

5:25:20this point.

5:25:23Cool.

5:25:24All right, so that is the input that we

5:25:26give it. So, we say hey, you would do

5:25:27XYZ, and here's the input that you have

5:25:29to do this thing for, and just give me

5:25:31the both the emails, okay?

5:25:33Now, one more thing we have to do here

5:25:35is actually turning this on. The output

5:25:36content is JSON because we actually told

5:25:39the AI give me JSON. So, we want it to

5:25:41actually officially say hey, the output

5:25:44should be JSON yes or yes. Um and we

5:25:46don't want it to error out. So, that's

5:25:47good.

5:25:48Now, let's execute the step, which is

5:25:50basically testing.

5:25:51It will use the previous variables.

5:25:54Now, it will give us the email. So, the

5:25:55email is all in a weird format. This is

5:25:57the format that Gmail likes when you

5:25:59give emails. So, don't worry about this

5:26:01too much, but worry about the fact that

5:26:02you got the subject line right here, and

5:26:04you got the email body as two different

5:26:06variables right here.

5:26:07Then we can then use to actually send

5:26:08the email. So, if I go here, I'm done

5:26:11with the AI part,

5:26:13which is

5:26:14well, I mean I guess it's part of this.

5:26:16I can go to Gmail,

5:26:19send a message.

5:26:21To connect your Gmail to N 8 N, you can

5:26:23go here, sign in with Google, and then

5:26:24you can take go through the same process

5:26:26that you went through Google Sheets.

5:26:27Close.

5:26:28And it's the three things that we have

5:26:30to fill out. The first one is message uh

5:26:32or resource. It's a message. Operation,

5:26:33which is what are we doing? We're

5:26:34sending the message. Uh who are we

5:26:36sending the email to? In this case,

5:26:37let's do my email.

5:26:39The subject line will be the one here.

5:26:41So, we just drag it across. We can see

5:26:42even the output before we even test,

5:26:44which is again amazing. And then the

5:26:46message itself or the email type in this

5:26:48case, which is where we add HTML. We

5:26:50have two of two options. So, we say

5:26:52okay, we're sending the email to

5:26:53someone.

5:26:54How do we want to send it to them? Do

5:26:56you want to just text or do you want to

5:26:57put HTML?

5:26:58HTML is just the way that you make your

5:27:00emails look pretty. You know when you

5:27:01guys get emails that look nice, they

5:27:03have formatting, they have headers, they

5:27:05have all that stuff. That is because

5:27:06you're using HTML. So, we kind of want

5:27:08to do that,

5:27:09which is why we use HTML. And that's

5:27:11what we tell the AI to output it as

5:27:13HTML, uh which is good. So, the message

5:27:15in this case would be the email body,

5:27:16which is the one here. We just drag it

5:27:17across.

5:27:18And one thing more that we have to do is

5:27:22we want to take this off. So, append N 8

5:27:23N attribution, which is basically a way

5:27:25for N 8 N to market themselves in a way.

5:27:27Um so, when you send an email to

5:27:28someone, if you don't turn this off, it

5:27:30will say this was sent by N 8 N. So, we

5:27:32take this off just because it's more, I

5:27:34guess, professional, uh more clean. It

5:27:35looks like it actually came from a real

5:27:36person, even though we all know it's

5:27:38not, uh especially when you're doing 100

5:27:39invoices a day, but that's fine. Now, we

5:27:41get it to execute the step, so we're

5:27:43testing this.

5:27:44And if I go to my email,

5:27:47I can see now, I refresh,

5:27:51that I got an email, um with all the

5:27:53details.

5:27:54Right? And this is how we managed to

5:27:56make these look nice, bold, and actually

5:27:58even have a

5:28:00sort of an embedded link. We can just

5:28:02press here, and it will take us to the

5:28:03sheet that we have. All right, so now

5:28:06let's test it from scratch with another

5:28:07invoice, from zero.

5:28:10Let me go to my Google Drive.

5:28:13Let me

5:28:15do this.

5:28:16Not delete this. Actually, I can just

5:28:17send a new one. The new one, let's do

5:28:20random one here. Let me see what the

5:28:22name of the person is.

5:28:25Isabella Moore.

5:28:27And now if I go here to N 8 N, I can run

5:28:29this.

5:28:30Now, this will do is it will take the

5:28:32file that has been created, it will

5:28:33extract the text, it will then go here

5:28:35to the information extractor, it will

5:28:36add it to the Google Sheet, it will then

5:28:38think through AI to make the email that

5:28:39will be sent to us on Gmail, and we'll

5:28:42have everything there. If I go here, I

5:28:44can see that I have Isabella Moore with

5:28:45the email, with the address, the

5:28:47description, with the total amount, with

5:28:48invoice date, status, and payment

5:28:49method. If I go to my email as well, I

5:28:51can see that now I also have a

5:28:52notification, dear billing team, we have

5:28:54received the invoice uh from Isabella

5:28:56Moore, and we have all the different

5:28:57things that we have here, Jenny, with no

5:28:59N 8 N attribution, with no hey, this was

5:29:01sent by N 8 N. And now I also have the

5:29:03link right here, which takes me again to

5:29:05the Google Sheet with all the

5:29:05information here.

5:29:10Hey, so in this video I'm going to build

5:29:11a human in the loop AI sales agent live

5:29:13in front of you that takes in lead form

5:29:15submissions, it adds it to your CRM, it

5:29:17drafts a sales email, it routes it to

5:29:19your team for feedback, and

5:29:20automatically revises it until it's

5:29:21ready to send. So, today I'm going to

5:29:22build the entire system from scratch in

5:29:24N 8 N. I'm going to walk you through my

5:29:26whole thought process, the whole

5:29:27detours, the the mistakes I make, and

5:29:29everything that I go through, so you get

5:29:30to see what an actual development

5:29:31process looks like when you're building

5:29:33automations. So, this is the automation

5:29:34we're going to build. It's built on N 8

5:29:36N, and it all starts with the lead form

5:29:38submission. And this is typically what

5:29:40the the client or the lead, whatever it

5:29:42is, they actually fill out to start the

5:29:44automation. That's the trigger. Then we

5:29:46add it to our CRM, which is in Google

5:29:47Sheets. Then we talk to our sales agent,

5:29:49which will draft an email, a sales

5:29:51email, that will be sent to us first.

5:29:53So, this is the human in the loop

5:29:54element. It will send it to us, we'll

5:29:55revise it, give feedback. If the

5:29:57feedback is negative, it will send it to

5:29:59another AI agent to revise, to make the

5:30:02feedback, make the changes based on what

5:30:03we told it, send it back, and do the

5:30:05whole repetitive loop until it's

5:30:06positive. And once we approve the email,

5:30:09it will then send it to the customer.

5:30:10Okay? So, let me show you exactly how it

5:30:11works from the start until the end. When

5:30:13I execute the workflow, which will run

5:30:14the automation once, I'm going to go

5:30:16here, and now I'm going to start filling

5:30:17it up. So, my name

5:30:24company name will be Jim's Solutions.

5:30:30Budget can be 1.5.

5:30:32Project description, we are

5:30:34looking to generate

5:30:37leads

5:30:39for our real estate

5:30:41business.

5:30:43And the timeline can be 1 to 3 weeks.

5:30:45When we press submit here, this will

5:30:47trigger the automation. So, the form is

5:30:48itself, that's what the customer will

5:30:50do. It will send it to the first agent

5:30:52to check against projects that we've

5:30:53done before, to actually incorporate

5:30:55results and testimonials into the email.

5:30:58It will then send it to us. So, the next

5:30:59step we have to do is go to our email,

5:31:01go to this email right here, action

5:31:02required, new lead budget of 1.1 to 5.

5:31:05Um and this is what their internal team

5:31:07in the company is going to look at.

5:31:09They're going to look at the email,

5:31:10they're going to respond. So, this is a

5:31:11place where you get to give feedback for

5:31:12the email. So, hey, thanks for reaching

5:31:14out. You told me 1 to 3 weeks. We

5:31:15recently helped another client. So, see

5:31:16how it incorporates testimonials here.

5:31:19Then it says, are you available for a

5:31:2015-minute call this week or something?

5:31:21Okay, let me ask let me tell it, don't

5:31:23ask a question at the end.

5:31:28Just

5:31:29say or just ask a few times

5:31:33and I'll just ask to provide

5:31:38a few times

5:31:40that work for them

5:31:42next week.

5:31:45Right? And this is the feedback that I'm

5:31:46going to give

5:31:47I'm going to press submit. Go back here.

5:31:49You see how now it routes it to the

5:31:51denied path because we denied the actual

5:31:53email. We said, hey, make changes, it's

5:31:54not good. It will now send it back to

5:31:56us. If we go here to my email,

5:31:59I'll have another email here which I can

5:32:00go through. I can respond.

5:32:02And here as we can see,

5:32:05it changed the email based on the

5:32:06feedback that we gave it. So, please

5:32:07share a few times that work for you.

5:32:08So, I'm going to say, okay.

5:32:11Looks good.

5:32:14I submit

5:32:15and now because it's positive, it will

5:32:17send it to the actual customer.

5:32:19Uh or the lead. So, I'm going to go

5:32:20here, and now since I'm the lead itself,

5:32:23I'm going to get an email

5:32:26saying lead generation results for your

5:32:27real estate business. And I get a whole

5:32:29customized email for me. Now, that's

5:32:32what there is the automation that we're

5:32:33going to build step by step, and the

5:32:36application of this on a business side

5:32:37is that a lot of customers or a lot of

5:32:39companies, they have a lot of forms on

5:32:41the websites, but the whole process from

5:32:43when the lead fills out the form to when

5:32:45they are replied to, and so on, is a

5:32:47very manual process for companies. And

5:32:48what we're doing here is not only saving

5:32:50that time for the company to be able to

5:32:52reply to those emails automatically, but

5:32:54actually making it custom, and also

5:32:56incorporating our feedback into the

5:32:58whole process as well. Right? And that's

5:32:59exactly what we're doing. All right,

5:33:00cool. So, I want to start from scratch,

5:33:02and I'm going to go to a new workflow,

5:33:04personal,

5:33:05and test builds.

5:33:07Create a workflow. Okay, and we're going

5:33:08to start here. And before we get to the

5:33:09actual build and actually putting any

5:33:10steps into it, I usually like to map out

5:33:12the automation, what it looks like. It's

5:33:14sort of like a plan I have uh before I

5:33:16get to the actual build. So, it all

5:33:17starts with the form. So, the first

5:33:19um the first place is form, and I add a

5:33:22sticky note saying what kind of things

5:33:23we want on the form. In this case, it's

5:33:24name, uh email,

5:33:28what was it? Uh income? No, budget.

5:33:32Intent,

5:33:34timeline,

5:33:35and project description.

5:33:36Okay, so that's what we want in the

5:33:37email. Then on the form, or after the

5:33:39form, we ideally want to make sure that

5:33:43we add it to the CRM.

5:33:45So,

5:33:46add responses

5:33:48to CRM. And the CRM can be Sheets, can

5:33:50be ClickUp, it can be Asana, whatever

5:33:51you have,

5:33:52uh or HubSpot, and then you can then,

5:33:55after we add it to the CRM, talk to the

5:33:56first agent.

5:33:57So, first agent

5:34:00to write sales email.

5:34:03Then ideally we want to send it back,

5:34:05send it to us

5:34:07for feedback

5:34:09and approval.

5:34:11And now it can go either two ways. If we

5:34:13approve it, it goes to send the email to

5:34:14the lead. If you don't approve it, using

5:34:16the feedback that we gave it, it will

5:34:17then send it back. So, I could have two

5:34:19paths here. I could have or really, red

5:34:25and green, right?

5:34:27That's approve or deny.

5:34:29So, if you approve it,

5:34:32deny. So, once it's approved, again, we

5:34:34will send it to the to the customer, so

5:34:36the lead. So, in this case, it will be

5:34:38send email to lead.

5:34:40And if it's denied, then we want to

5:34:44s- uh have second agent, so second

5:34:47revision agent

5:34:50right here,

5:34:52which will then

5:34:53send it back to us

5:34:55for feedback.

5:34:56Right? And that's exactly what we want

5:34:58to build. So, we start with the form.

5:35:00So, there's a form that lead fills out

5:35:02with different variables right here,

5:35:04or questions. Then we add the responses

5:35:06to our CRM. In this case, it's Google

5:35:07Sheets. Then we add the first or we talk

5:35:09to the first agent to write the sales

5:35:11email. Then we send it to us for

5:35:12feedback and approval. And I forgot to

5:35:14add one more step here, which is uh in

5:35:16this case,

5:35:17it's a

5:35:19intent agent. Okay, I'll explain that to

5:35:21what that is. Because we give feedback,

5:35:22but how does the system know

5:35:24whether it's positive feedback, whether

5:35:25it's negative feedback? How does it know

5:35:26whether it's accepted or denied, right?

5:35:28Uh so, this is

5:35:29intent. So, feedback intent agent.

5:35:34Feedback intent agent.

5:35:37Okay, and now

5:35:39if it's approved,

5:35:41it goes there, send the email to the

5:35:42lead. And if it's not approved, then we

5:35:44talk to our second agent, which will

5:35:46write the email.

5:35:47Make this smaller. So, quick note here,

5:35:49um you don't actually build automations

5:35:51and go straight to the platform and

5:35:52start building them. You always want to

5:35:54have a process to actually map things

5:35:56out, map out what you want to build

5:35:57first, and then go on and build it. It's

5:35:59sort of like you're building a castle on

5:36:00a foundation of sand. So, you always

5:36:02want to make sure you have that roadmap

5:36:03and that guide that you can then take

5:36:05when you're building automations. All

5:36:06right, so let's go to N 8 N and actually

5:36:08build it. Um the first step, of course,

5:36:10because we have the form, we have to

5:36:12create a form. Now, thankfully, we have

5:36:13N 8 N, which has an internal way of

5:36:16creating the forms. What I mean by this

5:36:17is that they have just an internal N 8 N

5:36:19form right here.

5:36:21Um so, we can use this. Let me go here,

5:36:23create a form. And we can use the

5:36:25trigger. So, the trigger just means

5:36:26what's the first thing that starts the

5:36:27automation. And in this case, it will be

5:36:29on a new N 8 N form event. So, if I

5:36:31press this button, it will take me to

5:36:32this page uh where I have a few things

5:36:35to look at. The first thing is test URL

5:36:37versus production URL. And test URL just

5:36:39means that this URL will be used when we

5:36:41are filling out the form on test mode.

5:36:43So, when we activate the automation

5:36:44right here,

5:36:47then only do we use the production URL,

5:36:48okay?

5:36:49So, test URL is what we're using right

5:36:50now to test it, but production is when

5:36:52you activate it. Authentication is when

5:36:53you want to add a password. So, do you

5:36:55want to add a password to this form? So,

5:36:57let's say I add a basic auth.

5:36:58Uh name credential, I can create a new

5:37:00credential. I can name it

5:37:02YouTube

5:37:03human in the loop agent. I'm definitely

5:37:07not going to remember what this is. Uh

5:37:08user will be user, and then it will be 1

5:37:112 3 4 5.

5:37:13So, let me show you exactly what this

5:37:14is. Um

5:37:16Close this fine. Uh no, thanks. And now,

5:37:20I can do

5:37:21new lead

5:37:24submission.

5:37:27I want to show you exactly what the

5:37:28basic auth is. I can execute the step

5:37:31and see before we actually get to the

5:37:32form, it asks us for a password. Well,

5:37:34why do we do this? It's sort of like

5:37:35you're putting a password on your phone.

5:37:36You don't want everyone to have access

5:37:37to it. Uh you want only the people who

5:37:39have the password to have access to it.

5:37:40So, in this case, if I put the password

5:37:42that I put before, 1 2 3 4 5,

5:37:45I sign in, then I can uh obviously do

5:37:48the form and whatever app, right? On

5:37:50there.

5:37:50And I can submit.

5:37:52In this case, there's no questions. Uh

5:37:53but, that's what it do and I get the

5:37:54output. Uh so, that's what basic auth

5:37:56is. Um

5:37:58Form title, so let's Let me actually

5:37:59turn this off cuz I don't want the the

5:38:00password. So, this will just be free. Uh

5:38:03the title will be this. So, this will be

5:38:05We can add this as we'll get back to you

5:38:08soon as possible.

5:38:12Now that we have the description and the

5:38:13title, we want to add the elements. So,

5:38:15in this case, we spoke about having

5:38:17name, email, budget, intent, timeline,

5:38:18and project description. So, to add

5:38:21questions, we have to add a form

5:38:22element. So, in this case, it can be

5:38:24full name. It'll be text. Placeholder

5:38:26will be

5:38:28James Low. So, this is the thing that

5:38:29you see before you actually fill it out

5:38:31to give you an idea of what you have to

5:38:32fill out there. Uh required yes, it'll

5:38:34be required. Then, we have, let's say,

5:38:36email.

5:38:38So, this will be email.

5:38:40And email could be James

5:38:43.low @gmail.com.

5:38:46That's what we have here. And we can

5:38:47also make this required. So, the the

5:38:48user has to fill it out. And then, we

5:38:50have another uh question here, which can

5:38:52be company name. In this case, we didn't

5:38:54add it here, but it can be a question.

5:38:56Uh so, let me do it here. Company name.

5:39:00Uh JM Solutions, which is the company

5:39:03name uh that I have. And then, we have

5:39:05budget.

5:39:07So, budget can be a not a text, uh but

5:39:09it can be

5:39:11a drop-down. So, drop-down just means

5:39:14you have different options. So, option

5:39:15one

5:39:17will be less

5:39:19I can just do this.

5:39:21Less than 1,000.

5:39:23Add a field option. Option two will be

5:39:261,000

5:39:27to 3,000.

5:39:30And then, like this.

5:39:31And then,

5:39:333,000

5:39:36to 5,000.

5:39:39And then, another field option, 5,000

5:39:41plus. So, in this case, more than 5,000.

5:39:46That's for budget. And then, we have um

5:39:48project description. So, in this case,

5:39:50it wouldn't be this. Be required.

5:39:52Project description, which would be

5:39:54a text field.

5:39:57You can just add

5:39:58we want a system that

5:40:03boom.

5:40:03You can leave it up to the user.

5:40:05Required field. And then, we have

5:40:06timeline. So, timeline

5:40:08again, can be a drop-down uh because you

5:40:10want to give them a few options.

5:40:12It can be

5:40:14within

5:40:161 week.

5:40:171 to 3 weeks. And then, we can do 3

5:40:19weeks and both. So, 1 week

5:40:22to

5:40:233 weeks.

5:40:27And then, we can put 3 weeks plus.

5:40:30All right, cool. So, uh the last thing

5:40:31we have to fill out is respond when. So,

5:40:33this is saying, when do we want to send

5:40:35the data? In this case,

5:40:36we want to send the data when the form

5:40:37is submitted. But, there are cases where

5:40:39you want to send the data when the

5:40:40workflow finishes. So, you start the

5:40:41form and it doesn't only submit Does it

5:40:43only send the confirmation of submission

5:40:45when the the actual workflow finishes

5:40:47when the automation finishes. In this

5:40:48case, we don't need this. Uh we just

5:40:50have form submitted. So, whenever the

5:40:51user first submits the form, it starts

5:40:52the automation and we can now test it.

5:40:55So, in this case, as I mentioned, we're

5:40:56testing it, so we're using the URL here.

5:40:59I can execute the step. I can now just

5:41:02fill out the form. So,

5:41:04for

5:41:08company name

5:41:10budget, it can be 3,000. Project

5:41:13description, we want

5:41:15more leads. More leads.

5:41:18And 1 to 3 weeks, right? If I go back

5:41:21here, I can see that this is the output

5:41:22that I get.

5:41:23>> [music]

5:41:23>> So, we trigger the form using the N N

5:41:25and now, we get this output. So, full

5:41:27name, email, company name, and so on.

5:41:28Now, we can use these variables. So,

5:41:30these are called dynamic variables

5:41:31because they are dynamic. They change

5:41:33every single time.

5:41:34Um and then, we can use them for for

5:41:35next steps. So, all is good.

5:41:38Took us a minute to put this together.

5:41:40But, now we can add this to the CRM. So,

5:41:42the CRM will be a Google Sheet. So, let

5:41:44me add a Google Sheet here. We can do

5:41:46CRM intake YouTube YouTube human in the

5:41:50loop

5:41:51agent.

5:41:54I have so many Google Sheets with this.

5:41:55So, I make sure I have to make sure that

5:41:56I know exactly which Google Sheet is

5:41:58what. Um so, this can be full name.

5:42:01Uh I think we had company or email.

5:42:05Let me just quickly check.

5:42:08I have company name, full name, email,

5:42:09company name, budget,

5:42:12project description, and timeline.

5:42:18Uh

5:42:19Got to have to figure it out.

5:42:22Budget, project description, timeline.

5:42:30Project description.

5:42:35And then, we have timeline.

5:42:38Let me make this bold. Let me make this

5:42:40here

5:42:41here white.

5:42:43I like to make this pretty. I can get

5:42:45this set.

5:42:46All right, cool. Uh now that we made the

5:42:47CRM, and typically we use Google Sheets

5:42:49cuz that's the easiest, but um a company

5:42:51probably wouldn't have Google Sheets.

5:42:52They would have a HubSpot, they would

5:42:53have a Notion, or they would have a

5:42:55ClickUp where they store all the leads

5:42:56that come through. Um but, this is just

5:42:58for testing purposes.

5:43:00All right, so once we made the CRM, we

5:43:02can now connect it. So, to connect the

5:43:03form to the uh Google Sheets, we just

5:43:05have to press plus, look for Google

5:43:07Sheets right here.

5:43:09Now, we want to append a row. Append

5:43:11just means add, right? So, we want to

5:43:12append a row in a sheet.

5:43:13Uh connect your account. So, you can

5:43:15connect your account by creating a new

5:43:16credential. In this case, you can sign

5:43:17in with Google. I'll do it step by step.

5:43:20My email.

5:43:22Continue.

5:43:23Connection successful. So, if I go back,

5:43:25I can see that the account was

5:43:26connected. I usually would recommend

5:43:28naming it um the email. So,

5:43:31five and then, the date,

5:43:34which is 20th of August.

5:43:38Okay, cool.

5:43:39And then, press save.

5:43:40>> [music]

5:43:40>> So, now the connection is done. Uh the

5:43:41resource is sheet within document append

5:43:43a row because that's the action that

5:43:45we're doing. There's a bunch of stuff

5:43:46that we can do.

5:43:47Uh and we're going to use, I believe

5:43:49it's get rows. Yeah, we're going to use

5:43:50get rows a little on.

5:43:52Now, it's asking for the document. The

5:43:53document in this case is

5:43:55the CRM intake YouTube human in the

5:43:58loop. That's a long name. Okay, that

5:43:59right there. I know it's that one cuz we

5:44:01named it. So, that's good. Uh and sheet

5:44:03one will be the sheet that we have to

5:44:04map. And sheet one is here.

5:44:06And now, it's asking us to put the

5:44:08values to send. So, in this case, we're

5:44:09not mapping each column manually because

5:44:11we are manually adding variables for

5:44:12each column. And we're saying, "Hey,

5:44:14full name needs to go in column one,

5:44:16which is full name."

5:44:17Second column is email, company name,

5:44:19budget, description, and timeline. We do

5:44:20everything for for the different

5:44:22columns. So, full name, let me drag it

5:44:23across

5:44:25right here.

5:44:26Email, right across here. Company name,

5:44:28here. Budget, here. Project description,

5:44:32here.

5:44:33Timeline.

5:44:34I forgot to add one more, which is date

5:44:38submitted.

5:44:43All right, cool. Um I wanted date

5:44:45submitted cuz I know I want to know

5:44:46exactly when they submitted the date or

5:44:47when they submitted the form cuz I

5:44:49That's always good to know. I can just

5:44:50refresh here.

5:44:52And now, it gives me the the column that

5:44:53I put. And now,

5:44:55this is the variable. So, submitted at,

5:44:57which tells me the date. This gives me

5:44:58also the time and all that sort of

5:44:59stuff. So, we're going to drag this

5:45:00across submitted at.

5:45:02And now, I wouldn't want this like this.

5:45:04So, I'm going to format this in a way

5:45:06where it's actually readable for the

5:45:07company. They can actually understand. I

5:45:09mean, cuz who's going to understand

5:45:10this? They're going to have to spend

5:45:11time even thinking about what this

5:45:12means. So, uh to do it, I believe it's

5:45:16format date.

5:45:19Uh

5:45:20no, it's not that.

5:45:21Okay, so let's see why it doesn't work.

5:45:22Uh let me see what I have. Suggested to

5:45:24date time. Okay. Okay, okay. And then,

5:45:26we have to format it, right?

5:45:28Right here. Yeah, format. And now, it's

5:45:30asking me to format it in the right way.

5:45:32In this case, you see the result. The

5:45:33way that this is set up, we just added

5:45:35the formula.

5:45:36WW MM DD will result in this.

5:45:40Uh in this case, I probably wouldn't

5:45:41want it like that. Um

5:45:43let me just go to the formatting guide,

5:45:44which will show me exactly the kind of

5:45:46format that I need to add. But, this

5:45:48looks crazy with the

5:45:50with the color that I have. Um

5:45:53In this case, we want

5:45:55We can do this. Uh August 6th. Let me do

5:45:57FF.

5:46:00So, if I do FF here,

5:46:02it should show Yeah, 20th of August 2025

5:46:05at 6:20. Yeah, that's perfect. Uh now,

5:46:07if I execute the step, which will use

5:46:09the previous variables to actually add

5:46:10it to the sheet. I go here, I can see

5:46:13that the responses were added here.

5:46:16Okay? So, JM Solution, this, this, and

5:46:18then we also have the date. Let's space

5:46:19this out, and then that's good. All

5:46:20right, cool. So, now that we have this,

5:46:22we can go to our next step, which is

5:46:23actually making the sales email. So, in

5:46:25order for us to make the sales email,

5:46:27we have to use a agent. Okay, there's a

5:46:30few reasons why. Um

5:46:32we typically would have like this is a

5:46:34agent workflow because we're we're also

5:46:36formatting the email. I know exactly

5:46:38what it means. But,

5:46:40if you go to AI, you can either use an

5:46:41agent or you can just simply use an LLM.

5:46:43I typically use an agent because we're

5:46:44doing different actions with the with

5:46:46the thing. Like, we're we're not just

5:46:47telling the agent write the email, but

5:46:48we're also telling it, "Hey, format it."

5:46:50And AI agents are usually very good at

5:46:52taking something and then doing

5:46:53something with it. Um

5:46:55as in, doing different actions. So, I'm

5:46:56going to press AI agent to connect this

5:46:58step to here. And now, I'm going to

5:47:00rename this

5:47:01sales. So, first

5:47:04sales agent.

5:47:06Sales email agent.

5:47:08rename And now I have to connect this to

5:47:10three different things. Uh and I have to

5:47:11put a prompt inside, which is the main

5:47:13thing. Um so here chat model will be

5:47:16OpenAI.

5:47:18To connect your OpenAI here, create a

5:47:20new credential, you have to go to

5:47:21platform. The open ai.com sign up to

5:47:24login.

5:47:26I want to show you everything cuz I feel

5:47:27like this is one of the things that uh

5:47:29it's like the small things that actually

5:47:30matter when you build automations.

5:47:31Dashboard

5:47:32go to API keys.

5:47:34Create an API key. Name it whatever you

5:47:35want, right? Then you have So let's

5:47:37actually do it. Human in the loop

5:47:41agent YouTube

5:47:43Create a secret key. Don't want Don't

5:47:44worry about any of this. This is the API

5:47:46key. So save this cuz you're not going

5:47:47to be able to reaccess it unless you

5:47:50make a new one. Um so we go back to n8n.

5:47:53API key paste it here, then you save it,

5:47:55and then it will automatically be

5:47:56connected, okay?

5:47:58Close. All right, cool. Then you want to

5:47:59connect it to 4.1 mini, that's fine.

5:48:02And actually we have to go inside the

5:48:03agent first before we do the other ones.

5:48:05Let me go inside. And now we have to do

5:48:06a few things. Uh the first thing is

5:48:08source for prompt. So this is asking us

5:48:09what is that thing that's going into the

5:48:11AI agent every single time. Uh in this

5:48:13case, it would be the the details of the

5:48:17lead, right? Which will be the details

5:48:19of the form. Um which is why we have to

5:48:20change this. So this right here, it says

5:48:22connected chat trigger node. This means

5:48:24that usually when you have an AI agent,

5:48:25you chat to it and then it does

5:48:26something, uh which is why we're using

5:48:28chat trigger node. But in this case,

5:48:29we're using a form. So we have to change

5:48:31this to define below.

5:48:33And now here we have to add the things

5:48:35that are going into the agent every

5:48:36single time. Uh so I can go here to

5:48:38expression.

5:48:40Go full screen. And now I can add the

5:48:42lead details to the form. So in this

5:48:44case it can be

5:48:46Here's the lead.

5:48:48Here's the

5:48:50Yeah, here's the new lead intake

5:48:52information.

5:48:54Then we can start adding it. So full

5:48:55name

5:48:58right here.

5:48:59Yeah.

5:49:00We're going to cross. Email

5:49:03company name

5:49:06budget

5:49:08project description

5:49:12timeline

5:49:14And then I also want to add something

5:49:16else later on. Uh but email goes here.

5:49:18Company name goes here.

5:49:20Budget goes here.

5:49:23Project description goes here.

5:49:25All right, so uh the reason why And now

5:49:27this is basically changing every single

5:49:29time. So these variables will change as

5:49:30the form submissions change, uh which is

5:49:32what we want because they want the sales

5:49:34email to be different every single time

5:49:35for every lead. Um but the reason we're

5:49:37putting it in the user message is

5:49:39because in the user message we add the

5:49:40things that change. The system message,

5:49:42which is what we find here system

5:49:44message. This is what we tell the AI

5:49:46agent what it needs to do, right? In

5:49:48general and the identity that it has. So

5:49:50if I go here, I can now start adding the

5:49:52system message. I'm going to go here.

5:49:54This is a prompt that we're going to

5:49:55give the agent for it to think through

5:49:57what it needs to do and what it is. I'm

5:49:59going to copy the prompt from the other

5:50:00agent that I built before and paste it

5:50:02here.

5:50:03Uh and by the way, you can either take a

5:50:04screenshot and put it through ChatGPT

5:50:05and tell it, "Hey, can you transcribe

5:50:06this?" Or I'm going to show you after at

5:50:08the end what how you can get the whole

5:50:09resource for free, the whole blueprint,

5:50:10so don't worry. Um but this basically

5:50:13saying, "You are an expert salesperson

5:50:15for an agency that delivers AI

5:50:15solutions. Your job is to respond to

5:50:17incoming leads by addressing their needs

5:50:19in a professional manner. You will

5:50:20receive an information that looks like a

5:50:21lead project description and timeline,

5:50:23and your goal is to convince them and

5:50:24let them uh let them know that we are

5:50:26the best AI agency on the market." The

5:50:28projects uh so the tools, right? So this

5:50:30is the typical structure that we have.

5:50:31We have overview. We have the tools that

5:50:33are connected to the agent. Then we have

5:50:35the rules.

5:50:36Now

5:50:37I'm going to explain to this I'm going

5:50:38to explain to you what it is, something

5:50:40we forgot to add to the Miro right here.

5:50:43When the first agent actually um is

5:50:45doing cuz we want the agent to be

5:50:47connected to

5:50:49the Google Sheet

5:50:52with project results.

5:50:55Because we want to incorporate results

5:50:57to our email. So we we don't want to

5:50:58say, "Hey, thanks for filling out the

5:51:00form. We can definitely help." We want

5:51:02to say, "Hey, I saw that you do it a

5:51:03lead generation I saw that you're

5:51:04looking for lead generation project."

5:51:05"We actually did a lead generation

5:51:06project for John a few months ago and we

5:51:08got these results. We can help you,

5:51:10right?" So it's always good to

5:51:12incorporate proof into what you're

5:51:13doing. Um

5:51:15So we want to connect this to Google

5:51:16Sheet.

5:51:18We want to connect this as well to Let's

5:51:20leave this to Google Sheet, right? So in

5:51:21this case

5:51:23uh that's why we see the projects. So

5:51:25this is the tool that's Google Sheets in

5:51:27this case where it gets the different

5:51:29rows from our Google Sheets to then give

5:51:31to the AI agent uh for it to to actually

5:51:33use to make the email. Um we say use

5:51:36this tool to search through the previous

5:51:36project we've done that can be included

5:51:38in the Okay, cool. So before So to

5:51:40actually make the tool, we have to make

5:51:41the sheet. Because right here is the

5:51:43intake.

5:51:44But then right here is the projects.

5:51:47So what we want here is a way for the

5:51:49agent to pull projects in or pull

5:51:51results that we've done before. So what

5:51:54I'm going to do is I'm going to copy the

5:51:57um the results I had before. And bear in

5:51:59mind, this is something that the company

5:52:00can start adding every single time after

5:52:03after a minute. It'll The agent will

5:52:05always be automatically uh updating as

5:52:07in it will take all the rows that are

5:52:08here. So if you keep adding, that's

5:52:09fine. It will keep on updating

5:52:11whatever's here. Um and again, these are

5:52:13the projects that are going to be

5:52:14included when the agent needs to refer

5:52:16to Let's say someone said lead gen, it

5:52:18will use this example for result in lead

5:52:21gen project. Same thing with general

5:52:23tech, onboarding content, and whatever

5:52:24it is. So actually now that I start to

5:52:26think about it

5:52:28we forgot to add

5:52:30the intent. Um

5:52:32Okay.

5:52:34Which is

5:52:36drop down

5:52:38lead generation

5:52:42Then we have content creation.

5:52:48And this is something that happens,

5:52:49right? You just think through it,

5:52:50forget. Um that's why I want to show you

5:52:52the raw version of me building

5:52:53automations cuz that's what actually

5:52:55drives value to people. Uh onboarding

5:52:57automation

5:52:58Uh let's do general

5:53:01uh general automation support.

5:53:07All right, so um yeah, this is

5:53:08definitely needed when we have to give

5:53:10to the agent for it to pull information

5:53:11from the Google Sheet. Um so

5:53:14let's rerun this. Let me actually update

5:53:15this. Uh let me go here.

5:53:17Let me do

5:53:20intent.

5:53:22Actually, let me

5:53:26So I have to shift this and then put

5:53:28here.

5:53:29Let me run this first.

5:53:34Let me just fast forward to me filling

5:53:35it up.

5:53:50All right, so I submitted the form. Now

5:53:51we have this data to to work with. We

5:53:53can pin it, right? Pinning it just means

5:53:54that we don't have to rerun the form

5:53:56every single time to execute the next um

5:53:58nodes, the automation. We can use this

5:54:00as test data for previous for the next

5:54:01steps. And now we want to add this to

5:54:04Let me refresh this.

5:54:07Okay, we This is good. Uh intent will be

5:54:09going here. Okay?

5:54:12Cool. So now we also want to give it the

5:54:13intent. So let me go here. Let me say

5:54:16intent.

5:54:18Submission, we can put intent here.

5:54:21All right, cool. Now we want to go here.

5:54:23And now because we are able to give the

5:54:26intent to the the agent, now I can use

5:54:28the projects, right? Because the intent

5:54:31is what's linked to here, to the

5:54:32projects.

5:54:33Perfect. Um Okay. So let's go here.

5:54:37We also give it some rules. So keep the

5:54:39email concise and professional under 100

5:54:40words. This comes from reactive

5:54:42prompting rather than active prompting,

5:54:44which is means that we prompt as we get

5:54:46errors, we prompt as we iterate as

5:54:48feedback as we get feedback. And

5:54:49feedback only comes from actually using

5:54:50the automation, actually running it. Um

5:54:52we give it a few objectives. Retrieve

5:54:54information about the projects with the

5:54:55lead to prove that the team is capable.

5:54:57Okay, so this is this is the part where

5:54:58we tell it to use previous projects'

5:55:00results to give in the email. Always

5:55:02write the email in HTML um because

5:55:05Gmail, to make it look pretty, so to

5:55:07make it look like this with new lines.

5:55:09This is called new line, one and two, uh

5:55:11spaces between lines. We use something

5:55:13called HTML tags.

5:55:14So break, so this right here, BR, really

5:55:17stands for break. Right? And that's why

5:55:19we add one.

5:55:20That will just do a new line. If you add

5:55:22two, that will be two new lines, one,

5:55:24two. Okay, so this is very important. Um

5:55:26and then do not add emojis in email.

5:55:27Yeah, don't like Definitely do not add

5:55:29emojis cuz in the sales emails, emojis

5:55:31are the worst thing you can add. Um

5:55:33perfect. Uh we're going to use this

5:55:35later on, but don't worry about it now.

5:55:36Uh now we can connect this to

5:55:39the Google Sheets. So

5:55:42Let me go to Google Sheets.

5:55:43Google Sheets tool, connection we did

5:55:45all this we already did. The resource

5:55:47will be um yeah, the resource will be

5:55:49sheet within document, and we can get

5:55:51rows.

5:55:52So when I get the rows, when I get

5:55:53these, then we're going to let the AI

5:55:55actually think through which result

5:55:56which project it needs to use to then

5:55:59make the sales email. So the sheet

5:56:00document will be

5:56:01CRM YouTube Human in the Loop Agent. The

5:56:04sheet will be projects.

5:56:07I'm going to leave this empty. So

5:56:08execute step.

5:56:11And now I'll see how it got the three

5:56:13different uh four different rows.

5:56:16Lead gen

5:56:17responses

5:56:18onboarding or content onboarding and

5:56:20general tech. Right? Now to That's what

5:56:21we're going to use to actually make the

5:56:22email to incorporate the results into

5:56:24the email.

5:56:25All right, cool. So now that we did

5:56:26this, we can now um I'm going to show

5:56:29you exactly

5:56:31why we have to add something else to the

5:56:32agent because it's a bit more technical,

5:56:34um but it's actually very very easy to

5:56:35understand once you see why we need it

5:56:37in the first place. So I'm going to run

5:56:38this.

5:56:40I'm going to show you exactly what we

5:56:42need this for.

5:56:43This agent right here

5:56:45what it did is that it just wrote the

5:56:47email. Okay? So Dear Mr. Kelly, we

5:56:49specialize in custom AI-driven lead

5:56:51generation systems and understand and

5:56:52all that. Okay. The only problem with

5:56:53this is that we

5:56:56don't get the subject line and we don't

5:56:57get the body of the email in two

5:56:59different

5:57:01Yeah, in two different uh variables. So,

5:57:02if I paste this all into Gmail, there

5:57:05will be no subject line. So, for us to

5:57:07be able

5:57:08to make an email that has a subject line

5:57:10and an email body, we need it to be in a

5:57:11very specific format.

5:57:13Right? That's why we pressed we toggle

5:57:15this on, which is required specific

5:57:16output format, because you want the

5:57:17subject line and the email to be in two

5:57:20different variables.

5:57:21So, once this is turned on, we have a

5:57:23new option here, which is output parser.

5:57:26We can just press this, structured

5:57:28output parser, and don't worry um I'm

5:57:30going to copy what I had before.

5:57:33But, when you get the blueprint, you can

5:57:34um you can directly have it.

5:57:36But, what I'm basically saying is

5:57:38let me just copy this.

5:57:42That I want

5:57:43the first property, so the first

5:57:45variable here is subject line, which is

5:57:47the subject line of the email, and then

5:57:48the email body, which is the body of the

5:57:50email, and then the required is for

5:57:52subject line and the email body.

5:57:53So, we want the actual output format to

5:57:55be in a subject line and the body of the

5:57:56email. So, let me show you the

5:57:57difference now

5:57:58when I run this.

5:58:02Okay, let's see why there's an error.

5:58:04All right, so after some error handling,

5:58:05uh I realized that the code here was

5:58:07wrong. I actually just pasted the right

5:58:08one. Um so, in this case again, it was

5:58:10just a few tweaks. A subject is subject

5:58:13line, and then we have email body,

5:58:15required. Again, if you have the the

5:58:16whole setup, you can just have it here.

5:58:18I don't worry. But, you want to make

5:58:19sure that this is right. And by the way,

5:58:20if you ask me, how did I get this code?

5:58:22You can simply go to ChatGPT and you can

5:58:24say, "Hey, I'm feeding the AI I'm

5:58:26feeding the code parser an email with a

5:58:28subject line and the body together. I

5:58:30want to output it as two different

5:58:32variables. One is subject, one is email

5:58:33body." And it will give you this code

5:58:34right here. So, you can see here we have

5:58:36a subject line, and we have an email

5:58:38body. Okay?

5:58:40So, now we can go to the next step. The

5:58:41next step is actually

5:58:43setting this. So, setting the edit

5:58:45fields set. Why do we do this? It's

5:58:47because

5:58:49ideally, when we go to the next step,

5:58:50which is human in the loop agent, which

5:58:52is what you're here for,

5:58:53is we get the feedback, and then we get

5:58:56the intent of the feedback. If it's

5:58:57positive, we send it to the customer. If

5:58:58it's negative, then we reroute it back.

5:59:00But, the only problem is is that we want

5:59:02to route the same variable back to the

5:59:04agent or back to the human in the loop

5:59:06agent. So, it's better if I show you

5:59:08rather than tell you, uh cuz it makes

5:59:09much more sense. But, in this case,

5:59:11let's just set two variables, which is

5:59:13subject.

5:59:15I'm going to press here,

5:59:17which in this case is JSON output

5:59:18subject,

5:59:20and

5:59:21email body.

5:59:22All right, which is email

5:59:26body.

5:59:27Okay, so these are the two different

5:59:28variables.

5:59:29Uh now, when we route it back to the

5:59:31agent that actually has to do the

5:59:32revision, we loop it back here. Okay, we

5:59:34loop it back here for it to use these

5:59:36variables to um to reroute it back.

5:59:38Okay. So, now that we have the variables

5:59:40set, we can then go to the human in the

5:59:42loop element.

5:59:43So, human in the loop will be

5:59:46um human in the loop right here.

5:59:48And you can see we don't have only

5:59:49email, we have Google Chat, we have

5:59:50Outlook, we have different softwares. In

5:59:52this case, we are using Gmail, so we can

5:59:54go here.

5:59:55To connect your Gmail to N and N, we

5:59:56have to go here, sign in with Google. It

5:59:58will take you through the same thing

5:59:59that we went through before.

6:00:01Message, send, and waiting for response.

6:00:03That's that's the thing that is human in

6:00:05the loop. The email is who are we

6:00:07sending the email to for it to give us

6:00:08feedback. In this case, we can put my

6:00:09email.

6:00:11If I go here, uh on the email, I think

6:00:13we added action required, new lead with

6:00:15budget. Okay, so we put the budget here.

6:00:16And then, here we put, "Hey Michele, we

6:00:19have a new lead for you. Okay, we need

6:00:20project description and the email

6:00:21drafted." Okay, cool. So, here, subject

6:00:24line will be this, new lead with budget

6:00:26of

6:00:27and this variable will be changed,

6:00:28because that's the thing that changes

6:00:29every single time.

6:00:31Add fields.

6:00:32No, it's actually form submissions.

6:00:34I can go to budget right here. So, it

6:00:36will change. And then, the message, like

6:00:39I mentioned before, is, "Hey Michele,

6:00:43we have a new

6:00:45lead

6:00:46form submission.

6:00:50Please revise the email

6:00:52and give feedback

6:00:55on the

6:00:56copy."

6:00:57So, in this case, we can just add two

6:01:00So, this just it's just two headings,

6:01:01heading two. We can do project

6:01:04description. So, the internal team knows

6:01:06has a context to what we're giving

6:01:08feedback on.

6:01:09Project will be here.

6:01:11And now, we can add the email. So,

6:01:13subject I would add the subject line.

6:01:17Subject. Actually, I do

6:01:19email.

6:01:22Uh

6:01:24I think this would work with markdown.

6:01:26This is markdown format. Um

6:01:27subject line will be

6:01:29used.

6:01:32Which is this.

6:01:36And we have email body.

6:01:42Which is this.

6:01:43Let's test this. Uh let's see if it

6:01:45works, how it works, uh when it works,

6:01:47why it works. So, waiting for input.

6:01:49Um

6:01:50okay, cool.

6:01:51So, now we go here.

6:01:53You can see Okay, so this didn't work.

6:01:55So, we we have to take this out. Um

6:01:58I can go here, I can see that we got the

6:01:59email. So, it's all good. Okay, perfect.

6:02:01Um okay, I also realized just now

6:02:04that

6:02:05So, let me just give me feedback so that

6:02:07I can I can approve.

6:02:10Perfect. Um

6:02:12I realized that this

6:02:15So, email doesn't As I just mentioned

6:02:17before, email needs HTML, not um

6:02:20it needs HTML, not markdown format. This

6:02:21is markdown.

6:02:22In order to put HTML, so in order to put

6:02:24heading two on HTML, we have to use

6:02:26this.

6:02:28Uh here, and then to close it, we have

6:02:30to use this, slash forward slash.

6:02:33And then, same thing with this.

6:02:39And then, we can just remove this. I

6:02:40don't think we need it.

6:02:42Output body.

6:02:44Yeah, that's fine.

6:02:45Okay.

6:02:46Um okay, put And then, we can add,

6:02:48"Please provide feedback on the email

6:02:53if you have." Actually, no, previous if

6:02:54you have.

6:02:58Perfect. Now, as you can see, when I

6:03:00went to the email, it actually just

6:03:01asked me to approve. But, in this case,

6:03:03we want to leave space for feedback. So,

6:03:04in this case, we have want to add free

6:03:06text.

6:03:07So, what this means is that when he

6:03:08sends us the email to revise, we don't

6:03:10just press approve. We can also press

6:03:12approve and deny, right?

6:03:14But, we

6:03:16want to add uh text. We want to add

6:03:18feedback. So, we can say, "Hey, change

6:03:20this, change that." And then, it will

6:03:21then send it to the agent to revise it

6:03:23and then change it, right? Um this free

6:03:25text is what we need.

6:03:27I want to take off append N and N

6:03:29contribution, which is just this.

6:03:33Automated N and

6:03:34saying, "Hey, N and I did this."

6:03:36Um so, we can do this. We can execute

6:03:38the step again.

6:03:40And now, if I get the email,

6:03:42I can see that it says respond.

6:03:45And the response,

6:03:46now I can give feedback. Okay, so I can

6:03:48say,

6:03:49"Hey,

6:03:50uh this needs to be more concise

6:03:54and professional."

6:03:57Submit. And now, that's the feedback

6:03:59that's going to come through. So, hey,

6:04:00this needs to be concise and

6:04:01professional. So, ideally, we want to

6:04:02then talk to the other agent, give it

6:04:03the email that we drafted right now,

6:04:05give it the feedback, and then let it

6:04:06revise and then do the whole thing

6:04:07again, and make it a repetitive loop.

6:04:09Okay? So, now that we have the feedback,

6:04:12as I mentioned on the mirror before,

6:04:14we want to send it to the feedback

6:04:16intent agent. So, so first, let's rename

6:04:19this to

6:04:20human

6:04:23in the loop.

6:04:28Rename.

6:04:29Uh and then, now I can send it to the

6:04:31text classifier. Cuz the text classifier

6:04:33on N and N basically takes text and

6:04:35classifies basically says, "Hey, based

6:04:38on the text, this is what it is." Um

6:04:39based on the options that we give it,

6:04:40the categories, right? Um okay. So,

6:04:44text classifier would be

6:04:46the

6:04:47this right here would be the text to

6:04:49classify, which would be the the

6:04:50feedback that we give it. And then,

6:04:52there will be two categories. One is

6:04:53approved and one is denied, right? So,

6:04:55approve.

6:04:57And then, let me just copy the

6:04:58description from the agent that I built

6:04:59this for.

6:05:01Go here. I say the sales agent approved

6:05:03the email accepted the way it was

6:05:04written. The text that we're classifying

6:05:06intends that it was accepted and that

6:05:08everything was uh good. Example output,

6:05:11yes,

6:05:12that's fine.

6:05:14Looks good.

6:05:15Send it through. Now, this came from

6:05:16actually testing, because

6:05:18how does it The text classifier isn't

6:05:20always 100% correct, right? Sometimes we

6:05:22give it something, we say, "Hey, can you

6:05:23change this part?" But, it assumes that

6:05:25we accepted it, so it sends it to the

6:05:26lead. Uh we want to make sure that we

6:05:28give it examples of what someone might

6:05:29say as a way for them to reference

6:05:31whether it's accepted or denied. Um so,

6:05:33that's why we had the examples.

6:05:35And then, category will be denied,

6:05:38which will be

6:05:39the uh right here, expression. Let me go

6:05:42here.

6:05:43Here. The sales agent denied the email

6:05:45and denied the way it was written. Uh

6:05:46the text that we're classifying intends

6:05:49that it needs updating or changing,

6:05:50usually usually.

6:05:52Um we'll provide it feedback on how to

6:05:54do so, and then we give it a few

6:05:55examples.

6:05:56So, make it shorter.

6:05:58I don't like it.

6:06:00It's too long. Include other projects.

6:06:02And no. So, these are

6:06:05various things that you would um ask the

6:06:07agent or you would tell the agent, and

6:06:08then we tell it, "Hey, based on these

6:06:11sort of examples, this is the denied

6:06:13path." Now, [snorts] okay, this is good.

6:06:15Um so, now, as you can see, we now have

6:06:17two different paths. So, then we can go

6:06:19to decide where we send the email to the

6:06:20lead, and then the denied path where we

6:06:22have to make the agent to revise. Uh

6:06:23but, before we do that, we have to add a

6:06:25model, because this thing's through an

6:06:26AI. So, the model here will be

6:06:29uh OpenAI model.

6:06:31Again, we already connected it, so 4.1

6:06:32mini is fine. And now that we

6:06:33categorized the different types of

6:06:35responses based on what's approved and

6:06:36what's denied, we can now send it two

6:06:38different ways. So,

6:06:40let's do the easy one first, which is

6:06:41approved. In this case, we just um use a

6:06:44Gmail node to send it to the customer.

6:06:46So, create

6:06:48send a message? Yeah, send a message.

6:06:50Um you already connected it, message

6:06:51send to

6:06:53in this case, we have to execute

6:06:54previous nodes.

6:06:56Uh okay, let me just add test email.

6:07:04Subject line will be hello. Let me just

6:07:06change this real quick later.

6:07:09Uh, let me just run this.

6:07:13Okay.

6:07:14Pin this.

6:07:17And then, now I believe that we have

6:07:20Okay, we don't have data here. So, let

6:07:21me just run this again.

6:07:24Go here. It's my email.

6:07:32Make it shorter.

6:07:33Now, this right here I can pin.

6:07:36And now I can use this. Okay? So, I can

6:07:38use this to say for to classify whether

6:07:40it's denied or approved. So, as you can

6:07:41see, it went down the denied path

6:07:43because we said make it shorter, we give

6:07:44it feedback.

6:07:46Um, okay. So, now we're here, I can then

6:07:48pull information from the form.

6:07:50It'll be email, which will be subject

6:07:52line will be in this one right here.

6:07:55Subject line.

6:07:57Actually, need to remove hello first.

6:08:01And then the body of the email, which in

6:08:02this case again, it's HTML.

6:08:04We can also put text, but we're using

6:08:05HTML um, for this for the actual

6:08:08message.

6:08:10Okay? So, now if I test this,

6:08:13Okay, I actually didn't get it for some

6:08:14reason. I didn't get any email. Let me

6:08:15try again to see if it works this time.

6:08:19Okay, I think it's because it didn't go

6:08:21down this path, but

6:08:23or it's because these are pinned. Let me

6:08:25just unpin this. Do each one

6:08:26individually.

6:08:28By the way, I'm just pressing P when I

6:08:29hover over this.

6:08:30I can try rerun this.

6:08:34Okay, let me just go through the whole

6:08:35phase. Um,

6:08:37right here.

6:08:38Go here. I can get an email. I can say

6:08:40yes.

6:08:43Looks good.

6:08:44Submit. Go back. And now because it's

6:08:46approved, it will go down this path.

6:08:47Okay, cool. That's why. Uh, because the

6:08:49text that we gave it before was the

6:08:50denied path.

6:08:52So, we go here.

6:08:53Um, and then I can say we do usually

6:08:55generation one week. We're specializing

6:08:57developing new generation intelligent

6:08:58systems for business. For instance, we

6:08:59recently helped a real estate firm

6:09:01generate 20 leads. Do you see how it

6:09:02pulls in

6:09:03these sort of projects? We recently

6:09:04helped a firm generate 20 leads in 5

6:09:06days after working with us, which

6:09:08generated 100k pipeline. That's what it

6:09:09uses

6:09:11to uh, in the email, right? To generate

6:09:13sort of authority and trust.

6:09:15Uh, given your timeline and budget,

6:09:16we're confident we can deliver. Okay.

6:09:17Best regards. And now, this right here I

6:09:19don't want. Okay, so this is where we go

6:09:20here

6:09:22to the email node and add options. We

6:09:25can then, uh, append it we can turn this

6:09:27off. Okay, append and end attribution.

6:09:29Turn this off so that

6:09:31we don't need um,

6:09:32we don't have the sponsorship, which is

6:09:34right here.

6:09:36Okay. So, we're naming this to

6:09:38send solely email.

6:09:43And that's the first path for approved.

6:09:44Uh, so the next step is the denied path.

6:09:46So, in this case, we get the feedback

6:09:47and then we give it to another agent to

6:09:48revise it. Okay, so I'm going to press

6:09:50add AI agent. In this case, we can name

6:09:53it revision

6:09:55agent.

6:09:56We don't need to connect it to a chat

6:09:57trigger node. I mean, we don't have it

6:09:58connected, so we just have to define it

6:09:59below. And the thing that we give it is

6:10:02Let me go expression. Wait, is the

6:10:04feedback and the email, right? So, it

6:10:06knows the both of them. So, in this case

6:10:08it will be feedback

6:10:10received,

6:10:13which will be this one here.

6:10:15And the email body,

6:10:17which will be this one here.

6:10:20Right? And subject line.

6:10:24So, we get it. Okay. Uh, and now we want

6:10:26to give it a system message because we

6:10:27want to take give it an identity in the

6:10:28whole thing that we gave it before. The

6:10:30only thing that changes now is the fact

6:10:31that now it needs to revise. But it

6:10:33still sends the it still does the actual

6:10:35email. I'm just going to copy and paste

6:10:36the prompt that I wrote before, uh, so

6:10:38you don't have to waste time actually

6:10:39writing it.

6:10:40>> [snorts]

6:10:41>> And I have you are helpful intelligent

6:10:42email assistant who needs to update a

6:10:43sales email based on the provided

6:10:44feedback. When I add overview, which I

6:10:46forgot to add. The tools is the same,

6:10:48the rules are the same, and final notes

6:10:50are the same. Um, okay, cool. And uh, we

6:10:53still need to turn this on because we

6:10:54still need it to be in a very specific

6:10:56format. In this case, it's subject line

6:10:57and email. Again, the only thing that

6:10:59changes is that this makes a revision,

6:11:01but the output is still the same, which

6:11:02is an email. So, I'm going to put this

6:11:04requires a specific format. And now, I

6:11:06have to connect these to a chat model,

6:11:08to a tool, and an output parser. The

6:11:10good thing about N and N is that you

6:11:11don't have to connect it again

6:11:13to this to to a different thing. We can

6:11:15use the previous

6:11:16chat model, previous

6:11:18tool, and the previous output parser.

6:11:21Okay, so they're connected to the same

6:11:22thing.

6:11:23So, this goes here, uses these, then

6:11:25goes here if it needs to go here, and

6:11:27then uses this again. So, you don't have

6:11:28to redo it. And I can press save.

6:11:31And now, let's test it. So, let me go

6:11:32here.

6:11:34Let me use the feedback that we got uh,

6:11:36from here.

6:11:37Let me go here.

6:11:39Hey Michele, we specialize in customized

6:11:41lead generation systems. We recently

6:11:42helped I told it to be more concise. I

6:11:44think that's what Yeah, more concise and

6:11:45professional.

6:11:47We do a call to discuss how we can see.

6:11:48Yeah, I think it's more concise.

6:11:49Definitely more concise. I don't know

6:11:50about professional. Um, but that's fine.

6:11:52And now,

6:11:53to make sure that we can send it back to

6:11:55the human in the loop to make sure that

6:11:56it's a whole repetitive process,

6:11:58we have to

6:11:59pin this across and put it in the edit

6:12:01fields. Okay, so this is where it all

6:12:03links together because we want it to be

6:12:05a repetitive loop. So, we want to make

6:12:07the email for the first agent, which

6:12:08only writes the first email,

6:12:10then send it to the human in the loop to

6:12:11make sure that we revise.

6:12:13If it's bad, it will revise it, send it

6:12:16back again. If it's bad again, revise it

6:12:18until we accept it. Okay, so it's a

6:12:20whole repetitive process. So, there's no

6:12:21human The only human in the loop is us

6:12:24actually approving it or denying it. Uh,

6:12:26but the automation is smart enough so

6:12:28that we can loop it back. And the reason

6:12:29why we're using this node right here,

6:12:31which I explained before, is because the

6:12:32output here,

6:12:34subject and email body,

6:12:35is the same

6:12:37type of variables that we get here,

6:12:38subject and email body. Okay, so this

6:12:40basically gets the input from here and

6:12:44from here, and they're all the same. The

6:12:45only thing that changes is the actual

6:12:46content, right? Uh, but the variable

6:12:48name, the key, this is called the key,

6:12:50is the same.

6:12:51So, that's how we use that. Um, okay.

6:12:54So, let me unpin this.

6:12:55And we can run this from the start until

6:12:56the end.

6:12:58Save. Unpin this as well.

6:13:01Save. And I can execute workflow. Let's

6:13:03go here, and I can start filling out the

6:13:05form.

6:13:06James Michael.

6:13:18Now, obviously this should be above. Um,

6:13:20we can change it later in in the form,

6:13:22but that's the whole form right there.

6:13:23Submit.

6:13:24Now, this starts the automation. Okay,

6:13:26so it sends it to our CRM. So, if you go

6:13:28here to uh, that was the old one.

6:13:31To here.

6:13:32C1.

6:13:33James Michael, Media Corp, budget,

6:13:35authority, uh, budget description,

6:13:37timeline, intent, and date submitted.

6:13:39It will now send it to us for revision.

6:13:42Action required. Let's say we look at

6:13:43this and we say,

6:13:45respond.

6:13:46We say,

6:13:48>> [snorts]

6:13:48>> you need to

6:13:53ask him

6:13:55at the end

6:13:58to give you

6:14:00a few times that work for them

6:14:05next week for a call. Okay, so in this

6:14:07case, it should send it to the denied

6:14:09because we gave it feedback.

6:14:10So, you see how it goes here. It will

6:14:12use the AI.

6:14:14It will use these tools as well. Send it

6:14:15back. Another email.

6:14:17So, could you please provide a few times

6:14:18that work for you next week?

6:14:20Let me say,

6:14:22make this

6:14:23a bit longer.

6:14:25So, now when I submit it, it then goes

6:14:26back to the same thing. You see how it's

6:14:27a whole repetitive loop? It goes through

6:14:29every single time. Um, and that's why

6:14:31it's it's a great system to have because

6:14:33it doesn't really end until you accept

6:14:34it.

6:14:35I go here again.

6:14:37I can

6:14:39respond

6:14:40and say, yes.

6:14:42All good.

6:14:44Press submit. And now, because it's

6:14:46approved, it then goes here. Okay, and

6:14:48we get the email,

6:14:50which is this. So, let's discuss your

6:14:52AI-driven automation. It made it a bit

6:14:54longer like we asked it to. It also made

6:14:55the question here.

6:14:56Um,

6:14:58and it added the case study right here.

6:15:01Okay, so that right there is One more

6:15:04one step ahead that we can do is

6:15:05actually make only the first name, not

6:15:08the full name. So, let's just do that

6:15:10right now.

6:15:11Let me go here. Um,

6:15:16Yeah, let me actually just put first

6:15:18name. I think that would work in the

6:15:19send. Yeah, I could do first name.

6:15:25And I think this needs to be split.

6:15:31I think it needs to be a space.

6:15:35Yeah, and then I can

6:15:37first.

6:15:38So, this gets the first. Yeah, so this

6:15:39gets James. So, a full name

6:15:42is like this,

6:15:43right?

6:15:46And this is always good to know because

6:15:47when you're building automations, you

6:15:47want to have these sort of formulas uh,

6:15:50at hand. So, the full name is first

6:15:52name, space, last name. So, what we're

6:15:53saying is split this by the space, so it

6:15:55will be one and two, and I want the

6:15:57first. So, it comes here.

6:15:58The split with space, space here, and

6:16:00then I want the first. If I said last,

6:16:02it will get the last name. So, let me

6:16:03say,

6:16:05last. It will get Michael, right? James

6:16:07Michael. Or Michele Torti. I mean, in

6:16:08this case it would

6:16:10because the full name is James Michael,

6:16:12it will get Michael.

6:16:13And if you're enjoying this n8n course,

6:16:15then you might want to check out our AI

6:16:16automation circle, which is a school

6:16:18community for people who look into learn

6:16:20AI automations from zero, either to

6:16:22apply it in their own business or to

6:16:24start their AI agency to provide

6:16:26services to clients. We have people

6:16:27introducing themselves every single day,

6:16:29asking questions, sharing wins, getting

6:16:31technical support, and also looking for

6:16:33jobs and partnerships. We also have a

6:16:34classroom full of courses, which is the

6:16:37AI automations one-on-one course, an

6:16:38extension to this course, the templates

6:16:40vault, which is all the resources from

6:16:43our YouTube channel in case you want to

6:16:45work with us one-on-one to start and

6:16:46scale your agency. We have all the

6:16:48weekly recordings from every single call

6:16:49that we do, plus over $20,000 in

6:16:52discount codes. And we also have two

6:16:54calls a week for weekly huddles to

6:16:55answer any questions and also live

6:16:57coding sessions where we actually build

6:16:59systems from scratch. The only catch is

6:17:00not everyone gets in, so feel free to

6:17:03apply and make sure you put some

6:17:04thoughts into your answers. With that

6:17:06being said, let's get back to the

6:17:07course.

6:17:10I built an AI agent on N and that reads

6:17:13my contacts, manages my emails, and my

6:17:15calendar, and even writes my blog posts.

6:17:17And honestly, it still blows my mind.

6:17:19So, in today's video, I'm going to show

6:17:20you exactly how I did it. All right, so

6:17:21let me show you exactly how it works. We

6:17:23have the agent pulled up here, and then

6:17:25we also have Telegram, which is exactly

6:17:26how I get to talk to the agent. Let me

6:17:29just say,

6:17:30"Can you send an email to James Low uh

6:17:32telling him that we have dinner tomorrow

6:17:34at 7:00 p.m. in Rome, and also can you

6:17:37put that on the calendar to make sure

6:17:39that we have it there for 7:00 p.m. and

6:17:40send an invite to him?" And uh yeah, let

6:17:43me know when it's done.

6:17:44All right, so right now, the agent had a

6:17:47task assigned to him. It's going on and

6:17:49finding the different agents that he

6:17:50needs to talk to in order to fulfill the

6:17:51task. It's using both the email agent

6:17:53and the calendar agents, as you can see.

6:17:56The email is done, the calendar is done.

6:17:58And I get a text saying that the email

6:17:59to James Low about dinner tomorrow 7:00

6:18:01p.m. in Rome has been sent, and a

6:18:02calendar event for dinner is also being

6:18:04created. So, if I go to my email right

6:18:05here, I should expect an email saying we

6:18:07have dinner tomorrow 7:00 p.m. in Rome,

6:18:09which is fine. Calendar, I can see that

6:18:11we have dinner in Rome, which is

6:18:12scheduled for 7:00 to 8:00 p.m. and I

6:18:13never told it to do 1 hour, but it was

6:18:15smart enough to understand that for

6:18:16dinner, uh 1 hour is fine, which is

6:18:18great. And then it sent an invitation to

6:18:20100 million dollar peanuts, which is the

6:18:21email that I have uh unlisted under

6:18:23James Low right here. The real ones know

6:18:25what this is, and uh it was scheduled

6:18:27automatically for me, and the email was

6:18:28sent. All right, cool. So, now you got

6:18:30to see what the AI agent does. Let's go

6:18:32to Miro right here. So, I drew up this

6:18:34diagram which shows exactly the

6:18:35fundamentals or the way that this

6:18:37multi-step AI agent works. Now, we still

6:18:39have an input, and we have an output.

6:18:41Sorry for that. Uh the input is

6:18:43essentially what I told it. I said,

6:18:44"Hey, can you do XYZ for me? Can you

6:18:46schedule an email? Can you schedule um

6:18:48can you put something on the calendar?"

6:18:49Right? This is an instruction that we

6:18:50told the AI agent to start with. That's

6:18:52the input. Uh and the output is here,

6:18:54everything was good. So, after we give

6:18:56it the input, that goes on to the

6:18:57multi-step AI agent. Now, think of this

6:19:00as a CEO of the company, CEO of the AI

6:19:02agents. It has system prompts and

6:19:04instructions. So, what these are are

6:19:06instructions that say, "Hey, you are a

6:19:08helpful, intelligent assistant." Right?

6:19:10The typical prompt that you put in for

6:19:11an AI agent. And we also say, "Here are

6:19:13the tools that you have access to. Here

6:19:14are the agents that you have access to.

6:19:16If this happens, if you're asked to send

6:19:18an email, then choose this agent. If

6:19:21you're asked to do the calendar, then

6:19:22choose that agent." Right? So,

6:19:24fundamentally, this multi-step AI agent

6:19:27thinks with its brain, which is the LLM,

6:19:29and also has a memory, which means it

6:19:31remembers the previous conversations

6:19:32that you had or the previous questions

6:19:33that you asked. And on a high level, the

6:19:35multi-step AI agent gets an input, which

6:19:37means it gets a a request, right? And

6:19:39then chooses which agent to talk to.

6:19:42So, think of these as head of

6:19:43departments. So, the CEO has different

6:19:45head of departments in their company.

6:19:48So, it gets a request and then chooses,

6:19:49"Hey, based on what I was told, let's

6:19:51say we do uh schedule calendar event for

6:19:53tomorrow for dinner," which is exactly

6:19:54what I did, then it would go out and

6:19:56talk to the head of calendar, so the

6:19:57calendar agent. It sends a request

6:20:00saying, "Hey, I got a request saying

6:20:02that we want to schedule a dinner for

6:20:03tomorrow 7:00 p.m." And then that

6:20:06calendar agent talks to its tools, which

6:20:08are the employees, which actually do the

6:20:10thing, which actually schedule the

6:20:11event, create the event through a

6:20:13request. And then they get a response,

6:20:14which is, "Yeah, it was successful." And

6:20:16they respond back to here saying, "Hey,

6:20:18everything was good."

6:20:19And obviously, these head of departments

6:20:21think with their brain, which is the LLM

6:20:23in this case. But, let's say we asked it

6:20:25to send a calendar event or even send an

6:20:27email.

6:20:28In this case, because we have a contact

6:20:31department, we because we have a contact

6:20:32agent, the first step it has to do that

6:20:34we instructed to is, "Hey, if we're told

6:20:37or if you're told to schedule a calendar

6:20:38event or schedule an email, the first

6:20:40step you have to do is actually find the

6:20:42contact of the person that we're talking

6:20:44about because I'm just saying the name,

6:20:46and then you can do the other things."

6:20:48So, for the example that I gave you for

6:20:49the calendar, they have the input, which

6:20:51is calendar. Multi-step AI agent. First

6:20:53step is contact agent, so to get the

6:20:54contacts that it needs through a request

6:20:57and a response, right? Talking to the

6:20:58tools as well, which are the employees,

6:20:59which gives the contacts and find the

6:21:01contacts. And then it goes here, then it

6:21:03says, "Okay, what do I have to do

6:21:04first?" In this case, calendar agent, so

6:21:07we schedule the calendar. So, head of

6:21:09department goes to the employees saying,

6:21:11"Hey guys, can you do it?" "Yes, it's

6:21:12done." [music] Sends a response,

6:21:13"Everything was good." And then talks to

6:21:15the email agent, which is head of email

6:21:17in this case for the company. Then from

6:21:19the email agent, it assigns it to its

6:21:20employees, which are tools, through a

6:21:22request. So, sends a request like, "Hey

6:21:23guys, can you do this?" Then sends a

6:21:25response, which is, "Yeah, everything

6:21:26was good." And then once everything is

6:21:28executed based on what we told it to do,

6:21:30it then gives me the output saying,

6:21:31"Hey, everything was good." And so on.

6:21:33And then we also have a blog agent,

6:21:34which in this case wasn't used, but this

6:21:36agent is just used when we tell it to

6:21:37write a blog. Right? And then it goes

6:21:39out to the head of content, per se, and

6:21:41then head of content assigns it to its

6:21:42employees, which are tools, through a

6:21:44request, and then we get a response.

6:21:45Right? And that's our whole repetitive

6:21:46loop that happens every single time.

6:21:48But, this is non-deterministic. So, what

6:21:50does non-deterministic mean? It means

6:21:51that the input can result in different

6:21:54outputs. So, I can say, "Hey, send an

6:21:56email." And it will send an email. But,

6:21:57I can also say, "Send a blog." And it

6:21:59will send a blog. So, it the one input

6:22:02can result in multiple different

6:22:03outputs. That's what non-deterministic

6:22:04means. It's not determined, right? Uh

6:22:06so, that's what it is. All right, so the

6:22:07first step to this AI agent is the

6:22:09trigger. So, the trigger is the first

6:22:10thing that actually starts the

6:22:11automation, starts the the AI agent

6:22:13because there's a way that there's a

6:22:14systematic way that we actually talk to

6:22:16the AI agent. It's like you're talking

6:22:17to an employee, there has to be an

6:22:18input, right? And this is the input

6:22:20right here. Uh so, if I go on here,

6:22:22which you can find, by the way, if when

6:22:23you go to Telegram,

6:22:25go here, and then you go down to

6:22:27triggers, which is essentially, I don't

6:22:29know if you guys can see it, but

6:22:32on message right here.

6:22:33So, this is the one we're going to use

6:22:36to then trigger. So, it says, "Hey,

6:22:38whenever a message comes," so trigger on

6:22:39message, "whenever a message comes, can

6:22:41you please just um allow it to or can

6:22:43you please just trigger the automation?

6:22:45Can you start the automation?" And to

6:22:46connect to your Telegram, all you have

6:22:47to do is press here on credentials to

6:22:50connect with. This is my account. You

6:22:51can create new credentials. And then to

6:22:53actually connect this, let me press this

6:22:54here, which talks to the agent from N

6:22:56and N, which gives you like a

6:22:57step-by-step instructions. Uh there's a

6:22:59clear process to it. You have to talk to

6:23:01an agent called the BotFather, which is

6:23:04Yeah, so create a Telegram account,

6:23:05start a chat with the BotFather, so you

6:23:07have to use this link right here.

6:23:09And then you can uh you have to give it

6:23:11a {slash} something. You have to start a

6:23:12conversation with yeah, {slash} new bot.

6:23:15And then you can get your API key or

6:23:17your access token, which it gives you,

6:23:19which then allows you to connect it to

6:23:21your account. So, once you connect it to

6:23:23your account, you want to just put

6:23:24trigger on message, which allows you to

6:23:26be able to trigger the the actual

6:23:28workflow on the message that you sent

6:23:30it. So, let's say I trigger this.

6:23:32So, I go here.

6:23:33And I just

6:23:34I can write a text like, "Hey, how are

6:23:36you?"

6:23:38And then go inside and see that we got a

6:23:40text saying, "Hey, how are you?" Right?

6:23:42And this is a text. [music] Now, we use

6:23:44a switch node after this because a

6:23:46switch node allows us to differentiate

6:23:47whether the text or whether the message

6:23:49was in audio, whether it's a text.

6:23:51Because if it's an audio, we have to get

6:23:52the file, which because the audio itself

6:23:54turns into a file, and then give it to

6:23:56AI to say, "Hey, we have an audio. Can

6:23:58you just turn it into text so we can use

6:24:00it?" Okay? Because the input here has to

6:24:02be text. Either way, whether it's an

6:24:04audio, whether it's just text. So, we

6:24:05want to make sure that we get text in

6:24:07the AI agent, in the CEO, uh all the

6:24:09time. So, switch here, go inside, and

6:24:12then we want to make sure we're choosing

6:24:14basically a field that only happens

6:24:16whenever we send the audio. So, what I

6:24:18mean by that is, let's say we send a

6:24:19text. In this case, this is all the

6:24:21fields that we get, right? Which is

6:24:23this, message text. So, we know it's a

6:24:25text because this says text, because

6:24:27chat says text. But, let's say I did a

6:24:28voice message, so let me go here and let

6:24:30me rerun it.

6:24:32Let me say, "Hello, this is me. Hello,

6:24:34hello."

6:24:36I can then go here, I can see that it

6:24:37triggered. We can see here that it's

6:24:38voice. So, when we go back here, we're

6:24:40basically saying, "Hey,

6:24:42set the rules." There's two different

6:24:43rules. If it's an audio, so we know it's

6:24:45an audio because we know that this

6:24:47variable exists, mime type. And we know

6:24:49it's a text when text exists, which we

6:24:51already had before. So, we're splitting

6:24:53into two different ways.

6:24:54And we're using again two different

6:24:55variables, the ones here. Right? This

6:24:57looks like code, but it actually is just

6:24:58me

6:24:59dragging and dropping this one here.

6:25:01Boom, like this, right? And you'll get

6:25:03it there.

6:25:04Uh and then we are splitting into two

6:25:06different ways. So, if it's an audio, it

6:25:07goes here. If it's a text, it will go

6:25:09here. And then we'll send this, so this

6:25:11right here is just the text of the

6:25:12message, and it will send it both ways

6:25:14to the AI agent. So, route it back and

6:25:16then bring it back to the same place.

6:25:18So, the AI agent always gets text.

6:25:19There's a few things we have to set up

6:25:21for the main AI agent. The first one is

6:25:22source for prompt, which is the user

6:25:24message. Now, in the simplest way

6:25:25possible, this is asking us basically,

6:25:26"What is the thing that you want to feed

6:25:28in to the AI agent?" So, there's two

6:25:31options. The first one is connect uh

6:25:33connected chat trigger node. So, let me

6:25:34zoom in. Connected chat trigger node,

6:25:35which is basically saying, "Do you want

6:25:37to connect it to the chat node of N and

6:25:40N?" Which is because N and N has a uh

6:25:42native chat node. So, we say no, we're

6:25:44using Telegram, so we just want to

6:25:45define it below. So, we're defining it

6:25:47ourselves. And below, which in this case

6:25:49is just json.text, which is the text

6:25:51that we get from Telegram. Whether it's

6:25:53a voice, whether it's a text, we always

6:25:55give it the same thing. And then we

6:25:57require specific output format. No, it

6:25:58doesn't require any specific output

6:25:59format because it changes. And then

6:26:01enable fallback method. This says, "Hey,

6:26:03since it's using an AI to actually

6:26:05think, uh it says, 'If the AI doesn't

6:26:07work, do you want to set another

6:26:08fallback method?'" So, it uses another

6:26:10AI. Well, in this case, we don't need

6:26:11to, so we can just leave it there. And

6:26:12now, for the most important part of the

6:26:14agent is the system message. So, this is

6:26:16the instructions. Let me press this

6:26:17button right here, which basically puts

6:26:19it full screen. And this is the general

6:26:21structure that you would give an AI

6:26:23agent for it to actually work. Because

6:26:24the prompt is the most important thing.

6:26:25Without a prompting, without you giving

6:26:27instructions to someone, how are they

6:26:28meant to know what to do? Right? So, we

6:26:30say we give it an overview, so you are

6:26:32the ultimate personal assistant. Your

6:26:33job is to send the user's query to the

6:26:35correct tool. Uh and these are the

6:26:36different tools. So, I say first tool,

6:26:38and then second tool, and then third

6:26:39tool, and then content agent, so this is

6:26:42a

6:26:42another tool, and then we give it some

6:26:43rules, instructions, and a final

6:26:45reminder, here's the current date and

6:26:46time. So, we always give it the date and

6:26:48time because AI isn't the best at at

6:26:50guessing what date and time it is.

6:26:52I tried running it before. I said, run a

6:26:54make an event for tomorrow and it made

6:26:56an event for I think 6 months ago. So,

6:26:58not the best. And the structure is

6:27:00overall mainly the same. We have the

6:27:02overview, which is some context. We have

6:27:04tools. So, for the tools this app we

6:27:05have contact agents. So, we say use this

6:27:07tool to take contact actions. You might

6:27:09use this before sending emails or

6:27:11creating calendar events within

6:27:12attendees. So, this is where we go into

6:27:14prompting, right? Which I don't want to

6:27:15get too deep in, but we're basically

6:27:17saying, "Hey, before you use something

6:27:19else, use this." So, let's say we say,

6:27:21"Hey, can you send an email to James?"

6:27:22How does it know James' email, right?

6:27:24So, we're basically saying we're

6:27:25prompting it saying, "Hey, before you

6:27:26send an email, before you create a

6:27:27calendar event, just go out to the

6:27:29contact database and find the contacts,

6:27:31which in this case is in a Google

6:27:32Sheet." So, that's what we tell it to

6:27:33do. And then we have the email agent,

6:27:35which is use this tool to take action in

6:27:37email, that's simple. Then we have

6:27:39calendar agent, which is basically

6:27:40saying use this tool to take action in

6:27:41the calendar. I also reiterate it. So, I

6:27:43said, "Hey, you must use a contact

6:27:46agent before using calendar agent and

6:27:48make sure you pass through the email of

6:27:49the contact to the calendar agent. Now,

6:27:51this only comes from actually testing

6:27:52the agent and making sure that it works

6:27:54because sometimes what it was giving me

6:27:55it was when you know when I say send the

6:27:57invite to the actual person, it was

6:27:59sending me just the name. So, I say,

6:28:00"Hey, no, that can't happen. Just send

6:28:02me the email cuz that's the email is the

6:28:03only thing that we can actually use to

6:28:05send the invite." Then we have content

6:28:07agent, so use this tool to generate a

6:28:08blog and return the full text. And then

6:28:10we have rules here. And the rules are

6:28:12basically going towards telling the AI

6:28:14agent some rules that it needs to do.

6:28:16And this is a difference between

6:28:17proactive and reactive prompting because

6:28:19reactive prompting is essentially the

6:28:21the act of iterating, so means changing

6:28:24the prompt over time as you're testing

6:28:26the agent. So, you're testing the agent,

6:28:28you see that the email agent doesn't

6:28:29work for this reason, you add rules

6:28:30saying, "Hey, if this works,

6:28:32do this." But, you wouldn't know it

6:28:33didn't work if you didn't actually test

6:28:34it. So, you always want to do reactive

6:28:36prompting. Test the agent and then add

6:28:37the rules.

6:28:38That's what you want to do. And then

6:28:39some instructions and then final

6:28:41reminder again. All right, cool. So,

6:28:43this is the prompt that we want to use.

6:28:44And this is the one that is going to use

6:28:45to then decide which AI agent it's then

6:28:48going to offload the task to. Now, the

6:28:50main AI agent is connected to a child

6:28:52model. So, this is the brain, the LLM

6:28:53that I was talking about. With in this

6:28:55case we use ChatGPT 4.1 mini. To connect

6:28:57your OpenAI, you just have to go here,

6:28:59create a new credential.

6:29:01And then you have to go to the actual

6:29:03platform the OpenAI. So, you go here.

6:29:09platform.openai.com

6:29:11You log in. So, you have to log in and

6:29:12then you have to go to dashboard, I

6:29:14believe. API keys on the left-hand side.

6:29:17Go here to create a new API key.

6:29:19Name it. So, hello.

6:29:21Test. YouTube, 19th of August.

6:29:26Leave this as you. Project is default

6:29:28and information is all, so it's fine.

6:29:30Create a secret key and then copy this.

6:29:33Bring it back to N and N.

6:29:35And then this is the one you're going to

6:29:36put here. So, API key, let's do YouTube

6:29:40August 19th.

6:29:42You don't need this. Base URL is fine.

6:29:44All you have to do is press save

6:29:46and you'll see this green check mark

6:29:47here, which means that connection was

6:29:49tested successfully. And bear in mind

6:29:50that you need to add credits to OpenAI

6:29:52for it to actually work. And I think $5

6:29:54should do, it's enough. It's exactly

6:29:56what I put I think 4 months ago and now

6:29:58it's still going. So, it's very very

6:29:59cheap. Now, the model itself, 4.1 mini

6:30:01is actually very very good. Some models

6:30:03don't work for this AI agent, like to to

6:30:05actually run the AI agent. For example,

6:30:074.0 would not work. So, leave this as

6:30:094.1 mini, which is very fast. Then we

6:30:11have think, which is a new node that was

6:30:14added recently, which is just used to

6:30:16add that extra person to think. So, it

6:30:18does everything and then it consults is

6:30:19like a consultant. It consults with the

6:30:21AI agent saying, "Hey, I did all of

6:30:23this. Am I doing it right or is there

6:30:24something that I'm getting wrong?" It

6:30:26will think through it and then it will

6:30:27tell it if something is changed. And

6:30:29then simple memories, if I go in here, I

6:30:31can see that we have a session ID, which

6:30:34will just be the chat ID that we have

6:30:35with the agent. Then we have context

6:30:37window length. This just means how many

6:30:38text messages do you want the AI agent

6:30:39to actually remember when it gives you

6:30:41the output. Cuz let's say I say, "Hey,

6:30:43can you send an email to James?" Then he

6:30:45goes out and sends the email to James

6:30:46and says, "Hey, we're done." And then

6:30:48you say, "Can you actually schedule the

6:30:49calendar event with him as well?" Now,

6:30:51it needs to remember who James was,

6:30:53right? That we actually said James for

6:30:55it to actually do the thing. So, this is

6:30:56basically saying if you put five, it

6:30:58will just say, "Hey, remember the five

6:31:00past conversations that we had with

6:31:01you." So, that's what it means. And then

6:31:03here is where the real sauce begins

6:31:05because we have the contact agent, the

6:31:07email agent, calendar agent, the content

6:31:09creation [music] agent. All right, so

6:31:10the first tool here, the first agent

6:31:12that is hooked up with is the contact

6:31:13agent. Now, this right here, again, is

6:31:16the head of contacts. What it will do is

6:31:18it will call this tool to take action

6:31:19within the contact database. So, we add

6:31:20a description, which is what it is, and

6:31:22then we say the prompt. So, the prompt

6:31:24is what do we tell the agent to do? In

6:31:26this case we can define it automatically

6:31:27by the model. And then we give it a

6:31:29system message, which is exactly what we

6:31:30gave it in the main model. Overview,

6:31:32which is you are a contact manager, you

6:31:33have tools to take action within the

6:31:35contact database. The different tools

6:31:37you have is get contacts, you use this

6:31:38tool to get contact information, like

6:31:40address or phone number, and then add or

6:31:42update a contact, use this to add a new

6:31:44contact to database or update an

6:31:45existing contact. So, that's exactly

6:31:47what it does. Those instructions allow

6:31:48it to think about what it has to do and

6:31:50choose which tool it needs to send the

6:31:52information to. And we also have a

6:31:54model, which is the brain, so in this

6:31:56case the LLM, which is also hooked up to

6:31:58the main agent, the same. So, in this

6:32:00we're using 4.1 mini like I mentioned

6:32:01before. Then we have the tools. We have

6:32:03get contact and then we have add or

6:32:05update contacts,

6:32:06like [music] you saw here in the system

6:32:07message. So, if I go here to the first

6:32:08tool, we can see that get contacts is

6:32:10hooked up to Google Sheets. So, the

6:32:12first step you have to do is go here,

6:32:14create a new credential. And all you

6:32:15have to do is sign in with Google. You

6:32:16can press this button right here, which

6:32:17will take you through the main page

6:32:19right here with Google, which will

6:32:20basically allow you to connect to any

6:32:22account that you want. And then you can

6:32:23bring it back. It's as easy as that. You

6:32:25can bring it back and it will be

6:32:26connected, so that's fine.

6:32:28Yes, delete. And then you want to set

6:32:29this automatically because we're

6:32:31allowing AI to actually set the tool

6:32:33description, so what it actually needs

6:32:35to do. And then the resource will be the

6:32:36sheet within the document because

6:32:38there's a sheet that we're using, which

6:32:39is a contacts, which is this one right

6:32:40here, which all the contacts. In this

6:32:42case it will be more, but these are the

6:32:43ones that we have now. And then we have

6:32:45get rows because that's the action that

6:32:47we have to do. In this case we're

6:32:47getting contacts from the list. So,

6:32:49which sheet are you using? Which Sorry,

6:32:51which document are you using? So, which

6:32:53Yeah, which main sheet are you using?

6:32:54So, in this case it will be contact

6:32:55database USB. And what sheet within the

6:32:57sheet are we using? So, in this case it

6:32:58will be sheet one. And then you want to

6:33:00leave this blank because we want to let

6:33:01the AI figure it out. Now, let's test

6:33:03this. Let me show you exactly what this

6:33:05just what this step does. Let me go to

6:33:06Telegram. Let me execute the workflow

6:33:09and say So, in this case we have James

6:33:11Low.

6:33:13So, hey, can you

6:33:15quickly

6:33:17get me James Low's

6:33:20email?

6:33:21So, through text it will then talk to

6:33:23the main agent. It will think, "Hey,

6:33:24what agent do I need to use in order for

6:33:27me to do that task?" It will think and

6:33:29then it will send it here and then this

6:33:30will then send it here, bring it back,

6:33:32and then give me the output. And it will

6:33:33say, "Hey, James Low's email address is

6:33:35100 million dollar peanuts. Is there

6:33:37anything else you want me to do?" So,

6:33:38this right here just used the agent, so

6:33:39used this tool right here to do this

6:33:41specific task. So, it will think through

6:33:43which agent it will send it to. It will

6:33:45then send it here and then based on what

6:33:47it's told, it will then think through

6:33:48exactly which tools or which employee is

6:33:50it going to offload the task to. In this

6:33:52case the employee will be the get

6:33:53contacts. And the same thing is update a

6:33:55contact, so right here we can update the

6:33:57contact here. We're going to do the same

6:33:59connection, set automatically. This is

6:34:01all the same. The only thing you want to

6:34:02change is you want to map the column

6:34:04mode manually because you're manually

6:34:06mapping each column. And then it says

6:34:08based on cuz when we tell it, "Can you

6:34:10update or can you change something?" It

6:34:12needs to know what it needs to change.

6:34:13So, we want to match the name to the

6:34:15name in the sheet to make sure that it

6:34:17knows exactly which one is updating. And

6:34:19then it's updating the name, which is

6:34:20defined automatically by the model, the

6:34:22email

6:34:23or the phone number. Right, based on

6:34:25what it needs to update. And I give it a

6:34:26description as well. So, this is the

6:34:27name of the person, the email, and the

6:34:29phone number. And leave everything else

6:34:30the same. So, [music] these two are

6:34:31called upon when it needs to do that

6:34:33specific task. Now, let's get on to the

6:34:34email agent, which is, again, the same

6:34:36thing, same same sort of setup. We have

6:34:38the description, so call this tool to

6:34:39take action in email. Prompt, which

6:34:41should be defined by the model. Then we

6:34:43have system message. So, you're an email

6:34:45assistant, you have tools to take action

6:34:46in email. And then we have different

6:34:48tools, so send, get, draft, create,

6:34:52reply, create a draft, and then get

6:34:54labels, actually label them. And then we

6:34:56have rules and then final reminder.

6:34:58In this case for the different tools, we

6:35:00tell it we give it a small interaction.

6:35:01So, in this case you have to use this to

6:35:03send an email, use this to get emails.

6:35:05And we give it different rules and

6:35:06different logic. And this all comes from

6:35:08actually testing and making sure that we

6:35:09know exactly what hasn't worked [music]

6:35:12based on our test and then what can we

6:35:13add to the prompt to make sure that it

6:35:15works every single time. So, that's what

6:35:16we want there. And this is basically it.

6:35:18So, all the same for the different

6:35:19agents. And then it's hooked up to the

6:35:21OpenAI brain, which again is the same

6:35:23for every single agent. And then it's

6:35:25hooked up to six different tools. Send

6:35:27email, get emails, email reply, create a

6:35:29draft, get labels, and label emails.

6:35:31So, in this case let's go to send

6:35:32emails. This will be the one tool that

6:35:34will be used that will be called upon

6:35:35when it needs to send an email. So, if I

6:35:37go to credentials right here, all you

6:35:38have to do to connect your Gmail to N

6:35:40and N is go to create a new credential.

6:35:43And just as we did for the Google Sheet,

6:35:45we just have to sign in with Google. It

6:35:47will take you through this page right

6:35:48here. You can just choose which account

6:35:49you want to use and that's the one that

6:35:51will be brought back here and it will be

6:35:52connected automatically.

6:35:54Press delete. Let me go here. So, leave

6:35:55this as set automatically. The resource

6:35:57will be message because that's the thing

6:35:58that we're actually doing. The operation

6:35:59is basically what action are we taking?

6:36:01So, we want to send in this case. And

6:36:03it's asking us who do we send the email

6:36:04to? What's the subject line? So, email

6:36:06type, which is essentially either HTML

6:36:08or text. In this case we just want to

6:36:09leave it to HTML because if you want to

6:36:11send a blog over email, then we want it

6:36:14to have headers and all that sort of

6:36:15stuff. And the only way to have headers

6:36:16is to use HTML instead of text. And then

6:36:19it's asking us what message So, what's

6:36:20the body of the email? So, in this case

6:36:22we're allowing the model to actually

6:36:23think through exactly and define who are

6:36:25we sending the email to. So, based on

6:36:26So, let's say I say, "Hey, send the

6:36:27email to James." It will first of all

6:36:29get the contact, find the email, and

6:36:31then it's smart enough to actually think

6:36:33about

6:36:34what email do we put here? In this case

6:36:35it will be the email of the contact that

6:36:36we just mentioned.

6:36:38Subject line is the same. So, it will

6:36:39think through the context that we give

6:36:41it.

6:36:41In this case let's say we we tell it to

6:36:43write an email about going out for

6:36:45dinner. The subject line will be created

6:36:47based on that context. And the same

6:36:48thing with message. So, let me test this

6:36:50one right here so you get a feel of sort

6:36:51of what it does just on this

6:36:53>> [music]

6:36:53>> this right here.

6:36:55Let me execute workflow. Let me pull up

6:36:57Telegram. And we can say, "Hey, can you

6:36:59send

6:37:01an email to him?" So, in this case,

6:37:04we're actually testing the memory

6:37:05itself.

6:37:06Um saying,

6:37:10uh "You are fired."

6:37:13There you go.

6:37:15So, then you execute the workflow. So,

6:37:16it will think through what it needs to

6:37:17do.

6:37:18It will then know that it needs to use

6:37:19this email agent to send the email,

6:37:21bring it back

6:37:23to Telegram. So, if I go to my email

6:37:24here, I can see that I sent an email to

6:37:27100 million other peanuts saying, "You

6:37:29are fired." And the subject line was

6:37:31already chosen by the model. So, that's

6:37:33exactly what it does. So, based on what

6:37:35it was instructed to do, it will choose

6:37:37which tool it will use. This setup is

6:37:38very much the same as the other tools.

6:37:40So, if we go to get many, the connection

6:37:42is the same, set automatically, message

6:37:43is the same. In this case, we want to

6:37:45change this from send to get many

6:37:47because we want to get the different

6:37:48emails that we need to get. Return all,

6:37:50just let the AI handle this. It will

6:37:52define whether it needs to return all or

6:37:53just one

6:37:55or what it needs to return in this case.

6:37:57And then the sender. So, defined

6:37:58automatically by the model and we also

6:38:00give it a description. So, it sort of

6:38:01has the guardrails when it needs to

6:38:02think about who is the sender. So, in

6:38:04this case, it can be a sender's name or

6:38:05email address when it needs to pull

6:38:07information. And then same thing with

6:38:09email reply. So, in this case, we have

6:38:10message and then we have reply. The

6:38:12message ID will be obviously the message

6:38:14that we previously got that we're

6:38:15replying to.

6:38:16And then we will leave this as HTML just

6:38:18to make the email look pretty if it

6:38:19needs to in case we're sending a blog.

6:38:21And then the message here will be the

6:38:22body.

6:38:24Turn this off because then we don't have

6:38:25to see any end on the email.

6:38:28Same thing with create a draft. So, in

6:38:31this case, instead of message, you can

6:38:32put draft.

6:38:33Create for operations. That's the actual

6:38:35thing that we're doing. This is the

6:38:37subject line, so we let it define by the

6:38:38model. So, just press this button right

6:38:40here or you can simply add

6:38:42bracket bracket dollar sign from AI and

6:38:44then you put subject. This is the

6:38:45variable that we're pulling in or you

6:38:46can just

6:38:47do this. And then you can leave this as

6:38:49HTML and then message is defined by the

6:38:51model. And then whoever sending the

6:38:52email to as a draft is defined by the

6:38:54model as well. Same thing with get

6:38:56labels. We're just getting labels. So,

6:38:57label and get many and return all will

6:38:59be defined by the model. And then label

6:39:01emails as well

6:39:02because this right here is a two-step

6:39:04operation because we're first getting

6:39:05emails to then label the email. In this

6:39:07case, it will be the message. Add label.

6:39:10Message ID will be the ID of that

6:39:12specific thread of email. And then label

6:39:14names or IDs will be the ones that will

6:39:15be pulled in from this right here.

6:39:17Because before this acts, this one

6:39:19happens before cuz it needs to again get

6:39:21labels before using the labels that it

6:39:23was given to then do the thing. Then we

6:39:26go to calendar agent. Very similar

6:39:27setup. We have the description, the

6:39:29prompt which is defined by the model.

6:39:30Then we go here. As you can see that

6:39:32this is a system message. So, this is

6:39:33the instructions that we give the AI

6:39:35agent in thinking through what it needs

6:39:37to do.

6:39:38Again, very very similar setup as the

6:39:39one we have before, overview tools and

6:39:41final reminder.

6:39:42And most importantly here, we have date

6:39:44and time because again AI is just the

6:39:46worst at thinking through the times and

6:39:47the dates. And now it will think through

6:39:49what it needs to do. And then it's

6:39:50hooked up to five different tools. So,

6:39:51we have create an event with attendee.

6:39:53So, this is basically creating an event

6:39:55with someone, right? Um which is exactly

6:39:57what I showed you at the start of the

6:39:58video. In order to connect your Google

6:40:00calendar to an end, all you have to do

6:40:01is create a new credential. You go here,

6:40:02sign in with Google. It will take you

6:40:04through this page. Choose the account

6:40:05that you want and this is will be the

6:40:06one that will be connected here. And

6:40:07then you want to put the resources as

6:40:09event because it's an event, right? Uh

6:40:12create because that's the task that

6:40:13we're doing. That's the action that

6:40:14we're doing. We're creating something.

6:40:16The calendar will be your calendar. And

6:40:17then it's going to ask you for the start

6:40:18and end date. So, let's say I tell it to

6:40:20schedule an event for tomorrow at 7:00

6:40:22p.m. It will choose the start date. And

6:40:24it will also choose the end date. So,

6:40:25you see how before it shows the 8:00

6:40:27p.m. 1-hour time frame. I didn't tell it

6:40:29to. The AI automatically did it. Right?

6:40:31This is what it is. Default reminders,

6:40:33leave this as on because then Google

6:40:35calendar can choose its own reminders.

6:40:36And then it's going to ask us who the

6:40:38attendees are. The attendees are

6:40:39basically the people that are going to

6:40:40be invited to that specific event that

6:40:42we're doing. We're also giving it a

6:40:43description and the summary as well. All

6:40:45defined by the model itself because it

6:40:47will be smart enough to know that it

6:40:48will give the email, right? And we tell

6:40:49it the description as well. And the

6:40:50summary will be defined automatically by

6:40:52the model as well.

6:40:53And then let me actually do this. Let me

6:40:55actually show you just this model right

6:40:57here. So, you can see exactly the flow

6:40:59that it goes through. So, just get

6:41:00contact and then do this.

6:41:02Let me go here.

6:41:03Let me say,

6:41:05"Can you

6:41:07create

6:41:09an event

6:41:10for

6:41:11tomorrow?

6:41:13God, my spelling is horrible.

6:41:14Event for tomorrow at 6:00 p.m.

6:41:19and invite

6:41:21him." Yeah, that's it.

6:41:25Boom.

6:41:26Then I'm waiting for it to do. It will

6:41:28think through what it needs to do. It

6:41:29will create the event. It will then give

6:41:30me a response. If I go to my Google

6:41:32calendar, I can see that event with

6:41:35James Low was done at 6:00 p.m. to 7:00

6:41:37p.m. Again, it was smart enough to think

6:41:38that it's just a 1-hour slot. But of

6:41:41course, it was given it was given the

6:41:42context that it it wasn't given a 1-hour

6:41:43thing. So, it will think through exactly

6:41:45what it needs to do. It will just choose

6:41:46the 1-hour and add it there. It will

6:41:48send me the invite as well. That's cool.

6:41:50And that's what this tool does.

6:41:53And the same setup is for creating an

6:41:54event without the attendee. So,

6:41:56everything's the same apart from the

6:41:57fact that we just don't add any

6:41:58attendees here. Get events is the same.

6:42:00So, in this case, we're just changing

6:42:02this to get many.

6:42:04So, let's say we go here

6:42:05to Telegram and we ask it Let me just

6:42:07execute the workflow.

6:42:09Let me ask it,

6:42:11"What events

6:42:13do I have

6:42:15this week?"

6:42:17So, now it will think through what it

6:42:18has to do. It will then think through

6:42:19what it needs to use.

6:42:20It first it will get the events and

6:42:22bring it all back to Telegram. So, right

6:42:24here it will tell me that I have the

6:42:26out-school workshop this weekend,

6:42:28James Low, dinner in Rome, and workshop

6:42:30again. So, this right here is something

6:42:32that I had Was it yesterday at 1:00

6:42:34a.m.? Yeah, yesterday 1:00 a.m. That's

6:42:36why it's telling me that it's from this

6:42:37week as well. And that's how this tool

6:42:39works. So, get an event. And then we

6:42:40have delete events which is again the

6:42:42same. The only thing we have to change

6:42:43is the event and delete. Calendar will

6:42:45be ours. Then it's asking us for the

6:42:46event ID. It's sort of the same as

6:42:48replying to an email because you need to

6:42:49know the email ID first of the one that

6:42:51you're replying to to then reply. In

6:42:53this case, it's asking us what is the

6:42:54event ID? What is the event that we're

6:42:56deleting? And what's the ID? Because

6:42:57that's the unique identifier for that

6:42:59specific event. That's what we need. So,

6:43:00we want to define it automatically by

6:43:02the model. Which again, all of these

6:43:04This right here wasn't before. It wasn't

6:43:05here before. But now because the model's

6:43:07got smarter, we're able to let AI

6:43:09actually do it and let it handle it. And

6:43:11that's fine. [music] And then we have

6:43:12update an event which will be same

6:43:14connection, set automatically, event

6:43:16which will be update in this case.

6:43:18Same calendar, event ID which is the

6:43:20same as before. Use default reminders.

6:43:22And now we give it a start and end date

6:43:24which is the same as before. We're

6:43:26basically saying, "Hey, this is the

6:43:27start and this is the end, right? Of the

6:43:29of the time frame that you want to

6:43:31update." So, that there is for the

6:43:32calendar agent. And then we go on to the

6:43:34content creation agent. So, in this

6:43:35case, we have descriptions. Call this

6:43:37tool to create a blog post. The prompt

6:43:38is automatically decided by the model.

6:43:40It doesn't require any output format.

6:43:42The fallback model, we don't need this.

6:43:43And then we just have to use the system

6:43:45message which in this case is you're an

6:43:47expert blog writer. Use the appropriate

6:43:49tool to write a blog post. In this case,

6:43:51the only tool we have is Perplexity

6:43:52which will be used to actually do the

6:43:54research before we actually write the

6:43:55blog post.

6:43:56Um again, this is exactly what I told it

6:43:58to do. And then some rules are that your

6:43:59blog post should be less than 500 words

6:44:01because we don't want it to be too big.

6:44:03And also it can't send more than 500

6:44:05words. Or I mean, I don't know how much

6:44:06it can send. I don't know what the limit

6:44:07is. But on Telegram, it can't send a

6:44:08blog post to back to Telegram with more

6:44:11than X words. So, we're just cutting it

6:44:12off. And we're also saying output the

6:44:14whole blog text. And then [music] final

6:44:16reminder, we just give it a date and

6:44:17time in case it needs to know. So, that

6:44:19right there is the system prompt that we

6:44:21tell the content creation agent to do.

6:44:23And then we actually hook it up to

6:44:24Claude. So, you see here we use OpenAI,

6:44:26OpenAI, OpenAI.

6:44:27Well, the reason why we're using Claude

6:44:28in this case is because Claude is

6:44:30extensively better at understanding and

6:44:31making content. It's much better at

6:44:33using words and creating words and

6:44:35creating feelings out of words. That's

6:44:36like the best way that I like to think

6:44:37about it. So, that's why we use Claude.

6:44:39If I go here, the way to connect your

6:44:41Claude is

6:44:42create a new credential. And all you

6:44:43have to do is you have to go to

6:44:45anthropic.com/console. So, let me go

6:44:46here. anthropic.com/console.

6:44:49You want to log in. And then you want to

6:44:51get your API key right here.

6:44:54Create a new key.

6:44:55Name it whatever you want. So, let's do

6:44:57test

6:44:58N N

6:45:00agent.

6:45:01Add.

6:45:02Copy the key. This will be the one that

6:45:04you use to actually set back here.

6:45:06Right? And then you'll save it. So, now

6:45:08you connected your Claude. And then you

6:45:09can leave this as Claude for Sonnet. And

6:45:11now you want to hook up Perplexity to do

6:45:12the research for this agent to make the

6:45:14blog post. So, the way that we do that

6:45:16is press plus, add Perplexity tool. And

6:45:18then we go here, connect it. So, in this

6:45:20case, the way that we connect it is go

6:45:22here. And then in Perplexity, if you go

6:45:24here, you can see that down below

6:45:27to the account,

6:45:28we go to API,

6:45:30API keys.

6:45:32You can create a new key.

6:45:33Right? Or you can just copy here the one

6:45:35that you already made. And this will be

6:45:36the one that you then copy paste in

6:45:38here, API key

6:45:39to connect it. Set automatically,

6:45:41message a model because that's the thing

6:45:42that we're doing. Sonnet Pro is the

6:45:44model that we're using.

6:45:45You can use any other model. I think

6:45:46this is fine, relatively fast. And then

6:45:49the messages is what is the prompt that

6:45:50we tell the AI to do. So, what is the

6:45:52thing that we tell it to research? And

6:45:54we let him this define it by the model

6:45:55[music]

6:45:56based on the context that we give. And

6:45:58then you will leave it as user prompt

6:45:59because user prompt is essentially your

6:46:00task is to do XYZ. And that's fine. And

6:46:03then we have maximum number of tokens

6:46:05which will be automatically defined by

6:46:06the model which just means that when a

6:46:08blog is very very long and a lot of

6:46:09words come out of it, it's usually token

6:46:11intensive which means that it takes up a

6:46:13lot of API credits. It's more expensive,

6:46:14right? So, we would just want it to let

6:46:17the AI handle the maximum number of

6:46:18tokens. But we already told it to only

6:46:20do 500 words. So, the tokens are already

6:46:22restricted as to how many we're using

6:46:24them. So, that's fine. And that's the

6:46:26thing that we're going to use for

6:46:26Perplexity.

6:46:28So, let's actually test this cuz I

6:46:29haven't tested the content agents. Let

6:46:30me go here. Execute workflow. Let me go

6:46:33to Telegram. "Can you send me a blog

6:46:37about

6:46:40why the Roman times

6:46:43were the best

6:46:46compared

6:46:47to now.

6:46:48Some random Okay, so we got here.

6:46:50We'll then think through what he needs

6:46:52to use.

6:46:53He'll then know that he needs to use the

6:46:54content creation agent. He'll talk to

6:46:55Anthropic,

6:46:57then Perplexity to do the research.

6:46:58Again, it has different rounds, so it

6:46:59does different types of research. And it

6:47:01does take a bit longer than the others

6:47:02just because it is content creation.

6:47:03It's more uh time intensive. Now, it's

6:47:05going back here. It's thinking through

6:47:07what he needs to use. It'll now it'll

6:47:08now format it in the right way so we can

6:47:10send it to Telegram. And if I go here, I

6:47:12can see that we have a blog about why

6:47:15Roman times were better than compared to

6:47:17I'm actually interested to see what it

6:47:18says.

6:47:18Why the glory rage of my phones?

6:47:21Okay, it will probably say some some

6:47:22stuff that um like smartphones are bad

6:47:25for you or whatnot. Uh but yeah, this is

6:47:27the whole blog that we have. All

6:47:28automatically within what? Just a few

6:47:30seconds. Well, I mean, like 20 seconds,

6:47:31right? Uh so that's what we get there.

6:47:33And this is the way [music] that we set

6:47:35up the content creation agent. But

6:47:36essentially, what this is, again, is a

6:47:37multi-step agent. It's one agent that we

6:47:40talk to you through Telegram through an

6:47:41input and an output that has a memory

6:47:44uh right here. It has a brain, which is

6:47:46the LLM. And then it has different

6:47:48tools. The tools are the things that it

6:47:49calls when it needs to do something,

6:47:51right? In this case, if it needs to get

6:47:52a contact, it will talk to this tool.

6:47:54Again, head of department uh of

6:47:56contacts, head of emails, head of

6:47:57calendar, head of content.

6:47:59And then from there, it actually execute

6:48:01the task, sends a response, and then

6:48:02sends it back here. And then gives it to

6:48:04us in a in a very clean, natural

6:48:06language English way, right? That's what

6:48:07it does. So that right there is a full

6:48:09walk-through of the AI agent that I

6:48:11built inside of N8N that manages my

6:48:13contacts, calendar, emails, and even

6:48:14drafts my content.

6:48:19In today's video, I'm going to show you

6:48:20step-by-step how I built a self-learning

6:48:22AI agent inside of N8N that stores

6:48:24long-term memory. It remembers past

6:48:26[music] conversations from tools like

6:48:27Telegram, and even improves itself over

6:48:29time by writing new memories to our

6:48:31database. All right, so the first thing

6:48:32I want to do is actually show you the

6:48:33live action of how it works. On the

6:48:35left-hand side, we have Telegram because

6:48:37Telegram is sort of like WhatsApp,

6:48:39iMessage that you text the AI agent for

6:48:40it to actually do something. On the

6:48:42right-hand side here, we have

6:48:44uh in the middle, we have the AI agent

6:48:46in N8N. And right here, we have the

6:48:48memory database. So database just stands

6:48:50for a place where you put stuff, right?

6:48:52In this case, it's going to be a Google

6:48:53Sheet. And this is where we're going to

6:48:55store information for the AI agent to

6:48:57extract over time as it's giving us

6:48:59answers. So I'm going to say

6:49:01well, I mean, I like football. My

6:49:03brother's name is James. I'm from Italy.

6:49:06So let's do

6:49:07what sport do I like?

6:49:11In this case, it's talking to the

6:49:13memory. It extracted all the

6:49:14information, and now it tells us that I

6:49:15like to play football.

6:49:17Need some tips to want to talk to you

6:49:18about strategies. What the hell, man?

6:49:20Okay, there you go. All right, cool. And

6:49:21we can ask any other questions. So let's

6:49:22say I wanted to ask um

6:49:25I also like dogs.

6:49:28So let me run this first.

6:49:30And then, let me put the message here.

6:49:33And let me press go.

6:49:35This will now this should add it to our

6:49:36database.

6:49:37You should see it right here. User also

6:49:39likes dogs. As you can see, it's adding

6:49:41information over time about the user so

6:49:44that it comes to a place where you can

6:49:45ask any questions about yourself or

6:49:47whatever it is, or even your business or

6:49:49your life in general, and it has

6:49:50context, right? It has a database full

6:49:52of contextualized information of who you

6:49:54are, what you are, and sort of what what

6:49:56it is that you're about, um and

6:49:58different pieces of information like

6:50:00this

6:50:00that it can use to give you answers,

6:50:02right? So it's much better than just a

6:50:03normal AI agent that has no context to

6:50:06you. All right, so before I get to

6:50:07explaining the whole AI agent in N8N

6:50:09step-by-step, I want to go through and

6:50:11show you how this looks like in ChatGPT.

6:50:13You're probably asking yourself, why is

6:50:15this even relevant? Well,

6:50:17the AI agent that we're building today

6:50:18is an AI agent that has memory on you

6:50:21and that updates itself over time

6:50:23so that when it gives you answers, it

6:50:24has context. You don't have to repeat

6:50:26yourself. Now, with ChatGPT, we can go

6:50:29to our profile. We can go to I believe

6:50:31it's settings,

6:50:33personalization. If you scroll all the

6:50:35way down,

6:50:36you can see here that it has memory.

6:50:38Right now, it's 89% full, which means

6:50:40that the memory of me that it has is 89%

6:50:42full, and it goes to 100, and it can't

6:50:44add more information. And if I go to

6:50:45manage,

6:50:47I can see now that it has different

6:50:49pieces of information right here about

6:50:50me

6:50:51that it extracted or that it got

6:50:54from the conversations that I've had

6:50:55with it. Now, this is really really

6:50:56powerful because it allows it to

6:50:58reference saved memories

6:51:00when responding.

6:51:02And reference chat history as well. So

6:51:04that every single time you go to

6:51:04ChatGPT, you don't have to re-explain

6:51:06who you are, what you've done, what your

6:51:08business is, and so on. Um but the only

6:51:10caveat to this is that it has a storage,

6:51:13right? And the storage isn't a crazy

6:51:15amount of information that you can add

6:51:16there. Uh but it is still good to have

6:51:18when you want to ask ChatGPT any

6:51:19questions. So I wanted to give you this

6:51:21as context when we explain how the AI

6:51:23agent actually works on N8N. Now, I drew

6:51:25up this diagram right here, which is the

6:51:27easiest way for me to explain all these

6:51:28concepts because it can get a bit

6:51:29overwhelming with all this database,

6:51:31storage, extract, information, XYZ. But

6:51:34to put it in a simple way, what it is,

6:51:35it's an AI agent that has an input,

6:51:37okay? So we have an input, which is

6:51:38Telegram. Hey, can you do XYZ?

6:51:40What it does as a first step is that it

6:51:42retrieves the information. Okay, so we

6:51:44have this database right here,

6:51:46which is called the memory AI agent,

6:51:48which has different rows. And all these

6:51:50different rows are pieces of information

6:51:51that has about us. And this is what it

6:51:53will use to then give us or use as

6:51:56context to then give us the answer,

6:51:57right?

6:51:58And so that's what this is right here.

6:52:00And when you hear database, it just

6:52:02means an Airtable, it means a Notion, it

6:52:03means a Google Sheet, right? Just so you

6:52:05can store data. Then what it does is

6:52:07that it sends the input plus the

6:52:10retrieved information, so the memory,

6:52:12all to the AI agent. And what the AI

6:52:14agent does is the follows.

6:52:16It looks at the information that it got,

6:52:17and it thinks through itself.

6:52:19Is this something that is worth me

6:52:21adding to the memory database based on

6:52:23the input? Or is it simply just a

6:52:25question or a statement that we just

6:52:26need to answer based on the context that

6:52:28we got? So let's say I ask it like

6:52:30before, I ask it, "Hey, what sport do I

6:52:32like to play?" I say it says, "User like

6:52:34to play sports." What it does, or user

6:52:36like to play football. The input is,

6:52:37"What sports do I play?" That's the

6:52:38question. It retrieves all the

6:52:40information from the database. Well,

6:52:41clearly the AI agent knows that this

6:52:43isn't a new piece of information. This

6:52:45is just a question that we can simply

6:52:47answer using the database that we have

6:52:49here. So what it does is that it goes

6:52:50straight here, and it generates a

6:52:52contextualized answer. Now,

6:52:53contextualized just means that it has

6:52:55context. In this case, the context is

6:52:57the database of memory of us,

6:52:59right? And gives it the answer. And then

6:53:00the output is

6:53:02uh the output to the user. So in

6:53:03Telegram, we get an answer back saying,

6:53:04"Hey," or it just gives us the answer,

6:53:06right? Like just like a general chatbot.

6:53:09Now, there is a case where we give it

6:53:11information, so we can say, "Hey, my

6:53:12mom's name is Janette," or whatever it

6:53:14is.

6:53:15We give it here. Now, the AI agent will

6:53:16have to classify whether that's worthy

6:53:18of putting to the memory database.

6:53:20If it is, then it adds the new

6:53:22information there,

6:53:23right? And it goes here. And so what it

6:53:25becomes is again infinite loop that it

6:53:26goes like round and round and round, and

6:53:29it keeps getting smarter and smarter and

6:53:30smarter. That's why we call it a

6:53:31self-learning AI agent because it

6:53:33self-learns, right? It self-learns based

6:53:34on the questions and and statements and

6:53:36the conversations that we give it. So in

6:53:38N8N right here, essentially how it works

6:53:40is that the first part is the input.

6:53:41Okay, so all these nodes that you see

6:53:43are actually quite easy. I'll take you

6:53:44through exactly what it is. Uh the first

6:53:46step is a Telegram trigger. So this

6:53:47trigger right here is able for us to get

6:53:51messages, right? So when I run this, let

6:53:54me ex

6:53:55Go here. Let me execute workflow.

6:53:57Execute step. And I can pull up

6:53:59Telegram.

6:54:00And let's say I say, "My business name

6:54:02is JM Solutions, and we help companies

6:54:04be more efficient um

6:54:06in their own workflows using AI and

6:54:08automations." I can press go. What this

6:54:11will now do, as you can see, it

6:54:12triggered, which means that it sent the

6:54:13information here for us to start the

6:54:15conversation. Because a chatbot or an AI

6:54:17agent needs to have an input, right?

6:54:19Like what is the thing that we're

6:54:20actually processing? What is the

6:54:21information that we're processing? And

6:54:23then output, which is giving us the

6:54:24answer back. So right here in the schema

6:54:26version, which is the normal person

6:54:29version,

6:54:30uh we can see that the text here is, "My

6:54:32business is JM Solutions, XYZ." So now

6:54:34that we have this part,

6:54:36we send it two different ways. So the

6:54:37first way will be to extract the memory

6:54:40from here

6:54:41because you're always extracting it over

6:54:42and over again, right? So we have all

6:54:44these pieces of information that we give

6:54:46as context.

6:54:47This is the first step that we do. So we

6:54:49just connect it to the get rows in

6:54:50sheet, which means that it gets all the

6:54:51rows from the memory AI agent to Google

6:54:53Sheet right here.

6:54:55By the way, to connect your Google

6:54:56Sheet, you have to go here,

6:54:58sign in with Google.

6:55:00That's it. And then we have to do sheet

6:55:01one and leave all the filters alone

6:55:03because in this case, we're just getting

6:55:04all the rows,

6:55:05and then we're giving it to the AI

6:55:06agent.

6:55:08Now, the only thing about this is, let

6:55:10me just pin this. So if I pin this, I

6:55:12don't have to rerun the whole thing

6:55:13again.

6:55:14The only thing about this is that it

6:55:15gives it to us in nine items, okay? So

6:55:18for those of you who are not familiar

6:55:19with how arrays, iterating, aggregating

6:55:22works, it's actually quite easy. So

6:55:25as you can see here,

6:55:27what this looks like is that this has

6:55:28nine rows. So 1 2 3 4 5 6 7 8 9. Right?

6:55:33These nine rows are the ones that we

6:55:35get, right? So in logic, if we tell to

6:55:38Google Sheet, "Hey, can you get all the

6:55:39rows?" it gets nine. The only problem

6:55:41with that is that it then processes each

6:55:44row individually, and that's not

6:55:45something that we want. We want it all

6:55:47to be in one place. As in, we get all

6:55:49these pieces of information, all the

6:55:50rows, and it makes it into sort of like

6:55:52a paragraph that it then gives the AI

6:55:54agent as context. And so to do that, to

6:55:57make it into a paragraph, or to make it

6:55:58into

6:56:00we call it we to aggregate it, right? We

6:56:02use the aggregate node. So as you can

6:56:03see here by the diagram, we're basically

6:56:05getting all these nine rows, and we're

6:56:07merging them, so we're putting all in

6:56:09one place

6:56:10to then give uh to ChatGPT as or to the

6:56:13AI agent in this case as context. So we

6:56:16use the aggregate node,

6:56:18individual fields because we're doing

6:56:19individual fields, and then the input

6:56:21field name will be the memory.

6:56:24Because this is the memory.

6:56:25All I did here is I just drag this

6:56:27across.

6:56:28Right? And so if I execute the step,

6:56:30what it will now do is that it will take

6:56:31the nine items because before as you can

6:56:33see here it's nine items. I can't see

6:56:35all of them in the same place.

6:56:37Also here we put them all together and

6:56:39now this will be the thing that we give

6:56:41to ChatGPT or to the AI agent in order

6:56:44for it to get context before giving us

6:56:46the answer, right? And that's all we do.

6:56:48That's the first part. And that's what

6:56:51we give as a first input to the AI

6:56:54agent.

6:56:55The second input here is the Telegram.

6:56:58So all this is is saying hey, we can

6:57:00either give you text or we can give you

6:57:02audio messages, right? So if it's a text

6:57:04we send it here, if it's an audio

6:57:06message we send it here. So the switch

6:57:08node, this is basically it's a node so

6:57:10like a square that allows us to send the

6:57:12automation two different ways based on

6:57:14something. In this case the filter or

6:57:16the condition is if this variable exists

6:57:19which is audio then we send it one way

6:57:21to extract the audio to make the audio

6:57:23into text and then send it to the AI

6:57:24agent. But if this variable exist then

6:57:26what we do is we send it to the text way

6:57:28and it just simply goes straight to the

6:57:30AI agent. Now how do we know what

6:57:32variables to use? Well in this case we

6:57:34know that whenever we do an audio

6:57:36we get this variable. So let me just

6:57:39actually test this and show you exactly

6:57:40what I mean just so I'm not waffling.

6:57:42Uh let me

6:57:43do this. There you go. I can execute the

6:57:46step.

6:57:48Why did not work?

6:57:50Oh right cuz it's pinned. Let me unpin

6:57:51this.

6:57:53Then you go here. Execute step.

6:57:56Okay, again execute step.

6:57:59Never mind. Again execute step.

6:58:02Let me go here. Execute workflow. So

6:58:04we'll now put a new message and let me

6:58:06go to Telegram. Let me say let me put it

6:58:08here.

6:58:09Let me say

6:58:10um hello hello hello hello hello.

6:58:13What this will now do is it will send

6:58:15the information in Telegram to the

6:58:17switch node.

6:58:18And now you can see that this is green

6:58:20because that was a voice message. So we

6:58:22know it's a voice message because this

6:58:24variable right here or here or here or

6:58:26here or here, right? These are only

6:58:29present if it's a voice message.

6:58:31And the same thing with text. This

6:58:33variable is only present when it's a

6:58:35text message. And so what we do here is

6:58:37we split it out. So we're saying hey, if

6:58:38it's a text send it here, if it's an

6:58:39audio send it here. Now if it's an audio

6:58:41we have to get a file because it is file

6:58:43and the file has a file ID. So file get

6:58:47and then the file ID you can find

6:58:50right here.

6:58:51File ID.

6:58:53To then download it to then give it to

6:58:55AI

6:58:57to transcribe the recording. So to

6:58:58connect your OpenAI you have to go here.

6:59:00You need an API key. You can simply go

6:59:02to platform.openai.com.

6:59:04Go to

6:59:06Is it dashboard? Yeah. Go to API keys.

6:59:10Press this button right here. Name it.

6:59:12So N 8 10

6:59:13test. I think I've made like 30,000 of

6:59:16these.

6:59:17And then you can copy the key and that's

6:59:19what you bring back to the N 8 10.

6:59:21Important thing here is that this is not

6:59:22free as in you do have to pay.

6:59:24But luckily for you this is not

6:59:26expensive at all. Um you can add $5 of

6:59:29credits for your credit card here and

6:59:30just leave it as is. $5 can last you

6:59:33a long while. Obviously it depends on

6:59:35how much you use it but this is like a

6:59:36fraction of cents when you run it. So

6:59:38it's not noticeable.

6:59:39Um okay. Once you connected your OpenAI

6:59:41now you can transcribe the recording

6:59:44audio and the input data field name

6:59:46which is what is the thing that we're

6:59:47giving OpenAI to take as audio and turn

6:59:50it into text? Well that's data.

6:59:52Because if I test this if I go here

6:59:56So I put this. We can see that the

6:59:58output is data and that is the input on

7:00:00the next node data. We just drag this

7:00:03across and we get this. So now if I

7:00:05execute the step I should be able to see

7:00:07hello hello hello hello. There you go.

7:00:09Which is the audio that we gave

7:00:11Telegram. And that's the first input.

7:00:13The second input is simply text and we

7:00:14turn this to text JSON message of text

7:00:18because because this is very important

7:00:20because when we send the input here and

7:00:23the input here we want the output of

7:00:26both of these to be similar or to be the

7:00:28exact same named variable, right? What

7:00:30that means is that

7:00:32the output here is text so [music] we

7:00:35also want the output here to be text. So

7:00:38instead of message of text because this

7:00:39wouldn't be present here in the audio it

7:00:41would have to be something that we can

7:00:42manipulate here.

7:00:44Text, right? So now we have both the

7:00:47inputs are basically the same variable

7:00:49but it sends it different ways based on

7:00:51the input that we give it whether it's a

7:00:53voice message whether it's a text. Now

7:00:54we have the merge node which merges so

7:00:57all possible combinations. What this

7:00:58does is that it takes this it takes the

7:01:00uh Telegram

7:01:02input and now if I execute the step

7:01:05so let me actually

7:01:07Does it work? No it didn't work. Uh so

7:01:08let me actually start from from scratch

7:01:10here so I can show you exactly what that

7:01:11looks like.

7:01:13Execute workflow.

7:01:15Let me unpin this.

7:01:17Go to Telegram.

7:01:20And I can say

7:01:23What is my brother's

7:01:26name?

7:01:28Right now this goes here. It extracts

7:01:30all the memory. So you see how all nine

7:01:31items went through here and only one

7:01:33came out

7:01:34because it I put them all together. And

7:01:36now this went this way because it was

7:01:38text and in the merge node what this did

7:01:40is that it merged the chief on the name

7:01:43it merged

7:01:44the text from Telegram and also the

7:01:45memory. So these two pieces of

7:01:47information are the ones that are going

7:01:48to be directly given to the AI agent to

7:01:51do its own thing.

7:01:53All right, enough of that. That was the

7:01:54boring part. Now we get to the fun part

7:01:56which is the actual AI agent. So this is

7:01:57the thing that will think through its

7:01:59answers. It will then call the

7:02:01the Google Sheet tool to add memory and

7:02:04yeah. So the first step we have to do is

7:02:06actually define the input. So the input

7:02:09in this case will be JSON.text.

7:02:11And this is the one right here because

7:02:13this is the one from Telegram. The one

7:02:14from Telegram is the actual thing the

7:02:15user message because the user sent us a

7:02:17message and that's the thing that we

7:02:18send to this here. Now we have the

7:02:21system message and the system prompt.

7:02:23Now I'm going to show you at the end of

7:02:24the video how to get the whole system

7:02:25for free so don't worry. You'll have

7:02:27this whole prompt. But what it actually

7:02:28tells it is an overview. So memory

7:02:31handling so some rules and stuff,

7:02:33response styles, the context awareness

7:02:35and basically telling it hey

7:02:37you're getting this memory. Basically

7:02:39use the memory tool when you have to add

7:02:41a new memory.

7:02:42Don't feel forced to use memories only

7:02:44when they add value and that's why we're

7:02:46giving AI sort of that task to to think

7:02:48through. Is this worth putting in the

7:02:50memory database? If yes put it if not

7:02:52then just answer the question and so on.

7:02:54Um

7:02:55and let me give it a few rules, right?

7:02:57The example format and even the current

7:02:58date and time because AI is not good at

7:03:00determining date and times. So we give

7:03:02that as well. So again you get the whole

7:03:04prompt for free at the end of the video

7:03:06so don't worry. But this right here is

7:03:07really the sauce of the whole system

7:03:08because the prompt is the thing that

7:03:11really gives the instructions to the AI

7:03:12agent. So if you don't instruct it well

7:03:14then you won't get the output that you

7:03:15want. All right, so once this is done we

7:03:17added the system message and the user

7:03:19message.

7:03:20Now we have to connect the chat model.

7:03:21So the chat model is basically the

7:03:23brain. In this case we have to use

7:03:24OpenAI. Again follow the same process

7:03:26before to connect your OpenAI. I mean if

7:03:28you connected it before you'll have the

7:03:29same connection here. Uh the model you

7:03:31can use 4.1 mini that's good enough.

7:03:33Then we have the memory which is able to

7:03:35remember the actual conversation on

7:03:36chat. This isn't this kind of memory. Uh

7:03:38this memory is just for conversations on

7:03:40Telegram.

7:03:42And then we have our nice tool right

7:03:44here

7:03:45which is connected to again the same

7:03:47exact database memory AI agent. And the

7:03:50only action it takes is just adding more

7:03:52and more and more and more and more. So

7:03:55you basically just feed it more and more

7:03:56memories uh more and more sort of

7:03:58details about yourself as context. And

7:04:01the memory itself so the values to send

7:04:04is just a memory. And all we do here is

7:04:05just press this button cuz we're letting

7:04:07N 8 10 define what is the thing or how

7:04:09do we want to structure the input. For

7:04:12example here I didn't tell Telegram user

7:04:15also likes dogs. I told it hey, can you

7:04:17also add that I like dogs, right? And so

7:04:19what it did is that we let AI define

7:04:21what goes in here

7:04:22and AI defined that it should put it in

7:04:24this way. User also likes dogs. So that

7:04:26it's easier for for the actual system to

7:04:28know exactly what I'm talking about,

7:04:29right? And once this is done we have the

7:04:31tool connected.

7:04:33And this is where we actually add the

7:04:35the piece of information. So let me run

7:04:37this and I can show you exactly how this

7:04:39looks.

7:04:40Let me go here.

7:04:42In this case what we can do is we can

7:04:44say I also own a NBA team

7:04:49called

7:04:51Dallas Tories.

7:04:55Wish that existed. Uh what this did is

7:04:57that now I called the tool. So now I

7:04:59should see here

7:05:01that it says user owned an NBA team

7:05:03called Dallas Tories, right? And that is

7:05:05giving us context for the future things.

7:05:07And that's why we call it self-learning,

7:05:08right? That's all it is. Self-learning

7:05:10just means that it learns over time. And

7:05:11so that's the reason why we connect this

7:05:12tool right here to the AI agent giving

7:05:15the context as well. And then finally we

7:05:17connect this to the response of

7:05:19Telegram. So to connect your Telegram

7:05:20account I did mention this before but

7:05:22all you have to do is you have to ask

7:05:25the assistant AI

7:05:26cuz it has a whole process. So these

7:05:28right here are the steps you have to

7:05:29follow. For the sake of time I'm not

7:05:31going to connect it now

7:05:33um but if you follow these you'll be

7:05:34fine. And you just have to press this

7:05:36button right here. And now we can put

7:05:37message which is what is the thing that

7:05:39we're manipulating or changing and the

7:05:42operation which is what is the action

7:05:44that we're taking. In this case it's

7:05:45sending a message but you can do a bunch

7:05:47of stuff.

7:05:49And then the chat ID is the ID of the

7:05:51chat, right? Logically that's what it

7:05:53is. But the way that Telegram works is

7:05:55that every conversation that you have

7:05:57has an ID attached to it, right? And so

7:05:59if we get an input from this ID then we

7:06:01have to give the output to that ID. So

7:06:03logically if we get an input from this

7:06:04ID

7:06:06then we have to give back the output to

7:06:07that ID because then it's in the same

7:06:09conversation. And then the text will be

7:06:11the JSON.output which is the one here.

7:06:14So I just drag this across.

7:06:17So you can see here it says got it bro.

7:06:18I just added you

7:06:20that you own an NBA team called Dallas

7:06:21Tories. Anything else you want to add or

7:06:24chat about? What the hell man? There you

7:06:26go.

7:06:27And everything else keep the same. So,

7:06:29now when we get the output, this is the

7:06:31message that we come back to Telegram uh

7:06:33to do its own thing. And now you get to

7:06:34see exactly how it works, but this is a

7:06:36very simplistic version of a

7:06:38self-learning agent. I mean, we're using

7:06:39Google Sheets. Typically, you wouldn't

7:06:40use Google Sheets. You maybe have an

7:06:42airtable or even a rag database, right?

7:06:44To store these different pieces of

7:06:46information. Uh but, you get to see the

7:06:48the theory, right? The theory behind it.

7:06:50How it actually works. How it functions.

7:06:52So, now you can apply this to any kind

7:06:53of other database tool to store

7:06:55information and have that retrieve it

7:06:57every single time that it gives you

7:06:58answers.

7:07:02Hey, I'm about to show you how I built

7:07:04an AI resume screening agent in N8N that

7:07:07allows applicants to put their CVs and

7:07:10apply for a job. What it does is that it

7:07:12then extracts the text from that CV.

7:07:14It then matches the text of that CV to

7:07:16another PDF which contains the

7:07:18requirements of what a good applicant

7:07:20looks like for that specific job. Then

7:07:21it uses an AI agent in order to score

7:07:23the applicant based on different

7:07:25criteria. Then it sends a confirmation

7:07:27email to the applicant itself before

7:07:28adding it to our Notion database. All

7:07:30right, I'm going to show you the full

7:07:31system first before we go step-by-step

7:07:33into how it works. Uh just so you can

7:07:34see the output. I'm going to press

7:07:36execute workflow.

7:07:37And this would be the form that the

7:07:38applicant would fill out. All right, so

7:07:40I just finished the application. And

7:07:41also important to know that the job that

7:07:43we're applying for is an investment

7:07:46banking form or job, right? Um so, bear

7:07:49in mind because the CV is tailored

7:07:51towards that job. I'm going to press

7:07:53submit. What this will now do is it will

7:07:55go to Google Drive. It will upload the

7:07:57resume. It will download the resume to

7:07:58then extract the text. It will then go

7:08:00to this folder right here which contains

7:08:02a document which basically outlines the

7:08:04qualification uh for that specific job

7:08:07before giving it to the AI agent, the

7:08:08text or the qualification plus the text

7:08:10of a CV

7:08:12before scoring it and sending the

7:08:14applicant confirmation email and then

7:08:16adding it to our Notion database. So, if

7:08:17I go to my email here, I can see that I

7:08:19have thank you for your application. Hi,

7:08:20Mickey Kelly. Thanks for applying. We

7:08:22received your application and our team

7:08:23will review it shortly. We'll get back

7:08:25to you soon with the next steps. Best

7:08:27James Solutions. Obviously, we can

7:08:29remove this, which is the N8N

7:08:31attribution, and I'll show you exactly

7:08:32how to do that. But just so you know, we

7:08:33got it here. And if I go to my tracker,

7:08:36I should be able to see myself in the

7:08:37high ranking where we have Mickey Torti,

7:08:40Kelly Torti, email, phone number. Not

7:08:42only that, but we get to see the resume

7:08:43link. We get to see the strength, the

7:08:45weaknesses, the risk factor, the reward

7:08:47factor, which are all different pieces

7:08:49of information that's really really

7:08:50really important for someone to then go

7:08:52in and see exactly

7:08:54why the person scored eight out of 10.

7:08:56Why are they a high-ranking applicant

7:08:57versus a medium or low-ranking

7:08:59applicant? Like, what is that thing that

7:09:00differentiates them and gives us data

7:09:02based on that? Okay? So, with that said,

7:09:05let's go step-by-step into the system

7:09:06and how it works. And if you want a full

7:09:08system for free, make sure to check out

7:09:10the first link down below, which takes

7:09:11you to my free school community right

7:09:12here.

7:09:13Then you go to classroom, go to the

7:09:15templates vault, and then you'll be able

7:09:17to see the AI resume screening agent.

7:09:19Press this button to download it and

7:09:21then import it into your own N8N

7:09:22account. And if you have no clue how to

7:09:24do that, no worries at all. You can also

7:09:25go here, zoom in, and you will have a

7:09:28tutorial right here. And by the way, if

7:09:30you apply and you get in, you also get

7:09:31access to the AI automations 101 course,

7:09:34which is a comprehensive guide that

7:09:35takes you from a real beginner in AI

7:09:36automation to someone who's able to

7:09:38build automations for themselves or for

7:09:40their businesses. All right, so let's go

7:09:42through this step-by-step and I'll walk

7:09:44you through my thought process as I

7:09:45would wanted to build this. Um I

7:09:47basically wanted a system that could

7:09:48process resumes, right?

7:09:51And so, when we think of structuring a

7:09:53system, we always think in inputs and

7:09:55outputs, right? If I go here to my Miro,

7:09:58which is where I basically map

7:10:00everything out. Um the input in this

7:10:02case would be the application, but

7:10:04realistically it would just be the CV,

7:10:05right? Cuz that's the thing that we're

7:10:06that we're going towards. And the output

7:10:08would be

7:10:09read data, like results,

7:10:11and data

7:10:13on the CV

7:10:14based on job,

7:10:16right? qualification.

7:10:19So, it's basically saying, "Hey, we have

7:10:20a CV. How well did they compare to that

7:10:22job uh from the CV that we have?"

7:10:25So, the input CV and the last thing is

7:10:27this, which is typically what a HR role

7:10:29is. It's just simply to look at the

7:10:31applicant. Are they good enough or are

7:10:33they not good enough? Uh now, the next

7:10:34step here

7:10:36is to obviously extract the text.

7:10:38There's a few steps before, but extract

7:10:40text from CV.

7:10:44Then match

7:10:46against

7:10:48qualification.

7:10:50And then we want to use

7:10:53AI agent to score.

7:10:56All right, this is why I do this. Then

7:10:57we want to send applicant email.

7:11:01Be connected. This will be connected

7:11:03right here, right here.

7:11:05And then we get the results and data on

7:11:08the CV based on job qualification, which

7:11:09will then be added to our Notion

7:11:11database. Cool. This is important

7:11:13because this is how you structure

7:11:14systems. Like, how do we think about

7:11:15doing things? Like, what is that

7:11:16sequential order that we go through when

7:11:18building these automations? Now, the CV

7:11:20itself has to be an input coming from

7:11:23somewhere. It can be a Google Drive. It

7:11:24can be a Google Form. It can be in this

7:11:26case an N8N [music] form, a native form,

7:11:29uh where someone can just submit it and

7:11:30just give us the CV, which then kicks

7:11:32off the um well, you could say the

7:11:34automation, right? And so, the first

7:11:36step to this automation is the job

7:11:38application. It's us actually getting

7:11:40the details. So, if I go in here, I can

7:11:43see that we have job application. Please

7:11:45fill out this form right here. Uh we

7:11:46have the full name,

7:11:48the email,

7:11:50the phone number,

7:11:51and then the resume. So, the resume is

7:11:53really the thing that we I mean, we care

7:11:54about the others as well, right? Cuz we

7:11:55have to know their name. But, the resume

7:11:57is the thing that we actually use to be

7:11:59able to then score the applicant based

7:12:01on the qualifications for that job. And

7:12:03so, [music]

7:12:04the way that we do this is make sure

7:12:06that the element type So, this is

7:12:07saying, "Hey, what is the kind of

7:12:08response format that we want from this

7:12:10field?" In this case, it's a file. It's

7:12:12a bunch of fields that you can use, but

7:12:14in this case it's a file because we want

7:12:16a file from the applicant. Multiple

7:12:18files is the same thing. Hey, do we

7:12:19accept multiple files? Honestly, I don't

7:12:21know why I have this on. I would

7:12:22typically have this off because a CV is

7:12:24one. Uh and we don't want multiple CVs

7:12:26to then cuz there's one applicant. Um

7:12:28and then the accepted file types, you

7:12:30can leave empty to allow all the types

7:12:32of files. So, it can be a PNG image,

7:12:34JPG, can be a HEIC.

7:12:37It can also be a PDF. In this case, uh I

7:12:39would just like a PDF version. That's

7:12:41the best way that we can use to then be

7:12:43able to extract the text and I guess

7:12:45compare it to the other one. Um and

7:12:47that's it. So, we have a form which

7:12:48looks like this. Full name, email, phone

7:12:50number, and resume. And resume, as you

7:12:52can see,

7:12:53makes you choose a file.

7:12:55And it doesn't let you choose

7:12:56everything. It only lets you choose the

7:12:58things that are PDFs, which is great.

7:13:00All right, cool. Um so, once this is

7:13:02done, the first part is obviously

7:13:04connecting our Google Drive to N8N.

7:13:06>> [music]

7:13:06>> You have to go right here, create a new

7:13:07credential, and you need a client ID and

7:13:09client secret. For the sake of time, I'm

7:13:11not going to go into this, but you can

7:13:12check out this video up here if you want

7:13:14to um see how you can do that, which

7:13:16will take like 5 minutes. Uh and [music]

7:13:18then we want to do file upload resume

7:13:20because that is the name of the file

7:13:22that we get.

7:13:24The file name will be the person's name

7:13:26/CV. And then you could add it to a a

7:13:29folder called resumes or uh new

7:13:31applicant resumes, right? For in this

7:13:33case,

7:13:34the root folder will be no folder. It

7:13:35will be anywhere in the Google Drive.

7:13:37But you could obviously put it in a

7:13:38folder if you want everything organized

7:13:40in one place.

7:13:41After this, uh in order for us to be

7:13:43able to extract the text from the CV,

7:13:48first have to upload it. Then we have to

7:13:50download it. So, we're downloading the

7:13:51file, which you can find right here, ID.

7:13:54And that's the thing that we use to then

7:13:55download the file using the same

7:13:57connection, right? And we get the data.

7:14:00And this is where we're able to then

7:14:01pull through to the next node, which is

7:14:03extract from file. So, we're extracting

7:14:06text from a PDF. And fundamentally, the

7:14:08reason why we're doing these steps

7:14:10before adding it to the AI agent is

7:14:13because we can't give the AI agent two

7:14:14files, right? Which is why we have to

7:14:16download well, upload them in this case,

7:14:18download them, and extract the text

7:14:21right from the PDF.

7:14:23And in this case, the uh operation,

7:14:26which is what is the action that we're

7:14:27taking, is extract from PDF. The input

7:14:30binary field because this is binary.

7:14:32When a file is uploaded and is

7:14:34downloaded, it's binary. Uh that's just

7:14:36a format. And then the data itself is

7:14:38the data, right? Which is this one right

7:14:40here. Always match this with this. As

7:14:42you can see here, the output will be

7:14:44text that would then be used, right?

7:14:47The one I have here.

7:14:49Now, once this is done, this is the

7:14:50first step where we actually have to

7:14:52extract the text from the CV that we're

7:14:54getting from the applicant because

7:14:55that's the first step. The second step

7:14:57is this. So, we have this Google uh

7:14:59Drive folder. And this is where this

7:15:01part comes in, right? Matching against

7:15:03qualifications. So, when we have to

7:15:05match a CV against qualifications, you

7:15:08can either add the qualifications or

7:15:09rules in the AI agent or you can simply

7:15:13just have another document, which can be

7:15:15as long as you want, that will then be

7:15:17used extract the text from here, of

7:15:18course, and then be used to match the

7:15:21text of the CV that we then give to the

7:15:23AI agent to then qualify the applicant

7:15:26and give us the results, right? And so,

7:15:28what we do in this step is we have the

7:15:29CV from the applicant. We basically turn

7:15:31that into text. Then we have the initial

7:15:33job, which is this one right here from

7:15:35this folder. And the reason why we're

7:15:36doing it in a Google Drive folder is

7:15:38because we can then add more files and

7:15:40we don't have to change this one right

7:15:42here, the prompt here, because the

7:15:44prompt will be dynamic based on the um

7:15:46the thing here. And we're downloading

7:15:48it,

7:15:49right? Which is the investment banking

7:15:50intern PDF, which again is the

7:15:52qualifications. Like, what does good

7:15:54look like for this job? We extract the

7:15:56text from here because we're extracting

7:15:59the text to then have the second pillar

7:16:01because you have the CV and then we have

7:16:02what does good look like for that

7:16:04specific job.

7:16:05And then these two pieces of data cuz

7:16:07again, here will be job description

7:16:10will then be used to send

7:16:12to the AI agent, okay? And this is where

7:16:15we start to analyze the CV.

7:16:17So again, we get the CV

7:16:19text and then get the job application,

7:16:21which is what does good look like for

7:16:22that specific job. He then turns that

7:16:24into text. So, we have two pieces of

7:16:26text and then add all of that into the

7:16:28AI agent. If I go in here,

7:16:30I can see that the prompt that I have is

7:16:33a user prompt and a system prompt. The

7:16:35first step here is making sure that we

7:16:37have defined below because we want to

7:16:39define exactly what the input is. This

7:16:41is not a chat to the AI agent type

7:16:43agent. And so, the user prompt in this

7:16:45case is like what is the information

7:16:46that we give the AI agent for it to

7:16:48actually think through through its

7:16:50system message what it needs to do,

7:16:52right? And so, the prompt that we give

7:16:54it is a candidate's resume, which we

7:16:56pull in from the first extract from

7:16:59file, which is the text right here.

7:17:01Put it through.

7:17:02And the [snorts] job description

7:17:04requirements, which you get, which is

7:17:05the one here.

7:17:06You put it here.

7:17:07Right. So, we have the candidate resume

7:17:09and the job description resumes. And we

7:17:11turn this on. So, require specific

7:17:13output format and I'll show you exactly

7:17:14why we do that. But, the system message

7:17:17is really the thing that matters the

7:17:18most. And this is quite extensive. We

7:17:21have the overview. So, you're an expert

7:17:22technical recruiter specializing in XYZ.

7:17:25The output should be in the following

7:17:27exact formats. So, we have candidate

7:17:28strength, weaknesses, risk factor,

7:17:30reward factor, overall fit, and

7:17:32justification for rating. So, these are

7:17:34the different pieces of information that

7:17:36we want from the AI to do. So, it's an

7:17:39extensive analysis of both the CV and

7:17:42the qualification of what it looks to be

7:17:44good for that specific job. And then we

7:17:45give the job description here, which

7:17:47again is basically like a double input

7:17:49because we give it also here. Um I don't

7:17:51think you have to give it in both ways,

7:17:53but you can.

7:17:54Now, one important thing is that I did

7:17:56tell it to give me the output as

7:17:57candidate strength, which is one

7:17:59variable, weakness, another one, risk

7:18:00factor, reward factor, and overall fit

7:18:03and justification. So, six variables.

7:18:05When we give AI the ability to give us

7:18:07six variables,

7:18:08we want the output to look like this.

7:18:11Right? And for the output to look like

7:18:12this, we have to get it in a very very

7:18:14specific format. And in order for us to

7:18:16get something in a very specific format,

7:18:18we have to make sure that we have a

7:18:20structured output parser. So, this is

7:18:22saying, "Hey, this is the data that's

7:18:23unstructured. That's a block of text,

7:18:25right? Which contains weaknesses,

7:18:26strength, XYZ." And then we run it

7:18:29through this right here.

7:18:31This code, which is defined using JSON.

7:18:33And if you're looking at this and

7:18:34thinking, "What even is this?" It's

7:18:36actually quite easy. Ah, so don't worry.

7:18:38But, what it is, it's JSON that tells

7:18:40us, "Hey, we want the output in

7:18:42description. We want the candidate

7:18:44strength. We want the weaknesses. We

7:18:45want the um the risk factor, which is an

7:18:48object, explanation, which is a string."

7:18:50So, these are all different types of

7:18:51variables and we give the explanation of

7:18:53what each one does, right? We'll do

7:18:55description, description, and so on. And

7:18:57so, [music] what happens here is that it

7:18:59first talks to this chatbot, which you

7:19:00connect here.

7:19:01Go to OpenAI.

7:19:04And then connect your OpenAI by going to

7:19:05platform.openai.com.

7:19:07You can go to dashboard

7:19:09right here. You can go to API keys.

7:19:12Create a new secret key. Make a key

7:19:13right here. And then paste that key back

7:19:15into N 8 N, right? And then you press

7:19:17save and you connect it. GPT-4.1 mini is

7:19:20great.

7:19:21Once you have this connected, right?

7:19:22This is the thing that it will use to

7:19:24then think through exactly what the

7:19:26rating could be. Yeah, how it would rate

7:19:28the applicant based on the requirements

7:19:29for that job. And so, again, we get two

7:19:31different pieces of information here. It

7:19:33then ranks or it then rates this. Let me

7:19:35show you exactly what if we don't have

7:19:36this.

7:19:37Pin this.

7:19:38Pin. I believe you can pin this.

7:19:41Okay, cool.

7:19:42Here I can execute step. Please unpin

7:19:44extract text and try again. Okay, I

7:19:46think I have to start from zero. That's

7:19:48okay. That is okay. That is okay. I'll

7:19:50start from zero. Let's do it. Let me

7:19:52unpin this. Let me extract that. [music]

7:19:54Let me go here.

7:19:55Let me put a CV. Just submit this. Put

7:19:58some random email. I just want you to

7:19:59see exactly like what it would look like

7:20:01if we didn't have this plus when we do

7:20:02have this.

7:20:03So, it's doing everything that we want.

7:20:05And now the AI agent, well, as you can

7:20:07see, we got the output. And the output

7:20:09in this case, as you can see, is just a

7:20:11block of text.

7:20:13It's a block of text that looks like

7:20:15this,

7:20:16which has all the weaknesses, all the

7:20:18strength, and so on. So, something like

7:20:20this we can't add into a database in

7:20:22Notion,

7:20:23right? Or anywhere in Google Sheets,

7:20:24whatever it is they use,

7:20:26in a very structured format with each

7:20:27column. And so, what we do is then we

7:20:30add this here, right? We are able to

7:20:32then um

7:20:33make sure the information is in

7:20:34different variables.

7:20:36The next step, once we have this, once

7:20:38you have the whole rating, weaknesses,

7:20:39strength, XYZ, or we go to the next

7:20:41step, which is sending an email. So, we

7:20:43send a confirmation email.

7:20:45Uh this is a Gmail node. All you have to

7:20:47do is first connect your account. Sign

7:20:49in with Google,

7:20:50which will take you to this page. Make

7:20:52sure you have the right account.

7:20:53Then bring it back. Very very easy.

7:20:56And then we want to do message because

7:20:57that is the thing we're manipulating.

7:20:58Send because that is the action we're

7:21:00taking.

7:21:01To, so who are we sending the email to?

7:21:03Well, this is something that we get from

7:21:04here, the email.

7:21:06Subject line, thank you for application.

7:21:08And then we want to put the body um

7:21:11the text, right? And the way that we do

7:21:13that is through HTML. HTML is just the

7:21:15way that you make your emails look

7:21:16pretty. You could also not use HTML and

7:21:19it doesn't really matter.

7:21:21You were not adding any links or

7:21:21anything. Um

7:21:23and the email is hey.

7:21:26So, hey us in this case because S is a

7:21:28the full name. Let me go here for a

7:21:29second.

7:21:31Let me manipulate the the full name so

7:21:33you get to see what an actual full name

7:21:35looks like.

7:21:36Mikaela Torti.

7:21:37There we go. Save.

7:21:39And here

7:21:40you get to see

7:21:42that the full name turns into a first

7:21:44name. And the way that we do that is

7:21:45using formulas. So, the formula here,

7:21:47the way that it works, and this might

7:21:48look complex to someone who has never

7:21:50seen uh this type of formulas, but it

7:21:52looks like this, right? And the logic

7:21:54that I go through when I make formulas

7:21:55is the following. So, we have the full

7:21:57name,

7:21:58which is Mikaela Torti.

7:21:59And the full name, ideally, is Mikaela

7:22:02Torti. is separated into the first name

7:22:05and the last name. And between the first

7:22:07name and the last name, there is a a

7:22:09space.

7:22:10So, if we split this and this by the

7:22:13presence of a space, then we get

7:22:15this. We get one

7:22:17and we get two.

7:22:18And now, if you want to get the first

7:22:20one,

7:22:21then we just have to use

7:22:23first

7:22:24to then get

7:22:25the uh the first name. So, the way that

7:22:27this works is that we're saying, "Okay,

7:22:28this is the full name cuz this is the

7:22:30variable.

7:22:32Let's split this by the presence of a

7:22:34space because this is the space.

7:22:36And then let's get the first one.

7:22:39Mikaela.

7:22:40Right? And it's actually quite easy once

7:22:41you actually break it down that way.

7:22:42But, if you look at this

7:22:43at hand side, you think, "What what the

7:22:45is this?" Um but, that's what it

7:22:47means. So, "Hey Mikaela, thanks for

7:22:48applying. We received your application

7:22:50and our team will review it shortly.

7:22:51We'll get back to you with the next

7:22:52steps um as well. We should probably be

7:22:55able to put this right here,

7:22:58which by the way, this stands for

7:23:00>> [music]

7:23:00>> break.

7:23:01This is a new line, right? So, we have

7:23:03new lines here.

7:23:04That's it.

7:23:05And then we have Notion. So, the way

7:23:08that Notion works is that we set up a

7:23:09workspace so that we have one database.

7:23:12So, this is the same exact database,

7:23:13right? This, this, this, and this. It's

7:23:16just the way that we look at the

7:23:17database just different. So, in here, we

7:23:20have a filter,

7:23:21which is like, "Hey, the low applicants

7:23:23are everybody that has a score less than

7:23:26five.

7:23:27Medium applicants are the ones that have

7:23:28a score more than four and less than

7:23:30seven. And then high-ranking applicants

7:23:32have a score

7:23:34um more than six, right? And that's it."

7:23:37But, if I just took the filter out

7:23:39right here, you could see that I have

7:23:41the applicant right here. It's just

7:23:42because we have a filter that we don't

7:23:43see the applicants. So, we're able to

7:23:45just basically sort or filter by all the

7:23:47low applicants, medium, and high-ranking

7:23:49as well. And then we have applications,

7:23:51which shows us the amount of

7:23:51applications that we get over time,

7:23:53right? Now, you could use a Google

7:23:55Sheets for this. It's not really crazy

7:23:56one of a difference. It's just the fact

7:23:57that we can filter and we can do so much

7:23:59more in Notion than we can on Google

7:24:00Sheets. So, when we set this up, the

7:24:02first thing you have to do is go in

7:24:03here.

7:24:04You have to make sure that you can

7:24:06create a new credential. I recommend

7:24:08that you ask the AI assistant for what

7:24:09to do here

7:24:11cuz it is a bit of a longer process, but

7:24:12actually takes 2 minutes.

7:24:14Um and get the internal um integration

7:24:16secret. By the way, the alternative of

7:24:18this is Google Sheets, so you can use

7:24:19either.

7:24:20And it walks you through everything. Um

7:24:22yeah.

7:24:23And then, once you have that, make a

7:24:25database that has these columns right

7:24:27here. Applicant name, first name, last

7:24:28name, email, phone number, application

7:24:30date, resume, strength, weakness, risk

7:24:31factor, reward factor, overall fit, and

7:24:33justification. And these are the fields.

7:24:35So, in this case, we have a title, which

7:24:37is

7:24:37the name,

7:24:39first name, which is the name first

7:24:40name, last name, last name, email,

7:24:41email, phone, and so on. And now, we

7:24:44actually forgot to put the date.

7:24:46So, you can put a date as now. And the

7:24:47way that that works is it's asking me

7:24:49for a date.

7:24:50And I know that the

7:24:53the date in N 8 N is curly brackets

7:24:55because it's inside a variable, right?

7:24:57So, we have a variable here,

7:25:00which is like this. Inside, what you do

7:25:02a dollar sign.

7:25:03Now.

7:25:05And this is the output that we get. Now,

7:25:06ideally, we don't want it in this output

7:25:07because we still have words.

7:25:09So, we put a format

7:25:12like this.

7:25:13So, we format it in this way, which will

7:25:15then be good to then send it to Notion.

7:25:17And then we have the resume,

7:25:18uh strength, and weaknesses, and risk

7:25:20factor, reward factor, overall fit, and

7:25:22justification. So, these are all the

7:25:23fields that we're going to Notion to

7:25:25then uh rate the applicant. And that's

7:25:26how we get everything

7:25:28to here.

7:25:29Right? Applications, uh high-ranking,

7:25:31and low-ranking, and so on.

7:25:33All right. Let's start from zero and

7:25:34I'll take you through exactly like the

7:25:36the data and so on, which I did before,

7:25:37but now we go into detail. Want to

7:25:39execute a workflow.

7:25:40I'm going to call this

7:25:42let's say James Low.

7:25:45My email still. Phone number.

7:25:48Then my CV, which is not really my CV.

7:25:50It's one of my friends. So, if you're

7:25:51looking at this, man, we'll we'll break

7:25:52it out to everyone. Uh press submit.

7:25:55And then this now goes to the to the

7:25:57Google Drive folder. It downloads the

7:25:58file. It extracts the text.

7:26:00Right? So, we have the text.

7:26:02It extracts this uh PDF's text,

7:26:05right? Right here. It then uses AI

7:26:07to think through its output right here.

7:26:10And now I get me an error. So, what was

7:26:11the error?

7:26:12Send email confirmation. Unable to sign

7:26:14in. Oh, okay, cuz I put the wrong

7:26:16account. There we go.

7:26:17Yeah, I think this works. Execute step.

7:26:20Yeah, send. And then lastly,

7:26:22we have notion, right? Which adds the

7:26:24applicant, James Low, should be able to

7:26:27add it to the high ranking, James Low.

7:26:29There you go, with everything.

7:26:31Even the date right here. As you can

7:26:32see, it's different from this one

7:26:34because we forgot to add it there. We

7:26:36have the resume link right here.

7:26:38And then we have the strength, weakness,

7:26:39risk factor, reward factor, overall fit,

7:26:41and justification. That's it. Now,

7:26:43something like this could be very, very

7:26:44beneficial for any kind of business that

7:26:45is hiring new applicants. And there's so

7:26:48much more that you can do with hiring.

7:26:49Because stuff like these takes 10, 15

7:26:52minutes, or even 5 minutes for someone

7:26:53to match a CV to someone else or to

7:26:56another qualification. And if they have

7:26:58hundreds of applicants, then that's

7:26:59hundreds of hours that they have to

7:27:00spend to actually doing this tedious

7:27:02task that AI could literally do in

7:27:05seconds. And teams literally spend tens

7:27:06of thousands of dollars of for people or

7:27:09team members to be able to do this task,

7:27:11which is insane. Cuz now AI could

7:27:13actually do them for you.

7:27:17Hey, in this video I'm going to build an

7:27:18email classifier AI agent inside of N8N

7:27:22that watches your emails coming through.

7:27:24It then classifies them based on

7:27:25different criterias. It then uses a

7:27:27series of AI agents that will now write

7:27:30back an email, which will then be

7:27:31drafted into our inbox. All right, so

7:27:33this right here is the email classifier

7:27:34system. All I have to do is send myself

7:27:36an email. I'm going to go here. So I

7:27:38said, "Hey, question about company. Hey

7:27:40Mick Kelly, I have a quick question.

7:27:41What do you guys do and what is your

7:27:42service?" I'm going to press send.

7:27:44This should now come to this inbox. As

7:27:46you can see, we just got the email,

7:27:47question about company. All I have to do

7:27:49here, I'm going to test this. I'm going

7:27:50to press execute workflow. This will now

7:27:52get the email that it used. It

7:27:54classified it as a customer support

7:27:55email. It will now generate a draft

7:27:57email that we can find here. If I go to

7:27:59support, I can see that this email right

7:28:01here, question about company.

7:28:03See here? And we generated a draft email

7:28:05to that question that we can now

7:28:07double-check before sending it to the

7:28:08customer who wrote the email. And this

7:28:10is the exact same concept when it comes

7:28:12to high priority, promotion, and finance

7:28:14and billing. Right. Here we have

7:28:16promotion, priority, and finance and

7:28:18billing. All right, so let's build the

7:28:19whole system step-by-step. As I always

7:28:21say, we shouldn't build it first, we

7:28:22should map it out first to then have a

7:28:24strategy or an action plan when we build

7:28:26it, cuz it makes it so much easier for

7:28:28us. I'm going to go here, and for every

7:28:30automation that we do, we have an input

7:28:33and we have an output. All right, so in

7:28:35this case, the input would be the email

7:28:37coming through. So, watch your emails.

7:28:40Then we want to classify the email,

7:28:43right? Cuz we want to have that first

7:28:44before

7:28:46labeling it and before writing a draft

7:28:48email that will then be drafted into our

7:28:49inbox, right? So, we have this step

7:28:52right here. We have uh label email.

7:28:57Or was it classify email? Yeah, classify

7:28:58email. And we can classify it based on

7:29:03support.

7:29:04We had What was it? Priority.

7:29:07We then had urgent. No, that was urgent.

7:29:10Was it urgency?

7:29:12Promotion, finance and billing, and

7:29:13priority. Yeah.

7:29:14Promotion.

7:29:18Finance and billing.

7:29:20All right, so we are taking

7:29:22the new emails that come through from

7:29:23our inbox.

7:29:24We are then sending it to an AI to

7:29:26classify emails based on whether they

7:29:28are support, priority, promotion, and

7:29:29finance and billing. Then what we're

7:29:31doing at that point is we are

7:29:33sending it. Let me put it here. We're

7:29:35sending it

7:29:36to the appropriate AI agent.

7:29:39To AI agent.

7:29:41To correct AI agent.

7:29:43No, actually no, we should label the

7:29:45email first, right? Label the email.

7:29:47And then we

7:29:52use

7:29:53AI agent

7:29:55to

7:29:57draft email reply.

7:30:00And then we actually draft a reply

7:30:04to inbox.

7:30:07So, that's I think that's the I think

7:30:09that's what we want to do. Keep it

7:30:11simple, right? We're getting an email,

7:30:12classifying it, then we're sending it to

7:30:14the appropriate AI agent to do its own

7:30:16thing, to label it first.

7:30:18Or you can do that you can do the

7:30:19inverse as well. You can

7:30:20generate a reply and then label it, but

7:30:22I feel like

7:30:24um it'd be easier to just label it first

7:30:26and then draft it. And then we actually

7:30:28draft a reply to the inbox. I do think

7:30:30though that when the email is urgent, we

7:30:33shouldn't draft a reply to the inbox. We

7:30:35should send message to team on Telegram.

7:30:42Okay? Because the fact that they're

7:30:43urgent makes it so that we have to

7:30:45notify our team to do its thing. To

7:30:47actually go there and and and check it

7:30:49and send it through. Um

7:30:50or reply themselves, right? In that

7:30:51case.

7:30:52All right, so we're going to use this

7:30:53when we actually build the system. So,

7:30:54let me go to a new workflow. All right,

7:30:56I have a new workflow right here. I can

7:30:57put email classifier AI agent. And now,

7:31:02the way that we start is with the first

7:31:03step. So, the first step is watching

7:31:05your emails. So, I go here.

7:31:06And I go to Gmail, because that is the

7:31:08provider. If you're using Outlook, I

7:31:10believe that you can do it.

7:31:12Outlook. On message received. Yeah, so

7:31:15you can do it.

7:31:16Um

7:31:17but we're using Gmail cuz we're Google

7:31:18folks.

7:31:19And then, the first step of the

7:31:21automation is a trigger. So, the trigger

7:31:23is what is the thing that starts

7:31:25automation? Like how do how do we start

7:31:26it? Well, in this case, we only have one

7:31:28trigger, which is on message received.

7:31:30Which is basically saying, "Hey,

7:31:32when we receive a message, in this case

7:31:33a message is an email, then we start the

7:31:35automation." And the first thing we have

7:31:37to do is connect our account to N8N. All

7:31:39you have to do is create new credential.

7:31:41You can press sign in with Google. This

7:31:43will take you to this page right here.

7:31:44Choose an account and then bring it

7:31:45back.

7:31:46I already have it connected.

7:31:48Which would be James Solutions email.

7:31:52And now, we are given different options.

7:31:54So, we're given poll times, which means

7:31:57do you want to check it every minute? Do

7:31:59you want to check it every hour, every

7:32:01day, every week, every month, every X

7:32:02custom? In this case, we can just do

7:32:07we can just leave it. Leave it blank.

7:32:09And the event itself will be message

7:32:10received, right? Because that is the

7:32:12action that we're doing. We're receiving

7:32:13a message and then we're starting the

7:32:14automation. Simplify just means you want

7:32:16to simplify the data that we get

7:32:17through. And I'll show you exactly what

7:32:19what that looks like. And

7:32:22that's it.

7:32:23So, we're going to need to test this by

7:32:25sending ourselves an email

7:32:27to the inbox of the email that you

7:32:29connected the Gmail with.

7:32:31So, I'm going to go here, send myself an

7:32:32email.

7:32:35Customer su-

7:32:37support question.

7:32:40Hey, what's your return policy?

7:32:43I'm going to press send.

7:32:45I'm going to go to my inbox. All right,

7:32:47so we have the email here, customer

7:32:48support question. And now I can press

7:32:50execute workflow. So, this is now

7:32:52testing the the actual automation. Cuz

7:32:54when we build automations,

7:32:55uh even AI agents, I mean everything in

7:32:57general with N8N, we want to be able to

7:32:58test every single time.

7:33:00So, we have this here.

7:33:02This is the data that we got.

7:33:03Hey, what's your return policy? I

7:33:06believe this is because we put an

7:33:07apostrophe, and this is how it um

7:33:10classifies it.

7:33:11I'm going to pin this so that when I go

7:33:13to the next steps, I don't have to rerun

7:33:15the automation every single time. All

7:33:16right, now once this is done, I can go

7:33:18to the next step. So, this is green

7:33:21to classify the email based on whether

7:33:22it's support, priority, promotion, and

7:33:24finance and billing.

7:33:25I'm going to go here, press plus. I'm

7:33:27going to go classify text classifier

7:33:29right here. It's actually a pretty good

7:33:31feature, I'm not going to lie.

7:33:32Um because we are

7:33:35as in the system is set up so that we

7:33:36give a text, which is the snippet,

7:33:38which is the actual email. [music] And

7:33:39then, what we do is we start adding

7:33:41categories. So, categories would be

7:33:43maybe the support, and you put a

7:33:45description of what a support email is.

7:33:47So,

7:33:48this is for support emails asking just

7:33:50general questions. Then category, you

7:33:52can do priority.

7:33:55Can do email require attention, action

7:33:57typically from key stakeholders,

7:33:59clients, ASAP, immediate deadlines, all

7:34:01that stuff. Then we have the next one,

7:34:02which is uh promotions.

7:34:05I'm going to go here, promotions. And

7:34:07then, this will be emails related to

7:34:09marketing campaigns and so on. Or

7:34:11description, emails related to finance

7:34:12matters such as invoices, billing

7:34:14statements, payment reminders, uh or

7:34:16expense reports, anything involved

7:34:17transactions and so on. Okay? So, again,

7:34:19we have the support, which is this, and

7:34:21I'm going to paste the one that I had

7:34:22before cuz it it is more sophisticated.

7:34:25So, emails related to ongoing

7:34:26communication with current clients or

7:34:28including stakeholders, including

7:34:29service requests, feedback, support

7:34:31tickets, and inquiries, keyword

7:34:32requests, and So, we give it a few

7:34:34examples of also keywords. Same thing

7:34:36with priority.

7:34:37Promotions. And we have

7:34:41finance and billing.

7:34:43And one thing we also have is the system

7:34:45prompt template. We'll leave it like

7:34:47this. I think it's pretty good. Please

7:34:48classify the text provided by the user

7:34:50into one of the following categories,

7:34:52categories, which is the ones up here.

7:34:54And use the provided formatting

7:34:55instructions below. Don't explain and

7:34:57only output the JSON.

7:34:59Which is perfect. So, now if I execute

7:35:01this step,

7:35:04a model subnode must be connected.

7:35:05Right. I don't know why I'm tripping,

7:35:07but we have to connect the model to this

7:35:09because it is run by AI.

7:35:11Uh and feel free to choose anything,

7:35:13even OpenAI, it's fine. In order to

7:35:15connect your OpenAI, make sure to go to

7:35:17platform.openai.com.

7:35:20You can go to the dashboard.

7:35:22Go to API keys.

7:35:25Make a key right here.

7:35:26And then copy the key and bring it all

7:35:28the way back to N8N.

7:35:30And then connect your account. Press

7:35:31sign in.

7:35:32Once this is done, you will have your

7:35:33account connected. You can use 4.1 mini.

7:35:36We have different models as well that we

7:35:37can use. I think 4.1 mini is great. In

7:35:40my previous video, I spoke about how you

7:35:41can use OpenRouter, which is the thing

7:35:43that allows us to be able to choose any

7:35:45model that we want without having to

7:35:47make a cloud connection, OpenAI

7:35:48connection, everything else. Check it

7:35:50out up here. Um

7:35:51good video.

7:35:53But now we use OpenAI. So, now we can

7:35:55execute this step. This should now work.

7:35:58And we can see that

7:36:01these are all the branches that we have,

7:36:02support, priority, and promotions,

7:36:04finance and billing. And it went down

7:36:05the support branch.

7:36:08Because the question was, "Hey, what's

7:36:10your return policy?" So, that is a

7:36:11support question.

7:36:13So, you can see here, we have different

7:36:15options, right? Cuz we put different

7:36:16categories and each category represents

7:36:18a path that the automation can go

7:36:20through. Like priority, promotions,

7:36:21finance and billing. So, what we're

7:36:23going to do now is we're going to go to

7:36:24the next steps, which is

7:36:27not this. This is green.

7:36:29Labeling the emails, right? And so, if I

7:36:31go to here, I can then add the node,

7:36:34which is Gmail.

7:36:36I believe this is add label to message.

7:36:38Same connection.

7:36:40The resource, which is what is the thing

7:36:41that we're actually manipulating, it

7:36:42will be message. The action that we're

7:36:44taking is operation. The message ID is

7:36:47something that you can actually get

7:36:49down here.

7:36:50So, this will be

7:36:53ID.

7:36:56And if that's not the right one, then

7:36:57we'll we'll change it later. But, I

7:36:58believe this Yeah, this is ID. And then,

7:37:00the label names or IDs, you can choose

7:37:03from your inbox right here, right? Now,

7:37:06as you can see here, I already have the

7:37:08different labels. So, if you don't see

7:37:10them here,

7:37:11it's because you didn't add them here.

7:37:13So, if I add, let's say

7:37:16test, right? If I press create,

7:37:18now I have test. If I go here,

7:37:21I should be able to see

7:37:23test. Let me refresh actually. It

7:37:25doesn't show immediately.

7:37:29There you go, test, right? So, it's only

7:37:31because you don't have them here that it

7:37:33doesn't show up on end-to-end. So, make

7:37:35sure to add your labels to your emails

7:37:37uh to then be able to see them in your

7:37:39automation so you can add them to the

7:37:40inbox.

7:37:42Cool. So, now this will be the first

7:37:44category, which I believe is support.

7:37:48So, support.

7:37:50There we go.

7:37:51Can do label

7:37:53equal

7:37:54support.

7:37:57What we're going to do now is we're

7:37:58going to hover over this. We're going to

7:38:00copy and paste.

7:38:02And this will be priority. High

7:38:04priority. Yeah, priority right here.

7:38:07Change the name to

7:38:10priority.

7:38:13Same thing with here. Promotions. And

7:38:16then, finance and billing.

7:38:18You could You could put a Gmail

7:38:21label thing every single time, but just

7:38:23to save yourself those

7:38:25>> [snorts]

7:38:25>> few minutes, you can just copy and

7:38:26paste. Here will be promotions. So, this

7:38:28will be promotions.

7:38:32And this will be

7:38:34promotions.

7:38:37And down here, we finance and billing.

7:38:40Finance and billing.

7:38:43And down here, you can put finance and

7:38:46billing.

7:38:47So, now, in theory, when it classifies

7:38:50it, it should classify it and actually

7:38:52label the email on our inbox. So, if I

7:38:54pin this,

7:38:56I should Actually, no. Never mind. Let

7:38:59me not pin this. Let me just run this.

7:39:01Execute workflow. This should now

7:39:03classify to support and this should be

7:39:04labeled as support. So, if I go here,

7:39:06the email that we received, customer

7:39:08support question,

7:39:10this is now labeled as support. As you

7:39:11can see, it just changed. So, which is

7:39:13good. And now that we know that this

7:39:14works, we can go to the next step, which

7:39:16is

7:39:17um using AI to draft an email reply.

7:39:21So,

7:39:22in order for us to draft a reply, we can

7:39:24use the AI agent.

7:39:25Because the thing is, we can also

7:39:28connect it to the tool, which is draft

7:39:30an email, right? So, it does two in one.

7:39:31It drafts a reply and also drafts it in

7:39:33our inbox. So, the first thing I have to

7:39:35do is

7:39:37create a chat model,

7:39:38right? And connect it to our chat model.

7:39:40One hack that we typically do with AI

7:39:42agents, especially when you have five or

7:39:43six,

7:39:45is you connect them all to the same

7:39:47tool. You could just duplicate it here.

7:39:49You can just go

7:39:50delete and then choose open AI.

7:39:54But,

7:39:55for it to look less tools and less stuff

7:39:57on the screen, you can just drag it

7:39:59across here.

7:40:00So, now this is connected to the chat

7:40:01model. Then, we're going to go inside

7:40:02here. We're going to name this

7:40:04uh customer

7:40:06support agent.

7:40:08The user message will not be chat to

7:40:11your node because we're not chatting to

7:40:13it in this case.

7:40:14We are just defining it below.

7:40:16And now here, I should add the text for

7:40:18the email.

7:40:20Okay, I think we're missing something.

7:40:22I think we are. Because if I go here, I

7:40:23don't actually see the text. I see the

7:40:25snippet. But, the snippet is basically

7:40:27the the cut version of the email. So, if

7:40:29the email is longer, then it will cut

7:40:30it. It will give us a snippet of it. So,

7:40:32all we have to do, I think, is simplify.

7:40:35Yeah.

7:40:36I'm going to run this again.

7:40:38Uh I'm going to send myself an email.

7:40:40What's your policy for returns and what

7:40:43do you guys do as a company?

7:40:44I'm going to press send. As you can see,

7:40:46we have the email right here. Uh

7:40:47customer support. And now if I go here

7:40:49to end-to-end, I can fetch test event.

7:40:52Okay, there we go. So,

7:40:54when I added simplify, it didn't show me

7:40:56all these things, but we want the text.

7:40:58Like we want the actual text.

7:41:00Perfect. Let me pin this. If I go here

7:41:02to the AI agent, I can give it the

7:41:05uh email text

7:41:08and email from.

7:41:11Or maybe I do the opposite. Yeah, I do

7:41:12the opposite.

7:41:14Uh email from and email text.

7:41:17Gmail trigger, the email

7:41:20from.

7:41:22Let's see if I can just go here.

7:41:26From. There we go.

7:41:28From my character right here. And then,

7:41:29the email text

7:41:33will be this.

7:41:36Right? And this is what we give the AI

7:41:37as a user message because there's two

7:41:39types of messages or prompts in this

7:41:40case. There is a user and there's a

7:41:42system. The user in this case is like

7:41:44what is the thing that we're giving it

7:41:45every single time.

7:41:47As in variables that change. Then, do we

7:41:49have a system message,

7:41:51which is simply the instructions, right?

7:41:53So, we give it the information on user.

7:41:54We then give it the instructions on

7:41:55system so that it uses the instructions

7:41:58with the the variables that we give it

7:41:59every single time to do the task. And

7:42:02so, right here, I'm going to paste the

7:42:03prompt that I have made before.

7:42:06I'll go here.

7:42:08Expression.

7:42:09Go big and then paste it.

7:42:11And

7:42:13so, for the system message, I'm going to

7:42:14go full screen. I'm going to say

7:42:16we typically structure our prompts with

7:42:19an overview. Then, we have tools.

7:42:22And then, we have rules.

7:42:24Tools and rules.

7:42:25So, overview would be I want to say

7:42:28you're a customer support representative

7:42:30named Kelly. Your job is to respond to

7:42:31customer inquiries in a friendly and

7:42:32professional manner. Then, the tools.

7:42:35So, what is it What tool are you

7:42:36connecting to this? Well, in this case,

7:42:37we're connecting the draft email. Right?

7:42:40So, if we go here to eGmail, we can do

7:42:42draft.

7:42:44Message draft.

7:42:47Or was it draft? Yeah, draft here.

7:42:49Create the draft. The subject line, I'm

7:42:51going to let it do its thing.

7:42:53Like this is basically means let AI

7:42:55define this based on the context that it

7:42:56was given.

7:42:57Then,

7:42:59the message as well.

7:43:01Let the model define this parameter.

7:43:02This is great for us because we don't

7:43:05have to give it a variable every single

7:43:07time. We can just press this button,

7:43:09which makes it so much easier for us to

7:43:10draft emails and reply things back uh

7:43:12because of this feature as well. And

7:43:14then, we're also doing the email to

7:43:18email to and the email to will be the

7:43:19email that we get the email from, which

7:43:22will be

7:43:23this right here.

7:43:26And also, in addition to that, we want

7:43:28the thread ID.

7:43:30Now, the thread ID makes it so that when

7:43:31we go to, let's say, support,

7:43:35here. Yeah. You see how it replied on

7:43:37the thread? So, the thread just means in

7:43:38the same conversation. Because the

7:43:40opposite of that could be that we have

7:43:43this just as a reply as a draft on a

7:43:45separate email, but it's not in the same

7:43:47thread. So, this allows us to be able to

7:43:48have the same conversation. It's sort of

7:43:50like a chat ID on on Telegram.

7:43:52Um it's the same. So,

7:43:53you can say uh thread ID and we can find

7:43:57the thread ID.

7:43:59Where can we find it? There we go.

7:44:01Thread ID.

7:44:02This will be the tool that we use that

7:44:04we connect all the tools to. Cuz again,

7:44:06just like we can connect the chat model

7:44:07to the same tool, we can also create a

7:44:09draft an email tool and we can connect

7:44:11it to all the AI agents who make the

7:44:12emails. So, in this case, we have

7:44:13customer support agent

7:44:15with small g. I don't know why it spaces

7:44:17me off. Um and then, we have

7:44:20this is it. I'm going to test this. I'm

7:44:22going to go execute workflow.

7:44:26Text to classify. Oh, okay. Okay. Got

7:44:28you.

7:44:28Cuz we also have to change this. So, if

7:44:30I go here,

7:44:32text.

7:44:33And then, we paste this.

7:44:35Again, make sure this is not simplify.

7:44:38Because simplify gives you less

7:44:40variables.

7:44:41Um I'm going to press execute workflow

7:44:43again. This will now classify it. It

7:44:45will label it as support. And then, it

7:44:47will use the AI agent to reply an email

7:44:49or to make a reply. I'll put subject

7:44:51line.

7:44:53Now, the one thing

7:44:55that I don't know why it didn't do

7:44:56is it didn't call the tool. I know why.

7:44:59Because we didn't tell what tool it

7:45:00needs to call. So, I'm going to rename

7:45:02this draft

7:45:04email.

7:45:05I'm going to go inside.

7:45:06I'm going to go in the prompt and going

7:45:08to say draft email. Use this to send an

7:45:11email reply to customer. Always sign off

7:45:13as James from ABC Corp.

7:45:15And the rules is

7:45:17keep the emails

7:45:20concise.

7:45:22That's it. Keep the email concise. Um

7:45:25I'm going to execute the workflow again

7:45:26so you get to see how it now calls the

7:45:28tool. It's all prompting, right? Like AI

7:45:30agents are all prompting.

7:45:32Because if it wasn't for the prompt, it

7:45:33wouldn't have called this tool. The text

7:45:35right here, I believe. Yeah, return

7:45:36policy. What's your return policy? And

7:45:38this is the answer that it gives. Our

7:45:40return policy allows customers to do

7:45:41XYZ.

7:45:43All right. Now that we have this, we can

7:45:45now replicate this for pretty much all

7:45:47the other agents.

7:45:48I'm going to copy this. I'm going to

7:45:50paste this.

7:45:51I'm going to paste this here.

7:45:54I'm going to paste this here.

7:45:56The only thing we'd have to do is that

7:45:58for label priority,

7:46:00let me actually see if I can change the

7:46:01order. Let me change the order here.

7:46:03Because

7:46:06I want priority to be first cuz priority

7:46:07goes to a different way. And go here,

7:46:10and put a space, paste this.

7:46:12Then go back here, and then this be the

7:46:15thing here. So, I just switched it

7:46:16because I want

7:46:20priority to go to goes first, and then

7:46:22support to go second. All right, cool.

7:46:23Now that you have this, we are able to

7:46:25then rename the agents.

7:46:28So, the chat model here will be

7:46:29connected to here.

7:46:31This will be connected to here. It looks

7:46:33a bit messy, cuz we need to space it

7:46:34out. So, let me

7:46:35space this out a little bit. And then go

7:46:37here.

7:46:38Chat model will go here.

7:46:39And now I'm going to

7:46:41add this here.

7:46:43Put this down here.

7:46:45It's also important for you, when you

7:46:46build automations, for it to actually

7:46:47look

7:46:49clean or structured.

7:46:51Um so, it makes the, I guess, visual

7:46:52when you're debugging it and so on, a

7:46:54lot better.

7:46:55Um and so, now we have customer support.

7:46:57We can do promotional

7:47:00promotional agent.

7:47:03We can do finance agent.

7:47:08Let's hook this up to the same tool.

7:47:11Right? Because the only difference

7:47:12really is is a label, right? And then we

7:47:14make a reply. But And we do have to

7:47:16change part of the prompt, right? So, we

7:47:18have to go inside finance and say, "You

7:47:20are a

7:47:21finance support representative team

7:47:23Kelly."

7:47:25to customer inquiries to finance

7:47:28inquiries.

7:47:30This will be promotional. So, you are a

7:47:32promotion no support representative

7:47:35to promotional queries.

7:47:39That's it. And then this one will be

7:47:41priority.

7:47:42And the message will be different. So,

7:47:45when I paste this, you're an agent in

7:47:46charge of high priority emails. Your job

7:47:47is to summarize incoming emails and

7:47:49escalate them to the human. And the tool

7:47:50will change, right? So, we're not using

7:47:51the draft email anymore. We're using

7:47:53Telegram.

7:47:54So, in this case, tool

7:47:56we can search for Telegram.

7:47:58Telegram tool. And in order to connect

7:47:59your Telegram here,

7:48:01just follow this step-by-step guide. For

7:48:02the sake of time, I'm not going to be

7:48:03able to show you step-by-step how to do

7:48:06it, but

7:48:07if you follow these instructions, you'll

7:48:08be good.

7:48:10And now,

7:48:11you have this. So, the message is the

7:48:12thing that we're manipulating. The

7:48:14operation will be send the message. The

7:48:16chat ID, I don't think we need it,

7:48:18right? To be honest. Yeah, we don't need

7:48:19it. And the text itself will be

7:48:24defined by the model. I mean, we do need

7:48:26it, right? But we can define this. We

7:48:28can let We can let this be defined. Or

7:48:30not, right? Like I mean, if I'm wrong,

7:48:31I'll we'll fix it, but there we go.

7:48:33Reply markup none.

7:48:35Okay.

7:48:35So,

7:48:37Telegram.

7:48:40And what I'm going to say here is,

7:48:42"You're an agent in charge of high

7:48:43priorities, and the tool you're going to

7:48:44use is Telegram. Use this email to send

7:48:47the summary of the email once it's

7:48:49summarized."

7:48:52Look at that English. Use this email to

7:48:54send the summary of the email once it's

7:48:55summarized. That's fine.

7:48:57And now, what we can do is test it. So,

7:48:59test this right here.

7:49:01I'm going to go here. Want to press this

7:49:03little pencil right here, which

7:49:05basically manipulates the data.

7:49:07I can go

7:49:10Okay.

7:49:11>> [laughter]

7:49:11>> I think we're cooked here. Received.

7:49:13Where's the text?

7:49:14Text. There we go.

7:49:17Want to take this out and say, "Hey

7:49:19there.

7:49:20We have a client emergency.

7:49:23We She wants to know or they want to

7:49:25know

7:49:27how much we charge.

7:49:29Urgent."

7:49:31Well, actually, let's not put this.

7:49:33Cuz it's clearly obvious that it's

7:49:34urgent, right? Want to press save. And

7:49:36now, if I

7:49:37execute workflow,

7:49:40this should

7:49:41send Telegram message, but it didn't.

7:49:45Because the chat ID, I believe, was

7:49:46wrong. Chat not found. Okay, so what we

7:49:49have to do here is this.

7:49:51Yeah, yeah, yeah. Okay, okay, okay.

7:49:53Cool, cool.

7:49:54Yeah, cuz the chat ID here isn't isn't a

7:49:55number. It's not It's not text. So, it

7:49:57doesn't It doesn't categorize it as

7:49:58that.

7:50:00Yeah, so the problem here was that the

7:50:02chat ID

7:50:04it gave it as urgent emails, but the

7:50:06chat ID is numbers. So, that's wrong.

7:50:10So, what we have to do is we have to use

7:50:13Telegram.

7:50:14Go here. Telegram.

7:50:17And follow me through here. There's a

7:50:18clear thought process to why we're doing

7:50:20it. Uh we're going to

7:50:23Um actually, let me go back.

7:50:26Add another trigger. Telegram.

7:50:30On message

7:50:32received. On message and then message

7:50:34Yeah, on message. I cannot go to

7:50:35Telegram.

7:50:37I mean, we can see that the it worked,

7:50:38right? Like the email was sent. Um

7:50:41what I'm going to do though is I'm going

7:50:42to

7:50:43execute step. So, this is now watching

7:50:45for

7:50:46Yeah, watching for messages. Want to

7:50:48say, "Hello."

7:50:50Okay, with this here, I cannot get the

7:50:52chat ID. Okay, so now if I get the chat

7:50:54ID, I can then move this. I can hardcode

7:50:57it right here.

7:50:59So, the chat ID can be the same, right?

7:51:01Because it it can be in the same exact

7:51:02chat that we have. Um

7:51:04so, let's try this again.

7:51:06Let me go to execute workflow.

7:51:09And here we should see an email coming

7:51:10through at any time. So, high priority

7:51:12email from Michele Torti, a client

7:51:13emergency requires XYZ.

7:51:16And we can remove this. We can remove

7:51:17this message was sent automatically with

7:51:18N8N.

7:51:19I believe it's here. Add field.

7:51:22Append N8N attribution. We can turn this

7:51:24off.

7:51:26Okay, so we got to see the message was

7:51:27sent successfully.

7:51:29>> [sighs]

7:51:30>> And now, let's try with let's see

7:51:32finance, right? So, let's say we send

7:51:34ourselves an email.

7:51:35Say, "Hey there, can you provide us with

7:51:36a billing statement?

7:51:38Um

7:51:39James."

7:51:40Want to press send. All right, so we got

7:51:41the email, billing statement. I can

7:51:43press execute workflow.

7:51:46This should now send it down here,

7:51:47finance and billing. It should label it.

7:51:50It should make a reply, a draft, and

7:51:52then I should see it right here.

7:51:54Finance and billing.

7:51:55Finance and billing right here. I can

7:51:56see that we have uh information. Now,

7:51:59one thing that you should be asking

7:52:00yourself here, cuz if you're not asking

7:52:01yourself this, then I don't know.

7:52:04This is obviously hallucinating, right?

7:52:06Like let's be honest. Like how how this

7:52:08can't be accurate, cuz we're simply

7:52:10using AI,

7:52:12which is not trained on any data.

7:52:14And so, to mitigate this, what we would

7:52:16have to do is you can add a step right

7:52:19here, where we can basically pull in

7:52:21information from a Superbase. So, you

7:52:23can have Superbase back to store, which

7:52:26is trained on all our company's data.

7:52:29And then, we can then pull the

7:52:31information and then draft a reply.

7:52:33Cuz then we have context. Like the the

7:52:35actual agent doesn't just hallucinate.

7:52:37Because obviously, this right here will

7:52:39prepare a billing statement and send it

7:52:40to you shortly. This is obviously not

7:52:42true.

7:52:43And so, this just makes it up. And so,

7:52:44in real life, in actual business, you

7:52:45can't have something like this

7:52:47specifically. You would need an extra

7:52:48step here of pulling information from a

7:52:51vector database, which is a basically

7:52:53like a Google Sheet. That's better.

7:52:54Which you pull information from before

7:52:56sending it to the client, before

7:52:57actually replying to the client. Because

7:52:59it actually is accurate by that point.

7:53:01So, that right there is a full email

7:53:02classifier AI agent built inside of N8N.

7:53:09In today's video, I'm going to show you

7:53:10step-by-step how I built a full

7:53:12AI-powered blog generation system inside

7:53:14of N8N that can write highly effective,

7:53:17well-researched blogs by a team of AI

7:53:19agents. All right, so this right here is

7:53:20the system. I'm going to run it from

7:53:22scratch and show you exactly how it

7:53:23works before we uh go step-by-step and

7:53:25show you how I built it. I'm going to

7:53:27press execute workflow.

7:53:29I'm going to put the post topic. Let's

7:53:30do AI in finance.

7:53:33And let's do investment bankers.

7:53:36So, the post topic for the blog is AI in

7:53:38finance. Then we do investment bankers.

7:53:40Let me just

7:53:42finance. There we go. And tone of voice

7:53:44will be direct.

7:53:46So, these are the three different inputs

7:53:47that we give it. We press submit. What

7:53:49this will now do is it will send the

7:53:51information to the first AI agent, which

7:53:54is a newsletter expert, which basically

7:53:55does research on the topic that we're

7:53:57doing. Then what we do is we generate an

7:53:59outline using an AI step, which will

7:54:01then be split into four different parts,

7:54:03cuz the outline has four different parts

7:54:04of uh of the blog. We'll have a research

7:54:06agent, which is this one right here,

7:54:08which will do more research on the

7:54:10actual topic that is written on that

7:54:12first paragraph or first section of the

7:54:14blog,

7:54:15uh and second and third and fourth as

7:54:16well. Then what we do here is using the

7:54:19outline, which is split up into four

7:54:20different parts, we send it to the

7:54:22research agent, which is this one right

7:54:23here, which is now doing research on

7:54:26each part of the blog using Perplexity.

7:54:28And it's actually writing the snippet

7:54:30for that specific part. Then what we do

7:54:32here is we merge the output from here

7:54:35and here as well. We aggregate them,

7:54:37which means we put them all into one

7:54:38place before sending it to the editor AI

7:54:40agent, which in this case is an AI agent

7:54:43that will edit the actual newsletter.

7:54:44So, that's that's going to be the final

7:54:46version. And we use Claude here because

7:54:47Claude is a better model to write

7:54:49content. Then we use it just an AI step

7:54:51to generate a title, and then we send

7:54:53the [music] actual newsletter to our

7:54:54inbox. If I go to my inbox, and on my

7:54:56inbox, I can see that I have generative

7:54:58AI transforming investment bank

7:55:00operations, and this is the full blog

7:55:02that we use.

7:55:03And a good thing about this is that it

7:55:05uses It actually references which

7:55:06sources. If you go here to two, it

7:55:09references the source that we're using,

7:55:11right? Also, you can see it down here.

7:55:13First, second, third, fourth, fifth, and

7:55:15sixth. And this right here is just a

7:55:17prompting thing. Um and now you have a

7:55:18fully optimized blog, which gives us

7:55:21highly in-depth research from the top

7:55:24sources, from top credible sources, that

7:55:26we can use. And a good thing about this

7:55:28is you can have this running daily. Cuz

7:55:30right now, we have a form, but you can

7:55:32replace this with a Google Sheet that

7:55:33will have different topics, and then a

7:55:36on-time schedule, which means that it

7:55:37will run every week, every day, and so

7:55:38on. And you have a fully optimized blog

7:55:41in your inbox. So, with that said, let's

7:55:43see exactly how this works, and let's go

7:55:44step-by-step. All right, so let's go

7:55:46through the first step, which is the

7:55:47form input. So, we added a form. Again,

7:55:50this can be any kind of input, right?

7:55:51The form is just the easiest because we

7:55:53can just simply execute step, and we can

7:55:56have access to this form right here,

7:55:57which is a very very simple form that we

7:55:59just create natively within N8N.

7:56:01And for the forms itself on N8N, we have

7:56:03the test URL and we have the production

7:56:05URL. Now, bear in mind the test URL is

7:56:08just a URL that you use when you're

7:56:10testing, okay? Hence the name, test URL.

7:56:13When you're going to production, which

7:56:14means that you are turning this on,

7:56:15you're activating this, that's when you

7:56:17use the production URL. So, in theory,

7:56:19what this would look like is you

7:56:20wouldn't have to go inside here and

7:56:21press execute step and then run the

7:56:23whole thing. You would just activate it,

7:56:25you would use the production URL, and

7:56:27that's the thing that you paste into

7:56:28your browser when you're doing whatever

7:56:30you're doing, right? As you can see

7:56:31here,

7:56:32this is not activated, so this is

7:56:33deactivated. Um so, we can't see it.

7:56:35Then, we have authentication right here,

7:56:37and authentication can be used to

7:56:38basically add a password between the

7:56:40person that wants to fill out the form

7:56:42and actually filling out the form.

7:56:43Because if you don't want anybody or if

7:56:45you don't want everybody to have access

7:56:46to the form, then you want a password.

7:56:48Well, in this case, we can just leave it

7:56:49blank um cuz this URL is pretty unique.

7:56:52Then, we have the form title, in this

7:56:54case, newsletter form. And then, these

7:56:55are the fields. So, the fields is what

7:56:57are we asking the user to fill out? In

7:56:59this case, we are asking the post topic,

7:57:01which is in text field.

7:57:03And the placeholder can be AI in

7:57:04finance.

7:57:06Placeholder just means this, right? So,

7:57:07if you execute a step, this is a

7:57:09placeholder, which means what is a thing

7:57:10that they see,

7:57:12and typically you add this as

7:57:13inspiration for what they could add,

7:57:15right? [music] Let's make this a

7:57:17required field, actually. Target

7:57:18audience, text, required field, and then

7:57:21tone of voice, drop down. So, we have

7:57:22three different choices. So, we have

7:57:23authoritative tone, humorous, and

7:57:25direct.

7:57:27These are the three different choices.

7:57:28So, this will be the input again when we

7:57:29press execute workflow, this will

7:57:31execute the actual workflow. So, I can

7:57:32do AI in

7:57:34computer science. Target audience,

7:57:3750-year-old men.

7:57:39Tone of voice can be authoritative. And

7:57:41then, we see here that this is the

7:57:43answer that we get.

7:57:45Okay, and this is the variables that we

7:57:46then pull into the next step. Now, I'm

7:57:48going to pin this. I don't have to rerun

7:57:50it again every single time.

7:57:52The next step we're doing is we're

7:57:52setting variables. Now, honestly, you

7:57:54don't have to do this. I don't know why

7:57:55I did this, to be honest. Um you can go

7:57:57without this, but I just wanted to set

7:57:59the variable topic, target audience, and

7:58:01tone of voice for no reason, actually.

7:58:03So, we can actually delete this. Uh but

7:58:04because this is connected to all of

7:58:05these, then it makes sense to have this.

7:58:07I typically have this just to have

7:58:08things organized. Um

7:58:10and basically, what this looks like is

7:58:13we're replicating this, these variables,

7:58:15to just have topic, target audience, and

7:58:17tone of voice. And typically, why you do

7:58:19this is because on the form submission,

7:58:21we also get the submitted at and form

7:58:23mode, which is extra variables that I

7:58:25don't want to see, but at the same time,

7:58:27you can go without this because I mean,

7:58:28these these fields are only two fields,

7:58:30right? There's not a crazy amount. Um

7:58:32but we usually use set variables when we

7:58:35have an input, which is a ton of

7:58:37different variables. I think you can use

7:58:38like Apify or any of these softwares,

7:58:41they give you like a hundred variables,

7:58:42and then you basically want to extract

7:58:44the variables that you actually need,

7:58:46and that's where you use a set variable.

7:58:48In this case, it didn't make much sense

7:58:49of why I used it, but you can still use

7:58:51it. Cuz we don't get charged by step, we

7:58:53get charged by execution.

7:58:54Then, we have the first AI agent, which

7:58:56is a newsletter expert. We can use AI

7:58:58tools agent. There's three different

7:58:59types of agents, OpenAI functions agent,

7:59:02which uses OpenAI to just do its thing,

7:59:04conversations agent, so you can talk to

7:59:06it. We leave this as tools agent because

7:59:07we are using tools with the agent. Uh

7:59:09the source of prompt, which is what is

7:59:11the input that we're getting? In this

7:59:12case, if I execute the previous notes, I

7:59:14can see that the input is this.

7:59:16So, we give it the prompt user message

7:59:18because every AI agent has two different

7:59:20types of prompts. Okay? It has a user

7:59:22prompt and it has a system prompt.

7:59:24Also, assistant, but the main ones are

7:59:26user and system. And the user prompt in

7:59:29this case would be what are the

7:59:30variables that we're feeding into the

7:59:31actual AI agent for it to do its thing.

7:59:34And the prompt user message here is what

7:59:36are the variables like newsletter topic,

7:59:37tone of voice, and target audience,

7:59:39which we're pulling in from here that it

7:59:41uses to actually do its thing, right?

7:59:43So, that's for the user message. And

7:59:44then, we have the system message.

7:59:48Now, the system message is a prompt that

7:59:50gives it the

7:59:51instructions, right? The instructions

7:59:52for the thing. It doesn't actually give

7:59:53it the variables because the variables

7:59:55go in the user message, but we give it

7:59:56the overview, the context, the

7:59:58instructions,

8:00:00the tools

8:00:01that it uses, um examples as well,

8:00:04input, output, input, output. So, these

8:00:07are assistant prompts because we're

8:00:10giving it an example here, example here,

8:00:13example here, example here, to make it I

8:00:15guess to give it more context as to what

8:00:16we want to do. Uh cuz sometimes AI is so

8:00:19creative sometimes that it just spits

8:00:20out what it wants to spit out. So, if

8:00:22you give it a few example, it sort of

8:00:23like guides it and narrows down the the

8:00:25focus that it needs to have when making

8:00:27the blog for you.

8:00:29Um and so, this is the full prompt. And

8:00:30again, at the end of the video, I'll

8:00:31show you exactly how you can get the

8:00:33whole system for free, so don't worry.

8:00:35Uh but you can also take a screenshot of

8:00:36this and drop it into ChatGPT and ask it

8:00:38to extract the text. Uh that's what I

8:00:40used to do all the time.

8:00:42And now, you have the system message

8:00:43right here and you have the user

8:00:45message. We can see we ran this before,

8:00:47and this is the output that we get. Of

8:00:49course, this is cut, but if I go to

8:00:50JSON, I can see here that this is a full

8:00:53thing. So, table of contents. So, we are

8:00:55generating table of contents

8:00:57for the newsletter, right? And we're

8:00:59using Perplexity

8:01:00as a tool to do so.

8:01:02Why? It's because you want to do more

8:01:03research on the actual topic to then

8:01:05give it proper table of contents. And

8:01:08table of contents is like, okay, what's

8:01:09going to be in the actual newsletter?

8:01:11What's going to be in the blog?

8:01:12Once we have this, let me pin this.

8:01:14Then, we go ahead in the next step,

8:01:15which is generate an outline. And here,

8:01:17we're not using an AI agent, we're just

8:01:18using a simple step. Now, to connect

8:01:21your OpenAI to N8N, all you have to do

8:01:23is press create a new credential. You

8:01:24can go to platform.openai,

8:01:26platform.openai.com.

8:01:28You can go to login, choose your

8:01:30account,

8:01:34and then you want to go to dashboard,

8:01:36get your API key right here.

8:01:38Press this button, get a key. You can

8:01:41copy and paste back

8:01:42right [music] here. Bear in mind, this

8:01:44is not free, as in you still have to pay

8:01:46for this. Um and you pay for this using

8:01:48something called an API credit. Now, the

8:01:50API credit is something that you can

8:01:52see, where is it? Billing,

8:01:54on the left-hand side, and you will add

8:01:56money here.

8:01:57It is very, very cheap, so it will only

8:02:00cost

8:02:01a tenth of a cent when you run this. Um

8:02:03so, yeah. But make sure you have about

8:02:05$5 cuz that is the recommended amount

8:02:07that we use.

8:02:08All right. Now that we have this, we

8:02:09have connected our OpenAI to uh N8N, we

8:02:12can use text because that is the thing

8:02:14that we're manipulating. The action that

8:02:15we're taking is messaging model, which

8:02:17means that it's sort of like we're going

8:02:18to ChatGPT and we're typing something to

8:02:20get an answer back. Then, we're using

8:02:22the model 4o mini because it is the um

8:02:25it's we're going for like speed and

8:02:26quality, right? And 4o mini is great.

8:02:29And the prompt is this. Your job is to

8:02:30split out the table of contents into an

8:02:32individual item for each section. Output

8:02:35each section separately in a field

8:02:36called newsletter sections.

8:02:38When doing so, keep in mind that the

8:02:39newsletter target audience is this and

8:02:41the tone of the newsletter is this. So,

8:02:43now we're pulling in the variables from

8:02:44here, set variables.

8:02:46Here's the table of contents. So, what

8:02:48we're asking it to do is this. We're

8:02:49asking it to basically

8:02:52get the table of contents, which is a

8:02:53block of text, and then output an array,

8:02:56right? An array, I'll show you exactly

8:02:57what it is.

8:02:59An array is a something, right?

8:03:02Where it contains different items inside

8:03:04that something. So, in this case, it

8:03:06contains the four different sections. Uh

8:03:08each section has a title and has a

8:03:10description. Title and description,

8:03:11title and description. Why do we do

8:03:13this? Well, you can simply And by the

8:03:14way, this whole system, you can simply

8:03:16replace by just using one prompt from

8:03:18ChatGPT to make a blog. But because you

8:03:19want to make it higher quality, right?

8:03:21And go through basically generating an

8:03:23outline and taking each bucket of that

8:03:25outline. What I mean by this is taking

8:03:27each newsletter section and then giving

8:03:30it to AI to do the research and then

8:03:31making it more optimized and then making

8:03:33it better, right? And so, what we're

8:03:34doing here is we're asking it to take

8:03:36this text, which is unstructured,

8:03:39because it's a block of text,

8:03:40which doesn't make much sense to us and

8:03:42we can't really do anything with it, and

8:03:43then giving it to AI and saying, "Hey,

8:03:45take this block of text that we have

8:03:47here.

8:03:48So, this is the input.

8:03:50And basically, it's split it out. So, I

8:03:51want you to split out an array,

8:03:55which is something that has different

8:03:56items in it, and you know it's an array

8:03:57because typically has a square bracket.

8:04:01Square bracket? Yeah, square bracket

8:04:02here and here. And inside the square

8:04:04bracket, there are a bunch of items,

8:04:06which is this

8:04:08and here, and this and here,

8:04:11and this here as well, and same thing

8:04:13with this, right? And so, these items

8:04:15are all pretty much the same, and those

8:04:16are the four items, which means that

8:04:18they're four table of contents, four

8:04:20different parts of the blog that we want

8:04:22to iterate, want to split it out, right?

8:04:24Each one, and then use each one for

8:04:26research, use each one to write the

8:04:27blog, and use each one to make the blog

8:04:29better. So, once we have this, then we

8:04:31can split out, right? So, I mentioned

8:04:33that we Let me pin this.

8:04:34If I press this,

8:04:37you can see this is now four items. Why?

8:04:39It's because the array itself is best

8:04:42for us to use when we want to get the

8:04:45array,

8:04:46which can be found here. So, if I go

8:04:48here,

8:04:49newsletter section,

8:04:50this now will split out four different

8:04:52items.

8:04:53First, second, third, and fourth. And

8:04:56that's exactly what we then feed into

8:04:58our AI agent, which is the research

8:05:00agent right here,

8:05:02to do more research. So, the input, of

8:05:04course, is a tools agent cuz we're using

8:05:05tools. Uh the source of prompt is user

8:05:07message, which we'll define below. And

8:05:09then, the user message itself, which is

8:05:10what are the variables that are going

8:05:12into the AI agent for it to use to do

8:05:14its thing, are the section title,

8:05:17which is this, section description,

8:05:19which will be this right here. Where is

8:05:21it? Generate outline. There we go.

8:05:23Description,

8:05:25newsletter target audience,

8:05:27which will be this right here,

8:05:29the target audience. There we go.

8:05:31And newsletter tone of voice.

8:05:33And so, we feed all of this in so that

8:05:35it has context as to what the actual

8:05:38section is, right? And so, this being

8:05:40the user message, and this is the prompt

8:05:43that we use for the research agent. And

8:05:45so, we have an overview, which is you

8:05:46are an AI agent responsible for

8:05:47delivering only the final content for a

8:05:49newsletter. Then, we have context, uh

8:05:52which is all necessary details including

8:05:53the section title, the description, the

8:05:55target audience, and the tone will be

8:05:56provided. Then the goal and the content

8:05:59must be supported by research, and then

8:06:01we give it instructions. And this is

8:06:02usually how the the actual prompt goes,

8:06:05right? We have overview, context,

8:06:07instructions. Now, in this case, we have

8:06:08tools. It's only one tool because we're

8:06:10connecting this to Perplexity to do the

8:06:12research.

8:06:14And with that said,

8:06:16we have citations, examples. So, we give

8:06:18it examples and SOPs as well.

8:06:20And this is a very, very good prompt. As

8:06:22in, it has markdown formatting, which is

8:06:24the hashtags,

8:06:26which is basically saying, "Hey, this is

8:06:27heading one, this is heading two," and

8:06:29so on.

8:06:31And then it has a bunch of stuff as

8:06:32well. So, rules, guidelines, all that

8:06:33stuff that it needs.

8:06:34>> [music]

8:06:35>> And from here, we start using Claude in

8:06:37comparison to OpenAI right here because

8:06:38Claude because now we're actually

8:06:40writing content, right? And Claude is

8:06:41the best content. And to connect your

8:06:43Claude account, press create a new

8:06:45credential, anthropic.console,

8:06:47and then you can go to get an API key.

8:06:50You can go to create an API key.

8:06:52Just name it whatever you want. You get

8:06:53a key, then you can then paste back

8:06:55here. Now, 3.5 Sonnet is one of the best

8:06:58for content. Let me actually search it

8:06:59up.

8:07:00Um which Claude model is best for

8:07:02content?

8:07:05I believe it's 3.5 Sonnet.

8:07:07I think so.

8:07:08Not Claude. It's Claude.

8:07:10Let's see. Claude.

8:07:12Showing you guys the full raw content uh

8:07:14because that's what it is.

8:07:16Claude's Opus 4. Okay.

8:07:20Claude Opus 4. Do we have that available

8:07:21to us?

8:07:23I don't think we do.

8:07:25Yeah, we don't have an API version. So,

8:07:27let's do

8:07:29API model.

8:07:32Cuz not all models are given to us for

8:07:34an API.

8:07:35Um Claude 4 generation, Opus 4, and

8:07:38Sonnet 4 are hybrid models.

8:07:40Opus 4 is the most scalable. Yeah, I

8:07:43think Sonnet 4. Right, Sonnet 4. Um it's

8:07:45designed for speed plus quality as well.

8:07:47And since we don't have four here, we're

8:07:48just going to use 3.5.

8:07:50And that's the thing that it uses as its

8:07:51brain because again, an AI agent usually

8:07:52has a brain, which in this case is the

8:07:54LLM, and then it has tools that it's

8:07:56connected to, which are in this case,

8:07:58Perplexity, the thing that it actually

8:07:59uses to take action. And if you want to

8:08:01build your first AI agent from scratch,

8:08:03check out this video up here.

8:08:05What we do here is we run this.

8:08:07What this will now do is it will go

8:08:08through each section one by one. So,

8:08:10four different items at the same time.

8:08:12Not at the same time, obviously,

8:08:13separately.

8:08:14And it does research on each one.

8:08:16And the reason why we're adding two

8:08:18different inputs is because the first

8:08:19input is

8:08:21the actual research that it does. And

8:08:24the second input is the description. All

8:08:26right, so now we've finished the actual

8:08:27research, and bear in mind that each

8:08:29section of the blog will be researched,

8:08:32right? And that's what this does. So,

8:08:33I'm going to pin this

8:08:35so we don't have [music] to rerun it

8:08:35again cuz it does take a while.

8:08:38Obviously, it got cut in the video, but

8:08:39I've been here for about 4 minutes

8:08:41waiting. Um

8:08:43and [music] now, with the merge node,

8:08:45what we do here is let me press execute

8:08:47step.

8:08:48This will now get the output of the

8:08:51research agent,

8:08:52but it will also get the title

8:08:55and the description. So, the merge node

8:08:57is usually combining,

8:08:59right? Two inputs

8:09:01because we have one and two,

8:09:03and we're putting them all together. So,

8:09:04you see how it went from here, here, and

8:09:06here to all three right here. And these

8:09:08are four different items, which means

8:09:09that it does it for every single section

8:09:11of the blog.

8:09:13All right. Now that we have this, we can

8:09:14then aggregate it because we don't want

8:09:16to send four items individually to the

8:09:18editor AI agent. We want to send all

8:09:20together, right? Cuz we have four items,

8:09:22let's put them all together.

8:09:24And as you can see by the diagram here,

8:09:25this node right here is to take all the

8:09:27different separate items and put them

8:09:29all together into one paragraph.

8:09:31Let me go here.

8:09:33Execute step.

8:09:35And here we get all the titles, and we

8:09:36get all the outputs. Because again, four

8:09:38items, four the four outputs in this

8:09:40case for the research agent. And that's

8:09:42why we put individual fields, the input

8:09:44field name will be title because it's

8:09:46title. Same thing with output, which is

8:09:48this one right here. And that's what it

8:09:49takes to merge the list. Again, merge

8:09:52list just means merge everything

8:09:53together like this.

8:09:55So, we're able to then feed it into the

8:09:57editor AI agent, which will be the thing

8:10:00to actually write the blog, right? To

8:10:02actually put everything together.

8:10:04Um it will be a tools agent. The prompt

8:10:05will be the list of titles and the list

8:10:07of article content, which we get from

8:10:09here and here.

8:10:11So, we're giving it Let me show you

8:10:12this.

8:10:13We give it this.

8:10:15A full user input.

8:10:17So, it's going to be a big prompt. Plus,

8:10:19we give it a system message as well.

8:10:21So, this system message will have an

8:10:22overview. So, you're an expert editor

8:10:24specializing in creating and finding

8:10:25content to output a high-quality

8:10:27formatted article. You're given a list

8:10:29of titles and outputs, and you will use

8:10:31these to create a newsletter tailored

8:10:32towards the defined target audience.

8:10:34Create a section in the article for each

8:10:36title with a hyperlink source in each

8:10:38section based on the content. So, when I

8:10:40was making this workflow or this AI

8:10:42agent,

8:10:43I thought of the fact that obviously you

8:10:44want to have insight What's it called?

8:10:46Hyperlink um yeah, hyperlink um

8:10:48citations. So, for example, when you go

8:10:50into the actual word, and then when you

8:10:52press that word, it goes directly to the

8:10:53source of that news. And that's exactly

8:10:55what this is.

8:10:57This is a fancy way, a HTML way of

8:10:59saying, "Hey,

8:11:00this is the URL that we're giving,

8:11:02and this is the name of the actual thing

8:11:04that when we press this, it takes us

8:11:05here." And so, that's what it is. And we

8:11:07have the objective as well to create

8:11:09content. Uh we have the citation

8:11:11management. We have the source section.

8:11:13We have the output format. We have a ton

8:11:14of stuff in this prompt right here. And

8:11:16then we want to output 1,000 word

8:11:17maximum, or else the automation breaks,

8:11:19right? Because there's a limit. Uh and

8:11:21today's date is this. Why do we give it

8:11:23today's date? It's because sometimes

8:11:25within the actual blog, it needs to sort

8:11:27of cite um it says tomorrow, right?

8:11:30Like, how does it know what today is? AI

8:11:32is not the best at this. So, that's why

8:11:33we give it the actual date.

8:11:35So, now with this prompt right here, I

8:11:36can press execute step. This will now

8:11:38give all of this and these uh this

8:11:42prompt right here to be able to give us

8:11:43a final optimized sort of blog that we

8:11:46can use to send ourselves an email. All

8:11:48right, so we have the output right here.

8:11:49You see here with all these lines and

8:11:52MPs and As and H2.

8:11:55This is called HTML. HTML is basically

8:11:58the way that we make our

8:12:00text look pretty. You know when you see

8:12:02emails, when you get emails with

8:12:03headings, you get with colors and

8:12:05beautiful things, that's all HTML,

8:12:07right? And so,

8:12:09we want to do that because

8:12:11of the fact that we want headings, we

8:12:12want a text [music] when you press on

8:12:14it, hyperlinked, right? When you press

8:12:15on it, it goes to the source, all that

8:12:17stuff to make it look pretty, and to

8:12:18make it look more formatted, we use

8:12:20HTML. And then we use another AI right

8:12:23here, which is an AI step. Again, same

8:12:25connection, message model 4 or mini,

8:12:27which is fine. And the prompt is

8:12:30create a title for the incoming

8:12:31newsletter. The tone of the newsletter

8:12:32is

8:12:34authoritative.

8:12:35The target audience is 50-year-old men.

8:12:38And here's your newsletter. So, we give

8:12:39it the full newsletter, and then we say,

8:12:41"Only output the title in plain uh in

8:12:43plain text, no quotation marks, and

8:12:45capitalize the first letter of each

8:12:47word. Example, is artificial

8:12:49intelligence a friend or foe?" So,

8:12:51basically, this is making the title for

8:12:53the newsletter, which you can then feed

8:12:55into the subject line of the email that

8:12:56we're making. I can press execute step.

8:12:59This now gives us the actual content,

8:13:01which is the title of the blog. Quantum

8:13:03computing and AI transforming the future

8:13:05of technology. And that's the thing that

8:13:07we would use

8:13:08to then be able Let me pin this. To send

8:13:10ourselves an email. So, in the email

8:13:11section, just connect your email, and go

8:13:14here and sign in with Google.

8:13:16Connect your account, bring it back, and

8:13:17you're all good. And then the thing that

8:13:18we are manipulating is message. The

8:13:21action that we're taking is we're

8:13:22sending. The email that we're sending it

8:13:24to, of course, is my personal email. The

8:13:25subject line in this case will be the

8:13:27title here.

8:13:28Right, it will be this right here,

8:13:29content. We bring it across

8:13:31here.

8:13:32And this is now the title that we use.

8:13:34And then the email type because again,

8:13:36Gmail gives us two options, whether you

8:13:38do text, whether you use HTML. Well, in

8:13:40this [music] case, because we wrote the

8:13:41email in HTML, then we get this, right?

8:13:44We get a full thing, which is the thing

8:13:46that you saw in my email. And then we

8:13:47want to turn the append and and

8:13:49attribution off, which just means that

8:13:51usually when you send yourself an email,

8:13:53at the end, it will say

8:13:55and it ends in this, or sent by Anydan,

8:13:57right? We want to take that off. And as

8:13:59well, we want the name of the actual

8:14:01person to be daily newsletter, which is

8:14:02why we add here sender name, daily

8:14:05newsletter.

8:14:07All right, we can just test this.

8:14:08Execute step.

8:14:10What this will now do is it will send us

8:14:11another email.

8:14:12We go here and refresh. Quantum

8:14:14computing and AI. And this is a newly

8:14:16written email

8:14:17with hyperlink text that I can go here

8:14:20and I can go to the actual source

8:14:22of the research, which is amazing.

8:14:25And has settings, has more research,

8:14:28and the citations are coming from

8:14:30credible citations, right?

8:14:32Which are great to have. And at the end,

8:14:34we have sources as well.

8:14:36Here.

8:14:37And now this you can use as a way to

8:14:39keep yourself updated, but also to post

8:14:41it on your You can say on WordPress or

8:14:44any of the sites that you make blogs in.

8:14:46Right? Because you have a ton of

8:14:46research, a ton of value that you can

8:14:48get because this workflow right here is

8:14:50a series of AI agents. And the reason

8:14:52why we do a series of AI agents is

8:14:54because when you break things down and

8:14:56you actually go in depth into each topic

8:14:58or each section, the quality is just

8:15:00much better. And so, as I mentioned

8:15:01before, you can have a form, which is

8:15:04the input, which is the thing that what

8:15:06what do we feed in to the actual system,

8:15:08but you can also have a Google Sheet

8:15:10that you can run through every single

8:15:11row. And you can then add a

8:15:14you can say

8:15:16on the schedule

8:15:17right here

8:15:19at the start, which runs maybe every

8:15:20day.

8:15:21Right? So, every day.

8:15:22And then it runs, and then it takes the

8:15:24topic from a Google Sheet, and then it

8:15:25runs through the whole system step by

8:15:27step. Now, within our agency, we've

8:15:28implemented these sort of systems,

8:15:30especially with blogs and content, into

8:15:32tons of businesses just because of the

8:15:34fact that businesses know they need to

8:15:36make content, yet they don't have the

8:15:37time. They use AI anyways, so might as

8:15:40well automate the whole process and save

8:15:42them a ton of time and make it actually

8:15:44valuable and and with actual research

8:15:46and with good prompting so they can

8:15:47actually get results. And so, these

8:15:49systems right here are are for them

8:15:51because it allows them to have such an

8:15:53efficient process to generate this

8:15:55content that can either be sent to our

8:15:57email, that can either be sent to a

8:15:58WordPress. WordPress is just a way that

8:16:00you host your website. You can have

8:16:02blogs on your website, blogs on

8:16:03LinkedIn, blogs on whatever platform you

8:16:06use,

8:16:06uh that is highly effective, highly

8:16:08researched, well researched, right? Cuz

8:16:10if it is well researched. And so the

8:16:11system is great because it saves the

8:16:13company tons of time into making

8:16:14content, and we know it's good because

8:16:16we have good prompting, which companies

8:16:18usually don't.

8:16:22Hey, in this video I'm going to show you

8:16:24step-by-step how you can build your own

8:16:26research AI agent inside of n8n. And the

8:16:29best part is that it actually takes less

8:16:30than 5 minutes to set up. So I'm going

8:16:32to show you exactly how it works, how

8:16:34you can set it up, and how you can use

8:16:35it within your automations. So if that

8:16:37sounds like something that you want to

8:16:38learn, let's dive in. All right, so

8:16:39fundamentally we have an input and we

8:16:41have an output. This is the same exact

8:16:42structure as a normal AI agent, and the

8:16:45input could be research XYZ. Then the AI

8:16:47agent has system prompt or instructions.

8:16:50System prompt just means what is the

8:16:51thing that we tell the AI agent to do.

8:16:53Um and it can be, "Hey, research this."

8:16:55Or if this happens, then call this or do

8:16:57something else.

8:16:58And [music] the output would be the

8:16:59actual research. Now between the input

8:17:01and the output,

8:17:02the AI agent, now it's hooked up to

8:17:04OpenAI, which is basically ChatGPT, and

8:17:07that's its brain. That's how it thinks.

8:17:09And then for its tools, cuz tools are

8:17:11like the things that the AI agent calls,

8:17:13that it sends the request to when it

8:17:15wants to get something back, on this

8:17:17case we're using Perplexity. Because

8:17:18Perplexity is the research LLM. LLM

8:17:21stands for large language model. It's

8:17:22like ChatGPT, Claude, they're all LLMs,

8:17:25and this right here is specifically done

8:17:26for research. So I can go to Perplexity

8:17:28here, and I can show you that this

8:17:30uh LLM is like ChatGPT, it looks like

8:17:33it, but it's known for research. So I

8:17:34can say, "Find the latest news on AI."

8:17:39What this will do is that it will get

8:17:40sources.

8:17:42It will start getting all the sources,

8:17:43and it's known for because it's really

8:17:45good at finding research.

8:17:46And it gives you the full breakdown of

8:17:48everything, even giving you all the

8:17:50sources that it used for that specific

8:17:52research, which is insane. Cuz it does

8:17:54research over 20, 30, 40 research papers

8:17:57all within seconds to give you an

8:17:58answer. Something that ChatGPT could do,

8:18:01but isn't meant or prompted to do. And

8:18:03so that's what we're going to use to

8:18:04connect to the AI agent in order to do

8:18:06the research. And again, we're doing it

8:18:07automatically, so we're using the API

8:18:09version, just like we're using the API

8:18:11version for OpenAI. So we're just

8:18:12creating an AI agent that is hooked up

8:18:14to Perplexity to do the research, and

8:18:16then we get the output.

8:18:17So if I go to n8n, I can go to n8n

8:18:19workflows. All right, so I'm currently

8:18:21in n8n. I can go to create a workflow.

8:18:24As you can see, we have two options. And

8:18:25if you want to watch the video of me

8:18:26building it with AI, check it up here.

8:18:29But we're going to press add first step.

8:18:31We can go to agent. Just press agent,

8:18:33and this is how you add an AI agent in

8:18:35n8n.

8:18:36So this is where we start configuring

8:18:37things. And so we're sending the chat

8:18:38here. This will then send a signal to

8:18:40the AI agent. If I go inside, I can see

8:18:42that the user message, which is what is

8:18:44the thing that's going inside the AI

8:18:45agent, it will be the chat input, which

8:18:48I'll show you exactly what it looks

8:18:49like. And then,

8:18:51after the user message, we can add an

8:18:53option, we can have a system message.

8:18:54The system message is the instructions,

8:18:58this part right here.

8:18:59And so that's what we add here. We can

8:19:00say, "You're helpful intelligent

8:19:01assistant that does research." I'm going

8:19:03to give it a better prompt later, but

8:19:05for now we can leave it this. And now,

8:19:07as we mentioned before, we have the chat

8:19:08model, which is what is the brain of

8:19:10this LLM. In this case, it can be

8:19:12OpenAI,

8:19:13which is the one right here. And I can

8:19:15connect OpenAI to my account. The way to

8:19:17do that is to go to platform.openai.com.

8:19:20I can go to dashboard. I can go to API

8:19:23keys. And the API key is sort of like a

8:19:25password that says to n8n, "Hey, you

8:19:27feel free to use my API key for my

8:19:29account in OpenAI." And top right,

8:19:31create a new secret key.

8:19:33And name it, so it can be n8n.

8:19:36You can create a new secret key. Leave

8:19:37everything as is, no restrictions.

8:19:40And now you have this key that you can

8:19:42paste within n8n and name it. I can name

8:19:45it Michele

8:19:4715th of October.

8:19:50I can save it.

8:19:51And now I have my account connected.

8:19:53Bear in mind that this is not free. So

8:19:54you have to go to here, to profile, to

8:19:58billing,

8:19:59and add money here. $5 is more than

8:20:01enough cuz it it's only taking 1/10 of a

8:20:04cent, right? So it's fine.

8:20:06All right, now that we have this done,

8:20:07we have this connected, we can choose

8:20:084.1 mini. This is basically the brain

8:20:11again, how it actually thinks. And now

8:20:13we can connect it to a tool. Now we also

8:20:15have a memory here, and the memory is

8:20:16usually used when we are using the AI

8:20:19agent sort of like a chatbot like this.

8:20:21We want it to remember the previous

8:20:22conversation or the previous answer or

8:20:24question that we gave it as context for

8:20:27the next steps. Well, in this case, uh

8:20:29we can add it. We go here, I can put

8:20:30simple memory. And we have context

8:20:32window length, which is how many past

8:20:34interactions does the model receive as

8:20:35context. We can leave five, that's fine.

8:20:37And now for the fun part, is Perplexity.

8:20:40So this is how we actually do the

8:20:41research. So I can go to Perplexity.

8:20:43You can go to Perplexity tool right

8:20:45here. We're just talking to the API of

8:20:46Perplexity and generating um responses

8:20:49with citations. I can go [music] in

8:20:51here, and we get introduced to this. Now

8:20:53you will not get introduced to this

8:20:54because you will not have an account.

8:20:55All you have to do is press create a new

8:20:57credential. And now you need an API key.

8:20:59So all you have to do is go to

8:21:01Perplexity.

8:21:02ai

8:21:03up here.

8:21:04And you want to make an account. Once

8:21:05you make an account, you can go down to

8:21:07account, you can go to API,

8:21:10and I believe that you have API keys on

8:21:14the left-hand side.

8:21:15Right here. You can accept terms and

8:21:17generate a key. I can do n8n research

8:21:20agent test. I can create a key.

8:21:23I can now copy it

8:21:25and paste it here.

8:21:27I can say Michele

8:21:2915th of October.

8:21:32Put it here. There you go. And press

8:21:33save. And now you should be able to see

8:21:35it here, and you have successfully

8:21:36connected n8n to Perplexity. But as we

8:21:39mentioned before, just like OpenAI, this

8:21:41is not free. So you have to go to API

8:21:43billing. You would have to buy credits.

8:21:45I think I put $5 on a few months ago,

8:21:48and I still have it. $4 in 2017. So it's

8:21:50very, very cheap. And once you have

8:21:52this, now you can actually use the API.

8:21:54For tool description, we can set

8:21:55automatically. Operation, which is what

8:21:57is the action that we're doing, is

8:21:58messaging a model.

8:22:00And you can do custom API call, but in

8:22:01this case, messaging a model just says,

8:22:03"Hey, I'm going to automatically go into

8:22:06Perplexity. I'm going to automatically

8:22:07type something and get an answer back."

8:22:10And now we have the different models.

8:22:12I'm going to go to Perplexity API models

8:22:15to see the difference each one. There

8:22:16you go, models.

8:22:18So here we have all the models, and we

8:22:20have the search models, which are

8:22:22inherently the models that you just use

8:22:24uh to retrieve information, just like a

8:22:27general searching model, which is the

8:22:28one that we're going to use. We have

8:22:29reasoning, so more for multi-step tasks

8:22:32and research.

8:22:34So this is really for conducting

8:22:35in-depth research. The only thing about

8:22:37this is that it does take a lot longer

8:22:38than uh something like Sonar or Sonar

8:22:40Pro. So we're just going to use Sonar in

8:22:42this case.

8:22:43I'm going to try both actually. Um let's

8:22:45start with Sonar, and then we can put it

8:22:47there. We can go inside, and now I can

8:22:48change the model to again Sonar. We can

8:22:50use Sonar Pro as well. And now we have

8:22:53the user prompt. So the user prompt is

8:22:55what is the thing that we're giving

8:22:56Perplexity, so this sort of the input,

8:22:59right, that it uses when it's doing the

8:23:01research. So in this case, if you press

8:23:02this button right here, what this will

8:23:03now do is it will let the model define

8:23:05its parameter. So the AI agent is smart

8:23:07enough so that it decides what goes into

8:23:09Perplexity for it to actually do the

8:23:11research for and then giving us the

8:23:12output. So I'm going to press this, and

8:23:15we can leave everything as is. All

8:23:16right, now we have this, I can test it.

8:23:18So I can go here, open chat, and I can

8:23:20say,

8:23:21"What is the latest news on why 95% of

8:23:23AI products fail?" I can press go.

8:23:26What it should now do is it will talk to

8:23:27the uh Perplexity tool, and it will talk

8:23:29back to the OpenAI to structure the

8:23:31output

8:23:33for us to get it back on the chat. So

8:23:35you can see we have the research here,

8:23:37which is in-depth research. So you can

8:23:38see it's pretty good research compared

8:23:39to something like ChatGPT. The key

8:23:41reasons why 95% of AI products fail,

8:23:43poor data quality, lack of business

8:23:45alignment, execution, cost, privacy,

8:23:47hype versus hard work. Uh and then the

8:23:495% of AI projects that succeed typically

8:23:52is XYZ. So we get a full report or full

8:23:54answer, researched, right, which is

8:23:56actually pretty good. This is the thing

8:23:57that Perplexity is giving us back,

8:23:59right, which is the responses. We can

8:24:01see the prompt tokens, uh the amount

8:24:03that it took us, so 0.006,

8:24:06which is very, very cost-effective. And

8:24:08then citations, so the citations that it

8:24:10uses.

8:24:11It actually goes to YouTube videos,

8:24:12which is interesting.

8:24:13Who is this?

8:24:15Let's see. The AI bubble, why 95% of AI

8:24:17products fail. 1.1 million. It's cool.

8:24:20Um and we have more search results,

8:24:23right, which you can then use as

8:24:26citations or as more evidence as well.

8:24:28And the content is what is the actual

8:24:29message back that it gives to the user

8:24:31with all the citations. You can see 2 4

8:24:337 obviously refers to

8:24:36um citation two, citation four, citation

8:24:38seven. So that's pretty much how you can

8:24:39set up an AI agent uh that can do

8:24:41research. Now I'm going to apply this to

8:24:42a business use case. So let's say we had

8:24:44a business which had a form on the

8:24:45website, which you're going to make. And

8:24:47the form on the website asked someone to

8:24:49add the website. Right? So they say,

8:24:51"Hey, what's your name? What's your

8:24:52email? What's your phone number? And

8:24:54what's your website?" Right? And so what

8:24:56this does is that it takes the details

8:24:57from someone filling out the form on the

8:24:58website, and then it uses Perplexity to

8:25:01do the research on that website before

8:25:03giving us an answer that we can add to

8:25:05our CRM. So let's build it.

8:25:07This right here is going to be

8:25:08um the same because it's pretty much

8:25:10standard. Uh I'm going to change the

8:25:12prompts a little bit, but apart from

8:25:14that it's fine. And I can do on form

8:25:15submission

8:25:16because we're making a form.

8:25:18And this will be the first step in this

8:25:19case. I can go inside, and I can put a

8:25:23name for the form, which is website

8:25:25form.

8:25:27By the way, don't worry about these.

8:25:28Test URL is just a URL that we use when

8:25:29you're testing. Production we use when

8:25:32we set the automation to active.

8:25:33Authentication is if you want to put a

8:25:35password, but we don't want to. Uh we

8:25:37have the title, and this is, "Please

8:25:38fill out the form with your details."

8:25:40Then we can add form element, which is

8:25:42saying, "Hey, what are the questions?"

8:25:43In this case, we can ask them actually

8:25:45full name. Yeah.

8:25:47And we can say company name.

8:25:50We can say

8:25:52uh company website,

8:25:54which is the thing that we'll actually

8:25:55use.

8:25:57I believe that it has

8:25:59date checkboxes? No. Oh, email only.

8:26:02Um that's it.

8:26:03Right? We can just ask three different

8:26:05questions. Of course, a company would

8:26:07probably want to know what is your

8:26:08budget, what are you looking to to do,

8:26:10and so on. But these are three simple

8:26:12questions. So, I can execute step, and I

8:26:14can say Michele Torti.

8:26:17Company name is JM Solutions.

8:26:19My website is jmsolutions.com.

8:26:22Submit.

8:26:23They should now send a signal here

8:26:25with the details that we can then use

8:26:26for the next steps. So, I can pin the

8:26:28information, which means that now I

8:26:30don't have to rerun it again every

8:26:31single time that I want to run the

8:26:33automation.

8:26:34And now, the only thing that goes into

8:26:36this is not the chat input, because

8:26:38we're not chatting to it anymore. What

8:26:40we're doing is we can define

8:26:42the user message below. And again, user

8:26:44message is the thing that we actually

8:26:45give to the AI agent every single time

8:26:47that is different. In this case, it will

8:26:49be

8:26:50the company website. And what we can do

8:26:52is actually

8:26:53do company website,

8:26:56company name, actually,

8:26:58and then company website.

8:27:02Company name.

8:27:04There we go here.

8:27:05Company name.

8:27:08And there you go. Company name and

8:27:09company website is the thing that goes

8:27:10into the AI agent

8:27:12for it to use when making research of

8:27:15that company. So, I'm going to say

8:27:17you are a helpful assistant that helps

8:27:19to do research on new companies that

8:27:23come through. You could say that, right?

8:27:24Assistant account Yeah, you can say

8:27:26that.

8:27:26Uh and then let's say uh for rules,

8:27:30so I'm going to say

8:27:31we are or actually the

8:27:34the research

8:27:35that we are looking for from the company

8:27:40should contain

8:27:41target audience, and let's do

8:27:45offer.

8:27:46So, we want to know the offer of the

8:27:48company and target audience. That's it.

8:27:51I believe this should work. Uh let's see

8:27:52if it doesn't. If it doesn't, we'll

8:27:53change the prompt.

8:27:54And now, this will be the same. Yeah,

8:27:57this will be the same. Let's test this

8:27:58out. Let's go

8:28:00here.

8:28:01Oh, actually no. Yeah, we can't use the

8:28:02simple memory because

8:28:04the simple memory only works when we're

8:28:06using a chat model. So, when we're

8:28:07chatting to it like a chatbot. But in

8:28:09this case, we're not doing it. So, we're

8:28:11just using um these two.

8:28:13And we press go.

8:28:15Execute workflow.

8:28:16You see how I didn't have to fill out

8:28:17the form every single time? Now it's

8:28:19doing research, and then at the end, it

8:28:21gives us JM Solutions targets SMBs

8:28:23looking to improve operational

8:28:24efficiency through innovative workflow

8:28:26automation solutions, XYZ. [music] Cool.

8:28:29Which now we can add to our CRM. So, I

8:28:31can just make a new Google Sheet. I can

8:28:32name it say CRM.

8:28:36New

8:28:38website

8:28:39leads.

8:28:40I can say company name, or full name.

8:28:44Oh, there we go. Full name.

8:28:46Company name.

8:28:48Let me zoom in so you can see here.

8:28:51We'll ask I can do company

8:28:54website

8:28:55and research. I can make this black,

8:28:59white, bold.

8:29:02And freeze up to row one. I'm going to

8:29:04do like this. I can still see it. Cool.

8:29:06And now I have to connect Google Sheets

8:29:07to Any Ten.

8:29:09And to do that, I can go here.

8:29:11I can press plus. I can go to Google

8:29:13Sheets.

8:29:14I can then append a row in a sheet.

8:29:16Append just means you're adding a row

8:29:18into a sheet.

8:29:20Connect your account by going here. Just

8:29:22press sign in with Google, which will

8:29:23take you to this page. You can press

8:29:24your account that you are connected

8:29:26with. And once you're connected, you can

8:29:27go to sheet within a document, append a

8:29:29row, because that is the action that

8:29:30we're taking. The document would be CRM

8:29:33new website leads.

8:29:34The sheet will be sheet one. Yep.

8:29:38And then, the values to send. So, this

8:29:40is saying, "Hey, what do we want to add

8:29:41here, here, here, and here every single

8:29:44time that it runs?"

8:29:46We like to add the full name, which you

8:29:47can get on the left-hand side

8:29:49on the form. It's the full name.

8:29:51Company name.

8:29:53Company website.

8:29:55Research.

8:29:57And something more that we want to add

8:29:59is submission date.

8:30:01So, submission

8:30:03date.

8:30:06Because we ideally want to know exactly

8:30:07what date and time they submitted the

8:30:09form. This now refreshes because it saw

8:30:11that I changed something within the

8:30:12sheet. I can then add submitted at right

8:30:15here. But the problem is that if I go

8:30:19if I press this to go full screen,

8:30:21this right here is very messy. And so,

8:30:23what I want to do here is actually

8:30:24format it so it's readable to a normal

8:30:26human who has no clue what T01, all of

8:30:29this stuff is.

8:30:30So, what I can do is I can go in here,

8:30:33and I can put dot

8:30:35to date format, I believe.

8:30:37And I can say, what is it? Format date?

8:30:41Format. Yeah, okay, cool.

8:30:44Let me go into the formatting guide so I

8:30:45can see how to make a date look normal.

8:30:49Got this horrible. Let me see here.

8:30:52August 6th, 2014.

8:30:54This will be DD.

8:30:56All I have to do here is just put DD.

8:31:00There we go. 16th of October, 2025. And

8:31:03this will be format that we add the date

8:31:05inside of the Google Sheet.

8:31:07So, now I can pin this data,

8:31:09which means that I don't have to rerun

8:31:10this again. I can just press go.

8:31:12What this should now do is she would

8:31:13send the information here to the Google

8:31:16Sheet. Michele, JM Solutions with the

8:31:18website, with the research, which

8:31:20is very long. Let me make this a bit

8:31:22bigger.

8:31:23Come on.

8:31:25Go here.

8:31:27She can then read about offer and who

8:31:29they're targeting, and submission date

8:31:30as well. So, you get to know exactly

8:31:32when they submitted the form. And there

8:31:34we there is a use case that you can use

8:31:35the research AI agent for to do research

8:31:38on someone when they come through from

8:31:39the website or some sort of input from

8:31:42somewhere else. And we built this type

8:31:43of system for a company before. Uh a bit

8:31:46more extensive, so a bit more stuff. Um

8:31:48but it did research on new leads that

8:31:50came through the website, and then it

8:31:52looked at their social media, it looked

8:31:53at their website, it looked at

8:31:54everything that they had to then give it

8:31:56to the sales reps right in their CRM

8:31:59before the sales reps actually called

8:32:01the lead, right? Because they had more

8:32:02information, they were more prepared um

8:32:04before actually going out and selling to

8:32:06customers.

8:32:10In this video, I'm going to show you

8:32:11exactly how I built a voice agent inside

8:32:13of Eleven Labs and connected it to Any

8:32:15Ten that allows us to be able to send

8:32:17emails, get contacts, [music]

8:32:19and schedule calendar events. All right.

8:32:21So, on the left-hand side, I have the

8:32:22voice agent in Eleven Labs. On the

8:32:24right-hand side, I have the AI agent in

8:32:25Any Ten. I'm going to press execute

8:32:27workflow, which is now waiting for the

8:32:29voice agent to send information to the

8:32:31AI agent. And I'm going to go and talk

8:32:33to the AI agent here. Hey, my man. How's

8:32:34it going? What's up, brother? Um can we

8:32:37schedule a calendar event for tomorrow

8:32:39at 5:00 p.m. with Michael James?

8:32:41And just say that it's for celebratory

8:32:45meeting. All righty, I'm setting up that

8:32:46celebratory meeting for you with Michael

8:32:48James for tomorrow at 5:00 p.m. Boom.

8:32:51Your celebratory meeting with Michael

8:32:52James is all set for tomorrow at 5:00

8:32:54p.m. Is there anything else I can help

8:32:56you with today, you magnif- That's it.

8:32:57Magnificent what? Magnif-

8:33:00There we go. So, we have a calendar

8:33:01here, and the name celebratory meeting

8:33:04scheduled for this email, which is

8:33:06Michael James, which you can find right

8:33:08here in our database

8:33:09with Michael James and this email as

8:33:11well.

8:33:12There we go. All right. So, we're going

8:33:13to go through the whole process step by

8:33:14step. The first step is actually going

8:33:16to Eleven Labs and seeing how we

8:33:18actually set this up. So, if I go here

8:33:20to the actual home page. So, when you

8:33:22make an account on Eleven Labs, you will

8:33:25have this dashboard right here. All you

8:33:27have to go is here, and you go to agent

8:33:29platform. So, typically you would be in

8:33:31the creative platform, which is for

8:33:32voices and so on. In this case, we want

8:33:34to go to agent platform.

8:33:36Want to press agent.

8:33:37New agent right here.

8:33:39When you press a new agent, you will

8:33:40come on this page right here, and this

8:33:42is where you start adding all the

8:33:43settings. So, the first message is what

8:33:45is the first thing that the AI voice

8:33:46agent will say. In this case, as you can

8:33:48see by or as you could have heard

8:33:51um by the voice agent, it said, "Hey, my

8:33:52man. How's it going?" And this is

8:33:53important because it's the first thing

8:33:55that the AI agent says.

8:33:56Then the system prompt in this case is

8:33:59this. So, so we said, "You are a

8:34:01friendly and funny personal assistant

8:34:02who loves helping the user with tasks in

8:34:04an upbeat and approachable way. Your

8:34:06role is to assist the user with sending

8:34:07emails and scheduling calendar events.

8:34:09When the user provides details like who

8:34:11the email is for and what it's about,

8:34:12you will pass the information to Any Ten

8:34:14tool and wait for its response. If the

8:34:16user tells you that you want to schedule

8:34:17a calendar event, then you will pass the

8:34:19information to the Any Ten tool and wait

8:34:20for its response. Once you get the

8:34:22confirmation from Any Ten that the email

8:34:23has been sent, cheerfully let the user

8:34:25know it's done, and ask if there's

8:34:27anything else you can help with." And I

8:34:28can also add

8:34:31something else here. Once you get

8:34:32confirmation from Any Ten that the event

8:34:35was created, cheerfully let the user

8:34:37know once it's done. [music]

8:34:39Now, basically the way this works is

8:34:40that we have the voice agent that we

8:34:42speak to, sort of like a person. And

8:34:43when we give information to the voice

8:34:45agent, what that does is that it sends

8:34:47information to our AI agent in Any Ten,

8:34:49sort of acting as a back end, to then do

8:34:52it the actual thing that we told it to

8:34:53do, and then send back a response right

8:34:56to the actual voice agent saying, "Hey,

8:34:57everything is good." It's sort of like

8:34:58you have the CEO who talks to the head

8:35:00of sales. The sales guy in this case

8:35:02does the action, then he goes back to

8:35:03the head of sales saying, "Yeah,

8:35:05everything was good." And then the head

8:35:06of sales talks to the CEO. Right? The

8:35:08CEO doesn't actually talk to the um the

8:35:11actual sales guy because there's a

8:35:12intermediate step. There's a step in

8:35:14between. And so, this is the exact same

8:35:16thing here. Between me and Any Ten, it's

8:35:19Eleven Labs. It's me talking to Eleven

8:35:21Labs, which then speaks [music] to the

8:35:22back end system, which is Any Ten. And

8:35:24so, what we have here, again, is a

8:35:26prompt.

8:35:27Dynamic variables, leave this blank.

8:35:29LLM, I use Gemini 2.5 flash cuz it's

8:35:31pretty cheap plus fast. Uh the backup

8:35:34LLM configuration, leave this default.

8:35:36You can leave this as default. The

8:35:38thinking budget is fine right here. We

8:35:40We need to control any internal

8:35:41reasoning tokens. The temperature right

8:35:43here is basically controlling how

8:35:45creative do you want the AI agent to be.

8:35:47The higher the temperature, the more

8:35:49creative it is. The lower the

8:35:50temperature, which means it's

8:35:51deterministic, so we can determine

8:35:53exactly what it's going to say. It's

8:35:55less temperature. Now, for voice agent,

8:35:57you want to be careful with this. You

8:35:58want to make sure that it's not too

8:36:00creative because then it goes outside of

8:36:02the instructions that we give it, but

8:36:04you also want to make sure that it's not

8:36:06too deterministic, which means that it's

8:36:07not too fixed into the instructions

8:36:09because then we'll have the problem that

8:36:11it starts sounding like a robot. Limit

8:36:13token usage, and so we're basically

8:36:14predicting or we're limiting the amount

8:36:16of money, the amount of tokens, which

8:36:18equals to money, credits,

8:36:20that we're using for the LLM. LLM just

8:36:22stands for large language model. It's

8:36:24like ChatGPT, Claude, Gemini, Grok. All

8:36:27these are LLMs. Then you can also add a

8:36:29agent knowledge base in case you want to

8:36:31add documents that you want the AI

8:36:33agent, in this case the voice agent, to

8:36:35have access to when giving you back the

8:36:37answer, which is great. And now for the

8:36:39thing that we really care about is the

8:36:41tools, custom tools. So this is how we

8:36:43connect custom tools to Anytown or how

8:36:47we connect voice agent to Anytown. So if

8:36:49you can just press add a tool, you will

8:36:51get to this page right here. You have to

8:36:53put a name, in this case you can just

8:36:54put Anytown, and the description is use

8:36:56this tool to take action upon the user's

8:36:57request. And then the first thing we're

8:36:59doing is adding a webhook. Now for those

8:37:01of you who don't know what a webhook is,

8:37:03a webhook is a URL, which in this case

8:37:05looks like this, which in Anytown the

8:37:07way to set it up is go here,

8:37:10add a trigger, and then a webhook call.

8:37:13So on the webhook call right here.

8:37:15And now this is the thing that is used

8:37:17when we want to receive a signal. So

8:37:18from the voice agent, we say, "Hey, can

8:37:20you do this for me?"

8:37:21It sends all the signal to the

8:37:24automation to actually do it, and that's

8:37:26what a webhook is used for. Make sure

8:37:27that it's post because

8:37:30post is the way that we send

8:37:31information, get is the way that we get

8:37:33information. By get, I mean get here.

8:37:35Now I've made a full video showing you

8:37:36exactly webhooks, HTTP APIs, all that

8:37:39good stuff. You can check it out up

8:37:41here, but that's what we use to send

8:37:42information to the actual AI agent

8:37:44inside of Anytown. Response timeout is

8:37:46how long to wait for the client tool to

8:37:48respond before timing out. The default

8:37:50is 20 seconds. This is great in case

8:37:52your actual workflow, your AI agent

8:37:55inside of Anytown, has an error and it

8:37:57doesn't actually send back the

8:37:59information. And so we're just putting

8:38:01some precaution saying, "Hey, if it

8:38:02doesn't send back the information, just

8:38:04let the user know." Leave this all as

8:38:06is. Leave headers the same, path

8:38:08parameters the same, query parameters

8:38:09the same. And finally we have body

8:38:11parameters. So body parameters are the

8:38:13thing that we say, the instructions or

8:38:15the variables that we send [music] to

8:38:17Anytown's AI agent for it to actually

8:38:19take action. So in this case there are

8:38:21three things that we have to send over.

8:38:23As you can see by the description, I

8:38:24said, "Ask the user to provide the name

8:38:26of the email recipient and what the

8:38:28email is about unless they already

8:38:30provided the information. And ask them

8:38:32for the calendar event date and time if

8:38:35they're looking to schedule an event."

8:38:36Now in terms of properties, we have to

8:38:38send different variables to the actual

8:38:40workflow. Why? As you can see here, if I

8:38:43go inside the webhook, which is the

8:38:45thing that we use again to send the

8:38:46data. Once we said, "Hey, I want to

8:38:47schedule a calendar event with Michael

8:38:49James, call it celebratory dinner at

8:38:515:00 p.m." What it did is that it sent

8:38:54the body parameters. So who are we doing

8:38:57the thing for?

8:38:58What is the event description? And what

8:39:00is the calendar event time?

8:39:02And so these variables are crucial in

8:39:04making sure that the AI agent in Anytown

8:39:07understands what it is that we want to

8:39:09do, and as well

8:39:11who are we doing it for or what other

8:39:12variables need to be taken into account

8:39:15when actually doing the actual thing.

8:39:17And so [music] in Eleven Labs, we want

8:39:18to start adding properties. So the first

8:39:20property is two, which is who the email

8:39:22is going to or who to schedule the event

8:39:24with or for.

8:39:27For you. And make this required because

8:39:28we're going to need this either way.

8:39:30And leave this [snorts] as LLM prompt

8:39:32because we're leaving AI to decide this

8:39:34variable right here.

8:39:35The second one is email content, so what

8:39:37the email is about. I made sure that

8:39:39this is not required just because

8:39:40sometimes we want to schedule a calendar

8:39:42event and we don't need to send the

8:39:44email content. So this is not required.

8:39:46Leave this as LLM prompt because it

8:39:48allows us to let AI define this. As

8:39:50well, I didn't mention this, but string,

8:39:52which just means text, right? In this

8:39:54case you can do integer, number, object

8:39:56array. We just want to keep it simple.

8:39:58This is literally just text that's going

8:40:00into the webhook, so leave this as is.

8:40:02This is the name of the event for the

8:40:03calendar. Now that I'm thinking of it,

8:40:05this doesn't have to be required because

8:40:07sometimes we just want to send an email.

8:40:09We don't want to schedule a calendar

8:40:11event. And finally, calendar event time,

8:40:14which is what the event time and date is

8:40:16at, which is not required, which is used

8:40:18when we want to schedule a calendar

8:40:20event. And leave the last thing as this.

8:40:22So there we there is just setting up the

8:40:23tool, which is all we really need in

8:40:25order to connect Eleven Labs to Anytown.

8:40:27Now once we have this, let's go to

8:40:29Anytown and see exactly how it looks. So

8:40:30this right here is the AI agent that

8:40:32we're using. In case it's your first

8:40:34time looking at the AI agent inside of

8:40:35Anytown, stop this video, watch this

8:40:38video up here where I show you the AI

8:40:39agent fundamentals. Trust me, it will

8:40:41make much more sense once you watch that

8:40:43video.

8:40:44Um but essentially an AI agent is

8:40:45consisted of an input and an output. In

8:40:47this case the input can be who are we

8:40:49sending the email to or who are we

8:40:51scheduling the calendar event uh for.

8:40:53Then we have the event description, we

8:40:55have the email content, or we have all

8:40:57the different variables that I spoke to

8:40:58you about based on what the user wants

8:41:00to do. Then we have the output, which is

8:41:03a message that is sent back to the voice

8:41:04agent saying, "Yeah, everything was

8:41:06good." Then we have the AI agent in the

8:41:08middle, which is the thing that actually

8:41:10takes action, right? Then we have the

8:41:12brain, which in this case it's OpenAI.

8:41:14It's the way it actually thinks. And

8:41:16then we have the different tools, which

8:41:17is what are the softwares that are

8:41:18connected to the AI agent for it to

8:41:21actually do the thing that it needs to

8:41:22do. So the first thing is a webhook.

8:41:25We want to make sure that this is post

8:41:26because that's the method that we use on

8:41:28the Eleven Labs. And when you get the

8:41:29data here, you will see a ton of

8:41:31variables. Honestly, I have no clue what

8:41:32any of them are,

8:41:34but the only thing that you really have

8:41:35to care about is the body. So the body

8:41:38is the actual variables that we get from

8:41:41the voice agent for us to use when we

8:41:42want to actually take action on whatever

8:41:44it is. And so we get in this case to

8:41:47Michael James, event description

8:41:49celebratory meeting, and calendar event

8:41:51time tomorrow at 5:00 p.m. [music]

8:41:53And that's all you need to then send to

8:41:55the AI agent

8:41:57with a user prompt, which is usually a

8:41:58message that we give to the AI agent

8:42:00that changes every single time cuz in

8:42:02this case we have the prompt user

8:42:03message and we have the system message.

8:42:05The system message is more so for

8:42:06instructions. So we say, "Hey, here's

8:42:09who you are. Here's the instructions.

8:42:10Just follow this."

8:42:11>> [music]

8:42:11>> And then here is where we give the

8:42:13variables that change every single time.

8:42:15Now as you can see, this is code right

8:42:16here, but what this means is

8:42:19the person details, so who are we

8:42:21sending the email to, which we get from

8:42:22here. All right, make this smaller.

8:42:25Two. If I drag this across,

8:42:28I can see that it's JSON.body.two.

8:42:30Email content is not something that

8:42:32always shows up depending on what the

8:42:33user wants to do.

8:42:35And calendar event time and event

8:42:36description is something that we add

8:42:38here.

8:42:39Event title and uh calendar event time

8:42:42as well. And so we drag these variables

8:42:43across right here. And again, if you

8:42:46want to add this right here, you would

8:42:47have to run the voice agent and tell it,

8:42:49"Hey, can you send an email?" And that

8:42:51will send an email here, and it will

8:42:52give you this variable because this

8:42:54variable is only available when you want

8:42:55to send an email. And that's it for the

8:42:57user prompt. So very very easy. We just

8:42:58give it the variables, and now we get on

8:43:00to the system message, which is the

8:43:01instructions. Now if you get the full

8:43:03blueprint for free, you will be able to

8:43:05have the whole prompt, so don't worry.

8:43:06Um or else take a screenshot of this and

8:43:08then put it through ChatGPT and tell it

8:43:10to extract the text from the image. But

8:43:12what we're doing here is we're using the

8:43:14typical prompt format, which is

8:43:15overview. So you're a friendly, witty

8:43:18personal assistant who helps users send

8:43:19emails, get contacts, and schedule

8:43:21meetings, XYZ.

8:43:23Then we give the tools. So the tool name

8:43:25plus the description. It sends an email

8:43:27only when instructed or when email

8:43:28content is provided. So when the

8:43:30variable email content is given. And

8:43:32then schedule calendar event and so on.

8:43:34And then instructions, the rule, and

8:43:35finally current date and time. Now the

8:43:37reason why we give the AI current date

8:43:39and time is because AI isn't the best at

8:43:42guessing or knowing the date and time of

8:43:44today. So with this prompt, we're then

8:43:46able to take action, right? And the next

8:43:48step we have to do is connect our AI

8:43:50agent to the brain, which is in this

8:43:52case is OpenAI. And to connect OpenAI,

8:43:55you have to go to platform.openai.com.

8:43:58Log in, make an account, and then go to

8:44:00dashboard. You can go to API keys,

8:44:03go to create a new secret key,

8:44:05name it, get the key, and then bring it

8:44:07back to Anytown right here,

8:44:09which is basically a password that says,

8:44:11"Hey, you can use my OpenAI account."

8:44:13And then you press save. Now leave this

8:44:15as GPT-4.1 Mini is more than good for

8:44:19what we want to do.

8:44:20And then we have the tools. So we

8:44:22connected this to three different tools.

8:44:23The first tool is Google Sheets to get

8:44:25contacts, which is this right here. Then

8:44:27we have Google Calendar right here to

8:44:29schedule calendar events, which is this

8:44:31right here. And finally, we want to send

8:44:32emails to our Gmail, which is this right

8:44:34here. And so the theory behind this is

8:44:36that if you noticed, I didn't actually

8:44:38give the voice agent an email. I just

8:44:41gave it a name. And so that's why we

8:44:43have the step of retrieving the contact

8:44:46email from the Google Sheets here.

8:44:49We have the name, and then we have the

8:44:51email. So if I said to the voice agent,

8:44:52"Hey, can you send an email to Michael

8:44:54James?" I instructed the AI agent to

8:44:57know that it has to look at here first

8:44:59to be able to get the email to then take

8:45:00the action, right? And so it will go

8:45:02here. It will say Michael James. Michael

8:45:04James has this email, and this is the

8:45:06email that we're going to use to be able

8:45:08to schedule the calendar event or send

8:45:09the email to the actual person. And so

8:45:11we go in here. To connect your Google

8:45:13Sheets, all you have to do is create a

8:45:14new credential, sign in with Google. It

8:45:16will take you to the standard

8:45:18um login with Google page. Once you

8:45:20connected your account, make sure to

8:45:21have sheet within document. You want to

8:45:23get rows, which is the action that we're

8:45:25taking. Again, get rows just means get

8:45:27all the rows from the actual Google

8:45:28Sheet,

8:45:29which is that one right here as I

8:45:31mentioned. So it gets all of them, and

8:45:33then it decides who is who. Then you

8:45:35want to choose the exact Google Sheet,

8:45:37uh contacts database USB, and then the

8:45:39sheet within the Google Sheet will be

8:45:41sheet one. And finally, that's when you

8:45:43get the actual output, which is row

8:45:44number two, the name is Michael James,

8:45:47the name is John Laurie, James Low,

8:45:48James Arthur, with the emails as well.

8:45:50And based on what the user added as a um

8:45:53sort of input, it will then choose the

8:45:55corresponding email.

8:45:56So, if it's Michael James, it will

8:45:57choose this. If it's John Laurie, it

8:45:59will choose this. If it's James Low,

8:46:01this. James Arthur, this. And that's for

8:46:03the first tool. Then we have schedule

8:46:04calendar event. Again, same exact

8:46:06concept. Go here, sign in with Google,

8:46:08so you can connect your calendar. Tool

8:46:10description, set automatically. The

8:46:11resource, which is what is the thing

8:46:13that we're manipulating. In this case,

8:46:14it will be the event. The operation,

8:46:17which is what is the action that we're

8:46:18taking. We're creating an event. The

8:46:20calendar will be my calendar. And then

8:46:22start and end, we can simply just press

8:46:24these two buttons,

8:46:25>> [music]

8:46:26>> which basically means that we're letting

8:46:27the model, we're letting AI define these

8:46:29two parameters. We want to turn this on

8:46:31so that we don't have to do it manually,

8:46:33which is the beauty of AI agents. Then

8:46:34we have two different fields that we

8:46:36want to fill out. The first one is

8:46:37attendees, which you can find here,

8:46:39attendees.

8:46:40And then you simply do the same thing

8:46:41here, which is just pressing the AI,

8:46:44which in this case, the model itself

8:46:46will send the attendee email over, right

8:46:48here. And then the summary, you can pull

8:46:50from the Where is it? Event description.

8:46:53Over here.

8:46:55And that will be the title of the actual

8:46:56meeting. And that's how we get the

8:46:57calendar event to look like this, where

8:46:59we have the title, and it sends it to

8:47:01the right person. And then finally, we

8:47:03have the send email. So, if I go here,

8:47:05same exact concept. Just go here, sign

8:47:07in with Google. Set automatically. The

8:47:09resource that we are manipulating will

8:47:11be message. The action that we're taking

8:47:12is we're sending a message. The

8:47:13beautiful thing about Anythink AI agents

8:47:15to set up tools is that we literally

8:47:17just have to press

8:47:19three buttons, and that's it. So, we're

8:47:21letting AI define who are we sending the

8:47:23email to, what is the subject line, and

8:47:25what is the message. And what we could

8:47:26do here as well is turn this off, append

8:47:28Anythink attribution, so that the end of

8:47:30the email, it doesn't say this was sent

8:47:31by Anythink. And finally, we use a

8:47:33respond to webhook node, which responds

8:47:37with the first incoming item, which is

8:47:38this right here. The celebratory meeting

8:47:40with Michael James has been scheduled

8:47:41for tomorrow. If you need me to send any

8:47:43emails or add more details, then let me

8:47:45know. And that will be the thing that's

8:47:47sent to the actual voice agent in Eleven

8:47:48Labs. So, think of this as a boomerang,

8:47:51right? We have the voice agent here.

8:47:53It then goes here, and then it brings it

8:47:54back to the voice agent. Right? Sort of

8:47:56like again, we're talking to an

8:47:57employee, to head of department,

8:47:59employee, back to the head of

8:48:00department, to the CEO. All right, so

8:48:02I'm going to test this again. And in

8:48:04this case, let's do sending an email.

8:48:05And we can send the email to James

8:48:07Arthur. So, right here, I can call the

8:48:09AI agent.

8:48:10Hey, my man. How's it going?

8:48:12What's up, brother?

8:48:13Uh can you send an email to James

8:48:16Arthur, and can you say that we are

8:48:19disappointed in your work? You should

8:48:21have done better in yesterday's meeting,

8:48:23and that you're almost about to get

8:48:25fired.

8:48:25>> All right, I am sending that email to

8:48:27James Arthur right away. Hold there. I

8:48:29found a James Arthur with the email

8:48:30mish.alcal5@gmail.com.

8:48:32Should I send it to that address? Also,

8:48:34that message is a bit strong. Would you

8:48:36like me to help you rephrase it a little

8:48:38more gently? Nah, you're good. Just send

8:48:40that email over. Understood. Sending

8:48:41that email now, no holds barred. Oopsie.

8:48:44Yeah, it seems like there was a little

8:48:45hiccup, and I couldn't send that email.

8:48:47Don't worry, it's not you. It's probably

8:48:49just a

8:48:49glitch with my system.

8:48:51Can you try Can you try again? I'm on

8:48:53it. Let's try sending that email one

8:48:54more time. Dread. Seems like I'm still

8:48:57having a bit of trouble sending that

8:48:58email. Okay, so there was trouble

8:48:59sending the email. Let's see why.

8:49:02I thought it was because it needed to

8:49:04confirm.

8:49:05But in this case, let's just go inside

8:49:07here,

8:49:08and we actually did get the email

8:49:10content. So, that's weird. So, I think

8:49:12that is within the prompt itself. Uh

8:49:14send an email only when instructed or

8:49:16when email content is provided. Mm,

8:49:18interesting.

8:49:19So, in this case,

8:49:21what I would do it I would just test it

8:49:23again, and [music] it might have been a

8:49:25hiccup on the Eleven Labs side. And by

8:49:27the way, when you go live, you don't

8:49:28have to execute a workflow every single

8:49:30time. Just for testing purposes, we do,

8:49:33which is why when he was trying again,

8:49:35he said there was a hiccup because I had

8:49:36to rerun this again, and I didn't give

8:49:38enough time for me to press run and it

8:49:40actually sending the information. Uh so,

8:49:42let's test the AI agent again. Hey, my

8:49:44man. How's it going? Yo, can you send an

8:49:46email to Michael James saying that we

8:49:48have dinner tomorrow at 5:00 p.m., uh

8:49:50and just send it through. All right, I'm

8:49:52sending that email right away. Oops, it

8:49:54looks [clears throat] like I need a

8:49:55little more information to send that

8:49:56email to Michael James. Seems I didn't

8:49:58get the full email content or a clear

8:50:00event title. Could you please tell me

8:50:02exactly what you'd like the email to

8:50:03say? And if you want me to schedule this

8:50:06as a calendar event, what should the

8:50:07event be called?

8:50:08>> Mm.

8:50:09Uh just just name the email um the

8:50:12email's about just having dinner

8:50:13tomorrow, and it's to Michael James, and

8:50:16no, we don't have to schedule any

8:50:17calendar event. Got it. Just the email

8:50:19then. Sending [music] it off to Michael

8:50:21James now. Oh, no, it seems like there

8:50:22was a little hiccup. The email didn't go

8:50:24through. My apologies, it looks like I'm

8:50:26having some trouble connecting right

8:50:28now. Could you perhaps try again in a

8:50:30little bit, or is there something else I

8:50:31can help you with in the meantime? Yeah,

8:50:33try again. Try again. You got it. Let's

8:50:36get that email another shot for Michael

8:50:37James. Oh, shucks. Seems like I'm still

8:50:40getting a bit confused.

8:50:41>> All right, so I think it's because I

8:50:42don't have the variable here, which is

8:50:43called email content. So, I'm going to

8:50:45add this there and try again. Hey, my

8:50:46man. How's it going?

8:50:48Yo, can you send an email to Michael

8:50:50James saying that we have a meeting

8:50:51tomorrow at 5:00 p.m.? All right, I'm

8:50:53sending that email for you. Consider it

8:50:55done. I've sent your email to Michael

8:50:57James with the message about the meeting

8:50:59tomorrow at 5:00. Is there anything else

8:51:01Great. So, we know why now. If I go to

8:51:03my email, I can see that we have the

8:51:06meeting reminder at 5:00 p.m. from James

8:51:09Solutions, which is the email that I

8:51:10connected to Anythink. Now, to explain

8:51:12the problem that I just got, cuz you're

8:51:13going to have a similar problem as well,

8:51:16uh is

8:51:17>> [music]

8:51:17>> that inside the prompt, I actually told

8:51:20in the rules that you should only send

8:51:22an email

8:51:23if you actually receive a variable

8:51:26called email content. But here,

8:51:29I actually had this deleted, and I

8:51:31didn't have the name for the email

8:51:32content. It was just the actual email

8:51:33content. And so, by adding the name, it

8:51:36then recognizes that we got this

8:51:37variable, which means that now it's

8:51:39allowed to send an email. So, that right

8:51:41there is how you can make a voice agent

8:51:42inside of Eleven Labs and connect it to

8:51:44our AI agent inside of Anythink.

8:51:49In this video, I'm going to show you how

8:51:50I built a trading analyst [music]

8:51:52AI agent inside of Anythink. You can

8:51:54chat with it on Telegram and ask it to

8:51:56check any stock. [music] It'll find the

8:51:58chart, study it with AI, and tell you

8:52:00exactly what it sees, like [music] if

8:52:01it's going up or down, and how strong it

8:52:03looks. It can even compare two stocks

8:52:06and tell you which one looks better. All

8:52:07right, so the AI agent is divided into

8:52:09two different parts. We have the AI

8:52:10agent here, and then we have the tool

8:52:12that we call, which is the next

8:52:14workflow, which is this one right here,

8:52:15which is made to then get this sort of

8:52:17chart, analyze it with AI, and give us

8:52:19the answer back. All right, so I just

8:52:20turned this on, so it's now waiting for

8:52:21a message. I can say,

8:52:23can you

8:52:24analyze Microsoft?

8:52:29And then go. What this will now do is it

8:52:30will talk to the AI agent, which again

8:52:32is prompted with instructions. It then

8:52:34starts calling the tool right here,

8:52:36which is this right here. So, if I go

8:52:37here to executions, I can see down that

8:52:39this is running. So, there's a current

8:52:41workflow running, which means that it's

8:52:43giving us the answer, and it's getting

8:52:44it back. And then it's going to be able

8:52:48to then give us the whole analysis back

8:52:49on Telegram. And now it's going to give

8:52:51us the actual analysis over here. So,

8:52:54overall trend, recent price and action,

8:52:56support and resistance levels, MACD,

8:52:59which in case you don't know, I also

8:53:01don't know, and volume analysis, overall

8:53:04market sentiment. So, basically a full

8:53:05breakdown of the stock because traders

8:53:07go look at this pretty much every single

8:53:09day, right? They look at this, they look

8:53:10if it's going up or down. And so, this

8:53:12AI will do that for you, saving you the

8:53:13time of doing it yourself. And one more

8:53:15thing that it can do as well is it can

8:53:16compare two different stocks. So, I can

8:53:18say here,

8:53:19can you now compare Apple with

8:53:21Microsoft? And I can go

8:53:23>> [music]

8:53:23>> play.

8:53:24What this will now do is it will send it

8:53:25again to the actual tool, but the only

8:53:27difference now is that it will do it

8:53:29twice. So, it will send the first item,

8:53:31which in this case will be either

8:53:33Microsoft or Apple, and then [music]

8:53:35analyzes Microsoft, it will get the

8:53:36graph, then will get the graph of Apple,

8:53:38and then it will give us the full

8:53:39analysis of both stocks together. As you

8:53:41[music] can see, it was smart enough to

8:53:42know that it already sent us the graph

8:53:44for Microsoft. So, what it did is it

8:53:45sent us the graph for Apple right here,

8:53:47and it then

8:53:49gave us the actual

8:53:50>> [music]

8:53:50>> analysis of overall trend, recent price,

8:53:52MACD, volume analysis, support and

8:53:54resistance, and current market

8:53:55positioning for both Apple and

8:53:57Microsoft. So, now you're able to

8:53:59actually compare each one individually

8:54:01in all the different uh categories right

8:54:03here, which are about six. And we have

8:54:04[music] the key takeaways as well. And

8:54:06to me, this is insane cuz now we're able

8:54:08to analyze stocks individually, but also

8:54:10compare them and have AI do the whole

8:54:12thing for us. With that said, let's go

8:54:13through step by step exactly how it

8:54:15works and how we set it up. So, this

8:54:17right here is a typical structure of an

8:54:19AI agent, right? We have the input, we

8:54:21have the output. Now, in this case, the

8:54:22input will be Telegram. So, the first

8:54:24step is actually [music] connecting our

8:54:25Telegram account. You can do this by

8:54:27going here, press this button, let AI

8:54:29tell you step by step what you have to

8:54:30do. It's a longer process than than I

8:54:32would explain in just 2 minutes. And as

8:54:34you can see right here, this is the

8:54:35output, right? And the output in this

8:54:37case is update ID, message ID, from ID

8:54:40is bot first name, language, all these

8:54:42things. We don't really have to know.

8:54:43The only two variables that we really

8:54:45care about is chat ID because this

8:54:48allows us to actually send back a

8:54:50message in the same thread. It's sort of

8:54:52like you're having a conversation with,

8:54:53let's say, your friend. You don't want

8:54:55to be sending a reply to another guy,

8:54:57right? You want to be sending the reply

8:54:58to the same exact conversation. And so,

8:55:00this right here is the conversation.

8:55:01It's just numbered. And then we have the

8:55:03text. So, the text right here is the

8:55:05actual text, right? It's the actual text

8:55:06of what we ask the AI agent to do, and

8:55:09that's what it will use to then send to

8:55:11the AI agent, which is instructed It's

8:55:13prompted to do different things uh to

8:55:14then take action. We connect the input

8:55:16to an AI agent, which has a prompt

8:55:18inside, so I'll go through that in just

8:55:19a second. But the AI agent in this case

8:55:21is connected to a brain, which in this

8:55:22case, it's Claude. And to connect your

8:55:24Claude account, you have to go here, go

8:55:26to anthropic.console,

8:55:28log in.

8:55:31Go here, create a key.

8:55:33Put a name for it, so let's do any 10.

8:55:36Add.

8:55:37And then you will get this key [music]

8:55:38that you will then paste to go back

8:55:39here. Then choose the model. In this

8:55:41case, we have different models. Claude

8:55:433.5 Sonnet is fine. We usually look for

8:55:46quality plus speed, but for something

8:55:48like this, I think quality is more

8:55:49important than speed because it is quite

8:55:51a technical short topic, so we want to

8:55:53make sure that it actually is good. Then

8:55:54we have the memory, so connect this

8:55:56right here, memory.

8:55:58Which in this case is just a simple

8:55:59memory tool, which is any 10's memory

8:56:01tool, and we give it the context window

8:56:03of five. Now, what this means is that it

8:56:05takes the previous five conversations or

8:56:07the previous five messages sent by me.

8:56:10Which is great because, like you saw, I

8:56:12told it, "Hey, now compare Apple with

8:56:13Microsoft." So, it remembered already

8:56:15that we already analyzed Microsoft. So,

8:56:17what it has to do now is just analyze

8:56:19Apple. And it's all because we have this

8:56:21exact memory [music] tool. And one more

8:56:23thing that we add here is a chat ID.

8:56:25This is so that it remembers the actual

8:56:27chat that we're having with the AI And

8:56:30then finally, we have a tool. Now,

8:56:31before I get to the tool, let's go

8:56:32through the prompt inside here. It will

8:56:34be a tools agent because we're using

8:56:35tools, defined below, which is a user

8:56:37prompt, which is what is the thing that

8:56:39we're telling the AI agent to do, which

8:56:40in this case, like I mentioned, is the

8:56:42text.

8:56:43Right here.

8:56:44So, we drag this across.

8:56:47And then we have the system message. So,

8:56:48if I go here, this prompt is quite

8:56:50extensive as in it's pretty detailed.

8:56:52And by the way, if you want a full

8:56:53blueprint, I'll show you at the end how

8:56:55you can get it. And right here, we're

8:56:56not doing any rocket science. We're

8:56:57using the exact same prompt structure

8:56:59that I mentioned in my video up here,

8:57:01which is prompting AI agents. And that

8:57:03is using an overview, so you are a AI

8:57:05agent specializing in XYZ, giving it an

8:57:07identity. Then we have context, so

8:57:09things that it needs to know, and then

8:57:11instructions because it's important for

8:57:13it to know exactly step-by-step what to

8:57:14do.

8:57:15Then we have tools. So, tools is very

8:57:17important because then it knows what to

8:57:19call, what action to take based on what

8:57:21we tell it to do.

8:57:23Then we have examples, which is the

8:57:24assistant prompt, which means that we

8:57:26give it a few examples, so it has some

8:57:28context when it actually does the thing.

8:57:30And in this case, we give it three

8:57:31examples. And then finally, SOPs, which

8:57:34is pretty much the same as instructions.

8:57:37And then final notes, which are some

8:57:38final things, final rules to give it.

8:57:40And so, in this prompt, what we

8:57:41basically say is, "Look, the user is

8:57:43going to ask you for stock to analyze.

8:57:45What you have to do is just call this

8:57:47tool when you want to analyze any

8:57:50stock." And so, this tool right here,

8:57:51what it is, it's connecting or it's

8:57:53calling a different workflow inside of

8:57:56any 10, which is the one right here,

8:57:57which I'll go in it in just a second.

8:57:59And so, this isn't a typical AI agent

8:58:01where you just connect a software

8:58:03directly here and it takes action on the

8:58:05same workflow. This is an AI agent that

8:58:07calls a different workflow and then gets

8:58:08a response back, just like a boomerang.

8:58:10Now, if I go inside here, the only thing

8:58:12we have to do is name it, so get chart.

8:58:14And the reason why we added get chart on

8:58:16the prompt is so that it knows that this

8:58:18is the get chart tool. And now that I

8:58:20think of it, I think I [music] called it

8:58:22I think I added a space in the prompt.

8:58:24So, let me go here and edit it. Uh

8:58:28Get chart is fine, actually. Get chart

8:58:30Okay, that's fine then.

8:58:31Make sure that the name of the tool is

8:58:33exactly the same as the name in the

8:58:35prompt. So, get chart and then the

8:58:37description, which is what does it

8:58:39actually do? In this case, call this

8:58:41tool to get an analysis of a requested

8:58:42[music] stock. Please return the URL

8:58:44from this tool in markdown formatting.

8:58:46For example, this URL. And the reason

8:58:49why we asked the image to be in this

8:58:51format, it's so that it can then send it

8:58:53over to us on Telegram

8:58:54>> [music]

8:58:54>> in a format in a way where it actually

8:58:56makes sense. Then we have the source.

8:58:57So, this is saying, "Okay, we're calling

8:58:59this tool, which is calling another

8:59:01workflow, which in this case is here,

8:59:03called any 10 workflow tool." And right

8:59:04here, we give it a description of the

8:59:05workflow. And then we have source. And

8:59:07source and workflow just means, "What do

8:59:09you want to call?" In this case, we want

8:59:11to call the name of the workflow, which

8:59:13we have right here.

8:59:15So, to set this up, you have to make a

8:59:17completely new workflow

8:59:19and make sure that you have this node

8:59:22right here, which is

8:59:23I believe

8:59:25uh

8:59:26when executed by another workflow,

8:59:28which is the one right here.

8:59:30And so, you're sending the data and then

8:59:31you're getting the data back. Which in

8:59:33this case, the from list, it will be two

8:59:36technical analyst agent because that is

8:59:37the name of this right here. And again,

8:59:39I will give you the whole blueprint for

8:59:40free, so you can just play around with

8:59:41it. And so, with this done, what we get

8:59:44in the technical analysis agent, if I go

8:59:46here to executions, I go to the previous

8:59:48one,

8:59:49and I can press this button copy to

8:59:50editor, which will show me exactly the

8:59:52data that I previously mentioned before.

8:59:54We get

8:59:56this. Now, for those of you who are new

8:59:58to the trading world in stocks, it

8:59:59actually isn't that hard. If I go to

9:00:01Apple stock,

9:00:03I can see that Apple stock isn't

9:00:05actually called Apple. It's called AAPL,

9:00:08right? NASDAQ, which is again the boss

9:00:09of all the different stocks in the US.

9:00:11And then we have AAPL, which is in this

9:00:14case called a ticker, which is a short

9:00:16version of Apple Inc., right? And so,

9:00:18when we want to send it to the actual

9:00:19thing to make the chart and so on, we

9:00:21have to give it in a way where it

9:00:22actually understands. So, we can't say

9:00:24Apple Inc. We have to say AAPL. Which is

9:00:26why we call them tickers. Once we

9:00:28receive the ticker from these AI agent

9:00:31right here. And so, what would happen

9:00:32here is that we give it a, "Can you now

9:00:34compare Apple with Microsoft?" And it

9:00:36will know that now Apple needs to be

9:00:37turned into a ticker, which will then be

9:00:39sent here to the tool, which will then

9:00:41be sent here,

9:00:43which is the actual workflow, and which

9:00:44is this.

9:00:45And then this will be the thing that we

9:00:47now use to actually make the chart and

9:00:49download it. Now, the question you've

9:00:50been asking yourself is, "How do we make

9:00:52charts like these? How does this

9:00:53happen?" We have to go to a platform

9:00:55called chart/image.com,

9:00:56which is the one right here,

9:00:57chart/image.com.

9:00:59And you want to be able to make an

9:01:00account, so sign in.

9:01:09And this is completely free. The only

9:01:11caveat to this is that we have a daily

9:01:13limit of 50, so you can only call this

9:01:1550 times. The next step you want to do

9:01:17is go to the API documentation, which is

9:01:20just a documentation that says, "Hey,

9:01:21here's how you can use it," right? On

9:01:23the left-hand side, just understand the

9:01:25D base URL, which is a URL that we have

9:01:27to call. It is always sort of like a

9:01:29link that you say, "Hey server, do this

9:01:30for me." This is the start of the link.

9:01:33And then to actually be able to call the

9:01:34right exact graph because we have tons

9:01:37of graphs that we can call.

9:01:38We can get this, we can get this, we can

9:01:41get all these. In this case, we have to

9:01:43choose the right one. So, if I go here

9:01:44to the graph that we want, if I go

9:01:46under,

9:01:47I can then see something called a curl.

9:01:50Now, a curl is something that we just

9:01:52literally just paste into a HTTP node,

9:01:54which is a justice where

9:01:55>> [music]

9:01:56>> inside of any 10, that will do

9:01:57everything for us. So, all you have to

9:01:59do really is copy this curl

9:02:02right here.

9:02:04Go to any 10

9:02:05and then be able to just add a HTTP

9:02:08request. And then all you have to do

9:02:09here is import curl.

9:02:12So, you go here, paste this, and you

9:02:14import it. And you will have this.

9:02:16And that's when you start filling things

9:02:17out. Now, if you get the blueprint, you

9:02:19won't have to set this up, but at least

9:02:21now you know exactly how it works. And

9:02:22right here is where we start adding

9:02:23everything. Now, one thing you have to

9:02:25add is /storage because then it allows

9:02:27us to be able to get this as a URL

9:02:29format and make sure that everything's

9:02:31good. Make sure to dispose so that we

9:02:32send the information of the ticker and

9:02:34then we get something back, which in

9:02:36this case is a URL of the actual

9:02:39stock.

9:02:40And then we have to put the X API key.

9:02:43Again, the API key is something that you

9:02:44can find here,

9:02:46API key, generate a new key here, and

9:02:48then copy it.

9:02:51And then content type, make sure this is

9:02:52application/json

9:02:54because all in all, you just want it to

9:02:56give you the right format, right? And

9:02:57then finally, the thing that matters the

9:02:58most is this right here, which is what

9:03:01are we actually telling the the server

9:03:03to do. As you can see here, this is the

9:03:05body. We call this the body, which is

9:03:07what is the instructions that we tell

9:03:09the actual server to do. Like what stock

9:03:10are we asking it to to get? In this

9:03:12[music] case, you can see that we have a

9:03:14symbol, which is NASDAQ

9:03:16colon

9:03:17ticker, which we get from the actual

9:03:20previous steps. Now, as I showed you

9:03:21before, the way that the stock is

9:03:22represented is NASDAQ colon Apple,

9:03:25right? Ticker. So, we want to do the

9:03:27exact same thing right here. NASDAQ

9:03:29colon ticker.

9:03:31And so, with that said, what it returns

9:03:32to us is the URL of the actual stock

9:03:35right here, like I've showed you. And

9:03:36then finally, you want to put response

9:03:38format JSON because we added up here

9:03:40that we want the content type to be JSON

9:03:42as well. So, just make sure you have

9:03:43this and you have this here so you're

9:03:45[music] able to get the URL of the

9:03:46actual stock. Once this is done, then we

9:03:48want to be able to download the chart,

9:03:51so download the actual URL because this

9:03:52isn't publicly available so that OpenAI

9:03:54or AI can actually go inside the image

9:03:56and analyze it.

9:03:57>> [music]

9:03:57>> So, the next step is just using a simple

9:04:00HTTP request to get the link and

9:04:03download it. Execute the step, which

9:04:05looks like this. We get it in a binary

9:04:06format.

9:04:08Binary is just the way that an image or

9:04:09a file is represented in the web.

9:04:12Which then goes to the next step, which

9:04:14is stock analysis, which is an AI. So,

9:04:16we choose OpenAI. And the way to connect

9:04:18your OpenAI is just by going to

9:04:20platform.openai.com.

9:04:21You can log in, you can go to dashboard.

9:04:23On the left-hand side, you can go to API

9:04:25keys, create a new secret key right

9:04:27here, and then put a name and then

9:04:28create the key like we did for Claude.

9:04:31Bring it back here, put the API key

9:04:32here.

9:04:33And then make sure you choose image,

9:04:35which is the thing that we're actually

9:04:36using. And the action that we're taking

9:04:38is analyzing image. The model can be

9:04:40GPT-4o, that is good enough. And then we

9:04:42give it a whole prompt, so text input,

9:04:44which is telling it, "Hey, you'll be

9:04:45given an image. Now, just assess the

9:04:48image, analyze the output chart based on

9:04:50the candlestick analysis, MACD analysis,

9:04:52volume, support, actionable, other

9:04:55observations

9:04:56that it then uses based on the binary

9:04:59data,

9:05:00data here,

9:05:01data data, that we give it as an input.

9:05:03So, you want to make sure that this is

9:05:04binary. And I remember thinking that

9:05:06binary was uh was such a complex thing,

9:05:08but what it actually is, it's just

9:05:10literally a way for the web server to

9:05:11represent files. And so, what we say

9:05:13here is we say, "Hey, here's the input,

9:05:16which is in a binary file,

9:05:17and the name of the input is data

9:05:19because that is the name of the variable

9:05:20that we get. So, just put data here. And

9:05:22then detail can be auto, that's fine.

9:05:24And now, what it does is that it takes

9:05:26the actual stock and then it gives us

9:05:28the output which is this right here,

9:05:30which is candlestick analysis. If I go

9:05:32to JSON, I can see the whole thing.

9:05:33Right here, potential breakout zone, the

9:05:35price is approaching 270. It's giving us

9:05:37a whole breakdown analysis of that

9:05:39stock, which we keep for now and we go

9:05:40to the next step which is Telegram. And

9:05:42if you have the connection that you made

9:05:43before, use the exact same connection.

9:05:45In this case, it will be message which

9:05:46is the actual thing that we're

9:05:47manipulating or changing. The action

9:05:49that we're taking is send the photo,

9:05:51which is we're sending the actual graph.

9:05:52We're not actually sending the

9:05:53explanation first.

9:05:55And the chat ID is the thing that I

9:05:57mentioned that we called or that we had

9:05:59right here.

9:06:00Chat ID, schema, chat ID.

9:06:03This is only a one-time thing, right?

9:06:04Because once you copy this here, it will

9:06:06send everything to that specific

9:06:08conversation. So once you copy this from

9:06:10there,

9:06:11you will then be able to have the photo

9:06:13URL be sent from here, URL, which is the

9:06:17thing that makes it look like this in

9:06:19Telegram. And then finally, the actual

9:06:20thing that goes back to the AI agent

9:06:22here

9:06:23for it to actually finish is the last

9:06:25step of the workflow, which in this case

9:06:27is here, which is response. And the

9:06:28response will just be the analysis that

9:06:30we get from

9:06:33where is it? Stock analysis here, which

9:06:35is the content.

9:06:36Right here.

9:06:37And this is the thing that then goes

9:06:39back to the AI agent inside here as an

9:06:42output.

9:06:44And finally, we made the graph, it sent

9:06:45to our channel, it then sent the

9:06:47analysis back to the AI agent, it

9:06:49formatted it in a way where it actually

9:06:50makes sense, and finally it sent it to

9:06:52Telegram right here

9:06:54with the chat ID, which you can get

9:06:56here, chat ID.

9:06:58And the output, which in this case is

9:07:00here, output. And make sure that this is

9:07:02message and send a message. So let's try

9:07:03this out one more time. I can go here, I

9:07:05can say, "Can you analyze Amazon?"

9:07:09And by the way, not all stocks are going

9:07:11to be recognized here, right? Like

9:07:12something like Samsung isn't part of

9:07:14Nasdaq to my understanding, to my

9:07:17knowledge. Um and so if you put Samsung

9:07:19or something like that, it will not

9:07:21detect it on the next workflow because

9:07:22it is not part of that subset of stocks.

9:07:25And so make sure that whatever stock you

9:07:26ask it to do is within the category that

9:07:29we added when we asked to make the

9:07:31chart. So now it's giving us the chart

9:07:33which did it in the other workflow.

9:07:35And then finally here, it gave us the

9:07:37actual trend. Now I'm going to do

9:07:39something interesting that I haven't

9:07:40done before. So let me actually execute

9:07:41the workflow again.

9:07:43Let me go here and let me ask it, "Can

9:07:45you now

9:07:47compare Amazon with Apple and with uh

9:07:52Microsoft?"

9:07:54I'm going to go here.

9:07:55I'm interested to see what this does, if

9:07:57it remembers this, if it remembers the

9:07:59other one as well, and what the output

9:08:01will give us. And it seems like it

9:08:02doesn't actually call the tool because

9:08:05it already analyzed the three of them,

9:08:08which is amazing, brilliant, because now

9:08:10we have the full analysis here. So

9:08:11overall trend, Amazon, Apple, Microsoft,

9:08:14recent price action, MCD analysis. So

9:08:17let me say, "Which one should I

9:08:20buy?"

9:08:21When I go enter,

9:08:24let's see which one it tells me that I

9:08:25should buy based on this analysis right

9:08:27here. As you can see, we have this here.

9:08:29As an AI assistant, I'm not able to

9:08:31provide specific investment advice or

9:08:32recommendation. Fair enough. Yeah, so I

9:08:34guess we'll just have to look at this

9:08:35right here and decide for ourselves.

9:08:37There you go. All right, so this right

9:08:38here is obviously a very cool use case,

9:08:40but it should give you ideas for other

9:08:42use cases that you can build, right? And

9:08:43the ability for us to call different

9:08:45tools within our AI agents and then

9:08:47bring it back all in one place. And

9:08:49that's the beauty of tools within the AI

9:08:50agent cuz you can talk to it as if it's

9:08:52a normal human, but it can take actions

9:08:54on different things. And again, it all

9:08:55depends on what tools there are out

9:08:57there like the image chart tool. Cuz if

9:09:00it wasn't for this, we wouldn't be able

Module 6

9:09:02to actually do this.

9:09:09Hey, I'm about to build a live Instagram

9:09:11parasite system right in front of you

9:09:12that scripts posts from the top AI news

9:09:15Instagram account in the world, rewrites

9:09:17them in your tone of voice using AI, and

9:09:18turns them into a stream of content that

9:09:20you can post automatically. [music] All

9:09:21right, so this right here is a system. I

9:09:23can press execute workflow. This will

9:09:24now run on your machine. Ideally, we run

9:09:26this every single week.

9:09:27Uh then we scrape the Instagram post

9:09:29from the top AI news account in the

9:09:31world on Instagram using Apify. [music]

9:09:34As we can see here, this is currently

9:09:35running. Then we wait 5 seconds before

9:09:37actually getting all the data and then

9:09:39looping it through. So we only let 20

9:09:41posts at a time. In this case here,

9:09:43we're checking whether it's actually

9:09:44relevant to our target audience before

9:09:46sending it to the next AI to actually

9:09:48rewrite the post and then adding it all

9:09:50back to our Google Sheet database. All

9:09:51right, we can see it just ran

9:09:52successfully. I can go to the Google

9:09:53Sheet database. I can see here that we

9:09:55have the username of the account, in

9:09:57this case it's the same, the date when

9:09:59the post was posted, the post URL we

9:10:02have here. We can always look back. The

9:10:03original post and the rewritten post

9:10:06using our tone of voice, target

9:10:07audience, and so on. So [music] we have

9:10:09every single week a stream of content

9:10:10ideas that we can then post

9:10:11automatically that are repurposed using

9:10:13our tone of voice. So now let me save

9:10:15this. Let me make a new automation. All

9:10:18right, we start from scratch. And again,

9:10:19the first uh step of all this building

9:10:21the automation is not actually building

9:10:22it itself. It's going on Miro to map

9:10:25things out, to break it down step by

9:10:26step before we actually go out and build

9:10:27it. So if I go here, I always look at an

9:10:30automation as an input

9:10:34and an output.

9:10:36And then in between is different steps

9:10:38that we have to just figure it out.

9:10:39Well, the input in this case is I guess

9:10:41someone else's content because we are

9:10:43doing a parasite system and parasite

9:10:45just means that you that you just steal

9:10:46someone else's idea and then you

9:10:48repurpose it for your own uh target

9:10:50audience. [music] In this case, if I

9:10:51wanted to get the latest AI news and I

9:10:53want to use Instagram, I have to find an

9:10:55account where they posted the latest AI

9:10:58news and it was the top in the world. So

9:11:01initially what I would do is I would go

9:11:02here and say, "What is the top AI news

9:11:07Instagram account in the world?"

9:11:10And then I would get this right here,

9:11:12Evolving AI. So I go here, let me see

9:11:14what they have. Yeah, they're so they're

9:11:16pretty big.

9:11:17Ready use this go viral after revealing

9:11:19AI prompt tricks and ChatGPT that almost

9:11:21feel like cheat hack. Yeah, I think it's

9:11:22pretty good. Um sort of new AI news and

9:11:24they're posting pretty regularly. I

9:11:25mean, this is

9:11:264 hours ago, 6 hours ago. Okay, so they

9:11:28post like twice a day.

9:11:30Yeah, three times a day, four times a

9:11:32day.

9:11:33Four times a day,

9:11:34um which is great because now we have a

9:11:35lot of news, a lot of content to then

9:11:37repurpose. So the input is this. So

9:11:39we're going to put input in this case

9:11:42post

9:11:44from Evolving

9:11:46AI.

9:11:47That's for Instagram.

9:11:49We put a note here,

9:11:51Instagram, IG.

9:11:53Now the next step after this is actually

9:11:55extracting the text from the post. So

9:11:57this is called scraping. When I go here

9:11:59to let's say this post right here every

9:12:00single week, and we want to take this

9:12:02whole text

9:12:04and this is what we're going to use to

9:12:05then repurpose, which means that we're

9:12:07going to change the tone of voice, but

9:12:09the message is the same, so the overall

9:12:11information is the same, and we're going

9:12:12to make it our own content. So the next

9:12:14step here is scraping

9:12:18post text.

9:12:19>> [music]

9:12:19>> Now for us to actually scrape the post

9:12:21text from Instagram, we would use a

9:12:23platform called Apify. So Apify is I

9:12:26mean, the way that I would represent it

9:12:27is just the Amazon for scrapers, the

9:12:29Amazon for all of these things that a

9:12:31smart dude in the world created using

9:12:34code. Um but of course, we're not using

9:12:36any code, we're just using it

9:12:38automatically using our no-code platform

9:12:39Any Ten. Um so if I go to go to console,

9:12:43you have to make an account and [music]

9:12:45you go to Apify store. On the bottom,

9:12:47you get to see that you have usage which

9:12:48is $5 because Apify actually gives you

9:12:50$5 for free every single month that you

9:12:52can use. And so let's go to the example

9:12:55here.

9:12:56We can see this is in the best example.

9:12:58Let me go here.

9:13:00Yeah. That [music]

9:13:02we have the scraper. So this is the

9:13:03thing that we use to actually scrape and

9:13:05I'll I mean, if this looks complicated,

9:13:06don't worry, I'll break it down. And we

9:13:07have to use $1.50 or we have to pay

9:13:09$1.50 for 1,000 leads. So if we get $5

9:13:13for free and we have to pay $1.50 for

9:13:141,000 leads, and this changes every

9:13:16single scraper, depends on what they

9:13:17are, then do the math there and it

9:13:20should be around 4,000 leads if I'm

9:13:23right. The math dudes in the comments,

9:13:25let me know. But that's how much you

9:13:27have to pay. So ideally what I would do

9:13:29is I would go to the Apify store. Again,

9:13:31it's like you're looking for a product

9:13:32on Amazon. And the product that I want

9:13:33is a product that is able to scrape IG

9:13:37posts. Okay, so I want to sput scrape uh

9:13:42or let's just do Instagram

9:13:44post scraper. And we have two options.

9:13:47>> [music]

9:13:47>> Instagram post scraper and Apify

9:13:49Instagram post scraper. So Apify is the

9:13:51actual platform name, so I typically

9:13:52would go for something that's Apify

9:13:54based because again, it's a platform.

9:13:56[music] 50,000, I think that's pretty

9:13:58good. And $2.70 for 1,000 posts. That's

9:14:00a bit steep, but I think it's fine. I

9:14:02mean, we're not going to scrape 1,000

9:14:04posts. I think we're going to do maybe

9:14:0550 a week, so it's basically free cuz we

9:14:07get $5 a month. And this is what the the

9:14:10sort of UI looks like. So on the top, we

9:14:13have the name of the scraper, then we

9:14:15have the description, then we have the

9:14:17input. So there's two different ways

9:14:19that you can run the scraper that you

9:14:20can actually use this. You can either go

9:14:22on the platform and run it here, so run

9:14:24the um start the actual scraper,

9:14:27>> [music]

9:14:27>> or you can use the JSON, you can connect

9:14:30Apify to Any Ten, and [music] then be

9:14:33able to run it automatically within the

9:14:34no-code platform. And if that made no

9:14:36sense to you, no worries, I'll explain

9:14:38exactly what it is step by step, so

9:14:39don't worry. Um but we can see here that

9:14:42the inputs are

9:14:43uh are

9:14:44well, there's really only one. There's

9:14:45one input,

9:14:46>> [music]

9:14:46>> which is either an Instagram username, a

9:14:48profile URL, or a post URL. So if I go

9:14:51to what was it? Evolving AI. I think

9:14:53it's Evolving Yeah, there we go.

9:14:54Evolving AI. If I go here, on the top is

9:14:58a URL, and this is the post URL or the

9:15:00profile URL that I get to paste here.

9:15:03Right, and this is the I mean, the thing

9:15:05I already had pasted, uh but it's the

9:15:07input that we have that we give Apify

9:15:08saying, "Hey, here's a profile URL, just

9:15:10scrape these posts on this time frame,

9:15:13this many posts." For this many posts in

9:15:15this time frame. It says extract posts

9:15:17that are newer than date. So the input

9:15:19that has to go here is the URL of the of

9:15:22the actual account, which you can change

9:15:23with your own URLs if you want, then the

9:15:25number of posts that we make, whether we

9:15:27scrape, and then we scrape um

9:15:30we're only scraping the posts that are

9:15:32newer than this date [music] right here.

9:15:34So, again, you can run this. If I press

9:15:35start,

9:15:36what this will basically do

9:15:38is it will now say it's running right

9:15:40here. And over time it will start giving

9:15:42me results. So, results are just

9:15:43basically here here's the output. As you

9:15:45can see here, the actor is getting your

9:15:46data. All right, so we're already seeing

9:15:47some outputs come up. These are the

9:15:49different uh text posts that we ideally

9:15:51want to be able to then repurpose using

9:15:54our tone of voice. Full name, the post

9:15:56URL,

9:15:57which comes from here. So, this is the

9:15:58text that it extracted. Uh and we get a

9:16:00bunch of them, which is great.

9:16:02All right, so I mean, ideally you would

9:16:04have to run this. Let me abort, which

9:16:05means

9:16:07that you stop the automation. Well, it

9:16:09doesn't really mean that in real life,

9:16:10but in the automation context it does.

9:16:13But now we stopped the scraper. We said,

9:16:14"Hey, stop scraping." But now we have

9:16:17the different text posts that we would

9:16:18like to use. So, we know this works cuz

9:16:20we get the output.

9:16:21So, all right, cool. [music]

9:16:23Scraping IG posts using Apify. Then, the

9:16:26next step would be

9:16:27using AI

9:16:29to check

9:16:31if it's relevant. [music]

9:16:33It is great that we get all this AI

9:16:35news, but are they actually relevant to

9:16:37who we're targeting and who our audience

9:16:38is?

9:16:39Um so, in this case we use AI.

9:16:42Well, we can say ChatGPT, but I think AI

9:16:44is fine. And then we ideally want to

9:16:48rewrite

9:16:50the post

9:16:52using our tone of voice.

9:16:54And then we would add it to a Google

9:16:58Sheet. Now, this right here, this

9:17:00automation, we ideally want to run it

9:17:02every single week. So, the first step

9:17:04actually is run

9:17:07automation weekly

9:17:09on a Monday

9:17:11cuz we have fresh new ideas that we can

9:17:12post. So, run automation weekly on a

9:17:14Monday, post from Evolving AI, which is

9:17:16an account on Instagram, scrape IG posts

9:17:18using Apify, use the AI to check if it's

9:17:21relevant.

9:17:24Uh and then we rewrite the post using

9:17:27our tone of voice and add it to the

9:17:28Google Sheet. So, in this case, the

9:17:29output is a Google Sheet full of

9:17:31content. All right, we can get to

9:17:32building now. All right, let's go to

9:17:33n8n. And the first step that we have to

9:17:36do is let me just do a trigger manually,

9:17:38which means that just to test, but later

9:17:40on we're going to replace this with a on

9:17:42schedule, which will run every single

9:17:44week. Uh so, we do trigger manually

9:17:46right here. So, the first step

9:17:49is to scrape IG posts using Apify.

9:17:52So, how do we do this? Well, we have to

9:17:53connect Apify to n8n. I can go here to

9:17:56Apify.

9:17:57And I have this node.

9:17:59And I can now run an actor because,

9:18:00again, these are all different actors

9:18:02that we have within the actual platform.

9:18:04But this is an actor. So, I can run an

9:18:06actor. And then in order for us to

9:18:07connect Apify, we have to go to create a

9:18:09new credential.

9:18:10You have to go to API key. I believe

9:18:12that the API key you can find on

9:18:14settings.

9:18:15Yeah, API integrations and then you can

9:18:17copy this right here.

9:18:18If not, you have to create a new token

9:18:19and I think when you're new to Apify.

9:18:22Uh and then you paste it right here.

9:18:24Let's do 100 million

9:18:26connection

9:18:28and press save.

9:18:29And we're good to go.

9:18:31And the resource is actor because we're

9:18:33running an actor. The operation, so what

9:18:34is the action that we're doing? In this

9:18:36case it's running an actor. And then the

9:18:37actor source, recently used actors is

9:18:39fine. Now, one of the important thing

9:18:41here is that if you go to the actors, so

9:18:43again, went to Instagram. We can also go

9:18:46to runs cuz we already run this already.

9:18:49Apify Instagram Yeah, this is right

9:18:50here. Apify Instagram post scraper.

9:18:53In order for us to see it here, in order

9:18:55for us to have it in our list of

9:18:56scrapers,

9:18:57we already have to run this in the

9:18:59platform. So, if you don't see it here,

9:19:00it's because we need to press start and

9:19:02save.

9:19:03And it will start the automation. It

9:19:04will start the actual actor. You have to

9:19:05run it once in order for then for you to

9:19:07see it right here. Which in this case is

9:19:10Instagram post scraper, Apify Instagram

9:19:12post scraper. Cool. Now, it's asking us

9:19:14for the input JSON. So, the input JSON

9:19:16is essentially what is the thing that

9:19:17we're feeding to the scraper saying,

9:19:18"Hey, do this and then give us the data

9:19:20back." Well, in this case,

9:19:22we can either do it manually or we can

9:19:24use JSON like I mentioned.

9:19:25So, for us to use JSON, all we have to

9:19:27do is copy this whole thing

9:19:29and we delete this and paste it right

9:19:31here.

9:19:32So, I'm basically saying, "Hey, I'm

9:19:33running it automatically. I'm using the

9:19:35JSON that we have to use."

9:19:37And that's it. And now what we're going

9:19:39to do is we're going to be changing

9:19:44the date. So, first I'm going to run

9:19:45this just to get some test data. You can

9:19:47wait for finish. This means that we're

9:19:49waiting for the scraper to be done.

9:19:51Let me execute step.

9:19:54I go here, I can see that on the runs

9:19:57now this is running. This is starting

9:19:58the crawler, which means that it's

9:19:59starting to scrape.

9:20:02Well, what I was thinking here is

9:20:03because this is saying, "Hey, only get

9:20:05the posts newer than this date."

9:20:07We want the date to be dynamic. We want

9:20:08it to be the date that we're running it

9:20:11minus [music] 7 days from the last week.

9:20:13So, we only want to run posts from the

9:20:14last 7 week. Have we finished? Yeah.

9:20:17Yeah, yeah, yeah, cool. Okay, so

9:20:19we got the data. In this case, we didn't

9:20:21actually get the post, but we got

9:20:23something called a default data set ID.

9:20:26Now, Apify, the way it works is that we

9:20:28run the actor.

9:20:29And then we don't actually get the post

9:20:30there. We have to give it to another

9:20:32node in Apify, which is called the

9:20:36get data set items. [music]

9:20:37Yeah, right here.

9:20:41And this node right here will be the one

9:20:43with the same connection that we then do

9:20:45a data set and get items and paste the

9:20:47data set ID that we have from here,

9:20:48which in this case

9:20:50we can get from here. Default data set

9:20:53ID.

9:20:54So, I'm dragging it across.

9:20:56This will be the thing that we use to

9:20:57then extract the data. So, if I remove

9:21:00the limit, I think you can remove it.

9:21:01Yeah, yeah, yeah.

9:21:02And I can pin this, [music] which means

9:21:03that I don't have to rerun this again in

9:21:05order to do the whole thing. I can now

9:21:07execute the step.

9:21:08And this will now give me the post. So,

9:21:10the caption

9:21:12for all the different items that we

9:21:12have. This is a long, long list.

9:21:15Uh yeah.

9:21:17We can see it in schema. We can see it

9:21:18in JSON and table as well.

9:21:21All right, now that we got the data, now

9:21:22we can move on to the next steps. And by

9:21:24the way, all we did is run this run the

9:21:25actor, send it here to then get the

9:21:26data, so all the different post text

9:21:28that we want for the next steps.

9:21:30And that's it. Uh then we go here to

9:21:32Miro.

9:21:33This right here is [music] good.

9:21:36This right here is also good.

9:21:39And now we have to use AI to check if

9:21:40it's actually relevant. So, the next

9:21:42step right here is to add another node.

9:21:45In this case it's an AI step. We're not

9:21:47using an AI agent. We're using an AI

9:21:48step, which in this case I think OpenAI

9:21:50is I think pretty good at this. We can

9:21:52now message a model.

9:21:54In order to connect your OpenAI, you

9:21:55have to create a new credential. You

9:21:57have to go to platform.openai.com.

9:21:59You have to go to dashboard.

9:22:01Go to API keys.

9:22:03Make a new secret key. Name it whatever

9:22:04you want. You will have a code that you

9:22:06will then paste back here as an API key

9:22:09and press save. Now, bear in mind, this

9:22:10is not free. Like all of this is not

9:22:12free. You have to pay for API tokens,

9:22:14which you can find in your profile,

9:22:15billing, and then put some money here. I

9:22:17think $5 is more than enough. It I mean,

9:22:19it lasted me 6 months, so I think it

9:22:21will last you, hopefully. Um

9:22:24unless you completely bombard it with

9:22:26with different scrapers. But that should

9:22:27be fine. Now, once you have this

9:22:28connected, the resource is text. The

9:22:30operation, so what is the action that

9:22:31we're doing? In this case it's message a

9:22:32model. The model that we want to use

9:22:35is mini 4.1 mini cuz I'm going for

9:22:37quality and speed,

9:22:39which is fine. So, again, for prompt we

9:22:40have a system prompt, which is you are a

9:22:42helpful, intelligent XYZ assistant. I'm

9:22:45going to paste this.

9:22:46If I go here full screen, then you can

9:22:47see the whole prompt.

9:22:48You're a helpful, intelligent, precise

9:22:49Instagram post classifier for an

9:22:51AI-focused audience, people who build

9:22:52with or want to learn AI,

9:22:55uh understand cool news that come out of

9:22:57it and that actually strike and have an

9:22:58interesting take.

9:23:00I think it's a pretty good overall. I

9:23:01mean, you would have to change this with

9:23:02your audience and who you're targeting.

9:23:04Um and then for the second message we

9:23:06use a user message. For the user

9:23:08message, I'm going to paste this.

9:23:11If I go here,

9:23:12zoom in, I can say, "Hey, classify the

9:23:14Instagram post for an automation-focused

9:23:15audience. Return only a verdict,

9:23:18relevant or not relevant."

9:23:20It's relevant if it's something

9:23:21interesting news on AI that come out.

9:23:23Not relevant if it's a motivational,

9:23:25personal, non-automation, coding,

9:23:26crypto, politics, finance, or tool

9:23:28discounts, or vague hype with no build

9:23:31{slash} impact. And then we want to

9:23:33output this as JSON. Now, what what do

9:23:34we use JSON here? It's because we only

9:23:36want the output to be either one of

9:23:38these items. We want it to say relevant

9:23:40or not relevant. Right? And we toggle

9:23:43this on.

9:23:44Output confidence JSON because then

9:23:46we're basically saying, "Hey, I told you

9:23:47to do it JSON. Now, I'm telling the

9:23:49system that the only output that it can

9:23:51do is JSON." That's fine.

9:23:53Uh now we have to add the actual data

9:23:55that we're giving the

9:23:56um the AI, which in this case is the

9:23:58caption.

9:24:00If I go here,

9:24:01I'm basically saying, "Hey, here is the

9:24:03Instagram

9:24:05post to

9:24:07analyze."

9:24:08It did give me an output, but it's

9:24:09because I ran it when I shouldn't have

9:24:10run it. Uh and now I can drag this

9:24:12across

9:24:15and have this as a caption. So, the

9:24:16caption is basically the text of the

9:24:17post.

9:24:19Let me execute the step again.

9:24:21So, this is now running.

9:24:24And now it should give me like an

9:24:25accurate answer as well.

9:24:27Let me rename this formatted. [music]

9:24:29Classify.

9:24:31Got it.

9:24:32Classify relevance.

9:24:36Rename.

9:24:37Did it run? No, it didn't run. So, I

9:24:38renamed it. Right.

9:24:40Now it's running. Now, I actually forgot

9:24:41to put one step in the middle because

9:24:43ideally we're doing 20 items now because

9:24:46in here

9:24:46>> [music]

9:24:47>> we're saying, "Hey, only get 20 items."

9:24:49And we can put this to 100, whatever it

9:24:50is. Let's put it to 100 cuz that's more

9:24:52realistic. Um I mean, they post four

9:24:54times a day.

9:24:56What is it? Four times a day?

9:24:57Let's do 30, actually. Or 50. Let's do

9:25:0050. Yeah, we ideally don't want to send

9:25:02all 50 here. Maybe we want to send 20 at

9:25:04a time.

9:25:05And now we can see

9:25:06that we start to get the different

9:25:08outputs. So, not relevant, not relevant,

9:25:10relevant, not relevant, relevant, not

9:25:11relevant, not relevant, relevant. So,

9:25:13it's good because it's not giving us all

9:25:14the information as relevant. It's only

9:25:16uh filtering out the ones that we

9:25:17actually care about based on audience.

9:25:19So,

9:25:20in order for us to actually not send 20

9:25:22at a time, we can do we can batch it.

9:25:24So, instead of cuz I put 50 here, when

9:25:26we run this now, it will give us 50

9:25:27posts. I don't want to send all 50 posts

9:25:29through. I want to basically loop over

9:25:32it. So, which means that we send only 20

9:25:34through, then at the end of the

9:25:36automation we bring it all back, and we

9:25:38do another 20, and we do another 10

9:25:40until it's finished. So, in order to do

9:25:41that, we have to use the loop over

9:25:43items.

9:25:45This is saying, so we connect this to

9:25:47this, by the way.

9:25:49You can delete this

9:25:51and delete this.

9:25:52You're basically saying, "Hey, after

9:25:53this, [music] loop over only 20 items.

9:25:57So, I only want to send 20 posts through

9:25:58at a time."

9:26:00And the next step is here. And then at

9:26:02the end, the last step of the

9:26:03automation, we bring it all back to

9:26:05here. So, it takes the ones that are

9:26:06remaining. Now, one thing I also forgot

9:26:07to put here is the date. So, [music]

9:26:10if I go here inside, so now I can

9:26:12manipulate the data.

9:26:14So, here,

9:26:15>> [music]

9:26:15>> um ideally, it's telling us, "Hey,

9:26:18this post have to be newer than a date."

9:26:20Well, in this case, I want it [music] to

9:26:21be the date that is running minus 7

9:26:23days. The way to do that is to put

9:26:26square brackets.

9:26:28Put now, I believe.

9:26:30dot

9:26:32minus

9:26:34seven. Let's see if I got this right.

9:26:36days. No. It's giving us the actual

9:26:38text.

9:26:39We don't want that.

9:26:41So, in this case, what I would do,

9:26:43well, actually I can do

9:26:45format. I think that works. Yeah, yeah,

9:26:47yeah. I think that works.

9:26:48So, we're formatting the date. I mean,

9:26:50first of all, we're minusing, so now now

9:26:52is today, then we're removing or we're

9:26:54we're subtracting 7 days from now, so

9:26:56last week, the past week.

9:26:58And we're formatting it as YYYY and

9:27:01MMDD, which outputs this as this. So,

9:27:04let's try this out. I mean, could or

9:27:06could not work.

9:27:07So, we'll see. We'll only The only way

9:27:08to know is to actually test.

9:27:10So, let me unpin this and let me execute

9:27:11this step. Okay, cool. It worked. Cuz if

9:27:13it didn't work, it would give us an

9:27:14error. Perfect. Okay, cool.

9:27:16All [music] right, we know this works.

9:27:18Let me stop the automation. And let me

9:27:20Yeah, unpin this. It's fine. And now

9:27:22after we classify the relevance, which

9:27:23in this case

9:27:24>> [music]

9:27:24>> this step, now we want to be able to

9:27:26rewrite the post using our tone of

9:27:28voice.

9:27:29So,

9:27:30first step before we even go there, we

9:27:32have to set different variables. Cuz I

9:27:33want to extract the variables that I

9:27:34actually care about from the data set

9:27:37items. Cuz there's so many variables. I

9:27:38mean, this overwhelms me. Ideally, I

9:27:40want to get

9:27:41the like count, comment count, views

9:27:43count, and some other stuff as well. So,

9:27:45in order to do that, I can go to edit

9:27:48fields.

9:27:49I can then go to

9:27:51I think I have to run this.

9:27:53Yeah, I think I have to run this.

9:27:54[music]

9:27:55Maybe not.

9:27:56Let me try this.

9:28:00There we go.

9:28:01Little hack.

9:28:02Um

9:28:03And now I can put the

9:28:05comment count.

9:28:08Let me actually

9:28:09one click hack. Instead of you [music]

9:28:10putting the name, you can just drag it

9:28:11across.

9:28:12And it'll put the name itself.

9:28:14And then I think it's like views,

9:28:16if I'm not mistaken.

9:28:18View Yeah, video view count. Put it

9:28:21here.

9:28:22And then I think it's likes, likes

9:28:24count.

9:28:25And then I think that is pretty much it.

9:28:28So, likes count, comment count, views

9:28:30count, and a full text and date posted.

9:28:32Yeah. So, full text and date posted. The

9:28:35full text in this case will be the

9:28:36caption.

9:28:37And the date posted will be the

9:28:39timestamp right here. In this one. I

9:28:42think it should be this one. Yeah, yeah,

9:28:44yeah. It's this one.

9:28:45But, I don't want it in this way. So,

9:28:47later on we're going to change it.

9:28:49But, it's fine.

9:28:50So, for now we can set We can actually

9:28:52leave this here. So, we can set the

9:28:53variables and then go to the next step.

9:28:55And this will make more sense once I

9:28:56once I actually show you later. But,

9:28:57essentially why I'm doing this is

9:28:58because later on when I want to pull

9:29:00information here from the

9:29:03I'm not sure I want this.

9:29:04From here,

9:29:05I don't have to go all the way into here

9:29:07and then start finding information.

9:29:09I can just simply go here and find the

9:29:11things that I need.

9:29:12Right?

9:29:13So, in this case,

9:29:15the caption. We can leave this as is,

9:29:17but I feel like I want this here.

9:29:20Caption.

9:29:23And I think this is fine.

9:29:25The next step is in your automation to

9:29:27be able to then filter.

9:29:29Filter based on the ones that are

9:29:30relevant. Some are relevant, some are

9:29:32not relevant. So, I'm going to put a

9:29:33filter here. You simply have to press

9:29:35filter.

9:29:36And the verdict

9:29:39has to be equal to relevant.

9:29:43So, the filter's saying, "Hey, only let

9:29:45the ones that are relevant through to

9:29:46the next steps."

9:29:47So, if I

9:29:49if I pin this,

9:29:51and again, amazing feature and then

9:29:54and I run this,

9:29:56now I see that out of 20, only 12 went

9:29:58through. Which means that only 12 were

9:30:00accepted and were actually relevant.

9:30:02Once this is done, now we can send it to

9:30:04an AI, in this case Claude, because

9:30:06Claude is better at making content.

9:30:08We're able to rewrite the post using our

9:30:09tone of voice. If I go here,

9:30:12bot,

9:30:13Anthropic in this case,

9:30:14we can generate now message a model,

9:30:18which again, you can find

9:30:20I'm thinking you could find it.

9:30:22Anthropic

9:30:24down below.

9:30:25There you go. Message a model. And

9:30:26[music] you go inside, and now you to

9:30:28connect your Claude, you have to go to

9:30:30get the API key. You can go to Anthropic

9:30:32the console, the console to Anthropic

9:30:34the dashboard, and then get the API key.

9:30:36You can create a key.

9:30:37Name it whatever you want. And also,

9:30:39make sure to add money into your billing

9:30:41because it's not free.

9:30:45But again, just like OpenAI, this is

9:30:46very, very cheap. All right, cool. So,

9:30:48now we can go back to n8n and we can

9:30:51paste the API key. We can connect The

9:30:52operation, [music] which is what is the

9:30:54action we're doing? Again, message a

9:30:55model. The list we can actually use

9:30:59I think 3.5 Haiku is good.

9:31:01Let me actually go to ChatGPT. That's

9:31:02good.

9:31:04Which Anthropic

9:31:06model is good

9:31:08>> [music]

9:31:08>> is best

9:31:09for content?

9:31:11I mean, this is realistically what I

9:31:12would do if I didn't really know.

9:31:13And now ChatGPT will tell me.

9:31:15It depends.

9:31:17No, not complex. Yeah, 3.5 Sonnet.

9:31:21So, we can use Sonnet, 3.5 Sonnet.

9:31:24Yeah, that's fine. And now we can put

9:31:26the prompt. Now, for the sake of time,

9:31:27I'm not going to write the prompt from

9:31:29scratch. I'm going to paste the one I

9:31:30had before. But, it's fine because you

9:31:32get to have the system for free. I'll

9:31:34show you exactly how to get it, so don't

9:31:35worry. Um now, this has the overview,

9:31:37which is you are a helpful, intelligent

9:31:38writing assistant. And now that I think

9:31:40of it, this should probably be a system

9:31:42prompt. Because as I [music] mentioned,

9:31:43the system prompt is the prompt where

9:31:46you tell it Oh, that's why. Okay.

9:31:48All right. Take my words away. Uh

9:31:50there's no system prompt option, so we

9:31:52just leave it in the user prompt.

9:31:54And you are a helpful, intelligent

9:31:55writing assistant. The task is to

9:31:57rewrite the Instagram post that I'm

9:31:58going to give you in a way that

9:31:59encapsulates encapsulates the original

9:32:01theme but uses different words. I'm

9:32:03targeting an audience that are people

9:32:04who build

9:32:05>> [music]

9:32:05>> with or want to learn AI, and they are

9:32:07always fascinated by new discoveries or

9:32:09news that actually make an impact. My

9:32:10results over the last year have

9:32:11generated six figures, worked with over

9:32:1340 businesses, and taught 17,000 people.

9:32:15I've never gotten to do a bunch of fun

9:32:16stuff like travel, enjoy my life, etc.

9:32:18Rules uh use a youthful, young tone when

9:32:20rewriting the Instagram post. Only

9:32:21output the Instagram post and that's it.

9:32:23Perfect. Now, on a technical level, the

9:32:27prompt right here, where we use hashtag,

9:32:28this is called markdown formatting.

9:32:30Markdown formatting, you know when you

9:32:31go to docs,

9:32:33right? And you type something. When you

9:32:34write an essay, you have the title,

9:32:37which in this case is

9:32:38heading one. So, title.

9:32:41Then we have heading two.

9:32:42Then we have heading three, right? Then

9:32:44we have heading four, and then we have

9:32:46text.

9:32:47Right? And so, the same thing. One One

9:32:49of this

9:32:51I believe that it's title. Yeah.

9:32:54And this right here is

9:32:57heading two.

9:32:58This right here is heading three.

9:33:01And same thing with heading four as

9:33:02well. So, this is why we add markdown

9:33:04formatting in our prompts because then

9:33:06AI can basically it knows the hierarchy

9:33:08of the actual prompt, so it looks so it

9:33:10knows to look at the overview first, the

9:33:12task, and then my results and rules as

9:33:14well. All right. Uh and now we can add

9:33:16another user prompt, I believe, which is

9:33:19the IG post because we want to give it

9:33:21the post to actually rewrite. You can

9:33:23say, "Hey, here is

9:33:25the IG post to rewrite."

9:33:28I can go

9:33:30I think Yeah, it's here. Add a fields

9:33:32and put caption. Drag it across. And the

9:33:34good thing is that we actually get to

9:33:35see the output before it's even

9:33:38run, which is great. Um okay, cool. So,

9:33:41this is good. Simplify output is good.

9:33:44Now we can run this. Press this.

9:33:46And this should run.

9:33:48So [music] again, we only sent 12 items.

9:33:50Yeah, 12 items.

9:33:51We're We're ready to go. Okay, cool. Uh

9:33:54in the meantime, let me make a Google

9:33:55Sheet,

9:33:57which is the database where we actually

9:33:58get to store all the content. And I

9:34:00believe I want the username,

9:34:02the post URL,

9:34:04the original post text,

9:34:08and the re-

9:34:09written

9:34:10post text.

9:34:12Okay, cool.

9:34:13Make this white. [music]

9:34:15Make this the middle.

9:34:17Let me freeze that to row one. We're

9:34:19good to go. Let me make this a bit

9:34:20larger. So, now it's going to be a bit

9:34:22bigger than that.

9:34:23If I go back here, I should see that

9:34:25this is not over. Cuz it does take a

9:34:27while. Cuz Claude is time-consuming. But

9:34:29now it's finished. We have

9:34:31So, here, "Yo, this is actually insane.

9:34:33Apple just dropped a game-changer.

9:34:34AirPods Pro can actually now be your

9:34:35personal translator.

9:34:37Just tap both stems and booms. It picks

9:34:39up your foreign language, cancels noise.

9:34:40I know it could do that." All right, now

9:34:42we bring it all back to the sheet. So,

9:34:43this right here

9:34:45So, I'm good. And look at how I'm

9:34:46actually structuring the automation. So,

9:34:48I map it out, and then every time that I

9:34:49finish something, I go here to green cuz

9:34:51[music] I'm It's called iterative

9:34:53testing. So, we test every single step

9:34:54to make sure that it's good. And then we

9:34:56want to make sure some sort of

9:34:57confirmation checklist that we can then

9:34:59say, "Yes, it's good." before going to

9:35:01the next step. So, the next step here is

9:35:02adding everything to the Google Sheet.

9:35:04Let me rename this.

9:35:06IG.

9:35:07Again, not ideal. Let me do IG.

9:35:09And then here, let me do Google Sheets.

9:35:12I can append a row on a sheet. Append a

9:35:13row just means add a row. To connect

9:35:15your Google Sheets, you have to go here

9:35:17and sign in to Google.

9:35:18>> [music]

9:35:18>> This is a simple page. You can just

9:35:20choose your account and so on.

9:35:21Um that's fine.

9:35:23Once you're done with this, you can do

9:35:24sheet within document append a row cuz

9:35:26this is the action that we're doing. The

9:35:28document will be IGGGG.

9:35:32Choose the right account.

9:35:34Yeah, there we go. The sheet will be

9:35:36sheet one.

9:35:37Which is this one right here.

9:35:40And now we want to be able to map all

9:35:42the fields. So mapping just means that

9:35:44we want the username to be something

9:35:45from here. We drag it across. Post URL,

9:35:47original post, and rewritten post as

9:35:48well.

9:35:49So the username

9:35:50I believe we can find I mean what was

9:35:52his name? Evolving AI? Yeah, there we

9:35:54go. Owner full name.

9:35:56I can drag it across. Now what do we

9:35:57actually want? This is because what if

9:35:58we change the URL of another person

9:36:01later on? We still want to know exactly

9:36:02where the post came from.

9:36:04And then we want the post URL.

9:36:07Post URL.

9:36:10There we

9:36:13This right?

9:36:15Yep, it's good. Uh and now the original

9:36:17post text is I can get from the

9:36:20I might have been beginning to actually

9:36:21use N 8 N for the first time. Maybe

9:36:23[music] I get so confused here.

9:36:25There's so much to so much to look at.

9:36:27Um and then the caption is this.

9:36:30It's good. And now the

9:36:32message of model which is the text. The

9:36:35rewritten post. I like how we just

9:36:37translated it in our own tone of voice.

9:36:38Yo, this is actually insane. This is

9:36:41wild. [music] I like that.

9:36:42Apple just dropped a game changer. All

9:36:44right, cool. Um all right. We can test

9:36:46this as always. We can pin this I think.

9:36:49Yep.

9:36:50We're good. So now we should see this.

9:36:51It's going to be formatted weird or not.

9:36:54Yeah, it's good. [music] Uh what I'm

9:36:55going to do is I'm going to make this

9:36:57smaller.

9:36:59I want to see the username, the post

9:37:00URL.

9:37:05Perfect. The original post and then

9:37:06[music] rewritten post. I like all of

9:37:08this apart from this. Yeah, like this I

9:37:11mean this is obviously not ours, right?

9:37:13Yeah, this is not ours. So let me go to

9:37:14AI hello rules.

9:37:18Do not use any CTA

9:37:21at the end. Not the best change in

9:37:23prompt, but it's fine.

9:37:24>> [music]

9:37:24>> We're going to run it from scratch um

9:37:26again so don't worry. But now that we're

9:37:28finished with this

9:37:30so we said hey, okay. We run this actor.

9:37:32We got the data.

9:37:33We set the fields cuz it's easier for us

9:37:35to actually map later on. I mean this

9:37:36should work on its own. Um then we said

9:37:39okay, we maybe we can get 50 posts, but

9:37:42I only want to run 20 posts at a time.

9:37:44So [music] we run 20 posts here.

9:37:46Classify the relevance. If it's

9:37:47relevant, then we go to actually make

9:37:49the post. Then we add it to the sheet

9:37:50and then we go back here and we run

9:37:53[music] the next 20 and the next 20

9:37:55until it's finished. Well, in this case

9:37:56it's 50, right? So it will run twice and

9:37:58then it will run three times. On the

9:38:00third it only get 10. Finish. Let me

9:38:02unpin all of this. There we go. Let me

9:38:04save this. Let me refresh the page. And

9:38:07now I should be able to run this.

9:38:11Yeah.

9:38:13Yeah.

9:38:14Execute workflow. I can now wait. If I

9:38:17go to the post creator, I can see that

9:38:19this is now running. And this usually

9:38:20takes about 20 per seconds. It can be a

9:38:22minute depending on how many results you

9:38:24want.

9:38:2546 seconds.

9:38:27Yeah, depends.

9:38:28You can start to see the posts that are

9:38:30being scraped right now. And we only get

9:38:32the data.

9:38:33Okay. That was 19. 19 posts. Okay, cool.

9:38:36We get the data when it's finished.

9:38:38So it goes here. Now it's going to

9:38:39classify the relevance. Let me check in

9:38:40here. Yeah, it's good. I guess it only

9:38:42found 20 posts uh from the last 7 days

9:38:45which is fine.

9:38:46Cuz we did put a time frame, right? And

9:38:47it's going to rewrite them and then put

9:38:49them into the IGGGG database.

9:38:52>> [music]

9:38:52>> Now the reason why we see we give it

9:38:54like hey, you can script 50 posts, but

9:38:56in the past 7 days they only had 20. So

9:38:58>> [music]

9:38:59>> uh I didn't find 50. I mean you can see

9:39:00here that the content is now being added

9:39:02to the Google Sheets. So if I go here

9:39:06I can see that more content has been

9:39:07added.

9:39:09I mean this is 24.

9:39:10>> [music]

9:39:11>> And we made 11.

9:39:14So 1 2 3 4 5 6 7 8 9 10 11. So these 11

9:39:19are the ones that have just been added,

9:39:21right?

9:39:22Which is great. And we have more

9:39:23content. As you can see, there's no CTA.

9:39:26Changed it compared to this.

9:39:28Where is the CTA?

9:39:30So we made that change.

9:39:32Perfect. Um

9:39:34All right. Now the only thing we have to

9:39:35change in this automation is that we

9:39:37have to run this every week.

9:39:39I can delete this. Now I can go here

9:39:41on a schedule.

9:39:43And say weeks.

9:39:45One week. We can trigger this on a

9:39:46Sunday at midnight which is Oh actually

9:39:48no, I set it on Monday. Let's do Monday.

9:39:50Um Monday at 6:00 a.m. [music] Cuz who

9:39:53wakes up before then? Um and then we

9:39:56press save.

9:39:58And now you should have a working

9:39:59automation that runs every week. It will

9:40:01scrape the different posts. It will get

9:40:02the data set items. It will then set the

9:40:03nodes or set the variables. [music] It

9:40:05will then only run 20 at a time.

9:40:07It will classify whether it is actually

9:40:08relevant for our target audience. It

9:40:10would only send the ones through that

9:40:12are actually relevant. It would then

9:40:13rewrite them. So let me rename this to

9:40:15rewrite

9:40:18post

9:40:20before adding them to our Google Sheet

9:40:22database with all the content right

9:40:24here.

9:40:27Hey, I'm about to build a live Twitter

9:40:29parasite system right in front of you

9:40:31that scrapes tweets from top performing

9:40:32posts on Twitter based on a keyword that

9:40:34we give it, rewrites them in your tone

9:40:36of voice using AI, and turns them into a

9:40:38stream of content that you can post on

9:40:40automatically. So I'm just going to run

9:40:41it and show you exactly the outcome that

9:40:42we get. We have a form where we can add

9:40:44a keyword. So in this case let's just

9:40:45put AI agents.

9:40:47And I submit. This now starts the

9:40:49automation. It calls a scraper on Apify

9:40:51so you can scrape the top 100 tweets on

9:40:54Twitter based on that specific keyword

9:40:56that we give it.

9:40:57If we go here, we can see that this is

9:40:59running.

9:41:01It's got 80 so far.

9:41:03So you can see now it went to the wait

9:41:05because we're waiting 5 seconds before

9:41:06adding it to the next Apify node to get

9:41:08all the data and then add to the first

9:41:10AI step which will classify the

9:41:12relevance of the tweet whether it's it's

9:41:15actually good for us to actually post it

9:41:17or whether it could be considered a good

9:41:18content idea.

9:41:20And we're only letting 50 items through

9:41:21at one time cuz we want to make sure

9:41:22that we don't give all the AI

9:41:24all the context and all 217 tweets.

9:41:28This now sends only the relevant tweets

9:41:31now to the other agent or to the other

9:41:32AI step which will rewrite it in our

9:41:34tone of voice before adding it to the

9:41:36Google Sheet. All right, if you go here

9:41:38to our Google Sheet, we can see that we

9:41:40have the AI agent keyword, the original

9:41:42post or the original tweet, and the

9:41:44rewritten tweet [music] that we take in

9:41:46order for us to then be able to post it

9:41:47to our platform. All right, so let's

9:41:49dive in. I'm going to go to a new

9:41:50workflow.

9:41:52Workflow personal right here. We start

9:41:54from zero. Now in theory I would have to

9:41:56go to Miro which is a platform where we

9:41:58actually map out the automation before

9:41:59actually building it. We're going to

9:42:01start strategizing behind what is it

9:42:03that we want, right? Now initially a

9:42:05parasite system is using someone else's

9:42:07content to be able to repurpose it for

9:42:09our own.

9:42:10And so because we're talking about

9:42:12Twitter

9:42:13Twitter operates with keywords. As in

9:42:15like you give a keyword and you can get

9:42:16a bunch of tweets. So the input has to

9:42:18be a keyword, right? The input is a

9:42:20keyword. That's the input.

9:42:22Now the keyword can be can be a form,

9:42:24can be a button, can be

9:42:26a message. It can be different things.

9:42:29Um we can Sorry, we can give the input

9:42:30in different different ways. A form, a

9:42:32message, whatever it is, an email. But

9:42:33in this case because we have Notion

9:42:35Sorry, N 8 N forms integrated within N 8

9:42:37N, we can use the form right here.

9:42:40Okay. Actually, let me just put N 8 N

9:42:41form here.

9:42:43And this will be the keyword. That will

9:42:44be like the only question that will be

9:42:45asked. Now after we have the form uh

9:42:48with the N 8 N keyword

9:42:50we would be able to we should send it to

9:42:52a scraper. In this case we use Apify and

9:42:55I'll talk about which one's the best,

9:42:56how we actually find them, and all that

9:42:57sort of stuff. Um but in this case we So

9:43:00um scraper

9:43:03scrapes

9:43:06tweets

9:43:08based on keyword.

9:43:11Scrape tweets. I can just put scrape

9:43:12tweets.

9:43:14Based on keyword. Let's make it bigger.

9:43:16And now we want to be able to send it to

9:43:18an AI because not all tweets that come

9:43:20from that keyword are relevant to what

9:43:21we do. So use AI

9:43:24to check

9:43:25if

9:43:26to check relevance.

9:43:28And then if it's relevant, we want to

9:43:30rewrite it. Okay?

9:43:32Rewrite

9:43:35relevant

9:43:37tweets.

9:43:39Okay, so that's exactly how it's going

9:43:40to go and then we're going to be adding

9:43:41it to a Google Sheet.

9:43:43N 8 N form scrape tweets based on

9:43:44keyword that we have using the form.

9:43:46Then we use AI to check the relevance.

9:43:47Then we rewrite the relevant tweets. Uh

9:43:49so this will be a filter in here. It

9:43:51will be a filter whether it's actually

9:43:52relevant or not.

9:43:54And then we can rewrite it and then add

9:43:55it to a Google Sheet. Okay, I think

9:43:57that's pretty

9:43:58pretty It's pretty standard, pretty

9:43:59easy. Um

9:44:01The first step here is N 8 N form.

9:44:03So let me actually make that on N 8 N.

9:44:05And again this is step by step so you'll

9:44:06see everything. The first step right

9:44:07here I can press add. I can go here and

9:44:09now I can add the different options. In

9:44:10this case it will be on form submission

9:44:12because we're using the N 8 N form right

9:44:14right here.

9:44:15So if I press this

9:44:16I'll have this page.

9:44:17Now again N 8 N forms, we have a test

9:44:19URL, we have production URL. The test

9:44:21URL is something that we use when we're

9:44:22actually testing the automation. But

9:44:24once this button right here is turned

9:44:25on, we actually activate the automation

9:44:27so we don't have to keep executing your

9:44:29workflow every time manually.

9:44:32Uh we will be using production URL. But

9:44:34in this case let's leave it here cuz

9:44:35we're testing. Authentication will leave

9:44:37it uh we don't need any password.

9:44:38Authentication is sort of saying do you

9:44:40want a password to your form? We don't

9:44:41need it. Uh the form title can be

9:44:44Twitter

9:44:47parasite

9:44:48system.

9:44:50Yeah, there we go. Uh I don't know for

9:44:51some reason I always put the Y instead

9:44:52of the I. And then here you can add

9:44:56Please

9:44:57add a keyword to activate

9:45:00this system.

9:45:03And now we can So this will be the form

9:45:05description as in what you'll see in the

9:45:06form. And now we can add we can start

9:45:08adding the questions.

9:45:09So we if we add add from element, this

9:45:11just means add a question. Uh the field

9:45:13name will be keyword.

9:45:15It will be a text and placeholder let's

9:45:17just put an example AI automation.

9:45:20Okay, and this will be an example thing

9:45:22they they see before they even write it

9:45:23to get an idea what they have to put. We

9:45:25put required.

9:45:26And it's asking us respond when form is

9:45:28submitted. Yes, because you want the

9:45:29trigger

9:45:30we want to send information there when

9:45:32the form is submitted.

9:45:33And that's it.

9:45:35Uh so let me execute the step. Let me

9:45:36test this out.

9:45:38Let me do AI agents.

9:45:40I submit and now here I should be able

9:45:42to see the output.

9:45:43And it's green, all good. And the

9:45:45keyword is AI agents. Followed by the

9:45:46date, the form mode which is in test

9:45:48mode, right? Because we're using the

9:45:49test URL. Uh so that's good.

9:45:51>> [music]

9:45:51>> Uh so that's the first step done. Now we

9:45:53can go on to the next step which is the

9:45:56Apify. So scrape tweets based on

9:45:57keywords. Uh let me delete this. We'll

9:45:59go to Apify from scratch. We'll go to

9:46:01apify.com which is a platform where

9:46:03it's sort of like a Amazon and the thing

9:46:06the products that you're buying are

9:46:07scrapers. Okay, and scraper and the the

9:46:09Amazon products someone makes them, you

9:46:11just use them. Okay? So in this case

9:46:13that's exactly what this is. People make

9:46:14scrapers, you just use them

9:46:16to do whatever. Uh and it's all code in

9:46:18the back end, right? Again, we don't

9:46:19want to use code. So that's why we use

9:46:21Automate.io system.

9:46:22Um

9:46:23so

9:46:25typically when it comes to to scraping

9:46:27like the first thing you do is go here

9:46:29and search up

9:46:30the thing that you want to do. In this

9:46:31case it's Twitter scraping.

9:46:34What's there you should have a look at

9:46:35the reviews. Like that's the first thing

9:46:36I would look at. Reviews, reviews,

9:46:38reviews.

9:46:39And the ratings and then I would go out

9:46:41and look for the price. Now because I

9:46:43already did this, um I have on home

9:46:47this this scraper right here which is if

9:46:49you want to if you want the actual

9:46:50thing, just copy this x data {slash}

9:46:52Twitter x scraper. You can copy this,

9:46:54you can go here Apify store, you can

9:46:56paste it.

9:46:57And you will have this one right here.

9:47:00Okay, so this is the one that we're

9:47:00going to use because of the fact that

9:47:02it's actually very cheap. So Apify

9:47:04actually gives us $5 to anybody who

9:47:06signs up

9:47:07every month. Okay? And we have 8 GB.

9:47:10This is more than enough to be using

9:47:12this scraper which is 35 cents per 1,000

9:47:14tweets. If we scrape 100 tweets per

9:47:16keyword

9:47:17we have to do and that's that's what?

9:47:19That's very that's not even like that's

9:47:21not something to even mention, right? In

9:47:22terms of price. So it's basically free.

9:47:25Um so you can use it as much as you

9:47:26want.

9:47:27Uh obviously again, not infinite, right?

9:47:29Because we still have 35 cents per 1,000

9:47:31tweets, we have $5. So with that being

9:47:32said um

9:47:35we have basically the scraper tells us

9:47:36that the input in this case can either

9:47:38be a start URL, it can be a URL of a

9:47:40tweet or whatever it is.

9:47:42It can be a search term

9:47:43which is a keyword

9:47:45or it can be a Twitter handle.

9:47:47Okay? In this case, we want to be able

9:47:49to add a keyword because that's the

9:47:50thing that we're inputting

9:47:52which is why we add so if I press X, I

9:47:54can add here.

9:47:56I'm going to do AI

9:47:57automation, whatever it is. And for you

9:47:59to actually see it on end to end, you

9:48:01have to actually start and run it once

9:48:04for it to save.

9:48:05So I already did this, so I don't have

9:48:07to do this again, but you can start and

9:48:08then save it.

9:48:10And then maximum number of atom output,

9:48:12that's good. All right, so let me go to

9:48:13end to end and actually cuz I have this

9:48:14scraper already

9:48:16I'm going to go to Apify

9:48:18right here and I'm going to run an actor

9:48:19because the actor is the scrapers like

9:48:21the scraper itself is called an actor.

9:48:23Uh so if I press run an actor, it gives

9:48:25you the option to um to actually connect

9:48:27Apify to end to end. I press here, I can

9:48:30now put the API key which I can find

9:48:32when I go to settings.

9:48:35I go to API integrations and this will

9:48:36be

9:48:37the one here. Default API token. I copy

9:48:40this and I go out here and I paste it

9:48:43this will now let me put

9:48:45100

9:48:47connection

9:48:49100

9:48:50connection

9:48:52second [music]

9:48:53September

9:48:55I press save, this will now save. As you

9:48:57can see here

9:48:58you can't see it cuz I'm there, but uh

9:49:00it will be credentials successfully

9:49:01created.

9:49:02I go here and now I will have the

9:49:03connection. Okay? The resource will be

9:49:05actor, the operation will be run an

9:49:06actor cuz that's the action that we're

9:49:07doing.

9:49:09Actor we can be uh actor source recently

9:49:11used actors.

9:49:12You should do Apify store actors in case

9:49:14you haven't used it yet.

9:49:15From the list now you have a list of

9:49:17actors that you've probably used. If you

9:49:19did this the first time you'll see none

9:49:20of them. Um

9:49:21but

9:49:22you I mean you will see the one that you

9:49:23just you just run which is the one that

9:49:24I would just spoke about which is the

9:49:26one here.

9:49:27So this is the one that you have to use.

9:49:28Look for the handle x data Twitter

9:49:30scraper or look for the name xcom uh

9:49:32x.com Twitter API scraper. I go here, I

9:49:35can then look the thing, right? And it

9:49:37tells us the name. So we know that it's

9:49:38this one. I want to press this

9:49:40and now it's asking me for a few things.

9:49:42It's asking me what's the input JSON? So

9:49:43how do you know the input JSON? Well

9:49:46you can actually scrape on Apify using

9:49:48two different ways. You can scrape on

9:49:48the platform, so you can go here and

9:49:50actually put the keyword and run it and

9:49:52get the results manually and download as

9:49:53a CSV or whatever it is. Or you can

9:49:55actually use it automatically. Use it

9:49:58automatically, you need the JSON here.

9:49:59So this is the manual process. In in

9:50:01case you want to use JSON, we have to

9:50:02press this button right here. And now it

9:50:04gives us

9:50:05the JSON that we can copy

9:50:08right? And the only thing we have to

9:50:09change in this case is the search term

9:50:11>> [music]

9:50:11>> which is the variable that we get from

9:50:13the form that we fill out. Okay? So if

9:50:15we

9:50:16copy this whole thing

9:50:17we go here, we paste it back

9:50:21Uh okay, so if you do this, we just copy

9:50:23it. And now

9:50:25the only thing we have to change here

9:50:27because the search term is the thing

9:50:29that's dynamic we have to change the

9:50:30search term which we get from the

9:50:32keyword. If I delete this

9:50:34and I pull this across

9:50:35keyword

9:50:36in the middle

9:50:38right?

9:50:39Make sure that it is in the middle. Make

9:50:40sure that it's

9:50:41uh that it's not here.

9:50:43Make sure that it is in the middle

9:50:44between the two quotes.

9:50:46So now what this will do is this

9:50:47variable right here will be changed.

9:50:49Okay, it will be dynamic. It will be

9:50:50something that changes as the form

9:50:51submissions change. So what did we do

9:50:52here? We created the actor, we connected

9:50:54the actor, we said okay, this actor is

9:50:56fine. Then I went to Apify and said

9:50:58okay, if this is the normal way of doing

9:50:59things with these with these settings AI

9:51:01automation 100 and so on top

9:51:03the JSON for it is this.

9:51:06Top AI automation 100 and so on, right?

9:51:08So you want to copy this. You're going

9:51:10to paste it here and then the only thing

9:51:11you want to replace is the actual

9:51:12keyword that you use uh to actually

9:51:14scrape the tweets.

9:51:16And it's asking us for um wait for

9:51:18finished. In this case, yes we want to

9:51:19wait for finished. What this means is

9:51:21that we can if we toggle this off, we

9:51:23can basically send the data to the

9:51:26the actor but it will run it will say

9:51:29it's successful as in it won't give us

9:51:30the the data back, it will just run it.

9:51:32But if you press wait for finished, what

9:51:33it will do is that it will send the

9:51:35information to the actor like this. It

9:51:37will wait for the actor which in this

9:51:39case can take 45 seconds to finish and

9:51:41then it will give us the data. Okay? So

9:51:43in this case that's exactly what we

9:51:44want.

9:51:46Uh time out, we don't need time out.

9:51:48Memory is fine.

9:51:49That's fine.

9:51:50So let me actually test this. Uh in this

9:51:52case I can press execute step.

9:51:54I believe, yeah.

9:51:55So what this will do is it will go here.

9:51:56You see how now

9:51:58it's running. So it's running a new

9:51:59search term uh based on the

9:52:02keyword AI agents which we just run

9:52:04before.

9:52:05Again, execute step. The good thing

9:52:06about end to end is that you can

9:52:07actually test it using the data from the

9:52:08previous steps. So now it's waiting. So

9:52:10we're we're actually waiting for the

9:52:12data to come back. We scraped 60 so far.

9:52:15And now we have to wait another 20 more

9:52:16seconds for it to to load. Um but this

9:52:18right here is is basically what's

9:52:19happening. It's giving us a whole log of

9:52:21the whole of everything that's happening

9:52:22within the actual platform and how it

9:52:24scripts. All right, cool. So it's

9:52:25finished. If I go here, I can see that I

9:52:28get different data. But we don't

9:52:29actually get like you can see here we

9:52:30don't actually get the tweets. What we

9:52:32get is a bunch of fields and

9:52:35the thing that you really have to care

9:52:36about is this right here, default data

9:52:38set ID. Because this right here is the

9:52:40thing that we're going to feed into the

9:52:41next node

9:52:42the Apify for us to actually extract the

9:52:44information. So if I copy this code

9:52:47and I go here and I put another Apify

9:52:48node, Apify

9:52:50in this case it can be get data set

9:52:52items.

9:52:53So let me I mean I can just find it.

9:52:55There we are, right here. Get data set

9:52:57items. So if I go to get a get data set

9:52:59items, what this means is that

9:53:01the only thing that we have to feed it

9:53:02is the data set ID.

9:53:04So if I paste it manually, in this case

9:53:05we have to be automatic.

9:53:07I execute the step. Now this will give

9:53:09me all the data just 50 items, 50 tweets

9:53:12for that specific keyword. Where we can

9:53:14where we can go through. I go on table

9:53:16and see that it's a bunch of data and

9:53:18it's divided into pages.

9:53:19This is how we get the data from Apify.

9:53:21This actor runs, we wait for it to

9:53:22finish, then we get the data set ID

9:53:23which we feed into the second node which

9:53:25will get all the data from that data set

9:53:26ID and then we can go out and uh and use

9:53:29it for whatever. Now the limit we can

9:53:31leave to 500.

9:53:33So if I go to execute step

9:53:35now we see 179. It was 50 because that's

9:53:37the limit. Um

9:53:39well that was the limit.

9:53:40Data set ID, well that's the thing we

9:53:42have to replace. In this case you can go

9:53:43here to default data set ID.

9:53:45And you want to drag it across here.

9:53:48And the connection is the same. The

9:53:50resource is data set. Operation is get

9:53:51items.

9:53:52Uh offset, limits and that's all good.

9:53:55All right, so now that we have the data,

9:53:57we can go to the next step. So if I go

9:53:58here to Miro

9:54:00uh the next step is to use AI to check

9:54:02the relevance. There's only one problem

9:54:03here is that we're sending 179 items to

9:54:06the AI step which you can't do because

9:54:08sometimes it can overload which means

9:54:10that it's too much information and will

9:54:11not run, it will error out. Uh so

9:54:13[music] in this case, in order for us to

9:54:14actually be able to send

9:54:16let's say 50 and then 50 again and then

9:54:1850 again until it finishes we have to

9:54:20use a loop over items. So I go loop

9:54:23over items.

9:54:25And now it's asking me for a batch size.

9:54:27So batch size is saying okay, what is

9:54:28that number how many items do you want

9:54:30to send through before we loop back and

9:54:32get another, right? So in this case we

9:54:33can do 50

9:54:35and leave everything else as is.

9:54:37So in theory now

9:54:39it will get 179 or whatever it is it

9:54:41needs to get. It will send it it will

9:54:43send only send 50 through

9:54:44based on here and then it will go back

9:54:4650 again, 50 again until it finishes.

9:54:48Okay, so I'm going to delete this.

9:54:50Let me delete this. And now I can start

9:54:51adding the next steps of the automation.

9:54:53So in this case again is the AI to check

9:54:55the relevance. So we can go here loop to

9:54:57AI

9:54:58we can go to open AI

9:55:00message a model because we're messaging

9:55:02a model.

9:55:03And now, in order for us to connect our

9:55:04OpenAI to n8n, we have to go here to

9:55:07create a new credential.

9:55:09We have to get the API key. Now, the API

9:55:10key is something is sort of like a

9:55:11password that says, "Hey, and then you

9:55:13have access to my account. You can talk

9:55:15to it. You can talk to the GPTs,

9:55:17whatever it is you have to do."

9:55:18automatically. In order for us to get

9:55:20the API key, we have to go to here to

9:55:21platform.openai.com.

9:55:24We can go to uh you have to sign in, of

9:55:26course. Go to dashboard. Go to API keys

9:55:28on the left-hand side. You can create a

9:55:30new secret key on the top right. Uh name

9:55:32it whatever you want. So, we can do n8n

9:55:34workflow.

9:55:35When you create a secret key,

9:55:36this now will be the API key that we

9:55:38will use

9:55:39when you have to go back to n8n and

9:55:41paste it here.

9:55:42Okay? Now, make sure you don't share

9:55:44this API key with anyone cuz it is um

9:55:46it is something that if someone else has

9:55:48access to it, they'll start spamming

9:55:49your money. Um so, don't do it. So, copy

9:55:52this, bring it back here, paste it, and

9:55:53then you will have the connection

9:55:55sorted. Now, once this is done, you'll

9:55:56have the connection here. The resource

9:55:58is text. The operation will be message a

9:55:59model. The operation is sort of saying,

9:56:01"What is it that we're doing?" Uh and

9:56:02then from the list, the models, we can

9:56:03just use Let's do 4.0 latest. I think

9:56:07that's fine.

9:56:08Or 4.0 mini.

9:56:10I think 4.0 mini is 4.0 Yeah, 4.1 mini.

9:56:13That's like

9:56:14We're looking for something that's like

9:56:15quality plus speed, right? Um so, 4.1

9:56:18mini. That's fine. All right, so we have

9:56:20the prompt right here, which is in this

9:56:21case a system prompt because again, we

9:56:23give it an identity. Uh if I go in here,

9:56:26let me just zoom in.

9:56:27You can say, "You are a helpful, precise

9:56:29tweet classifier for an

9:56:30automation-focused audience, uh people

9:56:32who build or learn automations, n8n,

9:56:33make.com, Zapier, uh APIs and webhooks,

9:56:35AI agents, RPA, workflow ops,

9:56:37integration patterns, rebuild tool

9:56:38releases that impact automation work."

9:56:40Now, this will obviously be replaced

9:56:41with whatever you're doing. Um so, you

9:56:43can change this to to your kind of

9:56:45audience. Uh but for me, it's AI

9:56:46automation. And now, I'm going to start

9:56:47adding the user and assistant. So, for

9:56:50the user, I'm going to add a prompt that

9:56:53allows it to

9:56:54So, user.

9:56:56Uh to see whether this is relevant or

9:56:57not. So again, system is for you are a

9:57:00helpful, intelligent XYZ. So, it knows

9:57:01it's that thing. So, if it thinks it's

9:57:03that thing, it's going to the output of

9:57:04quality is going to go better uh cuz you

9:57:06give it an identity. And now, for the

9:57:07user prompt, we say, "Hey, classify a

9:57:09tweet for an automation-focused

9:57:10audience. Return only verdict uh

9:57:12relevant or not relevant." So, this is

9:57:13using JSON.

9:57:14We're saying, "Hey, only output this.

9:57:16This is the key. This is the value.

9:57:18Relevant or not relevant um based on

9:57:21these rules. Relevant if it contains

9:57:23actual automation content, how-tos,

9:57:24rebuild, API, webhooks, integrations,

9:57:26agent, RPA, workflows, templates, or ops

9:57:28patterns." Cuz in this case, we only

9:57:30want things that are actually relevant

9:57:32to what we do. And then not relevant if

9:57:33it's generic AI tech news, motivational,

9:57:35personal, non-automation, coding, uh

9:57:37politics, finance, or tool discounts, or

9:57:39vague hype with no build impact. And we

9:57:41only tell it to output JSON only. Okay?

9:57:43Because that's the only variable that we

9:57:45want. We don't really care about

9:57:46anything else. We just want to say,

9:57:47"Hey, is this relevant or is this not

9:57:49relevant?" Uh once this is done,

9:57:51now

9:57:52we can give it the tweet. Um so, if I

9:57:55add another user message,

9:57:57so in this case, I have to I believe I

9:57:59have to run the previous steps.

9:58:01Yeah, I have to run the previous steps.

9:58:02For me to see here, I have to execute

9:58:04previous nodes. This case, it's running.

9:58:06So, we have to wait about 40 seconds,

9:58:07but then we'll be able to pin the data,

9:58:09and then we can we don't have to rerun

9:58:10everything again.

9:58:11All right, so it just finished running.

9:58:12Um I mean, now we're using AI.

9:58:15But we have the variables on the

9:58:16left-hand side that we can use to

9:58:17actually add it here.

9:58:19Uh I'm just going to stop this.

9:58:20There we go. Okay.

9:58:22Now, all we have to add is this. So, we

9:58:24added, "You are a a helpful, intelligent

9:58:25um whatever assistant." And the prompt

9:58:28is, "You need to check whether the

9:58:29actual tweet is relevant or not." Uh but

9:58:32now, we have to give it the tweet. So,

9:58:34the last user message will be, "Here's

9:58:36the tweet

9:58:37that you need to classify."

9:58:41And now, we have to find the tweet here.

9:58:43So, if I go to not loop over items, it

9:58:44will be get it data set items for sure

9:58:46because that's where the data's all at.

9:58:48If I scroll, something you have to do

9:58:51with these sort of things cuz there's so

9:58:51many fields. Most of them don't matter.

9:58:54Okay. Okay. Yeah, it's definitely

9:58:55description.

9:58:56Description.

9:58:57That's the closest thing that looks like

9:58:58a tweet. Yeah, description. So, now we

9:59:00can

9:59:02drag this across.

9:59:04Not loop over items.

9:59:06This one right here. We can [music] drag

9:59:07this across. Make sure it's a verify.

9:59:10Right here. And now, this will be the

9:59:11thing that will be used to actually

9:59:13check whether it's relevant or not. So,

9:59:15here we can rename this to relevance

9:59:17agent. Although, it's not really an

9:59:19agent, right? Cuz it's just a step. It's

9:59:20an AI step. All right, cool. So, once we

9:59:22do this, now we can

9:59:27We can go to the next step, which in

9:59:28this case is actually filtering. Okay?

9:59:30So, we want to actually run this

9:59:32because

9:59:33we want to make sure that we have the

9:59:36data to test.

9:59:38Uh but I actually forgot to do one

9:59:39thing. So, this agent's going to run,

9:59:41but I forgot to do one thing, which is

9:59:42turn this on. Uh output content as JSON

9:59:44because we tell it, "Hey, output this as

9:59:45JSON." So, we have to turn this on to

9:59:47let it know the output is JSON. That's

9:59:49all it is. Uh so, now what it's doing is

9:59:51it's uh running through 50.

9:59:54So, I mean, we still get the data. And

9:59:55I'll show you exactly what it looks

9:59:56like.

9:59:57Um but now, it's running through all the

9:59:58prompts. It's checking every single

9:59:59first or every single Twitter um post

10:00:01that's made.

10:00:03And that's the thing we're going to use

10:00:04to go into the next steps. All right, so

10:00:05you can see now uh it's null. There's no

10:00:07data.

10:00:09So, now we have to turn this on, output

10:00:11content as JSON, and let's rerun it

10:00:12again. I said execute the step again.

10:00:15Now, it will take the data from these

10:00:16steps, and now it will run it again to

10:00:18make sure that we can now actually test

10:00:20the data or test the the step to make

10:00:22sure that we we have the correct things.

10:00:24All right, cool. So, now that it's

10:00:25finished, I can see here

10:00:27schema.

10:00:28Okay, why did it error out? Why did it

10:00:30not work as we expected it to? Okay,

10:00:33this is part of the process, so let's

10:00:34see.

10:00:35I think it might be because of it's not

10:00:38actually the author description, it's

10:00:39the text.

10:00:40Let me just press text here, and let's

10:00:42see what I get.

10:00:44It should be full Okay, that's why.

10:00:46Okay. Full text.

10:00:48I think that might be it. Yeah, yeah,

10:00:49yeah. I think I'm right. Full text is

10:00:51the full text of the Twitter post. So,

10:00:53let me execute the step again.

10:00:55And again, this is part of the process.

10:00:56I mean, we we mess up. We have to see.

10:00:58We have to check the variables, not

10:00:59check the variables, see what works or

10:01:00what doesn't work. Um And if I didn't

10:01:02show this part of the process, I'd be

10:01:03lying cuz that's always what we go

10:01:05through when we build automations.

10:01:07I'm just going to wait again until it

10:01:09finishes. All right, cool. So, now if I

10:01:10go in here, I can see that now we have

10:01:12relevant, not relevant, and so on. Now,

10:01:14the next step here is to add a filter

10:01:16because we're asking it to give us the

10:01:18relevant and not relevant so that we can

10:01:19filter out the ones that are not

10:01:20relevant and only send the ones that

10:01:21are. In this case, to add a filter, we

10:01:23just press plus and put filter.

10:01:26Remove items matching a condition. This

10:01:28case, the filter would be

10:01:30if the verdict is equal to relevant,

10:01:34then we send only those one through.

10:01:36That's it.

10:01:37That's all we're doing. So, if I run

10:01:38this,

10:01:41believes that it will do it.

10:01:43Yes. Should do it.

10:01:46Or it's running Oh, it's going to run it

10:01:47again. Okay.

10:01:48I forgot to pin the data. Okay, I should

10:01:50have pinned the data so that I don't

10:01:51have to run it again. For always for

10:01:53always remember to pin the data cuz then

10:01:55you see how now to rerun this to only

10:01:57run the step, I have to start everything

10:01:59again, and I have to wait like 40

10:02:00seconds. Um so, lesson learned. Uh we're

10:02:03going to pin the data in the next uh in

10:02:05the next round. All right, so it just

10:02:06finished, and you see how of the 50 that

10:02:08went through, only 27 stayed. Only 27

10:02:11were relevant. Now, let me pin this

10:02:13data. I can drag it across, and press P.

10:02:16So, now if I wanted to test this again,

10:02:18I would just um

10:02:20have this finished.

10:02:22And now, to get into the next steps, uh

10:02:25we have to go to the rewrite relevant

10:02:28tweet. Okay, we're still going to use an

10:02:30AI, but in this case, we're not using

10:02:31OpenAI, we're using Claude. Now, the

10:02:33reason why we're using Claude is cuz

10:02:35Claude is extensively better at writing

10:02:36content. Okay? So, if I go here and I

10:02:39type Claude, Anthropic,

10:02:42I can go to generate a prompt.

10:02:45Zoom out. Now, to connect your Claude to

10:02:49the uh n8n, we have to go here, create a

10:02:52new credential. You have to get the API

10:02:53key. So, we can go to anthropic.console.

10:02:56Um get the API key.

10:02:59Create a key right here.

10:03:00You can name it whatever you want, and

10:03:02then you can add, and you'll get the API

10:03:03key.

10:03:04Once that's done, you bring it back, and

10:03:05you will paste it here.

10:03:07All right. So, now that you pasted it

10:03:08and now you connected your API key to

10:03:10Claude, the resource is text. We want to

10:03:12message a model. The list uh let's do

10:03:153.5 Haiku. That's fine.

10:03:19I think that is one of the best at

10:03:20writing content.

10:03:22Or is it Sonnet? Okay, let's just do

10:03:23Haiku in this case. I think this is like

10:03:24the fastest. It takes the most context,

10:03:26uh the most amount of words. And the

10:03:28prompt in this case, let me just copy it

10:03:30from the automation I made before.

10:03:31It's the one here.

10:03:34It says, "Overview. You're a helpful,

10:03:35intelligent writing assistant.

10:03:37Uh rewrite the tweet that I'm going to

10:03:38give you in a in a way that encapsulates

10:03:39the original theme, but uses different

10:03:41words." So, that's what paraphrase and

10:03:42just means. We're taking something and

10:03:43rewriting it in our own words. "I'm

10:03:45targeting this audience. My results uh

10:03:47are this. So, worked with over generated

10:03:49just under six figures, worked with 40

10:03:50businesses, and taught over 17,000

10:03:52people. And I got to do a bunch of fun

10:03:53stuff like travel, enjoy my life, etc.

10:03:55The rules is use a non-fluffy, young

10:03:56tone when rewriting the tweet because

10:03:58that's me. Young. Um and then only

10:04:00output the tweet, and that's it."

10:04:02That's a pretty standard prompt. That's

10:04:03a pretty good prompt. It has overview.

10:04:05It has task, and it has my results. Now,

10:04:06what you see here is hashtags. Hashtags

10:04:08are in mark They're used for markdown

10:04:10formatting. So, this right here means

10:04:12it's heading one. This right here is

10:04:13heading two. Heading two. Heading one.

10:04:15Okay? We do this because that way, the

10:04:18GPT knows what's the title, and it can

10:04:20it can basically categorize or has the a

10:04:22hierarchy to what to look at first.

10:04:24All right, so now that this is done, we

10:04:26can now prompt the same model to uh we

10:04:29have to give it tweet essentially for it

10:04:30to actually do something.

10:04:32So, we can add a message, user. In this

10:04:34case, we can say, "Here is the tweet

10:04:39to rewrite."

10:04:42Rewire. Rewrite.

10:04:44All right, and now we can pull the tweet

10:04:46from

10:04:47So, if

10:04:48uh was it full text?

10:04:50Yeah, full text.

10:04:51There we go.

10:04:53All right. So, now that this is done, uh

10:04:55we can I believe test.

10:04:58Yeah, we can test.

10:05:00Let me actually me pin this.

10:05:03Pin this as well.

10:05:05Pin this as well.

10:05:07Cuz I don't want any problems having to

10:05:09run everything.

10:05:10Uh let's uh let's execute the step. So,

10:05:12now it's actually running.

10:05:15This is running, taking the data from

10:05:16here and from here.

10:05:18And it's going to give us an output.

10:05:20Which you then need. All right, in the

10:05:21meantime,

10:05:22uh once we finish this, we have to make

10:05:24a Google Sheet. Okay, so let's make the

10:05:25Google Sheet right now.

10:05:27Let's go to

10:05:28sheet.new.

10:05:30Let me copy the headers that I had

10:05:31before, keywords, original post, and

10:05:33rewritten post. Cuz again, we want the I

10:05:36mean that what I wanted here when I

10:05:37actually thought of the system was the

10:05:39keyword. I I want to see exactly what uh

10:05:41where the comment came from, the

10:05:42keyword. The original post, so in this

10:05:44case, it'll be the original tweet,

10:05:46rewritten tweet.

10:05:49Okay, that's fine.

10:05:50All right, so you can see this is taking

10:05:52uh a bit long, but that's fine.

10:05:54Cuz it is taking I mean it is Claude. It

10:05:56is 27 items as well to rewrite

10:05:58something, so that's uh that's normal.

10:06:00So, now let's rename the sheet to

10:06:04Twitter.

10:06:06Mhm, Twitter system, cuz I already named

10:06:08this parasite system. Twitter system.

10:06:10The sheet is one. Uh let's put this to

10:06:12new

10:06:14tweets

10:06:15ideas.

10:06:17And now okay, we have the output here,

10:06:18which in this case is rewritten uh

10:06:22rewritten tweets that we can use. And

10:06:23now we want to store everything in a

10:06:24Google Sheet. So, I'm going to go here,

10:06:25press plus, sheet, Google Sheet, add

10:06:28row, so append a row. Append just means

10:06:29add.

10:06:31And now you have to connect your Google

10:06:32Sheet. So, you have to go here, create a

10:06:33new credential. You can sign in with

10:06:34Google. It will take you to a page. You

10:06:36can just press the account. In this

10:06:37case, this is my account.

10:06:39Press okay.

10:06:41It's successful. Means it's all good.

10:06:43You can go back to N8N.

10:06:44Name this

10:06:45Kelley connection.

10:06:47And then update. Press save.

10:06:50That's fine. The connection's made. Now

10:06:51we want to do a sheet within the

10:06:52document. We want to append a row.

10:06:54Again, operation just means what's the

10:06:55action that we're doing.

10:06:57And the document is Twitter

10:06:59system.

10:07:01Twitter system. Cool. And the sheet is

10:07:04new tweet ideas.

10:07:06We want to leave this as map each column

10:07:08manually because this is the manual

10:07:09step. We want to basically map the

10:07:11variables to the columns so that they

10:07:12change and they add every single time.

10:07:14In this case, the keyword is

10:07:17where can I find the keyword somewhere

10:07:18here? No, I think I think we have to run

10:07:19this. Yeah, yeah, we have to run this.

10:07:23Execute step.

10:07:26Okay, wait. Let me get the Let me get

10:07:27the link. Execute step.

10:07:30AI agents.

10:07:33Now I have this. I can pin this.

10:07:36So, that here I think now

10:07:38I'll have access. Okay, I think I need

10:07:40to rerun.

10:07:41Oh, no, here right here.

10:07:43Mhm.

10:07:45Yeah, I'm going to have to rerun all the

10:07:46steps

10:07:47in order to get the data.

10:07:49That's fine.

10:07:50That is okay. That is okay, it happens.

10:07:52I should definitely get better at

10:07:53pinning data and

10:07:55making sure the data is not we don't

10:07:56have to rerun the whole thing.

10:07:58And we can have previous steps pinned.

10:08:00So, we can use it for the next steps.

10:08:04And learning process here, so it's fine.

10:08:06Okay, so now this is done. When this is

10:08:08done, we have to pin this. Uh we'll be

10:08:09able to access this variable right here,

10:08:11I believe.

10:08:13And then we can add everything to the

10:08:14sheet. All right, cool. So, now it uh it

10:08:16ran successfully. Let me pin this as

10:08:18well.

10:08:19And here,

10:08:20uh at least one value has to be added.

10:08:21Yeah, that's fine cuz we didn't add any

10:08:22keywords. Uh here I should be able to

10:08:24see the keyword. Perfect.

10:08:26Original tweet, this is

10:08:29the text, so full text.

10:08:33Let me do something actually cuz I I

10:08:34keep having to be looking at this. Let

10:08:35me just put a set

10:08:39a set variables node. Like I'll show you

10:08:41exactly what it is, but um let's do

10:08:43keyword.

10:08:45It just makes it so I don't have to go

10:08:46back to here and and find everything.

10:08:48But if I put keyword here

10:08:50and I put uh

10:08:51get data set items,

10:08:53I put text. This is like the tweet.

10:08:56Original tweet.

10:08:59And this is re

10:09:01written tweet.

10:09:04I can go to Claude

10:09:07and get this.

10:09:10Now

10:09:11if I go here to

10:09:13to Google

10:09:15Sheets. Let me run this. Using the item

10:09:17method does not work when pinned data in

10:09:18this scenario. Please unpin get data set

10:09:19items and try again. [music]

10:09:21Okay.

10:09:23So,

10:09:24we're in a bad position again.

10:09:26That's fine. Let me just do AI agents

10:09:29and then I can change this later.

10:09:31Let me just

10:09:32start this.

10:09:35Simple filter.

10:09:38Okay, cool. Then this runs. Okay, I just

10:09:40wanted the data here so I can I can just

10:09:42send it here.

10:09:43Okay, now you see how I don't have to go

10:09:45back and forth in the form.

10:09:48Find it here, find it here, find it

10:09:49here. I already have it here. Keyword,

10:09:51original tweet,

10:09:53and rewritten post or tweet. Okay, so

10:09:55it's much easier for me to uh to

10:09:57actually use it.

10:09:59Now if I go here, I need to send this

10:10:00back

10:10:02to the keyword.

10:10:05I don't know why I did I don't know why

10:10:06I did that. There you go. It's here.

10:10:09Keyword.

10:10:10So, that's fine.

10:10:11Because again, we're mapping it from

10:10:13from the previous steps.

10:10:15And lastly, I'm just going to run

10:10:16everything from scratch

10:10:18to see how everything works. And one

10:10:20more thing we have to do is this right

10:10:22here. When it finishes, we have to get

10:10:24back

10:10:26uh here

10:10:28to make sure that we get the rest that

10:10:30are finished. Because we have 100 uh

10:10:32215, only 50 go through all this. We

10:10:34want to go all the way back to get

10:10:36another 50 until it finishes.

10:10:38Let me unpin this.

10:10:42Let me unpin this.

10:10:43I'm just pressing P. I'm hovering over

10:10:45it, pressing P.

10:10:46Now we're going to start the whole thing

10:10:47from scratch. Let me reload.

10:10:51Let me get this whole thing good.

10:10:52Let me execute workflow.

10:10:55Let me do

10:10:57MCP.

10:11:00Mhm, yeah, I think I think it's fine. I

10:11:01think it's pretty it's a pretty hot

10:11:03topic right now. So, submit.

10:11:05We can go here. So, now it's running the

10:11:06actors. If I go to Apify,

10:11:09I can go to running and I can see here

10:11:11that is running, which is great to see.

10:11:14I guess most most of the times when

10:11:15you're building automations, things

10:11:16don't go your way and things don't work,

10:11:18but it's about figuring it out. That

10:11:19that's how you really become the system

10:11:21architect. Uh when things don't go your

10:11:23way, you just build, you iterate, you

10:11:25just get better. And now we can see all

10:11:26of this is running, which is great.

10:11:28Um how many workers did I get? Okay,

10:11:30we've got 97 so far. All right, now it

10:11:32went to get the data set items.

10:11:34It then sent it to the first AI step to

10:11:35check the relevance of the agent. Then

10:11:37again, as you can see here, only 50 went

10:11:39through. And also, if you're asking what

10:11:41done is, this just means once everything

10:11:43is looped and everything's fine, what is

10:11:45the thing [music] we do? In this case,

10:11:46if you leave it blank, nothing will

10:11:47happen. Uh but you can maybe send an

10:11:48email to yourself saying, "Hey, uh we

10:11:50just finished looping through all the

10:11:51items." In this case, we don't it's not

10:11:53really necessary, so we don't have to do

10:11:54it. All right, so it's good. Out of 50,

10:11:56only 27 went through. Now we're using

10:11:58Claude to rewrite the posts, which will

10:12:00take about 40 seconds uh before we add

10:12:02everything to the sheet. All right, so

10:12:03now it's finished and now it's going to

10:12:04the Google Sheet.

10:12:06Now it's going back to get the other 50.

10:12:08So, I can see here that I mean it is a

10:12:10bit messed up. So, if I go here and I

10:12:12actually format it,

10:12:13I can see that now the keyword is MCP.

10:12:15This is the original tweets. This is the

10:12:17rewritten tweets.

10:12:19Now I can use this for whatever it is I

10:12:20have to use.

10:12:22All right, which I have a stream of

10:12:23content ideas just come through based on

10:12:24a topic tweets based on that topic in uh

10:12:26in Twitter that I can use.

10:12:31Hey, I'm about to show you an AI system

10:12:32that I built that scripts YouTube

10:12:34comments from any video and turns them

10:12:35into fresh, high-converting video ideas.

10:12:38Pulls in real feedback from your

10:12:39audience or even your competitors so you

10:12:40can see exactly what people want, what

10:12:42they're confused by, and what they're

10:12:44asking for next. All right, so this

10:12:45right here is a full end-to-end

10:12:46automation that I built. Uh and by the

10:12:48way, if you want the free resource, the

10:12:49whole template that you can download for

10:12:51your account, all you have to do is go

10:12:52to my free school community, go to

10:12:54classroom, go to tap it's vault, and

10:12:55right here you'll see the latest video

10:12:57that I posted with the resource that you

10:12:59can download. And if you're unsure as to

10:13:01how to import it onto your account,

10:13:03there's also a tutorial right here that

10:13:04I made, which is import blueprint to

10:13:06N8N.

10:13:07All right, with that being said,

10:13:09let's dive in. So, the automation itself

10:13:11is is a workflow. So, this is not an AI

10:13:13agent and there's a very specific reason

10:13:14for that and we'll talk about that in

10:13:16just a second. But it's separated into

10:13:17six different steps. The first step is

10:13:19list of YouTube channels. So, we have a

10:13:20list of YouTube channels in the a

10:13:22channel ID. So, we have a channel ID

10:13:23from each channel. From each channel, we

10:13:26took the 15 posts that are most recent

10:13:29from the feed. We script comments from

10:13:31those posts, the most recent ones. Then

10:13:33we check with AI if it's relevant to

10:13:35what we do and who we help and who we

10:13:37serve. Uh if it's relevant, it makes a

10:13:39title for that idea or comment, a

10:13:42YouTube channel, a video idea that could

10:13:43happen based on that comment. Then

10:13:46based on if it's relevant, we also

10:13:49generated hook and outline and we store

10:13:50everything in Notion, which is where we

10:13:52store everything for YouTube ideas and

10:13:53so on that you can then use to actually

10:13:55draft it and post it and so on. All

10:13:57right, cool. So, the way it's going to

10:13:58work, I'm going to run this. Um so,

10:14:00typically you would have this running

10:14:01every month, but I'm going to add a

10:14:02manual trigger.

10:14:04So, I'm going to go here.

10:14:06Otherwise, trigger manually, right here.

10:14:08Connect it.

10:14:10So, I want to see I want to show you

10:14:11exactly how it works and how it looks

10:14:13and everything around it and then we can

10:14:14go into step by step how it actually uh

10:14:16works and all the settings and stuff.

10:14:18All right, so I'm going to execute

10:14:19workflow, which starts the workflow from

10:14:20the start.

10:14:21It ran over here. We script the YouTube

10:14:23channels. Now it's using Apify, which is

10:14:25an external software to be able to

10:14:27scrape. Scrape just means extract

10:14:29comments from these videos.

10:14:31It is going to take a while just because

10:14:33it's 14 items, so it's 14 uh videos that

10:14:35it has to scrape, right, for each each

10:14:38time. As you can see right here, the

10:14:40actor is running. So, the automation's

10:14:42running. So, we have to wait it until we

10:14:43get the actual uh result back from here.

10:14:46Okay, then once it's done, which took

10:14:47about a minute or two, uh it goes to the

10:14:49wait because we're waiting until we get

10:14:51the results back from Apify, and I'll

10:14:52explain exactly what that means.

10:14:54And then once we get the actual items

10:14:56and the results, we only In this case,

10:14:58we have 505 comments. These 505 comments

10:15:01will go to the first agent. So, in this

10:15:02case, it's an AI step. It's not really

10:15:04an agent that checks whether it's

10:15:05relevant. If it's relevant, it makes the

10:15:07title for our video.

10:15:09And then send it through here to be able

10:15:11to then make the hook and the outline,

10:15:13right? Uh in this case, we're only

10:15:14passing 50 items at the time, which is

10:15:17why we're using loop over items, which

10:15:18means that out of 500 it doesn't send

10:15:20all 500 at the same time. It sends 50,

10:15:23right? And then we do 50 again and 50

10:15:24again until it's done, right? Um to make

10:15:26sure that we don't we don't time out, we

10:15:28don't get we don't exceed exceed the

10:15:30token limit, which is something that

10:15:32happens with AI when you add way too

10:15:34much text way too much information.

10:15:36Okay, now that is done, it only passes

10:15:38through the ones that are valid. In this

10:15:39case, it's only seven. So, from those

10:15:41seven, we generate the hook and the

10:15:42outline to then send it to Notion, which

10:15:45is where we add we store everything

10:15:47right here. As you can see, the topics

10:15:49are being added right now.

10:15:50We have the content idea, we have the

10:15:52hook, and we have the outline, right?

10:15:54So, let's take an example. So, we have

10:15:56how to automate meta ads inside and

10:15:57manage unlimited videos. Then here,

10:16:00I have the hook. So, based on this idea,

10:16:02we have

10:16:03I've helped over 40 businesses automate

10:16:05their AI and workflows. Uh today, I'm

10:16:06going to show you how to automate meta

10:16:07ads inside and manage So, this is a very

10:16:09simple hook. It follows a very specific

10:16:10framework that I use, uh which is

10:16:12credibility and then talking about what

10:16:14we're doing. And then we also have the

10:16:15outline right here, which is basically

10:16:16giving you a structured outline for the

10:16:18video that you can make uh from 1 to 8,

10:16:21which is great because when we're

10:16:22filming YouTube videos, it's Sometimes

10:16:24it's hard uh to think through an outline

10:16:26or you take some time to think through

10:16:27how you can position the video, how you

10:16:29can talk about from step by step um

10:16:32instead of just going on the camera and

10:16:33just just speaking out of nothing,

10:16:35right? Um so, that's exactly what we're

10:16:36doing the outline as well.

10:16:37And now what it's doing is that it's

10:16:38going back here.

10:16:41It's then doing the whole process again

10:16:44until all the 505 comments are being

10:16:46passed through.

10:16:48Okay, in this case, only 100 went

10:16:49through.

10:16:50And

10:16:51as you can see, more and more being

10:16:52added to Notion. More and more comments.

10:16:54So, you just have a stream of video

10:16:56ideas that you can use for your channel,

10:16:58uh which is awesome, especially for I'm

10:17:00in YouTube game, so I'm I always did

10:17:02YouTube, and that's what I that's what I

10:17:03do right now. Um so, this is awesome.

10:17:06I'm using this myself to be able to

10:17:08>> [music]

10:17:08>> just figure out what people want, what

10:17:09people don't want. I feel like you don't

10:17:10really run out of ideas in the AI space,

10:17:13but it's still good to know what people

10:17:14want, what people are struggling with,

10:17:16um the sort of problems that they want

10:17:17solved, the sort of videos that you can

10:17:18make based on feedback from other videos

10:17:21other comments that they put on videos,

10:17:22right? Which is such an underrated

10:17:24strategy. So,

10:17:26as you can see, now I have a list of

10:17:27topics. And again, this is running until

10:17:29it's finished until all the 500 items

10:17:31are finished. So, I'm just going to skip

10:17:32to the part where it's done.

10:17:34So, because it will take about 5 to 10

10:17:35minutes, I'm going to stop the

10:17:36automation.

10:17:39So, it'll take too long. Uh but as you

10:17:40can see, now what it will do literally

10:17:42was

10:17:43based on this one channel, so only one

10:17:45channel went through. It took all the

10:17:46videos, it scraped all the comments from

10:17:47those videos, it sent it through here to

10:17:49check the relevance. If it was relevant

10:17:52to us, what we want and what we do and

10:17:53who we serve, then it made the hook and

10:17:55the outline. Then it sent it to our

10:17:56database, and then it goes back here

10:17:58to get through all the comments. And

10:18:00then once that comment is done, at least

10:18:02all these comments are done, then it

10:18:03goes back and does the second channel

10:18:05and the third channel or how many

10:18:06channels you put. So, it's a whole

10:18:07repetitive loop that you don't have to

10:18:09really do nothing apart from adding the

10:18:11channels there. And you can run this

10:18:12every month, and this just runs

10:18:14automatically. Um and you just have the

10:18:16content ideas that just have here with

10:18:17the hook and with the outline. You can

10:18:19then obviously review, approve, or or

10:18:22reject, right? Whatever you want. Uh

10:18:24okay, cool. So, I'm going to save this.

10:18:27I'm going to refresh. Um

10:18:29We can go through step by step how I

10:18:30actually build this. This is I would say

10:18:32one of the more complex automations, but

10:18:34it actually is very simple once you

10:18:35break it down step by step and go

10:18:37through the logic of what you have to do

10:18:39when you're building. So, again, the

10:18:41first step would typically be

10:18:43uh on on time trigger. Typically, every

10:18:45single month because you're only

10:18:46scraping 15 videos, and 15 videos is

10:18:48typically what someone uploads every

10:18:49month if they're on it, right? Um which

10:18:52a lot of YouTubers are, which is great.

10:18:54So, we get to pull comments from their

10:18:55videos or even our videos, right? This

10:18:57can work for our videos or their videos.

10:18:58So, on time trigger would be the first

10:19:00thing. So, we would have

10:19:02with this ready

10:19:04on a schedule. So, the schedule would be

10:19:06once a month.

10:19:07And then the the first step here is to

10:19:10like the logic here is to have a list of

10:19:12YouTube channels that you can then run

10:19:14through each one and then go through go

10:19:16through the whole flow, right? Um so,

10:19:18this node right here is for us to

10:19:20actually set the channels. So, when you

10:19:22want to set the channels,

10:19:24um you don't necessarily you don't have

10:19:26the you don't have to put the link to

10:19:27the channel. You add the channel ID,

10:19:29right? Which is what we're adding here.

10:19:30I'll explain exactly what this is, um

10:19:32what an array is and all that sort of

10:19:33stuff. But when you go to YouTube,

10:19:35let's say I go to Alex Hormozi, right?

10:19:37Alex Hormozi right here on the URL,

10:19:40he has subscriptions and he has this

10:19:41long code.

10:19:42So, I can if I just pull everything in,

10:19:44I'll go to Miro so I can show you

10:19:45exactly where the ID comes from.

10:19:48Okay, the ID

10:19:50So, we have the fixed part, which is

10:19:52where this one.

10:19:53And then we have the ID, which is this.

10:19:56So, we would need the ID for each

10:19:58channel to be able to actually scrape

10:20:00the channel, okay? So, when you go to

10:20:02the YouTube um and you want to use a

10:20:04channel for this, in this case, you

10:20:05would just copy this. I mean, copy only

10:20:08this part, right? Which is the ID of the

10:20:10channel. And then you would add it here.

10:20:12So, the channel ID. [snorts] Now, the

10:20:13reason why we are And these are three

10:20:15different channel IDs of different

10:20:16competitors that I have in the space.

10:20:18And the reason why [snorts] I have this

10:20:20as an array is because

10:20:22when you want to run

10:20:23three different things at three

10:20:25different times, you need it to be in an

10:20:27array and then split it out.

10:20:29Split it out just means that it takes an

10:20:30array, which is a list of different

10:20:32items inside like here, for example, let

10:20:34me show you.

10:20:36It will give you three different things.

10:20:37So, schema, channel ID zero, channel ID

10:20:39one, channel ID two. And then take each

10:20:41one individually and start running the

10:20:43automation. It will split it out, start

10:20:45running the automation individually,

10:20:47right? It will go through the first one,

10:20:48then it will go back, second one, go

10:20:50back, third one, right? Um so,

10:20:52again, we have this, which is channel

10:20:54IDs, which is I just added channel IDs

10:20:55of my competitors that I can go through

10:20:57every single time. If I wanted to add or

10:20:58remove, I can just simply remove this or

10:21:01add, right? In this case, if I wanted to

10:21:02add Alex Hormozi, all I have to do is go

10:21:05here, bracket, channel

10:21:09ID,

10:21:10and then with the small L.

10:21:14And then you add the the code.

10:21:17And now this is pretty much set. Now,

10:21:19these right here are called key value

10:21:20pairs. This is a key, and this is a

10:21:22value.

10:21:23Okay, the key is channel ID, which is

10:21:25the same for each one. And the value is

10:21:27what is the actual thing. Yeah, you need

10:21:29a space. There you go. Okay, cool. So,

10:21:31that's how you do it. Um and this is

10:21:33JSON. So, the JSON has an array, and

10:21:35that's sort of the the technical part to

10:21:37this. But if you just had an array, you

10:21:39have three different things, you can

10:21:40then split it up. So, the next thing,

10:21:42again, is splitting it out. So, we have

10:21:43the array. The array itself, it doesn't

10:21:45run through each one individually. It

10:21:47doesn't run through them cuz the array

10:21:48only has

10:21:50one thing, which is channel IDs. In this

10:21:51case, we want one, two, and three,

10:21:53right? If I go here, execute step. Now,

10:21:55we can see that we have three items. So,

10:21:57on the table, you can see that we go

10:21:59through the first one, then we go

10:22:00through the second one, and then we go

10:22:01through the third one. Okay, so now

10:22:02we're able to actually run the

10:22:04automation one, first, second, and then

10:22:06third, okay? So, what are we doing here?

10:22:09The settings here are basically channel

10:22:11ID because that's the variable that

10:22:12we're using. In this case, channel ID,

10:22:14which is the one here. Channel ID,

10:22:15channel ID. It's all the same, right?

10:22:16Which is why we're able to split it out.

10:22:18Include no other fields. We just want

10:22:19this, which is where we take these and

10:22:23then take one individually, run it,

10:22:24second individually, run it, and third

10:22:26individually, run it. Okay, so that's

10:22:27what we do. Now, the reason why we're

10:22:29using this loop items is because

10:22:31um n8n natively runs three of them at

10:22:33the same time, right? Not obviously in

10:22:35three different things, but it runs

10:22:37three of them at the same time. We don't

10:22:38want that. We we want to run each one

10:22:41individually. So, to be able to only run

10:22:44one at a time,

10:22:45we have to use loop over items so that

10:22:47we can run this. And then at the end,

10:22:50when it does everything, it goes back.

10:22:51So, that's what this is. It goes back to

10:22:53here and it runs the second one. So,

10:22:55when we add batch size, which means how

10:22:57many items do you want to let through?

10:22:59In this case, it would just be one. We

10:23:01have three, you can see here, three

10:23:02items, but we just want one, which is

10:23:04why we put one here.

10:23:05Uh once we do this, we can then

10:23:09add a field. So, this In this case, we

10:23:10just have the channel ID. This is not

10:23:11necessary, but I just wanted to extract

10:23:13the channel ID so I can so I can have

10:23:15it. Um let me execute the node right

10:23:17here. And now I can just drag this

10:23:19across and put it here. So, I have the

10:23:21channel ID to then feed in to the next

10:23:22step, which is where we actually scrape

10:23:24the videos.

10:23:25Um but this is something that's not

10:23:26necessary. You can just simply add this

10:23:28to the next step. I just wanted to have

10:23:29something that's more clean. So, channel

10:23:31ID right here, which is just mapping

10:23:34field.

10:23:35And now we go to the list of top 15

10:23:38videos that we have to scrape. Now, in

10:23:39order for us to scrape something, we

10:23:41typically we use Apify. So, let me go

10:23:43here, Apify, which is basically a

10:23:45platform where people make their own

10:23:46scrapers. So, they code scrapers. They

10:23:47do the hard part, we do the easy part,

10:23:49which is just using it, right? And the

10:23:50good thing about Apify is that we um

10:23:55it's actually free. So, not necessarily

10:23:57free because we still have to pay, but

10:23:59if I go here to the one that I actually

10:24:00used before, and I'll explain exactly

10:24:01what this is,

10:24:02we can see that for this scraper to

10:24:04scrape a thousand results, which in this

10:24:05case is a thousand comments, we have to

10:24:07pay 40 cents.

10:24:09Okay? And we're basically scraping about

10:24:1120 comments 20 30 comments per video. Um

10:24:14so, we're paying nothing really. And we

10:24:16have $5 for free

10:24:18from Apify.

10:24:19So, if you do the math there, you're

10:24:20basically paying nothing. So, that's why

10:24:22we use Apify here. But

10:24:24for the YouTube videos, we also can use

10:24:26something called an RSS feed. Now, the

10:24:28RSS feed is basically a way for you to

10:24:30tell the web, like, "Hey,

10:24:32using this URL, go out and scrape go out

10:24:34and find um the YouTube videos that we

10:24:36can use." Now, in order for us to set up

10:24:38the RSS feed, we can go here,

10:24:40RSS feed,

10:24:42and then we go to this page right here.

10:24:43And then we have to add our URL. So, the

10:24:45URL is something that is fixed. The only

10:24:47thing that changes is the channel ID.

10:24:50So, we go through here. Within channel

10:24:52ID one, we scrape all the videos.

10:24:53Channel ID two, scrape all the videos.

10:24:55Channel ID three, until we finish all

10:24:56the videos, right? Now, how do we know

10:24:58this URL? How does this happen? Well, if

10:25:00I just go to Google and search up um RSS

10:25:04feed YouTube channels, I can see that if

10:25:07I I usually go to Reddit or you can see

10:25:09here as well that you can use this. So,

10:25:11https www.youtube.com. So, this is just

10:25:14a format

10:25:16for the YouTube videos. If I go here, I

10:25:17can see that this follows a very

10:25:19specific format. It follows the https

10:25:21www.youtube.com feeds subscriptions and

10:25:23then the code, right? In this case, it

10:25:24would be this. Uh it wouldn't be

10:25:27subscriptions. Yeah, it would be feed.

10:25:28So, you go here, you copy this. You

10:25:30would paste it here.

10:25:33Right? And then the only thing you have

10:25:34to change is this part right here.

10:25:36Channel ID here.

10:25:38Which is where we pull in the variable

10:25:40from the previous step to here.

10:25:41That's exactly what I did. So, in this

10:25:43case, if we execute the step, we can see

10:25:47that now

10:25:48we

10:25:49Uh I think this is next arrived. Yeah,

10:25:50next arrived. We um we scraped the

10:25:53videos from next arrived and we have 15

10:25:55of them. So, 15 items means that we have

10:25:5615 videos. And this only scripts the top

10:25:5815 videos. If you want to script more,

10:26:00you could use Apify um to scrape a list

10:26:02of 100, but I feel like for the most

10:26:04recent ones are good because they are

10:26:06the most recent ones, so they're on top

10:26:07of they're on top of like the the most

10:26:09recent one, which is great to scrape. Uh

10:26:11which is exactly what we want. So, here

10:26:14you can see the 15 videos, right? Why

10:26:16automation beginners should start this

10:26:17platform and all this sort of stuff. So,

10:26:19that's what we want to see and that's

10:26:20what this does essentially. And if you

10:26:21change the channel ID, you change the

10:26:23videos that you're scraping.

10:26:24So, it's very very easy. And you can see

10:26:26we just ask Google and they give us the

10:26:28URL. Okay? If I go here, then what we

10:26:31want to do is this is comes from

10:26:34testing. A lot of the videos that people

10:26:35post, not a lot of them, but some of

10:26:37them are shorts. They're not long form

10:26:38videos. So, we want to be able to filter

10:26:41based on whether it's a long form video

10:26:42or short form video. So, if I go here, I

10:26:44can see that the link, so the link right

10:26:47here, yeah, the link right here.

10:26:49If it's a short, it will say it's a

10:26:51short. It will add the word the name of

10:26:53shorts here. Okay? And that's what tell

10:26:55us that it is a short. Now, you can't

10:26:57see here because this is a long form

10:26:58video, but if it was a short,

10:27:01I think it would say https

10:27:02www.youtube.com watch I think shorts

10:27:03something. Uh and that tell us that it

10:27:06is a short. Okay? You can't see here

10:27:07just because this is a long form video,

10:27:09but bear in mind that we're just saying,

10:27:10"Hey, don't let any shorts through. I

10:27:13just want long form videos because

10:27:14they're more validated like that's what

10:27:15they're actually posting." And usually

10:27:17shorts are just a way for people to

10:27:19repurpose their long form videos and

10:27:20then bring them to

10:27:22uh which is exactly what we do, right?

10:27:24So, okay. So, JSON link, we're saying,

10:27:25"Hey, let me drag this across. If the

10:27:27JSON link does not contain shorts, then

10:27:30send it through." Okay, so there are

10:27:31cases. Let me go here.

10:27:33So, see how 14 items went through? It's

10:27:36because Let me go here and show you. I

10:27:38think there there has to be a short here

10:27:39because only 14 went through. There we

10:27:41go.

10:27:43So, you see how on this URL why uh why

10:27:45saturation doesn't matter? This is a

10:27:47short. And if I go here,

10:27:50I can see

10:27:50>> Just cuz something. This is a short from

10:27:52next arrived.

10:27:53Right? And this

10:27:55comparison is a long form video.

10:27:59So, we basically don't want any shorts.

10:28:01We want the long form videos. So, and

10:28:03the only thing difference between each

10:28:04one is that the short contains shorts

10:28:06here.

10:28:07All right. So, the filter's done. And

10:28:09then we go through the Apify. So, third

10:28:12step is scrape 100 comments from the

10:28:13videos. So, if you go to Apify

10:28:16and you go to actors. So, again, Apify

10:28:18is a way for us to be able to scrape

10:28:20Scrape just means extract different

10:28:22information from the web um for the

10:28:24YouTube videos that we're that we're

10:28:25talking about. We want to scrape the

10:28:27comments. So, typically what I would do

10:28:29is you would go to actors or Apify

10:28:32store, sorry. And you can search for

10:28:33actors. Actors, again, are just

10:28:35different pieces of code, different

10:28:37different scrapers that you can use to

10:28:39scrape whatever you want. So, if I added

10:28:41YouTube comments

10:28:44scraper,

10:28:46what I would do first is I would look at

10:28:48payment method because I typically want

10:28:50the pay on results or pay per output,

10:28:53right? Like 40 cents per 1,000 comments

10:28:55because then I don't have to pay. Some

10:28:56of them make you have to get a

10:28:58subscription for Apify, which is the

10:29:00ones that we don't want. But let's say I

10:29:01go here.

10:29:03This is two uh $2.40 for 1,000 comments.

10:29:06This is Yeah, this right here is $20 per

10:29:09month plus usage. So, we would typically

10:29:11have to pay for the scraper, so we don't

10:29:12want this.

10:29:13Uh 50 cents per 1,000 scrapers, that's

10:29:15fine.

10:29:17And then 25 a month, so we definitely

10:29:18don't want this. I found a scraper. What

10:29:21was this?

10:29:22YouTube comment scraper. So, grow social

10:29:24grow social media YouTube comment

10:29:26scraper. So, if I go here, I'm searching

10:29:27it up.

10:29:30Yeah, there we go.

10:29:32I found one that's 40 cents per 1,000

10:29:34results. Okay? So, this is right You

10:29:35just have to copy this. You can copy

10:29:37grow media YouTube comment scraper and

10:29:38you'll find this. This is the cheapest

10:29:39that I found

10:29:41and gives you the best results, right?

10:29:42And the thing that we can add to this uh

10:29:45that we can actually the the fields,

10:29:47right, itself are the YouTube video URL

10:29:49and the maximum comments. So, what's the

10:29:51video and how many comments you want to

10:29:52scrape? So, if I go to Apify, if I go

10:29:54here, back to NNN, I can add a run an

10:29:57actor. So, run an actor just means we're

10:29:58giving you the the actual video. Go out

10:30:01and scrape, right? So, we scrape it.

10:30:04And then, so let's say I go to execute

10:30:06step.

10:30:07What this will do is it will take the

10:30:08URL from here. It will give it

10:30:11the JSON link and it'll tell you, "Hey,

10:30:13maximum comments is 100."

10:30:15So, if I go here to runs,

10:30:17now you can see that it's running. And

10:30:19we got 45 comments so far.

10:30:21And these are all the comments, right?

10:30:22We can have a lot of comments from these

10:30:23videos, which is exactly what we want

10:30:25when we are scraping videos. And that's

10:30:27exactly what we have with Apify. Now, to

10:30:29connect your Apify account, you just

10:30:30have to go here, create a new

10:30:31credential, and then you need an API

10:30:33key. The API key you can find, I believe

10:30:36it's settings, API integrations and then

10:30:39you can have Yeah, this right here.

10:30:41Default API token, yeah. You can copy

10:30:43this and then you can paste it to right

10:30:46here and you can save it and you have

10:30:47the connection. And then you have to

10:30:49choose the actor. By the way, you have

10:30:51to save the actor first. So, if I go to

10:30:53actors,

10:30:54uh YouTube comment scraper, you have to

10:30:55save it. So, save here or start it at

10:30:58least and make a test run to be able to

10:31:00see it here.

10:31:01That's one of the the things that I

10:31:02struggled with at the start. You want to

10:31:03run an actor, that's the action.

10:31:05Recently used actors, that's fine.

10:31:06Actors here. And then the input JSON is

10:31:08what we get from here.

10:31:10Which is basically saying, "Hey, what's

10:31:11that thing that's going into the actor?"

10:31:14So, we put this and now we're waiting

10:31:15for the feedback or for the actual

10:31:17output. So, if I go here to runs,

10:31:19I can see that this is still running. Um

10:31:22I believe we got it back.

10:31:24Or I think Okay, I think it's going

10:31:25through all the 14 items. Okay, I know

10:31:27why.

10:31:28Let me just stop this.

10:31:30This will still keep on running. The

10:31:31reason why it kept on running is because

10:31:33we go through the 14 items and it's

10:31:34going through all the 14 videos, which

10:31:35is why it's it takes quite a bit. Uh it

10:31:37takes like two one to two minutes or two

10:31:39to three minutes based on um yeah, the

10:31:41type of video it is. Um okay. So, once

10:31:44we have that,

10:31:45we can add a wait because of the fact

10:31:47that here the output, yeah, it isn't the

10:31:49actual comments. We get a database uh

10:31:52data set ID. So, if I go here to save

10:31:54executions, I can see the previous one

10:31:55that I had. Okay, I went to one that I

10:31:57would that I did yesterday. If I go

10:31:58here, copy to editor, I can see that

10:32:01this one it ran, it gave it to Apify.

10:32:04And as you can see here, we don't get

10:32:05the actual comments. So, we don't get

10:32:07the comments anywhere here. There's a

10:32:08bunch of stuff. What we need is this.

10:32:11What we need is default data set ID. So,

10:32:13default data set ID is a thing that we

10:32:15then feed into the next node, which is

10:32:17get data set items.

10:32:19Which needs the default data set ID. So,

10:32:21what we do here is we go to

10:32:24the run an actor. We then look for

10:32:26default data set ID, which is something

10:32:28you have to do every single time with

10:32:28Apify. It's just the way it works.

10:32:31So, we drag it across and this is a

10:32:32thing that is now going to use

10:32:34to be able to get the results. And now

10:32:36this is giving us the comment ID,

10:32:37comment text, like count, replies, all

10:32:39that sort of stuff, right? That we want.

10:32:41Once we get the actual results, the way

10:32:42we want to do now is because of the fact

10:32:44that we get, let's say, 500 comments

10:32:46like you saw before here, which is the

10:32:48output of the actual get data set items.

10:32:50We don't want to run through 500 items

10:32:52all at once. We want to be able to batch

10:32:54them. So, basically saying, just like

10:32:56before, we don't want to run through all

10:32:58the channels at once. We want to say,

10:32:59"Hey, we have 500 comments, but I'm only

10:33:01letting 50 through." And this is where

10:33:03the relevance and title come in. Because

10:33:04now we're using a loop item again, which

10:33:06is where we're saying, "Hey,

10:33:08I know we're getting all these comments,

10:33:09but I only want to let 50 through." And

10:33:10then you can run it back and get the

10:33:11others that are left. And then do it all

10:33:13and over and over again until the

10:33:15comments are finished. So, loop items,

10:33:18once this is done is we add it to an

10:33:19agent. I mean, in this case it's not an

10:33:21agent, it's an AI step.

10:33:23To connect your OpenAI to NNN, you have

10:33:26to create a new credential. API key, you

10:33:27can find it at platform. the openai.com

10:33:32under dashboard. API keys. Create a new

10:33:35secret key, create it, and then you can

10:33:36paste it right here. You can save it.

10:33:40Now, once this is done, this will be

10:33:41text message a model. Uh the model will

10:33:42be 4.1 mini uh because I usually use a

10:33:45mini because it doesn't it can take more

10:33:47information, right?

10:33:49And because right now we're giving it 50

10:33:50comments

10:33:51at once all at once in the AI, it will

10:33:54take a while to process. Uh and the

10:33:56prompt that we give it is first

10:33:57assistant prompt, which is a prompt that

10:33:59we give that we give the AI when we want

10:34:01to say, "Hey, you are a helpful

10:34:03intelligent whatever it is." In this

10:34:04case is you are helpful intelligent

10:34:06content writing assistant. So, we give

10:34:07it an identity, so the AI thinks it is

10:34:09that thing and it will the output will

10:34:10be higher, the quality. And then the

10:34:12user prompt will be "Below is a YouTube

10:34:15comment for one of the videos. Your task

10:34:17is to determine if the comment is

10:34:19relevant and if it includes any

10:34:20questions, inquiries, or suggestions

10:34:21that we can use W

10:34:24as an idea [snorts] for future video. We

10:34:25Turn your output as JSON."

10:34:27And then we can um add a few examples.

10:34:32So, in this case, you would have a

10:34:33system, a user prompt, and then to give

10:34:35it a few examples, you give it a user

10:34:37and assistant. Okay? So, what this means

10:34:39is that we give it, "Hey, if I give you

10:34:41this comment,

10:34:42this will be the output. Okay, so the

10:34:44user is me giving it something. The

10:34:46assistant is what's the output that you

10:34:47want you want to have and I'm giving it

10:34:49two examples in this case.

10:34:51Or three. Yeah, three examples. So the

10:34:53first example would be

10:34:54Um, is there any reason to use an AI

10:34:57agent node instead of basic LLM chain,

10:34:58which is an actual comment that someone

10:35:00put in a video.

10:35:01And here will be relevant. So content

10:35:03ideas AI agent versus basic LLM node,

10:35:05when should you use each one? That could

10:35:07be a solid content idea. Or

10:35:09something else.

10:35:11This is a video from Nate uh Nate

10:35:13O'Brien um someone said a small request,

10:35:15can you please make a video on client

10:35:16onboarding? So these sort of things is

10:35:18exactly what we want to see. Right? So

10:35:19someone's asking for a client onboarding

10:35:21for N&N projects. The content idea in

10:35:22this case would be how to onboard your

10:35:24clients for an N&N projects and this is

10:35:25relevant. But if someone puts thank you

10:35:27cuz they put thank you and you're great

10:35:28and all that sort of stuff,

10:35:30we don't want to put it as a as a

10:35:31relevant idea because there's no idea

10:35:33here. Okay, so that's what we're doing.

10:35:34We are giving it a system prompt to say

10:35:36you are a helpful intelligent whatever

10:35:38it is. Then here we're saying hey, this

10:35:40is what you have to do and then we want

10:35:42to be able to add the comment first,

10:35:44what's the output that I that I want?

10:35:46Comment output comment output. So it has

10:35:48three different examples, one that's

10:35:50relevant a one that two that are

10:35:51relevant and one that's irrelevant. So

10:35:53it knows exactly sort of what what to go

10:35:55and then this is the comment. So the

10:35:57last

10:35:58prompt which is the user prompt which

10:36:00you can add message here. Uh it will be

10:36:02the alpha comment. Yeah, so we're using

10:36:03JSON here because of the fact that we

10:36:05want the verdict and we want the

10:36:08uh content idea as separate variables

10:36:10that we can then feed in to

10:36:13the filter and the other steps. Okay, so

10:36:14in this case 502 went through.

10:36:18In the filter, only 199 went through

10:36:20based on the 502 based on the response

10:36:23from the actual uh AI and the filter in

10:36:25this case it's if the verdict is

10:36:28relevant. If the variable verdict is

10:36:30relevant. Let me add a

10:36:32uh in this case it would be

10:36:34verdict

10:36:38relevant

10:36:40and then content

10:36:42idea

10:36:45how to make a N&N agent from scratch.

10:36:50I'm going to pin this and then

10:36:52this is basically what it's going to

10:36:53see. It's going to see verdict which is

10:36:55the one that I put here.

10:36:57And then it's going to see the content

10:36:58idea. But in this case we're saying only

10:37:00if this is relevant, then send it

10:37:01through. Okay? So once this is done, we

10:37:04can now

10:37:06add some fields. So these are the fields

10:37:07that will be added to the hook and

10:37:08outline. We can this is again is an

10:37:10optional step but I do want it to add

10:37:12fields cuz I like adding fields to be

10:37:14able to separate information cuz again

10:37:16we what we did is we scraped 100

10:37:18comments, we sent it to the AI and we

10:37:20said hey, only run 50 at once. The AI

10:37:22checks whether it's relevant or not. If

10:37:24it's relevant, it will send it through

10:37:25to the hook and outline because it's a

10:37:27relevant comment, it's a relevant idea.

10:37:29We could use it. Now we want to generate

10:37:31the hook and outline which we did before

10:37:32here here, hook and outline.

10:37:35Which is why we're using this AI step

10:37:37but in order to generate the hook and

10:37:38the outline, it needs to sort of

10:37:40understand what we do. So what I added

10:37:42here is two variables which is social

10:37:43proof which is basically some results

10:37:45that I have

10:37:46and what I do

10:37:49and some tone of voice of direction.

10:37:51This is the tone of voice and direction.

10:37:52And this is what I feed into my next AI

10:37:56step which is an AI step that generates

10:37:58the hook and the outline like I

10:37:59mentioned before. And this the settings

10:38:01will be the same. The system prompt will

10:38:03be you are a helpful intelligent content

10:38:04writing assistant. We can also write

10:38:06intelligent hook and

10:38:09outline

10:38:10YouTube hook

10:38:12and outline writing assistant. That's

10:38:14more contextual to what we're doing. And

10:38:16then we're saying your task is to

10:38:18generate high quality engaging hooks and

10:38:19outlines for content ideas. You receive

10:38:22a content idea in JSON and you'll return

10:38:24it in the following format hook string

10:38:26outline string and then these are the

10:38:27different things that we give it.

10:38:29So you can see this is the projected

10:38:31output that we get. And now we give it a

10:38:34few examples I believe. Yeah, we give it

10:38:35a few examples. So in this case the

10:38:38content idea will be build a rag agent

10:38:40inside of N&N and the assistant will be

10:38:42this. Right now we're giving it the

10:38:43content idea. And because we give it to

10:38:45we told it to give it to us in JSON

10:38:48which is

10:38:49just a programming language.

10:38:51It will give us

10:38:52the JSON language into two different

10:38:53variables. So it will be hook and it

10:38:54will be outline. And the string is just

10:38:56something we we say when we want it to

10:38:57say it's just text. Right? So we say

10:38:59give me the hook in text, give me the

10:39:01outline in text.

10:39:02Given an example and now you can see red

10:39:05because it's not this is not correct or

10:39:07like this

10:39:09What is it? This? Yeah, this is not

10:39:10correct. But

10:39:12this will pass through the content idea

10:39:14again which is something like this,

10:39:16content idea build a rag agent inside of

10:39:17N&N. And now this will give us the hook

10:39:19and the outline which we can then send

10:39:21to another set variables which takes all

10:39:23the variables and puts them onto one

10:39:24place. Again, not needed but I love to

10:39:27split information so we're more we're

10:39:29more structured with the way that we do

10:39:30things. And now once this is done once

10:39:32we once we set the variables, we can

10:39:34send it to notion um the YouTube comment

10:39:37database where we have everything here.

10:39:39We want to see all the [snorts] comment

10:39:40ideas. All you have to do to connect

10:39:42notion is go to here, create a new

10:39:43credential and then you can get an

10:39:44internal integration secret.

10:39:46You should follow this guide. It will

10:39:47take you through everything that you

10:39:48need to do. It's a bit more of a longer

10:39:50process.

10:39:51Um you can use Google Sheets as much as

10:39:52you can use notion. I'm just a notion

10:39:54fanboy so I love to use notion. And in

10:39:57this case it will be in database page

10:39:58because this is a database. Right? This

10:40:01right here is a page. From the list in

10:40:02this case the database is called the

10:40:04YouTube comment script database. So we

10:40:06can do YouTube comment script database.

10:40:07The title will be what's that first

10:40:09thing which is this content idea. So it

10:40:11will be the content idea. The hook will

10:40:12be this. The outline will be this.

10:40:15Initial comment will be this. Because I

10:40:17want to see also what the initial

10:40:18comment was to make sure that I know

10:40:19exactly if the AI has messed up or not.

10:40:21Right? So we get the hook, the outline

10:40:22and the initial comment. If I go here as

10:40:24well, I can see the initial comment.

10:40:27For example, what's the average time

10:40:28most of students take to get their first

10:40:30client?

10:40:31So how long does it take to you take to

10:40:32get your first client and what are the

10:40:33short investment or need to be on the

10:40:34and what investments do you need? So you

10:40:36can make a video about how to get your

10:40:38first client automation journey with

10:40:40zero dollars up front. Right? And that

10:40:42will solve this sort of pain point that

10:40:43this person has.

10:40:44Um so that's something you could do.

10:40:46So we get the comments. We get the hook

10:40:48and we get the outline. We put it all

10:40:49into and the title. We get it we put it

10:40:51all into notion. And now once this is

10:40:53done, it will then loop back so we go

10:40:55here, loop it back

10:40:57to here to get the other comments that

10:41:00are valid.

10:41:01And it will do it all and over and over

10:41:03again until it's finished and then we

10:41:05wait and then we send it all the way

10:41:07back here

10:41:09where we can do the other channels. So

10:41:12we'll go through the three different

10:41:13channels. And let's say you have 10

10:41:14channels, it will go through the 10

10:41:15channels. Right? And it will just run it

10:41:17every single month. Uh now typically

10:41:19[snorts]

10:41:20I would suggest that you run this every

10:41:22month or every week. It depends on the

10:41:24amount of channels that you have to be

10:41:25honest.

10:41:26Um but because we're scraping 15 YouTube

10:41:27videos, we also don't want duplicate

10:41:29comments. Right? Um

10:41:31and we don't want to give it the same

10:41:32content ideas. So think of a YouTuber a

10:41:34normal YouTuber, they typically post

10:41:36like what? Once every three days

10:41:38uh and in a month um that's about 10.

10:41:41Yeah, 10 videos.

10:41:42So if [snorts] you put that in mind you

10:41:44can run this every month in five days.

10:41:47And it will be free. Right? I'm I mean

10:41:49you would only have to pay for N&N from

10:41:50the start until the end which is which

10:41:52is a very good pricing model that they

10:41:53have. So that right there is for the

10:41:57way that it's set up. Or we obviously

10:41:58have the different steps and make it as

10:41:59structured as possible. And when you

10:42:02look at cost and how much it actually

10:42:03takes to run this, Apify as I mentioned

10:42:06right here. So let's say we have 29

10:42:09results

10:42:10and 1,000 results is 40 40 cents. So do

10:42:13the math there, it's 0.000. It's not

10:42:15even a noticeable amount of money that I

10:42:17have to even mention. Right? So

10:42:19it's not really expensive or at all,

10:42:21it's free because we all we get the $5

10:42:23free from Apify that you can use to be

10:42:25able to run this. And the other expenses

10:42:28really are the AI

10:42:30which because we're using 4.1 mini, it's

10:42:33relatively cheap. So there's nothing

10:42:35really to worry about. I think it will

10:42:36be a few cents or 0.01

10:42:39um whatever

10:42:40um because it's very very cheap like I

10:42:42mentioned and N&N. So N&N charges you

10:42:45per execution.

10:42:47Which means from the start until the

10:42:48end.

10:42:49So if you're doing it maybe 10 20 times,

10:42:51again, this is very very cheap because

10:42:53you're running it every month and so on.

10:42:54Right? So this is very very cost

10:42:55effective when it comes to an actual

10:42:56system. And that's exactly what we have

10:42:57this for. Now who can you actually sell

10:42:59this to? Well, YouTubers content

10:43:01creation agencies, they always need to

10:43:03done for you especially done for you

10:43:05YouTube content agencies, they need to

10:43:06always come up with new ideas for their

10:43:08clients. So if they have a system that

10:43:10scripts through all the different

10:43:11comments for their clients and sees it's

10:43:13actually validated data, it's not just

10:43:15stuff that they make up because that's

10:43:16what people are actually asking for.

10:43:17Right? So if they have a system like

10:43:19that, it saves them a bunch of time in

10:43:20the actual strategy and titles and hooks

10:43:23and outline all that sort of stuff that

10:43:24they can that they have to allocate

10:43:25right now. So you can save them that

10:43:27time of actually doing the actual work.

10:43:30That right there marks the end of the

10:43:31video where I showed you exactly how I

10:43:33built an AI system that scripts YouTube

10:43:35comments from any videos and turns them

10:43:36into fresh high converting ideas. And by

10:43:38the way, if you're looking for all the

10:43:39blueprints and resources that I'm

10:43:41talking about in the video, check the

10:43:42second link down below. You can go to

10:43:44the classroom section. You can go to the

10:43:46templates vault and you'll be able to

10:43:47see the N&N course right here and all

10:43:50the different resources that you can

10:43:51simply download the automation blueprint

10:43:53for and import it into your own account.

10:43:55And if you have no clue how to do that,

10:43:57no worries at all. You can always go to

10:43:58the welcome here and you have the

10:44:00tutorial which walks you through exactly

10:44:01how to do it.

10:44:05In this video, I'm going to show you

10:44:06exactly how we automated 95% of our

10:44:09onboarding processes using Notion and

10:44:11N&N. All right, so this right here is

10:44:13exactly what we're building.

10:44:14Essentially, it's an onboarding system.

10:44:16Now the onboarding system starts with

10:44:17this step right here which is filling

10:44:19out an onboarding form. Now the

10:44:20onboarding form is filled out whenever

10:44:22we close the client. So we're on a call,

10:44:23we close the client, after the call we

10:44:25fill out the onboarding form as soon as

10:44:27possible which kicks off the actual

10:44:29automation until the end. Now the

10:44:31onboarding form contains the name of the

10:44:32client, the website and small details or

10:44:34general details about the client. Then

10:44:35we're adding it to the Notion client HQ,

10:44:37the headquarters, which is exactly how

10:44:39we manage all our clients internally all

10:44:40in one place. Uh tasks, team, meetings,

10:44:43all that sort of stuff. So, we add the

10:44:44details of the new client which we just

10:44:45closed to our client HQ, uh which

10:44:48auto-populates the client portal. And

10:44:50that's I put it here just because it's

10:44:51not a an automation, it's a Notion-based

10:44:53automation. So, we have it here. Then we

10:44:56automatically add four onboarding tasks.

10:44:59We make the drive folder, which is the

10:45:00drive folder that we're going to use to

10:45:01store different assets for that client

10:45:03specifically. We create a Slack channel

10:45:04internally, which we'll then manually

10:45:06share access to with the client. And

10:45:08then we send an onboarding email to the

10:45:10client, which is saying, "Hey, welcome

10:45:11to the team. Super excited to have you

10:45:13going. Here's the drive link that we

10:45:15actually created for you. Uh we also

10:45:17sent the Slack access. We're going to

10:45:18send you the Slack access in just a

10:45:19bit." And yeah, that's pretty much it.

10:45:21All right, so let's go to n8n, which is

10:45:23a platform where we're actually building

10:45:24automations, which is an automation

10:45:25platform. Essentially, it's taking a

10:45:26task, breaking it down, automating it

10:45:28step by step so we don't have to do it.

10:45:30The automation does it itself. So, we

10:45:31all start with the the onboarding form

10:45:33right here, which is this one right

10:45:34here,

10:45:35right, where we have full name, email,

10:45:36company name, and website.

10:45:38Then we have the client folder. We share

10:45:40the file because we want it to be

10:45:41accessible to everyone. We add the

10:45:43company to our database. We add the

10:45:45contact related to the company cuz every

10:45:47company has a contact, which in this

10:45:49case is the CEO or whoever it is. Then

10:45:50we set the onboarding tasks. In this

10:45:52case, there are four. Uh the first one

10:45:53is audit, which is the first step of our

10:45:56delivery process. Then we have setting

10:45:57up this access, which means softwares.

10:45:59Then there is start implementation,

10:46:01which is essentially starting the

10:46:02structure for the system we're going to

10:46:04build for the client. And then

10:46:05automation structure, which is layering

10:46:07automations in the bigger system as

10:46:09well. Uh then we obviously this is just

10:46:11some formatting for the drive link. Then

10:46:14we create a Slack channel for the

10:46:15client. Slack is just the way that

10:46:17agencies talk to clients. Uh you can use

10:46:18WhatsApp, whatever it is, Telegram. Uh

10:46:20probably not Telegram. I don't think

10:46:21that's for agencies. Uh but uh but yeah,

10:46:23we use Slack. And then send email uh

10:46:26onboarding email to the client with some

10:46:27different variables. And by the way,

10:46:28this is templated. So, if I go here,

10:46:30don't get overwhelmed by all of this. Uh

10:46:32but it's saying, "So pumped to

10:46:33officially kick things off with you. I

10:46:35know investing in a service like this is

10:46:37a big decision, and our job here is to

10:46:38make sure it feels like the best

10:46:40decision you made all year. Uh below is

10:46:41your personal onboarding folder with

10:46:42everything you need to get started." The

10:46:44link right here. We also made a Slack

10:46:45channel. Uh we're thrilled to have you

10:46:47join the JMT and can't wait to get

10:46:48started. Cheers, Mikayla. Now, this

10:46:50right here is something that a lot of

10:46:51agencies don't have, which is touching

10:46:52on the psychological angle of onboarding

10:46:55uh because not everything's technical.

10:46:56Not everything is folders, drives, all

10:46:57that sort of stuff. It is still an

10:46:59investment that a company is making, so

10:47:00you want to make sure that they don't

10:47:01have buyer's remorse. They don't feel

10:47:02like they have not made the right

10:47:03decision. Um so,

10:47:05let's actually try this out. Let's see

10:47:07how it works. So, all I have to do now

10:47:09is press execute workflow, which will

10:47:10essentially run the automation once. We

10:47:12have to fill full name, email, company

10:47:13name, and website. So, let's do it and

10:47:15then press submit.

10:47:17If you go back to our n8n automation, it

10:47:18shows that it's running.

10:47:20All these green steps just says it's

10:47:21successful. It's making the different

10:47:23tasks, which all have due dates as well.

10:47:24Um one is I think one day, then two

10:47:26days, then three days, and four days

10:47:27when the automation is running. It's

10:47:29finishing up the task,

10:47:30Slack channel, and then getting the

10:47:31email. So, now if you go to our Notion

10:47:33HQ,

10:47:35where we manage everything from clients,

10:47:36contacts, tasks, meetings, and

10:47:37analytics. If I go to clients right

10:47:39here, we can see that we have One Media

10:47:40here added to the Kanban board, which is

10:47:42where we manage all our clients, all our

10:47:44delivery uh statuses. And if I go to One

10:47:46Media, I can see that the client portal

10:47:48was automatically generated. If I go to

10:47:50the client portal, which is essentially

10:47:51a place where we manage everything for

10:47:52our clients because this saves the time

10:47:55of us having to email the clients for

10:47:57different stuff, having to find

10:47:58information. We want to keep everything

10:47:59in one place for every single client,

10:48:01which is exactly what this is doing. In

10:48:02this case, if this is set to complete,

10:48:05this automatically sends an email to the

10:48:06client saying, "Hey, the name of the of

10:48:09the actual task," which in this case the

10:48:10audit, right, "the audit is finished.

10:48:12The next step is software access. The

10:48:13next step is database building and so

10:48:15on." So, it goes step by step, so it's

10:48:16all automatic as well, the updates to

10:48:18the clients. So, you don't have to

10:48:19manually do it. Uh we can keep software

10:48:21access here. We can then have databases.

10:48:23So, in this case, it will be resource

10:48:24area. We can add any folders and so on.

10:48:26And then the Miro would be the Miro for

10:48:29the audit because our first step of the

10:48:30delivery process is actually auditing

10:48:32what they have and mapping everything

10:48:33out step by step with the whole team.

10:48:35So, we put this whole stuff here. They

10:48:36have access to this. If I go back to the

10:48:38client, if I go to tasks, I can see that

10:48:40these four tasks were auto-populated for

10:48:41this specific client with due dates that

10:48:43are two days, three days, four days in

10:48:45advance depending on what you want. Uh

10:48:47but this is what we like to have. You

10:48:49can see the task progress, which is So,

10:48:50if I say I put complete, it shows 25%

10:48:52task progress. And if you have a bunch

10:48:54of clients here, you can see all the

10:48:55tasks you've done, the percentages, and

10:48:57so on. Uh so, we have everything in

10:48:58Notion right here, which is

10:48:59auto-populated again. And also one more

10:49:01thing, the tasks are stored in Notion as

10:49:03well. So, you don't need another project

10:49:04management tool. You don't need to store

10:49:05clients in other places, right?

10:49:06Everything is in one place for Notion.

10:49:08So, tasks are here, companies are here.

10:49:09If I go here, I can see that the website

10:49:12is stored here. The address, the email

10:49:13can be stored separately. If I go to

10:49:15contacts, I can see that one contact was

10:49:17here, which is the uh person from the

10:49:19email. You can connect with her too with

10:49:20the with my email as well. We can also

10:49:22add more fields like phone number, type,

10:49:24right? Uh role title, time zone, and so

10:49:26on. But just for this case, to make it

10:49:27simple, we just want to leave it like

10:49:29this. And then if I go back to the email

10:49:32right here, I can see that I got an

10:49:33email from JMT Solutions saying, "Hey

10:49:35Mikayla, so pumped to officially kick

10:49:37things off with you. I know investing in

10:49:38a service like this is a big decision,

10:49:40so our job here is to make sure blah

10:49:41blah blah." And then we have the

10:49:43onboarding drive folders. If I press

10:49:44here, this will take me to the drive

10:49:45folder, which is named with my company

10:49:48name, so One Media onboarding folder in

10:49:49this case. And this is where we can

10:49:51store any creatives or anything that

10:49:52they have, brand assets, and so on.

10:49:54Whatever it is that they have, um they

10:49:56can store here in the drive folder. And

10:49:58the client itself just gets a nice email

10:50:00sent to them uh automatically without

10:50:02the team having to do it themselves. And

10:50:03if I go to Slack, we can see that we

10:50:05have the One Media channel right here,

10:50:06which is a channel exactly for that

10:50:08client specifically where we can store

10:50:09anything. We can communicate with the

10:50:10client uh cuz for any agency service

10:50:12that you have, it's a good way to

10:50:14communicate with the client itself, not

10:50:15being on email uh cuz when you want to

10:50:17do quick things, it's good to be on

10:50:18something like this, WhatsApp, whatever

10:50:20you have, works. So, this is

10:50:21automatically generated as well. And

10:50:23that's the full onboarding process right

10:50:24there. So, again, we all started with a

10:50:25form. We then put it to Notion where we

10:50:27have a place where we can store

10:50:28everything. We generated the client

10:50:30portal, which is something else that a

10:50:31lot of agencies don't have because they

10:50:32scatter in different tools to find

10:50:34client information. In this case, I

10:50:35said, "Look, let's put everything in one

10:50:37place in one portal where we can manage

10:50:38everything for that client," which is so

10:50:40so good, especially cuz it sets the

10:50:41expectations. But it also increases the

10:50:43way that the client views you because

10:50:44you're more professional. You have your

10:50:46together, basically, uh all in one

10:50:47place. You then we have the onboarding

10:50:48tasks as well so the team knows exactly

10:50:50what to do. They're alerted as well, uh

10:50:52so they can get started on the project.

10:50:53The drive folder is automatically

10:50:54generated. The Slack channel's done uh

10:50:56so that everybody knows exactly that we

10:50:57have a new client rolling. And then the

10:50:59onboarding email sent to the client.

10:51:01Now, something like this, depending on

10:51:02the agency really, uh it would take

10:51:04around well, anywhere from an hour to

10:51:06days. I've worked with agencies which

10:51:08take days to do this, uh which is which

10:51:10is utterly insane uh when we have this

10:51:12automation right here that does it in

10:51:14seconds all by filling out a form. So,

10:51:16this is such a powerful automation. It's

10:51:18high leverage. For the time that you put

10:51:19in, the output is so so good and it's so

10:51:21so powerful, which is exactly why we

10:51:22recommend it to all these agencies. And

10:51:24this was all done using Notion right

10:51:26here and then using n8n right here.

10:51:32Hey, about to build a live LinkedIn

10:51:33outreach system right in front of you.

10:51:35We start by filling out a form with the

10:51:37details of who we are targeting. From

10:51:38there, it actually scrapes thousands of

10:51:40leads from Apollo, pulls in their

10:51:42LinkedIn URLs, and automatically drafts

10:51:43hyper-personalized connection messages

10:51:45that we can plug straight into our

10:51:47outbound campaigns. Okay, so as always,

10:51:49I want to run it from the start until

10:51:50the end, and then we're going to go to

10:51:51actually building it step by step. So,

10:51:53let me execute the workflow.

10:51:55This will then bring me to the form

10:51:56right here. So, let me say I am

10:51:58targeting real estate agencies in the

10:52:01US.

10:52:02I'm going to press submit. What this

10:52:03will do is it will send it to the first

10:52:05AI to generate a URL, which will then

10:52:07add or send to the scraper to then

10:52:09scrape the leads. Um and by leads, we

10:52:12mean

10:52:13LinkedIn URLs. So, you can see this is

10:52:14running right here cuz we're using

10:52:15Apify. As you can see here, we're

10:52:17starting to get results.

10:52:18Let me get the first name, last name,

10:52:19LinkedIn URLs, and the ID as well. Then

10:52:22we send it to the next node in order to

10:52:24extract the details. Then we only send

10:52:2720 um details of people or we just send

10:52:2920 people through the first loop. And

10:52:32then we draft a hyper-personalized

10:52:34connection message for that specific

10:52:36person based on their bio, based on who

10:52:38they are, and so on.

10:52:39Before adding it to our Google Sheet

10:52:40database, which is where we store

10:52:42everything right here. [music]

10:52:44So, you can see we have the different

10:52:45first name, last name, the name as well,

10:52:47the LinkedIn URL, the title,

10:52:49the email status, the photo URL, and

10:52:51also the icebreaker that we can um

10:52:54generate based on their profile. And if

10:52:56I go here, I can see that we're still

10:52:58running the system because we let 97

10:53:00items through, and then we're sending 20

10:53:02and 20 and 20 until it's actually

10:53:04finished. If I go here, I can see that

10:53:06we have more and more leads that are

10:53:07being added.

10:53:09So, I'm going to stop the workflow right

10:53:10here cuz you got to see exactly what it

10:53:11is. By the way, these are just

10:53:13icebreakers, so connection messages that

10:53:15you send [music] to the lead when you

10:53:16want to connect with them, uh which

10:53:18increases drastically increases the

10:53:20likelihood of them connecting back and

10:53:22you being able to have a conversation

10:53:23with that person and it being actually

10:53:25personalized. So,

10:53:28let's start from scratch. Let me make a

10:53:29new workflow right here.

10:53:32Personal, there we go.

10:53:34Let me start from zero. But as always,

10:53:36as you guys know, we're going to be

10:53:37mapping things out step by step into our

10:53:40Miro. So, let's dive in. All right, so

10:53:41here we can start mapping things out.

10:53:43Again, an automation has an input.

10:53:46Let me make this smaller. We can zoom

10:53:48in.

10:53:49And the output,

10:53:51right? And in this case, the input

10:53:53because we want to basically uh we want

10:53:55the thing to be dynamic, so it changes

10:53:57every single time. But the input in this

10:53:58case is who we are targeting. So, target

10:54:00audience.

10:54:04And then we start thinking about how can

10:54:06we actually give it the input? Well, as

10:54:07you saw, we used n8n forms, but you

10:54:09could also use a Telegram message or

10:54:11Gmail coming through or something else.

10:54:13So, in this case, it can be target

10:54:14audience

10:54:15from

10:54:18n8n form.

10:54:20Okay?

10:54:21Let me make this smaller.

10:54:23Uh let's put this like this. Cool.

10:54:25Then the next step is actually scraping

10:54:28the leads

10:54:29using Apify, which is a software that

10:54:32allows us to strip leads and I'll show

10:54:33you exactly what I mean.

10:54:35And then we're going to be able to

10:54:37generate

10:54:39personalized

10:54:42connection message

10:54:44to that person.

10:54:47And then we want to be able to

10:54:49send it, so add details to Google Sheet

10:54:55database.

10:54:56Perfect.

10:54:57>> [snorts]

10:54:57>> All right, so we have target audience

10:54:59from n8n form, then we have scraping the

10:55:01leads using Apify, then we have generate

10:55:03personalized connection message

10:55:05um using the the details of course, and

10:55:07then we want to add everything to our

10:55:08Google Sheet database, which is the one

10:55:10right here.

10:55:12So,

10:55:13what I'd like to do when I make

10:55:14automations is I actually like to go

10:55:15step by step and show you exactly my

10:55:17thought process, how I think through

10:55:18building automations um just so you can

10:55:21see everything, you can see the whole

10:55:22scope. So,

10:55:23the first step here is target audience.

10:55:26So, we need a way for us to be able to

10:55:28give the input. So, as you saw before, I

10:55:30used an n8n form. So, this is where we

10:55:31go to n8n and we start actually building

10:55:33the automation. So, I'm going to add the

10:55:35first step, which is in this case called

10:55:36a trigger. A trigger is the thing that

10:55:38starts the automation, and we can go to

10:55:40on form submission.

10:55:42Right here. And this is where you

10:55:43basically make a form. Now, the form can

10:55:47Well, in this case it can compile of the

10:55:50I guess describe your target audience or

10:55:52describe your audience that you want to

10:55:53target. So, we can name this

10:55:56LinkedIn

10:55:57lead outreach

10:56:00trigger.

10:56:01Description can be insert

10:56:03an audience

10:56:05for your LinkedIn outreach

10:56:08campaigns here.

10:56:11And then the form elements, which is in

10:56:13this case the What are we actually

10:56:14asking the user to input to then start

10:56:16the automation,

10:56:17we can add a field name called describe

10:56:20your audience

10:56:22in plain English.

10:56:25And we want to leave this as text.

10:56:28Yeah, text text area. I actually don't

10:56:30know the difference between text and

10:56:31text area. I believe that this is

10:56:33uh wider text, so it can be uh long form

10:56:36rather than

10:56:38short text. Uh so, let's leave this as

10:56:39it is. So, we can leave this as is, and

10:56:42the placeholder can be company name,

10:56:44company types, sorry.

10:56:47Location, etc. So, this is the thing

10:56:48that they see before actually writing,

10:56:50which gives them some ideas as to what

10:56:52input they can give. And let's make this

10:56:53required. So, now if I go to execute

10:56:55step, which means that I'm just testing

10:56:57the automation,

10:56:58it brings me to this page where I can

10:56:59see the title, the description,

10:57:04the um the first question, and then we

10:57:06can see that we have an area for us to

10:57:07actually make the text.

10:57:09Which we can Oh, that's why. That's

10:57:11cool. Um so, let's do again like we did

10:57:13before, real estate

10:57:16agencies in the US. I'm going to press

10:57:18submit.

10:57:20As you can see, this is a test version

10:57:21of your form.

10:57:23And here we can see that we got the

10:57:24results, which is this right here.

10:57:26If you go to schema, we can see that we

10:57:28have it in this way, which is exactly

10:57:30what we need in order to go to the next

10:57:31step. All right, so once this is done,

10:57:33uh this is good. Let me go here and make

10:57:35this green.

10:57:36Again, cuz it's all step by step. We

10:57:39want to be scraping the leads. So, based

10:57:41on the input, based on uh What is it

10:57:43right here? Real estate agencies in US,

10:57:45we want to be able to then send it to

10:57:47Apify,

10:57:48which is apify.com, which is the one

10:57:50right here. And I like to think of Apify

10:57:52as the Amazon for scrapers. So, you go

10:57:54here, you basically choose your product.

10:57:56In this case, it's a scraper. And for

10:57:58those of you who don't know what a

10:57:59scraper is, it's basically saying Let's

10:58:01do Let's say we do um Google Maps

10:58:02Scraper.

10:58:03This basically extracts. So, you go to

10:58:05Google Maps, it extracts the text, it

10:58:07extracts the location of businesses,

10:58:08reviews, all the stuff that we want from

10:58:10that specific software, and then we can

10:58:12use it for whatever we want. And for us,

10:58:13for this automation, we want to be using

10:58:15Apollo. So, Apollo is another software

10:58:17that allows us to be able to scrape

10:58:19LinkedIn profiles based on a specific

10:58:21criteria. So, it can be um real estate

10:58:23agencies in the US, which is the one

10:58:25that we have right here. All right, we

10:58:27want to put this in,

10:58:28and the output we want a list of leads.

10:58:30So, for us to be able to do that, we

10:58:32have to make an account, and then you'll

10:58:34be able to come to this page right here.

10:58:36You have the Apify store. By the way, if

10:58:37you're asking yourself, "Is this paid or

10:58:38is this free?" Well, um the scraper that

10:58:41we're going to be using today is

10:58:43free depending on how much you use it.

10:58:45So, the way that Apify works is that

10:58:46they give you $5 for free every single

10:58:47month.

10:58:49And the scraper that we're going to use

10:58:50is about $1 for 1,000 leads. Okay, so if

10:58:53you use uh $5, that means you will have

10:58:555,000 leads for free every single month.

10:58:58But anything that you use above $5,

10:59:00that's something that you're going to

10:59:01have to pay.

10:59:02Um okay, so

10:59:04once you come to the Apify store, again

10:59:05like an Amazon store, we just look for a

10:59:07product, and the product is Apollo

10:59:09Scraper.

10:59:10And then we have different options. So,

10:59:12how do you know which one to choose?

10:59:13Well, the first thing I do is actually

10:59:14look at how many people used it and the

10:59:17price. This right here is good. I know

10:59:19Curious Coder is a guy who makes a lot

10:59:20of co Yeah, as you can see, he's already

10:59:22here as well. But the one that I used is

10:59:24actually this.

10:59:25I used it because of price, uh but also

10:59:27because the amount of people that

10:59:28actually used it. And the way that this

10:59:30works is you pay this per event. So, you

10:59:32pay per event. What this means is that

10:59:34you pay per usage.

10:59:36And the price is right here. So, $1 for

10:59:371,000 leads. And you can do up to 50,000

10:59:39leads, which is exactly what we like. Um

10:59:42and this page right here, it might look

10:59:44intimidating, is actually quite easy to

10:59:45understand. The only thing you have to

10:59:47understand here is like what's the

10:59:48input? What is the thing that I'm giving

10:59:49the scraper in order for us to get the

10:59:52data back? Well, in this case, the input

10:59:54is the Apollo URL. Now, the Apollo URL

10:59:56is a URL, so let me show you here. Let

10:59:58me copy this and paste it. It's a URL

11:00:00that allows us to basically say, "Hey,

11:00:03we want this type of person." Look,

11:00:05person title, uh contact email, exclude,

11:00:07catch all. All this stuff is a criteria

11:00:09for the person that we want to extract,

11:00:11and this will now make a list of leads

11:00:13that we can use for whatever we want.

11:00:15So, so the input here is the Apollo URL.

11:00:18That's the only thing that we have to

11:00:19get in order to give the scraper the

11:00:22thing that it needs to use to then give

11:00:23us the leads. Well, in this case, one

11:00:26thing we didn't add here is the AI that

11:00:28we used to make the URL, because URL

11:00:31changes based on who we're targeting.

11:00:33So, in this case, it can be AI to make

11:00:36Apollo

11:00:37URL.

11:00:40That way, when we put the target

11:00:41audience, we give it to AI, AI knows the

11:00:43framework of that URL and how it usually

11:00:45works. Um and I'll show you exactly what

11:00:47I mean here, cuz it is a very specific

11:00:49thing.

11:00:50And then we have that URL, which we can

11:00:51then feed into the scraper on Apify to

11:00:54then give us the leads back, give it to

11:00:55AI to make the personalized connection

11:00:57message, and then we can add all the

11:00:58details to the Google Sheet. All right,

11:01:00uh let me go back here, and now we can

11:01:02use the next node, which is an AI. So,

11:01:05we can go AI. We're not using an AI

11:01:06agent because we just want the AI step.

11:01:08Let's use OpenAI. That's fine.

11:01:11And we're going to use message a model.

11:01:14And in order for us to be able to

11:01:15connect our OpenAI to uh n8n, we have to

11:01:17go to platform.openai.com.

11:01:20Make an account, go to dashboard,

11:01:22go to API keys. On the top right, create

11:01:24a new secret key. You can go here and

11:01:25name it whatever you want, so n8n test.

11:01:28You will then have this key right here,

11:01:30which you can copy and paste it back

11:01:32here.

11:01:34API key. And don't worry about any of

11:01:36this, okay? The only thing you have to

11:01:37worry about is the API key.

11:01:39All right, once you connected your API

11:01:41key, let me take this off. Um we can do

11:01:43text message a model. The model that we

11:01:45want to use is uh let's say GPT-5.

11:01:50GPT-5. Let's see if we have that.

11:01:53Cuz it is something that we

11:01:55don't want any errors on.

11:01:56Um

11:01:58let's see if we have GPT-5 here.

11:02:00Yeah, let's do chat latest, the latest

11:02:02GPT-5 model. And

11:02:04for the prompt, I'm going to give it a

11:02:05system prompt, which is basically

11:02:07saying, "Hey, you are a identity. You

11:02:09are a helpful, intelligent, whatever it

11:02:10is." And then a user prompt. So,

11:02:13system,

11:02:15and I'm going to say, "You're a helpful,

11:02:18intelligent

11:02:19sales

11:02:21assistant." And for the user prompt, I'm

11:02:23going to paste the prompt that I had

11:02:24before, so you guys can see it. Uh but

11:02:26again, you can grab the whole template

11:02:27at the end. I'll show you exactly how to

11:02:29do it. As you can see here, it says,

11:02:30"Your task is to take as input a natural

11:02:32language description of a prospect

11:02:34audience and turn that into an Apollo

11:02:36search URL." Now, here's an example of

11:02:38an Apollo search URL, so I give it a few

11:02:39examples. Not Not few, just an example

11:02:41right here. You can see it has United

11:02:43States. And this is in a very, very

11:02:44specific order, which Apollo likes when

11:02:47we want to be able to scrape leads. Uh

11:02:48the URL describes a search for people

11:02:50that are located in the US, hold the

11:02:52title owner, CEO, founder, and partner,

11:02:54have a keyword associated with creative

11:02:55agency. And these are the fields that

11:02:57you can change: organization location,

11:02:59keywords, person titles, and

11:03:00organization number of employee ranges.

11:03:02Do not add a change any fields. Use the

11:03:04above template. Return your response in

11:03:05JSON using this format: search URL,

11:03:08search URL it goes here.

11:03:09Okay? So, that way, we basically say,

11:03:12"Hey,

11:03:13this is what the structure is like.

11:03:14These are the things that you can

11:03:15change." And as the last input, we're

11:03:17going to give it another user prompt,

11:03:18which is the target audience.

11:03:22Okay? So, let me say, "Here is the

11:03:26audience I am targeting."

11:03:29And by the way, I just dropped it in

11:03:31from the form. So, this is a variable

11:03:33that I can pull in here

11:03:35and then start the automation. And

11:03:37that's how automation fundamentally

11:03:38works, cuz it's all dynamic. It changes

11:03:39every single time. Cuz you see here, it

11:03:41might look like code, cuz it is code, uh

11:03:43but it's just a variable from here. And

11:03:45then lastly, we have to output the

11:03:46content as JSON, because as you can see

11:03:48here, I I told it to return your

11:03:50response in JSON, cuz I just want a

11:03:52variable.

11:03:53So, what I'm going to do now is I'm

11:03:54going to execute this step, which means

11:03:56I'm going to test this. And as you can

11:03:57see, I got the search URL, which I will

11:04:00then be using to give to the scraper to

11:04:02then be able to scrape the leads.

11:04:04So, now that this is done, um

11:04:06perfect. Let me rename this to

11:04:09generate

11:04:10search URL.

11:04:13The next step is actually using Apify to

11:04:15be able to scrape the leads. So, I'm

11:04:17going to go here, look at Apify.

11:04:19I'm going to run an actor, because

11:04:21again, those different things are

11:04:22actors, the scrapers.

11:04:24And then to connect your Apify, you have

11:04:25to go to create a new credential, you

11:04:26need an API key right here.

11:04:29I believe that

11:04:31you can get your API key on settings,

11:04:34API integrations, and you can um copy

11:04:36this.

11:04:37Default API token.

11:04:38And then you can paste it here, have the

11:04:40connection, and that's it.

11:04:41Once you connected it, uh which one is

11:04:43it?

11:04:44Okay, I'm going to bet on this one.

11:04:46This one right here. Uh the actor is a

11:04:48thing that we're using. The uh action is

11:04:50the run an actor.

11:04:52And then actor source, this is fine. Uh

11:04:54very very important though, if you don't

11:04:55see it here, if you don't see it in the

11:04:57list, which I do, which is this one

11:04:58right here, you need to actually run

11:05:00this once, because yours will say start

11:05:02and save. Once you start and save, it

11:05:04will run it once. That way you can

11:05:06actually save it to your account, so

11:05:08you're able to see it here.

11:05:09And then the next thing it shows us is

11:05:11an input JSON. So, if we look at this,

11:05:13you're like, what the hell even is this?

11:05:15Uh well, if you go here to the input,

11:05:18there's two different ways that we can

11:05:19run scrapers in Apify. We can either use

11:05:21the platform itself and just run it and

11:05:23then get the data, or we can use it

11:05:25automatically within their automations,

11:05:26or N8N, or Make, or Zapier, whatever it

11:05:28is, um to be able to automatically do

11:05:31it. And so, because we're using N8N as

11:05:32our automation software, we have to give

11:05:34a JSON. So, this right here

11:05:36is an input JSON, like the input that we

11:05:38give the scraper, which we can find

11:05:40right here.

11:05:41Right, we can just copy this.

11:05:44And we can

11:05:46delete this, and we can paste it here.

11:05:47Okay? And the only thing that we have to

11:05:49change is this. Because right now it's

11:05:51fixed. If I run this, it will always

11:05:53take this URL. I want to change the URL

11:05:55based on the URL that we have here. So,

11:05:56search URL, which we can drop in here.

11:05:59Okay, so

11:06:01copy this, and put it here. I think this

11:06:03always happens.

11:06:05There we go. So, now [music]

11:06:07the green variable is the thing that

11:06:08changes every single time, and all these

11:06:10other ones are the same, apart from max

11:06:13search result, which we can leave to

11:06:16100.

11:06:17Or actually, yeah, you can do 100. What

11:06:19this says is like, hey, scrape the

11:06:21leads. These are the maximum amount of

11:06:23leads that I want you to scrape. Okay?

11:06:25And we do this because, as I mentioned,

11:06:27this is paid. So, you basically want to

11:06:29maximize, or you want to limit, sorry,

11:06:30you want to limit the amount of leads

11:06:32that you want to scrape from that

11:06:33scraper. Okay? So, now we have this,

11:06:35then we want to wait for finish, which

11:06:37means that we send the data, we then

11:06:38wait until we get the data back, and

11:06:40then we can move on to the next steps.

11:06:42So, I'm going to execute this step right

11:06:44here. Let me actually pin this. P, and

11:06:46then P.

11:06:48I'm going to run this.

11:06:49So, you can see now this is running, and

11:06:51if I go to here, to runs, I can see that

11:06:53we have a new run running right here.

11:06:57And this is fundamentally how you test.

11:06:58You go to the Apify platform, and then

11:07:00you go back to N8N, and so on. So, now

11:07:01you can see that we got a list of leads,

11:07:03and I mentioned the maximum amount of

11:07:04result that I put was 100. So, we're

11:07:06going to have to wait until we get 100,

11:07:07or we can just simply stop the

11:07:09automation and just test. That's how I

11:07:12usually do it, uh but let's wait until

11:07:13we get 100 results, then be able to go

11:07:15to the next steps. All right, we can see

11:07:16here that we have 97 results, uh close

11:07:19to 100.

11:07:20And if I go to N8N, at any second now,

11:07:23we should be able to

11:07:25get the run, um or finish the results of

11:07:28the run. All right, we got 100, and you

11:07:30go here.

11:07:31And at any second now, we should see the

11:07:32output that is generated. Cool. So, as

11:07:35you can see, this is what we get out of

11:07:37the scraper. But, the one thing about

11:07:39Apify that most people get confused

11:07:41about is they start thinking, where are

11:07:43the leads? Like, where did they where

11:07:45did they come? Well, there's an

11:07:46additional step that we have to do

11:07:48before we actually get the leads.

11:07:51Because right here, this is running the

11:07:52actor. Once we finish running the actor,

11:07:54what we get is something called a

11:07:56default data set ID, which you can find

11:07:58here. Default data set ID. This is the

11:08:00ID that we then give to the next node,

11:08:03which is, let me pin this real quick, so

11:08:05I don't have to run this again, the

11:08:06Apify

11:08:08uh get data set items, right here.

11:08:13Same connection, data set, get all

11:08:15items, and now we give the ID to this

11:08:17node, which is the one below here,

11:08:22to then be able to extract the details

11:08:24from that output. And I'm going to put

11:08:26the limit to 500.

11:08:27I'm going to execute this step.

11:08:29So, you can see now we get 100 items,

11:08:31which are the 100 leads, which is first

11:08:33name, last name, name, LinkedIn URL,

11:08:35title, email status, photo URL, Twitter,

11:08:37we get employment history, we get a

11:08:39bunch of stuff, employment history, a

11:08:40bunch of employment history. We get

11:08:42street address, we get organization, we

11:08:44get a bunch of stuff. We get everything

11:08:45about the actual profile, which is

11:08:46amazing. [music] And once this is done,

11:08:48then we have to go to the next steps.

11:08:49So, let me go here. Let me make this

11:08:51green. Let me make this green. The next

11:08:53step is actually generating a

11:08:54personalized connection message using

11:08:57AI.

11:08:57>> [music]

11:08:57>> Now, there's only one thing in between

11:08:59this and the AI. Because when we think

11:09:01about this, if I just add an AI step, so

11:09:03AI, OpenAI,

11:09:05message model, and so on, right? Let me

11:09:07just configure this later.

11:09:08This will basically send 100 items all

11:09:11at the same time to the AI. And if you

11:09:13want to something more scalable, ideally

11:09:15you want to send maybe 20 at first, and

11:09:17then loop back and do another 20, and

11:09:20another 20, another 20, until it's

11:09:22finished. Because [music] then you give

11:09:22it space, you give it time or room to

11:09:24breathe, to then be able to actually

11:09:26generate a better output, or for it not

11:09:28to fail. So, in order for us to be able

11:09:30to send only 20 at a time, and then it

11:09:32finishes the whole thing, and then goes

11:09:33back in 20 at a time, we use something

11:09:35called loop over items. So, if I go to

11:09:37loop over items right here,

11:09:40the only thing that this ask you is,

11:09:41hey, how many items do you want to send

11:09:43through at a time?

11:09:44Well, in this case, we want to send 20,

11:09:46right? Let me delete this.

11:09:48So, you can go here, delete,

11:09:50and delete. And now, using the loop

11:09:53output, we're going to go here.

11:09:55And it's basically saying, hey, okay, we

11:09:56have 100 items. If I run this,

11:09:59it should run.

11:10:00Or not. Oh, it shouldn't run, yeah, cuz

11:10:02this is just the the actual node. Oh, it

11:10:04should run. Then it shows us that out of

11:10:05100 items, it only sent 20 items

11:10:07through.

11:10:08So, that we have 20 items, and then we

11:10:10use the AI to generate the personal

11:10:12message, we then give it to the Google

11:10:13Sheet, then we send it back here, and

11:10:15get the next 20 items, and do the whole

11:10:17thing again, until it's actually

11:10:18finished.

11:10:19And this works for any amount of items,

11:10:21even if you have 5,000. It will always

11:10:23loop back, right? And this is a a cheat

11:10:25code that I like to use whenever you

11:10:26want to make your automations more

11:10:27scalable over time. Cuz again, adding

11:10:29one more step, you're not going to pay

11:10:30more, cuz the N8N you pay by workflow

11:10:33execution, not by step, uh which is

11:10:35exactly why I like to use this. So, now

11:10:37we want to be able to

11:10:39generate

11:10:41connection

11:10:42message.

11:10:43Okay?

11:10:45I'll go in here. Again, you already

11:10:47connected your OpenAI

11:10:48on these steps, you can use the same

11:10:50exact connection. Let's just use GPT-4

11:10:521. Yeah, you can use this. 4.1 mini, I

11:10:54think it's good. Um and the user, so in

11:10:56this case, system prompt first, because

11:10:57we always use a system prompt to give it

11:10:59an identity, to make itself think that

11:11:01it actually is that thing, and the

11:11:02quality of output would be better, um

11:11:04is, you are a helpful

11:11:07intelligent writing assistant. And this

11:11:10is always how you should structure your

11:11:11prompts. Always a system prompt first,

11:11:13and then, sorry about that, um and then

11:11:15a user prompt, and then you can do

11:11:17another user prompt, or whatever it is

11:11:18you have to do. Now, for the sake of

11:11:19time, I'm not going to be writing the

11:11:21prompts from scratch again, um I'm going

11:11:23to paste them here and then show you

11:11:24exactly why they're there and how they

11:11:26work. All right, so I just pasted the

11:11:27prompt. Let's go through one by one. We

11:11:28have a system prompt, as I wrote before.

11:11:30Then we have the user prompt, the first

11:11:32one, which is, your task is to take an

11:11:33input of a bunch of LinkedIn profiles,

11:11:35and then you basically have to return an

11:11:37icebreaker. So, the icebreaker is the

11:11:38connection message. Um in order to

11:11:40ensure the icebreaker punchy and high

11:11:41quality, make them follow this template.

11:11:43So, we give it a template that they can

11:11:45use, um

11:11:46and they can say, hey, hey name, love

11:11:49seeing thing about them, so you can say

11:11:50something specific about them. I'm also

11:11:52into plausible tie-in, which is

11:11:53something more specific about them. Um

11:11:56and then you can say, four thing about

11:11:57them and plausible tie-in. Never use the

11:11:59exact information provided in LinkedIn

11:12:00field, instead always paraphrase. This

11:12:02makes it seem more human written. You

11:12:04basically give it a few instructions

11:12:05that they can use. But this is

11:12:07essentially the structure that we use.

11:12:09Okay, and these variables are the thing

11:12:10that we change every single time, that

11:12:11the AI is smart enough to change, um

11:12:14when we give it the actual data from

11:12:15that person. The next prompt that we

11:12:17give it is another user prompt. So, now

11:12:20this is where we start to get to

11:12:21examples. So, this is where we start to

11:12:23use the assistant prompt. Uh the first

11:12:25thing is a user and then assistant. So,

11:12:27in this case, we're giving it an example

11:12:28because we want it to, I guess, have

11:12:30something in mind that it can come back

11:12:32to as expectations of what we expect the

11:12:34output to be. So, we give it an example,

11:12:36in this case, LinkedIn fields, Daniel,

11:12:38um founder and CEO, creative agency, uh

11:12:40regional sales director, previous

11:12:42experiences. And then we actually give

11:12:43an assistant prompt, which is the output

11:12:46that we should expect in JSON, which is,

11:12:48hey Daniel, love seeing your creative

11:12:49agency journey. I'm also building brands

11:12:51that I connect. Something short and

11:12:52sweet, very very uh personalized, and

11:12:54very human, right? Um

11:12:57which is what we want. So, we give it a

11:12:58user and assistant. And then lastly, we

11:13:00give it the actual data that we want it

11:13:02to use, uh to be able to then make the

11:13:04icebreaker. So, LinkedIn fields can be

11:13:07first name, the last name, which we get

11:13:09from here. The first name, last name,

11:13:11LinkedIn URL, title, uh I believe that

11:13:13we have previous experience. So, the

11:13:15company they work for, and there's a

11:13:16bunch of fields here. Again, if you get

11:13:18the template, you can copy this like

11:13:19literally word for word, and prompt by

11:13:21prompt, um so you don't have to do this

11:13:23again. But we give it different fields,

11:13:25as you can see here, for it to use to

11:13:27then make the icebreaker. Okay? So, now,

11:13:29let me pin this.

11:13:31Let me pin this, I think. I can pin

11:13:33this. No, I can't pin this.

11:13:34Um and let me execute this step. So, now

11:13:37I'm testing [music] this. All right, so

11:13:38the output uh was done, and as you can

11:13:40see here, I actually messed up because I

11:13:42forgot to turn this on.

11:13:45So, you can see here, the content that

11:13:46we got was actual JSON. Well, we don't

11:13:49want the actual JSON, we want this right

11:13:50here.

11:13:52Right, so what we do to fix that is turn

11:13:54this on.

11:13:55And now, if we execute this step again,

11:13:57what this should do now is it should

11:14:00actually output the icebreaker not in

11:14:02JSON, but as an actual sentence. All

11:14:03right, so you can see here we have the

11:14:04icebreaker, uh different from before

11:14:06because it's not in JSON anymore, it's

11:14:08an actual like something that we can

11:14:09actually use.

11:14:10And lastly, this is where we get to the

11:14:13Google Sheet. So,

11:14:14this right here, all good, and now we

11:14:17get to the Google Sheet part. Let's go

11:14:18here.

11:14:19I'm going to press plus.

11:14:21Google Sheet.

11:14:22Uh append a row in a sheet.

11:14:25First of all, make your connection. Just

11:14:26sign in with Google.

11:14:28Or yeah, sign in with Google right here.

11:14:30It will take you to a page like this.

11:14:32You can choose your account and then you

11:14:33will come back say successful and

11:14:34everything's good.

11:14:36Now, I already made the sheet, but I'm

11:14:37going to make it again um because I want

11:14:39to show you exactly what it looks like

11:14:40even making the sheet. Let's go to

11:14:41sheets.new, quick hack to make a new

11:14:43Google Sheet. And then, as you can see,

11:14:46we need different fields. So, if I go

11:14:47here, I can see that the different

11:14:48fields are ID, first name, last name,

11:14:50LinkedIn URL. So, ID,

11:14:52first name,

11:14:55last name.

11:14:57Let's do LinkedIn

11:15:00URL cuz I noticed that

11:15:02this is just a name, the first name as

11:15:04well. Then we have title,

11:15:06email status.

11:15:08I don't know if you need this cuz

11:15:09there's no email that we're getting. Uh

11:15:10so, title, photo URL, and icebreaker.

11:15:12Title,

11:15:13photo URL,

11:15:15and then connection message.

11:15:18Let me make this

11:15:20um

11:15:21dark blue. Make this white.

11:15:24Let me make it look pretty.

11:15:27Perfect. Go here.

11:15:29And then, quick hack.

11:15:31View this. Please have the row numbers.

11:15:33If I go like this, I can still see it.

11:15:35All right. So, now that we have this, I

11:15:36can do connection

11:15:39message

11:15:41LinkedIn

11:15:42and N YouTube tutorial. Really long

11:15:45name. Just so I know exactly what this

11:15:46is. If I go back here, I can see that

11:15:48now I can uh resource is the sheet

11:15:51within document. Then we want to append

11:15:53a row. Append just means add. And then,

11:15:55the document that we want to use is the

11:15:57connection message LinkedIn and N

11:15:58YouTube tutorial. There we go. Right

11:16:00here. And the sheet will be sheet one.

11:16:02We want to map each column manually.

11:16:04And now, this is where we start adding

11:16:06the different fields. So, I can go to

11:16:07ID.

11:16:08Yeah, this is the ID.

11:16:11I think. Yeah, yeah, this is ID. Let me

11:16:12go first name.

11:16:15First name

11:16:17right here.

11:16:18Last name

11:16:20Again, you could like you could spend a

11:16:22few minutes like trying to figure out

11:16:24where everything is right here.

11:16:26I just like to put everything here. I

11:16:28mean, you could also do this, right? Or

11:16:29title.

11:16:31Or photo URL. Yeah, maybe I was just

11:16:33tripping. Maybe we should do this

11:16:35uh save us more time. And then, the

11:16:36icebreaker is the thing that we use as

11:16:38the connection message. I think that's

11:16:40it.

11:16:42Right?

11:16:43Let's rename this. Add leads

11:16:47to Google

11:16:48Sheets.

11:16:50Let me save this. Uh and now, you see

11:16:53this ends.

11:16:54This right here now needs to go back to

11:16:57loop of items behind.

11:16:59There we go.

11:17:00So, that we loop 20

11:17:02and then we go back here, get the next

11:17:0320, the next 20, the next 20 until we

11:17:05get these many items.

11:17:07Okay? So, we do everything we split

11:17:09Basically, we split it. We loop over

11:17:10items. That's what this is. All right.

11:17:12So,

11:17:13let me execute the step. Let me test

11:17:15this thing right here.

11:17:16Um I should be able to see different

11:17:19leads coming through. If I don't, then

11:17:21something is wrong.

11:17:22We can fix it. Okay.

11:17:25This has to run first.

11:17:27And then, we can wait for everything to

11:17:28go to the Google Sheet. Right now, it's

11:17:29running. We can see that now we have the

11:17:31different leads. So, ID, first name,

11:17:33last name, LinkedIn URL.

11:17:35Let's go here. There we go. Gino, what

11:17:37is up, my man? Real estate agency.

11:17:41There we go. This is so good. I mean,

11:17:42you can actually just

11:17:44I can't. Yeah, you can actually just

11:17:46connect to them. So, connect add a note,

11:17:48and then literally just go here.

11:17:50Uh no, here. Copy this. Go here, paste

11:17:53it, and then actually just send it.

11:17:56Let me actually just send it. There we

11:17:57go.

11:17:58Boom.

11:17:59That's it. And that's how your outbound

11:18:00campaigns can actually run. And you can

11:18:02do this for every single one. And the

11:18:03best thing is you saw me do it manually,

11:18:05but there's so many softwares that can

11:18:07automate this. See, you simply can have

11:18:09a machine running through in the back

11:18:10end that's personalized like hyper

11:18:12personalized to each person because

11:18:14again, you can only send 30 connections

11:18:16a day maximum. I mean, you can, but you

11:18:18you you risk getting banned on LinkedIn.

11:18:20So, if you have an automated platform,

11:18:22you can only send 30 a day. So, 30 * 30

11:18:26900.

11:18:27Like typically, you would only need a

11:18:28900 leads right here every single month.

11:18:31God, why do I keep going back to this?

11:18:32Um you would only need 900 leads right

11:18:34here every single month you can go

11:18:36through. And again, we can script 5,000

11:18:38for free every single month. So, this is

11:18:40literally a no-brainer. Like everyone

11:18:41should be using this if you want um to

11:18:44to I guess run a campaign or run

11:18:46something in the back end that can work.

11:18:47Because

11:18:48the alternative is just you doing it

11:18:50manually.

11:18:53Hey, in this video, I'm going to build a

11:18:55full sales coach system inside of N and

11:18:58N that takes the transcript of every

11:18:59single one of my calls. It sends it to a

11:19:01custom sales coach GPT that is trained

11:19:04on the best sales frameworks in the

11:19:06world. And then, it delivers a full

11:19:07[music] breakdown on Slack with

11:19:08everything that I could have done

11:19:09better. By the way, this is literally

11:19:11the exact system that we sold [music] to

11:19:12a business for 3K. So, the first part of

11:19:14the automation is actually me ending the

11:19:16call, which triggers a webhook. Means it

11:19:18sends the data to N and saying, "Hey, we

11:19:20just finished a call. Review it." Right?

11:19:22Now, obviously, I can't do that right

11:19:23now cuz I'm not on call. But what I'll

11:19:24do is I'll send a request to this

11:19:26webhook so you can see what it actually

11:19:28looks like. So, we finished the call.

11:19:29Let me send the data here.

11:19:31What it does then is it uses Fireflies,

11:19:32which is the software that we're using

11:19:34for meeting notes to extract the

11:19:35transcript. Then we're sending it to a

11:19:37sales coach GPT, which is on our

11:19:39platform the OpenAI

11:19:41platform here, which is trained on a

11:19:44document,

11:19:45which is this one right here, which has

11:19:47a bunch of frameworks and questions that

11:19:49you should ask uh for different parts of

11:19:51the call, which analyzes the full call

11:19:52based on our framework, and then sends

11:19:54us a message on Slack right here. We can

11:19:56see that it broke down the start of the

11:19:58call and also the objections, clarifying

11:20:00objections. So, you missed an

11:20:01opportunity to clarify the prospect's

11:20:03objectives early on. A question like,

11:20:04"What specific outcomes are you hoping

11:20:06to achieve from this automation?" would

11:20:08have set clear expectations and

11:20:09direction. That's pretty true. Instead,

11:20:11you asked, "Can you run me through your

11:20:12company first?" which turned the focus

11:20:14away from the immediate needs. Now,

11:20:15that's pretty good uh framework. I of

11:20:17course I was this few months back, so I

11:20:19wasn't the best closer.

11:20:21I was trying my best. But there you go.

11:20:23So, it took all the call and it analyzed

11:20:25it based on this exact framework, right?

11:20:28Which is a framework that we use in

11:20:29sales. I'm going to start from zero, so

11:20:30I'm going to go plus

11:20:32workflow, personal, and then start from

11:20:34zero.

11:20:35So, you get to see what it actually

11:20:36looks like. And we can start. And as

11:20:38always, we never start here, but we

11:20:40start here, right? Because we want to

11:20:42map things out before we build it. So,

11:20:43every automation that we build has an

11:20:45input

11:20:46and has an output.

11:20:48Right?

11:20:50So, the input in this case, let me make

11:20:52this unbold.

11:20:54And by the way, if you're wondering what

11:20:55platform I'm using, it's Miro. Very

11:20:56good.

11:20:57Uh the input in this case will be

11:20:59the call

11:21:01recording.

11:21:02Or call transcript, right?

11:21:06This is a pretty easy system. I'm not

11:21:07going to lie. But it is one of the most

11:21:09ROI. I mean, you'll find is that the

11:21:10easiest systems, not the easiest, but uh

11:21:12the ones that are easier to build that

11:21:14are not super complex with 50 AI agents,

11:21:16uh they're typically the ones that give

11:21:17the business the most value.

11:21:20Okay. So, call transcript, which is a

11:21:21transcript of the call. And by

11:21:22transcript, we mean what's everything

11:21:24that has been said. And we know this

11:21:26works because we have meeting note

11:21:28takers. So, for those of you who don't

11:21:29know what meeting note takers are, let's

11:21:31go to Fireflies, for example.

11:21:33Right here.

11:21:34Fireflies, not this, but this

11:21:37is a note taker, right? What this does

11:21:39is that it joins the calls when you're

11:21:41on a call with a client. So, you hop on

11:21:43a call with the client and you let it

11:21:44in, and it's sort of like a

11:21:46like a live note taker. So, it's there.

11:21:48It doesn't speak, of course. It just

11:21:49takes notes and it transcribes the call

11:21:52so you can then use it for whatever it

11:21:53is. I typically have uh the note taker

11:21:56on every single call just because it's

11:21:58great if you missed anything on the call

11:21:59that you want to look back or action

11:22:01items or things like these, which are

11:22:02great.

11:22:04That's what we would typically do. So,

11:22:05call transcript, we would use Fireflies.

11:22:07Let me put here

11:22:09Fireflies. You also have Fathom, you

11:22:11have Sybill.ai, you have Loom. Uh

11:22:14there's a ton of stuff that you that you

11:22:15have in the market. Um they're all

11:22:17pretty good. So, call transcript, and

11:22:18then we want to basically send it

11:22:22to the GPT, sales GPT.

11:22:26We'll have to make a GPT on the OpenAI

11:22:29platform, which is actually very easy,

11:22:30so don't worry. Uh to

11:22:33to analyze call.

11:22:37Let me make this here.

11:22:38And then,

11:22:40we have to

11:22:41send Slack message

11:22:45with breakdown.

11:22:46With feedback.

11:22:50There we go.

11:22:51See, crazy system. $3,000 for something

11:22:53like this uh that took me about what, 1

11:22:56to 2 hours cuz it was the first time. Uh

11:22:58but if I were to sell it to another

11:22:59person, it would take maybe 30 minutes.

11:23:03It all really depends on what document

11:23:04you're using to the GPT to actually

11:23:05compare the sales call. All right. So,

11:23:08with that said, let's start here. Uh

11:23:09let's start with the first step, which

11:23:11is call transcript. So, because we're

11:23:12using Fireflies, what I'm going to do is

11:23:14I'm going to open up.

11:23:16And you're going to have to make an

11:23:16account. I have the free account, so I'm

11:23:18not paying for this. And you can see

11:23:20here I have meetings.

11:23:21I have all the meetings with everyone

11:23:23that I've had. I believe that I'm above

11:23:24the rate, which is cuz they give you

11:23:25like

11:23:26600 minutes of free free calls. But

11:23:29here's all the meetings that I have. And

11:23:31so, with every single meeting that I've

11:23:32had,

11:23:33we can transcribe it and use this exact

11:23:35automation, which is amazing. And

11:23:36especially cuz I've had days where I've

11:23:38had five calls, and so I wanted every

11:23:41single call transcribed and give me

11:23:42feedback and so on. And it happens

11:23:44instantly cuz it's right after the call.

11:23:45So, where am I going with this? We have

11:23:47to go here

11:23:48to the settings. And then, we go to

11:23:50developer settings here, and we can see

11:23:52that we have two different things. So,

11:23:53we're just going to play around with

11:23:54these two different things. So, the

11:23:55first thing is the API key, which is

11:23:57sort of like a password. If you use

11:23:58ChatGPT in your automations or Claude or

11:24:00Gemini or Grok or OpenRouter, you always

11:24:02need an API key, which is a password.

11:24:04>> [music]

11:24:04>> And then, we have a webhook. And this is

11:24:06really why we're able to make this

11:24:07automation happen is because we

11:24:11can transcribe. It's triggered when

11:24:13transcription is completed. What this

11:24:15means is that you go on a call with the

11:24:16client, it finishes, it then finishes

11:24:18transcribing the call, which takes about

11:24:203-5 seconds, and then it sends a signal

11:24:23to the automation saying, "Hey, this is

11:24:24the meeting recording, or this is the

11:24:26meeting ID." And then [music]

11:24:28we send it to the next step to take the

11:24:29meeting ID and then take the transcript

11:24:31from the call, okay? It will make much

11:24:33more sense once I actually build it. Uh

11:24:35but bear in mind that we are able to

11:24:36send a notification to the automation

11:24:38once a meeting is finished.

11:24:40So, the first step is actually adding

11:24:41the webhook. So, if I go to N and N

11:24:43right here, I can add a first step,

11:24:44which is a trigger, which is what is the

11:24:46thing [music] that starts the

11:24:47automation. And here we have on webhook

11:24:49call.

11:24:50So, again, webhook is just a URL of that

11:24:52people use, or that servers use, to send

11:24:54signals back and forth, right? So, the

11:24:57webhook is made right here. You don't

11:24:58have to do anything. Just get this.

11:25:01Just press on it, you copy it, and then,

11:25:03if you go back to Fireflies,

11:25:05you can paste it here.

11:25:06And you press save.

11:25:08Now, very important thing that we

11:25:10currently have a test webhook,

11:25:12right? If you want to go in production,

11:25:14so if you want to

11:25:15make this live, activate this, you have

11:25:17to change this to a production URL. The

11:25:20only difference is is that this

11:25:23has this,

11:25:25and production doesn't, right? That's

11:25:26it. So, [music] in theory now, if you

11:25:28have a call with the client, and you

11:25:29bring in Fireflies, then once the call

11:25:31is finished, it will send a signal to

11:25:32this webhook. So, as I mentioned, I'm

11:25:34not able to be on a call right now, but

11:25:36I have the request that we typically get

11:25:38from the call recording, right? Now, in

11:25:40order for us to send a example request,

11:25:42we're going to go to Postman API,

11:25:44which is a new thing that I haven't

11:25:45introduced before. Uh but it actually is

11:25:47a really, really good software. It's

11:25:49actually very easy to use. It looks a

11:25:50bit fancy and techy as well. Um but we

11:25:53use this when we are testing webhooks,

11:25:56right? Because something like this to

11:25:58test it, you would have to go on a call,

11:26:00you have to finish the call, you need to

11:26:01say something on the call, and it will

11:26:03take too much time for it to test. So,

11:26:05what we do here is we set up a sample

11:26:07request, example request. [music]

11:26:09The first thing we need is to

11:26:11um to add a URL,

11:26:13which is this right here.

11:26:16So, copy this

11:26:18and paste it here.

11:26:20And we want to make sure that this is

11:26:21post

11:26:22because get is getting information, post

11:26:23is sending information. So, in this

11:26:25case, we're sending information to the

11:26:26webhook, and because that is post, we

11:26:28also have to change this to post. There

11:26:30you go.

11:26:31And then we need the body, raw. So, this

11:26:33is a JSON. JSON is just a language that

11:26:35we communicate software to software, and

11:26:37we have to set up the request. So, we

11:26:39have to set up the actual variables that

11:26:41go into the webhook for it to start the

11:26:43automation, which are the ones right

11:26:44here. So, you get a meeting ID and event

11:26:46type. So, right here, if I listen for

11:26:48test events,

11:26:49I can press send,

11:26:51and this will send the information here.

11:26:53So, again, if this looks a bit

11:26:54complicated, just understand that we're

11:26:56not able to test this. Okay, I have to

11:26:57be on a call. So, we're using Postman

11:26:59API to send a sample request here. And

11:27:01this is exactly what we would get every

11:27:03single time when the call finishes. So,

11:27:04it's purely just for testing. As in,

11:27:06when we go live, we don't use Postman

11:27:08API, we just use the webhook from the

11:27:09Fireflies. Now that we have the meeting

11:27:11ID, and we don't have the transcript,

11:27:13we now have to figure out how to take

11:27:15this transcript from this meeting ID.

11:27:17So, meeting ID is like a unique

11:27:19identifier for every single call that

11:27:20you have.

11:27:21And so, if I go to Fireflies meetings,

11:27:24and I go to like a random one, say on

11:27:27here, this one right here.

11:27:29The URL on the top,

11:27:31if I go here, I can see that this is the

11:27:33meeting ID. So, the URL is pretty

11:27:34standard, and the only thing that

11:27:36changes is the meeting ID and the

11:27:38meeting name. So, going back here, we

11:27:39have to take the meeting ID, which I can

11:27:41pin now. I don't have to use Postman API

11:27:42anymore.

11:27:44Uh and then we can

11:27:46um look for Fireflies

11:27:48right here, Fireflies. You would have to

11:27:50install the thing. It only takes like 5

11:27:51seconds, so it's fine.

11:27:52>> [music]

11:27:53>> And now we want to get the transcript,

11:27:55get transcript.

11:27:57So, as you can see, to get the

11:27:58transcript, we just have to put the

11:27:59transcript ID. Now, the first thing you

11:28:01have to do is go here,

11:28:02create a new credential, you have to get

11:28:04the API key, which you can get here.

11:28:06Uh what was it? Settings, developer

11:28:09settings, and API key. Just copy this

11:28:11and paste it here to connect your

11:28:12account. Choose the right account. And

11:28:14now the resource, which is what is the

11:28:16thing that we are changing, or in

11:28:18general, what are we doing? In this

11:28:19case, it'll be transcript. The

11:28:20operation, which is what is the action

11:28:22that we're doing? And you can do a bunch

11:28:23of stuff.

11:28:25And the transcript ID, which we get from

11:28:27here,

11:28:28meeting ID.

11:28:30By the way, most of these variables,

11:28:31you don't actually have to know

11:28:32anything. You just have to know the

11:28:33body, which is the actual variables that

11:28:35we get, which is the meeting ID and

11:28:37event type. And that's it. So, now that

11:28:38we have the transcript ID, we can press

11:28:40execute step.

11:28:42This will now, I believe, take the

11:28:43transcript. Yep. And the problem is that

11:28:46we have an array. So, it didn't give us

11:28:48the transcript all together. It gave us

11:28:50different bits of the transcript.

11:28:52Sentence one, sentence two, and this,

11:28:55well, being a 12-minute call, is really,

11:28:57really long.

11:28:58See, we have about 444 sentences. It

11:29:01breaks up the transcript into sentences.

11:29:03But naturally, the thing you want to do

11:29:04here is take the sentences and put them

11:29:06all together. So, the next step is to do

11:29:08that. So, we have to pin this,

11:29:10and then And by the way, I'm pinning

11:29:11this so I don't have to rerun it again.

11:29:13I can go to edit fields, which is

11:29:15basically taking a sort of variable and

11:29:16changing it, manipulating data, right?

11:29:19And we're trying to get the sentences,

11:29:21which are all the way here, really,

11:29:22really long, and put them all together.

11:29:25To do that, we can just call this

11:29:26transcript. So, I'm setting a variable.

11:29:29And now if I go full screen, I can

11:29:32sentences, cuz this is the array. Again,

11:29:34an array is this whole thing full of all

11:29:36the variables together.

11:29:38And we just want to extract the raw

11:29:39text. And to do that, you have to go

11:29:41here.

11:29:44I believe that is map.

11:29:46Yeah, map, cuz we're mapping. We're

11:29:48saying, "Hey, inside this, I want raw

11:29:50text."

11:29:52So, it'll be item

11:29:53equals item. dot

11:29:56uh raw underscore text.

11:30:00There you go.

11:30:01You see how we have all the sentences

11:30:02here right now?

11:30:04All the sentences.

11:30:05And the last thing is to actually join

11:30:08them. So, join,

11:30:09which is basically taking out all the

11:30:10quote marks, and we just have a full

11:30:12transcript of a call instead

11:30:15of

11:30:17this, right? Sentences.

11:30:19With a bunch of variables that are so,

11:30:21so long.

11:30:22Cuz we could, theoretically, feed this

11:30:23to AI, but it would just be way too

11:30:25large. It would break, definitely break.

11:30:27So, we just have the transcript that we

11:30:28need.

11:30:29Okay, so what do we do? We took the

11:30:30sentences, cuz there's 450 sentences or

11:30:33more. Let me just scroll a little bit

11:30:34down.

11:30:35And we're taking the raw text, which is

11:30:37the actual text from that sentence. So,

11:30:38we just have all the sentences together.

11:30:40And this is the formula that we use.

11:30:42Map,

11:30:43item, item. The actual name of the item,

11:30:45which is raw text,

11:30:47plus [music] join, so dot join, which is

11:30:49joining everything together. And that's

11:30:51it. So, now that we have the transcript,

11:30:53we can execute step,

11:30:54and the JSON will just be the whole

11:30:56transcript. So, I'm going to rename this

11:30:58to

11:31:00clean

11:31:01transcript.

11:31:04The next step is actually the

11:31:05the sauce of the whole system. So, this

11:31:07is done.

11:31:10So, the next step here is to make a GPT.

11:31:11And by the way, a GPT is just a thing,

11:31:14like an AI assistant, you could say,

11:31:16that is just trained on a specific

11:31:17thing, right? That allows us to be able

11:31:19to analyze, to talk to, to do XYZ. And

11:31:22why is it better than just a normal one?

11:31:23It's because we give it examples. So,

11:31:25for [music] example, Mosey GPT

11:31:28is trained on 200 hours of content and

11:31:30two of his books, [music]

11:31:31right? So, you ideally want to use this

11:31:32instead of using the general ChatGPT

11:31:35search bar because this is trained on

11:31:36these documents. [music]

11:31:38So, it's more specific. And so, in this

11:31:39case, we're not going to use a GPT here,

11:31:41but we're going to go to

11:31:42platform.openai.com,

11:31:44which is the API platform, right? Where

11:31:46we actually use automations back and

11:31:48forth. By the way, I made a full video

11:31:49showing you how you can build with

11:31:50AgentKit, video up here. But the thing

11:31:52that we want to do is to be able to

11:31:54create a project. So, if you just logged

11:31:56into platform.openai.com,

11:31:57you most likely don't have a project.

11:31:59So, create one. Let's name it

11:32:01N and test.

11:32:03Create.

11:32:05Go to dashboard.

11:32:07Go to assistants

11:32:09because these are the assistants that we

11:32:10make. And by the way, if I go to my

11:32:11previous project, you can see that I

11:32:13already have assistants.

11:32:16You can press create an assistant.

11:32:19Create. And now this is where we make

11:32:21the GPT, okay? The thing that actually

11:32:24uh is going to be able to analyze our

11:32:26calls. So, I'm going to name this sales

11:32:28coach.

11:32:30And the instructions is the prompt. So,

11:32:32let's say I want an AI assistant to just

11:32:35give me feedback on my sales calls. I am

11:32:37taking sales calls every day for and I

11:32:38have an AI automation agency that helps

11:32:40clients to

11:32:42automate their processes and be more

11:32:44efficient [music] in the business. And

11:32:45the founder is Michele, M I C H E L E.

11:32:48I'm the one who's hopping on the calls,

11:32:49and I'm also the sales rep.

11:32:52I'm doing everything. Um

11:32:54so,

11:32:55there you go. Press create.

11:32:57And I'm using AI because typically

11:32:59that's what you guys would do. But I'll

11:33:00show you exactly if this is a good

11:33:01prompt or not good prompt. And this

11:33:03right here wasn't here, I believe, few

11:33:05months ago. I think it's almost recent.

11:33:08And

11:33:09it gave us a full

11:33:11um prompt.

11:33:13It's actually not bad. So, the founder

11:33:14is Michele. You don't have to spell it.

11:33:16Stop.

11:33:18I just didn't want it to say Michelle.

11:33:19That's cool.

11:33:20Uh providing actual feedback on sales

11:33:22calls for an AI automation agency.

11:33:23Founder is Michele. I am not saying

11:33:24about user. Let's write in markdown

11:33:26formatting. So, overview. This just

11:33:28means heading one. So, it's just

11:33:30hierarchy of like text, just [music] as

11:33:32you would for a normal essay. And then

11:33:33here it would be objective. Your

11:33:35objective is to analyze each submitted

11:33:37sales call, identify strength. That is

11:33:40pretty decent.

11:33:42I'm not going to give it any examples.

11:33:46And one thing we need to add here is a

11:33:47document that the GPT will use to

11:33:51actually

11:33:52give feedback on the call.

11:33:54So, I'm going to put file,

11:33:56and I'm going to drop in the file that

11:33:58we're going to use

11:33:59to be able to um

11:34:02to transcribe, or not transcribe, to

11:34:03give feedback on the call. And it's this

11:34:05file. So, this is the file that I'm

11:34:06going to using. This is a PDF that has

11:34:0710 steps framework. Has introduction.

11:34:09So, "Hey John, how's everything going?"

11:34:11Uh agenda. "What I'd like to do in this

11:34:13call is really just ask you a few

11:34:14questions, get to know a little bit more

11:34:16about you, and really see if and how I

11:34:18could actually help.

11:34:19Does that sound fair?

11:34:20It's crazy. I used to because I used to

11:34:21be in sales, so well,

11:34:24I can't call me a closer, but I was a I

11:34:26was a setter.

11:34:27Vision-based questions, challenge-based

11:34:29questions.

11:34:30And these are considered good, right?

11:34:31And this is a course program that I was

11:34:33in.

11:34:35And they gave us this framework.

11:34:36So, I'm going to use this to be able to

11:34:38compare it to our call. And yeah, that's

11:34:40it. So, with that said, we have the

11:34:41framework PDF. I can attach it.

11:34:44And what this will now do is it will

11:34:47turn this into a vector store. And what

11:34:49that means is that it's taking the PDF,

11:34:51in this case it's text, it's

11:34:53transforming it into embeddings, and

11:34:55then it's vectorizing the data. That's

11:34:57why it's called a Let me go here. It's

11:34:59called a vector vector store.

11:35:01And then we're adding it to a vector

11:35:03database, right? Database. So, you hear

11:35:05back to database, it just means that it

11:35:06is full of like information, whether

11:35:08it's an image, audio, video, and text.

11:35:09In this case, it's just a PDF that is

11:35:11turned into a number so that we then can

11:35:14text say, "Can you pull information from

11:35:16XYZ?" Which will then vectorize my

11:35:18question, which means it will take my

11:35:19question, turn that into 010001.

11:35:22It will then check it against the vector

11:35:24store that we have, which are all

11:35:25different vectors, lines, and stuff with

11:35:27all numbers. It would match the numbers

11:35:29and then give us the answer, okay? Which

11:35:30is much more efficient than anything

11:35:32else. That's why RAG systems are very

11:35:33very good. Um I need to turn this on,

11:35:36but it's telling me that the file search

11:35:38is not enabled for this model.

11:35:41Let's try GPT-5 or GPT-4 1.

11:35:44Yeah, there we go. So, not all models I

11:35:46can retrieve data. In this case, we can

11:35:48use 4 1. File search. And now

11:35:51we can say, "What is it that is called?"

11:35:54Millionaire Closers Framework, okay. So,

11:35:56when it's giving feedback, I want it to

11:35:57give feedback from like taking

11:35:59information from the Millionaire Closers

11:36:01Framework.pdf

11:36:03that I uploaded in the file search, um

11:36:06and just give feedback based on that.

11:36:08So, now it's doing its thing and we also

11:36:10have a few settings that we can change

11:36:11down below, which I'll explain in just a

11:36:13second.

11:36:14All right, so it just finished this.

11:36:16And then full screen.

11:36:17Let me change this again. It keeps

11:36:19changing it to the other one. Overview.

11:36:23Uh you're an AI assistant closers

11:36:25[music] or PDF. So, we're saying, "Hey,

11:36:27you are a assistant specializing in

11:36:28providing actionable feedback." So, the

11:36:30reason why most of the prompts that you

11:36:32see out there start with you are an AI

11:36:33assistant uh AI assistant is because

11:36:37we are giving it a system prompt. A

11:36:39system prompt is a prompt that we give

11:36:41an AI in general

11:36:43with an identity. So, if you tell an AI,

11:36:45"You are this type of person," it will

11:36:47psych itself to think that it actually

11:36:49is that thing, is that identity, so then

11:36:51the output will be better, right? It

11:36:52will be better in in every single way

11:36:54possible. So, for this example right

11:36:55here, imagine you had a sales call come

11:36:57through. You have to analyze this sales

11:36:59call, and you have to use AI to do it.

11:37:01If one AI was given the A, "You were a

11:37:03helpful, intelligent sales assistant

11:37:05that's done this for 10 years," versus

11:37:07another one that doesn't have it, this

11:37:09will be higher quality because it's now

11:37:11given an identity. That's it.

11:37:13Uh analyze each submitted user's call

11:37:15referencing only the Millionaire Closers

11:37:16Framework. Yeah, I'm just taking off the

11:37:18apostrophes because

11:37:19that's not what the the actual thing

11:37:21has. And now it's really just about

11:37:22testing, right? So, I want to press

11:37:24save, and we can test it right here. But

11:37:26before that, I also have these model

11:37:28configurations. So, the response format

11:37:30will be text, that's fine. Then we have

11:37:32temperature, and the higher the

11:37:33temperature, the more random the model

11:37:35will be. The lower the temperature, the

11:37:37more strict the AI is with the rules

11:37:40that we've given, okay? Then we have top

11:37:42P, which is the higher the top P, the

11:37:45more it will use different words. The

11:37:47lower top P, the more it will use the

11:37:49same words, right? So, it will start

11:37:51using actually the same words. All

11:37:52right, so I'm going to test this. I'm

11:37:53just going to drop in a transcript,

11:37:55which I can get right here.

11:37:59Let me just copy this.

11:38:00Copy selection. I can paste this.

11:38:04Yeah, that's good. That's good.

11:38:06Paste this here. I can run.

11:38:08And you're basically running this actual

11:38:10like agent GPT. So, you don't have to

11:38:12run it through the automation, you can

11:38:13just run it here. So, reasoning.

11:38:18Frame control and agenda.

11:38:21The prospect volunteered extensive

11:38:22details about the business.

11:38:24The rep asked several questions.

11:38:26I don't know if I like this too much,

11:38:27I'm not going to lie, cuz it also gives

11:38:29us null, which is a bit mad. Yeah, I

11:38:31don't want any of this. Like this is

11:38:32this is pretty pretty so

11:38:36it's not that good. Um plus it took a

11:38:38lot of tokens to do it. So,

11:38:40I'm actually going to paste the prompt

11:38:41that I had before.

11:38:43Just from right here.

11:38:44Uh which is much shorter.

11:38:46And I said, "You're a sales closer

11:38:47expert. I want to do overview."

11:38:51With over 30 years of experience in

11:38:53teaching sales, you know the exact

11:38:54framework that will get a prospect to

11:38:56buy and are expert in reviewing people's

11:38:57calls and so on. Then I give it my

11:38:59context and then rules and guidelines.

11:39:01Now, the important thing here and the

11:39:03actual use case is that the this will

11:39:06not be the CEO, well, most likely,

11:39:07right? It will be his sales team that

11:39:09does calls, and then you review the

11:39:10calls using a GPT here, and then you

11:39:12give feedback on the calls so they can

11:39:14actually get better. And that's

11:39:15literally it. So, let me paste this

11:39:16again, the the actual call.

11:39:19Let me go back to and then I can copy

11:39:21this. Copy selection.

11:39:24Paste this here.

11:39:25Run.

11:39:26And now it should give us a shorter

11:39:28answer.

11:39:29Opportunities null.

11:39:31Okay, let's just see how it looks like

11:39:32on the actual

11:39:34automation. I'm not going to judge here,

11:39:36so

11:39:37let's just see what it looks like. But I

11:39:38like this more cuz it's it's uh it's

11:39:40shorter,

11:39:41right? And it also seems like it's a bit

11:39:42more random. So, let me turn this down a

11:39:44little bit. Let's do

11:39:46uh

11:39:48eight.

11:39:49Let me try this again. And this is all

11:39:50about testing, right? So, theoretically,

11:39:52you won't have the actual answer like in

11:39:54your head. You just have to test.

11:39:57So, by putting it lower, I'm saying,

11:39:58"Hey, you can't don't be so creative,"

11:40:00right? Like just follow the framework,

11:40:02follow the prompt that we give it.

11:40:03And it's actually better. Well,

11:40:07I don't know if it's better, but

11:40:08it's giving us Yeah, it's giving us

11:40:09better answer, to be honest. We'll just

11:40:11put it to test in the automation and

11:40:12we'll see how

11:40:13how it does. Cool, I like the I like

11:40:15this one right here. Sample script

11:40:16experts from the next call. All right,

11:40:18now that we have this, we can now

11:40:19connect this to our n8n workflow. So,

11:40:22all we have to do is go to plus,

11:40:25look for OpenAI,

11:40:26and then usually you actually message a

11:40:28model, right? In this case, you want to

11:40:30assistant. Create an

11:40:32uh message an assistant. There we go.

11:40:35To connect your OpenAI, you have to go

11:40:37to get the API key, which you can get

11:40:39from from the openai.com.

11:40:41Go to dashboard, go to API keys,

11:40:46press create a new secret key.

11:40:48So, n8n test.

11:40:51Create a key, and then you can copy this

11:40:54and bring it back here and put me

11:40:56calendar

11:40:5819th of October.

11:41:00Save.

11:41:01Now you have the connection to your

11:41:02account saved. And now the resource will

11:41:04be assistant, the action that we're

11:41:06taking is messaging an assistant. So,

11:41:07we're doing the same thing that we did

11:41:08before here. We're doing it

11:41:10automatically.

11:41:12And now from the list, we want to

11:41:15uh get the sales coach. That's it. Bear

11:41:17in mind that when you make an assistant

11:41:20on this project [clears throat]

11:41:21and then you make an API key on this

11:41:23project, you will not be able to see

11:41:25this assistant here. So, make sure that

11:41:26you make the assistant on the project

11:41:29where you also get the API key in,

11:41:31right? It's important. So, you can see

11:41:33here, I got the API key from this

11:41:35project, n8n test. Then we have to add

11:41:37the user message. So, the user message

11:41:39will be uh not chat trigger node, it

11:41:41will be defined below because we're

11:41:43defining the user message. If I make

11:41:45this bigger, it's expression. Make this

11:41:47bigger, I can copy the prompt. And I can

11:41:49say, "Your task is to give feedback on

11:41:50this call by looking at the transcript.

11:41:52Uh rules, make the feedback concise and

11:41:54break tactical, pointing out exactly

11:41:56what I could have done better on the

11:41:57call. Provide specific quotes in the

11:41:58call when giving feedback, and remove

11:42:01this right here, which is typically what

11:42:02it gives us um when it sources the

11:42:05actual data or the the text.

11:42:07That's it. And then don't use markdown

11:42:09formatting because the next step is

11:42:11Slack, and Slack doesn't have markdown

11:42:12formatting. Uh if you don't know what

11:42:14markdown formatting is, it's this sheet

11:42:15here. This.

11:42:17Heading one is this.

11:42:19Then we have heading two.

11:42:21But it doesn't actually This is great if

11:42:22you have like some softwares that read

11:42:24markdown formatting. So, it wouldn't

11:42:25actually output this. It would just

11:42:26output the heading two in the format of

11:42:28heading two.

11:42:30But in this case, we don't have it with

11:42:31Slack, so it's fine.

11:42:32And now this is finished.

11:42:34So, make this green.

11:42:36The last thing is send a Slack message

11:42:37with the feedback.

11:42:39I want to go here. First, rename this to

11:42:41sales

11:42:42coach.

11:42:44Let me actually run this so I can see

11:42:45what

11:42:46how it works. This is now

11:42:48theoretically talking

11:42:50to this agent, [music]

11:42:52my agent GPT,

11:42:54and getting the answer. As you can see

11:42:56here, we have

11:42:58the output, which is sales call

11:42:59feedback, Millionaire Closers Framework,

11:43:01opening, report strength, okay.

11:43:04Cool.

11:43:06And now let me pin this.

11:43:08We can add Slack. Just the last uh node.

11:43:11And we can message a channel, send a

11:43:12message.

11:43:13To connect our Slack, just go here to

11:43:15create your credential. You can connect

11:43:16your account

11:43:18and just log in. Literally just choose

11:43:20your organization that you have. For me,

11:43:21it's JM Solutions.

11:43:23And then you can allow. Connection

11:43:24successful. Go back to n8n. You can put

11:43:27JM Solutions.

11:43:29As you can see, I've already done it

11:43:30before.

11:43:31Right here. I'll add another one.

11:43:33Another thing that we're changing is the

11:43:34message or manipulating. The action that

11:43:36we're taking is sending. Send a message

11:43:38to channel. If I go to Slack, I can see

11:43:41that all the channels that I have are

11:43:43these ones, which are all for testing.

11:43:45So, when you make a Slack account, this

11:43:47is a free account as well, so you will

11:43:48have the free account. Just literally

11:43:49make a channel. You can create a

11:43:50channel,

11:43:51and you can name it call reviews or

11:43:52whatever it is.

11:43:54And this will be the channel that we

11:43:55use. Now, bear in mind that the channel

11:43:56ID is also here. I believe it's either

11:43:58this or this. I think it's this. Um

11:44:01but we don't have to use the ID. We can

11:44:02just simply select from the options

11:44:05cuz it will be call reviews.

11:44:06And then it will be send a simple text

11:44:08message and the message text will be the

11:44:10output which is a feedback of the call.

11:44:13If I press execute step,

11:44:16we should now see that we have a

11:44:18um feedback. This is way too long. I'm

11:44:21going to lie.

11:44:22If I had to read this for every single

11:44:23call that I have, I probably wouldn't

11:44:26want to take calls anymore. Um

11:44:28So we definitely need to say make it

11:44:30shorter.

11:44:31Yeah, I think it will have to be here.

11:44:34Um rules

11:44:36make a concise

11:44:39without writing massive paragraphs.

11:44:45Not the best prompt, I'm not going to

11:44:46lie.

11:44:47Um

11:44:48So let me execute this step again. Now

11:44:50let me execute this step.

11:44:51Unpin and let me execute the step.

11:44:55And now I'm running this, we have the

11:44:57output. Let me pin this and let me test

11:44:59this again. Let me run this.

11:45:02If I go here, I can see that I have the

11:45:04Okay, that's much better.

11:45:06You see how a changing prompt can just

11:45:07change everything here? We control an

11:45:09agenda setting. Early in the call you

11:45:11let the prospect take the lead. I'm

11:45:12quite direct and I can just go cut

11:45:14straight to the chase.

11:45:15It's true.

11:45:17Um

11:45:17Yeah, cool. I I love the fact that

11:45:19they're putting in quotes. Like the

11:45:21quote stuff is really really good cuz it

11:45:22tells you exactly what you said and what

11:45:24you could have said better. So for

11:45:25example, it says here when she said, I

11:45:28just probably won't have the time to do

11:45:29it basically. You moved on to technical

11:45:31detail. Instead, drill down the tell me

11:45:33more about what not having the time is

11:45:35costing the business. Where have things

11:45:37broken down or gone wrong because of

11:45:38this?

11:45:39Not bad. Not bad.

11:45:41Um

11:45:43Okay, so we have the full exact

11:45:45framework

11:45:46that we want. Ideally, I want to see the

11:45:48name of the call at the top so what I

11:45:50can do here

11:45:51in Slack is

11:45:53I can go down to get a transcript and I

11:45:55should be able to see the name of the

11:45:57call

11:45:59right here. Title.

11:46:01And then you can say break down

11:46:04feedback.

11:46:05And now if I execute the step, I can now

11:46:07see that I have basically the same thing

11:46:09which you can now use and we have the

11:46:10full breakdown.

11:46:14Hey, in this video I'm going to show you

11:46:16step by step how I built a lead

11:46:17generation system inside of that allows

11:46:20us to scrape thousands of leads using

11:46:22Google Maps. Then we extract the URLs of

11:46:25the websites,

11:46:26>> [music]

11:46:26>> then we look for the emails inside the

11:46:27websites before adding it to our Google

11:46:29Sheet database which allows us to then

11:46:30reach out to them and get business. All

11:46:32right, so this [music] right here is the

11:46:33system. I'm going to run it from

11:46:34scratch.

11:46:35We're going to walk through how it

11:46:36works. The first part is scraping a URL

11:46:39which is a link of Google Maps.

11:46:41Now that's a link you typically go to

11:46:42Google Maps for in case you want to cold

11:46:44call or cold email. And what this will

11:46:46now do is it will extract the URLs which

11:46:48is the the websites that are in here. It

11:46:50will remove any duplicates. It will

11:46:52filter the ones that actually have a URL

11:46:54like a real one. And then it goes here

11:46:56to scraping the website,

11:46:58finding the emails of each website.

11:47:00And then at the end after having scraped

11:47:03every single one that's in the Google

11:47:05Maps URL, it will add it to our Google

11:47:07Sheet database. And then once it scraped

11:47:09every single URL

11:47:11and emails inside the URLs, then adds

11:47:13them all to our Google Sheet database.

11:47:16Where we can see here that we have 25

11:47:18emails, right? Out of 32 websites that

11:47:20we scraped. And so these right here are

11:47:23all the emails that we can now use to

11:47:25run our cold outreach. Now cold outreach

11:47:27just stands for reaching out to people

11:47:29who are cold, who have no idea who we

11:47:30are. So what I would do after this is

11:47:32hook them up to an email sequence uh

11:47:34software which means that there's some

11:47:36software that allow you to write emails

11:47:38automatically to each person. And so

11:47:40that you just run email campaign

11:47:41automatically and you can use the system

11:47:43every other day uh to scrape new leads,

11:47:45to scrape new emails and then reach out

11:47:47to them. All right, so let's go through

11:47:48the whole system step by step and show

11:47:50you how it works. The first part is the

11:47:52Google Maps data extraction. So if I go

11:47:54here, we're running this manually right

11:47:56now, but it would typically be a

11:47:59What would it be? On on schedule because

11:48:01ideally we don't want to go to Any.do to

11:48:03have to run this manually every single

11:48:04time. So we use something like this

11:48:07which allows us to be able to run the

11:48:08system every day or every second,

11:48:12minute, hour, days, weeks, months. It

11:48:14has very custom formulas. So we can put

11:48:17this as an automatic first step, but in

11:48:18this case we have this manually. And now

11:48:20the real first step to why this is

11:48:21possible, so if we go in here, we're

11:48:23using a HTTP request. Now HTTP stands

11:48:26for Hypertext Transfer Protocol. Yeah,

11:48:29there you go. Hypertext Transfer

11:48:30Protocol which is a very fancy word to

11:48:32say, hey, we're taking a URL like this.

11:48:35So let me just copy this and paste it in

11:48:38Google

11:48:39which is literally us going to Google

11:48:40Maps and putting agencies in New York

11:48:43which are all the agencies in New York

11:48:44right here. And we're scraping this this

11:48:47this all the websites that are here. All

11:48:48of them. Right, we're going to each one

11:48:51so you don't have to essentially. And so

11:48:53the HTTP request allows us to be able to

11:48:55get

11:48:56The method is just what are we doing? In

11:48:58this case we're getting information.

11:49:00All of this, right? And if I go here

11:49:02and show you exactly how this actually

11:49:04works

11:49:05to inspect. On the right hand side, this

11:49:08is what it's scraping. The HTML behind

11:49:11the page. Network. There's a ton of

11:49:13stuff, a ton of different little codes

11:49:15and language here, but that allows the

11:49:16HTTP request to be able to extract the

11:49:19whole information out of this page which

11:49:21then is useful for us for the next

11:49:22steps. And as you can see here the data

11:49:24which is the output like what is the

11:49:25thing that this the system is giving us

11:49:28to start with is just this.

11:49:31Right? Doc type HTML and there's a ton

11:49:33of stuff here. So I go to JSON which is

11:49:35the way that you can also represent

11:49:37this. It's a long long JSON string

11:49:40which again is the JSON not JSON, it is

11:49:42the HTML behind the actual website,

11:49:45right? Which you can then use. And by

11:49:46the way, if this is the first time that

11:49:47you see this node right here, HTTP, or

11:49:50maybe you never used it before, then

11:49:52check out this video up here where I

11:49:53show you the fundamentals of how it

11:49:54works. All right, now that we have this,

11:49:56let me pin this because now the output

11:49:58is just this, right? HTML.

11:50:00We use a code node, right? Again, we're

11:50:02coding now. But we're using a JavaScript

11:50:04code to be able to turn this long long

11:50:07HTML into this.

11:50:09Right? Which are all websites. I go to

11:50:11schema, I can see that we have 229 items

11:50:13which means that it found 229 websites.

11:50:17For example, we have schema.org and we

11:50:18have a ton more, right? Let's say let's

11:50:19go https fonts.gstatic.com.

11:50:24This is a invalid URL, right? For

11:50:26example. And so what this does, let me

11:50:28paste it into ChatGPT.

11:50:30That's usually what I would do if I

11:50:31didn't know what the code did and say,

11:50:33can you break this down into one

11:50:37sentence

11:50:39explain what this does.

11:50:44Typically the input is the HTML which is

11:50:47the long string of HTML text that we

11:50:50get.

11:50:51And we take the first input JSON. We

11:50:53find all the website URLs using regular

11:50:56expression. So we call this regex. It's

11:50:58just a a fancy way to say that we let's

11:51:00say we have a long text and it finds

11:51:02things that are like prominent, right?

11:51:04So for example, every website that we

11:51:05know has https semicolon slash slash. So

11:51:09it finds all the websites that are

11:51:10within that we're occurring sort of

11:51:12text, right? And then it extracts all of

11:51:14them.

11:51:15And then it returns them as a list of

11:51:18separate JSON objects. And that's

11:51:19essentially what it does. Because again,

11:51:20here we have these, right? So it

11:51:22extracts these which it finds. It knows

11:51:25because well sort of every website has

11:51:26https and then it has .com or .it or

11:51:30.whatever depending on what country. And

11:51:32it leaves these alone which are not

11:51:34websites. We want to make this run once

11:51:36for all items and we want to use JSON

11:51:38which is JavaScript Object Notation. And

11:51:40then we're just giving it this data,

11:51:42right? Which is

11:51:43this first.json.data.

11:51:45And we get this.

11:51:47Now once we have this, we now have a

11:51:48list of 229 websites that we can now use

11:51:52to be able to scrape, right? Now as you

11:51:55can see here, 229 websites entered this

11:51:59new node, but 34 only went out. It's

11:52:01because we have a filter here. We filter

11:52:04by the URLs that schema.org, right?

11:52:07Which is not a real website or Google

11:52:09websites or GG websites or GStatic

11:52:11websites. These are not websites that we

11:52:13can scrape that have emails in them. And

11:52:15so what we do here is we say the website

11:52:17does not contain

11:52:19right? Which is a string. Does not

11:52:20contain because string is just saying,

11:52:21hey, it does not contain within the text

11:52:24schema and it does not contain Google

11:52:26and it does not contain GG and GStatic

11:52:28because these are the signs that it's

11:52:30not an actual website. For example, as

11:52:32you can see here, we have all the ones

11:52:34that were invalid. I go here, https

11:52:37gstatic.

11:52:38These are all invalid websites. And so

11:52:40we don't want to scrape those websites.

11:52:41We only want to scrape the ones that are

11:52:43actual websites. For example, this right

11:52:45here.

11:52:46I go here

11:52:48and I can see that this is an actual

11:52:50business. And that's the ones that we

11:52:51use for the next steps. So we have this

11:52:52filter step right here. And then once we

11:52:54have 34 websites that are actual

11:52:56websites that we can scrape, we are

11:52:58removing duplicates which means that we

11:53:00are taking a list of 20 for example like

11:53:02these. And we're looking, hey, is there

11:53:04any duplicates in the actual list?

11:53:05[music] Well, as you can see here, yes,

11:53:07we have this.

11:53:08This, that's duplicate.

11:53:10And these three, so on. And so we just

11:53:13take them.

11:53:14We say, hey, remove items repeated

11:53:16within the current input which is this.

11:53:19And we want to compare all fields.

11:53:21And this is the output that we get. We

11:53:23get a list of websites that are actual

11:53:25websites that are not repeated that we

11:53:27can use to then extract the emails from.

11:53:29There we go.

11:53:32I'm going to pin this. I'll pin this as

11:53:34well. Now this up here actually doesn't

11:53:36have to be here. Uh it's just for

11:53:38production. Uh sorry, for testing

11:53:40because we're limiting the amount of

11:53:41items, the amount of websites that we're

11:53:42sending through just to test. But you

11:53:44could delete this and have this pass

11:53:46through all the items from remove

11:53:47duplicates. But here we have the um

11:53:50we're basically saying, hey, only let

11:53:5110,000 websites through as a limit. And

11:53:54now this is where we start the scraping.

11:53:55Now so far, these are nodes that you

11:53:57probably never seen before in an actual

11:53:59automation together, right? The HTTP

11:54:00code uh filter, remove duplicates, and

11:54:03limit. And we also have the loop over

11:54:05items again. So, we script the websites,

11:54:08we extract the URLs of the websites, and

11:54:10we go here and we filter and we say,

11:54:11"Hey, is this a Google website or is

11:54:13this an actual website?" If it's an

11:54:15actual one, then we send it to the next

11:54:17step, which basically takes the whole

11:54:18list, it removes all the duplicates, and

11:54:21then what we do here is now we go into

11:54:24the process of scraping. Now, scraping

11:54:26just means that you go inside Let's say

11:54:28I go to uh

11:54:31Let me go Let me take an example here.

11:54:33Custom Staffing, there we go. This one

11:54:35right here. And what we're doing here is

11:54:36we are extracting all the text, which

11:54:38you can find here. So, every single

11:54:40website that you see in the internet has

11:54:42HTML. It's consisted of HTML,

11:54:44which is why we're able to

11:54:47put these buttons, make this orange,

11:54:48make this white, make this blue, right?

11:54:50We're able to make websites not just a

11:54:52Google document, right? Make them look

11:54:54pretty. It's all HTML. So, what the

11:54:56server does is it just goes here and

11:54:57extracts that to be able for us to go to

11:54:59the next step, which is, again, going

11:55:02down the loop way, which is just

11:55:04looping. So, going through each website

11:55:06over and over again. And we're only

11:55:07sending one item, so one website through

11:55:10at the same time.

11:55:11So, we're sending one item, which is a

11:55:12website. We then script the website

11:55:14using just a simple HTTP again get

11:55:17request. So, we're getting the whole

11:55:19HTML

11:55:20of the website here. We just drag this

11:55:22across. So, this is all the code that we

11:55:24spoke about. And one thing that I also

11:55:25added here is the ability for the

11:55:27workflow to continue even though there's

11:55:29an error. Why? Well, it's because some

11:55:31websites, when you script them, they

11:55:33don't allow you to script the website.

11:55:34As in there's a there's an encryption

11:55:35that that says, "Hey, this is private.

11:55:37You need a password or you need some

11:55:38sort of authentication to get inside."

11:55:41And if that happens, this will error

11:55:43out. There'll be an error. So, we're

11:55:44saying, "Hey, you can still continue the

11:55:45automation even though it might fail at

11:55:47the same time." And so, what we do for

11:55:48the next steps after we extracted all

11:55:50the language behind the website is we

11:55:52wait. Now, the reason why we wait about,

11:55:54yeah, 1 second is because of the fact

11:55:57that we don't want to run into any rate

11:55:58limits. And rate limits usually happens

11:56:00when you script websites over and over

11:56:02and over again really really fast. So,

11:56:03you want to give it some room to

11:56:04breathe. 1 second is enough. Um you can

11:56:06even put two.

11:56:08So, you're able to make sure that you

11:56:09are actually able to script all these

11:56:11websites. And then what we do here is we

11:56:13go to a similar

11:56:16sort of node right here. Well, it's the

11:56:17same node, right? But it's a similar

11:56:18function.

11:56:19And we extract the emails. So, the input

11:56:22is this, which is the data here. So,

11:56:24this right here, this this this whole

11:56:25thing that you see that you probably get

11:56:26confused about,

11:56:28this just says, "Hey, this is the

11:56:30typical way that people write emails,

11:56:32okay? And the email is usually text

11:56:35here,

11:56:36right? Before

11:56:38the @ and then gmail.com and then

11:56:39something.com or something.it.

11:56:42And so, what we're seeing here is this.

11:56:43We're saying, "Hey, we're basically

11:56:44looking at patterns." So, every email

11:56:47usually has these characters before the

11:56:49@, these characters after the @,

11:56:51and then some sort of text.

11:56:54And so, that's what we extract from the

11:56:56website to then get the emails. And

11:56:58sometimes [music]

11:57:00it cannot read properties of undefined

11:57:01reading match, which means that it

11:57:03didn't find it. But if I go here to

11:57:06Let's say 21, so on,

11:57:09you can see that it found a ton of

11:57:11emails from the same company that he

11:57:13uses. And so, again, we're using code to

11:57:15be able to extract all the emails from

11:57:18the script of the website, so from the

11:57:19HTML, from the language behind the

11:57:20website, that we can then do for every

11:57:22single website that we have. And when

11:57:24this is finished, we then send it up

11:57:25here to wait again. We give it 5 seconds

11:57:28just to give it some room to breathe.

11:57:30And then we have to filter out the

11:57:32websites that don't have any emails. So,

11:57:33we're saying, "Hey, does it JSON.email

11:57:36right here?

11:57:37If this exists, then send it through. If

11:57:39it doesn't exist, then don't send it

11:57:40through." In this case, you see that we

11:57:42had uh these emails come up, and the

11:57:45emails that didn't come up were these

11:57:46ones because we couldn't find them or it

11:57:48was just, yeah, null just means that

11:57:50there's nothing there. This just means

11:57:51that it was an error that we can't read

11:57:53the property.

11:57:54And we're only keeping the ones that we

11:57:55can find

11:57:57right here. Before taking these emails,

11:57:59which are in an array. Array just means

11:58:01that it's in a way where we have

11:58:02different information inside the

11:58:03information. And we're taking this block

11:58:06and we're splitting it out.

11:58:08Right? So, what this means is that we're

11:58:09taking all these emails and we're

11:58:11processing each one individually. Okay,

11:58:14that's what an array is. Array is just

11:58:15something that has this inside. It's

11:58:17like you go to the grocery store and the

11:58:19groceries is banana, strawberries,

11:58:21fruits, XYZ. These is the different

11:58:24items within the grocery list. We're

11:58:25splitting it out into each one. So, you

11:58:27can see now we have 110 emails,

11:58:29different pages.

11:58:31Right? That you can then send to another

11:58:33remove duplicate because, as you can see

11:58:35here, there are some duplicates as well

11:58:37within the emails.

11:58:39And so, we want to remove those.

11:58:41And so, out of 110 emails,

11:58:43we only kept 25. Which I'm going here, I

11:58:45can see that it's the same exact

11:58:47setting, remove items repeated within a

11:58:48current input. With the input is this.

11:58:51And this is the output.

11:58:53List of emails, which you can now use to

11:58:55be able to add to our Google Sheet

11:58:57database right here.

11:59:00Which you can then use for email

11:59:02campaigns.

11:59:03Now, can you use Apify to do all of

11:59:05this? Yes, but Apify isn't free. As in

11:59:08you still have to pay for it. Um I guess

11:59:11it is more reliable in a sense as in

11:59:12Apify has their own scrapers, you can

11:59:15add more stuff there. But just the fact

11:59:16that we're able to put a URL right here,

11:59:18and we can change this to

11:59:20agencies in I don't know.

11:59:24Canada.

11:59:26Right here.

11:59:28Agencies is in Ontario. I don't know if

11:59:31that thing come up. Agencies. Zoom

11:59:32agencies.

11:59:36Again, we can do agencies in a specific

11:59:38location.

11:59:40And then these are all the agencies that

11:59:41it will use, that it will extract the

11:59:43information from.

11:59:44In this case, we're in New York,

11:59:46the one and only. Um and this [music]

11:59:49will be the thing that it will extract

11:59:50to then be able to then get all the

11:59:52emails. Now, one thing that we could do

11:59:53actually is this. We could, instead of

11:59:55running this on a daily basis because it

11:59:57would extract the same exact websites,

11:59:59now that I thought of it, you can have

12:00:01another page here,

12:00:03and the page would be websites or

12:00:05businesses

12:00:07to scrape.

12:00:09And you can have,

12:00:12I don't know, like agencies in New York,

12:00:17agencies in Canada,

12:00:20or whatever, like flooring businesses.

12:00:23You can have a ton of businesses here

12:00:24that you can use.

12:00:25And then you can hook this up. So, if I

12:00:27go here,

12:00:28I can press plus. I can then look for

12:00:31sheets.

12:00:34Get rows.

12:00:36Look for our Google Sheet, which is

12:00:38Apify emails.

12:00:40It will be sheet one,

12:00:42I believe. No, sheet two. Let's call

12:00:44this businesses.

12:00:48So, you know, we can keep track. Okay,

12:00:50it'll be sheet two.

12:00:51And now we can run this.

12:00:55So, if I run this here, I can now get

12:00:57these agencies in New York.

12:00:59Right? And so, what will happen here is

12:01:02that we have to hook this up to the

12:01:04Google Sheet, to the actual Google Maps.

12:01:07And we know that everything that goes

12:01:08after the search

12:01:10is something that changes.

12:01:12Right? Because Google Maps will search

12:01:13everything behind here because

12:01:15everything before here is a static,

12:01:17which means it's the exact same for

12:01:18every single URL. But here is something

12:01:20that we can change. And so, what we can

12:01:22do, pretty high level, but we can take

12:01:25this. We can put it here.

12:01:27Right? And watch this. We can go inside.

12:01:30I don't think I've done this before, but

12:01:32uh we can

12:01:34press plus, and then

12:01:37replace all

12:01:39um space

12:01:41spaces with plus. Why did I do that?

12:01:44It's because Apify, or not Apify, HTTP

12:01:47requests don't allow you to have spaces.

12:01:50And so, as you can see here, we had SO

12:01:52agencies in New York. We had agencies

12:01:55plus

12:01:57in plus New plus York. And so, that's

12:02:00what we're doing here. We're taking this

12:02:01and we're saying, "Okay, make it so that

12:02:03in the spaces, we only have plus."

12:02:06And now if I run this, let me go

12:02:09here.

12:02:11Okay, I need to unpin this though.

12:02:14If I run this, now this should work from

12:02:15the Google Sheet.

12:02:17Three.

12:02:19Went through all three.

12:02:21Each one individually that we can then

12:02:23use to go through the whole system. So,

12:02:25where was I going with this? Well, I was

12:02:26going to say that you can have a list of

12:02:29businesses to scrape

12:02:32here.

12:02:33And then at the end of the the actual

12:02:35thing, you can have a update a row,

12:02:37which is updating here and saying,

12:02:39"Added."

12:02:40And you can put yes. And then now here,

12:02:42you can also put a filter that says,

12:02:44"Hey, don't send the ones that have yes

12:02:46in here." So, you always send the ones

12:02:47that are new that you haven't script

12:02:48before. You can have a whole list right

12:02:50here. Congrats on finishing the ultimate

Outro

12:02:52course on n8n, which took you from a

12:02:54real beginner in automations in general

12:02:56and n8n to someone who's actually able

12:02:59to build automations for themselves and

12:03:01for other businesses. We answered the

12:03:03question of what is automation, and then

12:03:05going diving deep into the exact tool,

12:03:07which is n8n, which allows us to build

12:03:09automations step by step. Then we looked

12:03:11at more of the theoretical standpoint to

12:03:12automations and understanding how

12:03:14softwares speak to softwares, along with

12:03:16actually building AI agents, building

12:03:18workflows, and then putting them into

12:03:20practice by building tangible systems

12:03:22that you can implement into businesses.

12:03:24And I hope that now gave you a lot of

12:03:26use cases that you can think of when

12:03:27going out to businesses or even for

12:03:29yourself to implement. With that said, I

12:03:31really hope that you enjoyed this n8n

12:03:33course, and I recommend that you keep

12:03:35this unnecessarily long course of n8n

12:03:37and automations in the back pocket

12:03:39whenever you want to go back to it. With

12:03:41that being said, I hope you found value

12:03:43from this video, and I'll see you in the

12:03:45next one.

More from Michele Torti

Recently added transcripts

Browse the whole transcript library

This transcript was generated from the captions YouTube publishes for this video. Get the transcript of any YouTube video atfreeyoutubetranscribe.com, free, unlimited, no sign-up.