YouTube2Text

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

by Michele Torti · 158,590 words · 23,658 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Welcome to the most comprehensive N8N
  2. 0:01course, where I take you from a real
  3. 0:03beginner in AI automation [music] to
  4. 0:05someone who's actually able to build
  5. 0:07automations and AI agents for themselves
  6. 0:10or for other businesses. And in case we
  7. 0:11haven't met, my name is Michele, and
  8. 0:13over the past 12 months, we've helped
  9. 0:15over 40 businesses implement AI and
  10. 0:17automations and taught over 20,000
  11. 0:19people in the process. All starting with
  12. 0:21zero technical knowledge. So, we're
  13. 0:22going to go through everything from
  14. 0:23understanding
  15. 0:24>> [music]
  16. 0:24>> what is AI automation to setting up your
  17. 0:26own N8N account, understanding how to
  18. 0:29build stronger and faster, more AI
  19. 0:31automations and AI agents, and finally,
  20. 0:34actually building systems step-by-step.
  21. 0:36[music]
  22. 0:36By the end, you'll be an AI automations
  23. 0:38and AI agents expert, and you'll know
  24. 0:40exactly how to build systems that drive
  25. 0:42real business value. So, the course
  26. 0:44itself is split into six different
  27. 0:46modules. Module one is getting started
  28. 0:48with N8N foundations. We'll go through
  29. 0:50exactly what automation even is to
  30. 0:52understanding how you can set up
  31. 0:53everything within N8N and build your
  32. 0:55first automation. Module two is [music]
  33. 0:57core N8N foundations, using automation
  34. 0:59logic and APIs, and walking you through
  35. 1:01exactly how automation really works in
  36. 1:03the backend. Module three is AI agent
  37. 1:05fundamentals, and really understanding
  38. 1:07how AI agents work. Module four is
  39. 1:09building smarter AI systems, using
  40. 1:11frameworks and prompts, which allow our
  41. 1:13automations and AI agents to make sure
  42. 1:15that everything that we build is
  43. 1:16actually scalable, tangible, and can
  44. 1:18actually be implemented into a business.
  45. 1:20Module five is real-world AI agent
  46. 1:22projects, end-to-end builds, showing you
  47. 1:24exactly different use cases within a
  48. 1:26business that you can implement [music]
  49. 1:28AI agents, and showing you how I build
  50. 1:30it step-by-step. And module six is
  51. 1:32real-world AI workflow projects,
  52. 1:34end-to-end builds, [music] where I show
  53. 1:35you exactly how we now not only just use
  54. 1:38AI agents, but use entire workflows to
  55. 1:40be able to implement into a business,
  56. 1:42and showing you how I build different
  57. 1:43use cases step-by-step. By the way, if
  58. 1:45you want access to all the resources
  59. 1:47that we're going to be talking about in
  60. 1:49this video, plus being part of a
  61. 1:51community of over 3,000 people who are
  62. 1:53actually building automations every
  63. 1:54single day and growing their own
  64. 1:56businesses, check the second link down
  65. 1:57below. I'm going to leave all the
  66. 1:59timestamps down below in case you want
  67. 2:01to skip through some modules or go to
  68. 2:03the direct part, or even come back to
  69. 2:04this video uh because I know it's really
  70. 2:06long. Um so, without further ado, let's
  71. 2:09dive in.
  72. 2:12All right, before we jump into N8N,
  73. 2:14let's talk about what is automation.
  74. 2:16Automation is the process of using
  75. 2:17technology to do tasks without you.
  76. 2:20Whether it's AI agents, whether it's
  77. 2:21workflows, whether it's all this stuff,
  78. 2:23that's exactly what it is. It's using
  79. 2:25softwares
  80. 2:26to be able to do things without you.
  81. 2:28Now, every day, we all perform many
  82. 2:30regular ad-hoc tasks. Ad-hoc just means
  83. 2:32that it's repetitive. Whether you are a
  84. 2:33working professional, whether you are a
  85. 2:35business owner, whether that's in sales,
  86. 2:37marketing, operations, finance, or
  87. 2:39business management, we all have
  88. 2:41different parts of the business that we
  89. 2:43have to do because that's what drives
  90. 2:44the business forward. But the problem
  91. 2:46is, these tasks are repetitive, so they
  92. 2:49happen every single time. They're
  93. 2:50no-to-low brainer, so they're not that
  94. 2:52hard to do.
  95. 2:53They're low value addition, so you do
  96. 2:55them, but they don't add that much value
  97. 2:57into your day. And most importantly,
  98. 2:58they're effort and time consuming. So,
  99. 3:00you do them, they take a ton of time,
  100. 3:02you don't want to do them, they are
  101. 3:03repetitive, they're very easy, and so
  102. 3:05the solution is automation. Now, you
  103. 3:07might not be fully conscious of it, but
  104. 3:09automation actually plays a big role in
  105. 3:11our everyday lives. For example, when we
  106. 3:13have a meeting in our school community,
  107. 3:14so we have two weekly calls. One is a
  108. 3:16weekly huddle, the other one is a vibe
  109. 3:17coding session. When the meeting is 1
  110. 3:19hour away, then it sends a notification
  111. 3:21over email to my school members. Or
  112. 3:23Netflix. When you watch a certain type
  113. 3:26of movie, then Netflix recognizes that,
  114. 3:28so it says, "Hey, he watched this movie,
  115. 3:29that means he must like something else,
  116. 3:31right?" And it gives you a
  117. 3:32recommendation. That is automation,
  118. 3:34because it automates the process of you
  119. 3:36having to find the movie that you like
  120. 3:38in yourself.
  121. 3:39Or a coffee machine. And you might be
  122. 3:40asking yourself, how does a coffee
  123. 3:42machine even play a role in this? Well,
  124. 3:43just hear me out. Whenever a coffee
  125. 3:45machine finishes making the coffee, then
  126. 3:47the timer finishes. And lastly, ChatGPT,
  127. 3:50right? Because when you give a prompt to
  128. 3:52ChatGPT, then it gives you the output,
  129. 3:54right? Now, ChatGPT is a bit different
  130. 3:56just because it's non-deterministic. So,
  131. 3:59non-deterministic means that one series
  132. 4:01of input. So, you can say, "Hey, can you
  133. 4:03do this for me?" And it does something
  134. 4:04else. You can say the exact same thing,
  135. 4:06and it might do it differently next
  136. 4:07time, right? Because you can't determine
  137. 4:09the output that you get. But at the end
  138. 4:10of the day, everything is automation.
  139. 4:12Now, I don't know if you noticed the way
  140. 4:13that I was actually explaining these
  141. 4:15concepts, but we actually use a very
  142. 4:17simple principle, which is if this, then
  143. 4:20that. So, if we have X, then it goes to
  144. 4:22either A and B. If it's B, it goes to
  145. 4:24either E and F. If it's A, then it goes
  146. 4:26to either C and D. And that is exactly
  147. 4:28how automation works. Everything and
  148. 4:30everything is built on logic, right?
  149. 4:32Whether you're building code, whether
  150. 4:33you're using automations, whether you're
  151. 4:34using N8N, make.com, Zapier, Power
  152. 4:37Automate, all these tools, they're all
  153. 4:38built on logic. If this happens or when
  154. 4:41this happens, then you do this. And the
  155. 4:43question then becomes, what can
  156. 4:44automation do for you? Well, as a
  157. 4:46business owner or an individual, it
  158. 4:49increases productivity and efficiency,
  159. 4:50which means that you can do more with
  160. 4:52less, more leverage. You save time to do
  161. 4:54other things, right? Because automation
  162. 4:56for a business means that they can now
  163. 4:58focus on other areas of the business.
  164. 5:00Has an increase of availability, cuz
  165. 5:02automation doesn't need holidays, they
  166. 5:04don't need any emotional support,
  167. 5:05they're always there working 24/7. You
  168. 5:07can scale with less resources. And by
  169. 5:09the way, we've come to a point where
  170. 5:10automation allows us to be able to build
  171. 5:12a one-person company, as you might have
  172. 5:14heard. Uh but it's all because of the
  173. 5:16softwares and technologies that is out
  174. 5:17there. All because of automation.
  175. 5:20And it's more robust and less errors,
  176. 5:22especially when it comes to the
  177. 5:23repetitive tasks that you have to do
  178. 5:24every single time. Cuz if you are
  179. 5:26anything like me, when I do something
  180. 5:28over and over again, I get tired, and my
  181. 5:31quality of output goes down, right? And
  182. 5:33so, with automation, it's consistent.
  183. 5:35And with that said, let's jump into N8N.
  184. 5:38All right, so this right here is N8N.
  185. 5:40Now, all you have to do to get to this
  186. 5:42page is go to n8n.io, and you'll have
  187. 5:45this dashboard. Now, as you can see
  188. 5:46here, it's a flexible AI workflow
  189. 5:48automation for technical teams that
  190. 5:50allows us to be able to build
  191. 5:52automations without needing to know how
  192. 5:54to code. Now, the automation can vary,
  193. 5:56right? Depending on what you're using
  194. 5:57it. IT, security, dev,
  195. 6:00sales, you can do a bunch of stuff
  196. 6:01within this exact platform, and it
  197. 6:03allows us to have so much flexibility
  198. 6:05around what we build. As well as
  199. 6:06plugging it to over 500 integrations,
  200. 6:08which is a bit lower than other
  201. 6:10platforms, but it still allows us to be
  202. 6:12able to speak to different softwares all
  203. 6:14together. And also, it has the ability
  204. 6:15for us to code when you need it, the UI
  205. 6:18when you don't, which means that you can
  206. 6:20go either way, which is why I mentioned
  207. 6:21that it's flexible in what we do,
  208. 6:23because it's great for two kinds of
  209. 6:24people. All right, so if I go to pricing
  210. 6:26right here, I can see how much we
  211. 6:27actually have to spend to be using N8N.
  212. 6:30Now, N8N does not have a free plan on
  213. 6:32the cloud version, right? Cloud version.
  214. 6:35Now, if you're a beginner to N8N, you
  215. 6:37have probably heard about self-hosting
  216. 6:39versus cloud hosting. Cloud hosting just
  217. 6:41means that you just use N8N within the
  218. 6:43cloud. Literally just here. On Chrome,
  219. 6:46on Safari, whatever it is. But we do
  220. 6:48have the option to self-host, which
  221. 6:50means that we create our own server, and
  222. 6:52we self-hosted in our own server, so we
  223. 6:54don't have to pay. Now, don't worry, I'm
  224. 6:56going to show you exactly how to
  225. 6:57self-host as well in the next few
  226. 6:59videos, so you'll have that, too. Now,
  227. 7:01for the cloud hosting version, which is
  228. 7:02the one that most people use, we don't
  229. 7:04have a free plan, but we have a starter
  230. 7:06plan, pro, business, and enterprise.
  231. 7:09Now, most people use the 24 euro plan,
  232. 7:11which is, I believe, about 30 bucks. And
  233. 7:14the way that N8N actually prices us is
  234. 7:16through workflow executions, which I'll
  235. 7:18speak about in just a second. But we do
  236. 7:19have the ability for us to start a free
  237. 7:22trial with no credit card required,
  238. 7:24which allows us to test N8N for about 14
  239. 7:26days before we have to upgrade to a paid
  240. 7:28plan.
  241. 7:29And here, we have one shared project,
  242. 7:32five concurrent executions, unlimited
  243. 7:34users, 50 AI workflow build credits, and
  244. 7:37forum support, which is more than enough
  245. 7:39for what we need. Now, if you are
  246. 7:40building N8N for a bigger company and
  247. 7:42you want more workflow executions, then
  248. 7:44you're most likely going to be using the
  249. 7:46pro plan, which is 60 euros a month.
  250. 7:48Now, honestly, this is not super cheap,
  251. 7:50but when you think about the concept of
  252. 7:51how they actually price their
  253. 7:52automations, it is much better than any
  254. 7:55other platform that I've seen before.
  255. 7:56And same thing here, but it has a bit
  256. 7:57more stuff when it comes to the actual
  257. 7:59plan. All right, so for you, just press
  258. 8:01start free trial right here, then we can
  259. 8:03start filling out the form.
  260. 8:05And then you can press start a free
  261. 8:0714-day trial.
  262. 8:09Go through the onboarding questionnaire
  263. 8:11right here,
  264. 8:12where they ask you a few questions just
  265. 8:14so they get to know you a little bit
  266. 8:15more, okay?
  267. 8:18Podcast, submit. And you can also invite
  268. 8:20members into your workspace. Let's just
  269. 8:22press skip. And now our workspace is
  270. 8:23starting up. Now, I do really like the
  271. 8:25onboarding um sequence that N8N has.
  272. 8:28It's really, really quick, and it's
  273. 8:29really, really easy to follow. Now,
  274. 8:30because you're watching this video,
  275. 8:31there's no need to press this video
  276. 8:33right here, cuz I'll show you everything
  277. 8:35that you have to know. Uh but it is a
  278. 8:36pretty good starting video as well. And
  279. 8:38this guy is a legend.
  280. 8:40>> [laughter]
  281. 8:40>> All right, once the workspace is ready,
  282. 8:42just press start automating, which will
  283. 8:43take you to
  284. 8:45a dashboard that looks like this. So,
  285. 8:47welcome to N8N. Now, on the top, you get
  286. 8:49to see that you have 14 days left on
  287. 8:51your free trial, and you have 8,000
  288. 8:53executions, which is again the way that
  289. 8:54N8N charges you. And then on the top,
  290. 8:56you have upgrade now, which is a button
  291. 8:58to upgrade. I'm going to press X, and
  292. 8:59now we have this page. All right, so on
  293. 9:01the top right here, we have a dashboard
  294. 9:03that allows us to visualize the numbers.
  295. 9:05So, I can actually press inside each one
  296. 9:07and be able to see
  297. 9:08the different graphs. Now, production
  298. 9:11executions just mean that, "Hey, how
  299. 9:12many executions?" So, how many times did
  300. 9:14our automation run every single 7 days?
  301. 9:18How many times did the automation run,
  302. 9:20but it didn't work? Then out of all the
  303. 9:22executions that didn't run in the past 7
  304. 9:23days, how many of them did not work,
  305. 9:25which is this percentage right here? And
  306. 9:27then, how much time did you save, or how
  307. 9:28much time did the workspace save with
  308. 9:30these automations in place, which is
  309. 9:32good to have, but at the same time, it
  310. 9:33isn't super accurate, cuz to understand
  311. 9:35how much time you saved for a company or
  312. 9:37for yourself, N8N needs to know how much
  313. 9:39time did you take in the first place to
  314. 9:41do it, right? Because then you're saving
  315. 9:43them that much time. And lastly, run
  316. 9:45time. So, for how long are the
  317. 9:46automation running? Now, right here, and
  318. 9:48on the top as well, you have the ability
  319. 9:49to create a workflow, and this is how
  320. 9:51you start from scratch. This is how you
  321. 9:52start building. Now, before we get to
  322. 9:53that, we have workflows here, then we
  323. 9:55have credentials right here, which is
  324. 9:57the ability for us to be able to add
  325. 9:59credentials for the different software
  326. 10:01APIs. Now, if you have no clue what APIs
  327. 10:03are, it's how automations are basically
  328. 10:05happening, how they're
  329. 10:07existent. I'm going to go through APIs
  330. 10:09in much more detail in the later stages
  331. 10:10of the video, so don't worry. But here,
  332. 10:12we're basically adding the username and
  333. 10:14password for each software. So, we
  334. 10:16always have it here. We don't have to
  335. 10:18re-upload it again. It's always a
  336. 10:19repository of passwords.
  337. 10:21Then we have executions, so we can see
  338. 10:23all the executions, which is, "Hey, this
  339. 10:25automation just run." It logs it, so you
  340. 10:27have everything logged and uh secured
  341. 10:29here, which is great. And lastly, it's
  342. 10:31data tables. Now, I'm going to dive into
  343. 10:33data tables in this module, I believe,
  344. 10:35or next module, um where I show you
  345. 10:36exactly how you can use data tables, how
  346. 10:38they're powerful, how they're better
  347. 10:40than using tools like Google Sheets and
  348. 10:42Airtable or Notion. So, we'll dive into
  349. 10:44that. Now, without further ado, let's
  350. 10:46press start from scratch, or you can
  351. 10:47press create a workflow. All right, and
  352. 10:49once you get to this dashboard, you'll
  353. 10:51be introduced with two different
  354. 10:52options. The first one is adding a first
  355. 10:53step, which is adding a first step
  356. 10:55manually right here, trigger, which is
  357. 10:57the first step of the actual workflow
  358. 10:59automation,
  359. 11:01or you can start using build with AI.
  360. 11:03Now, build with AI is only something
  361. 11:05that, depending on when you're watching
  362. 11:06this video, it only came out about a
  363. 11:08month ago, but when I press this button
  364. 11:10right here, it takes me to this right
  365. 11:12page right here. Now, the good thing
  366. 11:13about n8n is that it has two different
  367. 11:16types of support. It has the support
  368. 11:18where you can ask any questions about
  369. 11:20anything, and you can simply type any
  370. 11:22message here, and it will give you an
  371. 11:23answer, sort of like an n8n coach that
  372. 11:26helps you when you're building your AI
  373. 11:27agents or automations.
  374. 11:29And then we have the feature, which is
  375. 11:31build. Now, build again is something
  376. 11:33that recently came out, but it allows us
  377. 11:34to actually give it a prompt, so we can
  378. 11:36tell it, "Hey, what would you like to
  379. 11:37automate?"
  380. 11:38And it actually builds the thing. I'm
  381. 11:40going to just do this real quick, so you
  382. 11:42get to see exactly uh how it looks. I'm
  383. 11:44going to say, "AI agent that drafts
  384. 11:47my emails." And we have only 20 credits
  385. 11:49a month to use.
  386. 11:51I'm going to press go. As you can see
  387. 11:52now, this is thinking.
  388. 11:54It's searching through the nodes. I'll
  389. 11:56explain exactly what a node is.
  390. 11:57Essentially, it's a step in an
  391. 11:59automation. It's getting the node
  392. 12:01details, so it's understanding exactly
  393. 12:03automations in n8n, understanding which
  394. 12:05steps to put together and what. On the
  395. 12:07left-hand side, you get to see that this
  396. 12:08is working.
  397. 12:09Now, you get to see that it's adding the
  398. 12:10different steps of the automation. And
  399. 12:12the best way to describe this is that
  400. 12:13it's searching through a puzzle.
  401. 12:15It's understanding exactly what pieces
  402. 12:17do I need for the puzzle, and then it's
  403. 12:19getting the pieces, and then it's
  404. 12:21putting the pieces together right here,
  405. 12:23and then it's connecting, making
  406. 12:24connections inside those pieces, which
  407. 12:26we have right here.
  408. 12:28And now we can start using the
  409. 12:29automation. Now, I'm going to delete
  410. 12:30this and start from scratch, because I
  411. 12:32want to show you exactly what it looks
  412. 12:33like without the build with AI. As you
  413. 12:35can see now, we have no option to build
  414. 12:37with AI. We just have the first step.
  415. 12:38So, when I press this, I can see that on
  416. 12:40the right-hand side, it asks us, "What
  417. 12:42triggers this workflow?" Now, a trigger,
  418. 12:43like I mentioned before, is the first
  419. 12:45thing that starts the automation. Now,
  420. 12:46in n8n, we have the ability to trigger
  421. 12:48manually, so we can manually trigger
  422. 12:50this. We just press this button right
  423. 12:52here, which is execute workflow, which
  424. 12:53means that we are starting the
  425. 12:54automation, and it executes manually.
  426. 12:57We're able to trigger from an app event.
  427. 13:00So, something happens within any of
  428. 13:02these apps, we can get notified,
  429. 13:04and then it starts the automation. And
  430. 13:06there's about 500 apps here, a bit lower
  431. 13:08than other platforms, but n8n is
  432. 13:10constantly adding it here, which is
  433. 13:11great. We have on a schedule. This is in
  434. 13:13case you want to start your automations
  435. 13:15maybe once a day, or you want to run it
  436. 13:17once a week, or every other Tuesday on a
  437. 13:19July, you can do this. You can do on
  438. 13:21webhook call. Now, a webhook is
  439. 13:23something that I'm going to explain in
  440. 13:25the later stage of the video, but it's
  441. 13:27something that we use when we want to
  442. 13:28get notified when something happens.
  443. 13:30We have on form submission, which is for
  444. 13:32us to be able to use forms inside of
  445. 13:34n8n, so that when someone submits the
  446. 13:36form, it then sends us the information
  447. 13:38inside the form, and then we can start
  448. 13:40the automation. Then we can do when
  449. 13:42executed by another workflow, so we can
  450. 13:43actually have a workflow that calls
  451. 13:45another automation, right? So, workflow
  452. 13:47calls another workflow and then brings
  453. 13:48it data back.
  454. 13:50Then we have on chat message, in case we
  455. 13:52want to create a chatbot within n8n.
  456. 13:54Then we have when running evaluation, so
  457. 13:56this is in case you want to test the
  458. 13:58performance of your workflow or of your
  459. 13:59AI agent. And then you can do other ways
  460. 14:01as well, which in this case, it's using
  461. 14:04other different service. Now, I will
  462. 14:05cover this in the later stages of the
  463. 14:06video, but understand that a trigger is
  464. 14:09just the first step of the automation.
  465. 14:11Because let's say we do it manually, now
  466. 14:12we have the ability to then add the next
  467. 14:15steps. And so, when we have the first
  468. 14:16step here, the way that this works is
  469. 14:17that we have this connected to another
  470. 14:19step right here, and I can choose the
  471. 14:21next step. In this case, we have the
  472. 14:23ability to use AI in our workflows. We
  473. 14:25have the ability to use any
  474. 14:26applications, so any softwares, the
  475. 14:28ability to transform any data right
  476. 14:30here, the ability for us to have some
  477. 14:33sort of routing, which means that if we
  478. 14:35send the automation one way if this
  479. 14:36happens, the other way if something
  480. 14:38happens. And again, all these things
  481. 14:41might look complex because you're new to
  482. 14:42n8n, but trust me, they're much easier
  483. 14:44when you actually put them into
  484. 14:45practice. We have core, which is using
  485. 14:47code, HTTP, webhooks, a bunch of stuff
  486. 14:50that you shouldn't worry about now, and
  487. 14:52human in the loop, which is another
  488. 14:53feature that I'll be explaining. So, we
  489. 14:55have the first step, then we have the
  490. 14:56next step. So, let's say I want to talk
  491. 14:59to Notion
  492. 15:00or Google Sheets. Let's say Google
  493. 15:01Sheets.
  494. 15:03Now, we are introduced with Google
  495. 15:04Sheets, and these are all the actions
  496. 15:05that we can do within that software,
  497. 15:08right? So, with every software that we
  498. 15:09have, let's say it's even Gmail. If I
  499. 15:11press on the actual software, I can see
  500. 15:13that all the actions that I can do
  501. 15:14within that software. I can add a label
  502. 15:17to message, delete a message, get a
  503. 15:18message, get many messages. I can do a
  504. 15:20bunch of stuff within each software,
  505. 15:22which is where automation truly shines,
  506. 15:24because it does the things that we don't
  507. 15:25want to do, or that we don't have to do.
  508. 15:27And so, let's say I wanted to go back to
  509. 15:29Google Sheets, I can just press Google
  510. 15:30Sheets here, action in app, which you
  511. 15:32find again right here, action in app.
  512. 15:36So, then
  513. 15:36I can go Google Sheets.
  514. 15:38I can choose the action that we want to
  515. 15:39take, which is append a row.
  516. 15:42And now we're introduced to this page
  517. 15:43right here. Now, every n8n node has an
  518. 15:46input,
  519. 15:47then has in the middle the
  520. 15:48configuration, which is, "How do we
  521. 15:50actually set the thing up?" And then the
  522. 15:52output, which is, "Okay, using the
  523. 15:54configuration here, what was the
  524. 15:55output?" All right, so I just made a
  525. 15:56Google Sheet here that has name, email,
  526. 15:58phone number, company, role, and
  527. 16:00address. Let me name this contacts. Now,
  528. 16:02here, if I go back to n8n, the first
  529. 16:04step to building any kind of automation
  530. 16:06with different steps in the flow, is
  531. 16:08connecting our accounts to these
  532. 16:10softwares. So, we're able to access them
  533. 16:13without us having to go to the actual
  534. 16:14software to do it. So, right here, you
  535. 16:15get to see on the top that we have
  536. 16:17credential to connect with, which is,
  537. 16:19just press here, you can create a new
  538. 16:20credential, which means that you're
  539. 16:21connecting your account, and you're
  540. 16:23introduced to this page. Now, if you see
  541. 16:25OAuth 2, service accounts, allowed HTTP,
  542. 16:27and you get overwhelmed, don't worry,
  543. 16:28just sign in with Google. It's just a
  544. 16:30simple login verification, and you're
  545. 16:32all good. I'm going to press the account
  546. 16:34that I want to connect to. You can press
  547. 16:36select all, so you're basically saying,
  548. 16:37"Hey, I trust n8n to have access to my
  549. 16:41Google Drive and my Google Sheets." You
  550. 16:42will get to this page, which is
  551. 16:43connection successful, and you'll be
  552. 16:44redirected here to n8n. I can make a
  553. 16:47name, so I can say Michele
  554. 16:49system
  555. 16:53account.
  556. 16:54So, I'm pressing save. And usually, what
  557. 16:56we have is also the date. And the reason
  558. 16:57why we add the name is because when you
  559. 17:00connect 20 to 30 accounts here, you want
  560. 17:03to know exactly what the account was.
  561. 17:05And so, the only way for us to know
  562. 17:06exactly what the connection is, is to
  563. 17:08name the actual connection. Once you
  564. 17:10have this here, now the resource is
  565. 17:11usually, "What is the thing that we're
  566. 17:13manipulating? What is the thing that
  567. 17:14we're taking and doing something with?"
  568. 17:16In this case, it will be a Google Sheet.
  569. 17:17The operation is always the action that
  570. 17:19we're taking. So, as you can see here,
  571. 17:21we have different options. We have
  572. 17:22create, delete, delete rows, get rows,
  573. 17:25update a row. You can do a bunch of
  574. 17:26stuff. And in this case, you have append
  575. 17:28a row, which is create a new row in a
  576. 17:29sheet,
  577. 17:30right here. The document, it's choosing
  578. 17:33the actual Google Sheet, which in this
  579. 17:34case is contacts, right here. See how I
  580. 17:37just right here. And also, what you
  581. 17:39could do is actually go to the ID
  582. 17:42or the URL
  583. 17:44of the Google Sheet, which I can find,
  584. 17:45if I go here, I can find in the URL
  585. 17:46here, and the ID is usually
  586. 17:49right here. And then the sheet, which is
  587. 17:51the sheet within the Google Sheet, which
  588. 17:53in this case is sheet one. That's a lot
  589. 17:54of sheet right there. Um and finally,
  590. 17:56you have this right here. And so, this
  591. 17:58is where you start to map columns. So
  592. 18:00again, what we're doing here is we're
  593. 18:01adding a row inside here. So, we're
  594. 18:03adding a row into name, email, phone
  595. 18:05number, company name, role, and address,
  596. 18:07which is why when I go back here, I can
  597. 18:08see that it's asking us, "Hey, what are
  598. 18:10the different values that you want to
  599. 18:11send?" In this case, for name, let's
  600. 18:13just put James Arthur. Let's do email,
  601. 18:16my email here, my phone number,
  602. 18:18my company, the role,
  603. 18:21and the address, so on. And now, leave
  604. 18:24everything else as is. These are just
  605. 18:26other options that you can um sort of
  606. 18:28play around with, but there's no need
  607. 18:29for that. And all we have to do now to
  608. 18:31actually run the automation is to be
  609. 18:35able to connect this
  610. 18:37to here.
  611. 18:38So, this is saying, "Hey, the first step
  612. 18:39now is connected to the next step." And
  613. 18:41so, if I press here execute workflow,
  614. 18:43this should now start the automation and
  615. 18:46do the action, append the row, like we
  616. 18:48mentioned, and adding these details in a
  617. 18:50new row.
  618. 18:51So, let's try it out. Let's say I go to
  619. 18:53execute workflow. I can see that the
  620. 18:54first step executed, and we know this
  621. 18:56because it was all green, check mark,
  622. 18:58and the second step as well. And if I go
  623. 19:00to my Google Sheet, I can see now that
  624. 19:02James Arthur, with his email, phone
  625. 19:04number, James Solutions, CEO, and Spain,
  626. 19:06was added to our database. And that
  627. 19:08right there was a full execution from
  628. 19:09the start until the end, workflow
  629. 19:11executions, from the first step until
  630. 19:13the last step. Now, we can add another
  631. 19:15step, which let's say is Gmail. I chose
  632. 19:17to type Gmail. I can choose the software
  633. 19:19here, and now I can choose the action.
  634. 19:21So, in this case, it can be send a
  635. 19:22message.
  636. 19:24And now we're introduced to this page
  637. 19:25right here, which is very, very similar
  638. 19:27to the one that we had on Google Sheets,
  639. 19:28but the only difference now is that we
  640. 19:30have access to the previous, we call
  641. 19:32them variables, right? Because they're
  642. 19:33different variables here.
  643. 19:35And now we can use these variables in
  644. 19:37the automation. And that's why we don't
  645. 19:38call them variables, what we call them
  646. 19:40dynamic variables, because they change
  647. 19:42every single time. Because when I put
  648. 19:43name somewhere here,
  649. 19:45and I run the automation again later, if
  650. 19:47the name changes, this automatically
  651. 19:49changes name. So, all I have to do here
  652. 19:51is do the same thing. So, I can send a
  653. 19:52message, which in this case is send an
  654. 19:54email. I can sign in with Google. I can
  655. 19:56choose my account, select all.
  656. 19:58Connection successful.
  657. 20:00And now [snorts] I can name this, press
  658. 20:01save. Correct. And now we've connected
  659. 20:03our account to n8n. So, now n8n is able
  660. 20:06to use our Gmail. The resource, which is
  661. 20:09what is the thing that we're
  662. 20:10manipulating, again, changing, is a
  663. 20:12message, which in this case is an email.
  664. 20:14And you can use draft, thread, label,
  665. 20:15you can do whatever.
  666. 20:16Operation, which is what is the action
  667. 20:18that we're taking? In this case, it's
  668. 20:19sending. We can do a bunch more stuff
  669. 20:21here, depending on what you want to do.
  670. 20:23And then it's asking us, who do we want
  671. 20:25to send the email to? What is the
  672. 20:26subject line of the email? And what is
  673. 20:28the message of the email, which is the
  674. 20:29email body. So, now, as you can see
  675. 20:31here, when I pressed on two, it gave me
  676. 20:33the ability to drag an input field from
  677. 20:35the left to use it here. So, now I can
  678. 20:37take the field from the previous step,
  679. 20:39drag this across over here,
  680. 20:42email, and have this be the variable
  681. 20:45that we use every single time, instead
  682. 20:47of putting the email here, right?
  683. 20:49Instead of putting the email manually.
  684. 20:51Get it?
  685. 20:52Get it? [email protected].
  686. 20:55Because if you do it this way, it's
  687. 20:56going to be fixed. But, if you take the
  688. 20:58variable from the previous step, and I
  689. 21:00drag this across here, then only are we
  690. 21:02able to change the variable dynamically,
  691. 21:04without us having to go here and change
  692. 21:06it manually ourselves. And so, what
  693. 21:08we're doing now is that we've just
  694. 21:08pulled in the variable here. We can do
  695. 21:10name. So, pull this name here,
  696. 21:13and say, "Welcome to the team." And
  697. 21:16also, one more thing that you start to
  698. 21:17see is JSON code, right? Now, this looks
  699. 21:20very intimidating for someone looking to
  700. 21:22get started with automations and going
  701. 21:24into n8n, but trust me, it's actually
  702. 21:26quite easy. Because this code right here
  703. 21:28is literally just the variable here that
  704. 21:30we just pulled across.
  705. 21:31So, you don't really have to know
  706. 21:32exactly what this is. But, in case
  707. 21:34you're wondering, we can actually
  708. 21:36hardcode it. So, we can do curly
  709. 21:38bracket, curly bracket. This opens this
  710. 21:39up. You can do JSON {dot} the actual
  711. 21:43step from the previous step. So, you can
  712. 21:45go to, let's say, email. And you when
  713. 21:47you press email, it automatically takes
  714. 21:49us back to the same place as if I were
  715. 21:51just to drag this across.
  716. 21:53And this is great for us in case we want
  717. 21:55to reference any variables from the
  718. 21:57previous steps, and there's a ton of
  719. 21:58variables, and we just want to reference
  720. 22:00them really, really quickly, we just
  721. 22:01manually hardcode it. But, most of
  722. 22:03times, you're just going to drag and
  723. 22:04drop. And then, we're going to ask the
  724. 22:06email type. So, in this case, let's just
  725. 22:07do text. HTML is just the way that you
  726. 22:10make your emails look pretty. We can
  727. 22:11say,
  728. 22:12"Hey brother,
  729. 22:14happy to work with" And let's do
  730. 22:17company. Company right here.
  731. 22:19So, now we're saying,
  732. 22:21"Hey brother, [snorts] happy to work
  733. 22:22with JSON variable, which is company,
  734. 22:24which is this name right here."
  735. 22:26We just don't see James Solutions
  736. 22:27because
  737. 22:29it's a variable right here. Now, the
  738. 22:30good thing about n8n is that we can
  739. 22:31actually see the output.
  740. 22:33So, we can see the actual variable
  741. 22:35before we run it, which is amazing,
  742. 22:36because now it this gives us the ability
  743. 22:37to visualize whether it's correct or
  744. 22:39not. So, James Arthur, welcome to the
  745. 22:41team. "Hey brother, happy to work with
  746. 22:43James Solutions." Which is great. Now,
  747. 22:45what I can do is go back.
  748. 22:47I can go back here. I can change the
  749. 22:48email to, let's say,
  750. 22:52this one here that I have,
  751. 22:54[email protected].
  752. 22:56And now, all I have to do is execute the
  753. 22:58workflow again from the start until the
  754. 22:59end.
  755. 23:01Right here.
  756. 23:03This now goes into Google Sheets, and it
  757. 23:04goes here. I can see now that I have the
  758. 23:06name, the email, and I guess the email
  759. 23:08changed, right? Because we changed it
  760. 23:10manually in n8n. The phone number, James
  761. 23:12Solutions, CEO in Spain. And as I showed
  762. 23:14you, it also sent the email. So, if I go
  763. 23:16to my email here, I can see that we had
  764. 23:18a new email called James Arthur,
  765. 23:19"Welcome to the team. Hey brother, happy
  766. 23:21to work with James Solutions." Which is
  767. 23:23the exact same email that we added into
  768. 23:25our n8n. And so, now that we've built
  769. 23:27this, I can explain exactly how the
  770. 23:28pricing works. So, from the start until
  771. 23:31the end,
  772. 23:32right? When you are testing, so when
  773. 23:34we're pressing this button and we're
  774. 23:36executing this,
  775. 23:37we're not paying for it. From the time
  776. 23:39that we want to set this live, so we
  777. 23:41don't have to manually do it every
  778. 23:42single time, we can turn this on by
  779. 23:44pressing this button.
  780. 23:45So, right now, the workflow, or the
  781. 23:47actual automation, is inactive, which
  782. 23:49means that the automation is only
  783. 23:51running when we manually run it. When we
  784. 23:53go inside the platform, when we manually
  785. 23:55press this button, and it goes here.
  786. 23:57But, in the case for clients that you
  787. 23:58want to set this live, it's sort of like
  788. 24:00this is just for testing. When you're
  789. 24:01building automations, you're testing
  790. 24:03here and there. And the live is when you
  791. 24:04want to actually set this live, it goes
  792. 24:06live. Now, it works by itself, and it
  793. 24:08runs through this at whatever interval
  794. 24:10that you want. And the good thing about
  795. 24:12this is that we're not paying for it
  796. 24:13when we're testing, which is great,
  797. 24:14because it allows us to be able to spam
  798. 24:16the testing as much as we we can,
  799. 24:18because the way that I they actually
  800. 24:19charge you is by workflow executions,
  801. 24:21which is from here to here. As you can
  802. 24:23see, we have the green check marks,
  803. 24:25which tell us that everything went good,
  804. 24:26which is awesome. Now, let's say
  805. 24:28something went wrong, right? So, if I go
  806. 24:30here, and I just create a new
  807. 24:31credential, and I just save it. So, I
  808. 24:35just put a fake credential. Close.
  809. 24:38Gmail account. This shouldn't work. So,
  810. 24:40now, if I execute the workflow, I can
  811. 24:42also execute it here, instead of going
  812. 24:44here, I can see that now in the bottom,
  813. 24:46you can't see it because my face is
  814. 24:47there, but if I just move myself here, I
  815. 24:50can see that I have problem in node
  816. 24:52here.
  817. 24:53Right? Which allows us to see that we
  818. 24:55have a problem in our automation. And
  819. 24:57so, this node right here, again, a node
  820. 24:59is just a square within n8n, is a step
  821. 25:01in our automation. We can see that we
  822. 25:03have an issue, and it tells us the
  823. 25:04actual issue, "Unable to sign in without
  824. 25:06access token." Which means that the
  825. 25:08authorization, the actual account, was
  826. 25:10invalid. And on the right-hand side, you
  827. 25:12can also see if something went wrong,
  828. 25:14what is it that went wrong. And you can
  829. 25:16also ask AI, which is amazing, because
  830. 25:19this AI is actually good. It's not some
  831. 25:20sloppy thing that they just added into
  832. 25:22the software. It actually works, and
  833. 25:24it's really good. With that said, make
  834. 25:25sure that when you build automations,
  835. 25:26you always save right here on the top.
  836. 25:28And up here, you have the ability to
  837. 25:30edit. So, this is where we edit our
  838. 25:32workflows. Executions is where we get to
  839. 25:34see all the times that this executed,
  840. 25:37that this ran, right? The first time it
  841. 25:38ran, the second time when we had more
  842. 25:41steps, the third time when we had even
  843. 25:43more steps, right? So, we get to see
  844. 25:45exactly the previous times that it ran.
  845. 25:47And then, we have evaluations in case
  846. 25:49you're running some more advanced
  847. 25:51evaluations, you're testing your your
  848. 25:52actual workflow. If you're building this
  849. 25:54for clients, you're most likely going to
  850. 25:56use this, but it is not necessary to
  851. 25:58start. Going back to editor right here,
  852. 26:00on the top right here, I have the
  853. 26:01ability for me to duplicate the actual
  854. 26:04workflow. So, if I duplicate this, I
  855. 26:06have to rename this, and I can press
  856. 26:07duplicate. And this will now make the
  857. 26:09exact same workflow here. Then, I have
  858. 26:11the ability to download. So, if I
  859. 26:13download it now, I get a JSON file. And
  860. 26:15so, the good thing about that is that
  861. 26:16this, in the back end, is all JSON,
  862. 26:18which is is all code. And so, I can
  863. 26:20simply just press download, like I
  864. 26:21showed you, and then you can press
  865. 26:23import from file, which allows you to
  866. 26:25import the automation into your own
  867. 26:26workspace. So, if I go to a blank
  868. 26:28workflow, I can simply press this button
  869. 26:30right here. I can import from file.
  870. 26:33And now, I can put the actual file that
  871. 26:35I need.
  872. 26:36And suddenly, I have the actual
  873. 26:37automation, which is imported into your
  874. 26:39my n8n account. And then, finally, we
  875. 26:40have change the owner, so you can change
  876. 26:42the owner of the actual automation. You
  877. 26:44can rename the automation this right
  878. 26:46here. And you can import from URL. So,
  879. 26:48in case you turn the file into a URL,
  880. 26:50you can simply import it there. On the
  881. 26:52right-hand side here, like we mentioned,
  882. 26:53we have the ability for us to add steps.
  883. 26:56We have the research, so we can command
  884. 26:58bar, so you can actually search through
  885. 26:59the different nodes that we have here.
  886. 27:01We have notes, which is a big part of
  887. 27:03n8n, because we can actually start
  888. 27:04documenting our automations. So, I can
  889. 27:06go in here,
  890. 27:07and I can say, "First step is
  891. 27:10manual."
  892. 27:12And I can delete all of this, and I can
  893. 27:13put this over the automation, which is
  894. 27:15great, because when I'm going to give
  895. 27:16the automation to someone, right? I can
  896. 27:18actually give them an explanation of
  897. 27:19exactly how it's working. If I go here,
  898. 27:21I can also say, "This
  899. 27:23step allows us to be able to manually
  900. 27:28trigger the automation."
  901. 27:31Right? And so, we have the text here.
  902. 27:32And you can start to see how bigger
  903. 27:34automations and bigger workflows use
  904. 27:36this. And it's something that I use all
  905. 27:38the time when I have to give workflows
  906. 27:40and AI agents to my community members
  907. 27:42who are looking to get them and then
  908. 27:43start using them right away. And now
  909. 27:45they have an explanation of what it is.
  910. 27:46Then, we have right here focus panel, in
  911. 27:48case you're doing some note stuff here.
  912. 27:50We don't really use this that much, so
  913. 27:51don't worry. Um and finally, we have the
  914. 27:53AI, which I mentioned is able
  915. 28:02or is able to assist us whenever we have
  916. 28:04any questions about automations. Now,
  917. 28:06you probably might be asking yourself
  918. 28:07this question, right? Which is, if you
  919. 28:10can build with AI, why are we learning
  920. 28:12this at all? It's because AI only gets
  921. 28:14you so far. When something doesn't work,
  922. 28:17how do you know if it doesn't work? How
  923. 28:18do you know if it's not good enough? How
  924. 28:20do you know if it's not efficient? Which
  925. 28:21is where understanding the fundamentals
  926. 28:23is very, very important, rather than
  927. 28:25relying on AI for everything. All right.
  928. 28:26So, now that you understand exactly what
  929. 28:28automation is, how you can set up your
  930. 28:30own n8n account, how n8n actually looks
  931. 28:33visually, plus building your first
  932. 28:34automation inside of n8n, now it's time
  933. 28:37to go a level deeper. Because in the
  934. 28:39next module, we'll dive into actually
  935. 28:40understanding how automations really
  936. 28:42work. We'll dive into APIs, webhooks,
  937. 28:45and how data flows within automations.
  938. 28:47We will look at credentials. We will
  939. 28:49look at transforming data, and also
  940. 28:51understanding error handling, so if
  941. 28:52something goes wrong, what do we do
  942. 28:54about it? And lastly, understanding the
  943. 28:57core 17 nodes that you need to know when
  944. 28:59you want to master n8n. So, by the end
  945. 29:01of this section, you will not only use
  946. 29:03n8n, but you will actually understand
  947. 29:05it.
  948. 29:12If I had to learn just one skill for AI
  949. 29:14automation, it would be understanding
  950. 29:16how APIs work, because fundamentally,
  951. 29:18they are the things that allow softwares
  952. 29:20to speak with other softwares. And so,
  953. 29:22once you understand, really understand
  954. 29:23how APIs work, you'll be able to use
  955. 29:26n8n, Zapier, make.com, Power Automate,
  956. 29:28all with no problems, without getting
  957. 29:30stuck, and without any limitations. And
  958. 29:32the problem is, most people skip this.
  959. 29:34They go straight to the platforms to
  960. 29:35build automations step by step, and when
  961. 29:37something breaks, they have no clue why.
  962. 29:39So, in this video, I'm going to break
  963. 29:41down exactly how APIs actually work, how
  964. 29:43to read an API documentation without
  965. 29:46freaking out, and how to build your
  966. 29:47first real API request inside of n8n.
  967. 29:50Let's dive in. All right, so API stands
  968. 29:52for application programming interface.
  969. 29:55>> [music]
  970. 29:55>> A very fancy term that nobody even knows
  971. 29:57the meaning to. But what it means is the
  972. 30:00ability for softwares to speak with
  973. 30:02other softwares. Now, think of a waiter
  974. 30:03in a restaurant, right?
  975. 30:05This waiter has the chef, and he has the
  976. 30:07customers. And between the chef and the
  977. 30:09customers, there's a series of actions
  978. 30:10that happen, right? So, take the order,
  979. 30:12bring the order from the kitchen, they
  980. 30:13deliver the order, make the order.
  981. 30:15There's a whole repetitive loop that
  982. 30:16happens over and over again. And so,
  983. 30:18that is the exact same when it comes to
  984. 30:20APIs for softwares. Where we have one
  985. 30:23software here, one software here, and
  986. 30:25these two softwares communicate to each
  987. 30:27other through a series of requests and
  988. 30:29responses. So, request in this case
  989. 30:31would be the make the order, the
  990. 30:32response would be the actual order being
  991. 30:34delivered to their table. And that is
  992. 30:35the exact same when it comes to the
  993. 30:37softwares. And so, fundamentally, the
  994. 30:39waiter in this case is the API, and the
  995. 30:41chef is one software, and the customers
  996. 30:43are other softwares. And this right here
  997. 30:44is the thing that allows the softwares
  998. 30:46in make.com n8n to speak to each other,
  999. 30:48to be able to have a sequential order.
  1000. 30:50So, we send data to a place and get
  1001. 30:53something back, and that's how
  1002. 30:54automations and AI agents are built.
  1003. 30:56Now, what can APIs do with softwares?
  1004. 30:59There's a few things that APIs can do.
  1005. 31:01We call them requests. So, requests are
  1006. 31:03just a way for the server, the API
  1007. 31:05server, to send information to the
  1008. 31:08actual software itself to then create an
  1009. 31:10action. Now, the first thing it can do
  1010. 31:11is post.
  1011. 31:12So, this is when any type of new record
  1012. 31:14is created in a software. So, this is
  1013. 31:16like making a Google Sheet row. It's
  1014. 31:18creating a contact on ClickUp, a contact
  1015. 31:20on HubSpot. It's
  1016. 31:22you know, sending information to OpenAI
  1017. 31:24to make a LinkedIn post. This is a post
  1018. 31:26request, which is sending information
  1019. 31:27from one place to another. Then we have
  1020. 31:30get. So, get is extracting any details
  1021. 31:33from any record from the software. So,
  1022. 31:35let's say someone filled out a form on
  1023. 31:37your website, you wanted to get the
  1024. 31:39information from that form, and then use
  1025. 31:41it for whatever you want. Right now,
  1026. 31:43you're getting information because the
  1027. 31:44information is going from somewhere else
  1028. 31:46to us. That's getting information.
  1029. 31:49Then we have put or patch, which is
  1030. 31:50updating records in a software. So,
  1031. 31:52let's say John's name is not John
  1032. 31:54anymore, it's James, then you use a put
  1033. 31:56or patch request, right? So, updating
  1034. 31:58information. And then we have deleting.
  1035. 32:00So, you can't see this fully, but it's
  1036. 32:01deleting a record from a software. So,
  1037. 32:03let's say we had a Google Sheet, or
  1038. 32:05maybe a contact, we just want to delete
  1039. 32:07the row, or delete the Google Sheet, or
  1040. 32:09we just wanted to delete the contact.
  1041. 32:10That is a delete request. So again, post
  1042. 32:13is to send information, get is to get
  1043. 32:15information, then put or patch is to
  1044. 32:16update information, and then delete is
  1045. 32:18to delete information from somewhere.
  1046. 32:20Now, I'll share a story here. So, I was
  1047. 32:21on a call with a client a while back,
  1048. 32:23and she asked to automate different
  1049. 32:25parts of her onboarding process. And she
  1050. 32:27used Zoho CRM as the CRM, which by the
  1051. 32:30way is just a place for companies to
  1052. 32:32store information, to be able to send
  1053. 32:34information to Zoho to make a new
  1054. 32:36contact whenever someone filled out a
  1055. 32:37form. Now, the problem is I had never
  1056. 32:40used Zoho CRM. So, I'd never used it. I
  1057. 32:42didn't know exactly what you can and
  1058. 32:44cannot automate with Zoho CRM, which is
  1059. 32:46why we get to the next part, which is
  1060. 32:47finding the information of what you can
  1061. 32:49automate and cannot automate within a
  1062. 32:51software. So, what I did is a simple
  1063. 32:53Google search, and I searched up the
  1064. 32:55software name.
  1065. 32:56So, in this case, it can be Zoho CRM,
  1066. 32:58Monday, it can be OpenAI, it can be
  1067. 33:00whatever it is.
  1068. 33:02API documentation. And this is where we
  1069. 33:04get to the fundamental concept of an API
  1070. 33:07documentation, which allows us to be
  1071. 33:09able to see exactly what you can
  1072. 33:11automate within a software and how to
  1073. 33:13set everything up. Now, here's an
  1074. 33:15example of an API documentation. This is
  1075. 33:18Apollo's API documentation, and at
  1076. 33:20first, you think this is way too
  1077. 33:22complex, but the reality is, if you
  1078. 33:24understand how this looks, all the
  1079. 33:27others will be very, very easy because
  1080. 33:29they all follow a very similar
  1081. 33:30structure. So, the way that an API
  1082. 33:32documentation works is that on the
  1083. 33:33left-hand side, right here, you get to
  1084. 33:35see all the types of requests. So, this
  1085. 33:37is enriching people, it's searching
  1086. 33:39people, searching organizations,
  1087. 33:40creating an account. There's different
  1088. 33:42things that you can do within Apollo's
  1089. 33:43API, which means automatically without
  1090. 33:46having to go to Apollo, right? And so,
  1091. 33:48each action right here, so each thing
  1092. 33:50that we can do has a corresponding type
  1093. 33:53of request that follows through. [music]
  1094. 33:54So, people enrichment, in this case,
  1095. 33:56would be a post request because we're
  1096. 33:58sending information to the server, and
  1097. 34:00then it's enriching the person. Then we
  1098. 34:02have, let's say, organization
  1099. 34:03enrichment, which is a get request, or
  1100. 34:05update an account, which is a put
  1101. 34:06request, right? So, we have different
  1102. 34:08types of request and different actions
  1103. 34:10that we can do using Apollo
  1104. 34:12automatically within our automations.
  1105. 34:14And the only way to know is actually
  1106. 34:15just looking here. Now, let's say we go
  1107. 34:18to people enrichment. So, this will now
  1108. 34:20look at what you can do within that
  1109. 34:22specific request, which in this case is
  1110. 34:24enriching people. And this request right
  1111. 34:26here has the type of request, and then
  1112. 34:28has a URL. Now, the URL is something
  1113. 34:31that is very, very important in our API
  1114. 34:33requests because they are the thing that
  1115. 34:35allows us to be able to send the
  1116. 34:37information the right way. It's sort of
  1117. 34:39like going to google.com, right? The
  1118. 34:41server knows that you want to go to
  1119. 34:42google.com because
  1120. 34:44because of the request, because of the
  1121. 34:46URL. And so, this is the exact same
  1122. 34:48because this allows the server to know,
  1123. 34:49"Hey, he wants to use Apollo, and he
  1124. 34:51wants to enrich people." Then in the
  1125. 34:53middle here, it gives us a summary as to
  1126. 34:55what it is, how it works, and so on. So,
  1127. 34:57these down here are basically saying,
  1128. 34:58"Hey, this is the type of request." So,
  1129. 35:00right here,
  1130. 35:01this is the information you have to send
  1131. 35:03to the server to call the request, to
  1132. 35:04make it happen. In this case, it's
  1133. 35:06enriching people, and you have to send
  1134. 35:08the first name and the last name, right?
  1135. 35:10And those are the details that you have
  1136. 35:11to look into understanding exactly what
  1137. 35:14to send to the server. And on the
  1138. 35:16right-hand side, you get to see the the
  1139. 35:19actual setup. So, how can we set this up
  1140. 35:21in our automation platforms? And quick
  1141. 35:23side note, the reason why we look at the
  1142. 35:25API documentation is because here, if I
  1143. 35:27go to Apollo,
  1144. 35:29I can't find it. Which means that now we
  1145. 35:31have to set up the API request using the
  1146. 35:33documentation. And so, the left-hand
  1147. 35:35side is the type of request, the middle
  1148. 35:37is to show you the exact request and
  1149. 35:39sort of to give you a summary of what it
  1150. 35:40is and what it looks like. And the
  1151. 35:42right-hand side is saying, "Okay, we
  1152. 35:43have the request, we have the summary,
  1153. 35:45here's how you can set it up." Now, the
  1154. 35:47main thing that we have to look at when
  1155. 35:48we have to set up an API request through
  1156. 35:51an API documentation is the curl. Now,
  1157. 35:54the curl is the thing right here that
  1158. 35:55you see,
  1159. 35:56which basically gives us a heads-up or
  1160. 35:58an understanding of how the request
  1161. 36:01actually works. And if I go to n8n right
  1162. 36:03here, and I go to HTTP request, which is
  1163. 36:05the thing that we use to make the actual
  1164. 36:07request, we can see that we have a
  1165. 36:09button right here, which is import curl.
  1166. 36:12And this will be the place where we
  1167. 36:13import the curl, which is the one that
  1168. 36:15we saw on the API documentation, and
  1169. 36:17then this basically makes the whole
  1170. 36:18request for us, which I'll show you in
  1171. 36:20just a second. Now, this will make much
  1172. 36:21more sense once we actually build the
  1173. 36:23API request, which is super damn easy,
  1174. 36:25so don't worry. Uh we'll go through it
  1175. 36:27step by step. But now you get to see
  1176. 36:29what a structure of an API documentation
  1177. 36:31looks like. And this is for a software
  1178. 36:33called Apollo. Now, if I go to the
  1179. 36:34second API documentation, this right
  1180. 36:37here is for a software called Instantly,
  1181. 36:39which is a cold email software. As you
  1182. 36:41can see, it follows the exact same
  1183. 36:43structure. On the left-hand side, we get
  1184. 36:44to see all the actions that we can take.
  1185. 36:46On the middle, it tells us this is the
  1186. 36:48summary, or this is what it is, and
  1187. 36:50these are the different variables that
  1188. 36:51we have to send to the server in order
  1189. 36:53to make the action happen. And on the
  1190. 36:55right-hand side, this is the way that we
  1191. 36:57set it up through a curl, which is in
  1192. 36:59code, right? But again, we don't have to
  1193. 37:01know how to code. It's just telling us
  1194. 37:03the way that we have to set things up.
  1195. 37:05And usually, the curl in this case has a
  1196. 37:06URL, which is the action that we're
  1197. 37:08taking, telling the server, "Hey, we
  1198. 37:10want to enrich leads, we want to send
  1199. 37:12this information somewhere else." And
  1200. 37:13then we have the headers, which usually
  1201. 37:15are a way for the actual server to
  1202. 37:17authorize that this is your account. And
  1203. 37:19the way it does that is through
  1204. 37:20something called an API key, which we
  1205. 37:22use for tons of things. OpenAI API key,
  1206. 37:25we use Claude API keys, Perplexity API
  1207. 37:27keys. It's just sort of a way for the
  1208. 37:29server to know, like a password, to say,
  1209. 37:31"Hey, this is a key, it's only for me,
  1210. 37:33for my account, so you can take action
  1211. 37:35on my account, and you know it's my
  1212. 37:36account if it's this key." And then we
  1213. 37:38have content type application.json.
  1214. 37:41Sometimes it's there, sometimes it's
  1215. 37:42not. It's just a way for us to tell it
  1216. 37:44to format the information in the right
  1217. 37:45way.
  1218. 37:46And then D, which is the body, which are
  1219. 37:48these parameters, so these variables,
  1220. 37:50which we send through to the actual
  1221. 37:53server to make things happen. And if
  1222. 37:55that confused you even more, then just
  1223. 37:57wait until we build the API request cuz
  1224. 37:59it'll be very, very easy. And then the
  1225. 38:01last API documentation will be ClickUp.
  1226. 38:03As you can see, I'm just showing you the
  1227. 38:04example, so you get to see the
  1228. 38:06reoccurrence in the structure of an API
  1229. 38:08documentation, which is the one right
  1230. 38:09here. On the left-hand side, we have the
  1231. 38:11types of request. In the middle, we have
  1232. 38:13the summary, the URL, the type of
  1233. 38:15request, which is post, the title, and
  1234. 38:17then here will be the parameters that we
  1235. 38:19have to send through to the server to
  1236. 38:22say, "Hey, here's what you have to do,
  1237. 38:24here's how to do it," and so on. And on
  1238. 38:26the right-hand side, this is the way
  1239. 38:28that we set it up, which is the exact
  1240. 38:29same. And as you can see, the thing that
  1241. 38:31we really care about is the curl request
  1242. 38:33because this is the right-hand side part
  1243. 38:35of these API documentations, which allow
  1244. 38:38us to be able to know exactly how we set
  1245. 38:40things up. And if you read API
  1246. 38:41documentations a lot of the times, or
  1247. 38:43most of the times, you'll see something
  1248. 38:45that looks like these. These are three
  1249. 38:47random API documentations, and they all
  1250. 38:49follow the exact structure. So, let's
  1251. 38:51set up the API request. Let me give you
  1252. 38:54a use case. Let's say we want to get the
  1253. 38:55weather of a country or a location,
  1254. 38:58right? If you go here to weather, we can
  1255. 39:00do the OpenWeatherMap, but there's
  1256. 39:02actually this other software, which is
  1257. 39:04called the Weather API. So, if I go here
  1258. 39:06to Weather API,
  1259. 39:08there's this software right here, free
  1260. 39:09weather API,
  1261. 39:11which isn't listed here, right? And this
  1262. 39:13is when we start using the HTTP request.
  1263. 39:16Okay? So, HTTP request, again, like I
  1264. 39:18mentioned before, is all the case where
  1265. 39:22we can't find the exact software
  1266. 39:24for the specific action that we're
  1267. 39:26taking. So, we actually make our sort of
  1268. 39:28custom API call, which is saying, "Hey,
  1269. 39:31even though we might not have it in n8n,
  1270. 39:33it doesn't mean it's impossible, right?
  1271. 39:34We can still make the actual request,"
  1272. 39:36which is where the HTTP request comes
  1273. 39:38in. So, all I have to do is go here, put
  1274. 39:41HTTP,
  1275. 39:42and now we get to this page. The first
  1276. 39:44thing is the type of request, whether
  1277. 39:46it's a get, delete, head, options, path,
  1278. 39:49post, put, which we went through just
  1279. 39:50now. And we have options head, which
  1280. 39:53I've never used, so probably not
  1281. 39:54something that you should know about.
  1282. 39:56Then we have the URL, which is the
  1283. 39:58action that we're taking, which we get
  1284. 40:00from the API documentation. Then we have
  1285. 40:02the authentication, which we'll go
  1286. 40:03through in just a second. And then we
  1287. 40:05have the parameters, which I mentioned
  1288. 40:06will be here. And then also the body,
  1289. 40:08which is
  1290. 40:09this right here, right? Or you can also
  1291. 40:11use JSON, which we get from the API
  1292. 40:13documentation. Now, we'll have to set
  1293. 40:15one up so you understand. And let's go
  1294. 40:17to the free weather api.com. We get
  1295. 40:19here, and now I'm saying, "Hey, I don't
  1296. 40:20have it within any 10. So, I really have
  1297. 40:22to go to the docs." And usually you find
  1298. 40:24this here.
  1299. 40:25So, docs. All right, so this right here
  1300. 40:27is the API documentation.
  1301. 40:29And so, all we have to go is to the
  1302. 40:31request, right? So, we have the getting
  1303. 40:33started, we have the authentication, we
  1304. 40:35have the request URL, we have a bunch of
  1305. 40:37things, but the thing that we really
  1306. 40:38care about is the bulk request, which is
  1307. 40:41the request, which will be up down here,
  1308. 40:44I believe. Yeah, down here. Which will
  1309. 40:45be the request that we will use as an
  1310. 40:48example
  1311. 40:49for the actual API request that we do
  1312. 40:52within any 10. So, all we have to do is
  1313. 40:54copy this, go here, and set up an HTTP
  1314. 40:57request, import curl, just paste it
  1315. 41:00here. Now, we can see that everything
  1316. 41:02was done for us. We have the post, we
  1317. 41:03have the URL, we have the fields, the
  1318. 41:05key, the queue, which in this case would
  1319. 41:08be um
  1320. 41:10We can see here, we can see that we can
  1321. 41:12do the city name, we can do the US zip
  1322. 41:14code, UK post code, and so on. Um
  1323. 41:17which is required. And then we have the
  1324. 41:19API key, which is the one right here,
  1325. 41:21which is sort of a password that says,
  1326. 41:22"Hey, this is my account. This is um
  1327. 41:25related to me. Just use mine." And the
  1328. 41:28body in this case, we actually don't
  1329. 41:29need this because this is just an
  1330. 41:30example.
  1331. 41:32So, I can delete this. And we can just
  1332. 41:34work with this. So, type of request,
  1333. 41:35which is post, URL, which is the URL
  1334. 41:37that we use. So, what is the action that
  1335. 41:39we're taking? And then we have the key,
  1336. 41:40which is the API key, which we find on
  1337. 41:42my account. So, when you make a free
  1338. 41:44account, you can go here
  1339. 41:46to the dashboard, and up here
  1340. 41:48you will copy the API key
  1341. 41:50and paste it back here.
  1342. 41:52And then the queue will be the city
  1343. 41:54name. So, we can do London
  1344. 41:56or whatever it is.
  1345. 41:57And I press execute step, which will now
  1346. 41:59execute the step. So, as you can see
  1347. 42:01here, it successfully ran this. And I
  1348. 42:03get the weather,
  1349. 42:05so the current weather, the temperature
  1350. 42:07of that specific place,
  1351. 42:09which you can then use for whatever it
  1352. 42:10is. Right, so now you got to see exactly
  1353. 42:12what it's like to build an API request,
  1354. 42:15an API call, which we [music] call. And
  1355. 42:17this is exactly what you can then use in
  1356. 42:19between your automation steps. So, let's
  1357. 42:21say we had a next node, which would be
  1358. 42:23let's do an edit fields, and we wanted
  1359. 42:25to get the temperature.
  1360. 42:28So, temp, temperature
  1361. 42:31in Celsius, 9.3. Yeah.
  1362. 42:34Thank god I'm not in London.
  1363. 42:36I can execute the step, and this will
  1364. 42:38now call the server, bring the data
  1365. 42:40back, and then here you can see that the
  1366. 42:41temperature was 9.3 because this is a
  1367. 42:43variable that we found here. But again,
  1368. 42:46the reason why we're using HTTP is
  1369. 42:48because if I go here to free weather
  1370. 42:49API, it's not listed here. It's not
  1371. 42:51here, right? And any 10 only has about 4
  1372. 42:54to 500. It has the main softwares, but
  1373. 42:56sometimes softwares that we want here
  1374. 42:58are not here, which is exactly why we
  1375. 43:00have to then go to the API documentation
  1376. 43:03and find or understand how we can set up
  1377. 43:04the API request.
  1378. 43:09In this video, I'm going to show you how
  1379. 43:10you can master any 10 just by learning
  1380. 43:1217 nodes. And these are the exact same
  1381. 43:15ones that we use pretty much 80% of the
  1382. 43:17time when building automations for
  1383. 43:19clients. And honestly, these are
  1384. 43:20probably the only ones that you'll ever
  1385. 43:22need. So, the first one is the trigger.
  1386. 43:24Now, the trigger is essentially the
  1387. 43:25first step of the automation. Like, what
  1388. 43:27is that thing that starts the automation
  1389. 43:28for us to then do the next steps? In any
  1390. 43:3010, we have different types of triggers.
  1391. 43:32The first one is a manual trigger, so we
  1392. 43:34can just execute the workflow manually.
  1393. 43:36Now, this right here is something that
  1394. 43:37we use most of the times just for
  1395. 43:39testing. [music]
  1396. 43:40Right? Because you want to test
  1397. 43:41something, so there has to be a first
  1398. 43:43step, and that's where we add a manual
  1399. 43:45trigger. Now, the second one is a
  1400. 43:47schedule trigger. So, this trigger right
  1401. 43:48here is primarily used when you want to
  1402. 43:51run the automation, let's say once a
  1403. 43:52week, once a month, or at certain
  1404. 43:54interval of time. So, if I go in here, I
  1405. 43:56can see that I can run it
  1406. 43:58in seconds, minutes, hours, days, weeks,
  1407. 43:59months, and even custom. So, this is
  1408. 44:01cron, which you can put your maybe every
  1409. 44:032:00 p.m. on a Tuesday or every 3:00
  1410. 44:05p.m. on a Friday of every month. And you
  1411. 44:07have different settings that you can put
  1412. 44:09so that you're able to
  1413. 44:11to run the automation at a very specific
  1414. 44:13time of the month, of the year, of the
  1415. 44:14week, of the day, right? So, to give you
  1416. 44:16a use case, let's say we had a content
  1417. 44:18system. Let's say we wanted to generate
  1418. 44:20content automatically every single day.
  1419. 44:22What we would do here is we would go to
  1420. 44:23trigger interval, which is days,
  1421. 44:25one, midnight, [music] and trigger
  1422. 44:27minutes zero. And this is where we put
  1423. 44:29this as the first step of the automation
  1424. 44:31so that it runs every one day at
  1425. 44:33midnight of the week, right? So, we're
  1426. 44:34able to run the automation without us
  1427. 44:36having to manually trigger it. And this
  1428. 44:38is for the time trigger. And then we
  1429. 44:40have the Typeform trigger. Now, this is
  1430. 44:42just to show you an example of a trigger
  1431. 44:44that is not native to any 10. These two
  1432. 44:46are native to any 10, which means that
  1433. 44:48any 10 owns those nodes. But in this
  1434. 44:50case, Typeform is not any 10, it's a
  1435. 44:52different platform. And so, Typeform
  1436. 44:53itself is a platform that generates
  1437. 44:55forms. So, we can generate forms, and
  1438. 44:57this trigger right here starts whenever
  1439. 44:59someone fills out the hiring form in
  1440. 45:01this case. So, I have the form pulled
  1441. 45:02out here, which is a form that is
  1442. 45:03connected to this Typeform trigger. And
  1443. 45:05what happens is that whenever someone
  1444. 45:06fills out the form, this sends a signal
  1445. 45:09to this node because it's an on app
  1446. 45:11trigger
  1447. 45:12that will allow us to then be notified
  1448. 45:14and start the automation. So, I'm going
  1449. 45:15to press execute workflow. As you can
  1450. 45:17see now, this is waiting for you to
  1451. 45:18create an event in Typeform, which is
  1452. 45:20waiting for me to fill out the form. I'm
  1453. 45:21going to press submit. And as you can
  1454. 45:23see here, this is now triggered. And we
  1455. 45:25got the data, the name, the email, the
  1456. 45:27phone number, and location as well.
  1457. 45:29Right? So, this essentially is an on app
  1458. 45:30trigger, which means that it triggers
  1459. 45:32whenever an single app starts something
  1460. 45:34or whenever something happens within an
  1461. 45:36app that we can all find
  1462. 45:38right here. Add another trigger, we have
  1463. 45:40all these triggers, and the on app event
  1464. 45:43is the one that you can use for whatever
  1465. 45:45it is. So, these are all different
  1466. 45:46softwares that can be the first step of
  1467. 45:48the automation that triggers whenever
  1468. 45:49something happens within that software.
  1469. 45:51Now, the next part of the nodes are
  1470. 45:53going to be storage solutions. Now,
  1471. 45:54storage solutions is just a fancy way to
  1472. 45:56say
  1473. 45:57we use nodes that allow us to store
  1474. 45:59information in them, right? And so,
  1475. 46:01typically we use Google Sheets, we can
  1476. 46:03use Airtable, we can use Notion, we can
  1477. 46:05use any 10's new native data tables,
  1478. 46:07which only came out a few days ago, in
  1479. 46:08order to store information. And this
  1480. 46:10could be a simple Google Sheet that
  1481. 46:11looks like this, which has full name,
  1482. 46:12email address, location, and phone. But
  1483. 46:14it could also mean a data table within
  1484. 46:16any 10, which has name, email, phone
  1485. 46:18number, and location, which is the exact
  1486. 46:19same. The only difference is that one is
  1487. 46:22stored in any 10, and the other one is
  1488. 46:24stored in Google Sheets. So, let me show
  1489. 46:25you exactly what I mean here. Let me put
  1490. 46:27the
  1491. 46:28um manual
  1492. 46:29execution here.
  1493. 46:31And I can see that inside, I am adding a
  1494. 46:34row. So, append row means I'm adding a
  1495. 46:35row in the any 10 17 nodes, which is the
  1496. 46:38name of the Google Sheet right here.
  1497. 46:40And I'm putting the first name or the
  1498. 46:42full name as Michele Torti, the email as
  1499. 46:44this, and the location as this. I can
  1500. 46:45press execute workflow, which will now
  1501. 46:47run the step right here.
  1502. 46:49And it will add the row
  1503. 46:51into the Google Sheet, which will be
  1504. 46:52Michele, email, and location as well.
  1505. 46:55And I can also add the phone, which you
  1506. 46:57can also add by refreshing.
  1507. 47:00Let me add let's do 1 555 123 4567.
  1508. 47:05And if I execute the step again,
  1509. 47:07I can now see that I will have a new row
  1510. 47:09that will be added here with email,
  1511. 47:11location, and this as well. Now, the
  1512. 47:12reason why it gave us an error is
  1513. 47:14because Google Sheet doesn't like when
  1514. 47:15you put plus signs or equal signs and so
  1515. 47:17on because these are native equations
  1516. 47:20within Google Sheets.
  1517. 47:22But you get the gist here. You just
  1518. 47:23store information into Google Sheet. The
  1519. 47:25second one is within the any 10 data
  1520. 47:26tables. So, let me connect this. And in
  1521. 47:29this case, we do the exact same thing.
  1522. 47:31It will be new people because that is
  1523. 47:33the name of the database.
  1524. 47:34And we're adding the first name or the
  1525. 47:36name as Michele Torti, my email, my
  1526. 47:38phone number, and location as well.
  1527. 47:40And if I press execute step,
  1528. 47:42I can see that now it was successful.
  1529. 47:44And if I go here and I refresh, I can
  1530. 47:47now see that the data was added here.
  1531. 47:49Full name, email, phone number, and
  1532. 47:51location as well. Now, the amazing thing
  1533. 47:53is that once you master Google Sheets
  1534. 47:55and any 10's native data tables, you can
  1535. 47:57pretty much use Airtable, you can use
  1536. 47:58Notion, you can use Asana, ClickUp. All
  1537. 48:01these places where you store
  1538. 48:02information, they're all very, very
  1539. 48:04similar, right? So, if you understand
  1540. 48:05one, the setup will be very, very
  1541. 48:07similar for the other ones. All right,
  1542. 48:08so now we get to the universal data
  1543. 48:10processing. So, here is where we
  1544. 48:12manipulate data, right? Manipulate data
  1545. 48:14just means that we take some sort of
  1546. 48:15data that comes in, and then we
  1547. 48:17structure it in a way where it makes
  1548. 48:18sense for us to structure it in. Now, in
  1549. 48:20this case, I want to take the um manual
  1550. 48:23execution here.
  1551. 48:24I want to attach it here.
  1552. 48:27And I can see that inside the edit node,
  1553. 48:29if I execute the step, I can see that I
  1554. 48:31have an array, which is basically a list
  1555. 48:33of people's information. So, we have
  1556. 48:35name, email, phone number, and location.
  1557. 48:37David Smith, David Smith, Emily Chen,
  1558. 48:39Carlos Ramirez, and Aisha Khan. And
  1559. 48:41these are basically giving me the
  1560. 48:43different pieces of information. Now,
  1561. 48:44the only problem with this
  1562. 48:46is that let's say we want to add this to
  1563. 48:48our Google Sheet,
  1564. 48:49we can't because this is an array, which
  1565. 48:51means that it's inside
  1566. 48:53this right here.
  1567. 48:54So, this is where the split out comes
  1568. 48:56in.
  1569. 48:58So, what this means is that if you want
  1570. 48:59to process each name individually,
  1571. 49:01right? If you want to process this right
  1572. 49:03here individually, then this right here,
  1573. 49:05then this right here, and this right
  1574. 49:06here, and this right here as well,
  1575. 49:08then we have to split them out. We have
  1576. 49:09to take them, as you can see by the
  1577. 49:11diagram here, it's taking them, which is
  1578. 49:12a singular thing, and then it's
  1579. 49:14splitting them out based on the amount
  1580. 49:16of items that are in that array. So, let
  1581. 49:19me just show you. Let me just run this
  1582. 49:20right here.
  1583. 49:21And let me show you that now we have
  1584. 49:23five items.
  1585. 49:24So, as you can see here, it went from
  1586. 49:26one item, which is the array, to five
  1587. 49:27items. And so, what we're doing here is
  1588. 49:29we're processing each person's details
  1589. 49:31individually through the automation in
  1590. 49:33the next steps. And this is splitting
  1591. 49:35out. So, this is when you have an array
  1592. 49:37and you want to split out each item of
  1593. 49:39that array. Now, aggregate right here is
  1594. 49:41the exact opposite. As you can see, the
  1595. 49:43diagrams are opposites. And so, what we
  1596. 49:45do here is just bring it back to the way
  1597. 49:47it was before.
  1598. 49:48Right? If I press execute step, I can
  1599. 49:50see that now I have the array that is
  1600. 49:52back there, which is one item.
  1601. 49:54So, you can see we have one item, five
  1602. 49:56items, and one item as well. Now,
  1603. 49:57typically, you would use split out
  1604. 49:59whenever you have cuz a lot of the times
  1605. 50:00we get data
  1606. 50:02all within the same array.
  1607. 50:04We get a bunch of details, contacts, and
  1608. 50:05so on, all within one singular item. And
  1609. 50:08so, what we want to do is go inside that
  1610. 50:10item and take them out of each one and
  1611. 50:12process them individually. In case you
  1612. 50:14want to add them individually to, let's
  1613. 50:16say, a native data table or even a
  1614. 50:18Google Sheet. Right? You have to process
  1615. 50:20each one individually for it to actually
  1616. 50:21make sense to add them to a database or
  1617. 50:24whatever it is that you want to do.
  1618. 50:25Whilst this node right here, basically
  1619. 50:26when we have a lot of information that
  1620. 50:28is a lot of items, and we want to put
  1621. 50:30them all together, smash them all
  1622. 50:31together, to then send them through to
  1623. 50:33the next steps. Right? So, it's
  1624. 50:34aggregating data, so it's not
  1625. 50:36everywhere. It's not in different
  1626. 50:37places. It's all within one place. Then,
  1627. 50:39we get on to the logic, which is if. So,
  1628. 50:42this is saying, "If this equals to this,
  1629. 50:44then it's true. If not, it's false." So,
  1630. 50:47if I say, in this case, let me just uh
  1631. 50:50take this out. Uh there we go, right
  1632. 50:52here. So, let me say, "If the name
  1633. 50:55contains um contains
  1634. 50:58Sarah,
  1635. 51:00which it only be one name, then we send
  1636. 51:02it through the true route." Right? So,
  1637. 51:04if I go here, I can now see that only
  1638. 51:06one went through here, and the other
  1639. 51:08ones went through here. Now, this is
  1640. 51:09great because automation, again, is
  1641. 51:11logic. So, if you want to send the
  1642. 51:13automation in different ways based on
  1643. 51:15whether something is true or false, then
  1644. 51:17you can use the if node right here. Now,
  1645. 51:19the switch node is a bit different
  1646. 51:21because it gives you more flexibility.
  1647. 51:22Right? Let me show you exactly what I
  1648. 51:24mean.
  1649. 51:25Let me say right here, inside, I have
  1650. 51:28options to basically root the
  1651. 51:30automation. So, I can say,
  1652. 51:32"If the name
  1653. 51:34equals to Sarah
  1654. 51:36Johnson,
  1655. 51:37if the name equals David Smith,
  1656. 51:39then we can rename the output to Sarah,
  1657. 51:41rename the output to David."
  1658. 51:43And what this will do is that it will
  1659. 51:45run through every single one.
  1660. 51:47And the ones that are Sarah,
  1661. 51:49or Sarah Smith in this case, Sarah
  1662. 51:50Smith, Sarah Johnson, it will send them
  1663. 51:52through Sarah.
  1664. 51:54And if it's David
  1665. 51:55Smith, then it will send it through
  1666. 51:56David. So, if I run this, I can see that
  1667. 51:59we only have one item and one item here
  1668. 52:01because those are the only ones that
  1669. 52:02applied to the logic. And so, how is
  1670. 52:04this different from if? Well, if only
  1671. 52:06gives you the opportunity to add
  1672. 52:08conditions, but don't add more than true
  1673. 52:11or false options. Whilst here, you can
  1674. 52:13put as many options as you want. And
  1675. 52:15this is great because you could have a
  1676. 52:17use case where you have emails. You can
  1677. 52:19categorize the emails based on whether
  1678. 52:20they're FAQ, whether they are uh
  1679. 52:23promotional, whether they are just
  1680. 52:24normal, whether they are something else.
  1681. 52:26And an AI categorizes it, and then you
  1682. 52:28can use a switch node to then say, "If
  1683. 52:30the email is FAQ, then you send it this
  1684. 52:33way. If it's something else, you send it
  1685. 52:35this way. If it's something else as
  1686. 52:36well." Because you can keep adding root
  1687. 52:38rules. You can say,
  1688. 52:40"If the this equals to whatever, just
  1689. 52:42hello."
  1690. 52:44You can rename it to FAQ.
  1691. 52:46And this will be another option, right?
  1692. 52:47And you can do as many options as you
  1693. 52:49want, which is amazing because that
  1694. 52:50allows us to be able to root the
  1695. 52:52automation based on [music] the type of
  1696. 52:54input or the output that we get in the
  1697. 52:56previous step. All right, then we have
  1698. 52:57the code node. Now, the code node is
  1699. 52:59amazing uh because it allows us to
  1700. 53:02be able to do a lot of things at once.
  1701. 53:04And code is one of the things that,
  1702. 53:06again, a lot of no-code platforms don't
  1703. 53:07have because in the name no code. Uh but
  1704. 53:10the fact that n8n added the code option
  1705. 53:11here made it so much easier for us to be
  1706. 53:13able to to transform information from
  1707. 53:16unstructured to structured in the
  1708. 53:17easiest way possible. And it's very,
  1709. 53:19very fast. Yeah, so let's say we have
  1710. 53:20the array here, which is the exact same
  1711. 53:22as we had before, which are just a bunch
  1712. 53:24of names that are all uh within the same
  1713. 53:27array, and we can't process each one
  1714. 53:28individually now. What we can do with
  1715. 53:30the code node using code, and by the
  1716. 53:32way, if you're asking, "How did you
  1717. 53:33write the code?" I just said, "Split out
  1718. 53:35the items from the array." And the array
  1719. 53:37is this. And then, if I run this, I can
  1720. 53:39see that now,
  1721. 53:41really quick, it uh split out the items
  1722. 53:43in five different um separately. So,
  1723. 53:45then we can go through five items
  1724. 53:46individually. Now, this did the same
  1725. 53:48function as this, so this wouldn't make
  1726. 53:50a lot of sense. But, if you have
  1727. 53:51something a lot more complex, and you
  1728. 53:53need the data to be transformed in a way
  1729. 53:55where it would take you seven or eight
  1730. 53:58different nodes, then you can do it all
  1731. 53:59within the code node. Now, I'm not going
  1732. 54:01to get into detail about this because,
  1733. 54:02again, we're all here to not write code,
  1734. 54:04right? Uh but just know that you have
  1735. 54:06this option to be able to write code
  1736. 54:07with n8n, and it makes it a lot easier
  1737. 54:10to do more complex stuff. You won't
  1738. 54:11really need them for most of the time,
  1739. 54:13but just knowing that you have the
  1740. 54:14option there to use gives us a lot more
  1741. 54:16flexibility when we're building
  1742. 54:18automations. And then, we have the merge
  1743. 54:19node. So, let me actually set this up.
  1744. 54:21All right, so for the merge node, what I
  1745. 54:23did is I put two different fields. One
  1746. 54:25is hello, yo, and then the other one is
  1747. 54:26hello, ciao.
  1748. 54:28And when I run this automation, it will
  1749. 54:30run this one first, and then it will run
  1750. 54:32this one. And let's say I put a wait
  1751. 54:34node here.
  1752. 54:35I can put two 2 seconds just for it to
  1753. 54:37wait 2 seconds. I can show you that
  1754. 54:39this right here will run first, and then
  1755. 54:42it will run this one. Right? Now, let's
  1756. 54:44say that we had an automation where we
  1757. 54:45had to run this, and then we wanted to
  1758. 54:48run this, and then we wanted to go,
  1759. 54:50right? Without us having to go through
  1760. 54:51here first and run your whole
  1761. 54:53automation, and then run through here
  1762. 54:54first. Now, let's say that we had an
  1763. 54:56automation that we start here, and it
  1764. 54:58goes to different ways, but then we want
  1765. 55:00to aggregate the data. We want to send
  1766. 55:02the data up in the same way as two
  1767. 55:04different inputs, input one and input
  1768. 55:05two, to then be able to take both pieces
  1769. 55:07of information to then be able to go to
  1770. 55:10the next steps. So, that's exactly what
  1771. 55:12the merge node does. If I go here,
  1772. 55:14I can see
  1773. 55:15also I can add more inputs. So, if I
  1774. 55:17press four, it basically uh it can it
  1775. 55:19can intake more inputs at the same time.
  1776. 55:21In this case, I can do two. I can
  1777. 55:23execute the step, and now we can see
  1778. 55:26that we got two items. One is yo, and
  1779. 55:28one is ciao. So, what is doing here?
  1780. 55:30It's it's aggregating both of them
  1781. 55:32together. Now, there are other options
  1782. 55:33as well um to combine, to then SQL
  1783. 55:37query, so you can query different things
  1784. 55:39or different data points. And then, we
  1785. 55:40can also choose a branch. Now, honestly,
  1786. 55:42the one that we're mostly going to use
  1787. 55:44is going to be combine, and it's going
  1788. 55:45to be append. Now, append in this case
  1789. 55:47would be output each item individually,
  1790. 55:50and combine is taking these two and just
  1791. 55:52putting them all in the same sort of
  1792. 55:53array that you can use for the next
  1793. 55:54steps. Now, here's a system that I built
  1794. 55:56that uses the merge nodes, three
  1795. 55:58different ones. Uh and the way that with
  1796. 56:00this works is that we have um
  1797. 56:02the LinkedIn post, which is made, the
  1798. 56:04Facebook post is made, and then we want
  1799. 56:06to merge them. So, we have the Facebook
  1800. 56:08post and the LinkedIn post. And then, we
  1801. 56:09have the Twitter post, which is made,
  1802. 56:11the article, which is made, and then
  1803. 56:12we're merging these two together as well
  1804. 56:14to then finally merge all four things
  1805. 56:16together so we can directly send to the
  1806. 56:19Google Sheet. And the reason why we're
  1807. 56:20merging them is because if we run each
  1808. 56:22one individually, then we would have to
  1809. 56:24set up a new automation for each row at
  1810. 56:26a single time to add them to the Google
  1811. 56:28Sheet, which we can actually just remove
  1812. 56:30by just merging them all together in the
  1813. 56:32same sort of structured way, different
  1814. 56:34items, to then send them to the Google
  1815. 56:35Sheet. So, the next nodes right here are
  1816. 56:37going to be connectivity and API. Now,
  1817. 56:39API is the most important skill when it
  1818. 56:41comes to automation. And if you haven't
  1819. 56:42watched my video about fundamentals of
  1820. 56:44API, just watch it up here. Um but it is
  1821. 56:46the reason why apps get to talk to other
  1822. 56:48apps. Right? It's the reason why
  1823. 56:50this app right here
  1824. 56:52can talk to n8n.
  1825. 56:53But this app right here can talk to this
  1826. 56:55one, right? Or we can just talk to each
  1827. 56:56other um in different ways. So, in this
  1828. 56:58case, the first node that we have to
  1829. 57:00learn is the HTTP request. Now, this is
  1830. 57:02one of the most powerful nodes in n8n
  1831. 57:05because when we go here,
  1832. 57:07and I go to action app, so this is
  1833. 57:09taking an action within a single app, we
  1834. 57:11can see that we don't have an infinite
  1835. 57:12amount of nodes. Right? Like we can stop
  1836. 57:14here, and then what? What if you have a
  1837. 57:16software that we want to use, but we
  1838. 57:18can't find it here? What do we do then?
  1839. 57:20Well, in this case, we use the HTTP
  1840. 57:22request. So, let's say I wanted to use a
  1841. 57:24free weather API, which gave me the API
  1842. 57:26of the weather.
  1843. 57:27And if I go here to n8n,
  1844. 57:29I can't see any app that's called free
  1845. 57:31weather API.
  1846. 57:32So, what I have to do is I have to set
  1847. 57:34up the HTTP request all to the free
  1848. 57:37weather API, which I can find in the
  1849. 57:39documentation right here. By the way, I
  1850. 57:40covered this in the API fundamentals
  1851. 57:42video. So, if this makes no sense to
  1852. 57:43you, please go watch that video cuz it
  1853. 57:45will help a lot. Um but this right here
  1854. 57:47is the API documentation, which is
  1855. 57:49essentially a documentation which allows
  1856. 57:50you to see exactly what you can automate
  1857. 57:52and what you cannot automate within a
  1858. 57:53software, and also how to set up the
  1859. 57:55automation. And so, by looking at this
  1860. 57:57documentation here, I was able to set up
  1861. 57:59the um the automation of the weather
  1862. 58:01API, which looks at the temperature in
  1863. 58:03London right now. And if I execute the
  1864. 58:05step, I can see that now I'm still able
  1865. 58:07to actually run the automation. I was
  1866. 58:09still able to use the software without
  1867. 58:11having to use
  1868. 58:13the softwares here, which are already
  1869. 58:15pre-made by n8n. And you can see here we
  1870. 58:17have the different outputs. So, London,
  1871. 58:19[music] we have the temperature degrees
  1872. 58:20in Celsius, Fahrenheit, and different
  1873. 58:22other informations as well. Then, we
  1874. 58:24have webhooks right here. Now, webhooks
  1875. 58:25are a way for us to get notified when
  1876. 58:27something happens. So, let's say someone
  1877. 58:29fills out a form,
  1878. 58:30well, it sends the data to the webhook.
  1879. 58:32You remember this right here, the
  1880. 58:33Typeform trigger? Well, behind the
  1881. 58:35Typeform trigger is actually a webhook,
  1882. 58:37which allows us to be able to get
  1883. 58:38notified when something happens. Well,
  1884. 58:40in that case, it's whenever the form is
  1885. 58:42being submitted, it sends the data to
  1886. 58:44the webhook through an API. Right? So,
  1887. 58:47right here we have the test URL, which
  1888. 58:48is used for testing, and production URL,
  1889. 58:50which is used when the automation is set
  1890. 58:51to active. And then, we have the
  1891. 58:53different type of HTTP method, which,
  1892. 58:55again, is very similar to here because
  1893. 58:56we have post, we have all these options,
  1894. 58:58and these are the same ones that we have
  1895. 59:00here. And then, we have the path, which
  1896. 59:02is just the way that we that we name the
  1897. 59:03URL. And then, this right here is the
  1898. 59:05thing that you would connect to the
  1899. 59:07software itself to then be able to for
  1900. 59:08us to get notified when something
  1901. 59:10happens within a software. And respond
  1902. 59:11to webhook will be the thing that will
  1903. 59:13then respond back to the server that we
  1904. 59:15got the information from. Now, to show
  1905. 59:17you exactly how it works, what I'm going
  1906. 59:18to do is use a software called Postman
  1907. 59:21API, which allows us to send example uh
  1908. 59:24test data to the webhook, right? I'm
  1909. 59:26going to go in here, copy this. Make
  1910. 59:28sure you change this to post request,
  1911. 59:29and then I'm going to paste this here.
  1912. 59:31Make sure this is a post request as
  1913. 59:33well. And then the body will be what is
  1914. 59:34the thing that we're sending the
  1915. 59:35webhook. In this case, let's just do
  1916. 59:37full name.
  1917. 59:39My name.
  1918. 59:40Let me run this here.
  1919. 59:42I'm going to press send.
  1920. 59:44This will now start the workflow, as you
  1921. 59:45can see here. Now we started the
  1922. 59:47workflow and we sent the full name here,
  1923. 59:49which is the body, right? And this is
  1924. 59:51how we send information from one server
  1925. 59:53to another through a webhook. [music]
  1926. 59:55Now let's say I had this connected. Now
  1927. 59:57all I have to do here is I have to
  1928. 59:58change this to using respond webhook
  1929. 1:00:00node.
  1930. 1:00:02And here,
  1931. 1:00:03um, what we can do is
  1932. 1:00:06we can just respond with
  1933. 1:00:08workflow has finished.
  1934. 1:00:13And so when I run this
  1935. 1:00:15I send this here.
  1936. 1:00:17I can see that now we get the data,
  1937. 1:00:18workflow has finished.
  1938. 1:00:20Now this is amazing when we are sending
  1939. 1:00:22data to a software
  1940. 1:00:24or to a webhook in this case and we want
  1941. 1:00:25to get something back.
  1942. 1:00:27So let's say we send the sign-up link to
  1943. 1:00:29a user in some sort of software. He
  1944. 1:00:31signs up, we get something back. Lastly,
  1945. 1:00:34it would be the AI integration. So this
  1946. 1:00:35is one of the ones that are most
  1947. 1:00:37commonly used. First one is the AI node.
  1948. 1:00:40So this is just to create something with
  1949. 1:00:42AI. So in this case, we can say create a
  1950. 1:00:45LinkedIn post
  1951. 1:00:47about
  1952. 1:00:48life. And here we have our OpenAI
  1953. 1:00:50connected. The resource is text. The
  1954. 1:00:52operation, which is the action that
  1955. 1:00:53we're taking, is good. The model, it can
  1956. 1:00:55be You have a list of models here.
  1957. 1:00:57You can use GPT-4 or latest, or you can
  1958. 1:00:59use whatever you want. And then you have
  1959. 1:01:01the prompts right here. The prompts,
  1960. 1:01:02there are three different prompts that
  1961. 1:01:03you can write. The first one is the
  1962. 1:01:05system prompt. The system prompt is a
  1963. 1:01:06prompt that you tell the AI you give it
  1964. 1:01:09an identity. So here you are a helpful,
  1965. 1:01:10intelligent XYZ assistant. Then you have
  1966. 1:01:13user. So user is when you tell it to do
  1967. 1:01:16something. So your task is to do XYZ. An
  1968. 1:01:18assistant [music] is when you give it
  1969. 1:01:20some examples. In this case, let's keep
  1970. 1:01:21it simple. I'm going to press execute
  1971. 1:01:23step. And this will now create a
  1972. 1:01:25LinkedIn post about life. As you can
  1973. 1:01:27see, sure, here's a thoughtful and
  1974. 1:01:29professional LinkedIn post about our
  1975. 1:01:30life. And then it gives me a whole
  1976. 1:01:31LinkedIn post that we can then use. Now
  1977. 1:01:33this AI step is used whenever you want
  1978. 1:01:35to have some sort of data or some sort
  1979. 1:01:37of input sent to AI, just like we would
  1980. 1:01:40on ChatGPT, automatically and then give
  1981. 1:01:42us the output. For content, for any
  1982. 1:01:44structured data that you want
  1983. 1:01:45structured, for anything pretty much
  1984. 1:01:47that you can think of AI playing a role
  1985. 1:01:49in the automation, just as a linear
  1986. 1:01:51thing, for it to do just that task in
  1987. 1:01:52specific, only that task. And then we
  1988. 1:01:54have the AI agent. If you haven't
  1989. 1:01:56watched my AI agent 101 video, make sure
  1990. 1:01:58to watch it up here. It explained
  1991. 1:02:00exactly how you can build your first AI
  1992. 1:02:01agent from scratch using n8n. But the AI
  1993. 1:02:03agent is the reason, probably the reason
  1994. 1:02:05why n8n blew up so fast is because it
  1995. 1:02:08had now the opportunity for us to use
  1996. 1:02:11something that was connected to AI that
  1997. 1:02:13could think through or that could
  1998. 1:02:14remember the different conversation we
  1999. 1:02:16had but that was also hooked up to
  2000. 1:02:19different tools. So in this case, if you
  2001. 1:02:20scroll down we can see that we hook it
  2002. 1:02:22up to Gmail. We can hook it up to
  2003. 1:02:24Airtable. We can hook it up to or pretty
  2004. 1:02:27much anything.
  2005. 1:02:28We have all these different softwares
  2006. 1:02:31that we can use to then be able to
  2007. 1:02:32connect it to the AI agent for it to
  2008. 1:02:34actually take action. And the good thing
  2009. 1:02:36is that the Gmail tool
  2010. 1:02:38can be connected and the Airtable tool
  2011. 1:02:40can be connected and the let's say
  2012. 1:02:43Notion tool can be connected
  2013. 1:02:45and you can have as many connections as
  2014. 1:02:46you want and this acts as a personal
  2015. 1:02:48assistant that allow us to be able to
  2016. 1:02:51take action on different things based on
  2017. 1:02:53the input that we give it. So in this
  2018. 1:02:55case, what it would look like is we
  2019. 1:02:57would have a trigger, which would be
  2020. 1:03:00usually it would be an on chat message,
  2021. 1:03:02which means that we're chatting with the
  2022. 1:03:03AI agent itself. If I open chat, I can
  2023. 1:03:05now see that I can speak to the actual
  2024. 1:03:06AI agent, something that you can't do
  2025. 1:03:08with the AI step. So I can say, "Hello."
  2026. 1:03:11What this will do is that it will then
  2027. 1:03:12talk to its AI. It will remember the
  2028. 1:03:14conversation and then bring it back.
  2029. 1:03:16It's sort of like a person that we're
  2030. 1:03:17talking to. And the good thing is that
  2031. 1:03:19the person itself
  2032. 1:03:20has access to our softwares.
  2033. 1:03:23Which is amazing because now we can take
  2034. 1:03:24action on our behalf based on the input
  2035. 1:03:27that we give it. So if we say draft an
  2036. 1:03:28email, it will then go to the Gmail tool
  2037. 1:03:30and then do its thing. Same thing with
  2038. 1:03:32Airtable and same thing with Notion. And
  2039. 1:03:33the use case that you can think of this
  2040. 1:03:35is pretty much anything, any task that
  2041. 1:03:37you want a singular input data store. So
  2042. 1:03:40you basically have, let's say, one chat
  2043. 1:03:42message, right? We have one place and
  2044. 1:03:44through a series of inputs, so through a
  2045. 1:03:46series of sending Gmail, sending
  2046. 1:03:48Airtable or create a Notion task or
  2047. 1:03:50whatever it is it takes actions in
  2048. 1:03:51different softwares without us having to
  2049. 1:03:54create a new automation for every single
  2050. 1:03:56action that we want to take.
  2051. 1:04:00In this video, I'm going to walk you
  2052. 1:04:01through everything that you need to know
  2053. 1:04:03about data transformation and using JSON
  2054. 1:04:06within your automations. Now I know this
  2055. 1:04:08topic scares quite a few people and it
  2056. 1:04:10scared me coming into automation as a
  2057. 1:04:12beginner with no technical knowledge,
  2058. 1:04:13but it actually is quite easy and very,
  2059. 1:04:16very important to understand. All right,
  2060. 1:04:17so JSON 101. JSON stands for JavaScript
  2061. 1:04:21Object Notation. So if you see
  2062. 1:04:22JavaScript here and there, it stands for
  2063. 1:04:24JSON cuz it's JavaScript, so J S O N
  2064. 1:04:27right here.
  2065. 1:04:28What it is, it's a way for servers to
  2066. 1:04:32store and transfer data. Right, it looks
  2067. 1:04:34like text, but it's structured so
  2068. 1:04:36computers can read it. Now the best way
  2069. 1:04:37that I can describe JSON is English for
  2070. 1:04:40computers. It's the language that
  2071. 1:04:41computers use to speak to each other.
  2072. 1:04:43Right? And that's why it's very, very
  2073. 1:04:45important for us to understand it
  2074. 1:04:46because pretty much everything is built
  2075. 1:04:49in JSON. Right? APIs, which I spoke
  2076. 1:04:51about in another video up here. Config
  2077. 1:04:53files, databases, but also your favorite
  2078. 1:04:55platforms like make.com, n8n or Zapier,
  2079. 1:04:58they're all built on JSON. It's crazy to
  2080. 1:05:01me that people still don't understand
  2081. 1:05:02that cuz behind the nodes, the squares
  2082. 1:05:04and the [music] the steps if you really
  2083. 1:05:06look at it, it's all JSON. That's why
  2084. 1:05:08it's very, very important to understand.
  2085. 1:05:09Now we use a very basic structure in
  2086. 1:05:12JavaScript. [music] When we write JSON,
  2087. 1:05:13we use key-value pairs. So the keys are
  2088. 1:05:16strings. They're always going to be in
  2089. 1:05:17quotes. And the values can be string,
  2090. 1:05:19can be my name, number, can be an age,
  2091. 1:05:22boolean, which is true or false, null,
  2092. 1:05:24when you get no data, it's going to be
  2093. 1:05:25zero, zero data, object, which is
  2094. 1:05:27basically a JSON inside the JSON, an
  2095. 1:05:30array, which is a list of items, which
  2096. 1:05:32I'll walk you through step by step. So
  2097. 1:05:33these are all the different types of
  2098. 1:05:35values that you can get using the key.
  2099. 1:05:38Here's an example of a basic key-value
  2100. 1:05:40pair. We have the key, which is name. We
  2101. 1:05:42have the value, which is Michele in
  2102. 1:05:44quotes because it's a text string.
  2103. 1:05:46The age, which is key, which again is in
  2104. 1:05:48quotes because it's always a string. The
  2105. 1:05:51age, which is not in quotation marks
  2106. 1:05:52because it's an age, so it's a number.
  2107. 1:05:54Then student and then true. Which is
  2108. 1:05:56boolean, which is true or false, right?
  2109. 1:05:58So we have again name, key, key and key,
  2110. 1:06:01and these are values, but they're
  2111. 1:06:01different types of values. Now arrays
  2112. 1:06:03are ordered in list inside of the
  2113. 1:06:07brackets. Now let's say you go to the
  2114. 1:06:08grocery store and you get the groceries.
  2115. 1:06:11Right? The groceries isn't one thing.
  2116. 1:06:12Groceries is a list of items inside the
  2117. 1:06:15key, which is groceries. And so this is
  2118. 1:06:17the same exact example when we have
  2119. 1:06:19skills. So the key is skills and the
  2120. 1:06:22value is automation, AI, Notion, which
  2121. 1:06:24are my skills. And so why do we use
  2122. 1:06:26these? Well, we use this when we have
  2123. 1:06:27the same key, like groceries or skills,
  2124. 1:06:29but we want to add multiple items in the
  2125. 1:06:32array, right? The array is just the the
  2126. 1:06:34list of things,
  2127. 1:06:35um, to to explain the key, right? To
  2128. 1:06:37explain skills, to explain groceries, to
  2129. 1:06:39explain whatever it is.
  2130. 1:06:40We have nested objects, which are JSON
  2131. 1:06:43inside the JSON. And for example, we
  2132. 1:06:44have the key, which is person. The key
  2133. 1:06:47is also name, but the name is inside the
  2134. 1:06:48person, so it's JSON in JSON. Um, and
  2135. 1:06:51then we have contacts, which is email
  2136. 1:06:53and phone number. So we have different
  2137. 1:06:55pieces of information, but it follows a
  2138. 1:06:57very clear hierarchy. Hierarchy just
  2139. 1:06:58means what is the first thing that you
  2140. 1:07:00should see and then what is the next
  2141. 1:07:01thing and what is the next thing. Of
  2142. 1:07:02course, the first thing is person. The
  2143. 1:07:04next thing [music] is name. And we have
  2144. 1:07:05contacts within the name and we have
  2145. 1:07:07email and phone number. And then we
  2146. 1:07:08close off with three curly brackets
  2147. 1:07:10because we start with one, two and
  2148. 1:07:11three.
  2149. 1:07:12Right? So nested objects is usually the
  2150. 1:07:14thing that we always [music] use and
  2151. 1:07:16that n8n, make.com usually uses when
  2152. 1:07:19they want to show different types of
  2153. 1:07:20data inside the data. Right? So you
  2154. 1:07:22might have a Google Sheet and the Google
  2155. 1:07:24Sheet might show the ID of the sheet. It
  2156. 1:07:26might show the sheet name. It might show
  2157. 1:07:28the row values. It might show different
  2158. 1:07:30types of things. And so to show those
  2159. 1:07:32things, it uses the
  2160. 1:07:34nested objects. And so JSON applying
  2161. 1:07:37into APIs, and if you've never heard
  2162. 1:07:39APIs, it's just basically how a software
  2163. 1:07:41speaks to a software, how these
  2164. 1:07:42softwares are actually able to work
  2165. 1:07:44through APIs.
  2166. 1:07:45This is a HTTP request, which is a
  2167. 1:07:48request that we send to a server to do
  2168. 1:07:50something. So in this case, we have a
  2169. 1:07:51curl and a curl is just a bunch of JSON.
  2170. 1:07:53Now don't worry about what this means,
  2171. 1:07:55but this is a request. This is something
  2172. 1:07:57that we send to the server saying, "Hey,
  2173. 1:07:58can we get something? Can we Can we do
  2174. 1:08:00something?" Right? In case you want to
  2175. 1:08:01get new rows or you want to add a row to
  2176. 1:08:03a Google Sheet or you want to add a
  2177. 1:08:04contact on ClickUp or do something else,
  2178. 1:08:07this is what you use. And then the
  2179. 1:08:09response, which is always going to be in
  2180. 1:08:10JSON, looks like this. So let's say
  2181. 1:08:13we're looking for users in a software,
  2182. 1:08:15let's say. And the output that I get is
  2183. 1:08:17the ID of the user, the name of the
  2184. 1:08:18user, the email, whether the user is
  2185. 1:08:20active or not and [music] the roles of
  2186. 1:08:22the user, which is an array because
  2187. 1:08:24there can be different roles within the
  2188. 1:08:26same person. And so we have the keys,
  2189. 1:08:27which are all inside the quotation marks
  2190. 1:08:29because they're all strings.
  2191. 1:08:30>> [music]
  2192. 1:08:30>> And we have the values. But the values
  2193. 1:08:32can change based on whether it's a
  2194. 1:08:33number, a string like this
  2195. 1:08:36a boolean or just an array. So how does
  2196. 1:08:39this now apply to n8n? So if I go to
  2197. 1:08:41edit first step, I can add a manual
  2198. 1:08:43trigger, which is just a first step of
  2199. 1:08:45the automation manually. And let me add
  2200. 1:08:47another node, which is edit fields.
  2201. 1:08:50Now this node right here is very, very
  2202. 1:08:52important and is something that we
  2203. 1:08:53typically use to transform data, which
  2204. 1:08:56is getting an input, which can be a
  2205. 1:08:57name, it can be a bunch of values, then
  2206. 1:08:59putting it here right inside the edit
  2207. 1:09:02fields node, which transforms the input
  2208. 1:09:04and then gives us the output. So if I go
  2209. 1:09:05here to mode, I can see that I can do
  2210. 1:09:06manual mapping. Let me zoom in. Or I can
  2211. 1:09:09actually write things in JSON. And this,
  2212. 1:09:12again, is the key value pair, key value,
  2213. 1:09:15which is the exact same as the thing we
  2214. 1:09:17spoke about. Now if I go to manual
  2215. 1:09:18mapping, I can now start adding fields
  2216. 1:09:20to set. So I can say my full name
  2217. 1:09:23is Michele
  2218. 1:09:24Sorti.
  2219. 1:09:25Right? And I can see that this is a
  2220. 1:09:26string. Why is it a string? It's because
  2221. 1:09:28it's text. If I put number and I run
  2222. 1:09:31this,
  2223. 1:09:32this would be null because there is no
  2224. 1:09:33number. It's just text. And it deletes
  2225. 1:09:35it, right? And so, if you go back to
  2226. 1:09:37string, put my name,
  2227. 1:09:39what I can do here is execute the step,
  2228. 1:09:42which will show me the output in schema,
  2229. 1:09:43which is basically the way that we all
  2230. 1:09:45look at it because it looks a bit messy
  2231. 1:09:47in JSON, the table version,
  2232. 1:09:49or JSON, right? So, if you've never
  2233. 1:09:51pressed on this button JSON, this is
  2234. 1:09:53what it looks like. We have an object
  2235. 1:09:56right here. We have the key and we have
  2236. 1:09:58the value
  2237. 1:09:59right here.
  2238. 1:10:01Now, let's say I wanted to do age
  2239. 1:10:03and we do um 20.
  2240. 1:10:07If I execute the step, now you can see
  2241. 1:10:09that the object right here is increasing
  2242. 1:10:12in the size because there's a new
  2243. 1:10:14key-value pair. And bear in mind that
  2244. 1:10:16this is text right now. It's not a
  2245. 1:10:17number. So, if I wanted to change this
  2246. 1:10:19to a number,
  2247. 1:10:20look at the color of this, it changes
  2248. 1:10:22the actual type of output. Right? So, it
  2249. 1:10:24changes the type of output that comes
  2250. 1:10:26here to 20. Let's say I wanted to do
  2251. 1:10:28Boolean.
  2252. 1:10:29This is true or false.
  2253. 1:10:31I can say student
  2254. 1:10:34false or you can do true.
  2255. 1:10:36So, we're saying, "Hey, [music] his name
  2256. 1:10:37is Michele Torti. He's 20 years old and
  2257. 1:10:39he's a student, right?" And then you can
  2258. 1:10:41also be adding an array, which in this
  2259. 1:10:43case can be skills, like I mentioned
  2260. 1:10:44before, and you do
  2261. 1:10:47square bracket
  2262. 1:10:48square bracket to end it. Then you put
  2263. 1:10:50skills. You say notion.
  2264. 1:10:53You finish it off, then and then done.
  2265. 1:10:56Then make
  2266. 1:10:58and then you do something else, right?
  2267. 1:10:59But we are adding items inside the
  2268. 1:11:01array, which is here and here. Two items
  2269. 1:11:05right here. Boom.
  2270. 1:11:07Now, if I press execute step, this will
  2271. 1:11:08now show the skills like this. It will
  2272. 1:11:11show the full name, it will show the
  2273. 1:11:12age, the student, and the skills right
  2274. 1:11:14here, which are wrapped up in square
  2275. 1:11:16brackets right here.
  2276. 1:11:18Notion, make, and so on.
  2277. 1:11:19And finally, we have
  2278. 1:11:22the object, right? And the object can be
  2279. 1:11:25a summary. Let's call it summary and
  2280. 1:11:26let's copy this full thing, this whole
  2281. 1:11:28object, because this is an object again,
  2282. 1:11:31from here to here.
  2283. 1:11:33And I can paste this here.
  2284. 1:11:35If I execute the step,
  2285. 1:11:37this will now
  2286. 1:11:38add the new object that we have, which
  2287. 1:11:40is called summary,
  2288. 1:11:41and we have it this again,
  2289. 1:11:43which we just copied up here. Now, why
  2290. 1:11:45am I showing you this? It's because
  2291. 1:11:46typically when we get inputs from the
  2292. 1:11:48previous node, the previous step, we
  2293. 1:11:50send it here to then be able to change
  2294. 1:11:52the data. So, let me show you an example
  2295. 1:11:54here. Let's say I have Let me delete
  2296. 1:11:55this. Let's say I have the full name and
  2297. 1:11:57I wanted to get just the first name.
  2298. 1:12:00So, let's say I run this
  2299. 1:12:02and I have the output, which is full
  2300. 1:12:04name. Let's say I add another edit node
  2301. 1:12:07right here. I can go here. I can remove
  2302. 1:12:09[music] this. And now, let's say I
  2303. 1:12:11wanted to take the full name and I
  2304. 1:12:12wanted to transform it into just the
  2305. 1:12:14first name. What I do here is I press
  2306. 1:12:16here. I can say first name.
  2307. 1:12:19And if I go here to expression,
  2308. 1:12:22I can put curly bracket curly bracket.
  2309. 1:12:25And now inside here, it says anything
  2310. 1:12:27inside the curly bracket curly bracket
  2311. 1:12:29is JavaScript, which is JSON. Right? So,
  2312. 1:12:31we're saying I can actually reference
  2313. 1:12:33previous variables using this. So, I can
  2314. 1:12:35say dollar sign JSON, which is the way
  2315. 1:12:38that you start when you want to
  2316. 1:12:39reference some sort of item here,
  2317. 1:12:41dot
  2318. 1:12:43full name,
  2319. 1:12:44right? Which you got right here, full
  2320. 1:12:46name. And so, that is how you can
  2321. 1:12:48reference these variables from the
  2322. 1:12:49previous steps to the next steps. And
  2323. 1:12:52that's how dynamic variables work,
  2324. 1:12:53right? Because they are dynamic, they
  2325. 1:12:55change every single time. Cuz right
  2326. 1:12:56here, if I run this, I would also have
  2327. 1:12:59the first name, which is Michele Torti.
  2328. 1:13:01But if I go back here
  2329. 1:13:02and change it to James,
  2330. 1:13:06and I run this again,
  2331. 1:13:08this will now be James, right? Which is
  2332. 1:13:09why it's dynamic, which is why
  2333. 1:13:11automations are brilliant because they
  2334. 1:13:12change data and you can automate the
  2335. 1:13:14process so you don't have to do it
  2336. 1:13:16yourself.
  2337. 1:13:18So, okay. Let's say we have the full
  2338. 1:13:19name here. Let me go full screen by
  2339. 1:13:21pressing this button right here.
  2340. 1:13:23And let's say I wanted to take this
  2341. 1:13:24name. I just wanted to get James. Now,
  2342. 1:13:26inside N 10 and the reason why I would
  2343. 1:13:29say for a beginner it looks a bit
  2344. 1:13:30technical uh because of this, because
  2345. 1:13:32make.com doesn't actually show you this,
  2346. 1:13:35but that's what it is in the back end.
  2347. 1:13:37I can, after the whole variable, so full
  2348. 1:13:39name, which again is this,
  2349. 1:13:42what I can do is actually use some
  2350. 1:13:43formulas. So, I can put dot, which now
  2351. 1:13:46allows me to see different things that I
  2352. 1:13:48can do with this full name. I can split
  2353. 1:13:51the first name, which we're going to do.
  2354. 1:13:52I can check whether the um the name
  2355. 1:13:54includes something, right? So, you can
  2356. 1:13:56see here whether the team includes T and
  2357. 1:13:59it says true. And so, these are all
  2358. 1:14:00formulas that you can use within your um
  2359. 1:14:04the full name. Honestly, you'll probably
  2360. 1:14:06use maybe five or six of these, so don't
  2361. 1:14:08even worry about understanding each one.
  2362. 1:14:10Um one of them that I use a lot is split
  2363. 1:14:12because I usually want to split the full
  2364. 1:14:14name so I can get the first name. So, in
  2365. 1:14:16this case, what we're doing here is
  2366. 1:14:18we're getting the full name, which is
  2367. 1:14:19James Torti. What we're doing is saying,
  2368. 1:14:21"Hey, let's split this name by the
  2369. 1:14:23presence of a space so it gives me this,
  2370. 1:14:26which is first name, and then last name.
  2371. 1:14:29And then we want to get the first,
  2372. 1:14:31first one, which is James.
  2373. 1:14:34And that's the way that this works
  2374. 1:14:35because everything in JSON is logic.
  2375. 1:14:37Everything in code is logic. Right? So,
  2376. 1:14:39if you put logic here into this
  2377. 1:14:41automation, or not automation, in this
  2378. 1:14:43variable, then you're saying, "Hey,
  2379. 1:14:45let's split
  2380. 1:14:47this by the presence of a space." So, we
  2381. 1:14:49do the apostrophe here and we actually
  2382. 1:14:52put the space in our keyboard. So, now
  2383. 1:14:54we can see that we have the first one
  2384. 1:14:56and we have the second one. And now,
  2385. 1:14:58after we put split, then we want to put
  2386. 1:15:00dot
  2387. 1:15:01first
  2388. 1:15:03because we're returning the first
  2389. 1:15:04element of the array. Cuz you can see
  2390. 1:15:06here, this is an array,
  2391. 1:15:07right? Because it has this {comma} this
  2392. 1:15:10{comma} that, right? So, let's say I had
  2393. 1:15:12the full name being James Torti Arthur,
  2394. 1:15:15it would then be James {comma} Torti
  2395. 1:15:16{comma} Arthur. And so, after this, we
  2396. 1:15:18want to put first
  2397. 1:15:19>> [music]
  2398. 1:15:19>> and this is how we get James. And that's
  2399. 1:15:21how in emails you can turn the full name
  2400. 1:15:23into a first name by using JSON and by
  2401. 1:15:26using formulas within the JSON. Now, you
  2402. 1:15:28looking at this right now, it probably
  2403. 1:15:29looks very overwhelming and it was very
  2404. 1:15:31overwhelming for me at the start as
  2405. 1:15:33well. But when you understand the ones
  2406. 1:15:35that actually do matter, cuz yeah, let's
  2407. 1:15:37be honest, you're not going to be using
  2408. 1:15:38all these,
  2409. 1:15:40they work very well, right? Like if you
  2410. 1:15:41understand split, for example, and
  2411. 1:15:43understand that this is the formula that
  2412. 1:15:45you use every single time to split a
  2413. 1:15:47full name from something else, then
  2414. 1:15:49you're pretty much set. That's it,
  2415. 1:15:50right? And the good thing is that you
  2416. 1:15:52have an AI
  2417. 1:15:53on the right-hand side
  2418. 1:15:55that you can ask any questions to, which
  2419. 1:15:56can also help you. And so, that is how
  2420. 1:15:59we can transform data. We can take some
  2421. 1:16:01sort of full name, we can then use some
  2422. 1:16:03formula, and then we can output the
  2423. 1:16:06first name, right? From here
  2424. 1:16:08to here.
  2425. 1:16:09And that is data transformation. That's
  2426. 1:16:11how we use JSON to be able to take an
  2427. 1:16:13input and turn it into something that's
  2428. 1:16:15an output. And quick side note here, if
  2429. 1:16:17you're wondering what's behind this, I
  2430. 1:16:18mentioned it's JSON, let me show you
  2431. 1:16:20what I mean. I can copy this. I can go
  2432. 1:16:22here and if I paste this, this will be
  2433. 1:16:24JSON because these are nodes that have
  2434. 1:16:27parameters, that have different stuff,
  2435. 1:16:29which are all JSON. And the reason why
  2436. 1:16:32this N 10 make.com works very well is
  2437. 1:16:34because we don't have to see this. But
  2438. 1:16:36just know that behind this
  2439. 1:16:38is this, right? So, it's all JSON.
  2440. 1:16:40That's why understanding JSON is very,
  2441. 1:16:41very important because it gives you the
  2442. 1:16:42understanding of how things actually
  2443. 1:16:44work together and how the English
  2444. 1:16:46language in computers actually works.
  2445. 1:16:47Now that we have this, full name
  2446. 1:16:49>> [music]
  2447. 1:16:49>> and then going to the first name, now we
  2448. 1:16:50can add some branching. So, we can add
  2449. 1:16:52some some conditions.
  2450. 1:16:54And we can add if. So, if is saying,
  2451. 1:16:57"Hey, if this variable,
  2452. 1:16:59which again we can get by doing curly
  2453. 1:17:01bracket curly bracket,
  2454. 1:17:03JSON dot first name.
  2455. 1:17:06So, JSON dot the variable that's here,
  2456. 1:17:08right? JSON dot first name
  2457. 1:17:11equals to James, this will say true,
  2458. 1:17:14true branch. And if I go outside of
  2459. 1:17:15here, I can see that this is a true
  2460. 1:17:17branch. This is a thing that is true.
  2461. 1:17:19Then we can now send the automation one
  2462. 1:17:21way if that specific criteria or
  2463. 1:17:23condition is true. And if it's false,
  2464. 1:17:25then we go down this way. And for
  2465. 1:17:26example, if I change the the name to
  2466. 1:17:29Michele,
  2467. 1:17:30execute the step, now this will be a
  2468. 1:17:31false branch. This will go down
  2469. 1:17:33defaults. And again, behind this, what
  2470. 1:17:35it does is that it uses this variable.
  2471. 1:17:38It then says, "Hey, is this variable
  2472. 1:17:40equal to this? If yes, [music] then it's
  2473. 1:17:42true. If not, then it's false." Because
  2474. 1:17:44again, everything lies on logic.
  2475. 1:17:46Everything is logic in automations.
  2476. 1:17:48Whether you have this or whether you
  2477. 1:17:50have [music] this, conditioning into
  2478. 1:17:51different paths. All right. So, right
  2479. 1:17:52here I have an AI agent. So, we'll see
  2480. 1:17:54how JSON actually applies within the AI
  2481. 1:17:56agent. I can open chat and I can say
  2482. 1:17:59hello.
  2483. 1:18:01And what it's doing now is it's
  2484. 1:18:04is it sending the information here,
  2485. 1:18:06JSON, which is session ID, action, and
  2486. 1:18:09chat input, which is the thing that I
  2487. 1:18:10just told it to do. So, these are
  2488. 1:18:11different items that we get as an output
  2489. 1:18:13from the actual thing. It's transferring
  2490. 1:18:15data, so what you see here, the line is
  2491. 1:18:17actually just transferring the data
  2492. 1:18:18here,
  2493. 1:18:19to this AI agent, which is giving the
  2494. 1:18:21chat input as an example in JSON here.
  2495. 1:18:24Then,
  2496. 1:18:25using the chat input, is then talking to
  2497. 1:18:28the actual open AI by giving it JSON
  2498. 1:18:30again, which is messages,
  2499. 1:18:32right here.
  2500. 1:18:33And then the output that we get using
  2501. 1:18:35open AI is this. "Hello, how can I
  2502. 1:18:38assist you today?" Which again is the
  2503. 1:18:40output, which goes here. "Hello, how can
  2504. 1:18:42I assist you today?" So, everything that
  2505. 1:18:43you see within your automations, data
  2506. 1:18:45here and data there, or some sort of
  2507. 1:18:47variable going to the AI agent and then
  2508. 1:18:48going to something else, it's all JSON.
  2509. 1:18:51That's how data flows within different
  2510. 1:18:52automations. And so, let's say now I
  2511. 1:18:54wanted to take action on my email. I can
  2512. 1:18:56say send an email
  2513. 1:18:58to
  2514. 1:18:59[email protected]
  2515. 1:19:01saying we have
  2516. 1:19:04uh
  2517. 1:19:05football tomorrow. I can press go. This
  2518. 1:19:07will now send the data here. It will
  2519. 1:19:08then call the tool
  2520. 1:19:10and then it will send the email, right?
  2521. 1:19:12And if I go inside here, I can see that
  2522. 1:19:14this is the input. The messages is the
  2523. 1:19:16input, the subject line and email body.
  2524. 1:19:19And the output is the response, which is
  2525. 1:19:22the email ID that I just made, the
  2526. 1:19:24thread ID which is a thread of the
  2527. 1:19:25email, and then the label ID telling us
  2528. 1:19:28that this is sent. And this right here
  2529. 1:19:30is an object. Right right here. The same
  2530. 1:19:32way that it was person name, it was
  2531. 1:19:34contact, it was whatever it is. All
  2532. 1:19:36right, and lastly here we have a form
  2533. 1:19:37that I just made.
  2534. 1:19:39If I go to the form, I can see that I
  2535. 1:19:40have the full name, the age, and the
  2536. 1:19:41date. So I say Michele Torti.
  2537. 1:19:44The age will be let's say 20.
  2538. 1:19:46The date, let's say the date is today.
  2539. 1:19:48The 20th. I can press submit.
  2540. 1:19:51What this will now do is it will send
  2541. 1:19:52the data to our automation.
  2542. 1:19:55And we get back the full name which is a
  2543. 1:19:57key
  2544. 1:19:58value.
  2545. 1:19:59Key, as you can see here this is a value
  2546. 1:20:01but it's not in quotation marks because
  2547. 1:20:02it's a number. And then everything else
  2548. 1:20:04is a key value pair with this because
  2549. 1:20:06it's all a string. It's all text. Now
  2550. 1:20:08some fundamental rules to remember for
  2551. 1:20:10JSON is that the keys must always be in
  2552. 1:20:12double quotes. The keys right here,
  2553. 1:20:14name, must always be in these two codes
  2554. 1:20:16because it's always a string. If you
  2555. 1:20:19don't put it that way, it'll break,
  2556. 1:20:21right? The second thing is to understand
  2557. 1:20:22the difference between string, number,
  2558. 1:20:24boolean, null, object, and array, right?
  2559. 1:20:27And how these sort of function because
  2560. 1:20:28then you're able to understand JSON as a
  2561. 1:20:30whole because it is just that. It is
  2562. 1:20:32just strings which are text, numbers
  2563. 1:20:34[music] which are just numbers with no
  2564. 1:20:35quotation marks, boolean true or false,
  2565. 1:20:37null no data, object which is JSON
  2566. 1:20:40inside the JSON, and array which is a
  2567. 1:20:42list of values. Then we have the third
  2568. 1:20:44rule which is separating pairs with
  2569. 1:20:45commas. So we have the key which is
  2570. 1:20:47name,
  2571. 1:20:48the actual value, comma, the next thing,
  2572. 1:20:50comma, the next thing, and then the last
  2573. 1:20:52one doesn't have a comma, the one
  2574. 1:20:53nearest to the actual curly bracket
  2575. 1:20:55which finishes off the JSON structure.
  2576. 1:20:57And lastly is wrapping the whole thing
  2577. 1:21:00in quotation mark if it's an object. And
  2578. 1:21:02an object in this case is just a list of
  2579. 1:21:04key value pairs, right? Key, value, key,
  2580. 1:21:07value, key, value. And we wrap up the
  2581. 1:21:09whole object using curly brackets here
  2582. 1:21:12and curly brackets here to finish it
  2583. 1:21:13off. And if you're someone who's serious
  2584. 1:21:15about starting and scaling your AI
  2585. 1:21:17agency, then you might want to check out
  2586. 1:21:19the first link down below which is a
  2587. 1:21:20video that walks you through our
  2588. 1:21:21one-to-one mentorship program which is a
  2589. 1:21:23program where we get to work with you
  2590. 1:21:24one-to-one to help you start and scale
  2591. 1:21:26your agency to 10K a month.
  2592. 1:21:31Webhooks are by far one of the most
  2593. 1:21:32powerful thing within automation. Yet
  2594. 1:21:34most people still have no idea how they
  2595. 1:21:36work. So today I'm walking you through
  2596. 1:21:37exactly what a webhook is, how you can
  2597. 1:21:39use it in real life, and how you can set
  2598. 1:21:41it up within your own N and so by the
  2599. 1:21:43end of the video you'll be able to use
  2600. 1:21:45it within your own automations even if
  2601. 1:21:47you've never touched it before. So let's
  2602. 1:21:48dive in. So what a webhook is is
  2603. 1:21:50essentially a URL that allows us to get
  2604. 1:21:51notified when something changes within
  2605. 1:21:53an app. So think of it as someone coming
  2606. 1:21:55into your house and ringing your
  2607. 1:21:56doorbell. As soon as they ring your
  2608. 1:21:58doorbell, you instantly get notified,
  2609. 1:22:00right? And we could usually refer to
  2610. 1:22:02this as an instant trigger. That's
  2611. 1:22:03exactly what a webhook is. As soon as
  2612. 1:22:05something happens, we instantly get
  2613. 1:22:07notified in the webhook. Now the
  2614. 1:22:09business use case to this could be
  2615. 1:22:11someone filling out a form. So as soon
  2616. 1:22:13as the user fills out a form, whether
  2617. 1:22:14it's in the website or something else,
  2618. 1:22:16we instantly get notified so the webhook
  2619. 1:22:18receives the data meaning receives the
  2620. 1:22:19responses from the form and then starts
  2621. 1:22:21the automation which is the one right
  2622. 1:22:23here. All right, so let's jump onto N
  2623. 1:22:24and right here real quick and we can add
  2624. 1:22:26the first step. So adding the first step
  2625. 1:22:27just asking us what is the trigger? What
  2626. 1:22:29is a thing that starts the automation?
  2627. 1:22:31As I mentioned, when someone fills out a
  2628. 1:22:32form, the first step will be the webhook
  2629. 1:22:34because that's the thing that allows us
  2630. 1:22:35to actually start the automation. Now
  2631. 1:22:37the webhook can be found here. So on
  2632. 1:22:38webhook call, we can obviously trigger
  2633. 1:22:39manually an app event on a schedule,
  2634. 1:22:41form submission. We can do a bunch of
  2635. 1:22:42stuff but the webhook itself is this one
  2636. 1:22:44and it runs the flow on receiving an
  2637. 1:22:46HTTP request. Now HTTP stands for
  2638. 1:22:48hypertext transfer protocol, very fancy
  2639. 1:22:51way of saying that data is passed from
  2640. 1:22:54one app to another when we get notified,
  2641. 1:22:55right? So when we tap on here, we get
  2642. 1:22:58introduced to this page right here.
  2643. 1:22:59On the left hand side is basically
  2644. 1:23:01pulling in from the webhook so it's
  2645. 1:23:02listening for new events. So when we
  2646. 1:23:03press this button, it now the webhook
  2647. 1:23:05itself it's listening for notifications
  2648. 1:23:08coming from some server, some sort of
  2649. 1:23:09server.
  2650. 1:23:10So let's stop listening.
  2651. 1:23:11And in the middle, this is the
  2652. 1:23:13configuration and on the right hand side
  2653. 1:23:15is the output. So when we get notified,
  2654. 1:23:17the notification will show up here.
  2655. 1:23:19So right here the first thing that we
  2656. 1:23:20see is the difference between a test URL
  2657. 1:23:22and a production URL. Now this is quite
  2658. 1:23:24misunderstood between what they are but
  2659. 1:23:26a test URL so if you look at the the
  2660. 1:23:28actual thing, the actual URL in this
  2661. 1:23:29case,
  2662. 1:23:30it says test but production doesn't have
  2663. 1:23:32test. Now when you want to deploy which
  2664. 1:23:35means that you when you want to activate
  2665. 1:23:36your automation, you typically want to
  2666. 1:23:38use the production URLs. That's the main
  2667. 1:23:39use case for this but you can use the
  2668. 1:23:42test when you test and production is
  2669. 1:23:43again when you want to activate your
  2670. 1:23:44automation. Now right here you can see
  2671. 1:23:46that you have a URL. So again, the
  2672. 1:23:48webhook itself is URL that's accessible
  2673. 1:23:50to anyone. It's literally it goes on the
  2674. 1:23:51web. It's just a normal link that you
  2675. 1:23:53can use for anything that you do. So if
  2676. 1:23:55I press here, I can easily copy it and I
  2677. 1:23:57can go to to Google and actually search
  2678. 1:23:59it. But again, this is a thing that
  2679. 1:24:00allows us to actually get notified when
  2680. 1:24:02something happens and we also get this
  2681. 1:24:05this long string. So this is the the
  2682. 1:24:06unique part which is 3826BB2D9056
  2683. 1:24:11and this is the path.
  2684. 1:24:12This is what we call a path. Now the
  2685. 1:24:13path can be changed to something else
  2686. 1:24:15like hello.
  2687. 1:24:16Like hello Michele, whatever it is.
  2688. 1:24:19Or we typically want to have a long
  2689. 1:24:20string. It doesn't really matter.
  2690. 1:24:22But again, this can be this can vary.
  2691. 1:24:23This can change, right? And it doesn't
  2692. 1:24:25really matter what you put here.
  2693. 1:24:26Now when it comes to the webhook itself,
  2694. 1:24:29we have different types of method. Now
  2695. 1:24:31when you want to get notified from a
  2696. 1:24:32server, you typically want to use one of
  2697. 1:24:33these different HTTP methods. So the
  2698. 1:24:35HTTP method can be a get which is
  2699. 1:24:38getting information, head, patch, post,
  2700. 1:24:40put, and delete. Really the only ones
  2701. 1:24:42that I've actually used after building
  2702. 1:24:44hundreds of automation is get and post.
  2703. 1:24:46So a server could say, "Hey, I'm sending
  2704. 1:24:47you the notification but you need to be
  2705. 1:24:50a put request or a post request or a get
  2706. 1:24:53request." Right? So this is the thing
  2707. 1:24:54that you put here. The path again I
  2708. 1:24:55explained which is the last part of the
  2709. 1:24:56webhook. Authentication is basically
  2710. 1:24:58saying, "Do you want to add a password
  2711. 1:25:00so only you only the people who know the
  2712. 1:25:03username and password can actually
  2713. 1:25:04access it." You can use it but I don't
  2714. 1:25:06really use basic auth and header auth or
  2715. 1:25:07JSON webhook token auth. It doesn't
  2716. 1:25:10really matter like the difference
  2717. 1:25:10between doesn't really matter but just
  2718. 1:25:11know that they're used as a way for us
  2719. 1:25:13to say, "Hey, don't breach across this
  2720. 1:25:15point. You need to have a password to
  2721. 1:25:16actually use it." So that's what we use
  2722. 1:25:17authentication for but typically I would
  2723. 1:25:19have it as none. And then for the
  2724. 1:25:20response we have immediately, we have
  2725. 1:25:22when last node finishes. So immediately
  2726. 1:25:24just means like when this happens,
  2727. 1:25:25immediately send the data here. We can
  2728. 1:25:27have when last node finishes so return
  2729. 1:25:29the data when the last node which means
  2730. 1:25:30that the last step of the execution is
  2731. 1:25:32finished, the last step of the
  2732. 1:25:33automation, and then it sends the data
  2733. 1:25:35back. And we can use a respond to
  2734. 1:25:37webhook node which I'll show you in just
  2735. 1:25:38a second, and then streaming as well
  2736. 1:25:40which we don't really use uh so don't
  2737. 1:25:41worry about it too much. And then we
  2738. 1:25:42have different options. So for options,
  2739. 1:25:44I would usually have the raw body so in
  2740. 1:25:46case we need it. But for most of the
  2741. 1:25:48times because we're getting notified
  2742. 1:25:49because we're getting something, we
  2743. 1:25:51wouldn't use any options but you can
  2744. 1:25:53have the option to basically have some
  2745. 1:25:55different options here that you can use
  2746. 1:25:57for the different types of requests that
  2747. 1:25:58you're getting. But typically we
  2748. 1:25:59wouldn't put anything here. So with that
  2749. 1:26:01being said, if you go here to webhook,
  2750. 1:26:03when I spoke about the respond to the
  2751. 1:26:04webhook, we also get a webhook response.
  2752. 1:26:07Respond to webhook. So what this means
  2753. 1:26:09is that when we get notified from the
  2754. 1:26:10server, we can actually give it a
  2755. 1:26:12response back to the server. So let me
  2756. 1:26:14show you what I mean. So because this is
  2757. 1:26:16accessible on the internet, I can copy
  2758. 1:26:18this, I can listen for the test events.
  2759. 1:26:20And let me just
  2760. 1:26:21go like here.
  2761. 1:26:23And then I can see that now the message
  2762. 1:26:25says workflow has started. So if I go
  2763. 1:26:27back here, I can see that [music] on
  2764. 1:26:29here I get a bunch of output. So I get
  2765. 1:26:31the user agent, Mozilla which is
  2766. 1:26:33basically telling everything about my
  2767. 1:26:34browser, a bunch of codey stuff that you
  2768. 1:26:36don't have to worry about but just know
  2769. 1:26:37that because we opened it on the
  2770. 1:26:39browser, it's basically giving us a
  2771. 1:26:40bunch of information that we then can
  2772. 1:26:42use for the automation. So let me show
  2773. 1:26:43you exactly what I mean by a respond to
  2774. 1:26:45webhook. So let's say we add this here
  2775. 1:26:47and I go in here and I say
  2776. 1:26:50all incoming items.
  2777. 1:26:51So we're basically saying, "Hey, I'm
  2778. 1:26:53going to give you back everything that
  2779. 1:26:55you gave me." So if I execute this
  2780. 1:26:57workflow,
  2781. 1:26:59I think I have to change this to yeah,
  2782. 1:27:01you respond to webhook as well because
  2783. 1:27:04this is the response.
  2784. 1:27:05Execute the workflow and now I go here,
  2785. 1:27:08I can see that I get a bunch of
  2786. 1:27:09different text. So this is exactly what
  2787. 1:27:11sent to us but because we're sending it
  2788. 1:27:12back, we get everything here. So that's
  2789. 1:27:14why it's sending us everything back. All
  2790. 1:27:16right, so you understand what a webhook
  2791. 1:27:17is now. You understand sort of the
  2792. 1:27:18different things, the different
  2793. 1:27:20settings. Let's actually put it to work
  2794. 1:27:21and see how it actually works in a
  2795. 1:27:23business case scenario. If I go here,
  2796. 1:27:26let me just put in production mode and
  2797. 1:27:27let me copy this.
  2798. 1:27:29Uh the workflow that we're going to
  2799. 1:27:31basically make is starting from a
  2800. 1:27:32Typeform which is someone filling out a
  2801. 1:27:34form and then we can add it to let's say
  2802. 1:27:36a Google Sheet and then we can send an
  2803. 1:27:38email back to the person that filled out
  2804. 1:27:40the form.
  2805. 1:27:41So let me go to Typeform. So this right
  2806. 1:27:42here is the Typeform that we're going to
  2807. 1:27:44use for this test right here. It all
  2808. 1:27:45starts with full name, email, and what
  2809. 1:27:47are you looking for? Very simple. You
  2810. 1:27:48can obviously add more details like
  2811. 1:27:49company name, budget, whatever it is
  2812. 1:27:51that you have but let's start here. I
  2813. 1:27:53want to show you exactly when we fill
  2814. 1:27:55out this form, how does it send the
  2815. 1:27:56information to N and N? So let me go to
  2816. 1:27:58workflows.
  2817. 1:27:59Let me go to webhooks right here. So you
  2818. 1:28:02can connect with any app to send
  2819. 1:28:03responses or trigger actions which is
  2820. 1:28:05exactly what we want. We want to add a
  2821. 1:28:06webhook
  2822. 1:28:07which will take us to this page. We can
  2823. 1:28:09add a webhook and then here is where we
  2824. 1:28:12go inside and we actually what is it?
  2825. 1:28:14Production URL. Let's copy this
  2826. 1:28:16and let's put it into here.
  2827. 1:28:20And we can save the webhook.
  2828. 1:28:21Now once this is done, we can we
  2829. 1:28:23typically want to send a test request to
  2830. 1:28:25make sure that it does work. So let me
  2831. 1:28:26go here.
  2832. 1:28:27Go inside and listen for test events. I
  2833. 1:28:30can send a test request [music] and now
  2834. 1:28:31it's giving me an error. So let's see
  2835. 1:28:33why it gives me an error. So below
  2836. 1:28:35on the response, we can see the workflow
  2837. 1:28:37must be active for a production URL to
  2838. 1:28:40run successfully. You can't activate the
  2839. 1:28:41workflow using toggle. Okay, so this is
  2840. 1:28:43what I meant before. So if you go here,
  2841. 1:28:45I just pasted the production URL. Let's
  2842. 1:28:47do the test URL because again, the
  2843. 1:28:49production URL only works when you
  2844. 1:28:50activate the automation. So let's do
  2845. 1:28:52test URL. Let me copy this.
  2846. 1:28:54Let me go here.
  2847. 1:28:56Let me replace
  2848. 1:28:58webhook.
  2849. 1:29:00And now
  2850. 1:29:01we can
  2851. 1:29:02test it again. So let me listen for
  2852. 1:29:05event.
  2853. 1:29:07And I can test the [music] request.
  2854. 1:29:09In this case it's giving me another
  2855. 1:29:10error. So let's see the response.
  2856. 1:29:12And now it's telling me the webhook is
  2857. 1:29:13not registered for post request. Did you
  2858. 1:29:14mean to make a get request? So now this
  2859. 1:29:17is goes back to the fundamental where I
  2860. 1:29:18told you some servers ask us to do a
  2861. 1:29:20different request. So in this case for
  2862. 1:29:22the HTTP, they say, "Hey, this is not
  2863. 1:29:24set up to do a post request." So all we
  2864. 1:29:26have to do is set up to the to do a post
  2865. 1:29:28request in this case. And then we can
  2866. 1:29:30try again,
  2867. 1:29:31go here and then send a test request and
  2868. 1:29:33now it should be successful, right? 200,
  2869. 1:29:35which means it's all good. The workflow
  2870. 1:29:36has started. And if I go back to n8n,
  2871. 1:29:39I can see that we have the output, which
  2872. 1:29:41is successful, right? Which is
  2873. 1:29:42everything. Okay, cool. Now, now we know
  2874. 1:29:45that this works and we know that we get
  2875. 1:29:46a request whenever this is post and it's
  2876. 1:29:48test just to test until we set it to
  2877. 1:29:50active,
  2878. 1:29:51we can then fill out the form and see
  2879. 1:29:53the data that we get. Go here, listen
  2880. 1:29:56for events, go back to Typeform, and
  2881. 1:29:58then I can activate this cuz we want
  2882. 1:30:01this to be on every single time.
  2883. 1:30:03I can copy the link to the Typeform and
  2884. 1:30:05then I can start filling it out. So let
  2885. 1:30:07me do Michele Torti,
  2886. 1:30:09my name, or my email.
  2887. 1:30:13And what are you looking for? I want to
  2888. 1:30:15learn automations.
  2889. 1:30:18And I can press submit and now this
  2890. 1:30:20information will be sent to n8n right
  2891. 1:30:21here with a different output. So we have
  2892. 1:30:24headers, which is just a bunch of fancy
  2893. 1:30:25stuff that you want to look at, but then
  2894. 1:30:27what we actually care about is
  2895. 1:30:29not the body, but the responses. Where
  2896. 1:30:31is it?
  2897. 1:30:33The answers. So Michele Torti, my name,
  2898. 1:30:36the email is this, and the text, the
  2899. 1:30:38third one, is this.
  2900. 1:30:40So these are the ones that we're going
  2901. 1:30:40to use for the next steps. The form
  2902. 1:30:42submitted is sent the data to the
  2903. 1:30:43webhook. It's like, "Hey, we have this
  2904. 1:30:45data. Someone just submitted the form.
  2905. 1:30:46Now use it for whatever you want to use.
  2906. 1:30:48Here's a notification." Okay, once we
  2907. 1:30:49have this, what we can do now is we can
  2908. 1:30:52add it to our Google Sheet. So let's
  2909. 1:30:54make a Google Sheet right now.
  2910. 1:30:57Let's name it
  2911. 1:30:59new form request.
  2912. 1:31:03Let's do full name. These are the the
  2913. 1:31:05variables that we had, email.
  2914. 1:31:10Uh once. Let's just do once.
  2915. 1:31:13So let's connect this to n8n. So I go
  2916. 1:31:15here, I can press plus, I can go Google
  2917. 1:31:18Sheets.
  2918. 1:31:19And then what I need to do is append a
  2919. 1:31:20row in a sheet.
  2920. 1:31:23Connect it. All you have to do is go
  2921. 1:31:24here, sign in with Google, very very
  2922. 1:31:25simple.
  2923. 1:31:27And then I can do sheet within a
  2924. 1:31:28document, append a row, which means add
  2925. 1:31:30a row. And the document will be new form
  2926. 1:31:32request. There we go, the first one.
  2927. 1:31:34And then the sheet will be one. We want
  2928. 1:31:36to map each column manually because we
  2929. 1:31:38want to do this manually. And then the
  2930. 1:31:39full name will be
  2931. 1:31:41the one here. Where is it? There we go.
  2932. 1:31:43Text.
  2933. 1:31:45Because this is [music] the text that we
  2934. 1:31:46got.
  2935. 1:31:47And you know this because these are the
  2936. 1:31:48answers, right? You wouldn't put it here
  2937. 1:31:50if it wasn't the answers. And then email
  2938. 1:31:52would be the one here, so you just drag
  2939. 1:31:53it across. And once will be the last
  2940. 1:31:55thing, which is I want to learn
  2941. 1:31:56automations. So it's always good to test
  2942. 1:31:58because when you go here, how would you
  2943. 1:31:59know this is the answers, right? I mean,
  2944. 1:32:01it says answers right here, but it's
  2945. 1:32:03much better if you test to get actual
  2946. 1:32:04answers that you know you put, so you
  2947. 1:32:06can just map them here. And this is all
  2948. 1:32:08good, so I can just execute step, which
  2949. 1:32:09means I'm just testing it. This is
  2950. 1:32:10executing, so if I go here to the sheet,
  2951. 1:32:12I can see that this is already added.
  2952. 1:32:14Let me add this to bold.
  2953. 1:32:16And then I know this works, so I can go
  2954. 1:32:18to the last step, which is sending an
  2955. 1:32:19email.
  2956. 1:32:20So email in this case will be Gmail.
  2957. 1:32:22Uh create a message. No, send an email.
  2958. 1:32:25Yes, send a message. All I have to do to
  2959. 1:32:27connect to Gmail to to n8n is go here,
  2960. 1:32:29sign in with Google, very very simple,
  2961. 1:32:30like Google Sheets. And then here I have
  2962. 1:32:33to put message send because we're
  2963. 1:32:34sending the message. And in this case,
  2964. 1:32:36who are we sending the email to? We can
  2965. 1:32:38either pull it from here
  2966. 1:32:39or we can pull it from the actual form
  2967. 1:32:41itself, which is the email, right? I can
  2968. 1:32:44put it here. The subject line will be
  2969. 1:32:46thanks for filling out
  2970. 1:32:50the form.
  2971. 1:32:52Then it's asking us for the email type.
  2972. 1:32:53Now HTML is just the way that we make
  2973. 1:32:55our emails fancy. We can leave this as
  2974. 1:32:56text
  2975. 1:32:58cuz we don't need to use HTML. We can go
  2976. 1:33:00here, full screen. And then here I can
  2977. 1:33:02say, "Hey,
  2978. 1:33:03I can go down to my name." So hey
  2979. 1:33:05Michele. And obviously, ideally we want
  2980. 1:33:07to have just the first name and that
  2981. 1:33:09goes into formulas. I don't want to get
  2982. 1:33:10into this uh just for this video cuz
  2983. 1:33:11it's a bit more complex, but I can say,
  2984. 1:33:13"Hey Michele,
  2985. 1:33:15just saw
  2986. 1:33:20our team will get back to you
  2987. 1:33:24as soon as possible.
  2988. 1:33:27Thanks."
  2989. 1:33:29All right, cool. So we said, "Hey,
  2990. 1:33:30webhook name", which is a variable that
  2991. 1:33:32we're pulling in from the form because
  2992. 1:33:33again we're using dynamic variables, it
  2993. 1:33:34changes every single time. We're also
  2994. 1:33:36saying, "Hey, what do you want Who do
  2995. 1:33:37you want to send an email to?" And
  2996. 1:33:38that's about it for the step. So let me
  2997. 1:33:39test it. Okay, I just realized that it
  2998. 1:33:41was actually wrong. I put an extra O, so
  2999. 1:33:44I I actually didn't send an email. Um
  3000. 1:33:46but you should be getting the email when
  3001. 1:33:48you send it through. I just had to put
  3002. 1:33:50one O less, but that's how that's
  3003. 1:33:52usually how it works. You just send it
  3004. 1:33:53and you get this output right here. So
  3005. 1:33:55let's test it from the start until the
  3006. 1:33:56end. Let's execute the workflow and
  3007. 1:33:58let's
  3008. 1:33:59do a new form. So let's refresh. Let me
  3009. 1:34:01go here and say James Low.
  3010. 1:34:04Let me do my actual email
  3011. 1:34:06without the extra O.
  3012. 1:34:09Automations
  3013. 1:34:10for lead generation.
  3014. 1:34:13Submit.
  3015. 1:34:14We go here.
  3016. 1:34:15It's talking to Google Sheets to
  3017. 1:34:16actually add it, but we got the the
  3018. 1:34:18output here. So if I go here, I can see
  3019. 1:34:20that the answers in this case was James
  3020. 1:34:22Low,
  3021. 1:34:23was email, and then it was automations
  3022. 1:34:26for lead generation,
  3023. 1:34:27which rhymes. Uh let me go to Google
  3024. 1:34:29Sheet, which appends a row in the sheet,
  3025. 1:34:30which means that it added. So if I go
  3026. 1:34:32here, I can see that James Low was
  3027. 1:34:33added. And obviously this would be a
  3028. 1:34:35project management tool, it could be a
  3029. 1:34:36CRM, whatever you have. Um
  3030. 1:34:38but we added it here so you so you can
  3031. 1:34:39keep track of all the different requests
  3032. 1:34:41you're having.
  3033. 1:34:42And lastly, we have the email, which was
  3034. 1:34:44sent
  3035. 1:34:45this time with the right email. So if I
  3036. 1:34:46go to my email right here, I can see
  3037. 1:34:48that I have an email from Michele which
  3038. 1:34:50says, "Hey James Low, just saw you
  3039. 1:34:52filled out the form on our website. Our
  3040. 1:34:53team will get back to you as soon as
  3041. 1:34:54possible." Of course you want to add
  3042. 1:34:54more. And then it actually sends this as
  3043. 1:34:57well, which is which we don't want. So
  3044. 1:34:59all we have to do is go here
  3045. 1:35:01and then we can go to append n8n
  3046. 1:35:03attribution. We can turn this off so
  3047. 1:35:05that whenever it sends us an email, it
  3048. 1:35:06doesn't say this part, which we don't
  3049. 1:35:08want.
  3050. 1:35:09All right, so that right there is
  3051. 1:35:10basically how you use webhooks on n8n. I
  3052. 1:35:12want to quickly show you how it looks
  3053. 1:35:14like on a different platform, which is
  3054. 1:35:15make.com. So if I go to make.com,
  3055. 1:35:18I can log in. This is just another
  3056. 1:35:19automation platform like n8n. It's just
  3057. 1:35:22between n8n, Zapier, and and make.com.
  3058. 1:35:24Make.com is it's fairly easier to to get
  3059. 1:35:26started with, but if I go here,
  3060. 1:35:29I can see that to add the webhook to
  3061. 1:35:31make.com, all you have to do is go here
  3062. 1:35:34and this lists your webhooks here, and
  3063. 1:35:35you can create a custom webhook,
  3064. 1:35:37which is the same. So create a webhook,
  3065. 1:35:39name it whatever you want. So Michele
  3066. 1:35:42test. This will be the URL that we had
  3067. 1:35:44before. So in n8n, it will be this,
  3068. 1:35:47this
  3069. 1:35:48URL right here. In make.com, it will be
  3070. 1:35:50this. They all have their own like
  3071. 1:35:52internal different names. In this case
  3072. 1:35:54it's make.com
  3073. 1:35:55and for n8n, it's n8n.cloud, right? So
  3074. 1:35:58they have their own unique sort of way
  3075. 1:35:59that they name their
  3076. 1:36:01the webhooks. But on a high level, this
  3077. 1:36:03is very very this is literally pretty
  3078. 1:36:05much the same. Like it has the same
  3079. 1:36:06functionality. All the webhooks are
  3080. 1:36:08pretty much the same. It's just that the
  3081. 1:36:09way they look is different because of
  3082. 1:36:12the way that the this is set up. Press
  3083. 1:36:14save.
  3084. 1:36:15And this much. I don't want to get into
  3085. 1:36:16make.com cuz that's more of a different
  3086. 1:36:17video, but I just wanted to show you the
  3087. 1:36:19how it looks like to actually make a
  3088. 1:36:20webhook on a different platform. And
  3089. 1:36:22lastly, I want to show you how to send a
  3090. 1:36:25data point from not from a form, but
  3091. 1:36:27from another scenario to a webhook,
  3092. 1:36:29right? If I go to another scenario right
  3093. 1:36:30here, so let me go out. Let me go here.
  3094. 1:36:34Let me create a new workflow. And now,
  3095. 1:36:36because we I spoke about HTTP at the
  3096. 1:36:38start, but in order for me to have a
  3097. 1:36:40workflow and then send the information
  3098. 1:36:41from that workflow to the next workflow
  3099. 1:36:43through a webhook,
  3100. 1:36:44I can then actually use a HTTP request.
  3101. 1:36:48So let me show you exactly what I mean.
  3102. 1:36:49It will look it will actually be much
  3103. 1:36:50more clear when I actually run this, but
  3104. 1:36:52all I have to do is [music] copy this.
  3105. 1:36:55And let me take this out.
  3106. 1:36:58So I copy the webhook that I need.
  3107. 1:37:00And now we will get data from from the
  3108. 1:37:02previous workflow. So if I execute the
  3109. 1:37:04workflow here, I can go here and then
  3110. 1:37:06then I can send
  3111. 1:37:07the URL, which would be basically
  3112. 1:37:09saying, "Hey, I'm sending the data to
  3113. 1:37:11you", right? And the webhook is getting
  3114. 1:37:12notified. In this case, the method would
  3115. 1:37:14always be post just because we're
  3116. 1:37:16posting information cuz that's sending
  3117. 1:37:17information from one place to another.
  3118. 1:37:19Authentication is zero. And then we can
  3119. 1:37:21also send a body. The body will be
  3120. 1:37:24anything that you want it to do, so you
  3121. 1:37:25can say
  3122. 1:37:26uh full name.
  3123. 1:37:28So actually let's do camel case.
  3124. 1:37:31Full name, Michele.
  3125. 1:37:34Camel case is just just wants the
  3126. 1:37:36capital letters to be this.
  3127. 1:37:38So this right here will send the
  3128. 1:37:38information with it. So if I execute
  3129. 1:37:40this step, first of all I have to run
  3130. 1:37:41this.
  3131. 1:37:43All right, so actually it's already
  3132. 1:37:43running, right? Now it's waiting for
  3133. 1:37:45this. So if I [music] execute the step,
  3134. 1:37:47now
  3135. 1:37:49it will send the information and I can
  3136. 1:37:51see that we have in the body right here,
  3137. 1:37:52we have full name, Michele.
  3138. 1:37:54So imagine if you had a workflow right
  3139. 1:37:56here, which could send different
  3140. 1:37:57variables, so different things from one
  3141. 1:37:59workflow to another, so you can split it
  3142. 1:38:01up. And you have all the different
  3143. 1:38:02workflows talking to each other because
  3144. 1:38:04you have webhooks and because you have
  3145. 1:38:05HTTP requests.
  3146. 1:38:07This is a whole 'nother topic in itself,
  3147. 1:38:09but I wanted to show you the overall
  3148. 1:38:10sort of arcing thing of what a webhook
  3149. 1:38:12is, how it can be used in a business
  3150. 1:38:14sense, how it can be used, or what the
  3151. 1:38:16fundamentals are, and how everything
  3152. 1:38:17works together, how you can link it from
  3153. 1:38:18automation to automation as well.
  3154. 1:38:23In this video, I'm going to show you how
  3155. 1:38:24you can handle any errors inside of n8n
  3156. 1:38:27so your AI agents and your workflows are
  3157. 1:38:29smarter, stronger, and make sure that
  3158. 1:38:31they actually work. All right, so the
  3159. 1:38:32first one here is retry when failure. So
  3160. 1:38:34this happens when the workflow stops
  3161. 1:38:37working because of some reason, and then
  3162. 1:38:39we tell it to run X amount of times in X
  3163. 1:38:41interval. And you know a node, you know
  3164. 1:38:43a step has this exact error handling
  3165. 1:38:45technique because you will see this
  3166. 1:38:47right here, which says retry when fail.
  3167. 1:38:49So if I go inside the HTTP request,
  3168. 1:38:51which is a again a node, a thing that we
  3169. 1:38:53used to send a request to some server in
  3170. 1:38:55the internet asking for information,
  3171. 1:38:57we can execute the step and basically
  3172. 1:39:00what this is, it's a server where it
  3173. 1:39:02allows me to get any images of any dog
  3174. 1:39:04randomly.
  3175. 1:39:05I got this dog right here, right? And I
  3176. 1:39:07can keep going
  3177. 1:39:08again and again and again. And as you
  3178. 1:39:10You see, it's [music] successful. Why is
  3179. 1:39:11because the status is success. And I
  3180. 1:39:14also notice because there's a green
  3181. 1:39:15check mark, right? Which tells me that
  3182. 1:39:16everything went good.
  3183. 1:39:18Now, what happens if something goes
  3184. 1:39:19wrong? Well, if I remove the E,
  3185. 1:39:22right? Cuz before there was image, now
  3186. 1:39:24there's no image.
  3187. 1:39:25>> [music]
  3188. 1:39:25>> This will now stop working. This will
  3189. 1:39:27say there's an error.
  3190. 1:39:28As you can see, the resource you are
  3191. 1:39:30requesting cannot be found.
  3192. 1:39:32And if I go here, let's say you have a
  3193. 1:39:34whole workflow behind it. It will stop
  3194. 1:39:35here, right? And so, why is this bad?
  3195. 1:39:37Well, it's because sometimes some
  3196. 1:39:40service just stop working randomly,
  3197. 1:39:41right? They stop working for 1 to 2
  3198. 1:39:43seconds, maybe 3 to 4 seconds, which
  3199. 1:39:45[music] is why we use the retry when
  3200. 1:39:46failure. So, the way to set this up is
  3201. 1:39:48to go to settings. You then have this
  3202. 1:39:50setting turned on, retry on fail,
  3203. 1:39:52which means that you're saying, "Hey,
  3204. 1:39:54retry [music] this many times in this
  3205. 1:39:56interval." So, it stops working, it
  3206. 1:39:58tries once, then it waits 1,000
  3207. 1:40:00milliseconds until it tries again.
  3208. 1:40:02Wait, tries again, right? And so, it
  3209. 1:40:04does it three times to make sure that we
  3210. 1:40:06say, "If it doesn't work, that's cool.
  3211. 1:40:08We'll try again after this amount of
  3212. 1:40:09time." Right? And try back, try back,
  3213. 1:40:11try back until it works. And so, if I go
  3214. 1:40:13here and I run this, [music] input a
  3215. 1:40:15manual trigger,
  3216. 1:40:17I think I have this, manual trigger.
  3217. 1:40:19There we go. I can execute the workflow,
  3218. 1:40:21and as you can see, this is now looping
  3219. 1:40:23around [music] because it's actually
  3220. 1:40:25waiting or it's trying again after those
  3221. 1:40:27many times in that interval. So, let's
  3222. 1:40:29say I take this off,
  3223. 1:40:32right? All I have to do now is execute
  3224. 1:40:33the workflow, and it will instantly
  3225. 1:40:35[music] error out. But by turning this
  3226. 1:40:36on, retry when failure,
  3227. 1:40:38it will wait, right? To try again and
  3228. 1:40:41again and again, and at the end it will
  3229. 1:40:42stop. But there's some process of them
  3230. 1:40:44going through it, they're trying again
  3231. 1:40:46um before it goes to the next step. This
  3232. 1:40:48can be applied to LLMs because sometimes
  3233. 1:40:50OpenAI, Claude, Gemini, they just stop
  3234. 1:40:52working, and we have no clue why. And
  3235. 1:40:54so, to make your automation more
  3236. 1:40:56scalable, so that it just doesn't stop
  3237. 1:40:58every single time something goes wrong,
  3238. 1:40:59then make sure you have this. The second
  3239. 1:41:01technique is called the continue when
  3240. 1:41:03failed. Now, we allow the workflow to
  3241. 1:41:05continue even when it fails. And so,
  3242. 1:41:07theoretically, right? Logically, this
  3243. 1:41:09step right here, where you would
  3244. 1:41:10continue even if it fails, has to be
  3245. 1:41:12something where if it fails, amazing, we
  3246. 1:41:15still keep going. If it succeeds, we
  3247. 1:41:17keep going. So, it can't be a step
  3248. 1:41:18that's very, very important in the whole
  3249. 1:41:20logic of the flow. It has to be
  3250. 1:41:21something where if it's great, great, if
  3251. 1:41:23not, then it's fine. And so, the way to
  3252. 1:41:25set this up is you have to go to on
  3253. 1:41:26error,
  3254. 1:41:28and here we have three options. In this
  3255. 1:41:29case, it would just be continue. And so,
  3256. 1:41:31what we do here is it continues, and it
  3257. 1:41:33actually sends the error output, right?
  3258. 1:41:36The error message, to the next step. So,
  3259. 1:41:38if I go here, I added an extra S, I can
  3260. 1:41:41go here or extra F in this case, and I
  3261. 1:41:43can see that this is the message that I
  3262. 1:41:44get. Now, on the outside, everything
  3263. 1:41:46looks great because you can see
  3264. 1:41:48that this succeeds, right? There's a
  3265. 1:41:49check mark. But on the inside, what we
  3266. 1:41:52get is a message, right? We get this
  3267. 1:41:54error message that we can then use
  3268. 1:41:55[music] to give to the next step. If I
  3269. 1:41:57go here to the next step, I can then
  3270. 1:41:59pull the error message, put it over here
  3271. 1:42:01like a normal variable. I can execute
  3272. 1:42:03[music] the step, and this is the output
  3273. 1:42:05that we get right here. The third
  3274. 1:42:06technique is called split error route.
  3275. 1:42:08Now, split error route is a technique
  3276. 1:42:10that we use in a lot of our automations
  3277. 1:42:12to split the automation based on the
  3278. 1:42:14logic cuz everything is logic. What that
  3279. 1:42:16means in the plainest of English is this
  3280. 1:42:19step runs if this step actually
  3281. 1:42:22succeeds, then it goes one way. If it
  3282. 1:42:24errors out, so something goes wrong,
  3283. 1:42:26then we go the next way. Now, typically
  3284. 1:42:27this is great because with automations,
  3285. 1:42:29because everything is built on logic,
  3286. 1:42:31then we would typically have a route.
  3287. 1:42:34So, if something goes right or
  3288. 1:42:35everything goes right, then it goes one
  3289. 1:42:36way and it continues the automation. If
  3290. 1:42:38something goes wrong, then we notify our
  3291. 1:42:40team saying, "Hey guys, something went
  3292. 1:42:41wrong." And so, if I go inside here,
  3293. 1:42:45I can see that now I have the same exact
  3294. 1:42:47API that we had before,
  3295. 1:42:48and this will now go through the success
  3296. 1:42:50branch, not the error branch. But if
  3297. 1:42:52there's an error,
  3298. 1:42:54so extra F, I can execute the step, and
  3299. 1:42:56I can see that now it goes to the error
  3300. 1:42:57branch, which is
  3301. 1:42:59this one here.
  3302. 1:43:00And the way to set this up is if you go
  3303. 1:43:02to settings,
  3304. 1:43:03on error, so again, what happens when
  3305. 1:43:05there's an error, you [music] can
  3306. 1:43:06continue using error output,
  3307. 1:43:08right? It passes the item to an extra
  3308. 1:43:09error output,
  3309. 1:43:11which means that it gives us two
  3310. 1:43:12different paths to go [music] down with
  3311. 1:43:13our automation, one here and one here.
  3312. 1:43:16And if I go to my email, which in this
  3313. 1:43:17case is a step that we have right after
  3314. 1:43:19there's an error in a workflow,
  3315. 1:43:21we can send the error message as an
  3316. 1:43:24output, which in this case looks like
  3317. 1:43:25this,
  3318. 1:43:26right? And so, right here I have the
  3319. 1:43:27workflow, and in this case, let's say
  3320. 1:43:29it's a success, right? Just take the F
  3321. 1:43:31out here.
  3322. 1:43:33You can execute this, and it goes the
  3323. 1:43:35next way.
  3324. 1:43:37And if I go to my email, right? And I
  3325. 1:43:38have this error here,
  3326. 1:43:39no route or get XYZ. Now, honestly, this
  3327. 1:43:43right here makes no sense to any normal
  3328. 1:43:44human looking at this unless you know
  3329. 1:43:46APIs and so on. We could delete all
  3330. 1:43:49these things, all these lines, uh just
  3331. 1:43:52to make it look cleaner. Um and yeah,
  3332. 1:43:54you can have this, so you're notified
  3333. 1:43:55when something happens. Now, there
  3334. 1:43:56actually is a better way when it comes
  3335. 1:43:58to uh using the notification when
  3336. 1:44:00something errors out, which I'll show
  3337. 1:44:02you in the last technique, but this is
  3338. 1:44:04great because it gives us two options,
  3339. 1:44:05right? It gives us the success option,
  3340. 1:44:07and it gives us the error option, all
  3341. 1:44:08within the same workflow. Next technique
  3342. 1:44:10is actually within the AI agent. So, if
  3343. 1:44:12I go to the AI agent and I go on chat,
  3344. 1:44:14and I can say
  3345. 1:44:16hello.
  3346. 1:44:17What this does is that it talks to the
  3347. 1:44:18brain, [music] right? Because again, we
  3348. 1:44:20mentioned that the brain is the LLM,
  3349. 1:44:22which means an AI that helps it think
  3350. 1:44:24through what it needs to do,
  3351. 1:44:25>> [music]
  3352. 1:44:25>> new instructions, based on the prompt
  3353. 1:44:27that we have inside. Now, this is all
  3354. 1:44:29great until this stops working, right?
  3355. 1:44:31There is a chance that this just errors
  3356. 1:44:34out, but this LLM just errors out, which
  3357. 1:44:36is where we add a fallback agent LLM.
  3358. 1:44:39So, if I go inside here, I can see that
  3359. 1:44:41I have an option here to enable fallback
  3360. 1:44:43model. If I turn this off, that means
  3361. 1:44:45that it removes the option for me to add
  3362. 1:44:48a fallback agent LLM. As you can see,
  3363. 1:44:50this is just [music] a glitch that n8n
  3364. 1:44:52needs to fix, uh but you will have no
  3365. 1:44:54option here as well. And so, the thought
  3366. 1:44:56behind this is, okay, cool. If we run
  3367. 1:44:58this and it goes here to the agent, then
  3368. 1:45:00the agent called its brain because
  3369. 1:45:02that's how it thinks, and it doesn't
  3370. 1:45:03work, then we just break the whole
  3371. 1:45:05[music] thing, right? And so, why don't
  3372. 1:45:06we add a step
  3373. 1:45:08in the middle where if it doesn't work
  3374. 1:45:10here, it then uses [music] a different
  3375. 1:45:12LLM to be able to try again. And so,
  3376. 1:45:14that's where we go in here, we turn this
  3377. 1:45:16on, and we start adding the fallback
  3378. 1:45:18agent [music] LLM. Now, the fallback
  3379. 1:45:19agent LLM, ideally, it would be a
  3380. 1:45:21different LLM because if OpenAI doesn't
  3381. 1:45:23work in that moment, it will probably
  3382. 1:45:25not work in that moment as well. Um so,
  3383. 1:45:27you want to make sure that you connect
  3384. 1:45:28it to another LLM,
  3385. 1:45:30and you will be able to then use this as
  3386. 1:45:33a fallback. So, if I go here, rename
  3387. 1:45:35this
  3388. 1:45:36fallback,
  3389. 1:45:38it will use this model right here in
  3390. 1:45:40case this one doesn't work. So, right
  3391. 1:45:41here, if I go inside
  3392. 1:45:44and I go to my connection,
  3393. 1:45:46and I just name it fail,
  3394. 1:45:48save.
  3395. 1:45:49Let's put an API key,
  3396. 1:45:51fake one.
  3397. 1:45:52Uh if I go out, I can see that now I
  3398. 1:45:54have a fake credential called fail,
  3399. 1:45:56which means that now it shouldn't work,
  3400. 1:45:58right? And so, if I go here to open
  3401. 1:46:00chat, I can say hello. This will now go
  3402. 1:46:02here, there's an error, and see how it
  3403. 1:46:04instantly talks to the next fallback LLM
  3404. 1:46:06to then give you an answer. Now, this is
  3405. 1:46:08great because a lot of the times, like I
  3406. 1:46:10mentioned, LLMs don't work, right? And
  3407. 1:46:12so, you want a some sort of fallback,
  3408. 1:46:15some sort of agent that they can rely on
  3409. 1:46:17if the first one doesn't work. It's sort
  3410. 1:46:18of like you're playing sports, you have
  3411. 1:46:20the main people and then the bench,
  3412. 1:46:21right? Which is me when I was younger.
  3413. 1:46:23And so, when we have the main guy who's
  3414. 1:46:25playing, and the main guy gets injured,
  3415. 1:46:27then it calls another guy, and then they
  3416. 1:46:29call me. But in this case, they call the
  3417. 1:46:30guy in the bench, and the guy in the
  3418. 1:46:31bench is a fallback LLM. All right, the
  3419. 1:46:33next one is called the error workflow.
  3420. 1:46:35So, this is what I meant by the other
  3421. 1:46:36way of doing this, [music] split error
  3422. 1:46:38route, because we actually set up a
  3423. 1:46:40completely new automation,
  3424. 1:46:42which receives
  3425. 1:46:44any error that comes from any automation
  3426. 1:46:46in our workspace, and then we can do
  3427. 1:46:47whatever we want. Now, this has to be a
  3428. 1:46:49separate automation. So, this is just
  3429. 1:46:51the automation that we're running now,
  3430. 1:46:52right? But [music] this will be a node
  3431. 1:46:55that we add in a different automation.
  3432. 1:46:57Now, the way to set this up is we need
  3433. 1:46:58to have a workflow. We have to activate
  3434. 1:47:01this, right here.
  3435. 1:47:03Once I activate this, all I have to do
  3436. 1:47:05is go, make a new workflow like this,
  3437. 1:47:07which has the error trigger. And again,
  3438. 1:47:09you can't activate this because it
  3439. 1:47:10doesn't let you, cuz this is already
  3440. 1:47:12activated. And I'll go here. You want to
  3441. 1:47:14go to settings. You then want to go
  3442. 1:47:16[music] and choose the error workflow,
  3443. 1:47:17which in this case is this, right? Which
  3444. 1:47:19is the workflow where the error trigger
  3445. 1:47:21node is here, and you just want to
  3446. 1:47:23attach to it. So, in this case, for
  3447. 1:47:24mine, it will be E with the R right
  3448. 1:47:26here. I can press save, and now what
  3449. 1:47:28happens is that I just connected this
  3450. 1:47:30automation
  3451. 1:47:32to the error workflow. So, that whenever
  3452. 1:47:33something wrong happens here, it sends
  3453. 1:47:35the data or sends a notification on the
  3454. 1:47:37other workflow. So, [music] let me test
  3455. 1:47:38it out. So, now let's say we go inside
  3456. 1:47:40here and we execute the step.
  3457. 1:47:42This should now work, right here. Should
  3458. 1:47:44give us a picture of a dog.
  3459. 1:47:46Right? Um and what we want to do here is
  3460. 1:47:50we want to make sure that this will run
  3461. 1:47:51now every 5 seconds. That's fine. Let me
  3462. 1:47:54make sure there's an error here.
  3463. 1:47:55It's a F.
  3464. 1:47:58Let me run this.
  3465. 1:47:59There's an error.
  3466. 1:48:00Okay, cool. Now, if I press save, this
  3467. 1:48:02will now run the workflow every 5
  3468. 1:48:04seconds, and it should now send a
  3469. 1:48:05notification to our workflow every 5
  3470. 1:48:07seconds because there's an error here.
  3471. 1:48:09So, if I go inside here,
  3472. 1:48:11I go to editor again,
  3473. 1:48:13just to refresh cuz you have to reload
  3474. 1:48:15the actual automation, you go to
  3475. 1:48:16executions.
  3476. 1:48:18I can see now that we have new errors
  3477. 1:48:21coming every single time. And on the one
  3478. 1:48:23end, it's a error, right? But on this
  3479. 1:48:25end, it's a success because that's what
  3480. 1:48:27this job of the error node does. Now,
  3481. 1:48:29because I'm actually paying for
  3482. 1:48:31executions, I'm going to
  3483. 1:48:32deactivate this.
  3484. 1:48:34But as you can see here, we now have a
  3485. 1:48:37bunch of different workflow executions
  3486. 1:48:39that we can then
  3487. 1:48:40>> [music]
  3488. 1:48:40>> use to then be able to send ourselves an
  3489. 1:48:42email, right? So, if I go in here,
  3490. 1:48:44I can see that I have the URL of the
  3491. 1:48:46workflow, the description,
  3492. 1:48:48which actually makes sense in plain
  3493. 1:48:50English,
  3494. 1:48:51that we can now use to actually build
  3495. 1:48:52out a workflow here. So, if I go to copy
  3496. 1:48:54the editor,
  3497. 1:48:56which means that it now pins the actual
  3498. 1:48:57output that we got from that run.
  3499. 1:49:00I can then go to Gmail.
  3500. 1:49:02I can send a message.
  3501. 1:49:04Obviously, connect to Gmail by going
  3502. 1:49:05here, press sign with Google.
  3503. 1:49:08And you'll be good to go. Message, send,
  3504. 1:49:10let's do my email. Let's do subject
  3505. 1:49:12line, which means
  3506. 1:49:14>> [music]
  3507. 1:49:14>> you can say error in workflow.
  3508. 1:49:17And then the email type, let's just do
  3509. 1:49:18text.
  3510. 1:49:20Cuz HTML is basically saying, "Hey,
  3511. 1:49:22let's make it look pretty." We don't
  3512. 1:49:23have to. [music] Saying, "Hey, Michele.
  3513. 1:49:26There was
  3514. 1:49:28an error in this [music] workflow."
  3515. 1:49:32So, URL.
  3516. 1:49:35You can put the URL here.
  3517. 1:49:36Error description.
  3518. 1:49:40And you can put the description [music]
  3519. 1:49:41here.
  3520. 1:49:41And you can go
  3521. 1:49:44level and you can do warning.
  3522. 1:49:46Just saying, "Hey, to what extent do we
  3523. 1:49:48have to worry about this?" You can just
  3524. 1:49:49do warning. [music] And now, what I can
  3525. 1:49:51do is I can run this. And in that case,
  3526. 1:49:54it will error out and it will send me an
  3527. 1:49:56email every single time with those
  3528. 1:49:58variables that change. And if I go to my
  3529. 1:49:59email, I can see here that I have error
  3530. 1:50:01in workflow. Saying, "Hey, Michele.
  3531. 1:50:03There was an error in this workflow.
  3532. 1:50:04The error description is this. The URL
  3533. 1:50:06is this." And if I actually go inside
  3534. 1:50:08the URL, it will take me directly
  3535. 1:50:11to the execution
  3536. 1:50:13of the error of the workflow.
  3537. 1:50:15Which is amazing, right? Because now we
  3538. 1:50:17can go here, we can try this again,
  3539. 1:50:20right? Where we basically tried it again
  3540. 1:50:21with with something that actually works.
  3541. 1:50:23>> [music]
  3542. 1:50:23>> And now we can rerun the execution to
  3543. 1:50:25make sure that we don't actually lose
  3544. 1:50:26the data of this. It's all here. So,
  3545. 1:50:28those are pretty much the only error
  3546. 1:50:30handling techniques that you need to
  3547. 1:50:31know inside of n8n to make sure that you
  3548. 1:50:34have a way to handle errors. Because
  3549. 1:50:36what you start to realize when you're
  3550. 1:50:37working with clients is that building it
  3551. 1:50:39for fun on a YouTube video like this and
  3552. 1:50:42building it for a client is a tiny bit
  3553. 1:50:43different. You want to make sure that
  3554. 1:50:45these actually work every single time.
  3555. 1:50:47Right? Because sometimes when we're
  3556. 1:50:48building it for fun, we don't think
  3557. 1:50:50about what if it goes wrong, right? We
  3558. 1:50:51just actually build it, it looks cool,
  3559. 1:50:53>> [music]
  3560. 1:50:53>> it works in that moment. But what if it
  3561. 1:50:55doesn't work? And that's when we use
  3562. 1:50:56these techniques, depending on your use
  3563. 1:50:58case, to be able to mitigate that error,
  3564. 1:51:00to be able to uh be safe when something
  3565. 1:51:02happens.
  3566. 1:51:06Hey, so in this video I'm going to show
  3567. 1:51:07you 30 n8n hacks that I wish I knew when
  3568. 1:51:09I got started that will help you make
  3569. 1:51:10your workflows at least three times
  3570. 1:51:11faster and save a ton of money on
  3571. 1:51:13execution. All these are hacks that I
  3572. 1:51:14had to learn the hard way over the
  3573. 1:51:16course of the past 12 months building
  3574. 1:51:18and selling automation to businesses. If
  3575. 1:51:19that sounds like something that you want
  3576. 1:51:21to improve on and learn, then this video
  3577. 1:51:22is for you. Let's dive in. So, the first
  3578. 1:51:24hack is actually software updates. So,
  3579. 1:51:26sometimes when you build automations on
  3580. 1:51:28n8n, and a lot of times when you watch
  3581. 1:51:30videos of people actually adding steps
  3582. 1:51:31to the automation, they go here and then
  3583. 1:51:33look in the app.
  3584. 1:51:34Sometimes you don't have any new
  3585. 1:51:35software. It's because n8n actually
  3586. 1:51:37updates a platform so that they're able
  3587. 1:51:39to add more and more nodes, more and
  3588. 1:51:41more actual executions or or stuff to
  3589. 1:51:43the platform so that you are able to
  3590. 1:51:45make your workflows more efficient. And
  3591. 1:51:47so, the thing you have to do, the way to
  3592. 1:51:48update your your workflow or your
  3593. 1:51:50account is to go to sign in. You'll be
  3594. 1:51:53brought to this page. All you want to do
  3595. 1:51:54here is you want to manage
  3596. 1:51:56You're going to go here and you want to
  3597. 1:51:57press the latest version. In this case,
  3598. 1:51:59this is a beta, so you might want to
  3599. 1:52:01press the one below or alpha or the
  3600. 1:52:03latest stable in this case, which is the
  3601. 1:52:05most stable version of n8n as of right
  3602. 1:52:07now that will help you build your
  3603. 1:52:08workflows in the current version. The
  3604. 1:52:10second hack is deactivating workflow.
  3605. 1:52:11So, let's say I have a workflow right
  3606. 1:52:13here triggered manually, have a HTTP
  3607. 1:52:15request, which talks to a server, and
  3608. 1:52:17then step after this is edit or set
  3609. 1:52:20fields. So, X equals Y.
  3610. 1:52:23Right? And then here, let's say I have
  3611. 1:52:26my website.
  3612. 1:52:28So, if I press execute step, now this
  3613. 1:52:29will scrape the website. Now,
  3614. 1:52:32let's say I run this whole workflow.
  3615. 1:52:33This will run this, this, and this
  3616. 1:52:34successfully. But let's say I had a
  3617. 1:52:36problem when I was running this. Let's
  3618. 1:52:37say I add some more stuff.
  3619. 1:52:39Now, if I execute workflow, this will
  3620. 1:52:40stop right here. And when we're building
  3621. 1:52:42automations on n8n and we want to
  3622. 1:52:43execute this even if this fails, then
  3623. 1:52:45all you have to do is press on the node
  3624. 1:52:47and press D. This way it deactivates the
  3625. 1:52:50node so that you're able to run even the
  3626. 1:52:51next step without this without this
  3627. 1:52:53influencing the decision itself. And
  3628. 1:52:55this stops It doesn't even consider this
  3629. 1:52:57node right here when it's running the
  3630. 1:52:58automation. So, if I execute workflow,
  3631. 1:53:00even though there's an error here, it
  3632. 1:53:01didn't run it and it will go to the next
  3633. 1:53:02step. The third hack is not really a
  3634. 1:53:03hack, but it's more so the fact that n8n
  3635. 1:53:05does not charge you for the amount of
  3636. 1:53:07test executions that you do when you're
  3637. 1:53:09testing the workflows. So, what I mean
  3638. 1:53:10by this is that we tested this, this,
  3639. 1:53:12and this. These are three different or
  3640. 1:53:14this is one execution. But if I go to
  3641. 1:53:16the admin panel, as you can see right
  3642. 1:53:18right now I have zero.
  3643. 1:53:19And if I run this across right now, I
  3644. 1:53:22also have zero again. Right? So, when
  3645. 1:53:24you're testing automations in n8n, the
  3646. 1:53:27the actual amount of executions that you
  3647. 1:53:28do or work for executions that you do
  3648. 1:53:29when you're testing does not count to
  3649. 1:53:31the amount that you have to pay every
  3650. 1:53:32single month. So, to show you when you
  3651. 1:53:33have to pay for something, I just added
  3652. 1:53:35a schedule trigger. I'm going to
  3653. 1:53:36activate this. So, now this is going to
  3654. 1:53:38run every 10 seconds. If I go here, I
  3655. 1:53:40can see that this is running right now
  3656. 1:53:43for two, three, four seconds. It's
  3657. 1:53:45successful. And if I go here to the
  3658. 1:53:46admin panel, I can refresh
  3659. 1:53:49and I can see that now I have one
  3660. 1:53:50execution out of the 2,500 that I have
  3661. 1:53:52every single month. So, this is more so
  3662. 1:53:54how n8n actually charges you on the
  3663. 1:53:55platform. Uh but just know that when
  3664. 1:53:57you're testing the automations, you are
  3665. 1:53:59not charged for the execution workflow
  3666. 1:54:01executions that you do on a testing
  3667. 1:54:02base. The next hack is actually pinning
  3668. 1:54:04data. So, let me remove this. Let me put
  3669. 1:54:06a trigger manually.
  3670. 1:54:07We have this.
  3671. 1:54:08Let's say I have to run this every
  3672. 1:54:09single time. You see how this may take
  3673. 1:54:1210 seconds, may take 15 seconds. And to
  3674. 1:54:14test this step, let's say I wanted to
  3675. 1:54:17to do all the data here.
  3676. 1:54:19Let me drag this across.
  3677. 1:54:21Now, if I drag this across, if I execute
  3678. 1:54:22the workflow,
  3679. 1:54:23the data here, the result that we get is
  3680. 1:54:25a result from the previous step.
  3681. 1:54:26And if I have to get these points of
  3682. 1:54:28data, I have to rerun the whole thing
  3683. 1:54:29over and over again. Well, not really,
  3684. 1:54:31because n8n just added the feature of uh
  3685. 1:54:33pinning data. So, you can go here and
  3686. 1:54:35actually pin the data so that we're able
  3687. 1:54:37to execute this workflow almost
  3688. 1:54:39instantly right here
  3689. 1:54:41without having to wait for these nodes
  3690. 1:54:43to run because we have test data to work
  3691. 1:54:44with. This is great when you have a
  3692. 1:54:46100-node workflow, when you have a lot
  3693. 1:54:47of steps. So, let's say I
  3694. 1:54:49copy-paste this
  3695. 1:54:51and have all these steps. So, let's say
  3696. 1:54:52now we have a four-step execution. If I
  3697. 1:54:55want to execute the workflow here, let's
  3698. 1:54:57say I wanted to get the data from the
  3699. 1:54:58HTTP without having to run it, I can use
  3700. 1:55:00the test data that we have in order to
  3701. 1:55:02actually get the data. In this case, the
  3702. 1:55:04HTTP was not run because of the fact
  3703. 1:55:06that it is pinned. But now when you want
  3704. 1:55:08to activate the scenario and you want to
  3705. 1:55:09get different data every single time
  3706. 1:55:10using the HTTP request, you want to
  3707. 1:55:13unpin this. And to do this, you can
  3708. 1:55:14press P again. So, you can pin and pin.
  3709. 1:55:16That's another hack. Another hack here
  3710. 1:55:18is actually something that a lot of
  3711. 1:55:19people underuse, which is the AI feature
  3712. 1:55:21on n8n. If I go here to ask the
  3713. 1:55:23assistant and ask it, "Hey,
  3714. 1:55:25n you or hey, how can we build
  3715. 1:55:27a human in the loop
  3716. 1:55:30agent?"
  3717. 1:55:31This AI assistant is one of the best
  3718. 1:55:33that I've seen on any automation
  3719. 1:55:34platform out there because what it does
  3720. 1:55:36is that it thinks It actually thinks
  3721. 1:55:37through what it needs to do, but then it
  3722. 1:55:38consults through the community, through
  3723. 1:55:40the documents first, and then the
  3724. 1:55:41community that has full of people who
  3725. 1:55:43actually uh engage with the community.
  3726. 1:55:45And as you can see, it says answer in
  3727. 1:55:46the community. So, it gives you three
  3728. 1:55:48different places that it pulls
  3729. 1:55:49information from. So, it gives you a
  3730. 1:55:50very, very contextual answer. And it
  3731. 1:55:52does actually help quite a lot when
  3732. 1:55:53you're building automations. Another
  3733. 1:55:54hack here is that when I go inside this,
  3734. 1:55:56for example, and I want to remove this
  3735. 1:55:57and I want to pull in data from the HTTP
  3736. 1:55:59request, usually I would have to drag
  3737. 1:56:01and drop this here.
  3738. 1:56:03As you can see, this is actually code.
  3739. 1:56:04So, if you can actually map this without
  3740. 1:56:06having to drag this across. All you have
  3741. 1:56:08to do is square bracket square bracket.
  3742. 1:56:10I can go dollar sign. I can then look
  3743. 1:56:12for the nodes that we have to reference.
  3744. 1:56:14In this case, hey, I want to get
  3745. 1:56:15information from the HTTP request node,
  3746. 1:56:17the edit fields node, or the other edit
  3747. 1:56:18fields node right here. Let's say I want
  3748. 1:56:20to do HTTP request.
  3749. 1:56:21I can then put dot and then I have this
  3750. 1:56:24option right here to do the item, which
  3751. 1:56:25is exactly the one that we want to do.
  3752. 1:56:27In this case, I can now still get the
  3753. 1:56:29output I got before without having to
  3754. 1:56:30drag and drop this. So, the next hack is
  3755. 1:56:32actually something that I've never seen
  3756. 1:56:33anyone say out on YouTube before, which
  3757. 1:56:35is the ability for us to add images on
  3758. 1:56:38our notes. So, notes are a way to
  3759. 1:56:39document your your automation. This I
  3760. 1:56:41think is one of the best uh things that
  3761. 1:56:42n8n actually put out, which is something
  3762. 1:56:44that are lacking in the other automation
  3763. 1:56:45platforms or the way that we have it set
  3764. 1:56:46up here. So, let's say I have a note and
  3765. 1:56:48I do
  3766. 1:56:49image one.
  3767. 1:56:51Now here, instead of putting text, which
  3768. 1:56:53you normally would,
  3769. 1:56:54right? You're not limited by text, but
  3770. 1:56:55you can also add images. So, the way to
  3771. 1:56:57add an image is to put an exclamation
  3772. 1:56:59mark. You do a square bracket.
  3773. 1:57:02This.
  3774. 1:57:03So, again. And now, you would have to
  3775. 1:57:05put the image URL right here. So, right
  3776. 1:57:08here we have an image URL, which you
  3777. 1:57:09have to put to then be able to see our
  3778. 1:57:11image here. So, let me pull in an image
  3779. 1:57:12that I have uh from the web. And so,
  3780. 1:57:15what I did is I actually took a
  3781. 1:57:16screenshot of this. I made it into a
  3782. 1:57:17public URL so anyone can access it. And
  3783. 1:57:19if I paste it, I can see now that I have
  3784. 1:57:21the image of this automation here. You
  3785. 1:57:23can imagine now this gives you a lot of
  3786. 1:57:25possibilities when you're documenting
  3787. 1:57:26things to actually add documents or add
  3788. 1:57:28document pictures or pictures, whatever
  3789. 1:57:29it is you have to put to add to the
  3790. 1:57:31documentation that you're putting for
  3791. 1:57:32other people to look at your
  3792. 1:57:33automations. Also, the next hack is an
  3793. 1:57:35error handling hack. So, if I go here,
  3794. 1:57:37delete this.
  3795. 1:57:38And let's say I have a set node behind
  3796. 1:57:41or before this. Let me do
  3797. 1:57:43copy and paste. Another hack right
  3798. 1:57:45there.
  3799. 1:57:47Paste this and I say I do I give it JM
  3800. 1:57:49Solutions
  3801. 1:57:51.com. So, now I want to pull this
  3802. 1:57:52variable and put it in here.
  3803. 1:57:55Drag this across.
  3804. 1:57:56So, then now this is basically scraping
  3805. 1:57:58whatever It's actually trying to access
  3806. 1:58:00anything that I put here.
  3807. 1:58:01Let's say I run this.
  3808. 1:58:02Now, I get an invalid URL right here
  3809. 1:58:05because this right here does not have an
  3810. 1:58:07HTTP
  3811. 1:58:08HTTPS, which which is which is what we
  3812. 1:58:10need in order for us to actually run
  3813. 1:58:12this. Now, let's say I go here and I go
  3814. 1:58:14to executions. I can see that here we
  3815. 1:58:17have an execution telling us, "Hey, you
  3816. 1:58:18ran this. There was an error." So,
  3817. 1:58:20there's two things we actually can do.
  3818. 1:58:21The first one is debug in editor. So, we
  3819. 1:58:23are able to access the way that the
  3820. 1:58:25workflow was when it erred, which is
  3821. 1:58:27great because now we can see exactly
  3822. 1:58:28what it is that the input was, what is
  3823. 1:58:30the output.
  3824. 1:58:31But also, the thing we can do is press
  3825. 1:58:33this button right here, which is retry
  3826. 1:58:35with currently saved workflow. So, what
  3827. 1:58:36this means is that you run a workflow,
  3828. 1:58:37so you run an automation. In this case,
  3829. 1:58:39it's this. Let's say it errors out. You
  3830. 1:58:41want to try again with the same data
  3831. 1:58:42that we had so we don't lose different
  3832. 1:58:44things. Let's say we had a Google Sheet
  3833. 1:58:45that was running every single day and it
  3834. 1:58:47count the the most recent 100 rows.
  3835. 1:58:49Let's say one row failed. You still want
  3836. 1:58:51to execute that same row even if it
  3837. 1:58:53failed because it is important to us
  3838. 1:58:54because it's still a data point that we
  3839. 1:58:55want to process. The next hack is
  3840. 1:58:57actually a switch mode. Go here to edit
  3841. 1:59:00node and I put X equals Y. This is just
  3842. 1:59:03something that we put just to test. Now,
  3843. 1:59:05the next step can actually be a switch
  3844. 1:59:07node
  3845. 1:59:08right here.
  3846. 1:59:09So, a switch node allows us to do
  3847. 1:59:10different things.
  3848. 1:59:11The The first thing that allows us to do
  3849. 1:59:13is to basically send the automation
  3850. 1:59:14different ways based on where we want it
  3851. 1:59:16to go and based on different criteria.
  3852. 1:59:17So, in this case, we have routing rules.
  3853. 1:59:19So, this means, "Hey, if this equals
  3854. 1:59:21that, then send it this way. If that
  3855. 1:59:22equals this, then send it this way." So,
  3856. 1:59:24we say we had a very easy sort of thing.
  3857. 1:59:27Add routing rule.
  3858. 1:59:29The
  3859. 1:59:30Or in this case, let's actually do a
  3860. 1:59:31different step. So, let's say we had
  3861. 1:59:33this
  3862. 1:59:34equals to y
  3863. 1:59:36and this
  3864. 1:59:37equals to x.
  3865. 1:59:39Right? So, in this case now, if I run
  3866. 1:59:41this, and again, this is called the 01,
  3867. 1:59:44I can run this, and it will send it this
  3868. 1:59:45way because this is
  3869. 1:59:47set to y. Right? And the second thing
  3870. 1:59:50was y. So, there's actually one hack
  3871. 1:59:51that we can do here because we can
  3872. 1:59:53rename the output. So, right here,
  3873. 1:59:55instead of having 0 and 1, we can have
  3874. 1:59:58this is x
  3875. 2:00:00or this is y in this case.
  3876. 2:00:02And here, I can have this is x.
  3877. 2:00:05So, that here, I can see that this is
  3878. 2:00:07This is y, and this is This is x. Which
  3879. 2:00:09is amazing when we're trying to uh Let's
  3880. 2:00:11say we get emails. We get an email that
  3881. 2:00:12we get. And let's say that if the email
  3882. 2:00:15contained something in the subject line,
  3883. 2:00:16it was a support email or a FAQ email or
  3884. 2:00:19something email, then we would rename
  3885. 2:00:20this with support, Q&A, or something
  3886. 2:00:23else, right? And it's amazing because it
  3887. 2:00:24allows us to visually see exactly what's
  3888. 2:00:26happening in the workflow.
  3889. 2:00:27All right. So, the next one is actually
  3890. 2:00:29the N8N attributions. So, if I go to
  3891. 2:00:31Gmail and I send myself an email, so
  3892. 2:00:32let's do send a message.
  3893. 2:00:34Let's put my email.
  3894. 2:00:38Do hello.
  3895. 2:00:40Hey there.
  3896. 2:00:41And I run this,
  3897. 2:00:42this will use my email to send my
  3898. 2:00:43emails. So, if I go here, I can see that
  3899. 2:00:45on the email itself, it says, "This
  3900. 2:00:47email was sent automatically with N8N."
  3901. 2:00:49Now, ideally, we don't have this or we
  3902. 2:00:50don't want to have this when we're using
  3903. 2:00:51it for businesses we're sending email to
  3904. 2:00:53clients because you want it to feel more
  3905. 2:00:54personal, and we don't want to exactly
  3906. 2:00:56say this is an automation, right? So,
  3907. 2:00:57what we do here is actually remove the
  3908. 2:00:59uh N8N attribution. So, if I go back
  3909. 2:01:01here,
  3910. 2:01:02and I go to add options, I can see that
  3911. 2:01:04I have append N8N attributions. If I
  3912. 2:01:06turn this off,
  3913. 2:01:07now if I rerun the automation, you can
  3914. 2:01:09see they got another email from Michele
  3915. 2:01:11James Solutions, but now there was no
  3916. 2:01:13N8N attribution. There was no, "Hey, N8N
  3917. 2:01:15sent this."
  3918. 2:01:16So, that we can actually send emails
  3919. 2:01:17that feel more personal that doesn't I
  3920. 2:01:18don't tell them, "Hey, N8N sent this. We
  3921. 2:01:20have an automation set up." Um so, you
  3922. 2:01:22can actually use it for your own
  3923. 2:01:23clients. So, the next hack is actually
  3924. 2:01:24on N8N forms, and it's the way that we
  3925. 2:01:26actually design the forms. So, if I go
  3926. 2:01:27in here and I want to execute the
  3927. 2:01:28workflow, and I want to Let's say test
  3928. 2:01:30the form. We can see that we have this
  3929. 2:01:32color right here. We have this font,
  3930. 2:01:34this color, this layout, which is
  3931. 2:01:36standard for N8N. But, what if you had a
  3932. 2:01:38company that wanted something with their
  3933. 2:01:39own brand colors that we can send to
  3934. 2:01:40clients that makes the client feel more
  3935. 2:01:43more aligned with or more in vision with
  3936. 2:01:45with the company itself. We can actually
  3937. 2:01:46customize it. So, to do that, we can add
  3938. 2:01:48an option. We can go to custom form
  3939. 2:01:50styling, and it gives you this code
  3940. 2:01:51right here.
  3941. 2:01:52So, if we copy this, and we go to
  3942. 2:01:54ChatGPT, and we say, "Can you also or
  3943. 2:01:56can you
  3944. 2:01:58or this is the N8N
  3945. 2:02:00um general
  3946. 2:02:02styling
  3947. 2:02:04form styling code. I want the
  3948. 2:02:07general
  3949. 2:02:08color and theme
  3950. 2:02:10to be blue.
  3951. 2:02:11To be light blue.
  3952. 2:02:13Again, this you substitute this with
  3953. 2:02:14anything that the client has like brand
  3954. 2:02:16colors and so on.
  3955. 2:02:18So, now we let ChatGPT run. And this is
  3956. 2:02:20all within CSS, which is just a way of
  3957. 2:02:22programming language that allows us to
  3958. 2:02:23change the design of things. All right.
  3959. 2:02:25So, it just finished. And by the way, uh
  3960. 2:02:27this right here, when you see hashtag
  3961. 2:02:29something something something, it just
  3962. 2:02:30says blue color. White, blue, uh blue,
  3963. 2:02:33and very light blue. These right here
  3964. 2:02:35represent colors. So, if I copy this,
  3965. 2:02:37and I go back to N8N,
  3966. 2:02:39I can paste it here. And if I want to
  3967. 2:02:41execute the step,
  3968. 2:02:42I now see that the form is in my brand
  3969. 2:02:44colors. It's blue. And you can do
  3970. 2:02:45whatever you want with it. You can
  3971. 2:02:46obviously customize the background and
  3972. 2:02:47so on. But, this adds that little touch
  3973. 2:02:49to us actually being able to customize
  3974. 2:02:51the form for whatever we want for our
  3975. 2:02:52brand colors. All right. So, the next
  3976. 2:02:54hack is on a schedule trigger. So, we
  3977. 2:02:56use the schedule trigger when we want to
  3978. 2:02:57run the automation maybe once a day,
  3979. 2:02:59once once a year, uh every second, every
  3980. 2:03:01whatever it is. Right? But, now we can
  3981. 2:03:03actually customize it even more as in
  3982. 2:03:05the time triggers like when it actually
  3983. 2:03:06runs. If you go here to trigger
  3984. 2:03:09interval. So, this is you want to run it
  3985. 2:03:10every second, minutes, hours, days,
  3986. 2:03:12weeks, and months. We can actually do a
  3987. 2:03:13custom cron. So, cron is a way that we
  3988. 2:03:15express time. So, if I go here to
  3989. 2:03:18documentation,
  3990. 2:03:19I can see that now
  3991. 2:03:21I have a lot more a lot more options.
  3992. 2:03:23You can do a custom. So, we can do it
  3993. 2:03:25every day at 2:00 a.m.
  3994. 2:03:26And I can copy this, and then paste it
  3995. 2:03:28here.
  3996. 2:03:30And this signifies every day at 2:00
  3997. 2:03:32a.m.
  3998. 2:03:33And it tells you that second, minute,
  3999. 2:03:34hour, day of the month, month, day of
  4000. 2:03:36the week. And this right here is a very
  4001. 2:03:37custom way that you can uh obviously run
  4002. 2:03:39your automations. But, I think it's
  4003. 2:03:40really really cool that we get to that
  4004. 2:03:41we're able to run automations whenever
  4005. 2:03:43we want in a very very custom order. I
  4006. 2:03:44mean, we have a ton, right? We have
  4007. 2:03:46every midnight, every Sunday, every
  4008. 2:03:48Thursday, once a week. This gives us a
  4009. 2:03:50lot more flexibility when we're building
  4010. 2:03:51automations. All right. So, the next
  4011. 2:03:53hack is actually on the workflow and the
  4012. 2:03:54way that data actually moves in the the
  4013. 2:03:55sequential order that it moves. So, an
  4014. 2:03:57example here is when we have an execute
  4015. 2:03:59workflow, and let's say we have a series
  4016. 2:04:00of steps.
  4017. 2:04:01But, we have two ways that the
  4018. 2:04:02automation can go through it. And it
  4019. 2:04:03will go through the two ways because we
  4020. 2:04:05have no filter involved. But, which one
  4021. 2:04:07does it do first? Well, in this case, if
  4022. 2:04:09I execute the workflow,
  4023. 2:04:10you can see that it goes up here first,
  4024. 2:04:12and then waits 3 seconds cuz I wanted to
  4025. 2:04:13show you that. Uh it then does
  4026. 2:04:14everything. So, this runs the workflow
  4027. 2:04:16that is actually on the top. So, if
  4028. 2:04:18again, if I put this to the top, we can
  4029. 2:04:20see that now it executes this first.
  4030. 2:04:23And this applies for anything that you
  4031. 2:04:24do. In case you have three, in case you
  4032. 2:04:25have four, in case you have five. So, if
  4033. 2:04:26you're wondering why your workflows are
  4034. 2:04:27running the way they are in the
  4035. 2:04:28sequential order, just know that it
  4036. 2:04:30runs. The first workflow that it runs is
  4037. 2:04:32the first uh is the one on the top, and
  4038. 2:04:33then it goes uh obviously on a worker
  4039. 2:04:35level on a lateral level until the end.
  4040. 2:04:37All right. So, the next hack is actually
  4041. 2:04:38on the webhooks. So, if I go here to
  4042. 2:04:40webhooks,
  4043. 2:04:42I can see that we have a test URL and a
  4044. 2:04:43production URL. This is the exact same
  4045. 2:04:45that we have on forms within N8N. And
  4046. 2:04:47just know that the test URL is only used
  4047. 2:04:48when you're testing the automations. And
  4048. 2:04:50once you set them to active, so once you
  4049. 2:04:52press this button right here,
  4050. 2:04:54activate this. Now, this will now you
  4051. 2:04:57have to change the production URL.
  4052. 2:04:59Right? You have to change the URL that
  4053. 2:05:00you're using for the external server
  4054. 2:05:01that we have to use uh when you're
  4055. 2:05:03putting it to active. So, just know that
  4056. 2:05:04test URL is when you're testing,
  4057. 2:05:05production URL is when the automation is
  4058. 2:05:07active. All right. So, the next hack is
  4059. 2:05:09actually calling another workflow within
  4060. 2:05:10a workflow. So, let's say I have an
  4061. 2:05:12automation right here, and then have x =
  4062. 2:05:14y, right? It's good. And now, the next
  4063. 2:05:17step can actually be calling another
  4064. 2:05:18workflow to do something and then giving
  4065. 2:05:19us the data. So, let's say I have
  4066. 2:05:22execute uh sub workflow,
  4067. 2:05:24which is the action that we want to do.
  4068. 2:05:26Now, it's asking us to source the data
  4069. 2:05:27as which is fine. And then it's asking
  4070. 2:05:28us which workflow do you want to call in
  4071. 2:05:30order to to send the data and actually
  4072. 2:05:31execute before getting the data back.
  4073. 2:05:34So, if I go here, I can actually create
  4074. 2:05:36an uh sub workflow. So, I can go
  4075. 2:05:37workflow, personal
  4076. 2:05:39in this case. And now, I start from
  4077. 2:05:40scratch. So, this right here,
  4078. 2:05:42the trigger will be when executed by
  4079. 2:05:44another workflow.
  4080. 2:05:45Let's leave this to all
  4081. 2:05:47accept all data, which means that it
  4082. 2:05:47sends everything. And now, let's say I
  4083. 2:05:49do
  4084. 2:05:50edit field.
  4085. 2:05:52Do hello.
  4086. 2:05:54I say, "My name
  4087. 2:05:55is Michele."
  4088. 2:05:58Let's say I do wait.
  4089. 2:06:00I wait 5 seconds before we send the data
  4090. 2:06:01back.
  4091. 2:06:02So, let me save this. As you can see, we
  4092. 2:06:04already can't activate this because it
  4093. 2:06:06always runs whenever it's called. But,
  4094. 2:06:08here I can then Let me name this
  4095. 2:06:11hello world.
  4096. 2:06:14I can now go here, and I can choose
  4097. 2:06:15hello world to be the workflow that's
  4098. 2:06:18executed that sent the data to be for we
  4099. 2:06:20get the data back. So, in this case, if
  4100. 2:06:22I execute it, I can see that it's
  4101. 2:06:23running
  4102. 2:06:24because it takes 5 seconds, of course. I
  4103. 2:06:25mean, we have this step right here, and
  4104. 2:06:27then it waits 5 seconds, and then sends
  4105. 2:06:28it back.
  4106. 2:06:29I go here, I can see that we have the
  4107. 2:06:30data back, which is My name is Michele.
  4108. 2:06:32So, this right here, what it did is that
  4109. 2:06:33it sent the data to the workflow, and
  4110. 2:06:35then got it back, and now I can move on
  4111. 2:06:37to the next steps.
  4112. 2:06:38If I go here, I can see that executions.
  4113. 2:06:40So, this was successful, and then it
  4114. 2:06:41sent the data back. So, this is great
  4115. 2:06:43when you're building automations because
  4116. 2:06:44of the fact that when you build a linear
  4117. 2:06:46workflow, which means that it follows a
  4118. 2:06:47very specific process, and it's just one
  4119. 2:06:48line, you can't actually add more
  4120. 2:06:50automations here unless you actually
  4121. 2:06:51call them, right? So, in this case, this
  4122. 2:06:53sort of acts as an AI agent, um which is
  4123. 2:06:56similar to make.com's AI agent in the
  4124. 2:06:57sense that it actually calls workflows,
  4125. 2:07:00uh predefined workflows, and it gets the
  4126. 2:07:02data back. All right. So, the next hack
  4127. 2:07:03is actually using a loop over items. So,
  4128. 2:07:05in this case, we have an automation that
  4129. 2:07:06starts with a list of YouTube channels.
  4130. 2:07:08It then lists all the videos and it
  4131. 2:07:09scripts the comments from these videos
  4132. 2:07:10in order for us to actually be able to
  4133. 2:07:12know exactly what people want and in
  4134. 2:07:14order for us to have a database full of
  4135. 2:07:15content ideas and hooks and outlines
  4136. 2:07:17that we can use to generate content for
  4137. 2:07:19us. By the way, if you want to watch a
  4138. 2:07:20full video, check it out right here. And
  4139. 2:07:21so, right here, when we go to Apify,
  4140. 2:07:23Apify is scraping all the comments. But,
  4141. 2:07:25in this case, it gives us 505 comments,
  4142. 2:07:27which we then have to send to AI. Now,
  4143. 2:07:29typically with AI, it doesn't actually
  4144. 2:07:31take in or in this case, ChatGPT, it
  4145. 2:07:33can't take so much context. It can't
  4146. 2:07:34take everything at once. Because the way
  4147. 2:07:36that N8N works is that we have different
  4148. 2:07:38items. So, in this case, it's 505 items,
  4149. 2:07:41which are different comments in this
  4150. 2:07:42case.
  4151. 2:07:43Right? Different comments. This will run
  4152. 2:07:45through all the different comments at
  4153. 2:07:46once. And so, what we do here is
  4154. 2:07:48actually use a loop over items, which I
  4155. 2:07:49can find
  4156. 2:07:50right here. Loop over items. Split in
  4157. 2:07:52batches.
  4158. 2:07:53And we tell it, "Hey, only send 50
  4159. 2:07:55through
  4160. 2:07:56until and run this whole thing until
  4161. 2:07:58here,
  4162. 2:07:59and then send it back." So, we use this
  4163. 2:08:01right here
  4164. 2:08:02to loop it all back until we get the
  4165. 2:08:04other 50, and we get the other 50, and
  4166. 2:08:06the other 50 until the 505 is finished.
  4167. 2:08:09This is great because we're sort of
  4168. 2:08:10splitting the automation up into
  4169. 2:08:12different items so that the automation
  4170. 2:08:14can run the first step, go back, run set
  4171. 2:08:18amount of items. In this case, it's 50.
  4172. 2:08:19It can be 30. It can be 100, 150. Um
  4173. 2:08:22but, in this case, we want to keep it at
  4174. 2:08:2250 so that AI is actually able to uh to
  4175. 2:08:25cover all of those. All right. So, the
  4176. 2:08:26next hack is actually within testing AI
  4177. 2:08:28agents because whenever you want to test
  4178. 2:08:30any agent, you assume that you need to
  4179. 2:08:32get have an input. There has to be an
  4180. 2:08:33input for the agent to think through
  4181. 2:08:34what you just asked it and then give you
  4182. 2:08:35an answer back. But, what if I wanted to
  4183. 2:08:37test only this part, and I didn't want
  4184. 2:08:38to chat with it every single time in
  4185. 2:08:40order for it to actually run? Well, in
  4186. 2:08:41this case, let's say I do hello.
  4187. 2:08:43You see how now, because of the input,
  4188. 2:08:45it then does its thing. If I go here, I
  4189. 2:08:47can now pin the data so I don't have to
  4190. 2:08:49keep chatting to it every single time in
  4191. 2:08:50order for the actual agent to run. But,
  4192. 2:08:52bear in mind the data that goes through
  4193. 2:08:54the input will be the chat input, which
  4194. 2:08:56is hello.
  4195. 2:08:57Another hack that you can do is actually
  4196. 2:08:58press this button right here, so you can
  4197. 2:09:00manipulate the input. In this case,
  4198. 2:09:01let's do how's the weather
  4199. 2:09:04in Rome?
  4200. 2:09:06And save it. So, now the input changed,
  4201. 2:09:08and that's what it's going to be fed
  4202. 2:09:09into the agent every single time. So, if
  4203. 2:09:11I go here, I cannot only test this step
  4204. 2:09:14because this is pinned. I don't have to
  4205. 2:09:15chat with it every single time, which
  4206. 2:09:17makes testing so much easier. The next
  4207. 2:09:19hack is actually something that I was
  4208. 2:09:20wondering when I was building AI agents
  4209. 2:09:21myself because I thought, "Okay, we we
  4210. 2:09:23chat with it on N8N right here, but what
  4211. 2:09:25if I want to activate this to a client?"
  4212. 2:09:28Right? Do I have to always use Telegram
  4213. 2:09:29or WhatsApp or Slack, whatever it is?
  4214. 2:09:31Can't I just use something inside of
  4215. 2:09:33N8N, a link that someone can use for a
  4216. 2:09:34chatbot? Well, the answer is yes.
  4217. 2:09:36Because if I go here,
  4218. 2:09:38and I go to make chat publicly
  4219. 2:09:40available, if I copy this, and by the
  4220. 2:09:42way, you have to activate that scenario
  4221. 2:09:43first, so you have to activate this.
  4222. 2:09:45Activated.
  4223. 2:09:46And I paste this in the web. Now, I can
  4224. 2:09:48actually chat to the AI agents. If I
  4225. 2:09:50say, "Hello."
  4226. 2:09:52What it will do is that it will think
  4227. 2:09:53through the AI agents. So, if I go back
  4228. 2:09:55here, I go to executions, I can now see
  4229. 2:09:58that we just chatted with, and the input
  4230. 2:10:00was hello, right? And and so, you can
  4231. 2:10:03actually chat to this. This would be the
  4232. 2:10:04link that you share with the client
  4233. 2:10:06whenever they have to talk to it, or
  4234. 2:10:07whenever you have to talk to it as a way
  4235. 2:10:09to have a personal assistant without
  4236. 2:10:10having to rely on Telegram or Slack or
  4237. 2:10:11WhatsApp, whatever it is. So, the next
  4238. 2:10:13hack is actually being able to connect
  4239. 2:10:14an AI agent to another AI agent. So,
  4240. 2:10:16let's say I go to tool, and I go to
  4241. 2:10:18agent AI agent tool, I can now see that
  4242. 2:10:20I have the a possibility to connect the
  4243. 2:10:22AI agent to another AI agent right here.
  4244. 2:10:24This right here is an example of a
  4245. 2:10:26workflow, an assistant that I built that
  4246. 2:10:28uses this exact feature of calling
  4247. 2:10:30sub-agents within the main agent. Sort
  4248. 2:10:32of like this is the CEO of the company,
  4249. 2:10:34and these are the head of departments,
  4250. 2:10:36and the head of departments talk to the
  4251. 2:10:37employees which actually do the exact
  4252. 2:10:38task. But, this is great because
  4253. 2:10:40previously we actually had to make an AI
  4254. 2:10:42agent somewhere else, and then be able
  4255. 2:10:43to call it on a different workflow, and
  4256. 2:10:45then send the data back. But, in this
  4257. 2:10:46case, we can all do it in the same
  4258. 2:10:47place. And again, the way to set it up
  4259. 2:10:49is to go to tool, put the AI agent tool,
  4260. 2:10:51and then you can simply do the same
  4261. 2:10:52thing that you do here. You can put a
  4262. 2:10:53chat model. In this case, let's do
  4263. 2:10:55OpenAI.
  4264. 2:10:57You can do the memory. This is this
  4265. 2:10:58here. And now you connect it to any tool
  4266. 2:11:00that you want, right? In this case, it
  4267. 2:11:01can be whatever. It can be Gmail
  4268. 2:11:03here, and so on.
  4269. 2:11:05And the way to actually know whether it
  4270. 2:11:06sends it here is to be able to give it a
  4271. 2:11:08prompt.
  4272. 2:11:10You tell it, "Hey, only execute this, or
  4273. 2:11:12this is the data that you're going to
  4274. 2:11:13get, and do XYZ."
  4275. 2:11:14Just like a general agent would. All
  4276. 2:11:16right. So, the next hack is actually
  4277. 2:11:17prompting the AI agent in a very
  4278. 2:11:19specific way. So, if I go here, I know
  4279. 2:11:21that every AI agent has a system
  4280. 2:11:22message, which is a message or prompt
  4281. 2:11:24that we tell the AI agent whenever we
  4282. 2:11:26want to give it instructions. So,
  4283. 2:11:27typically the way they would look is we
  4284. 2:11:28have
  4285. 2:11:30overview,
  4286. 2:11:31which is an overview of what it needs to
  4287. 2:11:32do. Then we have tools. And the way the
  4288. 2:11:34reason why we actually use these
  4289. 2:11:36hashtags is to give it a It's called
  4290. 2:11:38markdown formatting. So, this is heading
  4291. 2:11:39two, this is heading one, this is
  4292. 2:11:41heading three. In this case, we can
  4293. 2:11:42leave it at heading two.
  4294. 2:11:44And then we also have rules.
  4295. 2:11:46And something that people don't even put
  4296. 2:11:47whenever they're using AI agents. Let's
  4297. 2:11:49say the AI agent was connected to a
  4298. 2:11:50calendar, and we say, "Hey, can you make
  4299. 2:11:52an event for tomorrow?"
  4300. 2:11:53How does it know today's date? Well,
  4301. 2:11:55that's the thing about AI because it
  4302. 2:11:56doesn't actually remember today's date.
  4303. 2:11:57Let me show you. So, if I go here, and I
  4304. 2:11:59have no prompt in this case,
  4305. 2:12:02and I ask it, "Hey,
  4306. 2:12:04what's today's date?"
  4307. 2:12:08You see that it says, "Hey, today's date
  4308. 2:12:09is April 27th, 2024." Well, today is
  4309. 2:12:11actually 4th of September, 2025. So, we
  4310. 2:12:14know that AI is actually not that good
  4311. 2:12:15remembering dates, which is crucial
  4312. 2:12:17because usually we have tools like
  4313. 2:12:19Google Calendar or Gmail, and when we
  4314. 2:12:21have to say different dates, let's say
  4315. 2:12:23we say, "Hey, send a meeting for
  4316. 2:12:24tomorrow." or "Schedule a meeting for
  4317. 2:12:26next week." We want to be able for the
  4318. 2:12:27AI agent to know when today's date is so
  4319. 2:12:29that it can contextualize it when we say
  4320. 2:12:31it tomorrow or next week, whatever it
  4321. 2:12:32is. So, to actually fix that, we go here
  4322. 2:12:34to the system message.
  4323. 2:12:36We say,
  4324. 2:12:37"Today's date." This is going to be at
  4325. 2:12:39the end of the each prompt. So, we have
  4326. 2:12:40the overview, we have the rules, tools,
  4327. 2:12:41and all that stuff. And then we say,
  4328. 2:12:42"Today's date." Then you put curly
  4329. 2:12:44bracket, curly bracket, you put a nest
  4330. 2:12:45dollar,
  4331. 2:12:46and then you put now right here. Now,
  4332. 2:12:48this right here is going to be fed into
  4333. 2:12:50the AI agent every single time as an
  4334. 2:12:51extra so that it remembers today's date.
  4335. 2:12:53So, now if I ask it,
  4336. 2:12:55"Hey,
  4337. 2:12:56what is today's date?"
  4338. 2:12:59Because it knows the date, it can say
  4339. 2:13:01September 4th, 2025. So, this makes a
  4340. 2:13:02difference because again, when you have
  4341. 2:13:04calendar tools, you want to know exactly
  4342. 2:13:05when today's date is to be able to
  4343. 2:13:06contextualize it for next week or next
  4344. 2:13:08month, or whatever. All right. So, the
  4345. 2:13:09next hack is actually using a GPT that
  4346. 2:13:12Chris Roberts, I don't know who he is,
  4347. 2:13:13uh but he made a GPT that actually works
  4348. 2:13:15pretty well when you want to debug or
  4349. 2:13:17need help with automations. Now, I
  4350. 2:13:18mentioned that you can go and talk to
  4351. 2:13:19the AI right here, the AI assistant,
  4352. 2:13:21which pulls from the community, which
  4353. 2:13:23pulls from from different places, which
  4354. 2:13:24is amazing, but it doesn't actually
  4355. 2:13:26solve everything. So, in this case, I
  4356. 2:13:28use this GPT, I give it a picture,
  4357. 2:13:30whatever it is, some sort of voice, even
  4358. 2:13:31if you want to ask it, "Hey, I want to
  4359. 2:13:32build this automation." It actually does
  4360. 2:13:34a pretty good job. Now, I'm going to
  4361. 2:13:35leave the link down below. Again, this
  4362. 2:13:37is not mine. I'm not affiliated with
  4363. 2:13:38anything here. I actually genuinely use
  4364. 2:13:40this, and I think this is actually
  4365. 2:13:41pretty good GPT. All right. So, the next
  4366. 2:13:42hack is actually within the HTTP request
  4367. 2:13:44and the way that we actually set up
  4368. 2:13:45APIs. So, sometimes when we want to add
  4369. 2:13:48an app, let's say I go to on app event,
  4370. 2:13:50and I want to look for an app, but it's
  4371. 2:13:51not here. I then have to go to Google
  4372. 2:13:53and search up the app name, the software
  4373. 2:13:55name. Let's say ClickUp, and we search
  4374. 2:13:56up ClickUp API documentation. And we get
  4375. 2:13:59on this page. Now, this page is an API
  4376. 2:14:00documentation. It's a very follows a
  4377. 2:14:02very standard way of that it looks. We
  4378. 2:14:05have different requests, we have the
  4379. 2:14:06summary of the request, and then we have
  4380. 2:14:07something called a curl. And this curl
  4381. 2:14:09right here is something that previously
  4382. 2:14:10we had to manually paste into the HTTP
  4383. 2:14:12request because we have the URL, which
  4384. 2:14:14in this case is the one here.
  4385. 2:14:17We have the headers, which is the one
  4386. 2:14:19here.
  4387. 2:14:20Send headers.
  4388. 2:14:21Uh and we have the body in this case,
  4389. 2:14:22which is not here. But, now we can
  4390. 2:14:25actually copy this, and we can go back
  4391. 2:14:26here, and we can import curl, we can
  4392. 2:14:28paste this, and we can import it.
  4393. 2:14:30So, then now we don't have to know
  4394. 2:14:31exactly where things have to go at each
  4395. 2:14:33time. We can just worry about sending
  4396. 2:14:35the data that we actually need to send,
  4397. 2:14:36and not setting things up on HTTP
  4398. 2:14:37request. Now, one more thing is that a
  4399. 2:14:39lot of the times when you have to use a
  4400. 2:14:40software like ClickUp or other softwares
  4401. 2:14:42as well, we have to use something called
  4402. 2:14:43an API key. Now, this is a key that we
  4403. 2:14:46use to say, "Hey, this is my access
  4404. 2:14:48token. This is my password. You can
  4405. 2:14:50access it." Right? And most of the
  4406. 2:14:52times, the way that we actually use API
  4407. 2:14:53keys is by adding them here. So, we do
  4408. 2:14:55API key, and this is not always
  4409. 2:14:57standard. And then we have to put some
  4410. 2:14:59long code that, you know, signifies a
  4411. 2:15:02password. But, in this case, instead of
  4412. 2:15:04putting it here every single time, or
  4413. 2:15:05here, you can go to generic credential
  4414. 2:15:06type, we then can go to bearer off right
  4415. 2:15:09here,
  4416. 2:15:10and we can create a new credential. In
  4417. 2:15:11this case, it can be the actual API key
  4418. 2:15:14that you're using
  4419. 2:15:15right here.
  4420. 2:15:16And now you can name it whatever you
  4421. 2:15:17want.
  4422. 2:15:19ClickUp.
  4423. 2:15:20Let's save.
  4424. 2:15:21And now you're able to actually access
  4425. 2:15:23the API key every single time, or the
  4426. 2:15:24HTTP request is able to access the API
  4427. 2:15:27key here. Uh and whenever you have to
  4428. 2:15:28use ClickUp, all you have to go is here.
  4429. 2:15:30You can use ClickUp, and you don't have
  4430. 2:15:31to re-add the API key here. Now, the
  4431. 2:15:34next hack is actually batching. So, a
  4432. 2:15:36lot of the times when we do HTTP request
  4433. 2:15:37to a server, uh the server actually has
  4434. 2:15:40limits. So, let's say Airtable has a
  4435. 2:15:41limit of I think it was 100 requests per
  4436. 2:15:44minute or something like that, and the
  4437. 2:15:45HTTP request sometimes can go over that.
  4438. 2:15:47So, for us to actually limit the amount
  4439. 2:15:49of requests that we send to the server
  4440. 2:15:51for a amount of time, we can go down
  4441. 2:15:52here,
  4442. 2:15:53add options, we can go to batching, and
  4443. 2:15:55now we can add we only want to send 50
  4444. 2:15:57items per this interval. In this case,
  4445. 2:15:59it's 1 second. 50 items per 1 second.
  4446. 2:16:02And so, you have to obviously look at
  4447. 2:16:03the limit uh the API limit of that the
  4448. 2:16:06platform has, but this allows us to be
  4449. 2:16:07more flexible and navigate errors
  4450. 2:16:10because a lot of the times we know
  4451. 2:16:11there's errors when we send too many
  4452. 2:16:12requests to the to the actual platform
  4453. 2:16:14cuz they have a restriction. And in this
  4454. 2:16:15case, we say, "Hey, only send 50 through
  4455. 2:16:17at once every second." And we can change
  4456. 2:16:19this. This can be 10 10 million, right?
  4457. 2:16:22Whatever it is that you want to do, and
  4458. 2:16:24you can change the time from it, you can
  4459. 2:16:25change the amount of items that will go
  4460. 2:16:26through the API request at each time.
  4461. 2:16:29All right. So, the next hack is actually
  4462. 2:16:30within error handling itself. Uh now,
  4463. 2:16:32let's say we had a workflow that looked
  4464. 2:16:33like this. We have the schedule trigger
  4465. 2:16:34which runs every 10 seconds, and then we
  4466. 2:16:36have a HTTP request that we're calling.
  4467. 2:16:38In this case, it's my website, so if I
  4468. 2:16:40execute this step, this gives me the
  4469. 2:16:41whole code. But, let's say now I
  4470. 2:16:43activated this,
  4471. 2:16:44which runs every 10 seconds. So, now
  4472. 2:16:45it's calling the API every 10 seconds,
  4473. 2:16:47and I wanted to Let's say I changed
  4474. 2:16:49something like this, or added some more
  4475. 2:16:50stuff here. And I press save. So, we can
  4476. 2:16:52see here that we got an error
  4477. 2:16:54because of the fact that again, we put
  4478. 2:16:56an invalid URL, and this is not work.
  4479. 2:16:58Now, the good thing about error handling
  4480. 2:16:59is that we have debug and error chain,
  4481. 2:17:00we have go back to the same data before
  4482. 2:17:02that I showed you.
  4483. 2:17:03We also have something called an error
  4484. 2:17:05workflow. And this just means that
  4485. 2:17:06whenever a workflow stops working
  4486. 2:17:08because there's an error, we call or we
  4487. 2:17:10send the data to another workflow to
  4488. 2:17:11then do whatever it needs to do. But,
  4489. 2:17:13let me show you exactly cuz it it makes
  4490. 2:17:14much more sense once I show you. All
  4491. 2:17:16right. If I go here, another workflow,
  4492. 2:17:18the personal,
  4493. 2:17:20I can add
  4494. 2:17:21something called an error trigger.
  4495. 2:17:24So, this error trigger basically works
  4496. 2:17:26so that it receives all the errors from
  4497. 2:17:28any workflow that you connect it to, and
  4498. 2:17:30then it does whatever. So, let's say I
  4499. 2:17:31do Gmail,
  4500. 2:17:33and I want to send myself an email
  4501. 2:17:34whenever I receive an error from any
  4502. 2:17:35workflow. Okay, so now I'm going to
  4503. 2:17:36email right here. There was an error in
  4504. 2:17:38the workflow. Let me do
  4505. 2:17:40uh exclamation mark. Go here, I can
  4506. 2:17:41press save. Now, if I go back to the
  4507. 2:17:43original automation, I have to go to
  4508. 2:17:46settings
  4509. 2:17:47right here,
  4510. 2:17:48and then I have to go to error workflow
  4511. 2:17:49so to notify the error. So, in this
  4512. 2:17:51case, let me name this
  4513. 2:17:53error
  4514. 2:17:54right? So, I know that it is this
  4515. 2:17:55workflow right here. And now I can
  4516. 2:17:56choose the workflow to send the data to
  4517. 2:17:58when it errors. In this case, it will be
  4518. 2:18:00error, as you can see here, and I press
  4519. 2:18:01save. Now, let's execute this every 5
  4520. 2:18:04seconds.
  4521. 2:18:07And I press save. Let me press active.
  4522. 2:18:10So, this right here should now, when it
  4523. 2:18:12executes, it's going to error up again,
  4524. 2:18:14like here, as you can see.
  4525. 2:18:16There is a every 5 seconds. And if I go
  4526. 2:18:18here, I can see in the executions that
  4527. 2:18:20this was successful as in it's getting
  4528. 2:18:21the data because it there was an error
  4529. 2:18:23in the workflow. If I go to my email,
  4530. 2:18:26I can now see that I have a bunch of
  4531. 2:18:27emails saying there's an error, there's
  4532. 2:18:28an error, there's an error. Now, this is
  4533. 2:18:29great because Let me actually turn this
  4534. 2:18:30off cuz I don't want a bunch of emails
  4535. 2:18:32here.
  4536. 2:18:34This is great when you have different
  4537. 2:18:35automations. So, we have a bunch of
  4538. 2:18:37automations. Let's say we have 10 or 20
  4539. 2:18:38within the workspace. We all connected
  4540. 2:18:41this, we all connect all the different
  4541. 2:18:42automations to the error trigger so that
  4542. 2:18:44we know exactly every single time, and
  4543. 2:18:46it does the same thing.
  4544. 2:18:48Right? Which is amazing because then we
  4545. 2:18:49have everything centralized, and we have
  4546. 2:18:50everything within one workflow to be
  4547. 2:18:52able to notify us when there's an error.
  4548. 2:18:54I said the next hack is actually called
  4549. 2:18:56a human in the loop. So, let's say I had
  4550. 2:18:57a simple automation like this. I can go
  4551. 2:18:58here, [clears throat]
  4552. 2:18:59I can go go to human in the loop, and
  4553. 2:19:00this is across multiple different
  4554. 2:19:03platforms. So, let's say I use Gmail and
  4555. 2:19:04I SMS out the email and I execute
  4556. 2:19:06previous nodes. This is an example. In
  4557. 2:19:08this case, there's an error, so I can't
  4558. 2:19:10do that, but I'll say hello.
  4559. 2:19:12I say this.
  4560. 2:19:14Hello.
  4561. 2:19:16How's it going? Let's say I pull
  4562. 2:19:17something from before, previous step.
  4563. 2:19:20And then we have the response step,
  4564. 2:19:21which is essentially saying, "Hey, when
  4565. 2:19:22I send you the email for you to to check
  4566. 2:19:24or something, submit something, do you
  4567. 2:19:26want it to be an approval so you can
  4568. 2:19:27approve or disapprove? Do you want it to
  4569. 2:19:29be free text so you can actually give me
  4570. 2:19:30feedback, or do you want it to be a
  4571. 2:19:31custom form?" So, in this case, let's do
  4572. 2:19:33approval.
  4573. 2:19:34Let's say I
  4574. 2:19:36already sent the email.
  4575. 2:19:38I can get this and I can approve right
  4576. 2:19:40here. And this sends the data back right
  4577. 2:19:41here. And then we got the approval. I
  4578. 2:19:43approved equals true. And now, this is
  4579. 2:19:45great in case you're building
  4580. 2:19:45automations like these. And by the way,
  4581. 2:19:48this is a human in the loop AI sales
  4582. 2:19:49agent that basically starts with the
  4583. 2:19:51form, right? Let me execute it actually
  4584. 2:19:52to show you. Uh which has different
  4585. 2:19:55fields. So, James, email, company name,
  4586. 2:19:57intent, budget, project description, and
  4587. 2:19:58timeline. Let me talk to we add it to
  4588. 2:20:00the sheet. We talk to the sales agent to
  4589. 2:20:02make a sales email, which then is being
  4590. 2:20:03sent to us for us to say, "Hey, approve
  4591. 2:20:06or deny." Or actually get feedback. Then
  4592. 2:20:08when we give it feedback, the text
  4593. 2:20:09classifier classifies whether this is
  4594. 2:20:11good feedback or bad feedback. If it's
  4595. 2:20:12negative, then it uses feedback to
  4596. 2:20:14rewrite the email, and it goes through
  4597. 2:20:15the whole thing over and over again
  4598. 2:20:16until we give it a positive feedback
  4599. 2:20:18saying, "Hey, all good." And then it
  4600. 2:20:20actually sends the email to the lead.
  4601. 2:20:25Hey, so in this video, I'm going to show
  4602. 2:20:26you exactly how you can set up your own
  4603. 2:20:27Google credentials so you can connect
  4604. 2:20:28with Gmail, Google Drive, and Google
  4605. 2:20:30Docs to N8N and get going right away.
  4606. 2:20:32Let's step in. All right, so if I go to
  4607. 2:20:34N8N right here, I can see that if I go
  4608. 2:20:36to Google Sheets and I want to connect
  4609. 2:20:38my Google Sheets to N8N, I can see that
  4610. 2:20:40I can simply just sign in with Google.
  4611. 2:20:41If I press this button, it will take me
  4612. 2:20:42to this page. I can choose an account.
  4613. 2:20:45I will then press continue.
  4614. 2:20:47And the connection is successful. Now,
  4615. 2:20:48this is great because N8N previously did
  4616. 2:20:51not have this, but now they implemented
  4617. 2:20:52this so you only have to sign in with
  4618. 2:20:53Google. This is the same exact case when
  4619. 2:20:55you want to sign in with Gmail. I'm
  4620. 2:20:56going to go here, create a new
  4621. 2:20:58credential, and you can sign in with
  4622. 2:20:59Google. This is the exact same process,
  4623. 2:21:01and it's amazing because it allows us to
  4624. 2:21:02not have to do any authorization or
  4625. 2:21:04anything like that. We just have to
  4626. 2:21:05press the button, choose the account,
  4627. 2:21:06and that's it. But now, if I go to
  4628. 2:21:09Google Drive right here,
  4629. 2:21:11I can see that I want to press create a
  4630. 2:21:13new credential, I have to add the client
  4631. 2:21:15ID and client secret. So, how is it that
  4632. 2:21:18we have to do this?
  4633. 2:21:19And if I go to Google Docs,
  4634. 2:21:21I can see that it's pretty much the
  4635. 2:21:22same. So, if I go here,
  4636. 2:21:23create a new credential, I have to add
  4637. 2:21:25the client ID and client secret as well.
  4638. 2:21:27So, in order for us to
  4639. 2:21:29generate the client ID and client
  4640. 2:21:30secret, let me go here.
  4641. 2:21:32I have to go to the documentation.
  4642. 2:21:35I have to scroll down.
  4643. 2:21:37The first step is create a Google Cloud
  4644. 2:21:38Console project. So, I have to go log in
  4645. 2:21:40to Google Console Cloud or Google Cloud
  4646. 2:21:42Console. I have to go right here on the
  4647. 2:21:44top, and I have to press new project.
  4648. 2:21:48You want to name the project. In this
  4649. 2:21:49case, we can name it Google Auth
  4650. 2:21:51tutorial.
  4651. 2:21:54There it is. I'm going to press create.
  4652. 2:21:56And now, the project is actually
  4653. 2:21:58creating for you. I'm going to press
  4654. 2:22:00right here, select project, and you know
  4655. 2:22:01that you're in the right project when on
  4656. 2:22:03the top left, you can see the Google
  4657. 2:22:04Auth tutorial.
  4658. 2:22:06Now, the first thing you want to do,
  4659. 2:22:07you're going to go to API and services.
  4660. 2:22:10And you want to search up for the apps,
  4661. 2:22:11for the softwares that you actually want
  4662. 2:22:12to connect your automations to. So, in
  4663. 2:22:14this case, if I go back to N8N, I can
  4664. 2:22:16see that I want to connect my Google
  4665. 2:22:16Drive, but also my Google Docs. The
  4666. 2:22:18first step I have to do is search up
  4667. 2:22:20Google Drive.
  4668. 2:22:22Google Drive API.
  4669. 2:22:24And I want to enable this.
  4670. 2:22:26It's the same here. Let's enable the API
  4671. 2:22:27so we can use it in the automation.
  4672. 2:22:30All right, cool. So, you have to do the
  4673. 2:22:32same and want to do the exact same for
  4674. 2:22:34Google Docs.
  4675. 2:22:36Press Google Docs.
  4676. 2:22:39Google Docs API.
  4677. 2:22:40I press here.
  4678. 2:22:43And you want to enable this.
  4679. 2:22:45Amazing. So, now that we have both APIs
  4680. 2:22:47enabled, all we have to do is go to
  4681. 2:22:49OAuth consent screen.
  4682. 2:22:52We have to get started.
  4683. 2:22:55Put the app name, so let's do test N8N.
  4684. 2:22:58User support email, this will be your
  4685. 2:22:59email. Next, you can put external.
  4686. 2:23:03Just fine.
  4687. 2:23:04The email address, put your email
  4688. 2:23:05address for mine.
  4689. 2:23:08For next, agree, continue, and create.
  4690. 2:23:11All right, so once this is done, we can
  4691. 2:23:13go here to create OAuth client.
  4692. 2:23:16This will take us to this page, and we
  4693. 2:23:18can choose the application. In this
  4694. 2:23:19case, it will be web application. Then
  4695. 2:23:21the client can be let's do killer test.
  4696. 2:23:25Now, it's asking us for two different
  4697. 2:23:26things. It's asking us, do we want to
  4698. 2:23:28add an authorized JavaScript origins or
  4699. 2:23:30authorized redirect URIs? So, this right
  4700. 2:23:33here, we leave blank, but if I go back
  4701. 2:23:34to N8N, I can see that they said in
  4702. 2:23:36Google Drive, it used the URL above when
  4703. 2:23:38prompted to enter an OAuth callback or
  4704. 2:23:39redirect URL.
  4705. 2:23:41So, what we want to do here is want to
  4706. 2:23:42copy this URL, go back to the OAuth
  4707. 2:23:45client ID, and you want to add it to the
  4708. 2:23:47authorized redirect URLs.
  4709. 2:23:49Press add URLs. I'm going to paste this,
  4710. 2:23:51and you want to press create.
  4711. 2:23:54Once this is done, we have the client
  4712. 2:23:55ID. Make sure to not share the client ID
  4713. 2:23:57with anyone uh because this is
  4714. 2:23:59confidential. I'm going to press this,
  4715. 2:24:00copy, go back,
  4716. 2:24:03paste it here,
  4717. 2:24:04and now we have the client ID. To get
  4718. 2:24:06the client secret, all we have to do is
  4719. 2:24:07go back here.
  4720. 2:24:08Press okay.
  4721. 2:24:10I'm going to go here to make it test.
  4722. 2:24:12The client secret will be this one right
  4723. 2:24:14here, client secret. I'm going to copy
  4724. 2:24:15this.
  4725. 2:24:17You want to now go here, client secret,
  4726. 2:24:20and you'll see the option to sign in
  4727. 2:24:21with Google. So, let's say I sign in
  4728. 2:24:22with Google.
  4729. 2:24:24This will give me this option. I can
  4730. 2:24:25press the account that I have, but now
  4731. 2:24:27it will block me. Access blocked. N8N
  4732. 2:24:29Cloud does not have complete Google
  4733. 2:24:30verification process. So, once we get
  4734. 2:24:32this, we know that we have to publish
  4735. 2:24:34the app. So, to do this, I can go to
  4736. 2:24:36audience.
  4737. 2:24:37I can go to publish app.
  4738. 2:24:39Confirm.
  4739. 2:24:41Now, the app is published. So, we can
  4740. 2:24:43then go back to N8N.
  4741. 2:24:45Sign in with Google.
  4742. 2:24:48Choose the account.
  4743. 2:24:50It will send me to this page. I can go
  4744. 2:24:51to advanced right here.
  4745. 2:24:53I can go to n8n.cloud.
  4746. 2:24:56And now, I can select all the different
  4747. 2:24:58things that we want to do. In this case,
  4748. 2:24:59it's edit, view, and create.
  4749. 2:25:01I can continue.
  4750. 2:25:03And the connection is successful.
  4751. 2:25:05I can see that the connection is
  4752. 2:25:06created.
  4753. 2:25:07Go here. Select connection.
  4754. 2:25:10And I can press save.
  4755. 2:25:12If I go here, let's say I want to create
  4756. 2:25:14a file from text. Let's say I say hello.
  4757. 2:25:18I press execute step. I can see that now
  4758. 2:25:20the connection was successful.
  4759. 2:25:22I go back to Google Docs.
  4760. 2:25:24We have to pretty much do the same
  4761. 2:25:25thing. So, in this case, I can create a
  4762. 2:25:26new credential.
  4763. 2:25:27Go here.
  4764. 2:25:28You can go to clients.
  4765. 2:25:30Make it a test. Well, actually, we can
  4766. 2:25:32copy the client ID from here. So, copy
  4767. 2:25:33this.
  4768. 2:25:34Paste it here.
  4769. 2:25:37Go back. Go to the
  4770. 2:25:38software,
  4771. 2:25:39the account. In this case, you can copy
  4772. 2:25:41the client secret again.
  4773. 2:25:43And you can paste this.
  4774. 2:25:45Now, we can sign in with Google.
  4775. 2:25:47Go here.
  4776. 2:25:49Advanced.
  4777. 2:25:51Go to n8n.cloud.
  4778. 2:25:53Select the different things you want to
  4779. 2:25:54do. Continue.
  4780. 2:25:56And the connection is successful.
  4781. 2:25:58Go back. I can name it.
  4782. 2:26:00Save.
  4783. 2:26:02Now, if I want to, let's say, create a
  4784. 2:26:03document for my drive. Folder name is an
  4785. 2:26:05invoice N8N. Now, I press say I say I
  4786. 2:26:08can go to execute step.
  4787. 2:26:10Now, the step is executed. And we can
  4788. 2:26:12see that everything works fine. So far,
  4789. 2:26:13you've built a solid foundation. You
  4790. 2:26:15know exactly how to connect apps, how
  4791. 2:26:17automations actually work, how to use
  4792. 2:26:19webhooks, and how to clean up data. But
  4793. 2:26:21automations can only get you so far. The
  4794. 2:26:23real magic is when you build automations
  4795. 2:26:26and pair them up with AI. So, in the
  4796. 2:26:27next module, we'll dive into the hottest
  4797. 2:26:29topic of N8N, which is AI agents. You'll
  4798. 2:26:32learn exactly what they are, how you can
  4799. 2:26:34use them, what is the difference between
  4800. 2:26:35an AI agent and a workflow, and finally,
  4801. 2:26:38how you can start building it from
  4802. 2:26:39scratch inside of N8N. And this is where
  4803. 2:26:41your automation doesn't just turn into a
  4804. 2:26:43simple workflow, but turns into a
  4805. 2:26:45virtual employee. With that being said,
  4806. 2:26:47let's dive in.
  4807. 2:26:54If you're someone who's been finally
  4808. 2:26:55wanting to understand AI agents, but
  4809. 2:26:57you're getting lost in all the technical
  4810. 2:26:59terms, and you're getting way too
  4811. 2:27:00overwhelmed, well, this video is for
  4812. 2:27:02you. Because I'm going to be breaking
  4813. 2:27:03down the fundamentals of AI agents as if
  4814. 2:27:06I'm teaching it to a five-year-old
  4815. 2:27:07>> [music]
  4816. 2:27:07>> so you finally understand what this
  4817. 2:27:09whole hype is about. All right, so we're
  4818. 2:27:10going to cover the fundamentals of AI
  4819. 2:27:12agents and the different types of AI
  4820. 2:27:13agents. And by the way, if you want to
  4821. 2:27:15see the difference between AI agents and
  4822. 2:27:16workflows, check out this video up here.
  4823. 2:27:18Um but this is the simplistic version of
  4824. 2:27:21what an AI agent does. We have an input
  4825. 2:27:24and we have an output. Between the input
  4826. 2:27:25and the output, there's an agent,
  4827. 2:27:27there's someone who is prompted with
  4828. 2:27:29instructions. So, he has instructions
  4829. 2:27:31saying, "Hey, you have to do XYZ if this
  4830. 2:27:32happens." And the AI agent, so the
  4831. 2:27:35actual thing, the the boss, uh which has
  4832. 2:27:38instructions, is connected to its brain,
  4833. 2:27:40and its brain is AI, so ChatGPT or
  4834. 2:27:42Claude or Gemini,
  4835. 2:27:44and it has a memory because as a normal
  4836. 2:27:46human, you remember the previous
  4837. 2:27:47conversations, so you have this context.
  4838. 2:27:49And then, it has tools. So, these are
  4839. 2:27:52the different things that it uses to
  4840. 2:27:54take action on something. So, in this
  4841. 2:27:55case, let's do an example. If the input
  4842. 2:27:58is send an email, what it will do is
  4843. 2:27:59that it will think through all the
  4844. 2:28:01system prompt instructions that it was
  4845. 2:28:02given saying, "Hey, if the user says
  4846. 2:28:04send an email, then call then use the
  4847. 2:28:07tool, which is Gmail." And that's how
  4848. 2:28:08the logic usually goes. And so, if you
  4849. 2:28:10have multiple tools, then the AI agent
  4850. 2:28:12is able to take actions on multiple
  4851. 2:28:15softwares, which means that it has
  4852. 2:28:17actions, it can send emails, it could
  4853. 2:28:18also schedule calendar events, it can
  4854. 2:28:20get calendar events. It all depends on
  4855. 2:28:22the different tools that you connected
  4856. 2:28:23to the AI agent that now it's able to
  4857. 2:28:25take action. Okay? So, input, send
  4858. 2:28:28something or do something, whatever it
  4859. 2:28:29is, agent will think through what it
  4860. 2:28:31needs to do with its brain, which is
  4861. 2:28:33ChatGPT or Claude or whatever it is. It
  4862. 2:28:35remembers the conversation, and then it
  4863. 2:28:37takes action on what we told it to do
  4864. 2:28:40based on the tool that is connected to.
  4865. 2:28:41And then, it will give us the output,
  4866. 2:28:43which is, "Yeah, everything was good.
  4867. 2:28:44You're good to go." And the beautiful
  4868. 2:28:45thing about this is that one AI agent
  4869. 2:28:48can be connected to five to 10 different
  4870. 2:28:49tools. So, one input can lead in a
  4871. 2:28:52series of outputs. It can lead to
  4872. 2:28:54multiple actions in multiple softwares.
  4873. 2:28:56Now, what does an AI agent actually look
  4874. 2:28:58like? We're going to use N8N as an
  4875. 2:28:59example just because it is the the
  4876. 2:29:01widely known AI agent feature. But, the
  4877. 2:29:04way that it looks like is we have a
  4878. 2:29:06chat, which is the input. So, this is
  4879. 2:29:07the thing that goes into the AI agent.
  4880. 2:29:09In this case, you can chat to it using
  4881. 2:29:11the native N8N chat node, which looks
  4882. 2:29:13like this.
  4883. 2:29:14You can say hello, right? Um
  4884. 2:29:18you can also use Telegram.
  4885. 2:29:19Telegram is sort of like a like a
  4886. 2:29:20WhatsApp. You can use Gmail, so it can
  4887. 2:29:23send conversations to the AI agent using
  4888. 2:29:25email.
  4889. 2:29:26And now, the information will pass
  4890. 2:29:28through
  4891. 2:29:29all the way to the AI agent. So, this
  4892. 2:29:31line means that it the information goes
  4893. 2:29:32through to here. Now, this is where the
  4894. 2:29:35agent is prompted. So, if I go in here,
  4895. 2:29:38this AI agent is consisted of three
  4896. 2:29:39different things. The first one is the
  4897. 2:29:41source for prompt. So, prompt is
  4898. 2:29:43basically saying, "Hey, what is the
  4899. 2:29:44thing that we're actually giving the AI
  4900. 2:29:46agent for it to do?" Right? What is what
  4901. 2:29:47is this thing? What is the input? What
  4902. 2:29:49is the chat? What is the email? And so,
  4903. 2:29:51we connect this So, we say connected
  4904. 2:29:53chat trigger node because currently the
  4905. 2:29:55AI agent is connected to the chat
  4906. 2:29:57trigger node. This is what it's called.
  4907. 2:30:00And then, the prompt user prompt
  4908. 2:30:01message, which is what is the thing
  4909. 2:30:02that's going inside. In this case, it
  4910. 2:30:04would be the JSON chat input because
  4911. 2:30:07this is the thing that's going through
  4912. 2:30:08here. Let me show you an example.
  4913. 2:30:10Let me disconnect this.
  4914. 2:30:14There we go.
  4915. 2:30:15Let me go here. Let me say, "Hello."
  4916. 2:30:18And now, the information will pass
  4917. 2:30:19through to here. Now, it gives an error
  4918. 2:30:22because this AI agent must be connected
  4919. 2:30:24to an AI in order to think through. But,
  4920. 2:30:27you can now see that the chat input,
  4921. 2:30:30which is this one, is hello.
  4922. 2:30:32Is the input that we gave it.
  4923. 2:30:34Now, the second thing here is the system
  4924. 2:30:37message. So, the system message is the
  4925. 2:30:39instructions that we give it. So, sort
  4926. 2:30:41of like you have an employee, and you
  4927. 2:30:42tell the employee, "Hey, if this
  4928. 2:30:43happens, call this. If that happens,
  4929. 2:30:45call this." You're training them on what
  4930. 2:30:47they're meant to do. Now, usually when
  4931. 2:30:49it comes to the prompts or the the
  4932. 2:30:50instructions that we give to the AI
  4933. 2:30:52agent, it consists of an overview. So,
  4934. 2:30:55saying, "Here, we're a helpful
  4935. 2:30:55intelligent XYZ assistant that does
  4936. 2:30:57XYZ."
  4937. 2:30:58And then, the tools. Now, the tools, you
  4938. 2:31:00basically explain the different
  4939. 2:31:02softwares that are connected to the AI
  4940. 2:31:03agent. So, it has context as to what it
  4941. 2:31:06can do, what tool it can do, what
  4942. 2:31:07software it can uh it can take action on
  4943. 2:31:10based on the ones that are connected to
  4944. 2:31:12it. And then, we have rules, which are
  4945. 2:31:14different rules. So, it can be when a
  4946. 2:31:15task requires using one or more tools,
  4947. 2:31:17make sure to identify which tool is the
  4948. 2:31:19most appropriate, pass along the
  4949. 2:31:20relevant details, and execute the
  4950. 2:31:22actions needed to complete the task.
  4951. 2:31:25So, these are different rules that we
  4952. 2:31:26tell the AI agent to make sure that the
  4953. 2:31:27quality of output is increasing. Because
  4954. 2:31:29sometimes, with the fact that it's AI,
  4955. 2:31:32it can hallucinate. It can make up some
  4956. 2:31:34stuff. It can do its own thing, and we
  4957. 2:31:36basically want to restrict it to doing
  4958. 2:31:38only the things that we want it to do.
  4959. 2:31:39So again, we have overview, tools, and
  4960. 2:31:41rules. And then, we also give it the
  4961. 2:31:43date and time because let's say we tell
  4962. 2:31:45it, "Hey, can you tell John that we have
  4963. 2:31:46a meeting tomorrow?" Well, the thing
  4964. 2:31:48about AI is that it's not the best at
  4965. 2:31:49remembering dates. So, we always want to
  4966. 2:31:51give it a date, which in this case, you
  4967. 2:31:54can simply do by
  4968. 2:31:55putting curly bracket, and then put now.
  4969. 2:31:58Right? So, now it will give it today's
  4970. 2:31:59date, and then we format it in a way
  4971. 2:32:01where it looks like this.
  4972. 2:32:03Right? Which is good.
  4973. 2:32:04And now, the AI agent will always have a
  4974. 2:32:06dynamic variable. So, it will always
  4975. 2:32:08have this, which changes every single
  4976. 2:32:10day based on what day it is. And it uses
  4977. 2:32:12that as context
  4978. 2:32:13when taking the action that it needs to
  4979. 2:32:15take. Now, obviously, this is not used
  4980. 2:32:16always, but when it makes a calendar
  4981. 2:32:18event, when it sends an email asking for
  4982. 2:32:20a specific time, uh this is very very
  4983. 2:32:22useful.
  4984. 2:32:23So, again, we have the chat input, and
  4985. 2:32:24then we have the system prompt, which is
  4986. 2:32:26the instructions that we give to the AI
  4987. 2:32:27agent when it needs to take action on
  4988. 2:32:29something.
  4989. 2:32:30Then, [snorts] we have the LLM plus
  4990. 2:32:31memory. The chat model here is the brain
  4991. 2:32:34of the AI agent. Now, I can
  4992. 2:32:36connect this to the model, right? So,
  4993. 2:32:38this is the um the line that allows the
  4994. 2:32:40AI agent to then pass through the input
  4995. 2:32:42to its brain using its instructions and
  4996. 2:32:45actually think. And in order for us to
  4997. 2:32:48actually connect the AI agent to OpenAI,
  4998. 2:32:50all we have to do is go here, create a
  4999. 2:32:52new credential, and you want to go to
  5000. 2:32:54platform.openai.com.
  5001. 2:32:57Log in.
  5002. 2:32:58You can go to dashboard.
  5003. 2:33:00You can go to API keys. And we're
  5004. 2:33:02basically making a password that N8N AI
  5005. 2:33:04agents can use when actually thinking
  5006. 2:33:06through its LLM. LLM just means ChatGPT
  5007. 2:33:09or Claude
  5008. 2:33:10uh in actually thinking through the
  5009. 2:33:11instructions. So, you can press this
  5010. 2:33:12button. You can say AI agent.
  5011. 2:33:16Create a secret key.
  5012. 2:33:17And make sure to copy this,
  5013. 2:33:20which we'll then paste right here.
  5014. 2:33:23And then, you can call this AI agent
  5015. 2:33:25test
  5016. 2:33:273rd October.
  5017. 2:33:29Press save. And bear in mind that this
  5018. 2:33:30is not free, so you would have to go to
  5019. 2:33:32your profile,
  5020. 2:33:34and you would have to go to billing
  5021. 2:33:36uh right here, and make sure to add some
  5022. 2:33:37money because AI requires you to have
  5023. 2:33:40credits, and credits require money, uh
  5024. 2:33:42but it is very very cheap when we're
  5025. 2:33:43talking about a few cents per execution.
  5026. 2:33:46All right. So, now that we connected AI,
  5027. 2:33:48we have ChatGPT as the brain. All we
  5028. 2:33:50have to do now is connect the model.
  5029. 2:33:52Right? So, we're choosing the model that
  5030. 2:33:54the AI agent uses when it's thinking
  5031. 2:33:56through what it needs to do. So, now
  5032. 2:33:57that we have AI connected to it, let's
  5033. 2:33:59actually chat to it. Let's say, "Hello."
  5034. 2:34:02And now, you can see is that the input
  5035. 2:34:03went here. What it did is that it
  5036. 2:34:05automatically talked to its brain, which
  5037. 2:34:08is in this case, it's OpenAI, and then
  5038. 2:34:10it gave us an answer. So, the answer in
  5039. 2:34:11this case is, "Hello, how can I assist
  5040. 2:34:13you?"
  5041. 2:34:14And this is as if we're talking to the
  5042. 2:34:15actual ChatGPT interface on ChatGPT, but
  5043. 2:34:18we're connecting it using the API
  5044. 2:34:20version. So, the automatic version.
  5045. 2:34:22Now, we have memory. Now, memory right
  5046. 2:34:24here is when the AI agent when you want
  5047. 2:34:27the AI agent to remember previous steps
  5048. 2:34:29or conversations
  5049. 2:34:31uh when you're doing something. So, this
  5050. 2:34:33is useful when you're basically creating
  5051. 2:34:35a draft in email to John, and then um
  5052. 2:34:38the AI agent already knows who John is,
  5053. 2:34:39and you say, "Can you also schedule
  5054. 2:34:41calendar event?" So, now it has context
  5055. 2:34:43as to who John is for them be able to
  5056. 2:34:45take the next action without you having
  5057. 2:34:47to state who John is in the first place.
  5058. 2:34:49But, on a simple term, I can say,
  5059. 2:34:50"Hello.
  5060. 2:34:51How are you?"
  5061. 2:34:54And now, I can also ask it, "What did I
  5062. 2:34:56just
  5063. 2:34:58ask you?"
  5064. 2:34:59If I ask this, I can now get the answer,
  5065. 2:35:01which is
  5066. 2:35:02probably, "Hello, how are you? Uh you
  5067. 2:35:04asked me, 'Hello, how are you? How can I
  5068. 2:35:05assist you today?'" Now, as you can see
  5069. 2:35:06here, the logs, these are the different
  5070. 2:35:08steps that the AI agent took in order to
  5071. 2:35:10get to the output. Right? So, in this
  5072. 2:35:12case, what it did is that the AI agent
  5073. 2:35:14went through the simple memory. So, it
  5074. 2:35:16remembered exactly the conversation that
  5075. 2:35:18I had using the context.
  5076. 2:35:20Then, it uses AI to think through its uh
  5077. 2:35:23instructions, and then what it did is
  5078. 2:35:25that it used the memory tool again to
  5079. 2:35:27give us the actual answer. All right.
  5080. 2:35:28So, now that we have the LLM connected
  5081. 2:35:30to this and the memory, this tool right
  5082. 2:35:32here, so this is how the AI agent
  5083. 2:35:34actually takes action.
  5084. 2:35:35And we can connect this to Gmail and
  5085. 2:35:37calendar. And inside the Gmail, we set a
  5086. 2:35:39series of instructions and different
  5087. 2:35:41details to allow the AI to define what
  5088. 2:35:44the subject line is, what the message
  5089. 2:35:45is, and who are we sending the email to.
  5090. 2:35:47And same thing with the calendar.
  5091. 2:35:49This is going to be another tool that
  5092. 2:35:51the AI agent has access to in order to
  5093. 2:35:52take actions for us.
  5094. 2:35:54And we give it the before and after of
  5095. 2:35:56the event that we want to schedule, or
  5096. 2:35:58in this case, we want to get the event.
  5097. 2:36:00Um and now, if I speak to the AI agent,
  5098. 2:36:02this is prompted. If I go here, this is
  5099. 2:36:04prompted with the two different tools.
  5100. 2:36:06So, Gmail will be used to draft an
  5101. 2:36:08email.
  5102. 2:36:09Uh calendar will be used to get calendar
  5103. 2:36:11events. Right? So, it knows exactly when
  5104. 2:36:13to use each tool. And when I say,
  5105. 2:36:16"Hey, can you send an email?"
  5106. 2:36:20This should now send back
  5107. 2:36:21or should ask me who I'm sending the
  5108. 2:36:23email to.
  5109. 2:36:24I say, "Hey, I can help you draft an
  5110. 2:36:25email. Can you provide me with the
  5111. 2:36:26details of the email, such as the
  5112. 2:36:28recipient email address, the subject
  5113. 2:36:29line, and the message you'd like to
  5114. 2:36:30include?" So, I said, "Send an email to
  5115. 2:36:32Mikkel uh at work t at gmail.com saying
  5116. 2:36:35we have dinner tomorrow."
  5117. 2:36:37What this will now do is that it will
  5118. 2:36:38take action on the draft. As you can
  5119. 2:36:40see, it just called the tool. So, it
  5120. 2:36:41just sent a signal to the tool saying,
  5121. 2:36:42"Hey, I just got received instructions
  5122. 2:36:44to do XYZ. Can you do it?" As you can
  5123. 2:36:46see, we went through step by step right
  5124. 2:36:48here. And now, it says we have drafted
  5125. 2:36:50the email to Mikkel. So, if I go to my
  5126. 2:36:52email right here, I can see in the
  5127. 2:36:53drafts that we have dinner tomorrow to
  5128. 2:36:55this person right here. Obviously, you
  5129. 2:36:57can improve the prompt to make the email
  5130. 2:36:58actually more contextual or
  5131. 2:37:00I guess more sauce in the email, but
  5132. 2:37:02just know that it called the exact tool
  5133. 2:37:05that we wanted to call to take the
  5134. 2:37:07action that we wanted to take. Right?
  5135. 2:37:09Without us having to go to the Gmail
  5136. 2:37:10tool. And it did it within seconds. Now,
  5137. 2:37:12for my calendar, let's do an event um
  5138. 2:37:14lunch,
  5139. 2:37:16and let's do
  5140. 2:37:17dinner.
  5141. 2:37:19Right? We have one on Friday and one on
  5142. 2:37:20Sunday. If I go to N8N, let me ask it,
  5143. 2:37:23"Can you grab the events
  5144. 2:37:25from this week,
  5145. 2:37:27please?"
  5146. 2:37:29What this will now do is it will go
  5147. 2:37:30here. It will think through what it
  5148. 2:37:31needs to do. It will then call the
  5149. 2:37:32appropriate tool to then give us an
  5150. 2:37:34answer back, which should give us lunch
  5151. 2:37:36and dinner.
  5152. 2:37:37Um as you can see here, we have Q&A with
  5153. 2:37:39Shaz, which is something that I did
  5154. 2:37:40before, lunch, and dinner as well.
  5155. 2:37:43Because these were the three events we
  5156. 2:37:44have. Q&A with Shaz, lunch, and dinner.
  5157. 2:37:48And that's how fundamentally a simple
  5158. 2:37:49version of an AI agent looks like. It's
  5159. 2:37:51connected to an input. It thinks through
  5160. 2:37:53its LLM uh cuz that's how it's its brain
  5161. 2:37:55works. It It remembers the
  5162. 2:37:56conversations, and it takes action on
  5163. 2:37:59the the things that we want it to do
  5164. 2:38:00using different softwares. Now, this is
  5165. 2:38:02called a simple AI agent. Now, we can
  5166. 2:38:04get onto the multi-step AI agent. So,
  5167. 2:38:06this is an AI agent that is connected to
  5168. 2:38:08more AI agents and more tools. Right? As
  5169. 2:38:11you can see, it's more complex than just
  5170. 2:38:13a simple walk-through. And by the way,
  5171. 2:38:14if you want to see the full walk-through
  5172. 2:38:15of this AI agent, check out this video
  5173. 2:38:17up here. But, essentially, the way that
  5174. 2:38:19this works is that we have an input, and
  5175. 2:38:21we have an output. This is always the
  5176. 2:38:23case with AI agents. It doesn't change.
  5177. 2:38:25Now, the only difference here is that we
  5178. 2:38:27still have the system prompt
  5179. 2:38:28instruction. This is still the exact
  5180. 2:38:30same. Uh it still has a brain, which is
  5181. 2:38:32LLM. It still has a memory.
  5182. 2:38:34But, the only um change is that we're
  5183. 2:38:35not calling tools
  5184. 2:38:37as a first step. We're calling other
  5185. 2:38:38agents in the first step. So,
  5186. 2:38:40fundamentally, this is why.
  5187. 2:38:42Because the most important thing here
  5188. 2:38:43that matters it's not so much the tools,
  5189. 2:38:46it's the prompt that we give the AI
  5190. 2:38:47agents. Because the prompt is the
  5191. 2:38:48instructions.
  5192. 2:38:49>> [music]
  5193. 2:38:49>> And so, if we instruct an AI agent to
  5194. 2:38:52take action on 55 different tools like
  5195. 2:38:55these,
  5196. 2:38:56well, the chances that it would actually
  5197. 2:38:57succeed are pretty low even though we
  5198. 2:38:59have the best prompt in the world
  5199. 2:39:01because of the fact that
  5200. 2:39:04it being non-deterministic, right? It
  5201. 2:39:06can fail, right? Cuz it's AI. And so,
  5202. 2:39:08what we do here is you want to minimize
  5203. 2:39:10the failure rate of an AI agent. So,
  5204. 2:39:12what we do is we add more AI agents. And
  5205. 2:39:14so, the way to think about this use case
  5206. 2:39:16is as if you have a company. So, a
  5207. 2:39:18company, right, will be the customer,
  5208. 2:39:20which is the input. It then tells the
  5209. 2:39:22the CEO, "Hey, can you can you maybe
  5210. 2:39:25check the finances that we have in our
  5211. 2:39:26company?" And now the CEO is presented
  5212. 2:39:29with head of departments. So, in this
  5213. 2:39:30case, we have the head of calendar, head
  5214. 2:39:31of email, head of blogs, and head of
  5215. 2:39:33contacts.
  5216. 2:39:35And the head of contacts and blog and
  5217. 2:39:37email and calendar have access to tools
  5218. 2:39:39which are employees,
  5219. 2:39:40right? And so, why do we have head of
  5220. 2:39:42departments and not just have employees
  5221. 2:39:44connected to the CEO? Because if the CEO
  5222. 2:39:46had access to 100 employees and he was
  5223. 2:39:48given a task from his client, it would
  5224. 2:39:50be hard for him to know exactly who to
  5225. 2:39:52assign it to. He would get it wrong on
  5226. 2:39:53most of the time, or some of the time.
  5227. 2:39:55And so, when we want to minimize errors,
  5228. 2:39:57we want to assign a head of department
  5229. 2:40:00for that specific role and let him
  5230. 2:40:02figure out who to give it only for the
  5231. 2:40:04employees in his department, right? So,
  5232. 2:40:06the tools are only connected to the
  5233. 2:40:07calendar agent for the calendar tools.
  5234. 2:40:09Same thing with emails, blogs, and
  5235. 2:40:11contacts as well. And so, what ends up
  5236. 2:40:13happening here is that we have a big AI
  5237. 2:40:15agent and all of these are subset of
  5238. 2:40:18this. So, this is one, which is the same
  5239. 2:40:20thing as this. This is one, which is the
  5240. 2:40:22same thing as this. This and this as
  5241. 2:40:23well. The only difference is that the
  5242. 2:40:25memory is only connected to the main AI
  5243. 2:40:27agent.
  5244. 2:40:28And so, here we have Telegram, which is
  5245. 2:40:30the input. So, we can give it a voice
  5246. 2:40:31message or even a text. All right, so
  5247. 2:40:33here we have Telegram, which is the
  5248. 2:40:35input. And we have the whole AI agent.
  5249. 2:40:37And let's say now I wanted to uh send an
  5250. 2:40:40email
  5251. 2:40:41and schedule a calendar event.
  5252. 2:40:44As you can see, we also have the contact
  5253. 2:40:46agent, which in this case we instruct
  5254. 2:40:48the main agent to always look at the
  5255. 2:40:49contact agent before sending the email
  5256. 2:40:51and before making the calendar event
  5257. 2:40:53because this contains the detail of the
  5258. 2:40:54person that we're doing all this for. As
  5259. 2:40:56you can see here, the contact database
  5260. 2:40:57consists of Michael James, John Laurie,
  5261. 2:40:59and James Low. So, we can first run
  5262. 2:41:01this.
  5263. 2:41:02So, now it's waiting for the messages to
  5264. 2:41:03come through.
  5265. 2:41:05And now with Telegram, we can say, "Send
  5266. 2:41:07an email to Michael James uh telling him
  5267. 2:41:09that we have dinner tomorrow at 5:00
  5268. 2:41:10p.m. And can you also put that on the
  5269. 2:41:12calendar and invite him as well?" Um
  5270. 2:41:14yeah, that's it. All right, so now we
  5271. 2:41:15give it an input. Let's press enter.
  5272. 2:41:17What this will now do is it will then go
  5273. 2:41:19to the AI agent, it will then talk to
  5274. 2:41:21the contact agent because we instructed
  5275. 2:41:23it to use the contact agent first before
  5276. 2:41:25doing anything else.
  5277. 2:41:26And now it will take action on the
  5278. 2:41:27email.
  5279. 2:41:28As you can see, it used this tool, which
  5280. 2:41:29is send an email, and then it sent it to
  5281. 2:41:31calendar agent at the same time to
  5282. 2:41:33create an event. Now, if I go to my
  5283. 2:41:35email right here, I can see that I have
  5284. 2:41:36dinner tomorrow.
  5285. 2:41:37Yeah, dinner tomorrow at 5:00 p.m. And
  5286. 2:41:39my calendar, I can see that I should
  5287. 2:41:41have dinner with Michael James at 4:00
  5288. 2:41:43to 5:00 p.m. And it also invited his
  5289. 2:41:46email as well,
  5290. 2:41:47which is nuts. So, why is this any
  5291. 2:41:50different from the previous one? Well,
  5292. 2:41:52this is a very very simplistic version
  5293. 2:41:54of an AI agent, whilst this is more
  5294. 2:41:56advanced, has more features, and it
  5295. 2:41:59breaks down the different steps step by
  5296. 2:42:01step, right? As I mentioned, we have the
  5297. 2:42:02CEO and we have the head of departments.
  5298. 2:42:04And the head of departments are
  5299. 2:42:05connected to different tools. And these
  5300. 2:42:06tools are employees, right? Instead of
  5301. 2:42:08giving all the employees and hooking
  5302. 2:42:10them all up to this tool. Because then
  5303. 2:42:12it will overwhelm the AI agent. It has
  5304. 2:42:14to way too many options. The prompt will
  5305. 2:42:15be way too big. And so, we basically
  5306. 2:42:17want to construct it or deconstruct it
  5307. 2:42:20and break it apart for it to actually
  5308. 2:42:21have room for thinking when it's taking
  5309. 2:42:24the action that it needs to take. And
  5310. 2:42:25so, this is really really powerful
  5311. 2:42:26because just by having this one input,
  5312. 2:42:29it can lead to what over over 10, 12
  5313. 2:42:33actions, right? Which is nuts, which is
  5314. 2:42:35why AI agents are really really powerful
  5315. 2:42:38when you want to have something that's
  5316. 2:42:39autonomous. That's what they say it's
  5317. 2:42:41your virtual employee because your
  5318. 2:42:43virtual employee in this case is
  5319. 2:42:44connected to different tools, which are
  5320. 2:42:46different actions, and it can do
  5321. 2:42:47different things for you. But bear in
  5322. 2:42:49mind that if you want the AI agent to do
  5323. 2:42:50more things than you have right now,
  5324. 2:42:53then you have to connect it to more
  5325. 2:42:54tools and more softwares, right?
  5326. 2:42:56And what I always think about when I'm
  5327. 2:42:58building AI agents is
  5328. 2:42:59that we never want to overwhelm the the
  5329. 2:43:01AI agent, right? Because if you give it
  5330. 2:43:03a prompt that's super super long, it's
  5331. 2:43:05still AI, right? Like there's no 100%
  5332. 2:43:07fact or no 100% um
  5333. 2:43:09guarantee that it will always do the
  5334. 2:43:10same thing, and which is great, which is
  5335. 2:43:12fine when you're testing, but when
  5336. 2:43:13you're putting it into an actual
  5337. 2:43:14business, like the margin for error
  5338. 2:43:16needs to be very very very very small.
  5339. 2:43:18I'm talking like 0.0001%
  5340. 2:43:20>> [music]
  5341. 2:43:20>> chance it fails. Uh because it's in
  5342. 2:43:22production mode, businesses need to
  5343. 2:43:24actually operate, and so you don't want
  5344. 2:43:26something that sometimes work, that most
  5345. 2:43:28times works. You want something that
  5346. 2:43:29pretty much all the time works. By
  5347. 2:43:31pretty much, I mean like 99.99% of the
  5348. 2:43:33time works. Um but there's still
  5349. 2:43:35obviously that that thing of like AI not
  5350. 2:43:36being able to do everything, right? But
  5351. 2:43:39it's great that we can now chat to it
  5352. 2:43:40and it can now take action on everything
  5353. 2:43:42that we want. So, this right here is the
  5354. 2:43:43fundamentals of AI agents. Let me show
  5355. 2:43:45you another example of AI agents and
  5356. 2:43:46where these can come from. I can simply
  5357. 2:43:48go to ChatGPT and I can just search up
  5358. 2:43:50agent mode. So, agents are pretty much
  5359. 2:43:52everywhere because a lot of these
  5360. 2:43:53software tools, they're implementing
  5361. 2:43:55these sort of autonomous systems where
  5362. 2:43:57you can just say,
  5363. 2:43:58"Can you
  5364. 2:44:00go to Google
  5365. 2:44:02and find the top five marketing agencies
  5366. 2:44:06in
  5367. 2:44:07Ontario, Canada?" And just by this
  5368. 2:44:09prompt right here, what it does is that
  5369. 2:44:11it thinks through. So, it thinks through
  5370. 2:44:13the actual task, and then it takes
  5371. 2:44:15action on the thing that we told it to
  5372. 2:44:16do. So, now it's thinking,
  5373. 2:44:18which is the exact same with As in, it
  5374. 2:44:20has a brain that it thinks through. So,
  5375. 2:44:22as you can see now, it's cross-checking,
  5376. 2:44:23it's doing a ton of research uh for us.
  5377. 2:44:26And the good thing is that we can see it
  5378. 2:44:27live what it's doing, which is amazing.
  5379. 2:44:29And one step above of this is I can
  5380. 2:44:31actually take actions on our softwares.
  5381. 2:44:34>> [music]
  5382. 2:44:34>> So, this right here is obviously going
  5383. 2:44:35to Google on its own, but we can say,
  5384. 2:44:37"Hey, go to my Notion and create a
  5385. 2:44:38task." Or go here and do something else.
  5386. 2:44:40All right, as you can see here, we got
  5387. 2:44:41the different agencies, the location,
  5388. 2:44:43the key specialties, and the evidence as
  5389. 2:44:44well with all the different sources
  5390. 2:44:47and the summary as well,
  5391. 2:44:48which is crazy. As in, we gave it a
  5392. 2:44:50simple prompt, "Can you go to Google and
  5393. 2:44:52find the top five marketing agencies in
  5394. 2:44:53Ontario, Canada?" This is something that
  5395. 2:44:54you give to an employee,
  5396. 2:44:56and it just did it for 2 minutes. And it
  5397. 2:44:58did a ton of research as well.
  5398. 2:45:00All right, so that's exactly why AI
  5399. 2:45:01agents are so powerful because whether
  5400. 2:45:02it's ChatGPT, whether it's Any AI
  5401. 2:45:05agents, whether it's Relevans, whether
  5402. 2:45:06it's Lovable, whether it's Gemini
  5403. 2:45:07Canvas, right? Like we all have
  5404. 2:45:09different uh the AI agent fundamentals
  5405. 2:45:11don't change.
  5406. 2:45:12They don't change because they all have
  5407. 2:45:13an input, they all have an output, and
  5408. 2:45:15the middle part is the thing that really
  5409. 2:45:17drives the value because it takes action
  5410. 2:45:19on us without us having to be so
  5411. 2:45:21explicit with the instructions or with
  5412. 2:45:23the input that we give it. If you're
  5413. 2:45:24enjoying this course so far, then you're
  5414. 2:45:25going to love the community that we have
  5415. 2:45:27right here, which is the AI Automation
  5416. 2:45:29Circle. It's a space with over 3,000
  5417. 2:45:31individuals or legends looking to learn
  5418. 2:45:34AI automations from zero either to apply
  5419. 2:45:37it in their own business or start
  5420. 2:45:38selling it to businesses or start their
  5421. 2:45:41AI automation agency. People introduce
  5422. 2:45:42themselves every single day, they ask
  5423. 2:45:44questions, they share wins. We have
  5424. 2:45:46unlimited tech support, we have all the
  5425. 2:45:48YouTube resources, and people looking
  5426. 2:45:49for jobs and partnerships. And if I go
  5427. 2:45:51to classroom, we also have a AI
  5428. 2:45:53Automations 101 course, which is a mini
  5429. 2:45:55course on AI automations, very similar
  5430. 2:45:57to this one, but that dives deeper into
  5431. 2:45:59more frameworks that we use when we're
  5432. 2:46:01applying automations to businesses. We
  5433. 2:46:03have templates vault, which is a library
  5434. 2:46:05of all the different automations that we
  5435. 2:46:07built so far on YouTube, as well as the
  5436. 2:46:09blueprints as well. We have weekly
  5437. 2:46:11recordings because we have two calls a
  5438. 2:46:12week, and you have all the recordings
  5439. 2:46:14here, and you also have over $20,000 in
  5440. 2:46:16discounts with softwares across no-code
  5441. 2:46:19automations, across project management,
  5442. 2:46:21across AI tools, across marketing, LLM,
  5443. 2:46:24and other tools as well. As I said, you
  5444. 2:46:25have two calls a week, and our members
  5445. 2:46:27are spread out everywhere in the world,
  5446. 2:46:29which is literally awesome to see. If
  5447. 2:46:31you want to join, check the second link
  5448. 2:46:32down below.
  5449. 2:46:36So, in this video, I'm going to show you
  5450. 2:46:37step-by-step everything that you need to
  5451. 2:46:39know about building your first AI agent
  5452. 2:46:41on Any. So, today you're not just
  5453. 2:46:43watching me build it, but I'm walking
  5454. 2:46:44you through my thinking, showing you the
  5455. 2:46:45shortcuts and the mistakes. So, by the
  5456. 2:46:47end, you'll be able to build your own AI
  5457. 2:46:49agent with confidence. Let's dive in.
  5458. 2:46:51All right, so before we get to the
  5459. 2:46:52actual build and showing you Any, on a
  5460. 2:46:54high level, what an AI agent is
  5461. 2:46:56something that has an input and has an
  5462. 2:46:58output. In between the input and the
  5463. 2:46:59output, it does a series of actions. So,
  5464. 2:47:01for example, the input could be, "Can
  5465. 2:47:03you draft an email?" Right, you send
  5466. 2:47:04that input over to the AI agent, which
  5467. 2:47:07has instructions, has a system prompt,
  5468. 2:47:10and based on what you tell it, so let's
  5469. 2:47:11say draft an email like I mentioned, it
  5470. 2:47:13consults with the brain and LLM based on
  5471. 2:47:15the instructions it was given, "Okay, he
  5472. 2:47:17just told me to draft an email, um what
  5473. 2:47:19do we do?" And then based on the
  5474. 2:47:20instructions and based on what it has to
  5475. 2:47:22do, so for example, if he says draft an
  5476. 2:47:23email, then talk to Gmail. If he says
  5477. 2:47:26check all the calendar events, talk to
  5478. 2:47:27Google Calendar, right? Based on the
  5479. 2:47:29obviously the instruction it was given,
  5480. 2:47:30it will then talk to the tools. It will
  5481. 2:47:31send a request to the right tool that it
  5482. 2:47:33needs. In this case, it will be Gmail if
  5483. 2:47:35it has to be draft an email. So, it will
  5484. 2:47:36send a request to tools, to Gmail, and
  5485. 2:47:39then from the Gmail, it will get a
  5486. 2:47:40response, which would be like, "Hey,
  5487. 2:47:41200," which means successful, and it
  5488. 2:47:43will then give us the output, which is,
  5489. 2:47:45"Hey, it was all good. I was drafted.
  5490. 2:47:47Check your inbox or whatever," right?
  5491. 2:47:48So, input, output, uh system prompts,
  5492. 2:47:50instructions that we tell it every
  5493. 2:47:51single time like, "Hey, if this happens,
  5494. 2:47:53do this. If that happens, do that."
  5495. 2:47:54Brain LLM is essentially what the AI
  5496. 2:47:57agent is using to think, right? The
  5497. 2:47:59OpenAI or Claude or whatever it is. And
  5498. 2:48:01then the memory itself basically is
  5499. 2:48:03important because it actually remembers
  5500. 2:48:05the previous questions that we asked it.
  5501. 2:48:06So, let's say the first question is,
  5502. 2:48:07"How are you?" Then we ask it, "Hey, uh
  5503. 2:48:09can you draft an email for me?" On the
  5504. 2:48:11third try, we ask it, "Hey, what did I
  5505. 2:48:12ask you on the first on the first
  5506. 2:48:13question?" It will remember because it
  5507. 2:48:15has a context window. That's what we
  5508. 2:48:16call it. That's what the memory is. So,
  5509. 2:48:18input is, "Hey, can you do this?" AI
  5510. 2:48:20agent thinks through the instructions
  5511. 2:48:21that we will give it through the system
  5512. 2:48:22prompt. It will then talk to the AI
  5513. 2:48:24because that's how it thinks, that's his
  5514. 2:48:25brain. And then it will use any tool
  5515. 2:48:28that is connected to it that it needs to
  5516. 2:48:30use for that specific task. It also has
  5517. 2:48:32a context window. And it will give us
  5518. 2:48:33the output. Okay, so that's on a high
  5519. 2:48:34level what an AI agent is. So, the first
  5520. 2:48:36step to building an AI agent is going to
  5521. 2:48:38n8n and pressing sign in. You'll have to
  5522. 2:48:40make an account. There is a free
  5523. 2:48:41account, but I believe it's 14 days free
  5524. 2:48:43trial. So, after 14 days you're going to
  5525. 2:48:44have to pay. That's the way they have it
  5526. 2:48:45set up. Not really a big fan. Much
  5527. 2:48:47rather have Zapier or make a account.
  5528. 2:48:48Definitely has a free plan to start.
  5529. 2:48:50But, um n8n right here, you will come to
  5530. 2:48:52this page when you sign up. All you have
  5531. 2:48:53to do is press open instance.
  5532. 2:48:56And you'll come to this page right here.
  5533. 2:48:57Now, this page is essentially the
  5534. 2:48:58dashboard of n8n. This is what n8n looks
  5535. 2:49:00like. Uh right here on the left-hand
  5536. 2:49:01side you get to see home, personal,
  5537. 2:49:02which is in case you want to divide
  5538. 2:49:04different things in different folders.
  5539. 2:49:05Uh you have your different automations
  5540. 2:49:07here, credentials, executions. Uh these
  5541. 2:49:10are some different metrics that they
  5542. 2:49:11track. Um just you know exactly what
  5543. 2:49:13you're doing within your workspace. And
  5544. 2:49:14then, right here, this is where you want
  5545. 2:49:16to press create workflow because this is
  5546. 2:49:18the canvas for n8n. This is where
  5547. 2:49:20everything starts. The automation starts
  5548. 2:49:21here.
  5549. 2:49:22On [snorts] the down hand side, we have
  5550. 2:49:23this right here where we can basically
  5551. 2:49:25move the automation around. We have
  5552. 2:49:26zoom, we have um zoom out. We have go
  5553. 2:49:30back, we have basically if the
  5554. 2:49:32automation's here, it brings it all back
  5555. 2:49:33to the center. So, that's what this
  5556. 2:49:34button does. It's tidy tidy up here,
  5557. 2:49:36which also has keyboard shortcuts. Then
  5558. 2:49:38we go to editor right here, which is
  5559. 2:49:39where you can edit the automation,
  5560. 2:49:41executions, where you can see all the
  5561. 2:49:42different executions that you've done.
  5562. 2:49:44So, execution just means you run the
  5563. 2:49:46automation from start to the end. You
  5564. 2:49:48can see all the executions here. And
  5565. 2:49:49then, evaluations is just for some
  5566. 2:49:50testing. I don't use it that much, so
  5567. 2:49:52don't worry you worry about that. Then
  5568. 2:49:53you have this button right here where if
  5569. 2:49:54you toggle this on, it will activate the
  5570. 2:49:56automation. And what it means is that
  5571. 2:49:58when you build an automation from start
  5572. 2:49:59to the end, um you can activate it so
  5573. 2:50:01you don't have to run it once every
  5574. 2:50:02single time. Right, it's production. It
  5575. 2:50:04happens every single time without you
  5576. 2:50:05having to go to n8n.
  5577. 2:50:06>> [clears throat]
  5578. 2:50:07>> Then share, you can share, save, you can
  5579. 2:50:08save the automation. Then right here,
  5580. 2:50:09you can actually download the
  5581. 2:50:11automation. Uh and you can import from
  5582. 2:50:13file. So, let's say I download this
  5583. 2:50:14automation, I then give it to you and
  5584. 2:50:17you import it into your own n8n, you'll
  5585. 2:50:18have the automation done for you and you
  5586. 2:50:20don't have to worry about it. So, that's
  5587. 2:50:21how n8n automations and n8n workflows
  5588. 2:50:23really work. Then, right here you can
  5589. 2:50:24see that you have plus, which is
  5590. 2:50:25basically where you can add the
  5591. 2:50:28different steps to the automation.
  5592. 2:50:30Then we have this right here, which is
  5593. 2:50:32add sticky notes in case you want to add
  5594. 2:50:33sticky notes right here. And you want to
  5595. 2:50:36sort of walk you through. That's good
  5596. 2:50:37for documentation in case you're
  5597. 2:50:38building an automation, you want to
  5598. 2:50:39explain to someone who hasn't really
  5599. 2:50:41seen the automation how it works, you
  5600. 2:50:42can just put sticky notes here.
  5601. 2:50:44And then here, you can have the side
  5602. 2:50:46panel. And then here, you also have the
  5603. 2:50:47AI assistant, which is one of the best
  5604. 2:50:49I've seen so far uh within n8n. Um and
  5605. 2:50:51it actually answers most of the
  5606. 2:50:52technical questions that you have. All
  5607. 2:50:53right, cool. So, now that we got through
  5608. 2:50:55all the part, let's start with adding
  5609. 2:50:56the first step. So, this right here is a
  5610. 2:50:57node. Like this square right here is a
  5611. 2:50:59node.
  5612. 2:51:00When we press on this node, we get this
  5613. 2:51:02panel right here. Now, in order for us
  5614. 2:51:03to build an n8n agent, we ideally want
  5615. 2:51:05to talk to the agent itself, right? We
  5616. 2:51:07want to chat with it. So, the trigger it
  5617. 2:51:09basically means what's the first thing
  5618. 2:51:10that actually starts the workflow? Like
  5619. 2:51:12what is that thing that activates, that
  5620. 2:51:14starts everything? So, in this case we
  5621. 2:51:15can trigger manually, which means that
  5622. 2:51:16you can, let's say you go here, you can
  5623. 2:51:18execute workflow, which means that it
  5624. 2:51:19starts the automation. And this just
  5625. 2:51:21executes the automation, starts the
  5626. 2:51:23automation from scratch. But, this isn't
  5627. 2:51:25really best for us when using an AI
  5628. 2:51:27agent because we have to trigger
  5629. 2:51:29manually every single time.
  5630. 2:51:31Then we have on app event, uh on a
  5631. 2:51:33schedule, which means you can run it
  5632. 2:51:34every day or every hour. This is based
  5633. 2:51:35on apps. Then we have a webhook here,
  5634. 2:51:37which is where you can use webhooks to
  5635. 2:51:39get notified. We can use a form, we can
  5636. 2:51:41use when executed by another workflow,
  5637. 2:51:43and then we can have chat message or
  5638. 2:51:45running evaluation and other ways as
  5639. 2:51:46well. Now, for AI agents specifically,
  5640. 2:51:48we're going to use on chat message,
  5641. 2:51:49which means that you can actually talk
  5642. 2:51:50to the AI agent itself. So, let's say I
  5643. 2:51:52open the chat, I can then start talking.
  5644. 2:51:54This is basically what's going to start
  5645. 2:51:56the automation. So, let's say again, I
  5646. 2:51:57just put hello,
  5647. 2:51:59it will start the automation. So, the
  5648. 2:52:00node executed successfully. This means
  5649. 2:52:02everything was good. And you can see the
  5650. 2:52:03green mark, which means that
  5651. 2:52:04everything's good. All right. So, in
  5652. 2:52:06order for us to then connect this chat
  5653. 2:52:08message because ideally we want to talk
  5654. 2:52:09to the AI agent. We don't just want to
  5655. 2:52:10talk to n8n, right? We want something
  5656. 2:52:12out of it. We want to press plus.
  5657. 2:52:14And then,
  5658. 2:52:16we have different options here. Now, the
  5659. 2:52:17options are AI, which is what we're
  5660. 2:52:19going to use, action in apps, so you can
  5661. 2:52:20actually scroll through all the apps
  5662. 2:52:22here and you can add any apps here. Data
  5663. 2:52:24transformation, flow, core, human in the
  5664. 2:52:26loop, and another trigger, which are
  5665. 2:52:27cool things that you actually can use.
  5666. 2:52:28But, for the sake of this video and AI
  5667. 2:52:30agents, we're not going to go into that.
  5668. 2:52:31But, let's say we press AI.
  5669. 2:52:33We then have different options. We want
  5670. 2:52:35to press AI agent. Now, you can simply
  5671. 2:52:37talk to Anthropic, which is Claude. You
  5672. 2:52:38can talk to OpenAI individually or
  5673. 2:52:40Gemini. But, for this case, the AI agent
  5674. 2:52:43uh node is exactly what we want.
  5675. 2:52:45So, when we press the AI agent node, uh
  5676. 2:52:48which is obviously the node is just a
  5677. 2:52:49square, this thing will come up. Now,
  5678. 2:52:51the way that n8n is actually set up,
  5679. 2:52:52which is probably one of the best
  5680. 2:52:53platforms that I've seen,
  5681. 2:52:55they have the input here, which is the
  5682. 2:52:57steps from the previous
  5683. 2:52:59so, the variables or the things, the
  5684. 2:53:00output from the previous step. Then
  5685. 2:53:02here, so this is the input. Then we have
  5686. 2:53:04here the configuration of the AI agent.
  5687. 2:53:05This is how we set everything up. And
  5688. 2:53:07then here is the output. So, what is the
  5689. 2:53:09output of the AI agent? So, going here,
  5690. 2:53:11we have, again, by the diagram that I
  5691. 2:53:12showed you at the start, you have three
  5692. 2:53:14different things that you have to
  5693. 2:53:15connect the AI agent to. The first one
  5694. 2:53:16is a chat model. So, what chat model, so
  5695. 2:53:19in this case what LLM, OpenAI, Claude,
  5696. 2:53:20whatever it is, uh do you want to
  5697. 2:53:22connect the AI agents to? What memory do
  5698. 2:53:24you want to connect it to? And what
  5699. 2:53:25tools do you want to connect it to? So,
  5700. 2:53:27in this case, for chat model, I can just
  5701. 2:53:28press plus.
  5702. 2:53:30I can then have a choice of few future
  5703. 2:53:33models. In this case, we just go safe
  5704. 2:53:34with OpenAI. So, I can go here, OpenAI
  5705. 2:53:36chat model.
  5706. 2:53:37You'll have this page. All you have to
  5707. 2:53:39do to actually connect the OpenAI chat
  5708. 2:53:41model is go here to credentials.
  5709. 2:53:44Create a new credential. Now, in order
  5710. 2:53:45for us to actually connect OpenAI to
  5711. 2:53:47n8n, we need an API key. Now, API keys
  5712. 2:53:50API stands for application programming
  5713. 2:53:52interface. It's the way that a lot of
  5714. 2:53:53softwares talk to each other or how
  5715. 2:53:54softwares talk to each other. Uh and the
  5716. 2:53:56key itself allows us to authorize that
  5717. 2:53:58this is our account and we can actually
  5718. 2:54:00use it. So, in order for us to get the
  5719. 2:54:01API key, all we have to do is open the
  5720. 2:54:03docs. You can simply talk to the the AI
  5721. 2:54:05assistant in n8n. But, in this case we
  5722. 2:54:07can just press open docs. This will open
  5723. 2:54:09the documentation for n8n, which is
  5724. 2:54:12where we can look at this. Now,
  5725. 2:54:14it says refer to the OpenAI API
  5726. 2:54:16documentation. Uh API keys Okay. So, all
  5727. 2:54:19you have to do is log in to OpenAI
  5728. 2:54:20account, which is essentially platform
  5729. 2:54:23.the openai.com.
  5730. 2:54:26You'll have to make an account. So, sign
  5731. 2:54:27in with Google. And by the way, just
  5732. 2:54:29because you pay for ChatGPT, does not
  5733. 2:54:30mean that you can use this. Different
  5734. 2:54:32things, right? Different things. One is
  5735. 2:54:34for the web and one is for APIs. So,
  5736. 2:54:36once you log in, you'll have you'll come
  5737. 2:54:37on this page. All you have to go to is
  5738. 2:54:39dashboard. On the left-hand side, you
  5739. 2:54:41have to go to API keys. And this is
  5740. 2:54:42where we can create a secret key.
  5741. 2:54:44So, go here.
  5742. 2:54:45Let's do test YouTube.
  5743. 2:54:49And I can create a key. So, leave this
  5744. 2:54:50all here, owned by me, all restrictions.
  5745. 2:54:52Project is fine. Let's create a secret
  5746. 2:54:54key.
  5747. 2:54:55I want to copy it
  5748. 2:54:58and then paste it in n8n right here.
  5749. 2:55:01Paste it here.
  5750. 2:55:02And if I press save,
  5751. 2:55:04this will save.
  5752. 2:55:05Right, connection tested successfully.
  5753. 2:55:07So, now the OpenAI is actually connected
  5754. 2:55:09to this. Now, for the model itself, I
  5755. 2:55:11want to leave this to GPT-4.1.
  5756. 2:55:13You can use a bunch of models. Now, bear
  5757. 2:55:15in mind that not all models work with AI
  5758. 2:55:16agents. They might work with a normal AI
  5759. 2:55:18node that you can use AI in the process
  5760. 2:55:21for a workflow. But, for AI agents, not
  5761. 2:55:22all of them work. So, in this case,
  5762. 2:55:23leave this as GPT-4.1 mini. Uh and then
  5763. 2:55:26we go. Okay. So, in this case, now we
  5764. 2:55:28connected the OpenAI chat model to the
  5765. 2:55:29AI agent. And then we go on to memory.
  5766. 2:55:31Now, memory is basically saying what
  5767. 2:55:32memory do you want to implement in the
  5768. 2:55:34AI agent so that it remembers the
  5769. 2:55:36conversation that we're having. So, if I
  5770. 2:55:37press simple memory right here, you'll
  5771. 2:55:39have you'll come on this page and you
  5772. 2:55:41have the session ID, which just leave
  5773. 2:55:43this as this because we want it to
  5774. 2:55:44connect to the chat trigger node. Uh the
  5775. 2:55:46session key from previous node, leave
  5776. 2:55:48this as is. You don't need to modify
  5777. 2:55:49this. Well, I mean, we can't in the
  5778. 2:55:50first place. And then it's asking us for
  5779. 2:55:52the context window length. Now, the
  5780. 2:55:54context window length just means how
  5781. 2:55:55many past interactions does the model
  5782. 2:55:57receive as context? Now, what does this
  5783. 2:55:59actually mean? Let's say we say hello
  5784. 2:56:00and then it says, "Hello, how are you?"
  5785. 2:56:03Good. That's four different uh
  5786. 2:56:05interactions that we've had, right? So,
  5787. 2:56:06four different things, four different
  5788. 2:56:08messages uh as a total. So, you want to
  5789. 2:56:09make sure that the context window is a
  5790. 2:56:11bit larger in in cases where you want
  5791. 2:56:13the AI to actually remember the previous
  5792. 2:56:15conversation, in case you want to change
  5793. 2:56:17some things. Um so, that's what the
  5794. 2:56:18context window length is for. Now, I
  5795. 2:56:20want to leave this at five just to keep
  5796. 2:56:21it simple. Again, don't change any of
  5797. 2:56:23these, just put five here and that's all
  5798. 2:56:24good. And now the AI agent can actually
  5799. 2:56:26have a memory. And then we have tools
  5800. 2:56:28itself. Like tools are essentially
  5801. 2:56:30softwares that we connect to the AI
  5802. 2:56:32agent so when we say draft an email, it
  5803. 2:56:35will go to the software and actually do
  5804. 2:56:36it. But, it needs to be connected to the
  5805. 2:56:37software in the first place. So, for
  5806. 2:56:39today,
  5807. 2:56:40let's uh let's make an AI agent that can
  5808. 2:56:43draft an email and that can get calendar
  5809. 2:56:45events. I think that's the pretty the
  5810. 2:56:47most straightforward one. So, all we
  5811. 2:56:48have to do is to connect the tool is
  5812. 2:56:50first, for email, we have to connect
  5813. 2:56:51Gmail. And for calendar, we have to
  5814. 2:56:52connect Google Calendar.
  5815. 2:56:54So, we press plus.
  5816. 2:56:56And now it's going to ask us to do
  5817. 2:56:57different things. In this case, we just
  5818. 2:56:59want to connect it to other tools. So,
  5819. 2:57:01in this case we have a lot of
  5820. 2:57:02integrations, a lot of softwares.
  5821. 2:57:04We can see we have Asana, Apify, Claude,
  5822. 2:57:07Airtable. In this case, let's search for
  5823. 2:57:09Gmail.
  5824. 2:57:10And we have Gmail tool.
  5825. 2:57:12When we get to the Gmail tool, this is
  5826. 2:57:13how you connect Gmail to n8n. I go here
  5827. 2:57:17and I can press create a new credential.
  5828. 2:57:18When I press create a new credential,
  5829. 2:57:19it's very very straightforward. It used
  5830. 2:57:21to be harder before. All you have to do
  5831. 2:57:22now is actually just sign in with
  5832. 2:57:24Google. When you sign in with Google, it
  5833. 2:57:25will take you to this page right here.
  5834. 2:57:27You can choose which one you want. In
  5835. 2:57:28this case, let's just do this one here,
  5836. 2:57:30our work email. It will say connection
  5837. 2:57:32successful. Now, we can go back to n8n.
  5838. 2:57:34And you can see that the account was
  5839. 2:57:35connected. Now, name it whatever you
  5840. 2:57:36want and that's the name in there and
  5841. 2:57:38you can save it. Okay, that's how you
  5842. 2:57:39connect your Gmail to n8n.
  5843. 2:57:42So, once you have this, you can then put
  5844. 2:57:43tool description as set automatically,
  5845. 2:57:45that's fine. Then resource, let's just
  5846. 2:57:46put draft because you want to draft an
  5847. 2:57:49email, not actually send an email. And
  5848. 2:57:51then, for operation, you can put create,
  5849. 2:57:53that's fine. You're creating a draft.
  5850. 2:57:55And then, for the subject and the
  5851. 2:57:57message, which this is the subject of
  5852. 2:57:58the email and the message of the email,
  5853. 2:58:00we can press this little button right
  5854. 2:58:01here, which means that we let the model
  5855. 2:58:02define their favorite. So, we let the
  5856. 2:58:04model say, "Hey, based on what you've
  5857. 2:58:06given me, using AI, this is exactly what
  5858. 2:58:09the subject line's going to be." So, in
  5859. 2:58:10this case, let's just put this button
  5860. 2:58:11right here, which means that the
  5861. 2:58:12it will be defined automatically by the
  5862. 2:58:14model. And also this button right here.
  5863. 2:58:16So, that way when I tell it to draft an
  5864. 2:58:17email, I don't have to tell it exactly
  5865. 2:58:19what the subject line needs to be and I
  5866. 2:58:20don't have to tell it what the message
  5867. 2:58:22needs to be, right? Everything is just
  5868. 2:58:23straightforward, it does it on its own
  5869. 2:58:25based on the context that we give. Okay,
  5870. 2:58:26cool. And then leave this as text. Uh
  5871. 2:58:28you can use HTML, which is just a way to
  5872. 2:58:30make the emails fancy. Um and that's
  5873. 2:58:33fine. And then here, I think, yeah, we
  5874. 2:58:35have to add to email. So, to email
  5875. 2:58:36essentially, who are we sending the
  5876. 2:58:38email to that we're drafting? So, in
  5877. 2:58:39this case, you also want to put this
  5878. 2:58:41right here, let the model define the
  5879. 2:58:43parameter, because the AI agent actually
  5880. 2:58:45decides or knows the email, or it's
  5881. 2:58:48going to ask us the email that we need
  5882. 2:58:49to draft the email for. So, it will add
  5883. 2:58:51it here as well. And then we want to put
  5884. 2:58:52create a draft in Gmail, that's fine.
  5885. 2:58:54All right, cool. So, now we connected
  5886. 2:58:55Gmail to the AI agent. Now, let's do
  5887. 2:58:57calendar. So, go here, press plus,
  5888. 2:58:59and look for Google Calendar.
  5889. 2:59:03Google Calendar tool. To connect it, I
  5890. 2:59:04already connected, you can see
  5891. 2:59:05everything. But in this case, let's just
  5892. 2:59:07put create a new credential.
  5893. 2:59:08Sign in with Google again. Do the same
  5894. 2:59:10thing we did for Gmail, and it will
  5895. 2:59:11bring it all back.
  5896. 2:59:13You can close it. I think, yeah. Close
  5897. 2:59:15it. All right, so now that we connected
  5898. 2:59:17our account, all we have to do is set
  5899. 2:59:19this automatically, which is fine. The
  5900. 2:59:20resource will be event.
  5901. 2:59:22The operation will be get many, because
  5902. 2:59:24we're getting many events. You can see
  5903. 2:59:25here, you can retrieve many events from
  5904. 2:59:27a calendar, which is exactly what we
  5905. 2:59:28need. The calendar, which is mine, which
  5906. 2:59:30is fine. The limit will be 50, so 50
  5907. 2:59:32events can be retrieved at the same
  5908. 2:59:34time. And then it's asking us, what is
  5909. 2:59:36the time frame before and after?
  5910. 2:59:39In this case, because it's not fixed, we
  5911. 2:59:41just want AI. We want to let the model
  5912. 2:59:44define this, so based on what we tell
  5913. 2:59:45it. So, let's say we tell it tomorrow,
  5914. 2:59:47it will know that it's after yesterday.
  5915. 2:59:51So, after today, sorry, after today,
  5916. 2:59:52then before tomorrow or before in 2
  5917. 2:59:54days, right?
  5918. 2:59:55That's like the time frame between each
  5919. 2:59:57one. So, that's that's thing we want to
  5920. 2:59:58let the model do. All right. So, that
  5921. 3:00:00right there is how you connected the
  5922. 3:00:01different tools to the AI agent. So, we
  5923. 3:00:03have the chat model, we have the memory,
  5924. 3:00:04we have the tools, and now on to
  5925. 3:00:06probably the most important part is the
  5926. 3:00:07actual prompt, the system instructions
  5927. 3:00:10that we tell the AI agent. So, if you go
  5928. 3:00:11here, we have to add an option, which is
  5929. 3:00:13the system message.
  5930. 3:00:15So, the system message is essentially, I
  5931. 3:00:16mean, like this example, we're telling
  5932. 3:00:18the AI agent what it needs to do. So,
  5933. 3:00:20for the system message, I actually have
  5934. 3:00:21a structure that I use every single
  5935. 3:00:22time, which is this right here. First,
  5936. 3:00:25we say, you are a identity, so you are a
  5937. 3:00:28helpful intelligent assistant AI agent,
  5938. 3:00:31designed to handle various tasks
  5939. 3:00:32efficiently. Your primary role is to
  5940. 3:00:34task, so do to do the different tasks
  5941. 3:00:35that we have. In this case, it's draft
  5942. 3:00:36an email and get calendar events. You
  5943. 3:00:38have access to how many number of tools.
  5944. 3:00:40In this case, it's two, to help you
  5945. 3:00:42fulfill um requests. The first tool is
  5946. 3:00:45draft an email. So, what do you what
  5947. 3:00:47does it do? In this case, it will draft
  5948. 3:00:48an email. Second tool is calendar. In
  5949. 3:00:50this case, we have to get calendar
  5950. 3:00:51events. And then you say, when a task
  5951. 3:00:52requires you to use one or more tools,
  5952. 3:00:54make sure to identify which tool is most
  5953. 3:00:56appropriate, pass along the relevant
  5954. 3:00:57details, and execute the actions needed
  5955. 3:00:58to complete the task. Your goal is to be
  5956. 3:01:01proactive, precise, and organized in
  5957. 3:01:03managing these resources to provide a
  5958. 3:01:04smooth experience for the user. And then
  5959. 3:01:06we say, here is the current date and
  5960. 3:01:08time. Now, why do we say this? We say
  5961. 3:01:09the date and time of today, because AI
  5962. 3:01:11is actually not the best at guessing
  5963. 3:01:13what date it is today. So, we always
  5964. 3:01:15want to put this, especially when you're
  5965. 3:01:16including any any times into your emails
  5966. 3:01:19or any times into the calendar. Because
  5967. 3:01:20if we say tomorrow,
  5968. 3:01:22usually, it might mess up in knowing
  5969. 3:01:24what today is, right?
  5970. 3:01:26So, definitely it will get tomorrow
  5971. 3:01:27wrong. All right, so this is the prompt
  5972. 3:01:28that we have. Let's copy this. And by
  5973. 3:01:30the way, I left all the resources down
  5974. 3:01:31below, so you can copy this.
  5975. 3:01:34Want to go to N and N, and then I'm
  5976. 3:01:36going to delete this. I'm going to paste
  5977. 3:01:37this.
  5978. 3:01:38And I'm going to press this button right
  5979. 3:01:39here, which basically puts everything um
  5980. 3:01:41on a wider scale, so I can actually see
  5981. 3:01:43it. All right, so we have identity. So,
  5982. 3:01:44you are a
  5983. 3:01:46helpful
  5984. 3:01:51intelligent
  5985. 3:01:57intelligent executive assistant. Now, AI
  5986. 3:01:59agent designed to handle various tasks
  5987. 3:02:00efficiently.
  5988. 3:02:03Let's delete this and put
  5989. 3:02:05draft emails and
  5990. 3:02:08get calendar events.
  5991. 3:02:11You have access to two tools.
  5992. 3:02:14And then first tool is
  5993. 3:02:16Gmail.
  5994. 3:02:17Explanation is
  5995. 3:02:19Gmail will be used
  5996. 3:02:21to draft an email.
  5997. 3:02:24First
  5998. 3:02:25step is identify
  5999. 3:02:28what email we are
  6000. 3:02:31drafting the email to.
  6001. 3:02:34Then understanding
  6002. 3:02:38the context
  6003. 3:02:40of the email.
  6004. 3:02:43And then actually drafting it.
  6005. 3:02:47And then second tool will be
  6006. 3:02:49the calendar,
  6007. 3:02:52which will be
  6008. 3:02:53uh this tool
  6009. 3:02:57will be used to get calendar events
  6010. 3:03:02for any given time frame.
  6011. 3:03:05First,
  6012. 3:03:08understand
  6013. 3:03:10what the time frame is, and then
  6014. 3:03:13understand
  6015. 3:03:15what kind
  6016. 3:03:17of uh mm
  6017. 3:03:19then return
  6018. 3:03:22the calendar events.
  6019. 3:03:27Okay? So, why am I saying what I'm
  6020. 3:03:29giving extra instructions? So, I say the
  6021. 3:03:30first step is this, second step is this,
  6022. 3:03:32third step is this. It's because the
  6023. 3:03:33only downside to an AI agent is that
  6024. 3:03:35we're relying on a prompt to do things
  6025. 3:03:36for us. So, for us to actually implement
  6026. 3:03:38it and actually working 100% of the
  6027. 3:03:40time, we want to make sure that we give
  6028. 3:03:41it as clear instructions as possible.
  6029. 3:03:43So, in this case,
  6030. 3:03:45tools to get calendar events, and then
  6031. 3:03:46we leave this as here. Okay? And we go
  6032. 3:03:48here. All right, so this prompt is done.
  6033. 3:03:50All right, so the AI agent is
  6034. 3:03:51successfully set up.
  6035. 3:03:52Right, we have the prompt, the chat
  6036. 3:03:54model, the memory, so it remembers the
  6037. 3:03:56conversation, the Google Calendar, which
  6038. 3:03:58we can use to actually get events,
  6039. 3:04:00creating a draft using Gmail, and then
  6040. 3:04:01we can now actually test it. So, let's
  6041. 3:04:04go here.
  6042. 3:04:05Let me
  6043. 3:04:06go here.
  6044. 3:04:08Let me actually talk to it. Let me say,
  6045. 3:04:10hello, how are you?
  6046. 3:04:13It usually never likes this question.
  6047. 3:04:15It will talk to the chat model. It will
  6048. 3:04:16think through the things that I told it,
  6049. 3:04:18and it will say, hey, he just asked me
  6050. 3:04:19how I am. I'm not going to use any
  6051. 3:04:21calendar events or draft, because that's
  6052. 3:04:22not the instruction that was given. So,
  6053. 3:04:24this is the the thing about AI agents,
  6054. 3:04:25they're smart enough to understand. Let
  6055. 3:04:27me ask it, so you can see the memory.
  6056. 3:04:29What was the first question I asked? The
  6057. 3:04:33first question you asked was, hello, how
  6058. 3:04:34are you? So, you see how it remembers
  6059. 3:04:35previous ones?
  6060. 3:04:37That's the memory that it has. It has
  6061. 3:04:38the context window, like I mentioned.
  6062. 3:04:40All right, so now let's actually put
  6063. 3:04:41this to test. Let's create a draft on
  6064. 3:04:42the email.
  6065. 3:04:44Let's say, I want to create a draft
  6066. 3:04:48email draft.
  6067. 3:04:52So, it will think through this. Do I
  6068. 3:04:53have enough context to actually create
  6069. 3:04:55the email? And then it will ask me, hey,
  6070. 3:04:56the recipient email address, it needs a
  6071. 3:04:58subject line, it needs the message or
  6072. 3:04:59content you want to include in the
  6073. 3:05:00email. So, in this case, I'm going to
  6074. 3:05:01give it a email address. So, the email
  6075. 3:05:03address will be my email.
  6076. 3:05:05So, this is the email address right
  6077. 3:05:06here. And then in the email, just say
  6078. 3:05:10that I'm happy
  6079. 3:05:12you
  6080. 3:05:14are building automations
  6081. 3:05:16on N and N.
  6082. 3:05:18And that you are going
  6083. 3:05:20to take over the space.
  6084. 3:05:22There you go. Right, so we say this.
  6085. 3:05:24What it does is that now it has enough
  6086. 3:05:26context to actually draft the email. It
  6087. 3:05:28will send back an email saying, hey, or
  6088. 3:05:30send back a message saying, hey, I've
  6089. 3:05:31created a draft for you with the message
  6090. 3:05:33expressing the happiness about building
  6091. 3:05:34automations in N and N and comp. So, if
  6092. 3:05:36I go to my email now, right here, I can
  6093. 3:05:38see that I have drafted an email saying,
  6094. 3:05:40hey,
  6095. 3:05:41great to see your work on N and
  6096. 3:05:43automations. How many calendar I'm happy
  6097. 3:05:44you're building automations on N, you're
  6098. 3:05:45going to take over the space. Best
  6099. 3:05:46regards.
  6100. 3:05:47Right, and this was done using AI.
  6101. 3:05:49I just told it to the overall context of
  6102. 3:05:52the email, and it showed it did it did
  6103. 3:05:54the subject line, and it did the body of
  6104. 3:05:56the email, and it sent it to the email
  6105. 3:05:57that I told it to.
  6106. 3:05:59So, that right there is for the Gmail.
  6107. 3:06:01Like, thanks.
  6108. 3:06:02Thanks a lot.
  6109. 3:06:05All right, so let's do the calendar
  6110. 3:06:06events. So, let's say I Let's go to my
  6111. 3:06:08calendar. Let's see what I have on this
  6112. 3:06:09week. Okay, so this week I have
  6113. 3:06:11groceries tomorrow, and then I have
  6114. 3:06:12strategy session with James on the 21st.
  6115. 3:06:15These are all connected to different
  6116. 3:06:16accounts. So,
  6117. 3:06:18if I say, theoretically, can you get all
  6118. 3:06:20the calendars that I need
  6119. 3:06:21for or give me all the events that I
  6120. 3:06:23have on this week, it will say I have
  6121. 3:06:24Outschool,
  6122. 3:06:26I'll have strategy session, and I'll
  6123. 3:06:27have groceries.
  6124. 3:06:28Let's go here.
  6125. 3:06:30So, now I'm going to ask it, can I have
  6126. 3:06:33all
  6127. 3:06:34of the events I have going on
  6128. 3:06:37this week?
  6129. 3:06:39So, now what it does is that it talks to
  6130. 3:06:40the AI, goes to Google Calendar, pulls
  6131. 3:06:42it back. It takes a while because I have
  6132. 3:06:44three events or four. And it tells me
  6133. 3:06:46every single thing. So, I have Outschool
  6134. 3:06:48on August 14th, groceries on August
  6135. 3:06:5019th, strategy session with James on
  6136. 3:06:51August 21st,
  6137. 3:06:53uh and Outschool on August 24th. Now,
  6138. 3:06:55Outschool is something that I had today,
  6139. 3:06:57like this morning at 1:00 a.m.,
  6140. 3:06:59um which is why it tells it as well. Um
  6141. 3:07:00so, that's why it says the next day.
  6142. 3:07:03And it gives me all the events right
  6143. 3:07:04here. Right, so I don't have to go to
  6144. 3:07:05calendar. I can have an AI agent
  6145. 3:07:07actually pull this for me. Now, this
  6146. 3:07:08right here is a very very elementary
  6147. 3:07:09example. I just wanted to show you
  6148. 3:07:10exactly how you can build one step by
  6149. 3:07:12step, and we only have Google Calendar,
  6150. 3:07:14and we only have create a draft in
  6151. 3:07:14email, but we can add hundreds of more
  6152. 3:07:18softwares to this, which makes AI agents
  6153. 3:07:20incredibly powerful to use for
  6154. 3:07:22businesses, because it saves them the
  6155. 3:07:23time to have to go to the software to
  6156. 3:07:25find something, right?
  6157. 3:07:27So, very very good. Now, the most
  6158. 3:07:29important thing when it comes to the AI
  6159. 3:07:30agent is not the tools itself, is not
  6160. 3:07:31the memory or the model. It's the actual
  6161. 3:07:34prompt that you tell the AI agent to do,
  6162. 3:07:35because once you have 20 tools hooked
  6163. 3:07:37up, right, like these, once you have 20
  6164. 3:07:40or even 30 tools hooked up to the same
  6165. 3:07:42AI agent, it makes it incredibly
  6166. 3:07:43powerful, but it also increases the
  6167. 3:07:46error or the chance that it actually
  6168. 3:07:47errors out. Errors out just means that
  6169. 3:07:49it doesn't do what you want it to do.
  6170. 3:07:51Right, so you want to make sure that the
  6171. 3:07:52prompt itself is so so like 90% of your
  6172. 3:07:54time or 80% of your time should be spent
  6173. 3:07:56towards the prompt. Because you saw that
  6174. 3:07:57setting things up on Google Calendar and
  6175. 3:07:59Gmail is actually not the hard part.
  6176. 3:08:00Right, you want to make sure that what
  6177. 3:08:01you tell the AI agent to do, it actually
  6178. 3:08:03does it, so that's what the prompt it
  6179. 3:08:04does for you. Congrats on now being able
  6180. 3:08:06to understand and build your first AI
  6181. 3:08:08agent inside of N and N. In the next
  6182. 3:08:10section, we're actually going to make it
  6183. 3:08:11smarter. We'll dive deep into how you
  6184. 3:08:13can actually build high-performing,
  6185. 3:08:15scalable AI agents using advanced
  6186. 3:08:18frameworks and prompting techniques.
  6187. 3:08:20You'll discover how you can structure AI
  6188. 3:08:22agents using data tables, integrate them
  6189. 3:08:24with thousands of AI models, all within
  6190. 3:08:27one tool, and apply practical frameworks
  6191. 3:08:29that will make them 10 times smarter.
  6192. 3:08:31So, by the end you'll not only be
  6193. 3:08:32building agents, but you'll build actual
  6194. 3:08:34systems.
  6195. 3:08:41In this video, I'm going to show you
  6196. 3:08:43eight N8N AI agent hacks that I wish I
  6197. 3:08:45knew when I got started that will help
  6198. 3:08:47you build AI agents at three times the
  6199. 3:08:49speed and make them way more powerful.
  6200. 3:08:51All right, so here we have an agent in
  6201. 3:08:53N8N and the first hack is a you can
  6202. 3:08:55actually chat with, but you can make the
  6203. 3:08:57chat public available. Cuz tons of times
  6204. 3:08:59you can actually speak to the AI agent
  6205. 3:09:00like this, but what if you don't want to
  6206. 3:09:02go into N8N? What happens then? Do you
  6207. 3:09:04have to use Telegram? Do you have to use
  6208. 3:09:06WhatsApp? Well, in this case you can
  6209. 3:09:07actually get a link
  6210. 3:09:08using this button right here. You can
  6211. 3:09:10copy it. You can then make the actual
  6212. 3:09:13agent active, which means that you can
  6213. 3:09:15use it now. And if I paste it here, I
  6214. 3:09:17can see that now I can actually chat to
  6215. 3:09:18it as if it's a chatbot. Something that
  6216. 3:09:20most people don't know because that
  6217. 3:09:21hence why they connect this to a
  6218. 3:09:23Telegram or something else. Well, you
  6219. 3:09:24can actually just use this URL, which is
  6220. 3:09:26public, that you can chat with. Say,
  6221. 3:09:28"Hello."
  6222. 3:09:30And this will execute, right? If I go to
  6223. 3:09:32executions,
  6224. 3:09:33I can see that we just executed the
  6225. 3:09:35workflow.
  6226. 3:09:37Right? It went here. It used the
  6227. 3:09:38OpenRouter, which is the LLM, which is
  6228. 3:09:40its brain, and it gave us, "Hey, how can
  6229. 3:09:42I assist you today?" And let's say I
  6230. 3:09:43wanted to send a message in Gmail. I
  6231. 3:09:45said, "Send an email to
  6232. 3:09:46[email protected]."
  6233. 3:09:48And I press go.
  6234. 3:09:50So, we sent it a message.
  6235. 3:09:51And now it's asking us, "Sure, what
  6236. 3:09:53would you like the subject and message
  6237. 3:09:55email to be?"
  6238. 3:09:56As you can see here, again it ran. So,
  6239. 3:09:58if I refresh,
  6240. 3:10:02I can see that it ran again.
  6241. 3:10:06And the input was, "Send an email to
  6242. 3:10:08michele.035." And if I say that we have
  6243. 3:10:12dinner tomorrow,
  6244. 3:10:14I can go. This will just ask me the
  6245. 3:10:15subject line because of the fact that we
  6246. 3:10:17didn't prompt it, right? But let's say
  6247. 3:10:19it's dinner at 7:00 p.m.
  6248. 3:10:23And now you can see that the email about
  6249. 3:10:24having dinner at 7:00 p.m. has been
  6250. 3:10:26sent. So, if I go to my email,
  6251. 3:10:29I can see that we have dinner at 7:00
  6252. 3:10:31p.m. right here. All right, the second
  6253. 3:10:32set of hacks is within the brain of the
  6254. 3:10:35AI agent, which in this case is
  6255. 3:10:36OpenRouter. And in case you want to
  6256. 3:10:37watch how to connect OpenRouter to N8N,
  6257. 3:10:40check out the video up here. As you can
  6258. 3:10:41see here, we have all the models we can
  6259. 3:10:43think of, Gwen, Grok, ChatGPT, DeepSeek,
  6260. 3:10:45all that stuff. But the hacks is within
  6261. 3:10:48the options. So, we have all these
  6262. 3:10:50options that most people don't use
  6263. 3:10:51because they have no clue what they are.
  6264. 3:10:53So, the first one is frequency penalty.
  6265. 3:10:55So, the frequency penalty can either go
  6266. 3:10:56to, I believe, two
  6267. 3:10:58and it can either go to -2, right? So,
  6268. 3:11:01from -2 to 2. A lower value
  6269. 3:11:04tells ChatGPT, "Hey, can you make the
  6270. 3:11:06actual thing more repetitive?" Which
  6271. 3:11:07means whatever you're saying, use the
  6272. 3:11:09same kind of words. Whilst if I put two,
  6273. 3:11:11a higher value, it's more creative. So,
  6274. 3:11:14we're giving ChatGPT or the I'm saying
  6275. 3:11:15ChatGPT because we're using OpenAI, but
  6276. 3:11:18we're giving the brain or the AI agent
  6277. 3:11:19the ability to change how repetitive it
  6278. 3:11:22is with the answers that it gives us.
  6279. 3:11:24Then the second one is maximum number of
  6280. 3:11:26tokens. And so, a token is actually four
  6281. 3:11:27characters. So, if I put a token limit
  6282. 3:11:29of, let's say, 200, this would be
  6283. 3:11:32roughly 800 characters. Which means that
  6284. 3:11:34it will cut the actual text, the output
  6285. 3:11:36that the LLM in this case gives us. This
  6286. 3:11:39is great if you want to set a limit on
  6287. 3:11:40the amount of words that you want the
  6288. 3:11:42AI, in this case the brain, [music] to
  6289. 3:11:44give you to actually save money on
  6290. 3:11:46credits for the ChatGPT, Claude, Grok,
  6291. 3:11:48anything like that. The next one is
  6292. 3:11:50response format. So, we have text and we
  6293. 3:11:52have JSON. So, usually you would have
  6294. 3:11:54text, but JSON is great in case you want
  6295. 3:11:56to take some sort of input and structure
  6296. 3:11:58it in a way where we have variables come
  6297. 3:12:01out. All right, so let's say we have a
  6298. 3:12:03block of text which contains first name,
  6299. 3:12:04last name, and email, right? But it's
  6300. 3:12:06not structured, it's all within one
  6301. 3:12:07place. We use JSON to actually structure
  6302. 3:12:10it, so we can divide the first name,
  6303. 3:12:12divide the last name, and divide the
  6304. 3:12:13email. But usually we use text just
  6305. 3:12:14because of the fact that we also have
  6306. 3:12:16another hack, which allows you to do
  6307. 3:12:18that structuring thing that I just told
  6308. 3:12:19you about. Then we have presence
  6309. 3:12:20penalty. So, instead of words, in this
  6310. 3:12:23case it's the topic itself. So, if you
  6311. 3:12:25put a higher number, then it's more
  6312. 3:12:27creative. A lower number is more
  6313. 3:12:28repetitive. Then we have sampling
  6314. 3:12:30temperature. So, a lower temperature in
  6315. 3:12:31this case is more predictable and the
  6316. 3:12:34higher temperature is more creative. So,
  6317. 3:12:35we give AI the ability to be more
  6318. 3:12:37creative when giving us the output. Then
  6319. 3:12:39we have timeout. So, sometimes the AI
  6320. 3:12:41agent actually runs and the OpenRouter
  6321. 3:12:44starts running and it doesn't work,
  6322. 3:12:45right? It keeps on running and running
  6323. 3:12:46and running. Maybe there's some problem
  6324. 3:12:48with the server. So, what we say here is
  6325. 3:12:50we say, "Hey, you have 360,000
  6326. 3:12:53milliseconds, I assume?"
  6327. 3:12:54Maximum amount of time request, yeah,
  6328. 3:12:56milliseconds. Then we say, "Hey, you can
  6329. 3:12:58only go until this long and after that
  6330. 3:12:59just stop." It's just easier when you
  6331. 3:13:01want to error handle. Which means that
  6332. 3:13:02when something goes wrong, just stop the
  6333. 3:13:04workflow when it runs past a certain
  6334. 3:13:06time period. In this case it's 360,000
  6335. 3:13:08milliseconds
  6336. 3:13:09and we just stop. The next one is max
  6337. 3:13:11retries. So, sometimes you use
  6338. 3:13:13OpenRouter, the LLM, but it doesn't
  6339. 3:13:14work. So, you say, "Hey, if something
  6340. 3:13:16doesn't work, just try again this many
  6341. 3:13:18times." So, if you put 10,
  6342. 3:13:20then it will try again 10 times. Then we
  6343. 3:13:22have top P. As you can see here, if I go
  6344. 3:13:23hover, it says controls diversity. So,
  6345. 3:13:26it's controlling the diversity of the
  6346. 3:13:28output that we get from the LLM. All
  6347. 3:13:29right, the next hack is actually the
  6348. 3:13:31ability for AI to be able to enable a
  6349. 3:13:34fallback method. So, enable a fallback
  6350. 3:13:35method means that if this doesn't work,
  6351. 3:13:38we can actually add a new LLM as a
  6352. 3:13:40fallback, right? So, if I put OpenAI
  6353. 3:13:42here, that means that it will first try
  6354. 3:13:44here
  6355. 3:13:45and then it will try OpenAI. So, let's
  6356. 3:13:47say I go here and I add
  6357. 3:13:49a fake connection.
  6358. 3:13:51I do
  6359. 3:13:52michele. So, just do test.
  6360. 3:13:55Save. Let's do this. Test. Right, so
  6361. 3:13:58this is a fake credential. It shouldn't
  6362. 3:13:59work. If I go here and I chat to it,
  6363. 3:14:03hello.
  6364. 3:14:04What this will now do is that it will go
  6365. 3:14:06here, has an error, but it will try
  6366. 3:14:08again because it has a fallback LLM. And
  6367. 3:14:10so, that's amazing because sometimes the
  6368. 3:14:12first one doesn't work, but the second
  6369. 3:14:13one does. All right, the next one is
  6370. 3:14:14within the actual memory. So, if I go
  6371. 3:14:16inside, I can see that we have a context
  6372. 3:14:18window length. Which most people still
  6373. 3:14:19have no clue what it means. What this
  6374. 3:14:21means is that five this is the amount of
  6375. 3:14:24past interactions. So, let's say you
  6376. 3:14:26say, "Hey, how are you?" That's the
  6377. 3:14:28first interaction. It responds. [music]
  6378. 3:14:29Then you ask another question, which is,
  6379. 3:14:31"Can you send an email to John?" And
  6380. 3:14:33then, "Can you add a Google Sheet? Can
  6381. 3:14:34you add XYZ?" Right? Then it will get
  6382. 3:14:36the past interactions, which is your
  6383. 3:14:38questions, as context for the next
  6384. 3:14:41output. Right? So, if you put 10 or if
  6385. 3:14:44you put 15, then it will take more
  6386. 3:14:46interactions in the past that it will
  6387. 3:14:48use as context. Now, why do we want to
  6388. 3:14:50restrict this to about five to 10? It's
  6389. 3:14:53because the more interactions, the more
  6390. 3:14:56how would you put it? The more context
  6391. 3:14:57you give it, the more it can pull, the
  6392. 3:14:59more credits you use. And so, five I
  6393. 3:15:01think is a suitable amount of
  6394. 3:15:03interactions that we can use within the
  6395. 3:15:05AI agent. But you can increase or you
  6396. 3:15:07can decrease. The next hack is actually
  6397. 3:15:08within the tools. If I go here and I put
  6398. 3:15:11think,
  6399. 3:15:12I can see that I have a think tool,
  6400. 3:15:13which invites the AI agent to do some
  6401. 3:15:15thinking.
  6402. 3:15:16So, in theory the AI agent typically
  6403. 3:15:18thinks through what it needs to do using
  6404. 3:15:20its prompt or its LLM. In this case it
  6405. 3:15:22would be OpenRouter.
  6406. 3:15:23But we give it an additional tool, the
  6407. 3:15:26think tool, which allows it to think
  6408. 3:15:27even more. As you can see here, we have
  6409. 3:15:29a predefined prompt, which is prompt
  6410. 3:15:31that we never put before. It's already
  6411. 3:15:32here. Which has use a tool to think
  6412. 3:15:34about something. It will not obtain new
  6413. 3:15:35information or change the database, but
  6414. 3:15:37just append a thought to the log. Use it
  6415. 3:15:39when complex reasoning or some cash
  6416. 3:15:41memory is needed. And so, this right
  6417. 3:15:43here is the ultimate assistant AI agent
  6418. 3:15:44that I built, which is connected to a
  6419. 3:15:46contact agent, email agent, calendar
  6420. 3:15:48agent, and content creation agent. And
  6421. 3:15:50so, by feeding it the tool, which is the
  6422. 3:15:52think tool, it gives it the ability to
  6423. 3:15:55have a another step of reasoning.
  6424. 3:15:57Reasoning just means to think through
  6425. 3:15:58what it needs to do to then be able to
  6426. 3:16:00actually take the right action in the
  6427. 3:16:02right order. As opposed to not having
  6428. 3:16:03this and [music] just using the prompt
  6429. 3:16:05and using AI. Right? Sort of like that
  6430. 3:16:07extra step. And the next hack is
  6431. 3:16:09actually the ability for us to be able
  6432. 3:16:11to connect AI agents within the tools.
  6433. 3:16:13Cuz most times what you do is just
  6434. 3:16:15connect it to the software. So, Gmail
  6435. 3:16:17or you can connect it to an external
  6436. 3:16:19workflow. So, you say sub-workflow.
  6437. 3:16:21So, where is it? Sub
  6438. 3:16:23uh workflow
  6439. 3:16:25calling N8N workflow right here. Which
  6440. 3:16:27basically calls another workflow to take
  6441. 3:16:29action. But what if the workflow was
  6442. 3:16:32inside this workflow? Right? And well,
  6443. 3:16:33in this case, we have access to the
  6444. 3:16:35contact agent, which is another AI
  6445. 3:16:36agent, which is connected to more tools.
  6446. 3:16:38And the same thing with email agent,
  6447. 3:16:40calendar agent, and content creation
  6448. 3:16:41agent. This gives us the ability to be
  6449. 3:16:43more flexible in the
  6450. 3:16:46I guess AI agents that we build and have
  6451. 3:16:47that extra feature of not having to
  6452. 3:16:49build another AI agent in another
  6453. 3:16:51workflow and just have it all within
  6454. 3:16:53here. All right, so the next one is
  6455. 3:16:54actually within the tool softwares. So,
  6456. 3:16:56if I go in here to send a message, we
  6457. 3:16:58have to make the connection, we have to
  6458. 3:16:59do set automatically the action, the
  6459. 3:17:01thing that we're doing. And now we're
  6460. 3:17:02introduced to three different variables
  6461. 3:17:04that we have to do as an input. You can
  6462. 3:17:07put your email here, you can put the
  6463. 3:17:08subject line, and you can put the
  6464. 3:17:10message. But because of the fact that
  6465. 3:17:12it's a chatbot, so the input changes
  6466. 3:17:14over time, what we can do is press this
  6467. 3:17:16button right here, which lets AI in N8N
  6468. 3:17:19define the input. So, it defines what
  6469. 3:17:21goes in here so that you don't have to
  6470. 3:17:24put it manually. Right? You give AI the
  6471. 3:17:26ability to choose what goes in there as
  6472. 3:17:28an input for you to do it. And this
  6473. 3:17:30makes it so much easier for us to be
  6474. 3:17:32able to make AI agents because all we
  6475. 3:17:34have to do is literally just press this
  6476. 3:17:35button
  6477. 3:17:36for any parameter that comes through.
  6478. 3:17:38All right, the next hack is actually the
  6479. 3:17:39ability for multiple AI agents to be
  6480. 3:17:41connected to the same exact model. All
  6481. 3:17:44right, which you can see right here. We
  6482. 3:17:45have one step right here, which is not
  6483. 3:17:47an AI agent, it's just an AI step, which
  6484. 3:17:49is connected to a model and we can see
  6485. 3:17:51that all the AI agents are all connected
  6486. 3:17:54to the same exact thing. All right, so
  6487. 3:17:56the next hack is actually the ability
  6488. 3:17:57for us to use the structured output
  6489. 3:17:59parser, which allows us to be able to do
  6490. 3:18:01the thing that I mentioned before, which
  6491. 3:18:03is using JSON to take an unstructured
  6492. 3:18:06input. So, it can be a block of text,
  6493. 3:18:08can be whatever it is, and we structure
  6494. 3:18:09it in a way where it actually makes
  6495. 3:18:11sense. So, a variable. In this case we
  6496. 3:18:13have a human in the loop sales agent,
  6497. 3:18:15which drafts sales emails for us. So, I
  6498. 3:18:17put my name, my email, my company name,
  6499. 3:18:19intent, budget, project description, and
  6500. 3:18:21timeline. I can press submit. And what
  6501. 3:18:23this will now do is it will send it to
  6502. 3:18:24the Google Sheet. It will add it there
  6503. 3:18:26to our CRM. It will then talk to the
  6504. 3:18:27sales agent, which will speak to, first
  6505. 3:18:30of all, Claude, which is its brain, and
  6506. 3:18:32then it will then speak to the
  6507. 3:18:34structured output parser because that is
  6508. 3:18:36a thing that is going to help it to be
  6509. 3:18:38able to make the subject line and the
  6510. 3:18:40body of the email, which is then going
  6511. 3:18:41to be sent to our email. And if you go
  6512. 3:18:43right here, I can see that this was the
  6513. 3:18:46input, which is a block of text, and the
  6514. 3:18:48output was the email body and the
  6515. 3:18:50subject line as well. And if you're
  6516. 3:18:52wondering how we wrote this, you can
  6517. 3:18:54simply go to ChatGPT and ask it, "Hey,
  6518. 3:18:56can you draft me a input schema using
  6519. 3:18:58JSON that allows me to have a subject
  6520. 3:19:01line and the email body of the email?"
  6521. 3:19:03And that's exactly what you paste here,
  6522. 3:19:05and that's what the AI will use to then
  6523. 3:19:07give you the output that looks like this
  6524. 3:19:09from an input that looks like this. So,
  6525. 3:19:11that marks the end for the eight and a
  6526. 3:19:1210 AI agent hacks that I wish I knew
  6527. 3:19:14when I got started that makes your build
  6528. 3:19:17of AI agents much faster and way more
  6529. 3:19:19powerful.
  6530. 3:19:23Hey, in this video, I'm going to show
  6531. 3:19:24you four agentic frameworks that can
  6532. 3:19:25make your AI agents inside of AnyTask
  6533. 3:19:28faster, smarter, and way more scalable.
  6534. 3:19:30You see, most people try to build one
  6535. 3:19:31big agent that does everything, but
  6536. 3:19:33that's why it breaks, it slows you down,
  6537. 3:19:35and honestly, it's impossible to scale.
  6538. 3:19:37So, I'm going to walk you through each
  6539. 3:19:38framework step by step, show you exactly
  6540. 3:19:40how it works, when to use it, but also
  6541. 3:19:42when you can apply it within your
  6542. 3:19:43automations. With that being said, let's
  6543. 3:19:45dive in. All right, so the first
  6544. 3:19:46framework is the prompt chaining. So,
  6545. 3:19:48what this means is that you are using a
  6546. 3:19:50AI agent, and you're prompting it in a
  6547. 3:19:52chain. So, you're saying, "Hey, let's
  6548. 3:19:54use the AI agent for to do this first."
  6549. 3:19:56Then you chain it. Chain it just means
  6550. 3:19:57you connect it to the next AI agent,
  6551. 3:19:59which does another thing, and then chain
  6552. 3:20:01it to another AI agent, which does
  6553. 3:20:02another thing, and then you do whatever
  6554. 3:20:04you have to do. All right, so this right
  6555. 3:20:05here is what we call sequential
  6556. 3:20:06reasoning, where each AI agent um builds
  6557. 3:20:09on the previous output to refine
  6558. 3:20:10accuracy and context. So, this right
  6559. 3:20:12here is based on the output of this.
  6560. 3:20:14This right here is based on the output
  6561. 3:20:15of this, and so on. And this framework
  6562. 3:20:17is great for multi reasoning, um but I
  6563. 3:20:19want to show you exactly what that looks
  6564. 3:20:20like. So, right here we have a form,
  6565. 3:20:22which leads into the first AI agent, uh
  6566. 3:20:24which writes the outline for the blog.
  6567. 3:20:26Then it goes to the second AI agent,
  6568. 3:20:27which looks at the outline. It evaluates
  6569. 3:20:29how it is, and it changes it up. And
  6570. 3:20:31then we give it to the third AI agent,
  6571. 3:20:32which actually writes the blog before
  6572. 3:20:34putting the blog into a Google document
  6573. 3:20:36that we have access to. And so, if I go
  6574. 3:20:38here to execute workflow, I can put AI
  6575. 3:20:41in finance or whatever topic you want to
  6576. 3:20:42talk about. I can press submit. What
  6577. 3:20:44this will now do is that it will send
  6578. 3:20:45the data to the first AI agent. Right,
  6579. 3:20:48this is chaining prompts because we have
  6580. 3:20:50one prompt here, which does its own
  6581. 3:20:52output. Then it goes to the second one
  6582. 3:20:54to do its second output. And then
  6583. 3:20:56finally, it goes to the third AI agent,
  6584. 3:20:58again, prompt chaining. We're chaining
  6585. 3:21:00different prompts
  6586. 3:21:01um because these are a series of
  6587. 3:21:03different prompts. Right, this prompt is
  6588. 3:21:04just to make the outline. This prompt is
  6589. 3:21:05just to evaluate the outline. Whilst
  6590. 3:21:07this prompt is to actually make the full
  6591. 3:21:09blog based on the outline. Right, three
  6592. 3:21:11different prompts, but we're chaining it
  6593. 3:21:12together. And then finally, we will add
  6594. 3:21:14it to our Google document. As you can
  6595. 3:21:15see, we're finished. If I go here, this
  6596. 3:21:17is the blog that we get uh with all the
  6597. 3:21:19information from these different agents.
  6598. 3:21:22Now, don't get too fussed about the
  6599. 3:21:24actual quality of the blog. I just
  6600. 3:21:25wanted to show you exactly what the
  6601. 3:21:26framework is. But going inside here, for
  6602. 3:21:28example, we have the same prompt. So,
  6603. 3:21:29system message, this is one prompt with
  6604. 3:21:32the user message because the user
  6605. 3:21:33message is the thing that we actually
  6606. 3:21:34give it. The system message is basically
  6607. 3:21:36giving the AI agent context what it
  6608. 3:21:39needs to do in general,
  6609. 3:21:41which is then changed to the second
  6610. 3:21:43prompt, which is a different prompt
  6611. 3:21:44right here.
  6612. 3:21:46Right right here with a user prompt as
  6613. 3:21:48well.
  6614. 3:21:49And then we have the third AI agent with
  6615. 3:21:52another prompt,
  6616. 3:21:53which is the one right here. And yes,
  6617. 3:21:54these are very very small prompts just
  6618. 3:21:56to show you an example uh with the user
  6619. 3:21:57prompt as well,
  6620. 3:21:59which are all chained together. And one
  6621. 3:22:00main advantage to this framework as well
  6622. 3:22:03is that when you prompt chain, when you
  6623. 3:22:04add one step after the step after the
  6624. 3:22:06step as well, it's much easier to debug.
  6625. 3:22:08Debug just means that if something goes
  6626. 3:22:10wrong, how can you fix it? How can you
  6627. 3:22:12go there and fix it? Well, it's much
  6628. 3:22:14easier here because it's a linear.
  6629. 3:22:15Right, linear just means that it's one
  6630. 3:22:17line. Right, this is one line. It
  6631. 3:22:18doesn't go up and down. And so, when
  6632. 3:22:20there's a problem, it's much easier to
  6633. 3:22:21go here and fix it because you know
  6634. 3:22:23exactly what step it came from. The next
  6635. 3:22:25framework is called parallelization.
  6636. 3:22:26It's a big fancy word, uh which
  6637. 3:22:28basically means that we have multiple
  6638. 3:22:30agents. So, you can have three, four,
  6639. 3:22:31five, 10, 11, uh which are all working
  6640. 3:22:34simultaneously, which means at the same
  6641. 3:22:35time, on different tasks. Right? And so,
  6642. 3:22:38let's say we have a AI agent, which
  6643. 3:22:41allows us to create the LinkedIn hook,
  6644. 3:22:42then the LinkedIn body, then we merge
  6645. 3:22:44them, and then you send it to the final
  6646. 3:22:46agent to make the final post. So, let's
  6647. 3:22:48say I say, "Write a post about how AI is
  6648. 3:22:50going to impact agencies." I can press
  6649. 3:22:52go. And now, what this will do is that
  6650. 3:22:54it will send the information to the
  6651. 3:22:55first AI agent to write the hook, then
  6652. 3:22:57the second AI agent to write the body,
  6653. 3:22:59and then we merge them together. We put
  6654. 3:23:01them all in the same paragraph, which
  6655. 3:23:03then goes and feeds into the final AI
  6656. 3:23:05agent to write the LinkedIn post, and
  6657. 3:23:07then it gives it to us on here.
  6658. 3:23:09So, our AI agency is ready to for the AI
  6659. 3:23:11revolution. The tools we once to use are
  6660. 3:23:13evolving fast. And it gives us the whole
  6661. 3:23:15body. Again, don't look at the quality,
  6662. 3:23:17just look at the fundamental theory
  6663. 3:23:18behind this AI agent and how it works.
  6664. 3:23:20>> [music]
  6665. 3:23:20>> And
  6666. 3:23:22as you can see, we have the output right
  6667. 3:23:23here.
  6668. 3:23:24The first output. This is the hook. Then
  6669. 3:23:26we have the second output
  6670. 3:23:28right here. And the way that this
  6671. 3:23:29fundamentally works is that we have the
  6672. 3:23:31data going here,
  6673. 3:23:33and then we have also the data going
  6674. 3:23:35here. But it this doesn't go through
  6675. 3:23:36until
  6676. 3:23:38this finishes as well because they're
  6677. 3:23:39all connected to the merge node. And the
  6678. 3:23:41merge node makes it so that we say,
  6679. 3:23:43"Okay, cool. Go to the LinkedIn hook and
  6680. 3:23:45write the LinkedIn hook, then send me
  6681. 3:23:46the input, the first input, which is
  6682. 3:23:48input one. Then go to the LinkedIn body
  6683. 3:23:51and send me the second input. And only
  6684. 3:23:52once when I have both inputs together,
  6685. 3:23:55then I go to the next steps." Right,
  6686. 3:23:57which is great because now we get two
  6687. 3:23:59items,
  6688. 3:24:00which is right here. One item and one
  6689. 3:24:02item
  6690. 3:24:03that we can then use the aggregate
  6691. 3:24:05module or node. As you can see here by
  6692. 3:24:07the diagram, is that we take multiple
  6693. 3:24:09series of items and we put them all in
  6694. 3:24:11in one.
  6695. 3:24:12And if I go here, I can see that I have
  6696. 3:24:14the output one and the output two,
  6697. 3:24:16right, which is the hook and the body,
  6698. 3:24:18before feeding it into the final agent
  6699. 3:24:20right here to write the LinkedIn post,
  6700. 3:24:22which is the output right here. Right,
  6701. 3:24:24and so, we give it the output, which is
  6702. 3:24:26the called an array. An array is just a
  6703. 3:24:28way for us to store different pieces of
  6704. 3:24:30information.
  6705. 3:24:31And so, that's really how the
  6706. 3:24:32parallelization works. Now, the reason
  6707. 3:24:34why we would use this over the others is
  6708. 3:24:36because it is faster at processing
  6709. 3:24:38information.
  6710. 3:24:39Um as you can see here, it goes here,
  6711. 3:24:41and then it automatically goes here, not
  6712. 3:24:43automatically, but in a faster way
  6713. 3:24:45rather than the other frameworks. And
  6714. 3:24:46then we can merge them all together
  6715. 3:24:47before sending it to the agent. And it's
  6716. 3:24:49very very structured in a way where we
  6717. 3:24:51go to the first one, then the second
  6718. 3:24:52one, then the third one, then the fourth
  6719. 3:24:53one. That way you can keep track of all
  6720. 3:24:54the single steps. And one more thing it
  6721. 3:24:56can do is that it reduces the bias or
  6722. 3:24:58error uh from a single model because we
  6723. 3:25:00have these different agents giving their
  6724. 3:25:03own perspective or or the output in this
  6725. 3:25:04case. And this right here, typically we
  6726. 3:25:07would use it for research
  6727. 3:25:08uh or multi-domain inputs where speed
  6728. 3:25:10and diversity matters. And the use case
  6729. 3:25:12of using this type of framework is when
  6730. 3:25:15we are doing research. When we're doing
  6731. 3:25:17research, we typically want to split it
  6732. 3:25:18up in a way where we do one sort of
  6733. 3:25:20research first, then we go to the second
  6734. 3:25:21one, then we go to the third one, and so
  6735. 3:25:22on. So, that way you're splitting it,
  6736. 3:25:24and then you're merging it all together,
  6737. 3:25:26and then you're aggregating it, and then
  6738. 3:25:28you're doing something else. The third
  6739. 3:25:29[music] framework is called the routing
  6740. 3:25:31framework. Now, this dynamically directs
  6741. 3:25:32the data. So, this sends the data to the
  6742. 3:25:35appropriate agent based on
  6743. 3:25:37>> [music]
  6744. 3:25:37>> a classifier. Let's say we receive an
  6745. 3:25:39email. Then we have the step right here,
  6746. 3:25:41which is classifying the email based on
  6747. 3:25:43whether it's in high priority, customer
  6748. 3:25:45support, promotions, or finance and
  6749. 3:25:46billing. And based on the answer, so
  6750. 3:25:49based on the classification of the email
  6751. 3:25:50that we receive, we send it to the
  6752. 3:25:52appropriate agent. We go here to the
  6753. 3:25:55high priority agent, customer support
  6754. 3:25:56agent, promotion, and finance as well.
  6755. 3:25:58And then they can execute their own
  6756. 3:26:00tasks, which means that they can do
  6757. 3:26:01their own action, create their own
  6758. 3:26:02emails, and so on um
  6759. 3:26:04by their own. Right, and they're all
  6760. 3:26:05rooted by the output that we get from
  6761. 3:26:08the previous step. And so, this is great
  6762. 3:26:10because it makes our AI agents and
  6763. 3:26:11workflows much more adaptive, right? And
  6764. 3:26:14we are only using the right model or
  6765. 3:26:16logic when we have a certain use case.
  6766. 3:26:19Right, so in this case, when we want to
  6767. 3:26:20add a new step, all we have to do is go
  6768. 3:26:22in here,
  6769. 3:26:23add a category, so we can say love.
  6770. 3:26:26Hello.
  6771. 3:26:28And now, we have a new
  6772. 3:26:30filter right here, which you can then
  6773. 3:26:31add another AI agent. So, agent,
  6774. 3:26:34and we have this here.
  6775. 3:26:36And you can easily add more and more
  6776. 3:26:37options based on the output that we get
  6777. 3:26:39here. And this is great again because
  6778. 3:26:41when we have
  6779. 3:26:42a input
  6780. 3:26:44and we want to classify the input based
  6781. 3:26:46on whether it's X, Y, and Z, then we can
  6782. 3:26:48have a logic that says, "Okay, if this
  6783. 3:26:51is something that we send it here, if
  6784. 3:26:52that is something else, then we send it
  6785. 3:26:53here." And so on. And then you go
  6786. 3:26:55through the logic as well. And so, let's
  6787. 3:26:56say I send myself an email right here. I
  6788. 3:26:58can execute the workflow. This will then
  6789. 3:27:00be able to classify the email based on
  6790. 3:27:02whether it's all of these. In this case,
  6791. 3:27:04it saw that it's promotions. And what it
  6792. 3:27:06did is that it spoke to the AI agent to
  6793. 3:27:08then create the email that we can then
  6794. 3:27:10have in our draft. And if I go here,
  6795. 3:27:13I can see that it drafted the email back
  6796. 3:27:15to the email that we got here. Of
  6797. 3:27:16course, this is a spam email, not spam,
  6798. 3:27:18but promotional from Wise. Um
  6799. 3:27:21but as you can see, the AI agent drafted
  6800. 3:27:23a very very insightful email
  6801. 3:27:26um
  6802. 3:27:26using the prompt. Right? And so, that's
  6803. 3:27:28essentially what it does. Very very
  6804. 3:27:30easy. Only use this framework really
  6805. 3:27:31when you want to be able to root to the
  6806. 3:27:34appropriate agent based on the input
  6807. 3:27:36that we get. And the best use case that
  6808. 3:27:38I can think of when it comes to this
  6809. 3:27:39framework is just this, right? Getting
  6810. 3:27:41emails, classifying them, and then
  6811. 3:27:42sending them to the right agent uh based
  6812. 3:27:44on the type of the email. The last
  6813. 3:27:47framework is called the optimizer. If
  6814. 3:27:48you haven't watched the full video of me
  6815. 3:27:49building out this human-in-the-loop AI
  6816. 3:27:51sales agent, watch it up here. But the
  6817. 3:27:53way it works is that we have a form
  6818. 3:27:55right here,
  6819. 3:27:57which has different details that the
  6820. 3:27:58customer or the lead in this case would
  6821. 3:28:00fill out. So, let's say I put my name,
  6822. 3:28:02email, company name. I'm looking for a
  6823. 3:28:04lead generation service. My budget is
  6824. 3:28:06less than a thousand. My project
  6825. 3:28:07description is that we want a system
  6826. 3:28:09that can generate more leads, and we
  6827. 3:28:10want it within a week. If I press
  6828. 3:28:12submit, what this will now do is that it
  6829. 3:28:14will add it to our CRM. In this case,
  6830. 3:28:16CRM is just a way that we store
  6831. 3:28:17information about each client or leads.
  6832. 3:28:19Then it talks to the first AI agent
  6833. 3:28:21which writes the sales email we can send
  6834. 3:28:23back. What it does then is that it sets
  6835. 3:28:26a variable. In this case the variable
  6836. 3:28:27would be subject and email body, which
  6837. 3:28:29is subject here and email body.
  6838. 3:28:31Which will send it to our internal team.
  6839. 3:28:33You can see here we have the action
  6840. 3:28:34required new lead with budget of less
  6841. 3:28:36than 1,000.
  6842. 3:28:37And a team member from our team before
  6843. 3:28:39sending it to the actual customer. We
  6844. 3:28:41can respond. So I said don't ask him a
  6845. 3:28:43question. Just tell him we're available
  6846. 3:28:45at Tuesday 3:00 p.m. tomorrow because as
  6847. 3:28:46you can see here it asked them a
  6848. 3:28:48question of whether they are available.
  6849. 3:28:50I press submit. So I give a feedback.
  6850. 3:28:52What this does is that it then
  6851. 3:28:53classifies the feedback whether it's a
  6852. 3:28:55positive feedback or negative feedback.
  6853. 3:28:57If it's negative what this does is that
  6854. 3:28:59it roots it to the next step which
  6855. 3:29:01actually based on the feedback that we
  6856. 3:29:03gave it rewrites the actual email using
  6857. 3:29:05the next agent right here.
  6858. 3:29:07And it gives us a new email.
  6859. 3:29:10Which we then send back here.
  6860. 3:29:12Because again the
  6861. 3:29:13name of the variables is the same
  6862. 3:29:15whether it comes from here or from here.
  6863. 3:29:17Which we are able to then send it back
  6864. 3:29:19to our team.
  6865. 3:29:20Right here.
  6866. 3:29:22For another revision. I can press
  6867. 3:29:24respond. I can say as you can see here
  6868. 3:29:26we have we actually have the the revised
  6869. 3:29:27version. So Tuesday at 3:00 p.m.
  6870. 3:29:30And I can say yes, all good.
  6871. 3:29:32When I press yes all good and I submit
  6872. 3:29:33it, what this will now do is that it
  6873. 3:29:35will send the email because now it's
  6874. 3:29:37it's approved it's positive feedback. To
  6875. 3:29:39the customer. So if I go here I can see
  6876. 3:29:41that I'm obviously I'm the customer and
  6877. 3:29:42I'm team member here. But this is what
  6878. 3:29:44the customer will get. They will get a
  6879. 3:29:45fully sales optimized email.
  6880. 3:29:47Obviously with results and everything.
  6881. 3:29:49That responds to their inquiry from the
  6882. 3:29:52website. And so this framework right
  6883. 3:29:54here is amazing. It's actually one of
  6884. 3:29:56the best frameworks that I've used so
  6885. 3:29:57far within AI agents when it comes to
  6886. 3:29:59adding a feedback loop. Right? Because
  6887. 3:30:01what we're doing here is that we're
  6888. 3:30:02writing the sales email and you can
  6889. 3:30:03apply this to content or whatever it is.
  6890. 3:30:06But we're writing something then we're
  6891. 3:30:07sending it for revision to our team.
  6892. 3:30:09Then the team gives us feedback. Then
  6893. 3:30:11based on the feedback we categorize
  6894. 3:30:12whether this is positive feedback or
  6895. 3:30:14negative feedback. If it's negative then
  6896. 3:30:16we send it to another AI agent. So as
  6897. 3:30:18you can see here we have two options
  6898. 3:30:19approved or denied. And we give it the
  6899. 3:30:21description of what approved is and what
  6900. 3:30:23denied is.
  6901. 3:30:24And based on the appropriate output so
  6902. 3:30:26whether it's actually approved or denied
  6903. 3:30:28we send it two different ways. Again
  6904. 3:30:29denied will go to the AI agent which
  6905. 3:30:31revises the email. And so this is
  6906. 3:30:33prompted to to know that this needs to
  6907. 3:30:36update the sales email based on provided
  6908. 3:30:37feedback. And this is the email that we
  6909. 3:30:39get.
  6910. 3:30:40Which we send back here.
  6911. 3:30:42Which then sends it to our team again
  6912. 3:30:43for human in the loop. And this is a
  6913. 3:30:45whole repetitive process over and over
  6914. 3:30:46again. Now this is great because it
  6915. 3:30:49enables
  6916. 3:30:50the AI agent to have continuous
  6917. 3:30:51learning. Right? Because most of the
  6918. 3:30:53times not most of the times actually
  6919. 3:30:55sometimes the AI agent will not spit out
  6920. 3:30:57something that we're actually happy to
  6921. 3:30:58send to the client.
  6922. 3:31:00And so instead of sending it to the
  6923. 3:31:01client directly what we do is that we
  6924. 3:31:03have a repetitive process. As you can
  6925. 3:31:05see this is a circle. What's a what
  6926. 3:31:07Whatever you
  6927. 3:31:08rectangle. All right? But the concept is
  6928. 3:31:10that we have a loop. Right? Human in the
  6929. 3:31:12loop. The human is always in this loop.
  6930. 3:31:14We're able to give it feedback and
  6931. 3:31:16iterate on the feedback again and again
  6932. 3:31:18until we give it positive feedback.
  6933. 3:31:20Saying yeah all good or yeah no changes.
  6934. 3:31:23And then it sends it to the client
  6935. 3:31:24itself. And then it does its own thing.
  6936. 3:31:26Now this is great for systems that
  6937. 3:31:27require quality assurance which means
  6938. 3:31:29that they require someone to give some
  6939. 3:31:31sort of input or feedback based on the
  6940. 3:31:33output that AI gave. Um this can be
  6941. 3:31:35applied to again sales outreach or
  6942. 3:31:36customer support because those are the
  6943. 3:31:38ones that interact with a customer. And
  6944. 3:31:40so between the AI making something and
  6945. 3:31:42the customer receiving that something
  6946. 3:31:44there has to be an intermediate step of
  6947. 3:31:46us giving a feedback. And usually that's
  6948. 3:31:48having another person. Right? And so in
  6949. 3:31:50this case this allows us to have a
  6950. 3:31:51repetitive loop feedback loop to
  6951. 3:31:54generate different things. And that's
  6952. 3:31:55where we would use the optimizer
  6953. 3:31:56framework.
  6954. 3:32:00In this video I'm going to show you
  6955. 3:32:01exactly how to prompt your AI agents
  6956. 3:32:03inside of n8n so they actually do what
  6957. 3:32:06you want with less errors and more
  6958. 3:32:08accurate results. I'll break down the
  6959. 3:32:09main types of prompts, show you exactly
  6960. 3:32:12how to structure them, and explain how
  6961. 3:32:14to write prompts that actually get
  6962. 3:32:15results. All right, so to quickly recap
  6963. 3:32:17what an AI agent is we have an input, we
  6964. 3:32:19have an output, and in the middle the AI
  6965. 3:32:21agent is instructed right which is the
  6966. 3:32:23prompts that we're going to go through
  6967. 3:32:24today. Uh and based on the instructions
  6968. 3:32:27it then uses its brain which is LLM
  6969. 3:32:30which is just an AI which thinks through
  6970. 3:32:32the instructions and then takes action
  6971. 3:32:35on the tools based on the instructions
  6972. 3:32:37that it was given. So it's [music]
  6973. 3:32:38exactly the same as an employee. It's
  6974. 3:32:40only AI. And the instructions that you
  6975. 3:32:41give it are going to be in a prompt
  6976. 3:32:43format in an actual text. So this right
  6977. 3:32:45here is what it actually looks like.
  6978. 3:32:46This is the most basic version of an AI
  6979. 3:32:48agent inside of n8n. The first thing we
  6980. 3:32:50have is a chat. So I'm going to go here
  6981. 3:32:52and talk to it. I'm going to say
  6982. 3:32:54hello.
  6983. 3:32:56What this will do is that it will send
  6984. 3:32:57the input over to the AI agent. It will
  6985. 3:32:59then call its brain because that's how
  6986. 3:33:01it thinks. And it will call the memory
  6987. 3:33:03tool because we also have the ability to
  6988. 3:33:05remember uh the conversations that we
  6989. 3:33:07had. Now inside the AI agent we only
  6990. 3:33:10have two types of prompts. Only two.
  6991. 3:33:12Right? The first one is a user message.
  6992. 3:33:14And the next one you can find right here
  6993. 3:33:16is a system message. So in this case if
  6994. 3:33:18you have an employee right you tell the
  6995. 3:33:20employee a task. You say hey can you do
  6996. 3:33:22this for me? That is a user message.
  6997. 3:33:23[music]
  6998. 3:33:24Then the instructions that you gave the
  6999. 3:33:25employee before that is a system
  7000. 3:33:27message. So two different types of
  7001. 3:33:28prompts for two different types of
  7002. 3:33:30reasons. And so right here we have two
  7003. 3:33:32different options for source for prompt.
  7004. 3:33:34Source for prompt just means hey where
  7005. 3:33:36are we getting the input? Like what is
  7006. 3:33:37that thing that we're receiving and
  7007. 3:33:38where is it coming from? We have
  7008. 3:33:40connected chat trigger node. And we have
  7009. 3:33:42define below.
  7010. 3:33:43Now if I go out of here I can see that
  7011. 3:33:45right now the AI agent in this case is
  7012. 3:33:47connected to this node right here. A
  7013. 3:33:48node is just a is a square. That's what
  7014. 3:33:50they call it. And this right here is a
  7015. 3:33:52chat trigger node. It's one that is
  7016. 3:33:54native to n8n which means that n8n owns
  7017. 3:33:56it. And typically that is what we use to
  7018. 3:33:58be able to speak to the AI agent. Right?
  7019. 3:34:00And so the input comes from here. So if
  7020. 3:34:02I go inside I can see [music] that we
  7021. 3:34:04chat to the AI agent through the chat
  7022. 3:34:06node. So through here.
  7023. 3:34:08I go here open chat and I say so where
  7024. 3:34:10are you from? All right?
  7025. 3:34:12And so right now what this does is that
  7026. 3:34:14it takes this input. Right? Where are
  7027. 3:34:16you from?
  7028. 3:34:17It sends it over here. And this will now
  7029. 3:34:19be the user message. Right? So this JSON
  7030. 3:34:22fancy thing that you see which is code
  7031. 3:34:24because again everything is code behind
  7032. 3:34:26the no-code platforms. The irony there.
  7033. 3:34:28Um but that is a thing that the AI agent
  7034. 3:34:31uses as sort of an input to then take
  7035. 3:34:34action. Right? The second part is define
  7036. 3:34:36below. So there are times where we're
  7037. 3:34:38not connected
  7038. 3:34:40to the chat trigger node. So every
  7039. 3:34:41single time that we're not connected to
  7040. 3:34:43this node right here we have to use
  7041. 3:34:45define below. Because we have to define
  7042. 3:34:47the input based on where it comes from.
  7043. 3:34:49So for example if we have an AI agent
  7044. 3:34:51that looks like this and the input comes
  7045. 3:34:52from Telegram which is just a platform
  7046. 3:34:54where you chat
  7047. 3:34:55um sort of like WhatsApp. If I go inside
  7048. 3:34:57here I can execute the step and now it's
  7049. 3:35:00going to wait for someone to send a
  7050. 3:35:01message to Telegram. And right here I
  7051. 3:35:03have a new chat pulled up. And when I
  7052. 3:35:04press start it automatically sends a
  7053. 3:35:05message which is {slash} start. And that
  7054. 3:35:08is a trigger
  7055. 3:35:10right here.
  7056. 3:35:11Which is text start. And now this is a
  7057. 3:35:13thing that then goes into the AI agent.
  7058. 3:35:16And now we use define below. Because
  7059. 3:35:18this [music] right here chat trigger
  7060. 3:35:20node like I mentioned is only for that
  7061. 3:35:21specific node. And the node changed to
  7062. 3:35:23Telegram. And so we have to change the
  7063. 3:35:25input that comes in. And how we do this
  7064. 3:35:27let's say this is empty. We just take
  7065. 3:35:28the input which in this case would be
  7066. 3:35:30text right because that's the text that
  7067. 3:35:32we get.
  7068. 3:35:33And we drag it across here.
  7069. 3:35:35Or alternatively you can curly bracket
  7070. 3:35:37curly bracket dollar sign JSON
  7071. 3:35:41dot
  7072. 3:35:42message.
  7073. 3:35:44dot
  7074. 3:35:45chat. And so let's say now I execute the
  7075. 3:35:47workflow.
  7076. 3:35:48And I just talk to Telegram and I say
  7077. 3:35:50hey how's it going?
  7078. 3:35:53What this will now do is it will send
  7079. 3:35:54the input over here.
  7080. 3:35:55It will then talk to its brain.
  7081. 3:35:57And then based on its brain and based on
  7082. 3:35:59the instructions that we give it which
  7083. 3:36:00I'll show you exactly how to write that
  7084. 3:36:01instruction then it will do its thing.
  7085. 3:36:03It will give us the output and the
  7086. 3:36:04output will be in Telegram which in this
  7087. 3:36:07case it's hi I'm ready to assist you.
  7088. 3:36:09How can I help you today? And so that's
  7089. 3:36:11where we would use the define below
  7090. 3:36:14rather than the chat trigger node.
  7091. 3:36:16And this is the one that we mostly use.
  7092. 3:36:17Because again we chat trigger node I
  7093. 3:36:18feel like we only use it when we test
  7094. 3:36:20uh rather than anything else.
  7095. 3:36:22So I'm going to say hello here just to
  7096. 3:36:24put this as an example. And now we're
  7097. 3:36:26going to go on to the most important
  7098. 3:36:27prompt which is the instructions. So
  7099. 3:36:29that's system message.
  7100. 3:36:31So if I go to system message and I go to
  7101. 3:36:33expression and I go to full screen.
  7102. 3:36:35Now this is the playground. This is
  7103. 3:36:37where we write the actual prompt. And so
  7104. 3:36:39I'm going to paste a structure of prompt
  7105. 3:36:40that we typically use right here. Now
  7106. 3:36:43the first thing is the actual
  7107. 3:36:44formatting. So we use something called
  7108. 3:36:46markdown formatting. So if you see
  7109. 3:36:48uh these sort of hashtags or sometimes
  7110. 3:36:50you even see this
  7111. 3:36:52right here.
  7112. 3:36:54What this is is let's say I go to a
  7113. 3:36:55Google document. If I write hello
  7114. 3:36:59right? And I go to right here heading
  7115. 3:37:01one.
  7116. 3:37:02I can also write hello.
  7117. 3:37:05And then
  7118. 3:37:06this turns to heading one.
  7119. 3:37:08And so what this means is that this is
  7120. 3:37:10heading one.
  7121. 3:37:12This is heading two.
  7122. 3:37:14This is heading three.
  7123. 3:37:16Right? And so why do we do it? It's
  7124. 3:37:18because then the AI knows
  7125. 3:37:20the hierarchy. Right? Sort of like
  7126. 3:37:21you're doing an essay. If the essay does
  7127. 3:37:23not have a title, subtitle, uh the text
  7128. 3:37:25description, all that stuff then it's
  7129. 3:37:27very hard to understand. And so you are
  7130. 3:37:29using these using hashtags. Right? In
  7131. 3:37:32this case this is one. In this case it's
  7132. 3:37:34two. In this case it's three. And you
  7133. 3:37:35can go to four as well. Then the AI
  7134. 3:37:37knows exactly okay this is the main
  7135. 3:37:39thing to look at. Then this is the one
  7136. 3:37:41below it. And then this is the one below
  7137. 3:37:42it. And so when we look at this
  7138. 3:37:45we're saying hey this is the title of
  7139. 3:37:47the first thing and then the text. Title
  7140. 3:37:49text. [music]
  7141. 3:37:50Title text and so on. And if you add
  7142. 3:37:52things like these then this would bold
  7143. 3:37:54it. So something like this on a Google
  7144. 3:37:56document so that within the text it
  7145. 3:37:58recognizes that this is an important
  7146. 3:37:59word or an important phrase.
  7147. 3:38:01>> [music]
  7148. 3:38:01>> And it does the exact same thing for all
  7149. 3:38:03of them. Now let's say that you wanted
  7150. 3:38:05the overview to be the title. This as
  7151. 3:38:07well. This as well. But you realize that
  7152. 3:38:09examples aren't that important to be a
  7153. 3:38:11title. All you have to do is just put
  7154. 3:38:13another hashtag so that this becomes
  7155. 3:38:14heading two and so AI understands,
  7156. 3:38:17right? Based on the logic, heading one,
  7157. 3:38:19two, three, that this is less important
  7158. 3:38:21than this. And so it will prioritize
  7159. 3:38:23looking at this before looking at this.
  7160. 3:38:25Now, the first thing of the prompt
  7161. 3:38:28is an overview, right? So you are a your
  7162. 3:38:30purpose is to. Now, if you're watching
  7163. 3:38:32this video of prompting, then you've
  7164. 3:38:33probably been seeing prompts that look
  7165. 3:38:34like you are a helpful, intelligent
  7166. 3:38:37content writing assistant. You are a
  7167. 3:38:38helpful, intelligent something something
  7168. 3:38:40assistant. The reason why we do that is
  7169. 3:38:42because we're giving AI an identity,
  7170. 3:38:44okay? And by giving AI an identity, then
  7171. 3:38:48we're saying then what it does is it
  7172. 3:38:50allows AI to psych itself to to make it
  7173. 3:38:53think that it actually is that identity,
  7174. 3:38:55so the output will be higher. And so
  7175. 3:38:57here we start by saying, you are a
  7176. 3:38:59helpful, intelligent
  7177. 3:39:01personal assistant. Uh the only tool
  7178. 3:39:03that we have connected to it is send a
  7179. 3:39:04message, so that's fine.
  7180. 3:39:06>> [music]
  7181. 3:39:06>> And now we say your purpose is to and
  7182. 3:39:08then describe what the AI agent actually
  7183. 3:39:10does. And so here it would be your
  7184. 3:39:12purpose is to
  7185. 3:39:14send emails based on just send emails,
  7186. 3:39:17actually.
  7187. 3:39:18Yeah, your purpose is to send emails
  7188. 3:39:20to
  7189. 3:39:22customers.
  7190. 3:39:23And so that is it. That's the overview.
  7191. 3:39:25Now, of course, if it's a bit more
  7192. 3:39:27complex, then you have different tools,
  7193. 3:39:29then your purpose is going to be longer
  7194. 3:39:31because the purpose is different things.
  7195. 3:39:33And so this obviously depends on the
  7196. 3:39:34complexity. Now, I'm going to go through
  7197. 3:39:36a complex agent at the end, so don't
  7198. 3:39:37worry, you'll see exactly what it looks
  7199. 3:39:39like. But that right here is the first
  7200. 3:39:40part. The second part is the tools. So
  7201. 3:39:43right now in this AI agent, we are I
  7202. 3:39:45believe we're only connected, yeah, to
  7203. 3:39:46send a message.
  7204. 3:39:47And so that is the only tool. Now again,
  7205. 3:39:49a tool is a software is a thing that the
  7206. 3:39:52AI agent uses to take action. And so the
  7207. 3:39:54first thing is adding the full name.
  7208. 3:39:56So we say, "Hey, heading one, tool."
  7209. 3:39:59And the first thing we write is the tool
  7210. 3:40:00name, send message. And bear in mind
  7211. 3:40:02that the tool name, make sure it's the
  7212. 3:40:04exact name of the actual tool, not an
  7213. 3:40:06extra e, not an extra r, right? Exact
  7214. 3:40:09name. And now we have to add the
  7215. 3:40:10function and when to use it. So this
  7216. 3:40:12tool
  7217. 3:40:14will be used
  7218. 3:40:16when sending emails
  7219. 3:40:18to customers.
  7220. 3:40:19That's it.
  7221. 3:40:20And then And so if you have more tools,
  7222. 3:40:22then you have more names,
  7223. 3:40:25tool
  7224. 3:40:26name
  7225. 3:40:28and then tool description.
  7226. 3:40:30description. That's it. And the more
  7227. 3:40:32tools you have, the more you add right
  7228. 3:40:34here, right? And you keep going on and
  7229. 3:40:35on and on. And then we have rules. So
  7230. 3:40:37rules are great to then be able to give
  7231. 3:40:40it guardrails. So guardrails just means
  7232. 3:40:41that Let's say you're in the bowling
  7233. 3:40:43alley. You know, when you're at
  7234. 3:40:44bowling and they add the the little
  7235. 3:40:46sides on the
  7236. 3:40:47the little things that they put on the
  7237. 3:40:48sides cuz you're completely horrible.
  7238. 3:40:50It's only because by putting those
  7239. 3:40:51guardrails, there's a good chance that
  7240. 3:40:53you'll hit the target, right? If you're
  7241. 3:40:55anything like me at bowling, when I
  7242. 3:40:57throw the ball, it goes out, right? And
  7243. 3:40:58so by putting those those walls, it
  7244. 3:41:00makes sure that it actually hits the
  7245. 3:41:01thing.
  7246. 3:41:03And so that's exactly what we're doing
  7247. 3:41:04here. We're saying, "Hey, these are the
  7248. 3:41:05rules." And saying, "Always do this,
  7249. 3:41:07never do this, if unsure, do this." Now,
  7250. 3:41:10these three are obviously optional. It
  7251. 3:41:12depends on what rules you want. But in
  7252. 3:41:14this case, you can say, "Always make
  7253. 3:41:16sure to have an email address
  7254. 3:41:21before sending an email."
  7255. 3:41:24Right? Because we want to make sure that
  7256. 3:41:25we're actually sending the email to the
  7257. 3:41:26right person or a person at all. Then
  7258. 3:41:29you can say, "Never send an email
  7259. 3:41:32if you don't have
  7260. 3:41:35an email address.
  7261. 3:41:38If unsure, just ask the user
  7262. 3:41:41to clarify."
  7263. 3:41:43Simple as that. Obviously, it depends on
  7264. 3:41:45your use case, right? Again, it depends
  7265. 3:41:46on your use case, so the rules might
  7266. 3:41:48change. But for this specific use case
  7267. 3:41:50where we're just sending emails, then
  7268. 3:41:52this is fine. [music]
  7269. 3:41:53And then lastly, we have output format
  7270. 3:41:55and examples. Now, this is optional. I
  7271. 3:41:57wrote this as an option because it
  7272. 3:41:58depends on your use case. If I'm doing
  7273. 3:42:00something like an email send a message
  7274. 3:42:01assistant, there's no need to put output
  7275. 3:42:03format or examples, right? But what
  7276. 3:42:06these do is you tell it to basically
  7277. 3:42:08give you the output in a specific
  7278. 3:42:10format, so JSON or bullet list or
  7279. 3:42:12whatever it is, and it actually does it.
  7280. 3:42:14So in this case, what we could do is we
  7281. 3:42:16can say, "Format all responses as a
  7282. 3:42:18short, concise
  7283. 3:42:21sentence, right?" Or you could say, "A
  7284. 3:42:23bullet list
  7285. 3:42:25full
  7286. 3:42:27of
  7287. 3:42:28points, right?" It depends on your use
  7288. 3:42:30case. It kind of depends on what you
  7289. 3:42:31want.
  7290. 3:42:32>> [music]
  7291. 3:42:32>> Uh for this case, we can just keep it
  7292. 3:42:34very, very short and sweet. It's fine.
  7293. 3:42:36And then examples here. So examples in
  7294. 3:42:38this case, we wouldn't use it, right?
  7295. 3:42:40But for something a bit more complex
  7296. 3:42:42where it has different steps, where we
  7297. 3:42:43wanted to give it more guardrails
  7298. 3:42:45because again, giving it examples, it is
  7299. 3:42:47literally just giving it rules, right?
  7300. 3:42:48We're saying, "Hey, do it this way. Here
  7301. 3:42:50are some examples to guide you in the
  7302. 3:42:52right direction." So adding more
  7303. 3:42:53guardrails. Only because AI agents are
  7304. 3:42:55great, right? They're they're amazing.
  7305. 3:42:57They do really good stuff, but the
  7306. 3:42:59margin of error needs to be very, very
  7307. 3:43:01small when you're actually giving it to
  7308. 3:43:02clients. And so if you add more
  7309. 3:43:05guardrails, if you add more examples,
  7310. 3:43:06then the chances that it will error out,
  7311. 3:43:09which means that something goes wrong,
  7312. 3:43:10are very low. And the way that examples
  7313. 3:43:12usually work is we have the user.
  7314. 3:43:14>> [music]
  7315. 3:43:15>> So we say, "This is the input." So let's
  7316. 3:43:16say I say, "Send an email
  7317. 3:43:18to
  7318. 3:43:20Or actually, let's say I say, "Make a
  7319. 3:43:23LinkedIn post
  7320. 3:43:25about life."
  7321. 3:43:27And then you give it the uh the answer.
  7322. 3:43:30Right? You say
  7323. 3:43:31you actually give it the LinkedIn post.
  7324. 3:43:33So it can use the LinkedIn post as a
  7325. 3:43:35reference when actually giving the
  7326. 3:43:36output. And so why do we do this? It's
  7327. 3:43:38because again, with guardrails, the AI
  7328. 3:43:41agent knows what good looks like. It has
  7329. 3:43:42expectations. And by giving someone
  7330. 3:43:44expectations, they will get closer to
  7331. 3:43:47the actual goal because it aligns with
  7332. 3:43:49the expectations that you have. And so
  7333. 3:43:51that right there is a full structure of
  7334. 3:43:52prompt that we use. Obviously, some
  7335. 3:43:53things you add, some things you remove
  7336. 3:43:55depending on your use case, but this is
  7337. 3:43:56what it looks like.
  7338. 3:43:58And so when you pair up the user message
  7339. 3:43:59with a system prompt, the user message
  7340. 3:44:01is the input, so what do we get from the
  7341. 3:44:03user? And the system message is a thing
  7342. 3:44:05that it uses to actually think through
  7343. 3:44:07what it needs to do. Now, I'm going to
  7344. 3:44:08go through a single agent step prompt
  7345. 3:44:10and a multi-agent step prompt. So a
  7346. 3:44:13single-agent step prompt just means that
  7347. 3:44:14we just have one step before it goes to
  7348. 3:44:17the tools, right? And so if I go inside
  7349. 3:44:19here, the chat input will be the one
  7350. 3:44:21from Telegram, which is the text below,
  7351. 3:44:23which is what we covered before. And the
  7352. 3:44:24system message will be an overview, not
  7353. 3:44:26a personal AI assistant integrated with
  7354. 3:44:28Telegram. Your purpose is to help the
  7355. 3:44:30user manage communications efficiently
  7356. 3:44:32by retrieving the correct contact and
  7357. 3:44:34sending accurate, well-formatted emails
  7358. 3:44:36on command. As you can see, the purpose
  7359. 3:44:37changed because now we're also saying
  7360. 3:44:39you have to retrieve the correct contact
  7361. 3:44:41and sending accurate, well-formatted
  7362. 3:44:43emails on command. And now we're giving
  7363. 3:44:45it the tools. So the first tool is get
  7364. 3:44:47contacts,
  7365. 3:44:49right? We put this to bold it to say,
  7366. 3:44:50"Hey, this is important. This is the
  7367. 3:44:52name."
  7368. 3:44:52And the description is retrieves contact
  7369. 3:44:55details, name [music] and email, right?
  7370. 3:44:56So this AI agent in this case is
  7371. 3:44:58connected to two different tools.
  7372. 3:45:00It's connected to the get contacts,
  7373. 3:45:02which is a contact database, which is
  7374. 3:45:03the one right here, which has name,
  7375. 3:45:05email, and phone number.
  7376. 3:45:06And it's connected to send email, which
  7377. 3:45:08is another tool, right? And so that's
  7378. 3:45:10why we have get contacts to retrieve
  7379. 3:45:11contacts and we give it a rule. We also
  7380. 3:45:13say, "Use this first to verify the
  7381. 3:45:15recipient or retrieve missing contact
  7382. 3:45:17information." Because if you think about
  7383. 3:45:19it, what if I say I want to send an
  7384. 3:45:21email to, let's say, Michael James,
  7385. 3:45:24right? [music] How does it know the
  7386. 3:45:25email of Michael James? Which is why it
  7387. 3:45:26has to call this tool first and then it
  7388. 3:45:29can call the next tool. And then we have
  7389. 3:45:31send emails, send emails to contacts.
  7390. 3:45:33And the rules is never assume missing
  7391. 3:45:35details. Always ask for clarification.
  7392. 3:45:37If unsure, respond with, "Can you
  7393. 3:45:39confirm who I should send this email
  7394. 3:45:40to?" Keep the message short, clear, and
  7395. 3:45:42structured when replying on Telegram.
  7396. 3:45:44And so this right here is a very short
  7397. 3:45:45prompt that we give it because again,
  7398. 3:45:47the AI agent is pretty simple. We just
  7399. 3:45:49have it get contacts and we have send an
  7400. 3:45:50email. And now if I go here, I can wait
  7401. 3:45:53for the input.
  7402. 3:45:54So on Telegram right here, I can say
  7403. 3:45:55send an email to Michael James. I can
  7404. 3:45:57press go.
  7405. 3:45:59What this should now do is it should
  7406. 3:46:00call the contacts uh tool. Then it gives
  7407. 3:46:02us the output. And the output in this
  7408. 3:46:04case is, "Can you please provide the
  7409. 3:46:05subject and the email body uh of the
  7410. 3:46:07email that you want to send it to
  7411. 3:46:08Michael James?" So even though I told it
  7412. 3:46:10Michael James and it knows the email, I
  7413. 3:46:12didn't give it what the email was about.
  7414. 3:46:14And so now what I can say is,
  7415. 3:46:16"Send an email to Michael James
  7416. 3:46:18about uh and say we have dinner
  7417. 3:46:21tomorrow."
  7418. 3:46:22Now, you probably noticed that I
  7419. 3:46:25should execute this first. Uh that I
  7420. 3:46:28copied and reprompted this again.
  7421. 3:46:30Why did I do that? It's because in this
  7422. 3:46:31case, the AI agent doesn't have memory,
  7423. 3:46:34right? And so I have to reprompt it and
  7424. 3:46:36say, "Hey, send an email to Michael
  7425. 3:46:37James and say we have dinner tomorrow."
  7426. 3:46:39And now if I go to my email, I can see
  7427. 3:46:40that I have dinner tomorrow. Hi Michael
  7428. 3:46:42James, we have dinner tomorrow, best
  7429. 3:46:43regards, right? All within just telling
  7430. 3:46:46it a single prompt. But none of this
  7431. 3:46:48would have happened if I didn't prompt
  7432. 3:46:49it right. Because the AI agent, even
  7433. 3:46:51though it's hooked up to these tools, it
  7434. 3:46:52doesn't know that it should do this
  7435. 3:46:54first and then this, right? Which is why
  7436. 3:46:56it's all based on the instructions. I
  7437. 3:46:58mean, in, out, right? Let's be
  7438. 3:47:00honest. And it's the exact same as an
  7439. 3:47:01employee. You give an employee
  7440. 3:47:02instructions, you say, "Hey, when you
  7441. 3:47:04have to go to file taxes, do it in this
  7442. 3:47:06way." He does file taxes, he does it in
  7443. 3:47:08that way, and then he brings it to you.
  7444. 3:47:10If you say it's bad, it was not his
  7445. 3:47:12fault. It's the instructions, right? And
  7446. 3:47:14so you want to make sure that the
  7447. 3:47:15instructions are very clear and precise
  7448. 3:47:18so that the AI agent can actually do
  7449. 3:47:20what you want it to do.
  7450. 3:47:21And that right there is a single-agent
  7451. 3:47:23step prompt, which means that we only
  7452. 3:47:24have one step between here and the
  7453. 3:47:27tools.
  7454. 3:47:27>> [music]
  7455. 3:47:27>> And here we have a multi-agent step
  7456. 3:47:29prompt. Now, this agent looks
  7457. 3:47:31ridiculously big um right here, but it
  7458. 3:47:33is a video that I made about building a
  7459. 3:47:35personal assistant, which you can watch
  7460. 3:47:36up here. And the way it works [music] is
  7461. 3:47:37the exact same as the previous one right
  7462. 3:47:39here.
  7463. 3:47:40But in this case, we have Telegram,
  7464. 3:47:42which is the input.
  7465. 3:47:43We send it here. We also have the option
  7466. 3:47:44to do a voice message.
  7467. 3:47:46And then inside here, if I go inside,
  7468. 3:47:48the input is still JSON.text because it
  7469. 3:47:49comes from Telegram
  7470. 3:47:51and is defined below again because we're
  7471. 3:47:53not using chat trigger node. And if I go
  7472. 3:47:55to the system message, I can see that it
  7473. 3:47:57follows the same exact structure. It has
  7474. 3:47:59overview, tools, rules, and
  7475. 3:48:01instructions. And it also has final
  7476. 3:48:02reminder, which I'll explain exactly why
  7477. 3:48:04that's there.
  7478. 3:48:05So the first one is the overview. So
  7479. 3:48:07you're are the ultimate personal
  7480. 3:48:08assistant. Your job is to send the
  7481. 3:48:09user's query to the correct tool.
  7482. 3:48:11And so, in this case, we call it a
  7483. 3:48:12multi-step agent prompt because this
  7484. 3:48:15right here calls a tool, but the tool is
  7485. 3:48:18actually another AI agent. So, it
  7486. 3:48:19doesn't actually call the tool that
  7487. 3:48:20takes the action like to send an email
  7488. 3:48:22or get contacts. It calls
  7489. 3:48:25different agents. So, contact agent,
  7490. 3:48:27email agent, calendar agent, content
  7491. 3:48:29agent. Why is that? It's because when we
  7492. 3:48:32are doing something this complex, not
  7493. 3:48:34complex, but we're doing a ton of tasks.
  7494. 3:48:36We have 1 2 3 4 5 6 7 8 9 10 11 12 13
  7495. 3:48:4014. 14 tasks that the AI agent has the
  7496. 3:48:43ability to do. If we write all those 14
  7497. 3:48:45tasks
  7498. 3:48:46and we just connect it all to the same,
  7499. 3:48:48the main AI agent, there's a very high
  7500. 3:48:50probability that it will break. And so,
  7501. 3:48:52we break it down into a multi-step agent
  7502. 3:48:54prompt where we say, "Hey, these are the
  7503. 3:48:56agents that are connected to you.
  7504. 3:48:58If you get some sort of contact thing,
  7505. 3:48:59just send it to here. If you're asked to
  7506. 3:49:01take action on email, then call this
  7507. 3:49:03agent here.
  7508. 3:49:04Uh if you have to do anything within
  7509. 3:49:06calendar, call the calendar agent. And
  7510. 3:49:07the same thing with content. And then we
  7511. 3:49:08give it rules. Right, some actions
  7512. 3:49:10require you to look up contact
  7513. 3:49:11information first, which is the exact
  7514. 3:49:13same as we did before. We say, "Hey,
  7515. 3:49:15sometimes you need to go to the contact
  7516. 3:49:16agent first to get the contact and then
  7517. 3:49:18send the email." That's a step-by-step
  7518. 3:49:20process that it has to do. And then
  7519. 3:49:21instructions, call the necessary tools
  7520. 3:49:23based on the user's request. And we give
  7521. 3:49:25it some instructions to then give it
  7522. 3:49:26more guardrails, right? And finally, we
  7523. 3:49:28give it the current date and time. So,
  7524. 3:49:30the final reminder is just final things
  7525. 3:49:32that you want to add. In this case,
  7526. 3:49:33we're adding the current date and time
  7527. 3:49:35because AI, unfortunately, isn't the
  7528. 3:49:37best with dates and times. And so, with
  7529. 3:49:39AI agents, if we ever connect it to
  7530. 3:49:40something that has to do with time, like
  7531. 3:49:43calendar or
  7532. 3:49:44send an email for dinner tomorrow, it
  7533. 3:49:46needs to know what today is in order to
  7534. 3:49:48know what tomorrow is, right? And so,
  7535. 3:49:50that's why we add this formula right
  7536. 3:49:52here. And so, this right here is the
  7537. 3:49:53exact same as the other ones. User
  7538. 3:49:54message is like the one before.
  7539. 3:49:56And now we can go on to the next tools,
  7540. 3:49:58right? And so, from here it calls the
  7541. 3:50:00contact agent or the email agent. And
  7542. 3:50:02the best way that I can think about this
  7543. 3:50:04is like a CEO. A CEO doesn't actually
  7544. 3:50:06talk to each employee directly, right?
  7545. 3:50:08He talks to the head of sales, head of
  7546. 3:50:10operations, head of marketing. And then
  7547. 3:50:12the head of marketing talks to the
  7548. 3:50:13employees to take action. Why isn't it
  7549. 3:50:15the other way? Well, it's because if the
  7550. 3:50:16CEO had to talk to every single
  7551. 3:50:18employee, he would go crazy. And there's
  7552. 3:50:20a good chance he would get the employee
  7553. 3:50:21wrong because there's so many employees,
  7554. 3:50:23right? And so, right here, if I go to
  7555. 3:50:25contact agent, which is the head of
  7556. 3:50:27contacts, head of department, we just
  7557. 3:50:29have an overview and then we give it
  7558. 3:50:30tools, right? Get contact, add or update
  7559. 3:50:33contact, which is the tools
  7560. 3:50:36that we give right here.
  7561. 3:50:37Get contact and add or update contacts.
  7562. 3:50:40Same thing with this, email agent, we
  7563. 3:50:42have this, overview, tools, and some
  7564. 3:50:44rules as well, final reminder.
  7565. 3:50:46Same thing with calendar. I can see the
  7566. 3:50:47overview, tools, final reminder, and the
  7567. 3:50:50blog as well. Just because the contact
  7568. 3:50:51agent doesn't have to know today's date
  7569. 3:50:53and time to to get contacts, but these
  7570. 3:50:55do.
  7571. 3:50:56>> [music]
  7572. 3:50:56>> Uh overview, tool, and rules, right? And
  7573. 3:50:58so, that's it. The input here, the
  7574. 3:50:59prompt user message in this case would
  7575. 3:51:01be AI defining. And also, the only
  7576. 3:51:03difference from the single-step AI agent
  7577. 3:51:06to the multi-step AI agent is also the
  7578. 3:51:08user message, right? Because if I go
  7579. 3:51:10here, right? The user message here will
  7580. 3:51:13be Telegram. But if I go inside one of
  7581. 3:51:15these,
  7582. 3:51:16then I can see that this is now defined
  7583. 3:51:18automatically by the model. We say,
  7584. 3:51:19"Hey, the AI agent is given a task."
  7585. 3:51:21Right? This is the CEO. Then the CEO,
  7586. 3:51:24we're letting AI define what the CEO
  7587. 3:51:26tells the head of department,
  7588. 3:51:28right? Which is the prompt user message.
  7589. 3:51:30And we give it a description as well.
  7590. 3:51:32And then, based on the prompt, based on
  7591. 3:51:34the instructions, and based on the tools
  7592. 3:51:36that the head of department is connected
  7593. 3:51:37to, it will prompt each tool correctly.
  7594. 3:51:40And so, best practices for prompts is be
  7595. 3:51:42direct and explicit, right? The more
  7596. 3:51:43direct you are, the better it is.
  7597. 3:51:45Put critical info at the top or you can
  7598. 3:51:47put it with um markdown formatting to
  7599. 3:51:50make sure that it knows, "Hey, this is
  7600. 3:51:51title one, heading two, and heading
  7601. 3:51:52three." Keep it concise, no filler,
  7602. 3:51:54which means that the more stuff you add,
  7603. 3:51:56the more chances it will break. And that
  7604. 3:51:58is just a truth, which is why we're not
  7605. 3:52:00giving it a huge prompt, right? For the
  7606. 3:52:02multi-step AI agent, we're giving it one
  7607. 3:52:04prompt and then that goes to the next
  7608. 3:52:06and then the next, right? Only include
  7609. 3:52:07what improves performance. So, don't
  7610. 3:52:09include stuff just to include stuff
  7611. 3:52:11because again, the more context, the
  7612. 3:52:12more it needs to think, and the more
  7613. 3:52:14someone needs to think, the more chances
  7614. 3:52:16we have or the more likely it is for
  7615. 3:52:17actually stop working. And if you're
  7616. 3:52:19someone who wants to start and scale
  7617. 3:52:20your AI automation agency and work with
  7618. 3:52:22me personally one-to-one, then check the
  7619. 3:52:24first thing down below.
  7620. 3:52:28Hey, in this video I'm going to show you
  7621. 3:52:29step-by-step how you can connect over
  7622. 3:52:31500 AI models to your [music] N 10 AI
  7623. 3:52:34agents using OpenRouter. And I'll also
  7624. 3:52:36show you how I built a full AI agent
  7625. 3:52:38that actually decides what model to
  7626. 3:52:40choose based on the question that it was
  7627. 3:52:42given. With that being said, let's dive
  7628. 3:52:44in. So, if we go to N 10 right here, the
  7629. 3:52:46way that the AI agent works is that we
  7630. 3:52:48have an input.
  7631. 3:52:49We then have the actual AI agent, which
  7632. 3:52:51has instructions. This is the prompt
  7633. 3:52:53saying, "Hey, if you you are helpful
  7634. 3:52:54intelligent XYZ, you [music] do this and
  7635. 3:52:56you do that based on the input that
  7636. 3:52:58you're given."
  7637. 3:52:59And then what it has is it's connected
  7638. 3:53:01to its brain, which is an LLM, which is
  7639. 3:53:03the one that we're going to be changing
  7640. 3:53:04today.
  7641. 3:53:05The memory and the tools. And then it
  7642. 3:53:07gives us the output.
  7643. 3:53:08The only thing with this is that the
  7644. 3:53:09brain itself, when we go to N 10
  7645. 3:53:12chat model, this is the brain,
  7646. 3:53:14and I look for the software itself, we
  7647. 3:53:16can see that these are individual
  7648. 3:53:18softwares. These are individual LLMs.
  7649. 3:53:19So, if I want to connect Claude, that
  7650. 3:53:21means now I have to go to Claude and
  7651. 3:53:22make an API key and then choose a model
  7652. 3:53:24from here. But if I want to choose
  7653. 3:53:26OpenAI, then I have to go to platform
  7654. 3:53:28OpenAI, add money there, and do this
  7655. 3:53:30exact same thing for every single chat
  7656. 3:53:32model there is. But the question
  7657. 3:53:34becomes, what if there was just one
  7658. 3:53:37thing that we had to connect to the AI
  7659. 3:53:38agent that we can then use to access all
  7660. 3:53:41the models all together? Well,
  7661. 3:53:43welcome to OpenRouter. All you have to
  7662. 3:53:44do is go to openrouter.ai. Um I'm going
  7663. 3:53:47to leave the link down below in case you
  7664. 3:53:48want to check it out. And then we see
  7665. 3:53:50here on the top right that we have
  7666. 3:53:52different uh places that we can go. So,
  7667. 3:53:54if you go to models, this will basically
  7668. 3:53:56show us all the models that we have that
  7669. 3:53:59we are able to connect with OpenRouter
  7670. 3:54:01to then be able to access in our
  7671. 3:54:02automations, right? We have DeepSeek.
  7672. 3:54:05I don't know what this is. Um
  7673. 3:54:07there's tons of them. More than more
  7674. 3:54:08than you probably know, right? There's a
  7675. 3:54:10whole list, 500 models, which is crazy.
  7676. 3:54:12Then we have chat,
  7677. 3:54:14which is where we can actually
  7678. 3:54:16test or we can actually talk to all the
  7679. 3:54:17different models.
  7680. 3:54:19And then we have rankings, which is
  7681. 3:54:20actually an interesting feature because
  7682. 3:54:22we can see the leaderboard of which
  7683. 3:54:23models are the best. In this case, top
  7684. 3:54:25this week will be Grok.
  7685. 3:54:26And then if I go below to market share,
  7686. 3:54:29uh but below here to categories, we get
  7687. 3:54:30to see which model is the best by what
  7688. 3:54:33category. So, marketing for example,
  7689. 3:54:35I can see that Gemini 2.5 Flash is the
  7690. 3:54:37best for marketing. And if I go to sales
  7691. 3:54:40or whatever it is, science,
  7692. 3:54:42I can see that we have
  7693. 3:54:45Gemini 2.5 Flash. Right? And so, you get
  7694. 3:54:47to see exactly which models, this is a
  7695. 3:54:49live representation of which model is
  7696. 3:54:51the best for what specific use case that
  7697. 3:54:53you can then use, right? But for this
  7698. 3:54:55video, I'm not going to show you which
  7699. 3:54:56model is the best. I'm just going to
  7700. 3:54:58show you how you can connect it to N 10.
  7701. 3:54:59Uh the first step here is to make an
  7702. 3:55:01account.
  7703. 3:55:02Once you made an account, you go to
  7704. 3:55:03profile and you go to keys.
  7705. 3:55:05When you go to keys, this is like the
  7706. 3:55:07exact same thing that we did for Claude,
  7707. 3:55:09OpenAI, Grok, Gemini. We have to create
  7708. 3:55:11an API key. The only difference with
  7709. 3:55:13this API key is that we only have to
  7710. 3:55:15create one key to access all the models
  7711. 3:55:17instead of creating one key per model,
  7712. 3:55:19right? We press here.
  7713. 3:55:21Let's name it
  7714. 3:55:22all models key.
  7715. 3:55:25Uh reset limit every
  7716. 3:55:26choose how often the limit should reset.
  7717. 3:55:27No, NA is fine.
  7718. 3:55:29No limit.
  7719. 3:55:30Press create and now you have this key
  7720. 3:55:32right here,
  7721. 3:55:33which you can copy.
  7722. 3:55:35You can then go to N 10
  7723. 3:55:36chat model,
  7724. 3:55:38look for OpenRouter right here.
  7725. 3:55:41And then to connect your OpenRouter
  7726. 3:55:42account,
  7727. 3:55:43you can create a new credential,
  7728. 3:55:45paste the API key that we just had,
  7729. 3:55:47and name it all models. Okay.
  7730. 3:55:50And press save.
  7731. 3:55:52And now you have access to this API key.
  7732. 3:55:55Now, of course, this is not free. So,
  7733. 3:55:56the next step you have to do is add
  7734. 3:55:58credits into our account so we're able
  7735. 3:55:59to access all the LLMs and use them.
  7736. 3:56:02Uh I'm going to go here, profile,
  7737. 3:56:04to credits.
  7738. 3:56:06And yeah, also credits here. And now you
  7739. 3:56:08get to add credits here. Now, the thing
  7740. 3:56:10is you would add credits anyways cuz you
  7741. 3:56:12would have to go to ChatGPT, Claude,
  7742. 3:56:14Gemini, Grok. You have to make an API
  7743. 3:56:16key, but even those softwares are not
  7744. 3:56:17free. And so, this just allows you to
  7745. 3:56:19make it so much easier for yourself to
  7746. 3:56:22just add money in one place so that
  7747. 3:56:24you're able to actually access all the
  7748. 3:56:25models. And quick note here, when you're
  7749. 3:56:27working with clients and actually
  7750. 3:56:28implementing these automations and AI
  7751. 3:56:30agents into their system, sometimes you
  7752. 3:56:32would use more than two LLMs. Maybe one
  7753. 3:56:35for writing content, maybe one for
  7754. 3:56:36structuring data, maybe one for
  7755. 3:56:38reasoning, right? And so, this right
  7756. 3:56:40here gives us the ability to tell the
  7757. 3:56:42client, "Hey, just make an account on
  7758. 3:56:44one place. You don't have to go to every
  7759. 3:56:45single LLM to make an API key to add
  7760. 3:56:47credits," which makes it so much more
  7761. 3:56:49structured in the long run. Once we have
  7762. 3:56:51the credits down, we can go to N 10. We
  7763. 3:56:53can see that now
  7764. 3:56:55we have access to all these models right
  7765. 3:56:57here.
  7766. 3:56:58Perplexity, Qwen, OpenAI,
  7767. 3:57:00Claude,
  7768. 3:57:02there's a Grok, right? There's a ton of
  7769. 3:57:04different models that we can access
  7770. 3:57:06through the API version, which is
  7771. 3:57:08insane.
  7772. 3:57:09And this would be the exact same as just
  7773. 3:57:10adding
  7774. 3:57:12in this case, OpenAI
  7775. 3:57:144.1 Mini, right? Because we're using 4.1
  7776. 3:57:16Mini here, but we're also using it here.
  7777. 3:57:19Right? If I go here, then I can chat to
  7778. 3:57:21it. So, let's say
  7779. 3:57:23say hello.
  7780. 3:57:24I can see that now it's calling
  7781. 3:57:25OpenRouter
  7782. 3:57:27and it's giving us an answer. How can I
  7783. 3:57:28help you today? All right. So, now that
  7784. 3:57:30we connected the OpenRouter to our N 10
  7785. 3:57:32AI agent, now let's make an AI agent
  7786. 3:57:34that basically gets the input, which is
  7787. 3:57:36the question, gives it to the first AI
  7788. 3:57:38agent, which will decide what model to
  7789. 3:57:39use, and then it will use the model that
  7790. 3:57:42it needs to use based on the question
  7791. 3:57:43that it was given, okay? Now, the
  7792. 3:57:45fundamental concept here is that when we
  7793. 3:57:46go to OpenRouter
  7794. 3:57:48and I go to the model, if I press
  7795. 3:57:50expression,
  7796. 3:57:51this means now I can hardcode, which
  7797. 3:57:53means I can actually type the model that
  7798. 3:57:55we want, right? Which comes from this
  7799. 3:57:57list. So, I go to GPT-4 Turbo. I have
  7800. 3:58:00this. Now, this is the name of the
  7801. 3:58:01actual model. This is the way that the
  7802. 3:58:03API recognizes that we want to use GPT-4
  7803. 3:58:05Turbo. And so, in theory, when you think
  7804. 3:58:08about it, if you want an AI agent that
  7805. 3:58:10decides what model to choose, we need to
  7806. 3:58:13give it this text right here,
  7807. 3:58:15right? And then, it uses that model that
  7808. 3:58:17it we give it will be able to answer the
  7809. 3:58:19question.
  7810. 3:58:20And so, I map this out here.
  7811. 3:58:22This is a two-step uh AI agent. We have
  7812. 3:58:24the first one to choose the LLM, which
  7813. 3:58:25is LLM just means OpenAI, Claude,
  7814. 3:58:27Gemini. And then we have the second AI
  7815. 3:58:29agent to give the answer to the question
  7816. 3:58:32based on the LLM that the first AI agent
  7817. 3:58:33chose. So, [music] if I go here, I can
  7818. 3:58:35delete this now.
  7819. 3:58:37Let's go to the first one, agent.
  7820. 3:58:40Let's do LLM
  7821. 3:58:43router.
  7822. 3:58:44Keep the input the same. Now, the input
  7823. 3:58:46is chat input, which is this.
  7824. 3:58:49Then, we're going to need this as well.
  7825. 3:58:51I'm going to show you exactly how you do
  7826. 3:58:52it. You can go to system message,
  7827. 3:58:56expression, and then I'm going to paste
  7828. 3:58:58the message or the prompt that I already
  7829. 3:58:59had. Go here, paste it. And so, this
  7830. 3:59:02prompt right here basically is giving
  7831. 3:59:03the AI agent an overview of what it is.
  7832. 3:59:05In this case, it's an AI agent that
  7833. 3:59:07decides an LLM model. It gives us the
  7834. 3:59:09name of the LLM model based on the
  7835. 3:59:11question that it was given. And then we
  7836. 3:59:12give it context. So, we say, "Hey, you
  7837. 3:59:14have access to Perplexity Sonar, which
  7838. 3:59:16is good for extended reasoning in this
  7839. 3:59:19and this.
  7840. 3:59:20You have access to OpenAI O3 Mini High,
  7841. 3:59:22which is a cost-efficient model that
  7842. 3:59:23does this.
  7843. 3:59:24You have access to Anthropic Claude 3.5
  7844. 3:59:26Sonnet, which is good for this.
  7845. 3:59:28Right? Your task is to
  7846. 3:59:31respond only in the following JSON
  7847. 3:59:33format, clearly stating the user's
  7848. 3:59:35original query and the selected model.
  7849. 3:59:37Right? So, this will be the output that
  7850. 3:59:38we want.
  7851. 3:59:39We want the Let me take this out,
  7852. 3:59:41actually.
  7853. 3:59:42Cuz it will give it to me like that. Uh
  7854. 3:59:44but we want the user query, which is the
  7855. 3:59:45user's question,
  7856. 3:59:47and then we want the model.
  7857. 3:59:49So that the next AI agent is given the
  7858. 3:59:50model that it needs to use and the
  7859. 3:59:52question that it was it was given by the
  7860. 3:59:54user.
  7861. 3:59:55And so, we also give it a few examples
  7862. 3:59:57cuz it's always good to give the AI
  7863. 3:59:58examples. So, for example, if you find
  7864. 4:00:00the real-time stock price and latest
  7865. 4:00:01news on Tesla, we know that Perplexity
  7866. 4:00:03Sonar is great for research, and so it
  7867. 4:00:05will use the output will be Perplexity
  7868. 4:00:07Sonar. Same thing with craft a full
  7869. 4:00:09business strategy for a startup, it will
  7870. 4:00:11be OpenAI O3 Mini High, and then write
  7871. 4:00:13Python code to build a snake game,
  7872. 4:00:15Anthropic Claude 3.5 Sonnet. And at the
  7873. 4:00:17end of the video, I'll show you how you
  7874. 4:00:18can get the whole system for free, so
  7875. 4:00:19don't worry. Um but this is what we use
  7876. 4:00:21to give the AI agent. Now, we're going
  7877. 4:00:23to require a specific output format
  7878. 4:00:25because of the fact that we are asking
  7879. 4:00:27what we are asking the AI agent to give
  7880. 4:00:30us the output in JSON.
  7881. 4:00:32Right? And so, I'm going to copy this.
  7882. 4:00:35I believe
  7883. 4:00:36this will be the right way to do it. Um
  7884. 4:00:38require specific output format. This is
  7885. 4:00:40good. So, I'm saying, "Hey, let's
  7886. 4:00:42connect this to OpenRouter."
  7887. 4:00:45This isn't the AI agent that will choose
  7888. 4:00:46its model. Let's just use 4.1 Mini, and
  7889. 4:00:48that's fixed. That doesn't change.
  7890. 4:00:50And then,
  7891. 4:00:52the output parser,
  7892. 4:00:53cuz there's memory,
  7893. 4:00:55which is simple memory, which will be
  7894. 4:00:57the thing that the AI agent uses to
  7895. 4:00:58remember its conversation. The tools,
  7896. 4:01:01we're not going to need any tools here.
  7897. 4:01:02And then output parser, we can use
  7898. 4:01:05structured output parser right here.
  7899. 4:01:07And we can say
  7900. 4:01:08define JSON schema,
  7901. 4:01:11and we can say, I believe,
  7902. 4:01:14that it will be
  7903. 4:01:18Oh, is it?
  7904. 4:01:19Properties. Oh, user query, and then
  7905. 4:01:21model. I think this might be it.
  7906. 4:01:25Yeah, I think this might be it. So, we
  7907. 4:01:26say, "Hey, use this JSON." JSON is just
  7908. 4:01:29a It stands for JavaScript Object
  7909. 4:01:30Notation. It's just the way that
  7910. 4:01:32computers speak to each other. It's like
  7911. 4:01:34the English for computers. And so, we're
  7912. 4:01:36saying, "Hey, I want the user query as
  7913. 4:01:38one property,
  7914. 4:01:39and I want the model to be another
  7915. 4:01:41property."
  7916. 4:01:42So, what I'm going to do now is I'm
  7917. 4:01:43going to run this.
  7918. 4:01:45I'm going to go here and say, "Can you
  7919. 4:01:47research
  7920. 4:01:48Tesla news?"
  7921. 4:01:51So, now it should give me the output.
  7922. 4:01:53What is it? There we go.
  7923. 4:01:55Model, Perplexity Sonar, and the user
  7924. 4:01:57query, "Can you research Tesla news?"
  7925. 4:02:01Which is great. Um so, now I can give
  7926. 4:02:03this to the next AI agent to actually
  7927. 4:02:05answer the question using this model.
  7928. 4:02:08But I'll show you here. If I go here and
  7929. 4:02:09I say,
  7930. 4:02:10"Can you
  7931. 4:02:12generate code for a snake game?"
  7932. 4:02:16This should now use Claude. Right? So,
  7933. 4:02:18it should now give me the output of
  7934. 4:02:19Claude.
  7935. 4:02:21And so, that's how you dynamically
  7936. 4:02:22change the model in the next AI agent
  7937. 4:02:25based on the input that we gave. And so,
  7938. 4:02:26the next step is an AI agent again,
  7939. 4:02:30and the input will not be connected to
  7940. 4:02:33the chat trigger node. It will be
  7941. 4:02:34defined below,
  7942. 4:02:35because the input will be user query.
  7943. 4:02:39And if I go here to
  7944. 4:02:41um the chat model,
  7945. 4:02:44and I go to OpenRouter,
  7946. 4:02:47zoom out. I can now go to expression
  7947. 4:02:50because now I'm going to dynamically I'm
  7948. 4:02:52not going to choose this, because if I
  7949. 4:02:54choose this model right here, it will
  7950. 4:02:55always choose this model. It doesn't
  7951. 4:02:56change. So, I'm going to go to
  7952. 4:02:58expression, which allows us to change
  7953. 4:03:00the actual model by text, and I'm going
  7954. 4:03:02to paste Not paste. I'm going to bring
  7955. 4:03:04this across so [music] that it uses
  7956. 4:03:05this,
  7957. 4:03:06which changes every single time based on
  7958. 4:03:09the answer that we get from this AI
  7959. 4:03:10agent. Okay? So, I'm going to go here,
  7960. 4:03:12and then I believe this is it.
  7961. 4:03:14Yep.
  7962. 4:03:16And then AI agent.
  7963. 4:03:18>> [music]
  7964. 4:03:18>> That's cool. So, let's see how it works.
  7965. 4:03:19I'm going to go here, and I'm going to
  7966. 4:03:21paste this again. Let me actually rerun
  7967. 4:03:23this.
  7968. 4:03:24I rerun this. Can you generate code for
  7969. 4:03:26a snake game? Now, it's using the model.
  7970. 4:03:28It's going here.
  7971. 4:03:29It's choosing the actual model that we
  7972. 4:03:31get. So, in this case, it would be
  7973. 4:03:32Anthropic/Claude
  7974. 4:03:343.5 Sonnet. And now it's using Claude
  7975. 4:03:37to generate the answer
  7976. 4:03:39because this is the output here.
  7977. 4:03:41And we get
  7978. 4:03:43the code right here
  7979. 4:03:46using Claude. And then right here we
  7980. 4:03:47have the logs, which is essentially what
  7981. 4:03:49is the step-by-step process that we just
  7982. 4:03:51went through from the start until the
  7983. 4:03:52end.
  7984. 4:03:53And so, what we did there is that we
  7985. 4:03:54have the model, and we have the user
  7986. 4:03:56query. Then it goes to the second AI
  7987. 4:03:57agent. And if I go here,
  7988. 4:04:00I can see that it used this model
  7989. 4:04:02to be able to give us this answer.
  7990. 4:04:05If I go here, I can see that this will
  7991. 4:04:07be the answer. Right? Now, let's change
  7992. 4:04:09it up. Can you do
  7993. 4:04:10research on the top AI news in the US?
  7994. 4:04:14When I press go,
  7995. 4:04:15and now it should be using Perplexity, I
  7996. 4:04:18assume. Yeah, Perplexity Sonar.
  7997. 4:04:20It's going to send the model to this
  7998. 4:04:23OpenRouter chat cuz it dynamically
  7999. 4:04:24changes every single time, and we get
  8000. 4:04:26the output,
  8001. 4:04:27which is the top news.
  8002. 4:04:29Which is crazy, to be honest, because
  8003. 4:04:30now you have the ability to literally
  8004. 4:04:32choose which model you want to use,
  8005. 4:04:33right? Based on the input. And the model
  8006. 4:04:35that we use here is Perplexity Sonar.
  8007. 4:04:37And then it changes every single time.
  8008. 4:04:39And one thing you could do here is you
  8009. 4:04:40can add more and more models. As in, you
  8010. 4:04:42can give it more context to more models.
  8011. 4:04:44This is only three models, right?
  8012. 4:04:46Anthropic, OpenAI, and Perplexity. But
  8013. 4:04:48you can have over 200. Of course, not
  8014. 4:04:50recommended uh to honestly because it
  8015. 4:04:53will kind of trip up, and it might get
  8016. 4:04:54the name wrong. And if it gets the name
  8017. 4:04:55wrong, then this obviously wouldn't
  8018. 4:04:57work. Uh but you can definitely add more
  8019. 4:04:59than three here. So, it has access to
  8020. 4:05:01more models in that case.
  8021. 4:05:05In this video, I'm going to show you the
  8022. 4:05:06top three ways that you can scrape any
  8023. 4:05:08website inside of n8n in just a matter
  8024. 4:05:11of minutes. I'll show you exactly the
  8025. 4:05:12fastest way and the most scalable way
  8026. 4:05:15and which one you should probably use. I
  8027. 4:05:17So, before we get to the actual method,
  8028. 4:05:18let's talk about scraping. So, when
  8029. 4:05:20someone says, "I want to scrape a
  8030. 4:05:21website," what they mean is that they
  8031. 4:05:22want to go inside a domain, a public
  8032. 4:05:24domain, right? Which is accessible, and
  8033. 4:05:27they want to extract all this
  8034. 4:05:29information right here.
  8035. 4:05:31Now, if you don't know, each website is
  8036. 4:05:33actually if I go to inspect,
  8037. 4:05:35it's consisted of all this code. Now,
  8038. 4:05:37luckily, we don't have to know any of
  8039. 4:05:38this, right? But just know that this is
  8040. 4:05:40called HTML. So, HTML is a thing that
  8041. 4:05:44websites are written in, which allows it
  8042. 4:05:46to have an image, have this button
  8043. 4:05:47that's red, have this video, have this
  8044. 4:05:49number, and so on. It makes websites
  8045. 4:05:51look pretty. And so, when we say scrape,
  8046. 4:05:53we're scraping all the information here,
  8047. 4:05:55but realistically, we're scraping this,
  8048. 4:05:57right? We are scraping if I go to
  8049. 4:05:58inspect this code, which you can then
  8050. 4:06:00use to send emails, to maybe reply to
  8051. 4:06:02messages, maybe to customize a message
  8052. 4:06:04based on the website, and so on. And so,
  8053. 4:06:06that's what scraping websites mean. Now,
  8054. 4:06:08the first way is using a HTTP request.
  8055. 4:06:10Now, I covered this node in much more
  8056. 4:06:12detail in my API 101 fundamentals video,
  8057. 4:06:15which you can check up here. But right
  8058. 4:06:16here, we introduce to two different
  8059. 4:06:18fields, the method and the URL. So, the
  8060. 4:06:21[music] URL in this case would literally
  8061. 4:06:22just be the website of the actual thing,
  8062. 4:06:25which is in this case,
  8063. 4:06:26jamesolutions.twooses.com.
  8064. 4:06:28And the method in this case is either
  8065. 4:06:31get, delete, add, options, patch, post,
  8066. 4:06:33put. Now, these are all methods that we
  8067. 4:06:36use when we make a request. A request
  8068. 4:06:37just means we're saying, "Hey server,
  8069. 4:06:39can you do something for us and give us
  8070. 4:06:40back the information?" In this case, we
  8071. 4:06:42have to use get because we want to get
  8072. 4:06:45information. So, now all I have to do is
  8073. 4:06:47put get, put the URL, and leave
  8074. 4:06:50authentication as none, and leave all of
  8075. 4:06:51this blank. And if I press execute step,
  8076. 4:06:54you can see here that it's going inside
  8077. 4:06:56the website, and it's extracting
  8078. 4:06:59all the HTML, the whole code,
  8079. 4:07:02which you can see here, which is very,
  8080. 4:07:04very, very long, right? And this right
  8081. 4:07:06here is what's behind this. We just
  8082. 4:07:08extracted this code right here
  8083. 4:07:10inside this, right? Which you can then
  8084. 4:07:12use to do something else. Now, the only
  8085. 4:07:14problem here is that the HTTP gives us
  8086. 4:07:17the whole HTML, which is way too large
  8087. 4:07:19for us to feed it into maybe an LLM like
  8088. 4:07:21OpenAI, to maybe generate emails or
  8089. 4:07:24generate messages. So, what we do here
  8090. 4:07:26is turn the HTML, which is the whole
  8091. 4:07:28long code of the website, into text,
  8092. 4:07:30which is now readable to someone. So, I
  8093. 4:07:32can go here to plus. I can look for HTML
  8094. 4:07:35uh right here. So, work with HTML. I can
  8095. 4:07:38press on this,
  8096. 4:07:39and I can do extract HTML content,
  8097. 4:07:42which means that it's extracting the
  8098. 4:07:43text from the actual thing. And now, we
  8099. 4:07:46can extract HTML content. The source
  8100. 4:07:48data will be JSON because this is JSON.
  8101. 4:07:50Um well, like this. This is all JSON.
  8102. 4:07:52And if you're wondering what JSON is,
  8103. 4:07:54video up here.
  8104. 4:07:55Uh and then the property will be data
  8105. 4:07:57because this is called data. And the
  8106. 4:07:58key,
  8107. 4:07:59will let's call this website
  8108. 4:08:02text.
  8109. 4:08:04And let's do to
  8110. 4:08:06body.
  8111. 4:08:07And now if execute the step,
  8112. 4:08:09I can see [music] that we actually get
  8113. 4:08:10the text of the website. So, we got from
  8114. 4:08:13the HTML that we got, which is just a
  8115. 4:08:15ton of stuff, which is all of this,
  8116. 4:08:17right? All these letters and colors and
  8117. 4:08:18images and videos, which you typically
  8118. 4:08:20don't want. We just want the text. We're
  8119. 4:08:22saying, "Okay, just extract the text
  8120. 4:08:23from here." And as you can see, this is
  8121. 4:08:25much shorter than this one,
  8122. 4:08:27>> [music]
  8123. 4:08:27>> which is way longer than this, right?
  8124. 4:08:29And now this is something that you can
  8125. 4:08:31add to an AI
  8126. 4:08:32for it to draft emails or do something
  8127. 4:08:34else. And we also use this node right
  8128. 4:08:36here to be able to set up API requests.
  8129. 4:08:38Now, API request, I actually mentioned
  8130. 4:08:40this in my API 101 video, which you can
  8131. 4:08:42find up here. If you go to any of them
  8132. 4:08:44right here on App Event,
  8133. 4:08:46there'll be tons of apps, right? But not
  8134. 4:08:47everything is here, right? And so, how
  8135. 4:08:49do you automate something within an app
  8136. 4:08:51that you can't find the app here, right?
  8137. 4:08:53And so, let's say I want to use
  8138. 4:08:54PandaDoc, but PandaDoc is not here. It's
  8139. 4:08:57unlisted here. But I know for a fact
  8140. 4:08:59that you can actually automate things
  8141. 4:09:00within PandaDoc, which is where we have
  8142. 4:09:02to make our own app using a HTTP
  8143. 4:09:04request. And then we typically use the
  8144. 4:09:06HTTP node when the website is static, no
  8145. 4:09:09JavaScript, which means that it doesn't
  8146. 4:09:10actually change over time, and you're
  8147. 4:09:11testing or building a simple automation.
  8148. 4:09:13So, we typically use this for testing or
  8149. 4:09:15to build something quick. Now, the pros
  8150. 4:09:17is that this is fast and it's free,
  8151. 4:09:18completely free. There's no extra setup
  8152. 4:09:20or accounts needed. You just literally
  8153. 4:09:22need to put a URL and run it. And it
  8154. 4:09:24works great for APIs or plain pages. So,
  8155. 4:09:26APIs, like I mentioned, is just the way
  8156. 4:09:28that softwares talk to each other. So,
  8157. 4:09:30if you can't find a software in any of
  8158. 4:09:31them, you have to set up your own sort
  8159. 4:09:32of app to make it happen, which is where
  8160. 4:09:34you use a HTTP node. And plain pages,
  8161. 4:09:37again, is this. The website is static.
  8162. 4:09:39So, there's just that, just the text. It
  8163. 4:09:41doesn't change over time. It's same.
  8164. 4:09:43Now, the cons of this is that it gets
  8165. 4:09:45messy and unreadable HTML. So, as you
  8166. 4:09:47saw here, this right here gives me the
  8167. 4:09:49whole HTML, which isn't really readable,
  8168. 4:09:51which is why we have to use something
  8169. 4:09:53like this. But if it wasn't for this,
  8170. 4:09:55then we would just have to deal with the
  8171. 4:09:56HTML that makes no sense to anybody.
  8172. 4:09:59Then in terms of web scraping, it can't
  8173. 4:10:01handle JavaScript heavy sites. So, sites
  8174. 4:10:02that are changing over time that are a
  8175. 4:10:04bit more complex, it cannot handle
  8176. 4:10:05those. And it's very, very easy to get
  8177. 4:10:08IP blocked if scraped a lot. So, if you
  8178. 4:10:10scrape this website continuously over
  8179. 4:10:12and over again, you will get blocked,
  8180. 4:10:14right? There's a good chance you will
  8181. 4:10:15get blocked. And on top of that, we can
  8182. 4:10:17actually scrape every website. So, if I
  8183. 4:10:18go to my LinkedIn here,
  8184. 4:10:20and I just copy the URL and I paste it
  8185. 4:10:22here
  8186. 4:10:23inside,
  8187. 4:10:25LinkedIn isn't a platform that you can
  8188. 4:10:27actually scrape on a public level,
  8189. 4:10:29right? So, in this case, what this did
  8190. 4:10:31is that it just literally went to
  8191. 4:10:32LinkedIn.
  8192. 4:10:33It just scraped this. It tried to scrape
  8193. 4:10:35it. And LinkedIn said, "No, we have a
  8194. 4:10:37wall between you and me, and the wall is
  8195. 4:10:39an encryption. It's a password that we
  8196. 4:10:41have to go through." Which is why we
  8197. 4:10:42can't use HTTP requests for everything.
  8198. 4:10:45All right. So, the next method is using
  8199. 4:10:46Firecrawl. So, if you just type
  8200. 4:10:47Firecrawl right here,
  8201. 4:10:49you can go to Firecrawl, the web data
  8202. 4:10:50API for AI. And this website, the server
  8203. 4:10:53is great if you just want to scrape
  8204. 4:10:55websites. That's what it's meant to do.
  8205. 4:10:56And so, when you make an account, just
  8206. 4:10:58go to your dashboard,
  8207. 4:11:00and you are able to then go to API keys,
  8208. 4:11:03copy this key,
  8209. 4:11:04and then if you go back to n8n, you can
  8210. 4:11:07download this. So, you can go to
  8211. 4:11:08Firecrawl.
  8212. 4:11:10You have to install the node. So,
  8213. 4:11:11there'll be a button here that says
  8214. 4:11:12install. And then you have different
  8215. 4:11:14options right here. But when you press
  8216. 4:11:15any options that say scrape a URL and
  8217. 4:11:17get its content, you will get introduced
  8218. 4:11:19to this page right here. All you have to
  8219. 4:11:20do is connect your account by adding the
  8220. 4:11:22API key, press save, and once this is
  8221. 4:11:25connected, you now have the operation
  8222. 4:11:27which you have to pick, which is what is
  8223. 4:11:28the action that we're actually doing.
  8224. 4:11:30And there's different options. So, the
  8225. 4:11:31first one is search and optionally
  8226. 4:11:33scrape search results. Now, what this
  8227. 4:11:34means is that you're asking Google to
  8228. 4:11:36look something up for me. Then we have
  8229. 4:11:38map a website and get URLs. So, this
  8230. 4:11:40goes inside a website and gets all the
  8231. 4:11:41URLs, like the about section, the
  8232. 4:11:43services, the homepage, all that stuff,
  8233. 4:11:45all the URLs that you might need. Then
  8234. 4:11:47we have scrape a URL and get its
  8235. 4:11:48content, which is literally just
  8236. 4:11:50scraping the URL and getting its
  8237. 4:11:52content. So, you're going inside the URL
  8238. 4:11:54and getting everything back, so the
  8239. 4:11:55text.
  8240. 4:11:56And I'll show you how this is different
  8241. 4:11:57from the HTTP that we just used. Crawl a
  8242. 4:12:00website is a bit more advanced than this
  8243. 4:12:02right here. Um, but it still scrapes
  8244. 4:12:03websites. Then we have get crawl status,
  8245. 4:12:06which is you being able to get the
  8246. 4:12:08status of whether this is done or not.
  8247. 4:12:10So, you send a request. You're saying,
  8248. 4:12:12"Hey, can you just go inside this
  8249. 4:12:13website and get absolutely everything
  8250. 4:12:14that you that you have?" And this is
  8251. 4:12:16saying, "Okay, the status is approved.
  8252. 4:12:18Everything's good. You can move
  8253. 4:12:19forward." Then we have extract data. So,
  8254. 4:12:21in case we want to tell it, "Hey, go
  8255. 4:12:22inside the website and extract the
  8256. 4:12:24email, extract whatever it is." Then we
  8257. 4:12:26have get extract status, because the way
  8258. 4:12:28that these work is that you send the
  8259. 4:12:29request at first and then you get the
  8260. 4:12:31status. So, send the request and get the
  8261. 4:12:32status. And then custom API calls, which
  8262. 4:12:34is not going to in case you want to do
  8263. 4:12:36some more complex stuff.
  8264. 4:12:37So, in this case, we're just going to
  8265. 4:12:39use scrape a URL and get its content.
  8266. 4:12:41So, I'm just going to add my website. Go
  8267. 4:12:42here. Let me delete this.
  8268. 4:12:44Looks crazy. Um,
  8269. 4:12:47and I'm going to press execute step.
  8270. 4:12:49And what this will now do, if you go to
  8271. 4:12:51schema, is it would actually
  8272. 4:12:54extract the text. So, in comparison to
  8273. 4:12:56the HTTP node that we just used, this
  8274. 4:12:58doesn't give us the HTML, but it
  8275. 4:13:00automatically
  8276. 4:13:02does the job that these two do, right?
  8277. 4:13:04It goes inside the website and it gives
  8278. 4:13:06me the text, not the HTML. So, it's
  8279. 4:13:08condensed. So, you can see here, right?
  8280. 4:13:10Zoom out.
  8281. 4:13:12This is the text of the website. Plus,
  8282. 4:13:14we also get the metadata. So, we get the
  8283. 4:13:16description, and we get a bunch more
  8284. 4:13:18stuff that we can use for whatever it
  8285. 4:13:20is. And bear in mind that this
  8286. 4:13:21Firecrawl, I believe it's free.
  8287. 4:13:24Uh, they give you free credits every
  8288. 4:13:25month. So, you have about 525 credits. I
  8289. 4:13:28believe that each scrape is about two
  8290. 4:13:31two credits per scrape. But as I
  8291. 4:13:32mentioned, if you want to do something
  8292. 4:13:33more complex, you can also extract the
  8293. 4:13:35data, which allows you to put a prompt
  8294. 4:13:37saying, "Hey, can you extract this for
  8295. 4:13:38me from the website?" And then you can
  8296. 4:13:40put a URL here, and that extracts the
  8297. 4:13:42exact thing that you asked it to
  8298. 4:13:43extract. But in theory, what this would
  8299. 4:13:45look like is you have the URL, so you
  8300. 4:13:47would scrape it. You would do this whole
  8301. 4:13:48thing. Then you add the markdown, which
  8302. 4:13:51is just a way that you write English for
  8303. 4:13:52computers, per se.
  8304. 4:13:54And then you add this to an AI step to
  8305. 4:13:57extract the data that you want, to
  8306. 4:13:58extract maybe what the offers of the
  8307. 4:14:00company, uh, who are they targeting, for
  8308. 4:14:02whatever use case you have. Now, if
  8309. 4:14:04Firecrawl is great if you want a clean
  8310. 4:14:06readable website content. As you
  8311. 4:14:07mentioned,
  8312. 4:14:09we are doing the job of these two just
  8313. 4:14:11by using one node. You're also able to
  8314. 4:14:13scrape modern uh, slash dynamic
  8315. 4:14:15websites, which are websites that change
  8316. 4:14:17over time,
  8317. 4:14:18which is great. And if you want data
  8318. 4:14:20safe from bans and errors. So, there
  8319. 4:14:22isn't really any IP banning like HTTP,
  8320. 4:14:25because behind this node right here,
  8321. 4:14:28there's a ton of code that happens in
  8322. 4:14:29the back end, which allows you to be
  8323. 4:14:31more safe when you scrape. And the pros
  8324. 4:14:33here is handles JavaScript sites easily,
  8325. 4:14:34like I mentioned, so modern and dynamic
  8326. 4:14:36websites. It returns clean markdown or
  8327. 4:14:38JSON, which is not the full HTML, but
  8328. 4:14:40the thing that we actually want from the
  8329. 4:14:42website, which is the text. It uses
  8330. 4:14:44random proxies to avoid bans. Uh, so
  8331. 4:14:46when you hear proxies, it just means
  8332. 4:14:47that it's like sort of some things in
  8333. 4:14:49the back end, in the code behind this
  8334. 4:14:51website, uh, when it actually scrapes,
  8335. 4:14:53that make it safe for you to actually do
  8336. 4:14:55it, right? So, you don't actually get
  8337. 4:14:56banned.
  8338. 4:14:58And can map, search, or extract data at
  8339. 4:15:00scale. So, this is scalable, much more
  8340. 4:15:02scalable than this, because this only
  8341. 4:15:04works for a few sites and then you get
  8342. 4:15:05banned or something bad happens. But in
  8343. 4:15:08this case, because it's safer, it's also
  8344. 4:15:09more scalable over time.
  8345. 4:15:12The only cons of this is that it needs
  8346. 4:15:13an API key plus a small cost per crawl.
  8347. 4:15:16So, as we saw, this is not free. I mean,
  8348. 4:15:18it is free,
  8349. 4:15:19but if you want to go above this, then
  8350. 4:15:21you're going to have to pay. And I
  8351. 4:15:22believe that if I go to the website,
  8352. 4:15:24I go to pricing,
  8353. 4:15:27then we have per credits, right? So, we
  8354. 4:15:29have 500 credits for free.
  8355. 4:15:32And if you want
  8356. 4:15:343,000 credits, you have to pay $16 a
  8357. 4:15:36month, 16 euros a month,
  8358. 4:15:37which is not bad. Um, but it only
  8359. 4:15:39depends of how many credits you need.
  8360. 4:15:41All right. And each scrape takes about
  8361. 4:15:43two credits.
  8362. 4:15:44You can scrape about 1,500 websites, um,
  8363. 4:15:46using 3,000 credits, depending on the
  8364. 4:15:49website and depending how complex it is.
  8365. 4:15:50And then it's slightly slower than a raw
  8366. 4:15:52HTTP request. So, this takes a bit more
  8367. 4:15:54time uh, just because there's more stuff
  8368. 4:15:56in the back end. As you can see here, if
  8369. 4:15:58I go to execute step, one, two.
  8370. 4:16:01Well, actually pretty fast. Uh, and
  8371. 4:16:03here,
  8372. 4:16:05if I just go to Gen Solutions,
  8373. 4:16:08it's much faster, right? Like maybe half
  8374. 4:16:10the time. And the third method is Apify.
  8375. 4:16:13Now, I've made a full masterclass on
  8376. 4:16:14Apify, exactly how it works and
  8377. 4:16:16different use cases that you can use
  8378. 4:16:17with Apify. You can check it out up
  8379. 4:16:19here. But if I go to Apify platform,
  8380. 4:16:21apify.com, the way that I would describe
  8381. 4:16:23this is the Amazon for scrapers. So,
  8382. 4:16:25just like on Amazon, people sell
  8383. 4:16:27something and others buy something.
  8384. 4:16:29There's consumers and there's sellers.
  8385. 4:16:30In this case, the consumers is us. We're
  8386. 4:16:32going inside the platform to say, "Hey,
  8387. 4:16:34I want to scrape some Instagram
  8388. 4:16:36profiles."
  8389. 4:16:37And on the seller side, it's like, "Hey,
  8390. 4:16:39I just built a scraper that you can use
  8391. 4:16:41to scrape Instagram profiles, but you
  8392. 4:16:42have to pay me or you have to do some
  8393. 4:16:44sort of exchange of of credits or
  8394. 4:16:46something like that." And so, when you
  8395. 4:16:47make an account on Apify, you can go to
  8396. 4:16:49console,
  8397. 4:16:50and important thing here is that on the
  8398. 4:16:53bottom, you see that we have 8 gigabytes
  8399. 4:16:55of RAM, which is memory, and we have $5
  8400. 4:16:58for free every single month. Now, if you
  8401. 4:17:00do the math here, depending on which
  8402. 4:17:02scraper you use, it's free, right?
  8403. 4:17:04Depending on how much you use it. And
  8404. 4:17:06so, this is great because it allows us
  8405. 4:17:07to scrape tons more stuff than something
  8406. 4:17:10like Firecrawl or definitely HTTP,
  8407. 4:17:12because now we have the ability to
  8408. 4:17:13scrape Google Maps, Facebook, TikTok,
  8409. 4:17:15tons of stuff that you just simply can't
  8410. 4:17:17do with Firecrawl or HTTP.
  8411. 4:17:20But in this case, let's just do the
  8412. 4:17:22website content crawler, right? So, the
  8413. 4:17:23first step is actually connecting n8n to
  8414. 4:17:25Apify. So, I'm going to go to the run an
  8415. 4:17:27actor, which you can find Apify here.
  8416. 4:17:30You can do run an actor.
  8417. 4:17:32Actions, run an actor.
  8418. 4:17:34And by the way, actor is just the the
  8419. 4:17:36scraper. So, we call them scraper. Like
  8420. 4:17:37the Amazon product is called in this
  8421. 4:17:39case an actor.
  8422. 4:17:41The way to connect it is go here, press
  8423. 4:17:43plus, then go back here, go to settings,
  8424. 4:17:46I believe. Yes. And then go to API
  8425. 4:17:48integrations, and you You copy this.
  8426. 4:17:51Bring it back.
  8427. 4:17:53And go to API key. And save.
  8428. 4:17:56And name it whatever you want. Press
  8429. 4:17:58save. And now you have your account
  8430. 4:17:59connected. And now the resource is
  8431. 4:18:01actor. The action that we're taking is
  8432. 4:18:03run an actor. The actor source is
  8433. 4:18:05recently run actors. And the actor in
  8434. 4:18:07this case, you can choose
  8435. 4:18:09Um in this case you want to use the
  8436. 4:18:10website content crawler. Which you can
  8437. 4:18:12find right here. You can go to Apify
  8438. 4:18:15Store.
  8439. 4:18:16Go to website. Well, in this case you
  8440. 4:18:17can see it here.
  8441. 4:18:19And let's say you didn't see that. You
  8442. 4:18:20can go website content crawler.
  8443. 4:18:23Press here. And now you can start using
  8444. 4:18:26this scraper right away. And like I
  8445. 4:18:27mentioned, this scraper, what it is,
  8446. 4:18:29it's something that Well, in this case
  8447. 4:18:31it was built by Apify itself, the
  8448. 4:18:33platform. But usually we have
  8449. 4:18:35random people like Let me show you.
  8450. 4:18:37We have Compass. We have API Dojo. We
  8451. 4:18:40have Clockwork.
  8452. 4:18:41We have Curious Coder and some other
  8453. 4:18:43people who actually build these scrapers
  8454. 4:18:45and make money out of them. So as you
  8455. 4:18:46can see here, the pricing is pay per
  8456. 4:18:48usage. So you pay per run. But since we
  8457. 4:18:51have $5 of free credits, each run I
  8458. 4:18:53believe is a few cents. We'll see when
  8459. 4:18:55we actually run it. Um but it's very
  8460. 4:18:57very cheap. So in this case, you just
  8461. 4:18:58want to just test it. Just press start.
  8462. 4:19:00This will be an automatic thing that
  8463. 4:19:01will be there at default.
  8464. 4:19:03When you press start, what this will
  8465. 4:19:05look like is that it will start running.
  8466. 4:19:07We'll show you that it's running.
  8467. 4:19:09And here it will show you the results.
  8468. 4:19:11The request, the amount of usage that it
  8469. 4:19:12takes to script the website, and the
  8470. 4:19:14duration, and also the date. And down
  8471. 4:19:16here you can see the actor getting the
  8472. 4:19:18data. Now an important thing here is
  8473. 4:19:19that we currently just used Apify's
  8474. 4:19:22platform to scrape. But ideally we want
  8475. 4:19:24to use it within our automations. And so
  8476. 4:19:26right here, we can see that we have the
  8477. 4:19:27full text of the website, which is
  8478. 4:19:29great.
  8479. 4:19:30And now in order for us to set this
  8480. 4:19:32scraper up, all we have to do is go back
  8481. 4:19:34to n8n. I can choose the website content
  8482. 4:19:36crawler. And now we need an input JSON.
  8483. 4:19:39So an input JSON is something that you
  8484. 4:19:40can find right here.
  8485. 4:19:41>> [music]
  8486. 4:19:42>> And right here, there's two different
  8487. 4:19:43ways that you can run it. The first way
  8488. 4:19:44is manual, where you can start adding
  8489. 4:19:45the URL of the website, the different
  8490. 4:19:47types of crawlers, which is optional,
  8491. 4:19:49but you have different types. So adapt
  8492. 4:19:51to switching between browser and raw
  8493. 4:19:52HTTP, which by the way makes no sense to
  8494. 4:19:55anybody. And then we can use the crawler
  8495. 4:19:56type, which is the type of thing or the
  8496. 4:19:59type of way that we actually crawl the
  8497. 4:20:01website. Crawl just means extract all
  8498. 4:20:02the data that you can then apply to the
  8499. 4:20:05actual [music] scrape.
  8500. 4:20:06And then there's also stuff like crawler
  8501. 4:20:07settings, HTML processing, output
  8502. 4:20:10settings, and run options, which are all
  8503. 4:20:12things that we can change. But to keep
  8504. 4:20:13it simple, we will not change anything.
  8505. 4:20:15All we have to do is go to JSON, which
  8506. 4:20:17is the way that we actually use this in
  8507. 4:20:19the automation.
  8508. 4:20:21All I have to do is copy this.
  8509. 4:20:24I have to go back to n8n.
  8510. 4:20:26I can delete this. I can paste the URL.
  8511. 4:20:29Well, not the URL, the JSON.
  8512. 4:20:31And now all I have to do is change the
  8513. 4:20:33website, right? With the URL. In this
  8514. 4:20:35case, let's leave this right here. I can
  8515. 4:20:37now press execute step.
  8516. 4:20:39If I go back, I can see in the runs
  8517. 4:20:41this is now running.
  8518. 4:20:43So we have a new thing running
  8519. 4:20:44automatically, right? Without going into
  8520. 4:20:46the actual platform,
  8521. 4:20:47which is how you use it within your
  8522. 4:20:48automations. All right. So I realized
  8523. 4:20:50there was an issue here. And the issue
  8524. 4:20:52was that I actually exceeded my memory,
  8525. 4:20:53even though it doesn't say here, but
  8526. 4:20:55I've been using this a lot more than you
  8527. 4:20:56think. Um but if you're new to this, you
  8528. 4:20:58will not have that problem. So I'm going
  8529. 4:20:59to sign out and log in with a different
  8530. 4:21:01account. So what I did here is I just
  8531. 4:21:02changed account cuz the other one was
  8532. 4:21:04maxed out. And now the actor is running.
  8533. 4:21:06So we can wait for the information here.
  8534. 4:21:08All right. So it just finished running.
  8535. 4:21:09And we get this data right here. As you
  8536. 4:21:11can see, I told you that we don't
  8537. 4:21:12actually get the text of the website.
  8538. 4:21:14What we get is something called a
  8539. 4:21:16default data set ID, which I can copy.
  8540. 4:21:20And then Well, not copy, but go to the
  8541. 4:21:21next step. So let me just pin this.
  8542. 4:21:23Press P so I don't have to rerun this
  8543. 4:21:24again.
  8544. 4:21:25And right here, I can go to schema. I
  8545. 4:21:29can look for the default data set ID,
  8546. 4:21:31which is right here.
  8547. 4:21:33And I can give it as well.
  8548. 4:21:36And make sure that your connection is
  8549. 4:21:38correct. And now if I press execute
  8550. 4:21:40step, I can see that I have the whole
  8551. 4:21:41JSON here. And down here I have the text
  8552. 4:21:45of the website, which I can then use for
  8553. 4:21:47the next steps. Now you should only be
  8554. 4:21:48using Apify when when you're doing
  8555. 4:21:50large-scale scraping or complex projects
  8556. 4:21:52like LinkedIn, Amazon, because Apify is
  8557. 4:21:54known not for scraping just websites,
  8558. 4:21:57but for scraping Instagram profiles or
  8559. 4:21:59TikTok profiles or Facebook or LinkedIn.
  8560. 4:22:01If I go to here, LinkedIn, a platform
  8561. 4:22:03that natively does not want to get
  8562. 4:22:05scraped, um you can see that we can
  8563. 4:22:07scrape it using this stuff using these
  8564. 4:22:09different scrapers. And we have tons of
  8565. 4:22:11options as well. And also when you need
  8566. 4:22:12to use pre-built scrapers or browser
  8567. 4:22:14automation, because these right here are
  8568. 4:22:16all pre-built scrapers that we can use
  8569. 4:22:19to do whatever it is that we wanted to.
  8570. 4:22:20And we have a big variety of different
  8571. 4:22:22scrapers that we can use for different
  8572. 4:22:24use cases. Like I mentioned, social
  8573. 4:22:25media is a big one, uh which is where we
  8574. 4:22:27use Apify for a lot of these things. Uh
  8575. 4:22:29but there's tons more as well. Now the
  8576. 4:22:31pros is that we have a huge library of
  8577. 4:22:32pre-made scrapers, actors. It's
  8578. 4:22:34cloud-based, so there's no setup. It
  8579. 4:22:36handles login-based or complex sites,
  8580. 4:22:38which is very good, like LinkedIn,
  8581. 4:22:39something that with a HTTP node, you
  8582. 4:22:42just can't do because there's an
  8583. 4:22:43encryption, there's a password. And so
  8584. 4:22:45what they have is they have proxies that
  8585. 4:22:47go around the password. They make it
  8586. 4:22:49seem like they're an actual user to then
  8587. 4:22:51script the data. And the cons is that it
  8588. 4:22:53can get quite expensive at scale,
  8589. 4:22:54depending on the scraper that you use,
  8590. 4:22:56depending on the actor.
  8591. 4:22:57More setup steps for custom logic, and
  8592. 4:23:00overkill for small simple scripts,
  8593. 4:23:02right?
  8594. 4:23:03So if you're using something really
  8595. 4:23:04really simple, you're better off going
  8596. 4:23:06with something like Firecrawl, which is
  8597. 4:23:08simple, is very easy to set up, and it's
  8598. 4:23:10just made for websites. So now that you
  8599. 4:23:12have the skills to build workflows with
  8600. 4:23:14AI agents, let's focus on building just
  8601. 4:23:17AI workflows. Now don't get me wrong, AI
  8602. 4:23:19agents are extremely powerful when you
  8603. 4:23:20have to build them for businesses. But
  8604. 4:23:22the reality is that most of the times we
  8605. 4:23:25simply don't want an AI agent inside the
  8606. 4:23:27workflow because it's much easier just
  8607. 4:23:29to have a simple workflow. And tons of
  8608. 4:23:30businesses just need something simple
  8609. 4:23:33rather than anything complex that will
  8610. 4:23:34just make it harder, that is not
  8611. 4:23:36scalable, and that we simply just can't
  8612. 4:23:38put to production. And so in the next
  8613. 4:23:39module, we'll look at real-world AI
  8614. 4:23:41workflows, projects that we build step
  8615. 4:23:43by step for businesses. We'll look at
  8616. 4:23:45everything again from finance,
  8617. 4:23:47operations, sales, and marketing. So
  8618. 4:23:48you'll be able to build AI agents and
  8619. 4:23:50workflows at the same time.
  8620. 4:23:58I built no-code rag agent inside of n8n,
  8621. 4:24:01which allows me to search through
  8622. 4:24:02hundreds of documents all within
  8623. 4:24:04seconds. All right. So this agent is
  8624. 4:24:05split up into two different steps. The
  8625. 4:24:07first step is new document into
  8626. 4:24:08Superbase. So if I go here to the SOPs,
  8627. 4:24:10which ChatGPT made a quick one, I can
  8628. 4:24:12see that I have an SOP for a creative
  8629. 4:24:14agency. All I have to do right here is
  8630. 4:24:16go to file. I can download it as a PDF.
  8631. 4:24:19And this is a thing that I have to
  8632. 4:24:20upload into Google Drive. As soon as I
  8633. 4:24:22upload it into Google Drive, it will
  8634. 4:24:24download here. And I just have to press
  8635. 4:24:27execute workflow. Of course, this
  8636. 4:24:28workflow will automatically be will be
  8637. 4:24:30executed every on a polling trigger, so
  8638. 4:24:31every day or every hour, whatever it is.
  8639. 4:24:33And now this file is stored in our
  8640. 4:24:35Superbase, which is the vector database
  8641. 4:24:37that we have here. And now all I have to
  8642. 4:24:39do is go to our next agent, which is the
  8643. 4:24:41agent that you'll be using, and go to
  8644. 4:24:43open chat and ask any questions we have.
  8645. 4:24:45So if I go to SOPs, I can see that one
  8646. 4:24:47of the questions one of the things that
  8647. 4:24:48I mentioned is that ClickUp or Asana or
  8648. 4:24:50Notion are used as a project management
  8649. 4:24:52tool. So if I go here and say What tools
  8650. 4:24:56do we use
  8651. 4:24:58for our project management?
  8652. 4:25:01What it's doing now, it's it's querying
  8653. 4:25:03the agent. So it's querying the actual
  8654. 4:25:04database that we stored the information
  8655. 4:25:06in. And it's going to give us an answer.
  8656. 4:25:07In this case, it's ClickUp. All right.
  8657. 4:25:09If I go here, the answer was ClickUp.
  8658. 4:25:12All right. So that's exactly how the
  8659. 4:25:13agent works. And if you have hundreds of
  8660. 4:25:14documents, it will scan through hundreds
  8661. 4:25:16of documents and it will give you a
  8662. 4:25:17concise answer based on what it found.
  8663. 4:25:18All right. So let's go to Miro and let
  8664. 4:25:20me show you exactly how it works and
  8665. 4:25:21what the whole thing's about. So the
  8666. 4:25:23source data is essentially what is that
  8667. 4:25:24thing that we give the agent? What is
  8668. 4:25:26that thing that we give the database for
  8669. 4:25:27it to pull information from when we ask
  8670. 4:25:29any questions? Uh in this case, it can
  8671. 4:25:31be in the form of video, audio, image,
  8672. 4:25:33or text.
  8673. 4:25:34We use PDF, but you can use any of
  8674. 4:25:36these. Now for the source data, for the
  8675. 4:25:38data, for the file, whatever you're
  8676. 4:25:39using, uh to be added to the database,
  8677. 4:25:42again for the agent to pull information
  8678. 4:25:43from, it needs to be transformed into an
  8679. 4:25:46embedding. Now what the embedding means
  8680. 4:25:48is that it takes the file and turns it
  8681. 4:25:49into these numbers, into vectors, right?
  8682. 4:25:51Which gives me a bad bad um memory of
  8683. 4:25:54high school. Uh but the embeddings right
  8684. 4:25:56here are 0100100.
  8685. 4:25:59It's just a bunch of numbers that
  8686. 4:26:00represent the file that we gave it. And
  8687. 4:26:02then these vectors, so this is a vector
  8688. 4:26:04for a specific file, will be stored into
  8689. 4:26:06a vector database, which is a database
  8690. 4:26:09which has different vectors for
  8691. 4:26:10different files. And that's the thing
  8692. 4:26:12that the agent is going to query, is
  8693. 4:26:13going to ask when it needs to find
  8694. 4:26:15anything that we asked it. And
  8695. 4:26:17fundamentally, that's how a file gets
  8696. 4:26:19turned into a vector, which gets stored
  8697. 4:26:21into a vector database. It might sound
  8698. 4:26:23complex, but it's actually very very
  8699. 4:26:24easy because a file is a vector and
  8700. 4:26:26database is just full of vectors, full
  8701. 4:26:28of files. Now, how does it work when you
  8702. 4:26:30actually ask it a question? How does it
  8703. 4:26:31pull information from the vector
  8704. 4:26:32database to give us an answer? Well, the
  8705. 4:26:34question that you asked it is in text.
  8706. 4:26:35You say, "Hey, what is that XYZ?" Now
  8707. 4:26:38those different letters that you asked
  8708. 4:26:40those sentences that you give or that
  8709. 4:26:41question gets turned into an embedding,
  8710. 4:26:44which gets matched to the embeddings
  8711. 4:26:45here. And that's how it gives you an
  8712. 4:26:46answer cuz it matches the different
  8713. 4:26:48numbers. All right. So let's go to n8n.
  8714. 4:26:49Let me go here and we can actually build
  8715. 4:26:51one from scratch.
  8716. 4:26:53So the first one, as I mentioned, is
  8717. 4:26:55pulling data
  8718. 4:26:57from a Google Drive. And that will be
  8719. 4:26:58the thing that will be stored into the
  8720. 4:27:00Superbase. So ideally your team will
  8721. 4:27:02just drop files in Google Drive and the
  8722. 4:27:04automation just runs every every so
  8723. 4:27:06often, every 1 hour, every day, whatever
  8724. 4:27:07it is. So first step is actually making
  8725. 4:27:10the drive. So we made a drive. We called
  8726. 4:27:12it rag example. And that's the thing
  8727. 4:27:13that you want to do on a Google Drive
  8728. 4:27:14because that's the place that we use to
  8729. 4:27:15just drop the documents for it to go to
  8730. 4:27:17the Superbase.
  8731. 4:27:18And then we go here. And one of the
  8732. 4:27:20first steps here is watching every new
  8733. 4:27:22file that is created because that's the
  8734. 4:27:23thing that starts the automation, right?
  8735. 4:27:24We don't want to automatically or we
  8736. 4:27:26don't want to manually run the
  8737. 4:27:27automation every single time. We want
  8738. 4:27:28the automation to be smart enough to
  8739. 4:27:30know when a file is created in the drive
  8740. 4:27:32so that it pulls it to the database. So
  8741. 4:27:34the first step here is Google Drive.
  8742. 4:27:37And the action is
  8743. 4:27:39on changes involving a specific folder.
  8744. 4:27:43So what this is is you're watching a
  8745. 4:27:44specific change within a folder. And the
  8746. 4:27:46to change itself is a new file being
  8747. 4:27:48created. So, all you have to do to
  8748. 4:27:49connect Google Drive to your N8N is go
  8749. 4:27:52here and you need a client ID and client
  8750. 4:27:54secret. I would recommend watching or
  8751. 4:27:56asking the assistant exactly
  8752. 4:27:57step-by-step what you can do. It's more
  8753. 4:27:59of a longer process, um but it's very
  8754. 4:28:01very easy. Let me know down below if you
  8755. 4:28:03want a full tutorial where I can show
  8756. 4:28:04you exactly how you can do it. Uh but
  8757. 4:28:06once you connected your Google Drive,
  8758. 4:28:08let me go here,
  8759. 4:28:08>> [music]
  8760. 4:28:09>> you'll have this.
  8761. 4:28:10Then it's asking you poll times. This
  8762. 4:28:12means how long or how often do you want
  8763. 4:28:14to run the automation? So, in this case,
  8764. 4:28:16we can do every minute, which is fine.
  8765. 4:28:18And trigger on changes involved in the
  8766. 4:28:20folder. Okay, that's fine because we
  8767. 4:28:21want to change we want to watch changes
  8768. 4:28:23inside the folder. The folder itself
  8769. 4:28:24will be rag example, so rag example.
  8770. 4:28:28So, here. And then what are we watching
  8771. 4:28:30for? In this case, we're watching for a
  8772. 4:28:31file being created, right? So, let me
  8773. 4:28:33actually test this. Let me fetch test
  8774. 4:28:35event.
  8775. 4:28:37In this case,
  8776. 4:28:39I think the file was the one I put it
  8777. 4:28:41before, but let me do another one. So,
  8778. 4:28:42let me delete this
  8779. 4:28:45with the trash.
  8780. 4:28:46And let me
  8781. 4:28:47put it back here. So, I delete when one
  8782. 4:28:49is here. Every minute it runs and it
  8783. 4:28:50checks that it any document has been
  8784. 4:28:52added. So, I can go here, fetch test
  8785. 4:28:53event, and this right here has been
  8786. 4:28:55added and this will be
  8787. 4:28:57the file. So, let's see if that's the
  8788. 4:28:59file that we have.
  8789. 4:29:01Agency SOPs to PDF, [music]
  8790. 4:29:03which is this one.
  8791. 4:29:05Right, and that's the one that we're
  8792. 4:29:06going to be adding to the actual
  8793. 4:29:08database. All right, so now we have an
  8794. 4:29:11automation set up where it triggers
  8795. 4:29:12whenever a file is created inside of
  8796. 4:29:14Google Drive. But how do we actually
  8797. 4:29:15send a document from Google Drive to the
  8798. 4:29:17vector database? Right? Well, in this
  8799. 4:29:19case, to send any documents there, we
  8800. 4:29:20have to download the file first because
  8801. 4:29:22the vector database only
  8802. 4:29:24gets or only intakes binary, which I
  8803. 4:29:26will explain in just a second. But the
  8804. 4:29:28way that we have to send a document in
  8805. 4:29:30the vector database is in a very very
  8806. 4:29:31specific format, which is in the binary
  8807. 4:29:33format. So, all we have to do here is
  8808. 4:29:35actually download the file before we
  8809. 4:29:36send it to the vector database. And to
  8810. 4:29:38download the file, you have to press
  8811. 4:29:39plus, go to drive, and then you can
  8812. 4:29:41download a file right here.
  8813. 4:29:44Connect it, which is the same. File
  8814. 4:29:46download, and then the file we don't
  8815. 4:29:48want to select the file because we want
  8816. 4:29:49it to be dynamic. We want it to change
  8817. 4:29:50every single time,
  8818. 4:29:51and we can do ID, and the ID of the file
  8819. 4:29:54will be the one here. So, let me go
  8820. 4:29:57down to the ID. There we go.
  8821. 4:29:59And this is the ID of the file that
  8822. 4:30:00changes every single time because it's a
  8823. 4:30:02new file that we're doing. And that's
  8824. 4:30:03the thing that's going to be added to
  8825. 4:30:05the vector database.
  8826. 4:30:07And if I go here, let me just pin this,
  8827. 4:30:09which means that I'll already have this
  8828. 4:30:10input. I can I don't have to rerun this.
  8829. 4:30:12I can just use this as test data. I can
  8830. 4:30:14add it to the step,
  8831. 4:30:16and I can see that we have binary right
  8832. 4:30:18here.
  8833. 4:30:19This is exactly the type of input or the
  8834. 4:30:21type of thing that goes into the vector
  8835. 4:30:23database,
  8836. 4:30:24which you don't get in the previous one.
  8837. 4:30:26So, we have to download it first.
  8838. 4:30:28All right. Now, once we downloaded it,
  8839. 4:30:29we can go to Superbase because that's
  8840. 4:30:31the software that we're using to
  8841. 4:30:32actually add a document to. Superbase
  8842. 4:30:34vector store.
  8843. 4:30:36Add documents to vector store because
  8844. 4:30:37we're adding a document,
  8845. 4:30:39and you'll come on this page.
  8846. 4:30:40Now, once you come on this page, in
  8847. 4:30:41order for us to connect your Superbase
  8848. 4:30:43vector store, I'm going to go through
  8849. 4:30:44everything step-by-step. So, we go here,
  8850. 4:30:47create new credential,
  8851. 4:30:48and then the service role secret will
  8852. 4:30:50should be the thing in Superbase. So,
  8853. 4:30:52let me go here. Let me actually log out
  8854. 4:30:54and make a new account so you guys can
  8855. 4:30:55see exactly what it looks like. Let's
  8856. 4:30:56sign up now, actually.
  8857. 4:30:59Let me do my email,
  8858. 4:31:04and then my password.
  8859. 4:31:08Got
  8860. 4:31:09which is the same password I use for
  8861. 4:31:11every single email, which is not good.
  8862. 4:31:12Uh sign up.
  8863. 4:31:15Check your email notification. So, this
  8864. 4:31:17is the email that I got. Confirm email
  8865. 4:31:18address, and this will be the account
  8866. 4:31:20that is just made for Superbase.
  8867. 4:31:24All we have to do is organization,
  8868. 4:31:26personal. There you go. Create
  8869. 4:31:27organization.
  8870. 4:31:29And that's I just want to walk you
  8871. 4:31:30through step-by-step because that's
  8872. 4:31:31exactly what you have to do when you do
  8873. 4:31:32this.
  8874. 4:31:33And you can create a new project. Uh let
  8875. 4:31:35me just
  8876. 4:31:36let me just cancel. [music] That's fine.
  8877. 4:31:38So, that's it. So, now actually we can
  8878. 4:31:40create a new project because we actually
  8879. 4:31:41need this.
  8880. 4:31:42Uh let me do N8N
  8881. 4:31:44YouTube rag agent.
  8882. 4:31:47The password is
  8883. 4:31:51not strong enough.
  8884. 4:31:52Create a new project, and now we have
  8885. 4:31:54the project that is being added to
  8886. 4:31:56Superbase. All right, cool. So, once you
  8887. 4:31:58get to this page, there's a few things
  8888. 4:31:59we have to do. Now, the first thing we
  8889. 4:32:00have to do is we have to connect our
  8890. 4:32:03Superbase to N8N. And then the second
  8891. 4:32:06thing we have to do is actually make the
  8892. 4:32:07database that we add the document to.
  8893. 4:32:09So, in order for us to connect N8N, we
  8894. 4:32:11have to have a service role secret. In
  8895. 4:32:14order to have the service role secret,
  8896. 4:32:15we have to go, I believe, to project
  8897. 4:32:16settings, API keys.
  8898. 4:32:19There we go. Service role secret. So, we
  8899. 4:32:21can reveal. Let me just copy this,
  8900. 4:32:24and this is the thing that you want to
  8901. 4:32:25paste into N8N.
  8902. 4:32:27>> [music]
  8903. 4:32:27>> So, on here.
  8904. 4:32:28And you can save it.
  8905. 4:32:31Couldn't couldn't connect with these
  8906. 4:32:32settings. Let's see why. Okay, and so
  8907. 4:32:34the reason why it says couldn't connect
  8908. 4:32:35settings because I'm missing my host,
  8909. 4:32:36which I didn't even see. Uh now, so to
  8910. 4:32:38connect this host, you have to go to
  8911. 4:32:40Superbase.
  8912. 4:32:41You have to go to, I believe, project
  8913. 4:32:43overview. Yeah. And then down here,
  8914. 4:32:46there should be a project URL, which is
  8915. 4:32:47this one right here.
  8916. 4:32:49So, you should copy, go back to N8N,
  8917. 4:32:52paste it, and now you can save it.
  8918. 4:32:54And now the connection is tested
  8919. 4:32:55successfully. Let me do N8N YouTube
  8920. 4:32:59uh
  8921. 4:33:03Name your connections right cuz don't be
  8922. 4:33:05like me. Save it. Okay, so now that we
  8923. 4:33:06connected our N8N to Superbase, we have
  8924. 4:33:09to put operations mode, which is insert
  8925. 4:33:11document because that's the thing that
  8926. 4:33:12we're doing. We're inserting a document
  8927. 4:33:14into a database. But the problem is
  8928. 4:33:16there's no database to add the documents
  8929. 4:33:18to. So, the next step is this.
  8930. 4:33:20All we have to do to connect or to add a
  8931. 4:33:22database is to go to docs,
  8932. 4:33:25scroll down
  8933. 4:33:26to
  8934. 4:33:27uh where is it? Yeah, this one here. So,
  8935. 4:33:30a quick start for setting up your vector
  8936. 4:33:31store. Press this,
  8937. 4:33:33>> [music]
  8938. 4:33:33>> and you'll come on this page. All you
  8939. 4:33:34have to do here, just have to copy this,
  8940. 4:33:37right? Don't get overwhelmed. Just
  8941. 4:33:38follow me step-by-step. You go to
  8942. 4:33:40Superbase, and then you have to go to
  8943. 4:33:42this right here, SQL editor.
  8944. 4:33:45Just paste this here.
  8945. 4:33:47Paste it. There you go, like this.
  8946. 4:33:49Let me zoom out. And now you will have
  8947. 4:33:51this code here. Now, all you have to do
  8948. 4:33:53is run it.
  8949. 4:33:54Once you run it, on the bottom right,
  8950. 4:33:57it should say success, no rows returned.
  8951. 4:33:59[music]
  8952. 4:34:00Okay, so once that's done, once you
  8953. 4:34:02actually made this, on the table editor,
  8954. 4:34:04you can see that we just made a table
  8955. 4:34:05called documents. And this right here is
  8956. 4:34:07the database that we're going to be
  8957. 4:34:08adding document to. So, if I go back to
  8958. 4:34:10N8N, I can now choose
  8959. 4:34:13refresh. Let's refresh, actually,
  8960. 4:34:15cuz sometimes it trips out.
  8961. 4:34:17And it takes a while to actually update.
  8962. 4:34:18I'm going to go here,
  8963. 4:34:20and I'll have documents now from the
  8964. 4:34:21list. And so, that's document that's the
  8965. 4:34:24the place where we actually get to store
  8966. 4:34:25the document in. If I go to options,
  8967. 4:34:28can match the options, map documents,
  8968. 4:34:30and leave this as is. And the embedding
  8969. 4:34:31max size is 200, which is fine. And now,
  8970. 4:34:34in order for us to actually make it
  8971. 4:34:36work, we have to connect two different
  8972. 4:34:38things. The first one is the embedding,
  8973. 4:34:40which is what is that AI or I mentioned
  8974. 4:34:43before that we have to take the file and
  8975. 4:34:44turn it into different numbers. So, we
  8976. 4:34:45have to use AI for this, which in this
  8977. 4:34:46case, we could use OpenAI right here.
  8978. 4:34:49And we can leave this as text embedding
  8979. 4:34:51three small. Again, to connect your
  8980. 4:34:53OpenAI to N8N, all you have to do is get
  8981. 4:34:55the API key, which you can find on
  8982. 4:34:57platform.openai.com.
  8983. 4:34:58Let me go here. Let me actually show
  8984. 4:34:59you.
  8985. 4:35:00platform.openai.com. You log in.
  8986. 4:35:02Dashboard. On the left-hand side, you
  8987. 4:35:04have API keys.
  8988. 4:35:06Create a secret key. Name it whatever
  8989. 4:35:07you want. So, let's do N8N test.
  8990. 4:35:11YouTube.
  8991. 4:35:13Secret key. Copy this.
  8992. 4:35:16And now
  8993. 4:35:17we can go to N8N. We can paste this.
  8994. 4:35:20Name this
  8995. 4:35:22test August 19th.
  8996. 4:35:24Oh god.
  8997. 4:35:25Test August 19th.
  8998. 4:35:28We can save this, and now the
  8999. 4:35:29connection's done. Okay, that's how you
  9000. 4:35:30connect your OpenAI to N8N.
  9001. 4:35:32Um and now for the model itself, you
  9002. 4:35:34want to connect this to a text embedding
  9003. 4:35:36three small. It doesn't really matter.
  9004. 4:35:37Um just do this one. This is the fastest
  9005. 4:35:39and uh probably the most efficient for
  9006. 4:35:41now.
  9007. 4:35:42And this is the thing again that's going
  9008. 4:35:43to take the file, turn it into numbers,
  9009. 4:35:45to then add it to the database. And now,
  9010. 4:35:47for us to actually add a document, we
  9011. 4:35:49have to do the default data loader. So,
  9012. 4:35:51loads data from previous steps into the
  9013. 4:35:53workflow. So, let me go here. I can
  9014. 4:35:55press this.
  9015. 4:35:55>> [music]
  9016. 4:35:56>> And in this case, we don't want to do
  9017. 4:35:57JSON, but I mentioned before that we
  9018. 4:35:58want to do it as a binary, which means
  9019. 4:36:00that it's asking us what is that type of
  9020. 4:36:02file? What is the type of input that we
  9021. 4:36:04give you? In this case, it's binary. So,
  9022. 4:36:05load all data input. Yes, that's fine.
  9023. 4:36:08Automatic detect my own data.
  9024. 4:36:09Yes, that's fine.
  9025. 4:36:11And simple is fine. That's all good.
  9026. 4:36:14Is there anything else that we want? No,
  9027. 4:36:15that's it. Okay, so in this case, data
  9028. 4:36:17format automatically detected my data.
  9029. 4:36:18Text splitting is simple, and that's all
  9030. 4:36:20we have to do. Now, this right here just
  9031. 4:36:21means it splits every 1,000 characters
  9032. 4:36:23within a 200 character overlap. So,
  9033. 4:36:25before if you saw, the PDF was actually
  9034. 4:36:28stored into 10 different rows, 11
  9035. 4:36:30different rows. It's because it actually
  9036. 4:36:32split it up. So,
  9037. 4:36:34this right here is used. Then it goes
  9038. 4:36:36here to embeddings, turns the file into
  9039. 4:36:38the embedding, and then in order for us
  9040. 4:36:40to actually store the document, we have
  9041. 4:36:41to use this one right here.
  9042. 4:36:43So, let's test this. Let's test this one
  9043. 4:36:44right here. Let me go to unpin this.
  9044. 4:36:48Let me go to Google Drive.
  9045. 4:36:50Let me just
  9046. 4:36:50>> [music]
  9047. 4:36:51>> re-put another one.
  9048. 4:36:53SOPs.
  9049. 4:36:54Replace.
  9050. 4:36:56That's replacing the file. I can go back
  9051. 4:36:58to N8N.
  9052. 4:36:59And now if I execute the workflow,
  9053. 4:37:02it should work. Let me go here,
  9054. 4:37:03downloads the file.
  9055. 4:37:04It goes here.
  9056. 4:37:05Okay, everything was successful. And if
  9057. 4:37:07I go to N8N YouTube agent, I can see
  9058. 4:37:10that the data was stored here. And the
  9059. 4:37:11data has the ID, which is just the rows,
  9060. 4:37:14right? Every new Every new Every new
  9061. 4:37:16Every new entry is one.
  9062. 4:37:17And then content, which is this, which
  9063. 4:37:19is a bunch of text. Metadata, which is
  9064. 4:37:21JSON,
  9065. 4:37:22which is a bunch of stuff as well.
  9066. 4:37:24Embedding, which is again the thing that
  9067. 4:37:25I mentioned,
  9068. 4:37:27which is different numbers. These are
  9069. 4:37:29the vectors, which might look a bit
  9070. 4:37:30intimidating at the start, uh but these
  9071. 4:37:32are the series of numbers that we have
  9072. 4:37:33that are stored in the vector database,
  9073. 4:37:35which is the thing that's going to allow
  9074. 4:37:36us to actually ask it questions.
  9075. 4:37:38All right, so once this is done, we have
  9076. 4:37:39to to here, and we can get on to the
  9077. 4:37:42second agent because the second agent is
  9078. 4:37:44what the real sauce is about because we
  9079. 4:37:46can actually ask it any questions about
  9080. 4:37:47the document.
  9081. 4:37:49So,
  9082. 4:37:50we can keep this on the same workflow.
  9083. 4:37:51So, let me save this.
  9084. 4:37:53Right here we have uploaded document,
  9085. 4:37:55downloaded and then added it to the
  9086. 4:37:56database. Now, we can start by actually
  9087. 4:37:58querying the Superbase. So, for us to
  9088. 4:38:01actually create a Superbase, if you
  9089. 4:38:02really think about it, we have to text
  9090. 4:38:04the agent. In order for us to make a
  9091. 4:38:05text agent, we have to just have to add
  9092. 4:38:07an AI agent.
  9093. 4:38:08Which will
  9094. 4:38:10go here and then we just have to connect
  9095. 4:38:12it to a chat trigger. Which means
  9096. 4:38:16that we have a chat connected to the
  9097. 4:38:17agent. So, we can talk to the agent.
  9098. 4:38:20All right. So, there's a few things. Uh
  9099. 4:38:22the chat agent, so this right here,
  9100. 4:38:24I can just talk to it.
  9101. 4:38:26Right? And it will send the information
  9102. 4:38:27and it will send it here. It will do
  9103. 4:38:28whatever.
  9104. 4:38:29And then we have the AI agent. In the AI
  9105. 4:38:31agent,
  9106. 4:38:32the source or prompt, meaning what is
  9107. 4:38:34the input? In this case, it's just
  9108. 4:38:35connected to the chat trigger node
  9109. 4:38:37because this is the chat trigger node.
  9110. 4:38:40We can leave this as is. The prompt is
  9111. 4:38:41fine. Uh require specific output format?
  9112. 4:38:43No, we don't. And now it's asking us to
  9113. 4:38:46do a system message. So, that's the
  9114. 4:38:47thing that you want to add to the AI
  9115. 4:38:48agent.
  9116. 4:38:50Let me go here, expressions. I can do it
  9117. 4:38:52full screen. And now I can start adding
  9118. 4:38:54the prompt. Now, for the prompt itself,
  9119. 4:38:55we usually use a structure, which is
  9120. 4:38:57overview,
  9121. 4:38:59tools,
  9122. 4:39:03and then rules.
  9123. 4:39:07Right? For overview, we can say, "You
  9124. 4:39:09are a
  9125. 4:39:11helpful, intelligent
  9126. 4:39:14uh information
  9127. 4:39:16extracting
  9128. 4:39:17I don't even know if that makes sense,
  9129. 4:39:18but extracting assistant that helps me
  9130. 4:39:22to
  9131. 4:39:23answer or
  9132. 4:39:26that answers
  9133. 4:39:29any queries
  9134. 4:39:34that come to you."
  9135. 4:39:36Okay, that's fine. For the tools itself,
  9136. 4:39:39um we have to add.
  9137. 4:39:41And then for the rules, we can add as
  9138. 4:39:42well later. So, overview, you're a
  9139. 4:39:44helpful, intelligent information
  9140. 4:39:44extracting assistant answers my any
  9141. 4:39:46queries that come to you. And then
  9142. 4:39:47tools, we can add the tool. In this
  9143. 4:39:48case, we only have one, which is
  9144. 4:39:50getting the uh Superbase for the vector
  9145. 4:39:52database. And then we have the rules.
  9146. 4:39:54If I go here,
  9147. 4:39:55we can now connect this to a chat model,
  9148. 4:39:57which in this case we can do Open AI.
  9149. 4:40:00You can't see it right now cuz my face
  9150. 4:40:01is there, but Open AI chat model is
  9151. 4:40:03here. You can press this. And now again,
  9152. 4:40:05we already connected Open AI to NNN, so
  9153. 4:40:07we just have the connection here. In the
  9154. 4:40:09model, leave this as 4. from One Minute.
  9155. 4:40:11We don't have to connect memory. Well,
  9156. 4:40:13actually no, we have to. We can, right?
  9157. 4:40:15We can. Uh for simple memory, just so
  9158. 4:40:17that it actually remembers the previous
  9159. 4:40:19questions that we asked it.
  9160. 4:40:20We can leave this as this. This is fine.
  9161. 4:40:22And now this is asking, "How many past
  9162. 4:40:24interactions does the model receive as
  9163. 4:40:25context?"
  9164. 4:40:26Five is fine. You can add more if you
  9165. 4:40:27want.
  9166. 4:40:28In case you're having longer
  9167. 4:40:29conversations where it needs to remember
  9168. 4:40:30what you said before.
  9169. 4:40:32And now for the real sauce of the AI
  9170. 4:40:33agent, it's the Superbase. So, if I go
  9171. 4:40:35here, Superbase vector store,
  9172. 4:40:38you can see that now the tool is this
  9173. 4:40:39one here.
  9174. 4:40:40So, that's the first Let's rename this
  9175. 4:40:41to vector
  9176. 4:40:44store.
  9177. 4:40:47Rename.
  9178. 4:40:48If I go in here, I can then have
  9179. 4:40:50different settings. The first setting is
  9180. 4:40:51obviously the connection, which we
  9181. 4:40:52already made before. Then the operation,
  9182. 4:40:54which is what is that thing that we're
  9183. 4:40:55doing? In this case, it's retrieving
  9184. 4:40:56documents as tool for AI agent, which is
  9185. 4:40:58fine.
  9186. 4:40:59Again, we previously we had insert
  9187. 4:41:00documents.
  9188. 4:41:02The description is
  9189. 4:41:03You can just leave this as work with
  9190. 4:41:05data
  9191. 4:41:06from the Superbase
  9192. 4:41:09vector database.
  9193. 4:41:11Right?
  9194. 4:41:11>> [music]
  9195. 4:41:11>> And now the table The table is a
  9196. 4:41:13database, right? That is the thing that
  9197. 4:41:15we just made, this one here. So, if I go
  9198. 4:41:17here
  9199. 4:41:18and I go to it only gives me one option
  9200. 4:41:20because we only have one table,
  9201. 4:41:21documents. The limit is fine. Include
  9202. 4:41:23metadata.
  9203. 4:41:25Actually, I don't
  9204. 4:41:26This says, "Number of top results to
  9205. 4:41:27fetch the I don't think we need a limit.
  9206. 4:41:29I think we can just not have a I not
  9207. 4:41:31have one because it can pull any any any
  9208. 4:41:33number of results.
  9209. 4:41:34Include metadata.
  9210. 4:41:36What is this? Whether or not to include
  9211. 4:41:37my document metadata. It's fine. All
  9212. 4:41:39right. So, now we can connect this to an
  9213. 4:41:41embedding because just like we did this
  9214. 4:41:43above, we need to embed, which means
  9215. 4:41:45that we need to turn our question into
  9216. 4:41:47numbers so that it can ask it any
  9217. 4:41:50questions on a vector database. So, we
  9218. 4:41:52can go here,
  9219. 4:41:53embedding. And by the way, you can
  9220. 4:41:54connect this to the same one, right? But
  9221. 4:41:57to make it less complicated, we just
  9222. 4:41:58have our own. Uh so, let's go here,
  9223. 4:42:00embedding is Open AI.
  9224. 4:42:02Leave this as before, which is fine. And
  9225. 4:42:04now this is embedded. So, in theory now,
  9226. 4:42:07when we ask any questions, it will go to
  9227. 4:42:08the AI agent. It will think through its
  9228. 4:42:10its uh its brain, which is the LLM.
  9229. 4:42:12It will remember any conversation that
  9230. 4:42:14we had, but most importantly, it will
  9231. 4:42:15send the information here.
  9232. 4:42:17First, it will embed it, so it will turn
  9233. 4:42:18it our questions into numbers. It will
  9234. 4:42:20then match it up against any numbers
  9235. 4:42:22that we have, any vectors that we have
  9236. 4:42:23in the vector database. It will then
  9237. 4:42:25send us back uh an answer in natural
  9238. 4:42:27language, right? Like before, [music]
  9239. 4:42:28like I showed you.
  9240. 4:42:30Now, one thing I need to finish is the
  9241. 4:42:31prompt. So,
  9242. 4:42:33let me go here. Let me go here. And now
  9243. 4:42:35for the tools, we have vector store.
  9244. 4:42:38Very important that you name the tool
  9245. 4:42:40the same as the tool that you actually
  9246. 4:42:42have.
  9247. 4:42:43What I mean by this is like vector store
  9248. 4:42:44needs to be the same name as this.
  9249. 4:42:47If I rename this to something else,
  9250. 4:42:48like vector store, make sure to update
  9251. 4:42:50that into the prompt.
  9252. 4:42:53Especially when you have more tools.
  9253. 4:42:55So, vector store,
  9254. 4:42:56this will always
  9255. 4:43:00be used when
  9256. 4:43:04answering
  9257. 4:43:05any questions
  9258. 4:43:07that the user
  9259. 4:43:10might have.
  9260. 4:43:12Now, rules. The only rule I have is
  9261. 4:43:15Actually, I have two rules. The first
  9262. 4:43:16one is you must always
  9263. 4:43:19pull
  9264. 4:43:20information
  9265. 4:43:22from this from the vector store.
  9266. 4:43:26That's it. And then your answers
  9267. 4:43:30need to be concise and to the point.
  9268. 4:43:34Uh okay. So, why do I say this will
  9269. 4:43:36always be used? Because previously when
  9270. 4:43:38I actually made the
  9271. 4:43:40this agent, uh I was asking it a
  9272. 4:43:42question. It was using like the natural
  9273. 4:43:43LLM to actually answer it, like what it
  9274. 4:43:46what is a project management tool that
  9275. 4:43:47we're using? It would use the LLM to
  9276. 4:43:49search in the internet or search through
  9277. 4:43:51like its own its own storage. But in
  9278. 4:43:53this case, we only wanted to pull
  9279. 4:43:54information from the vector store. Okay,
  9280. 4:43:56that's why we're saying this. And then
  9281. 4:43:58we always we always want the answer to
  9282. 4:43:59be concise cuz I don't want it to give
  9283. 4:44:00me a full paragraph um
  9284. 4:44:02or a long long paragraph that we can't
  9285. 4:44:03read.
  9286. 4:44:04All right. So, I think that's it. Now,
  9287. 4:44:06we can test this and if it goes wrong,
  9288. 4:44:07we can
  9289. 4:44:09we can obviously change it. So, let me
  9290. 4:44:10go here.
  9291. 4:44:11Let me say Let me go here. Let me
  9292. 4:44:13>> [music]
  9293. 4:44:13>> get something specific.
  9294. 4:44:15What are the things that are included in
  9295. 4:44:17the
  9296. 4:44:18content production? [music]
  9297. 4:44:20That's it.
  9298. 4:44:21And it should say video, social media,
  9299. 4:44:22copywriting.
  9300. 4:44:24Let me go. What is included
  9301. 4:44:28in our
  9302. 4:44:29content production?
  9303. 4:44:31So, what it's doing now, it's it's going
  9304. 4:44:33to embed our answer. It's then going to
  9305. 4:44:34query with the vector database,
  9306. 4:44:36give us back an answer. And now it says
  9307. 4:44:39that we have video production, social
  9308. 4:44:40media, and copywriting. And if I go
  9309. 4:44:41here, again I can see
  9310. 4:44:43video, social media, and copywriting.
  9311. 4:44:47So, there we go. Let me ask it another
  9312. 4:44:47question. So, let's say I want to ask
  9313. 4:44:49it,
  9314. 4:44:50"What is inside content I mean, the
  9315. 4:44:52social media?"
  9316. 4:44:54So, say, "What is inside
  9317. 4:44:58social media?"
  9318. 4:45:02What it should say now is that we have
  9319. 4:45:04content calendar managed in Notion, post
  9320. 4:45:06schedule one a week.
  9321. 4:45:08Content calendar is managed in Notion,
  9322. 4:45:10post schedule once a week. As I said,
  9323. 4:45:12this is insane, especially if you have
  9324. 4:45:13hundreds and hundreds of documents
  9325. 4:45:14inside the vector database, which allow
  9326. 4:45:17you to pull information from these uh
  9327. 4:45:19documents in in a matter of seconds. Cuz
  9328. 4:45:22typically when I work with agencies,
  9329. 4:45:23especially creative agencies or any
  9330. 4:45:25other type of agencies, we work with a
  9331. 4:45:26lot of them, they store their SOPs into
  9332. 4:45:29a Google document, into multiple Google
  9333. 4:45:31documents with tabs. And in order for
  9334. 4:45:33them to actually ask any questions about
  9335. 4:45:34the actual document, they have
  9336. 4:45:39In this case, we just have a chat
  9337. 4:45:41AI agent
  9338. 4:45:42queries itself and then gives us back an
  9339. 4:45:44answer in very, very simple way in just
  9340. 4:45:46seconds. So, that right there is a full
  9341. 4:45:47build for the rag agent inside of NNN
  9342. 4:45:50that allows us to search through
  9343. 4:45:51hundreds of documents that we have. In
  9344. 4:45:52this case, I only used one, but imagine
  9345. 4:45:54you can add multiple hundreds of
  9346. 4:45:56documents inside a Google Drive, which
  9347. 4:45:57will pull it into the vector database
  9348. 4:45:59and then you can just ask it any
  9349. 4:46:00questions that we want.
  9350. 4:46:04Hey, in this video I'm going to show you
  9351. 4:46:05how I built an AI support agent for an
  9352. 4:46:08e-commerce store that automatically
  9353. 4:46:09pulls in queries, classifies the query,
  9354. 4:46:11then searches through our vector
  9355. 4:46:12database for answers, drafts an email
  9356. 4:46:14reply before learning our team to review
  9357. 4:46:16the email and send it. Now, for
  9358. 4:46:17businesses who receive a large amount of
  9359. 4:46:19emails from customers asking questions,
  9360. 4:46:21at least 90% of them are the same. These
  9361. 4:46:23systems are amazing just because they
  9362. 4:46:24save that time that you can now devote
  9363. 4:46:25to actually growing the business. All
  9364. 4:46:27right. So, I'm actually going to test it
  9365. 4:46:28before I even explain exactly what
  9366. 4:46:29everything does, just so you get to see
  9367. 4:46:31the final outcome. So, I'm going to send
  9368. 4:46:33myself an email saying,
  9369. 4:46:35"Question
  9370. 4:46:36about the return policy."
  9371. 4:46:38>> [music]
  9372. 4:46:38>> All right. So, I asked it the return
  9373. 4:46:39policy plus the shipping location.
  9374. 4:46:42Uh I'm going to say, "Thanks in
  9375. 4:46:44advance."
  9376. 4:46:45And you press send.
  9377. 4:46:46Now, this right here will send it to the
  9378. 4:46:48base email. So, this will be in theory
  9379. 4:46:49the email that receives all the incoming
  9380. 4:46:51queries from my customers.
  9381. 4:46:53As you can see, we just got the email. I
  9382. 4:46:54go here. I want to execute the workflow.
  9383. 4:46:56So, this is going to run.
  9384. 4:46:58It's then going to classify the email.
  9385. 4:47:00It's going to then pull the answer from
  9386. 4:47:01the vector database.
  9387. 4:47:03It's going to drop an email.
  9388. 4:47:04And then it's going to send us a message
  9389. 4:47:05on Telegram informing us that a new
  9390. 4:47:07inquiry came through. We have to review
  9391. 4:47:08it and actually send the email. As you
  9392. 4:47:09can see in Telegram, it says new inquiry
  9393. 4:47:11received from the name.
  9394. 4:47:13About is the question of the actual the
  9395. 4:47:15subject line. And then the action is
  9396. 4:47:17email drafted to your email. So, they
  9397. 4:47:18know exactly that they have to go to the
  9398. 4:47:19email and actually look at the email
  9399. 4:47:20before sending it.
  9400. 4:47:22And if I go to my email here, I can see
  9401. 4:47:23that on drafts, I have one new draft.
  9402. 4:47:25You can see that we have the return
  9403. 4:47:26policy. We have the shipping locations
  9404. 4:47:28and James at Novel Mart customer service
  9405. 4:47:30team. All right, perfect. All right,
  9406. 4:47:32cool. So, let's go through the whole
  9407. 4:47:34process step by step. Now, you have an
  9408. 4:47:35idea of what it actually does. Takes
  9409. 4:47:36emails or takes emails with questions
  9410. 4:47:38and then looks through our vector
  9411. 4:47:39database, which is a database that has
  9412. 4:47:41different
  9413. 4:47:42the different documents and then sends
  9414. 4:47:44back an email reply and then informs the
  9415. 4:47:45team [music] to then go in drafts and
  9416. 4:47:47actually send it to the customer. All
  9417. 4:47:49right, so the first step here is
  9418. 4:47:50actually incoming emails. So this will
  9419. 4:47:51be the trigger on any incoming emails
  9420. 4:47:53that come through. In this case, we have
  9421. 4:47:54an inbox and for any businesses really,
  9422. 4:47:56they have inboxes like
  9423. 4:47:58a company name support.com and that's
  9424. 4:48:01the inbox that they use to answer any
  9425. 4:48:02incoming FAQs. So we will have this and
  9426. 4:48:04this will be the domain or the actual
  9427. 4:48:06inbox that we use to collect and then
  9428. 4:48:08run the automation for the first step.
  9429. 4:48:10So in order to connect our Gmail, we
  9430. 4:48:11have to go here. Obviously choose the
  9431. 4:48:13Gmail trigger.
  9432. 4:48:15Create a credential and then you can
  9433. 4:48:16sign in with Google and it'll take you
  9434. 4:48:17through the whole process. It's very
  9435. 4:48:18very easy. Just as a regular sign in
  9436. 4:48:20with Google sort of thing. And then it's
  9437. 4:48:22asking us for the poll times. The poll
  9438. 4:48:23time says, "Hey, we're looking at your
  9439. 4:48:25email, but how often do you want us to
  9440. 4:48:26go through your email to make sure that
  9441. 4:48:28we have all the questions?" In this
  9442. 4:48:29case, you can put minute, hour, day,
  9443. 4:48:31week, month, every X, custom. But I
  9444. 4:48:34think every minute is fine. It depends
  9445. 4:48:35on the amount of queries that they get.
  9446. 4:48:37So I would ask the business, "Hey, how
  9447. 4:48:38many queries do you get a month? How
  9448. 4:48:40many queries do you get a day?" If they
  9449. 4:48:41say, "Hey, we get about 1,000 a day or
  9450. 4:48:43100 a day, whatever it is." Maybe we can
  9451. 4:48:45run it every hour or every every 5
  9452. 4:48:47minutes, right? But speed speed to lead
  9453. 4:48:50and speed to questions is important
  9454. 4:48:51because that builds up the brand and it
  9455. 4:48:53just makes a part of better impact on
  9456. 4:48:55the customer as well. So we can
  9457. 4:48:56obviously do every minute, every hour
  9458. 4:48:58and what so on. So again, it depends on
  9459. 4:48:59on the amount of inquiries that they
  9460. 4:49:00get. Then we have the event. So the
  9461. 4:49:03event is, "Hey, what has happened?" Like
  9462. 4:49:04what is the thing that we're watching
  9463. 4:49:06for? In this case, is a message
  9464. 4:49:07received. [music]
  9465. 4:49:08Which is the only option here, right?
  9466. 4:49:10And then simplify, just fine because we
  9467. 4:49:12just want to keep it simple with with
  9468. 4:49:14the way that the [music] the actual node
  9469. 4:49:16is set up.
  9470. 4:49:17Once this is done,
  9471. 4:49:18right? Which is the again the email
  9472. 4:49:20trigger. So I can actually fetch test
  9473. 4:49:22event. I believe that we have Yeah, we
  9474. 4:49:23don't have any emails anymore.
  9475. 4:49:25Let me actually send myself an email so
  9476. 4:49:26we can we can test this. 100. Hello.
  9477. 4:49:30Hey,
  9478. 4:49:31I need to know
  9479. 4:49:33the shipping
  9480. 4:49:35policy
  9481. 4:49:36you have.
  9482. 4:49:38I send it. Now I have to wait. Of
  9483. 4:49:40course, when you have to run this for a
  9484. 4:49:41customer, you have to automatically run
  9485. 4:49:44this every 1 minute. But for this case,
  9486. 4:49:46we just have to test. So I'm just going
  9487. 4:49:48to send it to myself and wait for the
  9488. 4:49:49email to come back. As you can see, we
  9489. 4:49:51got the email here. I'll go here and I
  9490. 4:49:52can fetch test event and we get the
  9491. 4:49:54snippet, which is the email body, which
  9492. 4:49:56is in this case is, "Hey, I need to know
  9493. 4:49:58the shipping policy you have."
  9494. 4:50:00And that's the thing that's going to be
  9495. 4:50:01sent to the next step to actually
  9496. 4:50:03classify whether this is a promotional
  9497. 4:50:05thing or an actual FAQ. So,
  9498. 4:50:08the next step here, actually before we
  9499. 4:50:10get to this point, is we have to set the
  9500. 4:50:12variable. Now, why we do this is because
  9501. 4:50:14when we look at all these, we can get a
  9502. 4:50:16bit overwhelmed and we don't really know
  9503. 4:50:17where the where the actual text is. So
  9504. 4:50:19we just want to basically make it as
  9505. 4:50:21simple as possible for the next steps to
  9506. 4:50:23pull in information from Gmail. So we
  9507. 4:50:25add in a set node, which you can find
  9508. 4:50:27here.
  9509. 4:50:29So set on edit field set.
  9510. 4:50:31This allows us to just pull in variables
  9511. 4:50:32from a list of variables. In this case,
  9512. 4:50:35it's just snippet and we call this email
  9513. 4:50:36body. And call it whatever we want,
  9514. 4:50:37basically. This makes it so much easier
  9515. 4:50:39for the next steps to actually pull in
  9516. 4:50:40information from Gmail without having to
  9517. 4:50:42go through all these different pieces of
  9518. 4:50:44information. Once this is done, we go to
  9519. 4:50:47classify emails. Now, we have to have
  9520. 4:50:48this step because not all emails are
  9521. 4:50:50FAQs. Some are promotional, some are
  9522. 4:50:52just general emails.
  9523. 4:50:54In this case, we just wanted to check
  9524. 4:50:55whether they are promotional or support
  9525. 4:50:57service. So if I go in here, and this by
  9526. 4:50:59the way is text classifier.
  9527. 4:51:02Right here, text classifier. This allows
  9528. 4:51:04us to classify text based on specific
  9529. 4:51:07you know, rules. So you go in here.
  9530. 4:51:09Text classifier will be the JSON email
  9531. 4:51:11bodies. So let me actually run the
  9532. 4:51:12previous steps. Let me go here and pin
  9533. 4:51:14so I don't have to rerun the whole
  9534. 4:51:16email.
  9535. 4:51:17Let me actually execute step.
  9536. 4:51:19As you can see, we have, "Hey, I need to
  9537. 4:51:21know the shipping policy you have." And
  9538. 4:51:22this will be the thing that we then pull
  9539. 4:51:24here saying, "Hey, classify this text."
  9540. 4:51:27Now, here's where we start adding the
  9541. 4:51:29categories. So the category is like,
  9542. 4:51:31what are we classifying it for? Like
  9543. 4:51:32what are what are the what are the rules
  9544. 4:51:33and what is what's the logic here? In
  9545. 4:51:34this case, we have promotional, we have
  9546. 4:51:36support service. Now, to add a category,
  9547. 4:51:38you have to press this button right
  9548. 4:51:39here. You can put the name. So in this
  9549. 4:51:41case, let's do support service. And then
  9550. 4:51:42description is, "Hey, this is the name
  9551. 4:51:44of the of the actual rule or the
  9552. 4:51:46category. This is the description of
  9553. 4:51:48what it is." So in this case, for
  9554. 4:51:49promotional, we said marketing offers,
  9555. 4:51:51discounts, sales pages, newsletters,
  9556. 4:51:52which are typical sort of promotional
  9557. 4:51:54emails. And then we have support
  9558. 4:51:55service, which is customer inquiries,
  9559. 4:51:57troubleshooting, complaints, or help
  9560. 4:51:58requests. That's the only two categories
  9561. 4:52:00that the classify email node or the text
  9562. 4:52:03classifier will take into account. It
  9563. 4:52:04needs to look at the the inquiry that
  9564. 4:52:07came through from the customer and
  9565. 4:52:08classify as to whether they are one or
  9566. 4:52:10the other.
  9567. 4:52:11Then we have options, a system prompt,
  9568. 4:52:13which is basically saying, "Hey, please
  9569. 4:52:14classify the emails provided by the user
  9570. 4:52:16into one of the following categories."
  9571. 4:52:17Categories right here just so it knows
  9572. 4:52:19that these are the categories. And use
  9573. 4:52:21the provided formatting instructions
  9574. 4:52:23below. Don't explain it, only output the
  9575. 4:52:24JSON. I believe that this is a standard
  9576. 4:52:27prompt. Yeah, it is a standard prompt.
  9577. 4:52:29So you can just add this.
  9578. 4:52:30But this allows the the actual node to
  9579. 4:52:32be more strict in understanding exactly
  9580. 4:52:34what it is.
  9581. 4:52:35Now, in order for this to actually work,
  9582. 4:52:37this doesn't just work on its own. It
  9583. 4:52:38works through the AI. So you have to go
  9584. 4:52:40here, the model. You have to choose a
  9585. 4:52:41model here. And we have all these
  9586. 4:52:42models. I typically go for the OpenAI
  9587. 4:52:44chat model because it is the
  9588. 4:52:46I go for quality plus
  9589. 4:52:47plus price. I think this is fine.
  9590. 4:52:49Connect it. To connect to your OpenAI,
  9591. 4:52:51you just have to go to
  9592. 4:52:52platform.openai.com.
  9593. 4:52:55Go to the dashboard.
  9594. 4:52:57Go to the API keys.
  9595. 4:52:59Create a new secret key and then you can
  9596. 4:53:00put your name and then create a secret
  9597. 4:53:01key and then bring it back here to paste
  9598. 4:53:03it. Don't worry about the organization
  9599. 4:53:05ID, you don't need it. And as well, this
  9600. 4:53:07don't worry about this. One important
  9601. 4:53:08thing here is that for a company to run
  9602. 4:53:10this, they do have to pay for the
  9603. 4:53:11credits, which you find in your profile.
  9604. 4:53:14Billing.
  9605. 4:53:15And you find it here.
  9606. 4:53:17But I obviously would look into how many
  9607. 4:53:19inquiries they get and then make the
  9608. 4:53:20price based on that. But the price is
  9609. 4:53:21like 1/10 of a cent per per run. All
  9610. 4:53:24right, and now that we connected AI,
  9611. 4:53:26what does happen? So how this works is
  9612. 4:53:28we have the email body, which is
  9613. 4:53:29incoming emails. It will then go here
  9614. 4:53:31saying, "Hey, can you classify this
  9615. 4:53:32using AI?" Right? It will have
  9616. 4:53:34categories. It will have strict rules.
  9617. 4:53:36It will talk to the AI to make sure that
  9618. 4:53:37that's how it thinks. That's that's
  9619. 4:53:39that's the actual like program.
  9620. 4:53:40And then based on the the two different
  9621. 4:53:43sides, we have promotional and support
  9622. 4:53:44service. In this case, we actually
  9623. 4:53:46didn't put anything for promotional. So
  9624. 4:53:47if something is promotional, it just
  9625. 4:53:48stops there cuz we we don't want to
  9626. 4:53:50really do anything with it. We only want
  9627. 4:53:52to send it through if it's a support
  9628. 4:53:53service. So that's why we drag this
  9629. 4:53:55across and we put it to the next node,
  9630. 4:53:58which in this case is an AI agent, which
  9631. 4:53:59is really the the main source of the
  9632. 4:54:01whole system. And so once we classify
  9633. 4:54:03the emails, we say, "Hey, okay, this is
  9634. 4:54:05an FAQ. This is like actually something
  9635. 4:54:06that we can answer. Let's go out and
  9636. 4:54:08actually review and draft an email for
  9637. 4:54:10the customer using the data that we
  9638. 4:54:12have." Now, if you haven't checked out
  9639. 4:54:13my AI rag agent system, then make sure
  9640. 4:54:15to check it out right here on the top or
  9641. 4:54:16below. It'll show you exactly how we set
  9642. 4:54:18this up step by step so you get to see
  9643. 4:54:20the whole process. But essentially what
  9644. 4:54:21it is, it's an AI agent that
  9645. 4:54:24gets incoming emails. In this case, it
  9646. 4:54:26gets the the inquiry from here, which is
  9647. 4:54:28the same input as this. But now we know
  9648. 4:54:30that it's support service because we
  9649. 4:54:31went through the step. And what it will
  9650. 4:54:32do is I will go through a vector
  9651. 4:54:33database. Now, a vector database is
  9652. 4:54:35something that looks like this, which is
  9653. 4:54:36composed of different rows. These rows
  9654. 4:54:39come from this document. Cuz we have a
  9655. 4:54:41document, which is essentially where all
  9656. 4:54:43the information stored. So account
  9657. 4:54:44logins, all the different FAQ questions
  9658. 4:54:46that people usually ask, which is
  9659. 4:54:47typically what a company would have in
  9660. 4:54:49the first place. And then now we
  9661. 4:54:50basically transform this into vector
  9662. 4:54:53database so embeddings, in this case we
  9663. 4:54:54call them.
  9664. 4:54:55That will allow the the program to
  9665. 4:54:57actually take the question that's coming
  9666. 4:54:59through, match it up against any of
  9667. 4:55:01these embeddings, and then give us back
  9668. 4:55:02an answer in the simplest way.
  9669. 4:55:04So the way to do this is we have an AI
  9670. 4:55:06agent.
  9671. 4:55:07Right here, the prompt, which is the
  9672. 4:55:08user message. This right here will say,
  9673. 4:55:10"Hey, what is the thing that we're
  9674. 4:55:11feeding into the AI agent?" In this
  9675. 4:55:13case, it's email received, which you can
  9676. 4:55:14find from the email body. Right here. So
  9677. 4:55:17this right here will be the the from
  9678. 4:55:19because when we actually have to draft
  9679. 4:55:21the email, we have to know who the email
  9680. 4:55:22is coming from and the name as well just
  9681. 4:55:24so we can personalize the email plus
  9682. 4:55:25send it to the right person. And that's
  9683. 4:55:27about it for the user message. In this
  9684. 4:55:28case, we don't require any specific
  9685. 4:55:30output format. We don't enable any
  9686. 4:55:31fallback method. This just means do you
  9687. 4:55:33want it in a very in a in a specific
  9688. 4:55:35format like JSON or anything like that?
  9689. 4:55:37We don't want to do any of that. And
  9690. 4:55:38also, do we want to enable a fallback
  9691. 4:55:39method? This means that if OpenAI does
  9692. 4:55:41not work, do you want to use another AI
  9693. 4:55:44to to test? In this case, you could or
  9694. 4:55:46could not put this on. I mean, typically
  9695. 4:55:47I wouldn't have it on
  9696. 4:55:49because the chat model right here works
  9697. 4:55:51fine.
  9698. 4:55:52But you can have it on even to be more
  9699. 4:55:53safe. Now, the system message here is
  9700. 4:55:55the system or is the message that we
  9701. 4:55:57tell the system, "Okay, you are a
  9702. 4:55:58helpful intelligent XYZ that does a few
  9703. 4:56:01things." So the prompt for the AI agent
  9704. 4:56:04follows through a very very specific
  9705. 4:56:05structure that we use for most of the AI
  9706. 4:56:06agents that we build. In this case, it
  9707. 4:56:08has an overview. So you are a helpful
  9708. 4:56:09assistant that answers any inquiries
  9709. 4:56:11from our e-commerce store called
  9710. 4:56:12Novamart. You'll [music] be drafting
  9711. 4:56:13email replies for the incoming queries
  9712. 4:56:14that come through. And then tools, this
  9713. 4:56:16will be the tools that the AI agent is
  9714. 4:56:18connected to. In this case, it's two.
  9715. 4:56:20The first one is pulling in information
  9716. 4:56:21from the document
  9717. 4:56:23that we have, which is the one right
  9718. 4:56:24here.
  9719. 4:56:25Which now right now is stored in the
  9720. 4:56:26vector database in Superbase.
  9721. 4:56:28And the second one is the email draft,
  9722. 4:56:31right? Because this tool will be used to
  9723. 4:56:33draft any emails back to the user to
  9724. 4:56:35make sure that they have the
  9725. 4:56:36corresponding answers based on the
  9726. 4:56:37information that comes from the vector
  9727. 4:56:39store. Some rules here is we have to
  9728. 4:56:41always use the vector store before
  9729. 4:56:42answering any questions and drafting any
  9730. 4:56:44emails. This is very very important
  9731. 4:56:46because sometimes what the AI could do
  9732. 4:56:48is that it can draft the email, but it
  9733. 4:56:49will not have any context or any
  9734. 4:56:50information that's actually valuable for
  9735. 4:56:52the end user to give them an answer. So
  9736. 4:56:54it's sort of saying, "Hey, what is the
  9737. 4:56:55return policy?" I reply to you first and
  9738. 4:56:57then I go out and look for the
  9739. 4:56:58information. We have to make the order
  9740. 4:57:00actually make sense, which is why we
  9741. 4:57:02tell it, "Hey, look for the information
  9742. 4:57:03first and then you can go out and draft
  9743. 4:57:05the email." And then some extra
  9744. 4:57:06information, my name is James. Make sure
  9745. 4:57:08to include that when drafting the email
  9746. 4:57:09because at the end,
  9747. 4:57:11what it did basically in the email it
  9748. 4:57:12said, "Hey, thank you. This comes from
  9749. 4:57:15at your name." Like bracket at your
  9750. 4:57:17name. And then it will put the put the
  9751. 4:57:19actual company name. In this case, we
  9752. 4:57:21want to put James because again, that's
  9753. 4:57:22that's the reality of what emails look
  9754. 4:57:24like. They put names instead of just
  9755. 4:57:25adding variables. So we give it that
  9756. 4:57:27context as well. All right, once this is
  9757. 4:57:29done, then we have the chat model. In
  9758. 4:57:30this case, we can add here.
  9759. 4:57:32Same way as we did before, we can go to
  9760. 4:57:34open AI and we have to connect to our
  9761. 4:57:36account and use 4.1 mini. Again, this is
  9762. 4:57:38perfect perfectly fine for for this use
  9763. 4:57:40case. Now, what we have to do is connect
  9764. 4:57:42tools. Now, the way that an AI agent
  9765. 4:57:44works is that it gets it gets the
  9766. 4:57:46inquiry. So, it gets an input like "Hey,
  9767. 4:57:47draft an email." or "Hey, look for this
  9768. 4:57:49information." or "Do something." and it
  9769. 4:57:51will then think through what it needs to
  9770. 4:57:52do using its model. And then, to take
  9771. 4:57:55action and what it actually needs to do,
  9772. 4:57:57it uses tools. So, in this case, because
  9773. 4:57:59we have two tools, again one for the
  9774. 4:58:00draft and one for the back to database
  9775. 4:58:01that actually looks for the information,
  9776. 4:58:03we connect these tools to the
  9777. 4:58:04corresponding softwares.
  9778. 4:58:06>> [music]
  9779. 4:58:06>> In this case, to connect to the vector
  9780. 4:58:07store, we have to go here. In this case,
  9781. 4:58:09well, I mean it's vector store, so
  9782. 4:58:11you will have to press plus. Let me see
  9783. 4:58:12if I can move this. There you go.
  9784. 4:58:14Uh Superbase.
  9785. 4:58:16Superbase vector store.
  9786. 4:58:18And you come to this page.
  9787. 4:58:19Once you get to that page, let me delete
  9788. 4:58:21this.
  9789. 4:58:22You will be here. The first thing you
  9790. 4:58:23have to do is create a new credential.
  9791. 4:58:25Again, you should have a service role
  9792. 4:58:27secret and a host, which you can find
  9793. 4:58:28here. And then, we have this page right
  9794. 4:58:30here. The first thing you have to do is
  9795. 4:58:32obviously make the account. Then, you
  9796. 4:58:33have to make the database and again, I
  9797. 4:58:35put a whole video on how to do this down
  9798. 4:58:37below, so make sure to check it out. And
  9799. 4:58:38now, we have to go back here, go to the
  9800. 4:58:41API keys and [music] you can then
  9801. 4:58:42reveal, copy the secret and paste it
  9802. 4:58:44here and then you can press save and
  9803. 4:58:46then you're done.
  9804. 4:58:47All right, cool. So, once we are done
  9805. 4:58:49with this, we can then use the operation
  9806. 4:58:50mode. Again, operation in and its end
  9807. 4:58:52just means what is the thing that we
  9808. 4:58:53want to do. In this case, it's retrieve
  9809. 4:58:54documents.
  9810. 4:58:56As tool for AI agent, there's a
  9811. 4:58:57different options here.
  9812. 4:58:58And now, the description is work with
  9813. 4:59:00data inside the vector database to
  9814. 4:59:02answer any questions, which is fine. Let
  9815. 4:59:04me delete the extra e
  9816. 4:59:05>> [music]
  9817. 4:59:05>> right here.
  9818. 4:59:06Um and then, the table name, which will
  9819. 4:59:07be the table here, right here, table
  9820. 4:59:10editor.
  9821. 4:59:11Yeah, this will be the one that's
  9822. 4:59:12containing different information. As you
  9823. 4:59:13can see, we have number marked
  9824. 4:59:14e-commerce, general information, we have
  9825. 4:59:17go to your cart, XYZ, all the different
  9826. 4:59:19information that it needs to use in
  9827. 4:59:21order to then answer any incoming
  9828. 4:59:22queries. Once [music] that's done, we
  9829. 4:59:24have the limit. Again, actually I don't
  9830. 4:59:26know why I put this to four. Uh this
  9831. 4:59:27basically says number of results fetched
  9832. 4:59:30from the vector store. I typically
  9833. 4:59:31really be blank. Uh in this case, of
  9834. 4:59:33course, if you have a really really
  9835. 4:59:34large vector database and you don't put
  9836. 4:59:36a limit, it will basically use [music]
  9837. 4:59:38more credits than if you put a limit on
  9838. 4:59:40X amount. Uh so, that's why we add a
  9839. 4:59:42limit here.
  9840. 4:59:43And then, we include metadata. And then,
  9841. 4:59:46we have to put the query name, which is
  9842. 4:59:47match underscore documents, which is the
  9843. 4:59:50database that we're using. All right,
  9844. 4:59:51then we have the embeddings, which are a
  9845. 4:59:52way for open AI to take the incoming
  9846. 4:59:54query like, "Hey, what's the return
  9847. 4:59:55policy?" turn that into numbers so that
  9848. 4:59:58it can match them to the embedding.
  9849. 5:00:00Again, this will make much more sense
  9850. 5:00:01once you see the video uh of mixing the
  9851. 5:00:03AI rag agent and the fundamentals behind
  9852. 5:00:05what it is. But, in a very simple way is
  9853. 5:00:07that text is turned to numbers, numbers
  9854. 5:00:08will match numbers to give you an
  9855. 5:00:10answer. Um so, to do this, we have to uh
  9856. 5:00:13put the embedding, which in this case is
  9857. 5:00:15another LLM and we can use open AI.
  9858. 5:00:18Connect your open AI and you can leave
  9859. 5:00:19the model to text embedding three small.
  9860. 5:00:21All right, once the vector store tool is
  9861. 5:00:22finished and we now can look for the
  9862. 5:00:24information in the vector database, we
  9863. 5:00:26can now connect the second tool, which
  9864. 5:00:27is the email draft. Because again, the
  9865. 5:00:29sequential order goes in the vector
  9866. 5:00:31database to find the email to find the
  9867. 5:00:32information in this case, sorry, and
  9868. 5:00:34then go to the email to then draft the
  9869. 5:00:35email to give an answer to the customer.
  9870. 5:00:37So, in this case, we have to use an
  9871. 5:00:38email draft. We can go here.
  9872. 5:00:41Gmail tool.
  9873. 5:00:42And you come to this page.
  9874. 5:00:44You have to connect your email.
  9875. 5:00:46So, it's the same exact process as the
  9876. 5:00:47one before. Create a new credential and
  9877. 5:00:49then you can sign in with Google.
  9878. 5:00:51And then, you have to use the tool
  9879. 5:00:52description. So, the tool description,
  9880. 5:00:54you can set automatically. The resource,
  9881. 5:00:55which would be uh what is the thing
  9882. 5:00:57we're doing? In this case, it's not
  9883. 5:00:58label, it's not message, it's not layer,
  9884. 5:01:00it's draft. And then, the action that
  9885. 5:01:01we're taking is we're creating a draft.
  9886. 5:01:04And the subject line, something good at
  9887. 5:01:06n8n has is that we can actually let the
  9888. 5:01:07AI define this define this parameter,
  9889. 5:01:10which is the subject line of the email.
  9890. 5:01:12And then, the email type, which would be
  9891. 5:01:13text. Then, we have the message, which
  9892. 5:01:14is the email body. And we can also press
  9893. 5:01:16the button right here, which will let
  9894. 5:01:17the model define this parameter, which
  9895. 5:01:19is amazing because you don't have to do
  9896. 5:01:20anything. And also, on top of that, we
  9897. 5:01:21also have to send the email to someone.
  9898. 5:01:23So, we have to press to add option,
  9899. 5:01:25[music] to email, so whoever you're
  9900. 5:01:26sending the email to.
  9901. 5:01:28And then, the info example.com will be
  9902. 5:01:30replaced by the email that we mentioned
  9903. 5:01:31that we're giving the AI agent to take
  9904. 5:01:33action. So, we can just press this and
  9905. 5:01:35now the AI will already have be smart
  9906. 5:01:37enough to be able to think about who are
  9907. 5:01:39we sending the email to based on the
  9908. 5:01:40input that it was given. All right.
  9909. 5:01:41[music]
  9910. 5:01:42So, let's put this to test. Let's see
  9911. 5:01:44how it actually works.
  9912. 5:01:45Um I think we can just I think we can
  9913. 5:01:47just test this.
  9914. 5:01:49Yeah. Let me go here. I'm going to press
  9915. 5:01:50this button right here, which just test
  9916. 5:01:52this right here. It will classify it.
  9917. 5:01:54We'll say it's a poor service. Now, what
  9918. 5:01:56it will do is it will look through the
  9919. 5:01:58vector store. But again, first of all,
  9920. 5:02:00the first step is it will think through
  9921. 5:02:01its memory or its LLM um its brain to
  9922. 5:02:04then think about what it needs to do.
  9923. 5:02:05So, the first step is finished.
  9924. 5:02:07And then, the second step is drafting an
  9925. 5:02:08email. And then, it goes back and it
  9926. 5:02:10thinks through and before it gets to the
  9927. 5:02:11next steps, which is Telegram in this
  9928. 5:02:13case. But, before we get to that, let's
  9929. 5:02:15look at the draft of the email. Let me
  9930. 5:02:17go here.
  9931. 5:02:18Go to drafts.
  9932. 5:02:19Refresh.
  9933. 5:02:21And the shipping policy tells me all of
  9934. 5:02:22this. Now, one thing we want to change
  9935. 5:02:25ideally is maybe the size of the length
  9936. 5:02:27of the email. I think this is pretty
  9937. 5:02:28long. Uh so, to do that, to make any
  9938. 5:02:30changes, you can go here. And then, the
  9939. 5:02:33rules
  9940. 5:02:34uh
  9941. 5:02:35make the email
  9942. 5:02:37draft
  9943. 5:02:39a medium length
  9944. 5:02:41keeping
  9945. 5:02:42it concise [music]
  9946. 5:02:44with a good structure.
  9947. 5:02:47So, let me test this again. Let's see if
  9948. 5:02:48anything changed. And this is how you
  9949. 5:02:50usually go about iterating and and
  9950. 5:02:51making sure that the AI agent does what
  9951. 5:02:53you want it to do in the in the best way
  9952. 5:02:55possible. Now, if we go back here, you
  9953. 5:02:58can see that we made another email,
  9954. 5:03:00which is more structured.
  9955. 5:03:02Maybe the size isn't it's not shorter,
  9956. 5:03:04but the structure is better, I'd say.
  9957. 5:03:06So, now we can say
  9958. 5:03:08and we can leave this as this, to be
  9959. 5:03:09honest. If I was a if I was a customer,
  9960. 5:03:11I would want some sort of answer like
  9961. 5:03:12this.
  9962. 5:03:13That would give me the best information
  9963. 5:03:14with all the prices and stuff.
  9964. 5:03:16Cool. All right. Um
  9965. 5:03:18and again, all the information comes
  9966. 5:03:19here. So, the shipping policy and
  9967. 5:03:21options comes from here, which it pulls
  9968. 5:03:24the information from. All right, now
  9969. 5:03:25once this is done, we can then go to the
  9970. 5:03:26last step, which is basically informing
  9971. 5:03:28the team. Now, why do we do this? It's
  9972. 5:03:29because the email, again, you saw it
  9973. 5:03:31wasn't it wasn't sent to the customer.
  9974. 5:03:32It was drafted. We have to notify
  9975. 5:03:34someone that they have to go to the
  9976. 5:03:35inbox and actually send the email to the
  9977. 5:03:37customer if they like it. So, that's
  9978. 5:03:39where the last step is Telegram, which
  9979. 5:03:40is send a text message, which you can
  9980. 5:03:41find right here.
  9981. 5:03:43Telegram.
  9982. 5:03:44Send a text message right here. And
  9983. 5:03:46then, to connect it,
  9984. 5:03:48you have to create a new credential.
  9985. 5:03:50You have to get the access token.
  9986. 5:03:52If I go to ask AI, start a new session,
  9987. 5:03:54now this will tell me the step-by-step.
  9988. 5:03:56And I recommend you guys always use this
  9989. 5:03:57sort of feature when you're not really
  9990. 5:03:58sure as to how to do it uh cuz it is
  9991. 5:04:00better than ChatGPT because what this
  9992. 5:04:02does is that it actually looks at the
  9993. 5:04:03n8n community, it looks at the different
  9994. 5:04:05questions and it will give you a
  9995. 5:04:06step-by-step as to how to do it. So, the
  9996. 5:04:08first step is start a chat with the bot
  9997. 5:04:09father and then you do different steps
  9998. 5:04:11until you get the actual
  9999. 5:04:12access token. All right, so once you
  10000. 5:04:13connect to your Telegram, you can go
  10001. 5:04:15here. The resource again is message
  10002. 5:04:16because
  10003. 5:04:17we're not drafting or chat or fallback
  10004. 5:04:19or file, we're just sending a simple
  10005. 5:04:21message.
  10006. 5:04:22The operation is what is the action that
  10007. 5:04:23you're taking? In this case, we're
  10008. 5:04:24sending a message. The chat ID is
  10009. 5:04:26something that you can actually take
  10010. 5:04:28um so, let me let me show you. Let me
  10011. 5:04:30execute the step.
  10012. 5:04:33Right here. So, executed the step. Now,
  10013. 5:04:34if I go to Telegram, I should see the
  10014. 5:04:36message. Let me show you. Right here. I
  10015. 5:04:38just got another message
  10016. 5:04:40at 3:50.
  10017. 5:04:42And now, in theory, this will give me a
  10018. 5:04:44chat ID. So, if I go here, chat ID,
  10019. 5:04:47this is the chat ID that will be used to
  10020. 5:04:48then send the
  10021. 5:04:51the text to. This is great because the
  10022. 5:04:52chat ID allows it to give us [music] the
  10023. 5:04:54the answers in the same thread of
  10024. 5:04:56information or or or conversation in
  10025. 5:04:58this case. All right, and now once this
  10026. 5:04:59is done, we have the chat ID. Now, we
  10027. 5:05:01have to put the text. So, what is the
  10028. 5:05:02thing that we're putting in the message?
  10029. 5:05:04Well, in this case, I thought that it'd
  10030. 5:05:05be good to add new inquiry received from
  10031. 5:05:07the name of the person and also the
  10032. 5:05:09about, which is the subject line.
  10033. 5:05:11Uh you could in theory change this and
  10034. 5:05:13add more stuff, but I thought that this
  10035. 5:05:15would be the most relevant to have for
  10036. 5:05:16this agent uh as a text message. Um
  10037. 5:05:20So, we have new inquiry received from
  10038. 5:05:22name about subject line here. And then,
  10039. 5:05:24the action is says email drafted to your
  10040. 5:05:26email. So, again, if you saw on Telegram
  10041. 5:05:28that the message itself was email
  10042. 5:05:29drafted, go to the email informing
  10043. 5:05:31someone they know the name, they know
  10044. 5:05:32the about, like the actual question and
  10045. 5:05:34they can then go and send the email.
  10046. 5:05:39Hey, I'm about to build a live invoicing
  10047. 5:05:41parsing system right in front of you
  10048. 5:05:42that grabs invoices from a Google Drive,
  10049. 5:05:44uses AI to extract all the key data,
  10050. 5:05:46stores it in a Google Sheet before
  10051. 5:05:48sending an email to our billing team
  10052. 5:05:49once it's done. Now, this kind of system
  10053. 5:05:51can actually save companies hundreds of
  10054. 5:05:52hours of processing documents. In this
  10055. 5:05:54case, it's invoices, which they can now
  10056. 5:05:55devote to actually growing the business.
  10057. 5:05:57So, today I'm going to build the whole
  10058. 5:05:58system from scratch using a platform
  10059. 5:06:00called n8n. I'm going to show you all
  10060. 5:06:02the mistakes, all the details I make
  10061. 5:06:03that you get to see what an actual
  10062. 5:06:05development process for a real client
  10063. 5:06:06project actually looks like. so this
  10064. 5:06:08right here is the n8n workflow that
  10065. 5:06:09we're going to work with. Uh we start
  10066. 5:06:11with a Google Drive. So, in this case, I
  10067. 5:06:12go to my Google Drive, I drop in an
  10068. 5:06:14invoice that I have, one of the hundreds
  10069. 5:06:16that I have right now. I go to the
  10070. 5:06:17invoice, I can see that I have different
  10071. 5:06:19fields in the invoice. Company name, uh
  10072. 5:06:21address, email, line item, price,
  10073. 5:06:24currency, payment method, invoice
  10074. 5:06:26number, date, and status, right? So,
  10075. 5:06:27these are different fields that I have
  10076. 5:06:28within the invoice. If I go here to the
  10077. 5:06:30first Google Drive, I'm here to execute
  10078. 5:06:32the workflow.
  10079. 5:06:33What this will do is it will take the
  10080. 5:06:34invoice that we just gave it. It will
  10081. 5:06:35then extract the text from the invoice.
  10082. 5:06:37It will give it to an AI, which will
  10083. 5:06:39extract different variables that we need
  10084. 5:06:40from the invoice like client name,
  10085. 5:06:41address, all that sort of stuff. It adds
  10086. 5:06:43it to a Google Sheet database. It then
  10087. 5:06:45drafts an AI so, drafts an email using
  10088. 5:06:47AI and then sends it to us as well. If I
  10089. 5:06:49go to my Google Sheet database, I can
  10090. 5:06:51see that now the invoice is parsed. So,
  10091. 5:06:53the different variables have been
  10092. 5:06:54extracted. If I go to my email right
  10093. 5:06:55here, I can see that I got an email
  10094. 5:06:57saying, "Dear billing team, you have
  10095. 5:06:58received a new invoice." and it gives
  10096. 5:07:00you the different details. It says the
  10097. 5:07:01system has added the fields in the
  10098. 5:07:02Google Sheet database, which you can
  10099. 5:07:04also view here. If I go here, takes me
  10100. 5:07:05to the Google Sheet database with all
  10101. 5:07:07the line items there. All right, so that
  10102. 5:07:08right there is for the system we're
  10103. 5:07:10going to build from scratch. Again, I'm
  10104. 5:07:11going to start from zero, completely
  10105. 5:07:12zero. So, I'm going to show you the
  10106. 5:07:13whole development process. Let me go to
  10107. 5:07:15a new
  10108. 5:07:17a new workflow right here. We can start
  10109. 5:07:19from scratch.
  10110. 5:07:21The first thing we have to do is
  10111. 5:07:22actually map out the process of the
  10112. 5:07:23automation on a platform called Miro.
  10113. 5:07:25You can use any other platform for this.
  10114. 5:07:27Um, but I like using Miro uh because it
  10115. 5:07:29is very very easy. All right, so the
  10116. 5:07:31first part or the first The thought
  10117. 5:07:33process here is we have a bunch of
  10118. 5:07:34invoices, then we have to So, let's do
  10119. 5:07:37invoices.
  10120. 5:07:39Then we have to basically extract the
  10121. 5:07:41text or extract different variables.
  10122. 5:07:43Extract variables
  10123. 5:07:45from invoice. And by variables, we mean
  10124. 5:07:47client name, client address, all that
  10125. 5:07:48sort of stuff.
  10126. 5:07:50And then we want to add it
  10127. 5:07:53to a database. When someone says
  10128. 5:07:56database, they just mean a Google Sheet
  10129. 5:07:57or an Airtable, Notion, ClickUp,
  10130. 5:07:59whatever it is.
  10131. 5:08:00And then after we add it to the
  10132. 5:08:01database, we want to send an email. So,
  10133. 5:08:03send email
  10134. 5:08:05to billing team
  10135. 5:08:06confirming
  10136. 5:08:07invoice.
  10137. 5:08:09All right. I mean, it is a four-step
  10138. 5:08:10process. As you saw, it was more than
  10139. 5:08:11four steps just because of the way that
  10140. 5:08:13we had to set up. Uh, but this is
  10141. 5:08:14fundamentally what it is that we're
  10142. 5:08:16doing, right? We're watching new
  10143. 5:08:17invoices from somewhere. We're
  10144. 5:08:19extracting the variables. We're saying,
  10145. 5:08:20"Hey, okay, what is the client name?
  10146. 5:08:21What is the client address? What is the
  10147. 5:08:22price? What is the currency?" All that
  10148. 5:08:23sort of stuff. And then we're adding it
  10149. 5:08:25to a database. And then we're sending
  10150. 5:08:26the billing team We're sending an email
  10151. 5:08:27to the billing team confirming the
  10152. 5:08:28invoice. Now, typically when I do
  10153. 5:08:29something like this, I will think
  10154. 5:08:31through how to structure it. So, the
  10155. 5:08:32first step is invoices. As you saw, we
  10156. 5:08:34used the Google Drive because that is
  10157. 5:08:36the easiest to get started with. So, we
  10158. 5:08:38can say watch invoices
  10159. 5:08:41from Google Drive.
  10160. 5:08:44And what this could look like is we run
  10161. 5:08:45the automation maybe once a day or once
  10162. 5:08:47an once a minute uh every minute, I
  10163. 5:08:49mean, every hour or every week, and we
  10164. 5:08:51watch new invoices that have been added
  10165. 5:08:53so that we It's a continuous thing.
  10166. 5:08:56Uh, and that's always good because we
  10167. 5:08:58don't want to have a system where there
  10168. 5:09:00has to be a manual step of running the
  10169. 5:09:01automation every single time. We want it
  10170. 5:09:02to be automatic so that they can just
  10171. 5:09:04drop invoices and every so often it
  10172. 5:09:06takes invoices and then does the whole
  10173. 5:09:07process. Uh, then extract the variables
  10174. 5:09:09from the invoice,
  10175. 5:09:10add it to a database, uh in this case,
  10176. 5:09:13Google Sheet, add variables
  10177. 5:09:17to Google Sheet.
  10178. 5:09:20And then send the email to the billing
  10179. 5:09:21team confirming the invoice. All right,
  10180. 5:09:23so the first step is Google Drive. So,
  10181. 5:09:25what is the first step is always the
  10182. 5:09:26trigger. So, what is the thing that
  10183. 5:09:27actually starts the automation? In this
  10184. 5:09:28case, every new client that has or every
  10185. 5:09:30new file that has been added every new
  10186. 5:09:32invoice that has been added every so
  10187. 5:09:33often will be the thing that starts the
  10188. 5:09:34automation.
  10189. 5:09:35Um, so if I go to Google Drive
  10190. 5:09:38and I go to on changes to a specific
  10191. 5:09:39folder because we're adding
  10192. 5:09:41invoices to a folder,
  10193. 5:09:43I can see that the change that we want
  10194. 5:09:45to make is actually when a file has been
  10195. 5:09:46created, when a file has been added. Um,
  10196. 5:09:48so first The first thing you have to do
  10197. 5:09:50is go here,
  10198. 5:09:51create a credential, and you have to um
  10199. 5:09:53connect your Google Drive to an N
  10200. 5:09:56Now, I'm not going to dive into this
  10201. 5:09:57whole process right now, but I actually
  10202. 5:09:58made a full step-by-step video on how
  10203. 5:10:00you can do it within less than 5
  10204. 5:10:01minutes. Uh, you can check it out on the
  10205. 5:10:02screen right now. Uh, but once you
  10206. 5:10:04connect to your Google Drive, you'll
  10207. 5:10:05have a connection right here, which is
  10208. 5:10:07good. The poll time is just means how
  10209. 5:10:09many times or how often do you want to
  10210. 5:10:10run the Google Drive? In this case, it
  10211. 5:10:12can be every minute. Then the trigger on
  10212. 5:10:14just means what do you want the trigger
  10213. 5:10:16to be? Do you want it to be just changes
  10214. 5:10:18involving a specific folder or a file?
  10215. 5:10:20In this case, it will be a folder
  10216. 5:10:21because we need a folder to include the
  10217. 5:10:23invoices in. And then we have to make
  10218. 5:10:25the folder. So, let's go to Google
  10219. 5:10:26Drive. I can go here.
  10220. 5:10:28I can make a new folder.
  10221. 5:10:31I can call it invoices test
  10222. 5:10:35YouTube. Create.
  10223. 5:10:37And now this created a folder, which I
  10224. 5:10:39can find here.
  10225. 5:10:40Now, this is a place where we're going
  10226. 5:10:41to store all the invoices to be
  10227. 5:10:43processed every every so often. Uh,
  10228. 5:10:45okay, cool. So, now uh obviously make
  10229. 5:10:48sure that your connection is correct. In
  10230. 5:10:50this case, it actually should be James
  10231. 5:10:51Solutions, not the killer connection.
  10232. 5:10:53It's a different uh account. And the
  10233. 5:10:55folder in this case is invoices test
  10234. 5:10:57YouTube. So, invoices test YouTube.
  10235. 5:11:00Okay, and then it says, "What are we
  10236. 5:11:01watching for?"
  10237. 5:11:02In this case, we're watching for a file
  10238. 5:11:04to be created, updated, created, uh
  10239. 5:11:06folder created, folder updated, watch
  10240. 5:11:08folder updated. Well, in this case, we
  10241. 5:11:10want to do when a folder is created
  10242. 5:11:12within a folder. So, when a file is
  10243. 5:11:13created within a folder. So, in this
  10244. 5:11:14case, it'll be when a file is created in
  10245. 5:11:16the watched folder, which is this folder
  10246. 5:11:18right here.
  10247. 5:11:19So, let me go here. We do file created.
  10248. 5:11:21So, now this watches every new file that
  10249. 5:11:23has been added. So, let's try it out.
  10250. 5:11:25Let's test because part of automation is
  10251. 5:11:27testing. I'm going to have an invoice
  10252. 5:11:29that I have right now. So, that you can
  10253. 5:11:30drop your invoices here.
  10254. 5:11:31And I'm going to test if uh now that I
  10255. 5:11:33add it here, if I execute workflow. So,
  10256. 5:11:35in this case, if I fetch test event,
  10257. 5:11:38I'll create it.
  10258. 5:11:39Will this catch the invoice that has
  10259. 5:11:40been added? Well, in this case, yes. So,
  10260. 5:11:41this is the output. If I scroll all the
  10261. 5:11:43way down, I can actually find the link,
  10262. 5:11:46which is the web view link, of the
  10263. 5:11:48invoice that has been added, which is
  10264. 5:11:49correct, which is the same one that has
  10265. 5:11:50been added here because it basically
  10266. 5:11:52caught all the files from there that has
  10267. 5:11:53been added. It only one. All right,
  10268. 5:11:55perfect. So, we know it works. Um, so
  10269. 5:11:56the first step is done. Right right here
  10270. 5:11:59is finished.
  10271. 5:12:01We watched invoices from Google Drive.
  10272. 5:12:03That's good.
  10273. 5:12:05Now, the next step is to extract
  10274. 5:12:09text from a file. So, let me go here.
  10275. 5:12:12Extract from file. Extract from PDF
  10276. 5:12:14because the invoices itself are on PDF
  10277. 5:12:16version.
  10278. 5:12:18So, it depends what kind of PDF or kind
  10279. 5:12:19of file you have. Now, here says extract
  10280. 5:12:22from PDF, which is the thing that we
  10281. 5:12:23have to do uh because that's the action
  10282. 5:12:25that we're doing. But then it says the
  10283. 5:12:27input. So, the thing that's going in to
  10284. 5:12:29this node right here, which extract text
  10285. 5:12:31from PDFs, has to be in a form of
  10286. 5:12:33binary.
  10287. 5:12:34>> [music]
  10288. 5:12:35>> Now, in order for us to get the file to
  10289. 5:12:37be added here, we have to do an
  10290. 5:12:39additional step, which is actually
  10291. 5:12:40downloading the file to then be adding
  10292. 5:12:43it to the to this node right here
  10293. 5:12:45because it only likes binary format, and
  10294. 5:12:47the only way to get binary format is to
  10295. 5:12:48download the file. So, if I go here to
  10296. 5:12:50Google Drive,
  10297. 5:12:52I can now download a file. Press it down
  10298. 5:12:55right here. Make sure you have the right
  10299. 5:12:56connection.
  10300. 5:12:58File download, that's fine.
  10301. 5:13:00Uh, and now we want to actually do it by
  10302. 5:13:03the ID
  10303. 5:13:04because if you do it by the list, then
  10304. 5:13:06you only have access to one file. We
  10305. 5:13:07don't want to keep downloading the same
  10306. 5:13:08file. We want to change the file that
  10307. 5:13:10we're downloading. So, the file itself
  10308. 5:13:12will have an ID that's unique. So, if we
  10309. 5:13:14map the ID, if we put the ID that's
  10310. 5:13:16different every single time, it will
  10311. 5:13:17download every single file differently,
  10312. 5:13:19which is exactly what we need.
  10313. 5:13:21I'll go here. I can put ID.
  10314. 5:13:23You can find the ID. And now the ID will
  10315. 5:13:25actually be here.
  10316. 5:13:26It always It usually starts with one uh
  10317. 5:13:28Y. You can see here ID. Um, one Y,
  10318. 5:13:31whatever. So, this will be the one that
  10319. 5:13:33we map to be added here to be able to
  10320. 5:13:36download it. Now, if I just execute the
  10321. 5:13:38step, I can now see that I got binary
  10322. 5:13:41format data, which is the thing that we
  10323. 5:13:42need in order to add it to the next
  10324. 5:13:43step. And this is the data we got. Okay?
  10325. 5:13:46So, you always need that additional step
  10326. 5:13:47when you're actually doing something
  10327. 5:13:49with Google Drive folder. It's usually
  10328. 5:13:51downloading it and then turning it into
  10329. 5:13:52a binary format when you have to do
  10330. 5:13:54something with it.
  10331. 5:13:55Now, in this case, um the input binary
  10332. 5:13:58format field is fine, data, because this
  10333. 5:14:00is equal to data. So, that's fine. We
  10334. 5:14:02can execute the step. We're actually
  10335. 5:14:03testing.
  10336. 5:14:05As you can see here, there's a lot of
  10337. 5:14:06fields. The one we really care about is
  10338. 5:14:07text right here,
  10339. 5:14:09which gives me the
  10340. 5:14:10company name, invoice number, customer
  10341. 5:14:13name, date, company name, all that sort
  10342. 5:14:14of stuff that we need in order to
  10343. 5:14:15actually split it up and add it to the
  10344. 5:14:17Google Sheet. So, the next step is
  10345. 5:14:18actually extracting the variables within
  10346. 5:14:20the text. Because there's a block of
  10347. 5:14:21text, how do we split it up so we get
  10348. 5:14:23the customer ID, the customer name, the
  10349. 5:14:25email, the address, all that sort of
  10350. 5:14:26stuff that we actually need in order to
  10351. 5:14:28add it to the Google Sheet. Well, in
  10352. 5:14:29this case, you can press plus.
  10353. 5:14:30We have to go to information extractor.
  10354. 5:14:34Now, what this does is that it receives
  10355. 5:14:36text to the actual thing. It then thinks
  10356. 5:14:38through what the text is about. And then
  10357. 5:14:39based on the descriptions of the line
  10358. 5:14:41items or variables that we tell it to to
  10359. 5:14:42give us, it will then split up the text
  10360. 5:14:44so it gives us the the customer name,
  10361. 5:14:45the address, the the invoice ID, all
  10362. 5:14:47that sort of stuff that we need. Um,
  10363. 5:14:48okay. So, the text here will be the text
  10364. 5:14:50from the previous step. So, I can
  10365. 5:14:53look across right here. And again, you
  10366. 5:14:55can also see the result, which is
  10367. 5:14:56something that N8N actually does really
  10368. 5:14:58well. Uh, you can see the output before
  10369. 5:15:00you can test.
  10370. 5:15:01The schema type will be from attribute
  10371. 5:15:03descriptions. Don't worry about this.
  10372. 5:15:04You can leave it as as it is. And now we
  10373. 5:15:05have to add attributes. So, attributes
  10374. 5:15:07just means what is that thing that we
  10375. 5:15:09want to extract from the text? In
  10376. 5:15:10[music] this case, there's a few things.
  10377. 5:15:12So, if I go here and I look at the
  10378. 5:15:13invoice,
  10379. 5:15:15again, this will be different for sort
  10380. 5:15:16of every company. It's sort of similar.
  10381. 5:15:18You still have the price, the invoice
  10382. 5:15:19number, all that sort of stuff. Uh, but
  10383. 5:15:21sometimes we do have something called
  10384. 5:15:22statuses or payment methods um
  10385. 5:15:25that we want to account for. In this
  10386. 5:15:27case, it would be com- customer name.
  10387. 5:15:29So, we can do
  10388. 5:15:30customer name.
  10389. 5:15:32This is the name of the customer.
  10390. 5:15:36So, right here it's asking us what type
  10391. 5:15:37of output is it? Is it a string? Is it a
  10392. 5:15:40Boolean, which is true or false? Is it
  10393. 5:15:41date? Is it a number? In this case, a
  10394. 5:15:43string is just text, like the normal
  10395. 5:15:45version. So, leave it as it is. And then
  10396. 5:15:46description is us giving it a
  10397. 5:15:48description so it actually helps it in
  10398. 5:15:50thinking what is the customer name um
  10399. 5:15:52and so on. And then we can put it
  10400. 5:15:53required. So, it needs to give us the
  10401. 5:15:55output.
  10402. 5:15:56Then we have uh from here company name,
  10403. 5:15:59address, and email.
  10404. 5:16:00So, company
  10405. 5:16:04name.
  10406. 5:16:05This is the name of the company.
  10407. 5:16:08Required.
  10408. 5:16:10Email.
  10409. 5:16:12This is the email of the customer.
  10410. 5:16:16Address as well.
  10411. 5:16:19So, address.
  10412. 5:16:23This is the address
  10413. 5:16:24of the customer.
  10414. 5:16:26Required. Then we have invoice number,
  10415. 5:16:28date, and status.
  10416. 5:16:32Invoice number.
  10417. 5:16:36Date.
  10418. 5:16:38Status.
  10419. 5:16:41Invoice number is this is the
  10420. 5:16:45number of the invoice.
  10421. 5:16:47Required. Now, this right here for date,
  10422. 5:16:49we can actually turn it into a date
  10423. 5:16:50format. Um, we say this is the date of
  10424. 5:16:53the invoice.
  10425. 5:16:55Required.
  10426. 5:16:56And then status will be this is the
  10427. 5:16:58status
  10428. 5:16:59of the payment. Required.
  10429. 5:17:02And then we have
  10430. 5:17:05line items. So, line items, this is like
  10431. 5:17:06the description of the payment, the
  10432. 5:17:08price, and payment method.
  10433. 5:17:10Price and payment method. Uh, line item.
  10434. 5:17:15This is the line item of the invoice.
  10435. 5:17:19Price.
  10436. 5:17:20The total amount.
  10437. 5:17:23This is
  10438. 5:17:26total amount
  10439. 5:17:27of the invoice.
  10440. 5:17:30And then payment method.
  10441. 5:17:34This is the payment method
  10442. 5:17:41of the
  10443. 5:17:42invoice. All right, so I just finished
  10444. 5:17:44filling out all the forms. Uh all the
  10445. 5:17:45details in the in the actual invoice. We
  10446. 5:17:47have customer name, we have a company
  10447. 5:17:49name, we have email, we have address, we
  10448. 5:17:50have invoice number, we have date. And
  10449. 5:17:52again, we turn this to date because it
  10450. 5:17:54is a date format. Um [music] status,
  10451. 5:17:57line item, total amount, payment method,
  10452. 5:17:59and so on. Okay? All right, now what we
  10453. 5:18:01have to do here is we have to do two
  10454. 5:18:02things. The first thing is to give it a
  10455. 5:18:04system prompt template. In this case,
  10456. 5:18:07it's you are an expert extraction
  10457. 5:18:08algorithm. You only extract relevant
  10458. 5:18:10information from the text. If you do not
  10459. 5:18:11know the value of the an attribution
  10460. 5:18:12asked to extract, um you may omit the
  10461. 5:18:15attribute's value. I think this is
  10462. 5:18:16pretty good. I think we don't need to
  10463. 5:18:18give it any more context. Now, one more
  10464. 5:18:19thing we have to do it because this is
  10465. 5:18:21not run on its own. This runs through
  10466. 5:18:23AI. So, we have to connect a model to
  10467. 5:18:25it. So, if I press here,
  10468. 5:18:27I have a list of models that I can
  10469. 5:18:28choose. In this case, I'm choosing Open
  10470. 5:18:29AI chat model.
  10471. 5:18:31And I will come to this page. The way to
  10472. 5:18:33connect your Open AI to N 8 N, you can
  10473. 5:18:35go here,
  10474. 5:18:36create a new credential. You can go to
  10475. 5:18:38platform to Open AI because you have to
  10476. 5:18:40get an API key.
  10477. 5:18:42Dashboard,
  10478. 5:18:43API key,
  10479. 5:18:45create a new secret key, name it. So,
  10480. 5:18:47you can do invoice system.
  10481. 5:18:50Create a secret key.
  10482. 5:18:51You can copy this,
  10483. 5:18:53go back,
  10484. 5:18:54paste it here,
  10485. 5:18:55and then name this whatever it is. So,
  10486. 5:18:595th September
  10487. 5:19:01connection. Save it. And now you will
  10488. 5:19:04have your Open AI connected to N 8 N.
  10489. 5:19:07Bear in mind that this is not free as in
  10490. 5:19:08you still have to pay for this in a
  10491. 5:19:10sense. So, you go to your profile and
  10492. 5:19:11you go to billing.
  10493. 5:19:13You have to add $5 because we're using
  10494. 5:19:15API credits and API credits cost money.
  10495. 5:19:17Uh but it's very very minimal as in I
  10496. 5:19:20think I used $5 in 6 months. Um and I
  10497. 5:19:22was using it quite a bit. So, obviously
  10498. 5:19:24it depends what you use it for as well.
  10499. 5:19:26But, it's relatively cheap. So, you can
  10500. 5:19:27add $5 and you'll have that last you for
  10501. 5:19:29a while. All right, so now that we have
  10502. 5:19:30that, the model can be 4.1 mini. It's
  10503. 5:19:33good, good quality, and good speed.
  10504. 5:19:35We can actually extract this. So, let me
  10505. 5:19:38run this.
  10506. 5:19:40This uses the previous steps to test
  10507. 5:19:41only this step. I go here, I can see
  10508. 5:19:43that I extracted uh the customer name,
  10509. 5:19:45the company name, the email, the
  10510. 5:19:46address, the invoice number, date,
  10511. 5:19:48status, line item, total amount, and
  10512. 5:19:50payment method, which is amazing.
  10513. 5:19:52Which is exactly what we need. Perfect.
  10514. 5:19:54All right, the next step. So, we did
  10515. 5:19:56this.
  10516. 5:19:57Done. The next step is actually to add
  10517. 5:19:59it to the sheet. So, if I go here, I
  10518. 5:20:01actually made the sheet. So, the
  10519. 5:20:02variables that I have,
  10520. 5:20:04uh let me just fill this out so you can
  10521. 5:20:05see. Go right here.
  10522. 5:20:07I have invoice number, client name,
  10523. 5:20:09client email, address, description,
  10524. 5:20:10total amount, invoice date, status, and
  10525. 5:20:11payment method. Now, this is right here
  10526. 5:20:13is just a way for us to actually store
  10527. 5:20:14the invoice uh cuz there has to be some
  10528. 5:20:16place for us to store all the
  10529. 5:20:17information. Um typically a company
  10530. 5:20:20they probably wouldn't have cool sheets.
  10531. 5:20:22They would have maybe a Notion, uh maybe
  10532. 5:20:25some sort of custom software they have.
  10533. 5:20:27Or but they always have a database,
  10534. 5:20:28right? They always have a place where
  10535. 5:20:29they actually have to store information.
  10536. 5:20:31So, this is what we're going to use.
  10537. 5:20:31Let's name this invoice
  10538. 5:20:34uh system.
  10539. 5:20:36N 8 N YouTube.
  10540. 5:20:38And now if I go back here to
  10541. 5:20:42uh here, I have to add a next step,
  10542. 5:20:44which is add the invoice to the Google
  10543. 5:20:47Sheet. So, if I go here, I can go to
  10544. 5:20:49action and app. Sheet, Google Sheets.
  10545. 5:20:52And then I can a append a row in a
  10546. 5:20:54sheet, which means add a row.
  10547. 5:20:56Connect your account. All you have to do
  10548. 5:20:58is create a new credential. You don't
  10549. 5:20:59have to do the same thing you did for
  10550. 5:21:00Google Drive. You can just sign in with
  10551. 5:21:01Google, which will take you to a page
  10552. 5:21:03like this. Choose your account.
  10553. 5:21:06Continue.
  10554. 5:21:07And then it's successful.
  10555. 5:21:09And you go back
  10556. 5:21:11and name it whatever you want.
  10557. 5:21:13Press save.
  10558. 5:21:15All right, now that you connected your
  10559. 5:21:16Google Sheets, uh it is going to be a
  10560. 5:21:17sheet within a document. You want to
  10561. 5:21:18append a row because operation again is
  10562. 5:21:20a thing that you're actually doing. And
  10563. 5:21:21then we want to look for invoice system
  10564. 5:21:23N 8 N YouTube, which is the first one
  10565. 5:21:24that comes up. The sheet will be sheet
  10566. 5:21:26one because again, this right here sheet
  10567. 5:21:29one.
  10568. 5:21:31And now we want to be able to map the
  10569. 5:21:33fields. So, mapping just means that you
  10570. 5:21:35have different columns. You want to add
  10571. 5:21:37the variables for each column to make
  10572. 5:21:39sure that when we run the automation,
  10573. 5:21:41they actually show up. Um so, it would
  10574. 5:21:43be invoice number,
  10575. 5:21:45which is invoice number.
  10576. 5:21:47Client name,
  10577. 5:21:49so customer name.
  10578. 5:21:50Client email, so email.
  10579. 5:21:52Address,
  10580. 5:21:53address.
  10581. 5:21:55Description,
  10582. 5:21:57and in this case it's line item.
  10583. 5:21:59Total amount is this.
  10584. 5:22:01Invoice date, it's here.
  10585. 5:22:04Status
  10586. 5:22:05is here. Payment method is right here.
  10587. 5:22:09I believe that's it. Do we have to do
  10588. 5:22:10anything else? No, that's all good. Um
  10589. 5:22:12okay, so let's test this. Let me execute
  10590. 5:22:13step.
  10591. 5:22:16Now it's running. If I go here, I can
  10592. 5:22:17see that the first run did well. Uh we
  10593. 5:22:20have the line items, we have invoice
  10594. 5:22:22109, Lucas Martin, the email, address,
  10595. 5:22:24description, total amount, invoice date,
  10596. 5:22:26status, and payment method. Let me just
  10597. 5:22:27freeze this row right here.
  10598. 5:22:29So, when I go here, it doesn't I doesn't
  10599. 5:22:31actually take it with it.
  10600. 5:22:33And the next step is finished, so this
  10601. 5:22:35can go green.
  10602. 5:22:36You see how I'm just checking things off
  10603. 5:22:38as I actually do this because it is a
  10604. 5:22:39whole process. I'm planning it out. And
  10605. 5:22:41now the last one is to send an email to
  10606. 5:22:43the billing team confirming the invoice.
  10607. 5:22:45So,
  10608. 5:22:46the next step is using AI because to
  10609. 5:22:47send an email to the billing team,
  10610. 5:22:49you typically want to use AI uh
  10611. 5:22:50depending on the the email, of course.
  10612. 5:22:52Um but in this case, we want to let AI
  10613. 5:22:54actually do the email and we just um set
  10614. 5:22:56up the email the Gmail after. So, let's
  10615. 5:22:58add plus.
  10616. 5:23:00Let's do AI.
  10617. 5:23:02Let's look for an Open AI node, which
  10618. 5:23:04just means hey, we're talking to a GPT
  10619. 5:23:06like can you do this and it gives us the
  10620. 5:23:08output. We are messaging model.
  10621. 5:23:11Uh the again, the way to connect your
  10622. 5:23:12Open AI, I showed it before. Uh go to
  10623. 5:23:14get the API key. And it's the same exact
  10624. 5:23:16connection. If you connected it before,
  10625. 5:23:17you'll have it here. The resource is
  10626. 5:23:19text. Operation is messaging model
  10627. 5:23:20because that's the action that we're
  10628. 5:23:21doing. The model will be let's do 4.1
  10629. 5:23:25mini. I think that's [music] more than
  10630. 5:23:26good.
  10631. 5:23:27That's fine. And the prompt is
  10632. 5:23:30going to be first a system, right? And
  10633. 5:23:33then we're going to have a user prompt.
  10634. 5:23:35So, the system prompt, I'm going to copy
  10635. 5:23:36it from the other automation. I go here.
  10636. 5:23:38It will be you are an email expert for
  10637. 5:23:40JM Media named Jenny. You receive
  10638. 5:23:42invoice information. Your job is to
  10639. 5:23:43notify the internal billing team that an
  10640. 5:23:44invoice was received or sent. In the
  10641. 5:23:46email, make sure that to include the
  10642. 5:23:48system that has been added to the
  10643. 5:23:49fields. So, you say okay. So, in the
  10644. 5:23:51actual email itself,
  10645. 5:23:53we want to give them a
  10646. 5:23:56this right here. So, anyone with the
  10647. 5:23:57link,
  10648. 5:23:58copy the link.
  10649. 5:24:00We want to give them access to the
  10650. 5:24:02Google Sheet
  10651. 5:24:03because I want them to actually have
  10652. 5:24:05access to it if they want to look at it.
  10653. 5:24:06Uh they get a notification saying here
  10654. 5:24:07everything's good. By the way, if you
  10655. 5:24:09want to look into this further, you can
  10656. 5:24:10obviously look at it in the Google
  10657. 5:24:11Sheet. Your output should be in the
  10658. 5:24:12following JSON format. Uh so, we tell it
  10659. 5:24:14this because
  10660. 5:24:16when we want to make an email, the email
  10661. 5:24:17is composed of two different things.
  10662. 5:24:18It's composed of a subject line and it's
  10663. 5:24:20composed of a email body. In this case,
  10664. 5:24:22because they're both custom, we want
  10665. 5:24:24them to split into two different
  10666. 5:24:25variables. So, that's why we use JSON to
  10667. 5:24:28then split the email body and the
  10668. 5:24:30subject line.
  10669. 5:24:31And the rules is don't use any markdown
  10670. 5:24:33formatting uh because Gmail does not
  10671. 5:24:35like any markdown. It doesn't actually
  10672. 5:24:36recognize it. And then it actually
  10673. 5:24:38recognizes HTML, which I'll speak about
  10674. 5:24:40in just a second what it is. Uh so, we
  10675. 5:24:42use we tell it that. We say hey, talk to
  10676. 5:24:45talk talk in the way that Gmail actually
  10677. 5:24:46likes that you're talking to. Um and
  10678. 5:24:48that's fine. Now, the user prompt is
  10679. 5:24:50going to be this. User prompt is going
  10680. 5:24:51to be the variables.
  10681. 5:24:54So, in this case, we need to add all the
  10682. 5:24:56different variables so it can be invoice
  10683. 5:24:58number. I'm going to cut to me actually
  10684. 5:25:00finishing this cuz it's going to take a
  10685. 5:25:01while. All right, so we have invoice
  10686. 5:25:02number, client name, email, total
  10687. 5:25:04amount, and invoice date. Now, we can
  10688. 5:25:06map this. So, invoice number right here.
  10689. 5:25:08Client name right here.
  10690. 5:25:10Uh email,
  10691. 5:25:11total amount, and invoice date.
  10692. 5:25:15Yeah, let me do status as well.
  10693. 5:25:18And we can also add payment method at
  10694. 5:25:20this point.
  10695. 5:25:23Cool.
  10696. 5:25:24All right, so that is the input that we
  10697. 5:25:26give it. So, we say hey, you would do
  10698. 5:25:27XYZ, and here's the input that you have
  10699. 5:25:29to do this thing for, and just give me
  10700. 5:25:31the both the emails, okay?
  10701. 5:25:33Now, one more thing we have to do here
  10702. 5:25:35is actually turning this on. The output
  10703. 5:25:36content is JSON because we actually told
  10704. 5:25:39the AI give me JSON. So, we want it to
  10705. 5:25:41actually officially say hey, the output
  10706. 5:25:44should be JSON yes or yes. Um and we
  10707. 5:25:46don't want it to error out. So, that's
  10708. 5:25:47good.
  10709. 5:25:48Now, let's execute the step, which is
  10710. 5:25:50basically testing.
  10711. 5:25:51It will use the previous variables.
  10712. 5:25:54Now, it will give us the email. So, the
  10713. 5:25:55email is all in a weird format. This is
  10714. 5:25:57the format that Gmail likes when you
  10715. 5:25:59give emails. So, don't worry about this
  10716. 5:26:01too much, but worry about the fact that
  10717. 5:26:02you got the subject line right here, and
  10718. 5:26:04you got the email body as two different
  10719. 5:26:06variables right here.
  10720. 5:26:07Then we can then use to actually send
  10721. 5:26:08the email. So, if I go here, I'm done
  10722. 5:26:11with the AI part,
  10723. 5:26:13which is
  10724. 5:26:14well, I mean I guess it's part of this.
  10725. 5:26:16I can go to Gmail,
  10726. 5:26:19send a message.
  10727. 5:26:21To connect your Gmail to N 8 N, you can
  10728. 5:26:23go here, sign in with Google, and then
  10729. 5:26:24you can take go through the same process
  10730. 5:26:26that you went through Google Sheets.
  10731. 5:26:27Close.
  10732. 5:26:28And it's the three things that we have
  10733. 5:26:30to fill out. The first one is message uh
  10734. 5:26:32or resource. It's a message. Operation,
  10735. 5:26:33which is what are we doing? We're
  10736. 5:26:34sending the message. Uh who are we
  10737. 5:26:36sending the email to? In this case,
  10738. 5:26:37let's do my email.
  10739. 5:26:39The subject line will be the one here.
  10740. 5:26:41So, we just drag it across. We can see
  10741. 5:26:42even the output before we even test,
  10742. 5:26:44which is again amazing. And then the
  10743. 5:26:46message itself or the email type in this
  10744. 5:26:48case, which is where we add HTML. We
  10745. 5:26:50have two of two options. So, we say
  10746. 5:26:52okay, we're sending the email to
  10747. 5:26:53someone.
  10748. 5:26:54How do we want to send it to them? Do
  10749. 5:26:56you want to just text or do you want to
  10750. 5:26:57put HTML?
  10751. 5:26:58HTML is just the way that you make your
  10752. 5:27:00emails look pretty. You know when you
  10753. 5:27:01guys get emails that look nice, they
  10754. 5:27:03have formatting, they have headers, they
  10755. 5:27:05have all that stuff. That is because
  10756. 5:27:06you're using HTML. So, we kind of want
  10757. 5:27:08to do that,
  10758. 5:27:09which is why we use HTML. And that's
  10759. 5:27:11what we tell the AI to output it as
  10760. 5:27:13HTML, uh which is good. So, the message
  10761. 5:27:15in this case would be the email body,
  10762. 5:27:16which is the one here. We just drag it
  10763. 5:27:17across.
  10764. 5:27:18And one thing more that we have to do is
  10765. 5:27:22we want to take this off. So, append N 8
  10766. 5:27:23N attribution, which is basically a way
  10767. 5:27:25for N 8 N to market themselves in a way.
  10768. 5:27:27Um so, when you send an email to
  10769. 5:27:28someone, if you don't turn this off, it
  10770. 5:27:30will say this was sent by N 8 N. So, we
  10771. 5:27:32take this off just because it's more, I
  10772. 5:27:34guess, professional, uh more clean. It
  10773. 5:27:35looks like it actually came from a real
  10774. 5:27:36person, even though we all know it's
  10775. 5:27:38not, uh especially when you're doing 100
  10776. 5:27:39invoices a day, but that's fine. Now, we
  10777. 5:27:41get it to execute the step, so we're
  10778. 5:27:43testing this.
  10779. 5:27:44And if I go to my email,
  10780. 5:27:47I can see now, I refresh,
  10781. 5:27:51that I got an email, um with all the
  10782. 5:27:53details.
  10783. 5:27:54Right? And this is how we managed to
  10784. 5:27:56make these look nice, bold, and actually
  10785. 5:27:58even have a
  10786. 5:28:00sort of an embedded link. We can just
  10787. 5:28:02press here, and it will take us to the
  10788. 5:28:03sheet that we have. All right, so now
  10789. 5:28:06let's test it from scratch with another
  10790. 5:28:07invoice, from zero.
  10791. 5:28:10Let me go to my Google Drive.
  10792. 5:28:13Let me
  10793. 5:28:15do this.
  10794. 5:28:16Not delete this. Actually, I can just
  10795. 5:28:17send a new one. The new one, let's do
  10796. 5:28:20random one here. Let me see what the
  10797. 5:28:22name of the person is.
  10798. 5:28:25Isabella Moore.
  10799. 5:28:27And now if I go here to N 8 N, I can run
  10800. 5:28:29this.
  10801. 5:28:30Now, this will do is it will take the
  10802. 5:28:32file that has been created, it will
  10803. 5:28:33extract the text, it will then go here
  10804. 5:28:35to the information extractor, it will
  10805. 5:28:36add it to the Google Sheet, it will then
  10806. 5:28:38think through AI to make the email that
  10807. 5:28:39will be sent to us on Gmail, and we'll
  10808. 5:28:42have everything there. If I go here, I
  10809. 5:28:44can see that I have Isabella Moore with
  10810. 5:28:45the email, with the address, the
  10811. 5:28:47description, with the total amount, with
  10812. 5:28:48invoice date, status, and payment
  10813. 5:28:49method. If I go to my email as well, I
  10814. 5:28:51can see that now I also have a
  10815. 5:28:52notification, dear billing team, we have
  10816. 5:28:54received the invoice uh from Isabella
  10817. 5:28:56Moore, and we have all the different
  10818. 5:28:57things that we have here, Jenny, with no
  10819. 5:28:59N 8 N attribution, with no hey, this was
  10820. 5:29:01sent by N 8 N. And now I also have the
  10821. 5:29:03link right here, which takes me again to
  10822. 5:29:05the Google Sheet with all the
  10823. 5:29:05information here.
  10824. 5:29:10Hey, so in this video I'm going to build
  10825. 5:29:11a human in the loop AI sales agent live
  10826. 5:29:13in front of you that takes in lead form
  10827. 5:29:15submissions, it adds it to your CRM, it
  10828. 5:29:17drafts a sales email, it routes it to
  10829. 5:29:19your team for feedback, and
  10830. 5:29:20automatically revises it until it's
  10831. 5:29:21ready to send. So, today I'm going to
  10832. 5:29:22build the entire system from scratch in
  10833. 5:29:24N 8 N. I'm going to walk you through my
  10834. 5:29:26whole thought process, the whole
  10835. 5:29:27detours, the the mistakes I make, and
  10836. 5:29:29everything that I go through, so you get
  10837. 5:29:30to see what an actual development
  10838. 5:29:31process looks like when you're building
  10839. 5:29:33automations. So, this is the automation
  10840. 5:29:34we're going to build. It's built on N 8
  10841. 5:29:36N, and it all starts with the lead form
  10842. 5:29:38submission. And this is typically what
  10843. 5:29:40the the client or the lead, whatever it
  10844. 5:29:42is, they actually fill out to start the
  10845. 5:29:44automation. That's the trigger. Then we
  10846. 5:29:46add it to our CRM, which is in Google
  10847. 5:29:47Sheets. Then we talk to our sales agent,
  10848. 5:29:49which will draft an email, a sales
  10849. 5:29:51email, that will be sent to us first.
  10850. 5:29:53So, this is the human in the loop
  10851. 5:29:54element. It will send it to us, we'll
  10852. 5:29:55revise it, give feedback. If the
  10853. 5:29:57feedback is negative, it will send it to
  10854. 5:29:59another AI agent to revise, to make the
  10855. 5:30:02feedback, make the changes based on what
  10856. 5:30:03we told it, send it back, and do the
  10857. 5:30:05whole repetitive loop until it's
  10858. 5:30:06positive. And once we approve the email,
  10859. 5:30:09it will then send it to the customer.
  10860. 5:30:10Okay? So, let me show you exactly how it
  10861. 5:30:11works from the start until the end. When
  10862. 5:30:13I execute the workflow, which will run
  10863. 5:30:14the automation once, I'm going to go
  10864. 5:30:16here, and now I'm going to start filling
  10865. 5:30:17it up. So, my name
  10866. 5:30:24company name will be Jim's Solutions.
  10867. 5:30:30Budget can be 1.5.
  10868. 5:30:32Project description, we are
  10869. 5:30:34looking to generate
  10870. 5:30:37leads
  10871. 5:30:39for our real estate
  10872. 5:30:41business.
  10873. 5:30:43And the timeline can be 1 to 3 weeks.
  10874. 5:30:45When we press submit here, this will
  10875. 5:30:47trigger the automation. So, the form is
  10876. 5:30:48itself, that's what the customer will
  10877. 5:30:50do. It will send it to the first agent
  10878. 5:30:52to check against projects that we've
  10879. 5:30:53done before, to actually incorporate
  10880. 5:30:55results and testimonials into the email.
  10881. 5:30:58It will then send it to us. So, the next
  10882. 5:30:59step we have to do is go to our email,
  10883. 5:31:01go to this email right here, action
  10884. 5:31:02required, new lead budget of 1.1 to 5.
  10885. 5:31:05Um and this is what their internal team
  10886. 5:31:07in the company is going to look at.
  10887. 5:31:09They're going to look at the email,
  10888. 5:31:10they're going to respond. So, this is a
  10889. 5:31:11place where you get to give feedback for
  10890. 5:31:12the email. So, hey, thanks for reaching
  10891. 5:31:14out. You told me 1 to 3 weeks. We
  10892. 5:31:15recently helped another client. So, see
  10893. 5:31:16how it incorporates testimonials here.
  10894. 5:31:19Then it says, are you available for a
  10895. 5:31:2015-minute call this week or something?
  10896. 5:31:21Okay, let me ask let me tell it, don't
  10897. 5:31:23ask a question at the end.
  10898. 5:31:28Just
  10899. 5:31:29say or just ask a few times
  10900. 5:31:33and I'll just ask to provide
  10901. 5:31:38a few times
  10902. 5:31:40that work for them
  10903. 5:31:42next week.
  10904. 5:31:45Right? And this is the feedback that I'm
  10905. 5:31:46going to give
  10906. 5:31:47I'm going to press submit. Go back here.
  10907. 5:31:49You see how now it routes it to the
  10908. 5:31:51denied path because we denied the actual
  10909. 5:31:53email. We said, hey, make changes, it's
  10910. 5:31:54not good. It will now send it back to
  10911. 5:31:56us. If we go here to my email,
  10912. 5:31:59I'll have another email here which I can
  10913. 5:32:00go through. I can respond.
  10914. 5:32:02And here as we can see,
  10915. 5:32:05it changed the email based on the
  10916. 5:32:06feedback that we gave it. So, please
  10917. 5:32:07share a few times that work for you.
  10918. 5:32:08So, I'm going to say, okay.
  10919. 5:32:11Looks good.
  10920. 5:32:14I submit
  10921. 5:32:15and now because it's positive, it will
  10922. 5:32:17send it to the actual customer.
  10923. 5:32:19Uh or the lead. So, I'm going to go
  10924. 5:32:20here, and now since I'm the lead itself,
  10925. 5:32:23I'm going to get an email
  10926. 5:32:26saying lead generation results for your
  10927. 5:32:27real estate business. And I get a whole
  10928. 5:32:29customized email for me. Now, that's
  10929. 5:32:32what there is the automation that we're
  10930. 5:32:33going to build step by step, and the
  10931. 5:32:36application of this on a business side
  10932. 5:32:37is that a lot of customers or a lot of
  10933. 5:32:39companies, they have a lot of forms on
  10934. 5:32:41the websites, but the whole process from
  10935. 5:32:43when the lead fills out the form to when
  10936. 5:32:45they are replied to, and so on, is a
  10937. 5:32:47very manual process for companies. And
  10938. 5:32:48what we're doing here is not only saving
  10939. 5:32:50that time for the company to be able to
  10940. 5:32:52reply to those emails automatically, but
  10941. 5:32:54actually making it custom, and also
  10942. 5:32:56incorporating our feedback into the
  10943. 5:32:58whole process as well. Right? And that's
  10944. 5:32:59exactly what we're doing. All right,
  10945. 5:33:00cool. So, I want to start from scratch,
  10946. 5:33:02and I'm going to go to a new workflow,
  10947. 5:33:04personal,
  10948. 5:33:05and test builds.
  10949. 5:33:07Create a workflow. Okay, and we're going
  10950. 5:33:08to start here. And before we get to the
  10951. 5:33:09actual build and actually putting any
  10952. 5:33:10steps into it, I usually like to map out
  10953. 5:33:12the automation, what it looks like. It's
  10954. 5:33:14sort of like a plan I have uh before I
  10955. 5:33:16get to the actual build. So, it all
  10956. 5:33:17starts with the form. So, the first
  10957. 5:33:19um the first place is form, and I add a
  10958. 5:33:22sticky note saying what kind of things
  10959. 5:33:23we want on the form. In this case, it's
  10960. 5:33:24name, uh email,
  10961. 5:33:28what was it? Uh income? No, budget.
  10962. 5:33:32Intent,
  10963. 5:33:34timeline,
  10964. 5:33:35and project description.
  10965. 5:33:36Okay, so that's what we want in the
  10966. 5:33:37email. Then on the form, or after the
  10967. 5:33:39form, we ideally want to make sure that
  10968. 5:33:43we add it to the CRM.
  10969. 5:33:45So,
  10970. 5:33:46add responses
  10971. 5:33:48to CRM. And the CRM can be Sheets, can
  10972. 5:33:50be ClickUp, it can be Asana, whatever
  10973. 5:33:51you have,
  10974. 5:33:52uh or HubSpot, and then you can then,
  10975. 5:33:55after we add it to the CRM, talk to the
  10976. 5:33:56first agent.
  10977. 5:33:57So, first agent
  10978. 5:34:00to write sales email.
  10979. 5:34:03Then ideally we want to send it back,
  10980. 5:34:05send it to us
  10981. 5:34:07for feedback
  10982. 5:34:09and approval.
  10983. 5:34:11And now it can go either two ways. If we
  10984. 5:34:13approve it, it goes to send the email to
  10985. 5:34:14the lead. If you don't approve it, using
  10986. 5:34:16the feedback that we gave it, it will
  10987. 5:34:17then send it back. So, I could have two
  10988. 5:34:19paths here. I could have or really, red
  10989. 5:34:25and green, right?
  10990. 5:34:27That's approve or deny.
  10991. 5:34:29So, if you approve it,
  10992. 5:34:32deny. So, once it's approved, again, we
  10993. 5:34:34will send it to the to the customer, so
  10994. 5:34:36the lead. So, in this case, it will be
  10995. 5:34:38send email to lead.
  10996. 5:34:40And if it's denied, then we want to
  10997. 5:34:44s- uh have second agent, so second
  10998. 5:34:47revision agent
  10999. 5:34:50right here,
  11000. 5:34:52which will then
  11001. 5:34:53send it back to us
  11002. 5:34:55for feedback.
  11003. 5:34:56Right? And that's exactly what we want
  11004. 5:34:58to build. So, we start with the form.
  11005. 5:35:00So, there's a form that lead fills out
  11006. 5:35:02with different variables right here,
  11007. 5:35:04or questions. Then we add the responses
  11008. 5:35:06to our CRM. In this case, it's Google
  11009. 5:35:07Sheets. Then we add the first or we talk
  11010. 5:35:09to the first agent to write the sales
  11011. 5:35:11email. Then we send it to us for
  11012. 5:35:12feedback and approval. And I forgot to
  11013. 5:35:14add one more step here, which is uh in
  11014. 5:35:16this case,
  11015. 5:35:17it's a
  11016. 5:35:19intent agent. Okay, I'll explain that to
  11017. 5:35:21what that is. Because we give feedback,
  11018. 5:35:22but how does the system know
  11019. 5:35:24whether it's positive feedback, whether
  11020. 5:35:25it's negative feedback? How does it know
  11021. 5:35:26whether it's accepted or denied, right?
  11022. 5:35:28Uh so, this is
  11023. 5:35:29intent. So, feedback intent agent.
  11024. 5:35:34Feedback intent agent.
  11025. 5:35:37Okay, and now
  11026. 5:35:39if it's approved,
  11027. 5:35:41it goes there, send the email to the
  11028. 5:35:42lead. And if it's not approved, then we
  11029. 5:35:44talk to our second agent, which will
  11030. 5:35:46write the email.
  11031. 5:35:47Make this smaller. So, quick note here,
  11032. 5:35:49um you don't actually build automations
  11033. 5:35:51and go straight to the platform and
  11034. 5:35:52start building them. You always want to
  11035. 5:35:54have a process to actually map things
  11036. 5:35:56out, map out what you want to build
  11037. 5:35:57first, and then go on and build it. It's
  11038. 5:35:59sort of like you're building a castle on
  11039. 5:36:00a foundation of sand. So, you always
  11040. 5:36:02want to make sure you have that roadmap
  11041. 5:36:03and that guide that you can then take
  11042. 5:36:05when you're building automations. All
  11043. 5:36:06right, so let's go to N 8 N and actually
  11044. 5:36:08build it. Um the first step, of course,
  11045. 5:36:10because we have the form, we have to
  11046. 5:36:12create a form. Now, thankfully, we have
  11047. 5:36:13N 8 N, which has an internal way of
  11048. 5:36:16creating the forms. What I mean by this
  11049. 5:36:17is that they have just an internal N 8 N
  11050. 5:36:19form right here.
  11051. 5:36:21Um so, we can use this. Let me go here,
  11052. 5:36:23create a form. And we can use the
  11053. 5:36:25trigger. So, the trigger just means
  11054. 5:36:26what's the first thing that starts the
  11055. 5:36:27automation. And in this case, it will be
  11056. 5:36:29on a new N 8 N form event. So, if I
  11057. 5:36:31press this button, it will take me to
  11058. 5:36:32this page uh where I have a few things
  11059. 5:36:35to look at. The first thing is test URL
  11060. 5:36:37versus production URL. And test URL just
  11061. 5:36:39means that this URL will be used when we
  11062. 5:36:41are filling out the form on test mode.
  11063. 5:36:43So, when we activate the automation
  11064. 5:36:44right here,
  11065. 5:36:47then only do we use the production URL,
  11066. 5:36:48okay?
  11067. 5:36:49So, test URL is what we're using right
  11068. 5:36:50now to test it, but production is when
  11069. 5:36:52you activate it. Authentication is when
  11070. 5:36:53you want to add a password. So, do you
  11071. 5:36:55want to add a password to this form? So,
  11072. 5:36:57let's say I add a basic auth.
  11073. 5:36:58Uh name credential, I can create a new
  11074. 5:37:00credential. I can name it
  11075. 5:37:02YouTube
  11076. 5:37:03human in the loop agent. I'm definitely
  11077. 5:37:07not going to remember what this is. Uh
  11078. 5:37:08user will be user, and then it will be 1
  11079. 5:37:112 3 4 5.
  11080. 5:37:13So, let me show you exactly what this
  11081. 5:37:14is. Um
  11082. 5:37:16Close this fine. Uh no, thanks. And now,
  11083. 5:37:20I can do
  11084. 5:37:21new lead
  11085. 5:37:24submission.
  11086. 5:37:27I want to show you exactly what the
  11087. 5:37:28basic auth is. I can execute the step
  11088. 5:37:31and see before we actually get to the
  11089. 5:37:32form, it asks us for a password. Well,
  11090. 5:37:34why do we do this? It's sort of like
  11091. 5:37:35you're putting a password on your phone.
  11092. 5:37:36You don't want everyone to have access
  11093. 5:37:37to it. Uh you want only the people who
  11094. 5:37:39have the password to have access to it.
  11095. 5:37:40So, in this case, if I put the password
  11096. 5:37:42that I put before, 1 2 3 4 5,
  11097. 5:37:45I sign in, then I can uh obviously do
  11098. 5:37:48the form and whatever app, right? On
  11099. 5:37:50there.
  11100. 5:37:50And I can submit.
  11101. 5:37:52In this case, there's no questions. Uh
  11102. 5:37:53but, that's what it do and I get the
  11103. 5:37:54output. Uh so, that's what basic auth
  11104. 5:37:56is. Um
  11105. 5:37:58Form title, so let's Let me actually
  11106. 5:37:59turn this off cuz I don't want the the
  11107. 5:38:00password. So, this will just be free. Uh
  11108. 5:38:03the title will be this. So, this will be
  11109. 5:38:05We can add this as we'll get back to you
  11110. 5:38:08soon as possible.
  11111. 5:38:12Now that we have the description and the
  11112. 5:38:13title, we want to add the elements. So,
  11113. 5:38:15in this case, we spoke about having
  11114. 5:38:17name, email, budget, intent, timeline,
  11115. 5:38:18and project description. So, to add
  11116. 5:38:21questions, we have to add a form
  11117. 5:38:22element. So, in this case, it can be
  11118. 5:38:24full name. It'll be text. Placeholder
  11119. 5:38:26will be
  11120. 5:38:28James Low. So, this is the thing that
  11121. 5:38:29you see before you actually fill it out
  11122. 5:38:31to give you an idea of what you have to
  11123. 5:38:32fill out there. Uh required yes, it'll
  11124. 5:38:34be required. Then, we have, let's say,
  11125. 5:38:36email.
  11126. 5:38:38So, this will be email.
  11127. 5:38:40And email could be James
  11128. 5:38:43.low @gmail.com.
  11129. 5:38:46That's what we have here. And we can
  11130. 5:38:47also make this required. So, the the
  11131. 5:38:48user has to fill it out. And then, we
  11132. 5:38:50have another uh question here, which can
  11133. 5:38:52be company name. In this case, we didn't
  11134. 5:38:54add it here, but it can be a question.
  11135. 5:38:56Uh so, let me do it here. Company name.
  11136. 5:39:00Uh JM Solutions, which is the company
  11137. 5:39:03name uh that I have. And then, we have
  11138. 5:39:05budget.
  11139. 5:39:07So, budget can be a not a text, uh but
  11140. 5:39:09it can be
  11141. 5:39:11a drop-down. So, drop-down just means
  11142. 5:39:14you have different options. So, option
  11143. 5:39:15one
  11144. 5:39:17will be less
  11145. 5:39:19I can just do this.
  11146. 5:39:21Less than 1,000.
  11147. 5:39:23Add a field option. Option two will be
  11148. 5:39:261,000
  11149. 5:39:27to 3,000.
  11150. 5:39:30And then, like this.
  11151. 5:39:31And then,
  11152. 5:39:333,000
  11153. 5:39:36to 5,000.
  11154. 5:39:39And then, another field option, 5,000
  11155. 5:39:41plus. So, in this case, more than 5,000.
  11156. 5:39:46That's for budget. And then, we have um
  11157. 5:39:48project description. So, in this case,
  11158. 5:39:50it wouldn't be this. Be required.
  11159. 5:39:52Project description, which would be
  11160. 5:39:54a text field.
  11161. 5:39:57You can just add
  11162. 5:39:58we want a system that
  11163. 5:40:03boom.
  11164. 5:40:03You can leave it up to the user.
  11165. 5:40:05Required field. And then, we have
  11166. 5:40:06timeline. So, timeline
  11167. 5:40:08again, can be a drop-down uh because you
  11168. 5:40:10want to give them a few options.
  11169. 5:40:12It can be
  11170. 5:40:14within
  11171. 5:40:161 week.
  11172. 5:40:171 to 3 weeks. And then, we can do 3
  11173. 5:40:19weeks and both. So, 1 week
  11174. 5:40:22to
  11175. 5:40:233 weeks.
  11176. 5:40:27And then, we can put 3 weeks plus.
  11177. 5:40:30All right, cool. So, uh the last thing
  11178. 5:40:31we have to fill out is respond when. So,
  11179. 5:40:33this is saying, when do we want to send
  11180. 5:40:35the data? In this case,
  11181. 5:40:36we want to send the data when the form
  11182. 5:40:37is submitted. But, there are cases where
  11183. 5:40:39you want to send the data when the
  11184. 5:40:40workflow finishes. So, you start the
  11185. 5:40:41form and it doesn't only submit Does it
  11186. 5:40:43only send the confirmation of submission
  11187. 5:40:45when the the actual workflow finishes
  11188. 5:40:47when the automation finishes. In this
  11189. 5:40:48case, we don't need this. Uh we just
  11190. 5:40:50have form submitted. So, whenever the
  11191. 5:40:51user first submits the form, it starts
  11192. 5:40:52the automation and we can now test it.
  11193. 5:40:55So, in this case, as I mentioned, we're
  11194. 5:40:56testing it, so we're using the URL here.
  11195. 5:40:59I can execute the step. I can now just
  11196. 5:41:02fill out the form. So,
  11197. 5:41:04for
  11198. 5:41:08company name
  11199. 5:41:10budget, it can be 3,000. Project
  11200. 5:41:13description, we want
  11201. 5:41:15more leads. More leads.
  11202. 5:41:18And 1 to 3 weeks, right? If I go back
  11203. 5:41:21here, I can see that this is the output
  11204. 5:41:22that I get.
  11205. 5:41:23>> [music]
  11206. 5:41:23>> So, we trigger the form using the N N
  11207. 5:41:25and now, we get this output. So, full
  11208. 5:41:27name, email, company name, and so on.
  11209. 5:41:28Now, we can use these variables. So,
  11210. 5:41:30these are called dynamic variables
  11211. 5:41:31because they are dynamic. They change
  11212. 5:41:33every single time.
  11213. 5:41:34Um and then, we can use them for for
  11214. 5:41:35next steps. So, all is good.
  11215. 5:41:38Took us a minute to put this together.
  11216. 5:41:40But, now we can add this to the CRM. So,
  11217. 5:41:42the CRM will be a Google Sheet. So, let
  11218. 5:41:44me add a Google Sheet here. We can do
  11219. 5:41:46CRM intake YouTube YouTube human in the
  11220. 5:41:50loop
  11221. 5:41:51agent.
  11222. 5:41:54I have so many Google Sheets with this.
  11223. 5:41:55So, I make sure I have to make sure that
  11224. 5:41:56I know exactly which Google Sheet is
  11225. 5:41:58what. Um so, this can be full name.
  11226. 5:42:01Uh I think we had company or email.
  11227. 5:42:05Let me just quickly check.
  11228. 5:42:08I have company name, full name, email,
  11229. 5:42:09company name, budget,
  11230. 5:42:12project description, and timeline.
  11231. 5:42:18Uh
  11232. 5:42:19Got to have to figure it out.
  11233. 5:42:22Budget, project description, timeline.
  11234. 5:42:30Project description.
  11235. 5:42:35And then, we have timeline.
  11236. 5:42:38Let me make this bold. Let me make this
  11237. 5:42:40here
  11238. 5:42:41here white.
  11239. 5:42:43I like to make this pretty. I can get
  11240. 5:42:45this set.
  11241. 5:42:46All right, cool. Uh now that we made the
  11242. 5:42:47CRM, and typically we use Google Sheets
  11243. 5:42:49cuz that's the easiest, but um a company
  11244. 5:42:51probably wouldn't have Google Sheets.
  11245. 5:42:52They would have a HubSpot, they would
  11246. 5:42:53have a Notion, or they would have a
  11247. 5:42:55ClickUp where they store all the leads
  11248. 5:42:56that come through. Um but, this is just
  11249. 5:42:58for testing purposes.
  11250. 5:43:00All right, so once we made the CRM, we
  11251. 5:43:02can now connect it. So, to connect the
  11252. 5:43:03form to the uh Google Sheets, we just
  11253. 5:43:05have to press plus, look for Google
  11254. 5:43:07Sheets right here.
  11255. 5:43:09Now, we want to append a row. Append
  11256. 5:43:11just means add, right? So, we want to
  11257. 5:43:12append a row in a sheet.
  11258. 5:43:13Uh connect your account. So, you can
  11259. 5:43:15connect your account by creating a new
  11260. 5:43:16credential. In this case, you can sign
  11261. 5:43:17in with Google. I'll do it step by step.
  11262. 5:43:20My email.
  11263. 5:43:22Continue.
  11264. 5:43:23Connection successful. So, if I go back,
  11265. 5:43:25I can see that the account was
  11266. 5:43:26connected. I usually would recommend
  11267. 5:43:28naming it um the email. So,
  11268. 5:43:31five and then, the date,
  11269. 5:43:34which is 20th of August.
  11270. 5:43:38Okay, cool.
  11271. 5:43:39And then, press save.
  11272. 5:43:40>> [music]
  11273. 5:43:40>> So, now the connection is done. Uh the
  11274. 5:43:41resource is sheet within document append
  11275. 5:43:43a row because that's the action that
  11276. 5:43:45we're doing. There's a bunch of stuff
  11277. 5:43:46that we can do.
  11278. 5:43:47Uh and we're going to use, I believe
  11279. 5:43:49it's get rows. Yeah, we're going to use
  11280. 5:43:50get rows a little on.
  11281. 5:43:52Now, it's asking for the document. The
  11282. 5:43:53document in this case is
  11283. 5:43:55the CRM intake YouTube human in the
  11284. 5:43:58loop. That's a long name. Okay, that
  11285. 5:43:59right there. I know it's that one cuz we
  11286. 5:44:01named it. So, that's good. Uh and sheet
  11287. 5:44:03one will be the sheet that we have to
  11288. 5:44:04map. And sheet one is here.
  11289. 5:44:06And now, it's asking us to put the
  11290. 5:44:08values to send. So, in this case, we're
  11291. 5:44:09not mapping each column manually because
  11292. 5:44:11we are manually adding variables for
  11293. 5:44:12each column. And we're saying, "Hey,
  11294. 5:44:14full name needs to go in column one,
  11295. 5:44:16which is full name."
  11296. 5:44:17Second column is email, company name,
  11297. 5:44:19budget, description, and timeline. We do
  11298. 5:44:20everything for for the different
  11299. 5:44:22columns. So, full name, let me drag it
  11300. 5:44:23across
  11301. 5:44:25right here.
  11302. 5:44:26Email, right across here. Company name,
  11303. 5:44:28here. Budget, here. Project description,
  11304. 5:44:32here.
  11305. 5:44:33Timeline.
  11306. 5:44:34I forgot to add one more, which is date
  11307. 5:44:38submitted.
  11308. 5:44:43All right, cool. Um I wanted date
  11309. 5:44:45submitted cuz I know I want to know
  11310. 5:44:46exactly when they submitted the date or
  11311. 5:44:47when they submitted the form cuz I
  11312. 5:44:49That's always good to know. I can just
  11313. 5:44:50refresh here.
  11314. 5:44:52And now, it gives me the the column that
  11315. 5:44:53I put. And now,
  11316. 5:44:55this is the variable. So, submitted at,
  11317. 5:44:57which tells me the date. This gives me
  11318. 5:44:58also the time and all that sort of
  11319. 5:44:59stuff. So, we're going to drag this
  11320. 5:45:00across submitted at.
  11321. 5:45:02And now, I wouldn't want this like this.
  11322. 5:45:04So, I'm going to format this in a way
  11323. 5:45:06where it's actually readable for the
  11324. 5:45:07company. They can actually understand. I
  11325. 5:45:09mean, cuz who's going to understand
  11326. 5:45:10this? They're going to have to spend
  11327. 5:45:11time even thinking about what this
  11328. 5:45:12means. So, uh to do it, I believe it's
  11329. 5:45:16format date.
  11330. 5:45:19Uh
  11331. 5:45:20no, it's not that.
  11332. 5:45:21Okay, so let's see why it doesn't work.
  11333. 5:45:22Uh let me see what I have. Suggested to
  11334. 5:45:24date time. Okay. Okay, okay. And then,
  11335. 5:45:26we have to format it, right?
  11336. 5:45:28Right here. Yeah, format. And now, it's
  11337. 5:45:30asking me to format it in the right way.
  11338. 5:45:32In this case, you see the result. The
  11339. 5:45:33way that this is set up, we just added
  11340. 5:45:35the formula.
  11341. 5:45:36WW MM DD will result in this.
  11342. 5:45:40Uh in this case, I probably wouldn't
  11343. 5:45:41want it like that. Um
  11344. 5:45:43let me just go to the formatting guide,
  11345. 5:45:44which will show me exactly the kind of
  11346. 5:45:46format that I need to add. But, this
  11347. 5:45:48looks crazy with the
  11348. 5:45:50with the color that I have. Um
  11349. 5:45:53In this case, we want
  11350. 5:45:55We can do this. Uh August 6th. Let me do
  11351. 5:45:57FF.
  11352. 5:46:00So, if I do FF here,
  11353. 5:46:02it should show Yeah, 20th of August 2025
  11354. 5:46:05at 6:20. Yeah, that's perfect. Uh now,
  11355. 5:46:07if I execute the step, which will use
  11356. 5:46:09the previous variables to actually add
  11357. 5:46:10it to the sheet. I go here, I can see
  11358. 5:46:13that the responses were added here.
  11359. 5:46:16Okay? So, JM Solution, this, this, and
  11360. 5:46:18then we also have the date. Let's space
  11361. 5:46:19this out, and then that's good. All
  11362. 5:46:20right, cool. So, now that we have this,
  11363. 5:46:22we can go to our next step, which is
  11364. 5:46:23actually making the sales email. So, in
  11365. 5:46:25order for us to make the sales email,
  11366. 5:46:27we have to use a agent. Okay, there's a
  11367. 5:46:30few reasons why. Um
  11368. 5:46:32we typically would have like this is a
  11369. 5:46:34agent workflow because we're we're also
  11370. 5:46:36formatting the email. I know exactly
  11371. 5:46:38what it means. But,
  11372. 5:46:40if you go to AI, you can either use an
  11373. 5:46:41agent or you can just simply use an LLM.
  11374. 5:46:43I typically use an agent because we're
  11375. 5:46:44doing different actions with the with
  11376. 5:46:46the thing. Like, we're we're not just
  11377. 5:46:47telling the agent write the email, but
  11378. 5:46:48we're also telling it, "Hey, format it."
  11379. 5:46:50And AI agents are usually very good at
  11380. 5:46:52taking something and then doing
  11381. 5:46:53something with it. Um
  11382. 5:46:55as in, doing different actions. So, I'm
  11383. 5:46:56going to press AI agent to connect this
  11384. 5:46:58step to here. And now, I'm going to
  11385. 5:47:00rename this
  11386. 5:47:01sales. So, first
  11387. 5:47:04sales agent.
  11388. 5:47:06Sales email agent.
  11389. 5:47:08rename And now I have to connect this to
  11390. 5:47:10three different things. Uh and I have to
  11391. 5:47:11put a prompt inside, which is the main
  11392. 5:47:13thing. Um so here chat model will be
  11393. 5:47:16OpenAI.
  11394. 5:47:18To connect your OpenAI here, create a
  11395. 5:47:20new credential, you have to go to
  11396. 5:47:21platform. The open ai.com sign up to
  11397. 5:47:24login.
  11398. 5:47:26I want to show you everything cuz I feel
  11399. 5:47:27like this is one of the things that uh
  11400. 5:47:29it's like the small things that actually
  11401. 5:47:30matter when you build automations.
  11402. 5:47:31Dashboard
  11403. 5:47:32go to API keys.
  11404. 5:47:34Create an API key. Name it whatever you
  11405. 5:47:35want, right? Then you have So let's
  11406. 5:47:37actually do it. Human in the loop
  11407. 5:47:41agent YouTube
  11408. 5:47:43Create a secret key. Don't want Don't
  11409. 5:47:44worry about any of this. This is the API
  11410. 5:47:46key. So save this cuz you're not going
  11411. 5:47:47to be able to reaccess it unless you
  11412. 5:47:50make a new one. Um so we go back to n8n.
  11413. 5:47:53API key paste it here, then you save it,
  11414. 5:47:55and then it will automatically be
  11415. 5:47:56connected, okay?
  11416. 5:47:58Close. All right, cool. Then you want to
  11417. 5:47:59connect it to 4.1 mini, that's fine.
  11418. 5:48:02And actually we have to go inside the
  11419. 5:48:03agent first before we do the other ones.
  11420. 5:48:05Let me go inside. And now we have to do
  11421. 5:48:06a few things. Uh the first thing is
  11422. 5:48:08source for prompt. So this is asking us
  11423. 5:48:09what is that thing that's going into the
  11424. 5:48:11AI agent every single time. Uh in this
  11425. 5:48:13case, it would be the the details of the
  11426. 5:48:17lead, right? Which will be the details
  11427. 5:48:19of the form. Um which is why we have to
  11428. 5:48:20change this. So this right here, it says
  11429. 5:48:22connected chat trigger node. This means
  11430. 5:48:24that usually when you have an AI agent,
  11431. 5:48:25you chat to it and then it does
  11432. 5:48:26something, uh which is why we're using
  11433. 5:48:28chat trigger node. But in this case,
  11434. 5:48:29we're using a form. So we have to change
  11435. 5:48:31this to define below.
  11436. 5:48:33And now here we have to add the things
  11437. 5:48:35that are going into the agent every
  11438. 5:48:36single time. Uh so I can go here to
  11439. 5:48:38expression.
  11440. 5:48:40Go full screen. And now I can add the
  11441. 5:48:42lead details to the form. So in this
  11442. 5:48:44case it can be
  11443. 5:48:46Here's the lead.
  11444. 5:48:48Here's the
  11445. 5:48:50Yeah, here's the new lead intake
  11446. 5:48:52information.
  11447. 5:48:54Then we can start adding it. So full
  11448. 5:48:55name
  11449. 5:48:58right here.
  11450. 5:48:59Yeah.
  11451. 5:49:00We're going to cross. Email
  11452. 5:49:03company name
  11453. 5:49:06budget
  11454. 5:49:08project description
  11455. 5:49:12timeline
  11456. 5:49:14And then I also want to add something
  11457. 5:49:16else later on. Uh but email goes here.
  11458. 5:49:18Company name goes here.
  11459. 5:49:20Budget goes here.
  11460. 5:49:23Project description goes here.
  11461. 5:49:25All right, so uh the reason why And now
  11462. 5:49:27this is basically changing every single
  11463. 5:49:29time. So these variables will change as
  11464. 5:49:30the form submissions change, uh which is
  11465. 5:49:32what we want because they want the sales
  11466. 5:49:34email to be different every single time
  11467. 5:49:35for every lead. Um but the reason we're
  11468. 5:49:37putting it in the user message is
  11469. 5:49:39because in the user message we add the
  11470. 5:49:40things that change. The system message,
  11471. 5:49:42which is what we find here system
  11472. 5:49:44message. This is what we tell the AI
  11473. 5:49:46agent what it needs to do, right? In
  11474. 5:49:48general and the identity that it has. So
  11475. 5:49:50if I go here, I can now start adding the
  11476. 5:49:52system message. I'm going to go here.
  11477. 5:49:54This is a prompt that we're going to
  11478. 5:49:55give the agent for it to think through
  11479. 5:49:57what it needs to do and what it is. I'm
  11480. 5:49:59going to copy the prompt from the other
  11481. 5:50:00agent that I built before and paste it
  11482. 5:50:02here.
  11483. 5:50:03Uh and by the way, you can either take a
  11484. 5:50:04screenshot and put it through ChatGPT
  11485. 5:50:05and tell it, "Hey, can you transcribe
  11486. 5:50:06this?" Or I'm going to show you after at
  11487. 5:50:08the end what how you can get the whole
  11488. 5:50:09resource for free, the whole blueprint,
  11489. 5:50:10so don't worry. Um but this basically
  11490. 5:50:13saying, "You are an expert salesperson
  11491. 5:50:15for an agency that delivers AI
  11492. 5:50:15solutions. Your job is to respond to
  11493. 5:50:17incoming leads by addressing their needs
  11494. 5:50:19in a professional manner. You will
  11495. 5:50:20receive an information that looks like a
  11496. 5:50:21lead project description and timeline,
  11497. 5:50:23and your goal is to convince them and
  11498. 5:50:24let them uh let them know that we are
  11499. 5:50:26the best AI agency on the market." The
  11500. 5:50:28projects uh so the tools, right? So this
  11501. 5:50:30is the typical structure that we have.
  11502. 5:50:31We have overview. We have the tools that
  11503. 5:50:33are connected to the agent. Then we have
  11504. 5:50:35the rules.
  11505. 5:50:36Now
  11506. 5:50:37I'm going to explain to this I'm going
  11507. 5:50:38to explain to you what it is, something
  11508. 5:50:40we forgot to add to the Miro right here.
  11509. 5:50:43When the first agent actually um is
  11510. 5:50:45doing cuz we want the agent to be
  11511. 5:50:47connected to
  11512. 5:50:49the Google Sheet
  11513. 5:50:52with project results.
  11514. 5:50:55Because we want to incorporate results
  11515. 5:50:57to our email. So we we don't want to
  11516. 5:50:58say, "Hey, thanks for filling out the
  11517. 5:51:00form. We can definitely help." We want
  11518. 5:51:02to say, "Hey, I saw that you do it a
  11519. 5:51:03lead generation I saw that you're
  11520. 5:51:04looking for lead generation project."
  11521. 5:51:05"We actually did a lead generation
  11522. 5:51:06project for John a few months ago and we
  11523. 5:51:08got these results. We can help you,
  11524. 5:51:10right?" So it's always good to
  11525. 5:51:12incorporate proof into what you're
  11526. 5:51:13doing. Um
  11527. 5:51:15So we want to connect this to Google
  11528. 5:51:16Sheet.
  11529. 5:51:18We want to connect this as well to Let's
  11530. 5:51:20leave this to Google Sheet, right? So in
  11531. 5:51:21this case
  11532. 5:51:23uh that's why we see the projects. So
  11533. 5:51:25this is the tool that's Google Sheets in
  11534. 5:51:27this case where it gets the different
  11535. 5:51:29rows from our Google Sheets to then give
  11536. 5:51:31to the AI agent uh for it to to actually
  11537. 5:51:33use to make the email. Um we say use
  11538. 5:51:36this tool to search through the previous
  11539. 5:51:36project we've done that can be included
  11540. 5:51:38in the Okay, cool. So before So to
  11541. 5:51:40actually make the tool, we have to make
  11542. 5:51:41the sheet. Because right here is the
  11543. 5:51:43intake.
  11544. 5:51:44But then right here is the projects.
  11545. 5:51:47So what we want here is a way for the
  11546. 5:51:49agent to pull projects in or pull
  11547. 5:51:51results that we've done before. So what
  11548. 5:51:54I'm going to do is I'm going to copy the
  11549. 5:51:57um the results I had before. And bear in
  11550. 5:51:59mind, this is something that the company
  11551. 5:52:00can start adding every single time after
  11552. 5:52:03after a minute. It'll The agent will
  11553. 5:52:05always be automatically uh updating as
  11554. 5:52:07in it will take all the rows that are
  11555. 5:52:08here. So if you keep adding, that's
  11556. 5:52:09fine. It will keep on updating
  11557. 5:52:11whatever's here. Um and again, these are
  11558. 5:52:13the projects that are going to be
  11559. 5:52:14included when the agent needs to refer
  11560. 5:52:16to Let's say someone said lead gen, it
  11561. 5:52:18will use this example for result in lead
  11562. 5:52:21gen project. Same thing with general
  11563. 5:52:23tech, onboarding content, and whatever
  11564. 5:52:24it is. So actually now that I start to
  11565. 5:52:26think about it
  11566. 5:52:28we forgot to add
  11567. 5:52:30the intent. Um
  11568. 5:52:32Okay.
  11569. 5:52:34Which is
  11570. 5:52:36drop down
  11571. 5:52:38lead generation
  11572. 5:52:42Then we have content creation.
  11573. 5:52:48And this is something that happens,
  11574. 5:52:49right? You just think through it,
  11575. 5:52:50forget. Um that's why I want to show you
  11576. 5:52:52the raw version of me building
  11577. 5:52:53automations cuz that's what actually
  11578. 5:52:55drives value to people. Uh onboarding
  11579. 5:52:57automation
  11580. 5:52:58Uh let's do general
  11581. 5:53:01uh general automation support.
  11582. 5:53:07All right, so um yeah, this is
  11583. 5:53:08definitely needed when we have to give
  11584. 5:53:10to the agent for it to pull information
  11585. 5:53:11from the Google Sheet. Um so
  11586. 5:53:14let's rerun this. Let me actually update
  11587. 5:53:15this. Uh let me go here.
  11588. 5:53:17Let me do
  11589. 5:53:20intent.
  11590. 5:53:22Actually, let me
  11591. 5:53:26So I have to shift this and then put
  11592. 5:53:28here.
  11593. 5:53:29Let me run this first.
  11594. 5:53:34Let me just fast forward to me filling
  11595. 5:53:35it up.
  11596. 5:53:50All right, so I submitted the form. Now
  11597. 5:53:51we have this data to to work with. We
  11598. 5:53:53can pin it, right? Pinning it just means
  11599. 5:53:54that we don't have to rerun the form
  11600. 5:53:56every single time to execute the next um
  11601. 5:53:58nodes, the automation. We can use this
  11602. 5:54:00as test data for previous for the next
  11603. 5:54:01steps. And now we want to add this to
  11604. 5:54:04Let me refresh this.
  11605. 5:54:07Okay, we This is good. Uh intent will be
  11606. 5:54:09going here. Okay?
  11607. 5:54:12Cool. So now we also want to give it the
  11608. 5:54:13intent. So let me go here. Let me say
  11609. 5:54:16intent.
  11610. 5:54:18Submission, we can put intent here.
  11611. 5:54:21All right, cool. Now we want to go here.
  11612. 5:54:23And now because we are able to give the
  11613. 5:54:26intent to the the agent, now I can use
  11614. 5:54:28the projects, right? Because the intent
  11615. 5:54:31is what's linked to here, to the
  11616. 5:54:32projects.
  11617. 5:54:33Perfect. Um Okay. So let's go here.
  11618. 5:54:37We also give it some rules. So keep the
  11619. 5:54:39email concise and professional under 100
  11620. 5:54:40words. This comes from reactive
  11621. 5:54:42prompting rather than active prompting,
  11622. 5:54:44which is means that we prompt as we get
  11623. 5:54:46errors, we prompt as we iterate as
  11624. 5:54:48feedback as we get feedback. And
  11625. 5:54:49feedback only comes from actually using
  11626. 5:54:50the automation, actually running it. Um
  11627. 5:54:52we give it a few objectives. Retrieve
  11628. 5:54:54information about the projects with the
  11629. 5:54:55lead to prove that the team is capable.
  11630. 5:54:57Okay, so this is this is the part where
  11631. 5:54:58we tell it to use previous projects'
  11632. 5:55:00results to give in the email. Always
  11633. 5:55:02write the email in HTML um because
  11634. 5:55:05Gmail, to make it look pretty, so to
  11635. 5:55:07make it look like this with new lines.
  11636. 5:55:09This is called new line, one and two, uh
  11637. 5:55:11spaces between lines. We use something
  11638. 5:55:13called HTML tags.
  11639. 5:55:14So break, so this right here, BR, really
  11640. 5:55:17stands for break. Right? And that's why
  11641. 5:55:19we add one.
  11642. 5:55:20That will just do a new line. If you add
  11643. 5:55:22two, that will be two new lines, one,
  11644. 5:55:24two. Okay, so this is very important. Um
  11645. 5:55:26and then do not add emojis in email.
  11646. 5:55:27Yeah, don't like Definitely do not add
  11647. 5:55:29emojis cuz in the sales emails, emojis
  11648. 5:55:31are the worst thing you can add. Um
  11649. 5:55:33perfect. Uh we're going to use this
  11650. 5:55:35later on, but don't worry about it now.
  11651. 5:55:36Uh now we can connect this to
  11652. 5:55:39the Google Sheets. So
  11653. 5:55:42Let me go to Google Sheets.
  11654. 5:55:43Google Sheets tool, connection we did
  11655. 5:55:45all this we already did. The resource
  11656. 5:55:47will be um yeah, the resource will be
  11657. 5:55:49sheet within document, and we can get
  11658. 5:55:51rows.
  11659. 5:55:52So when I get the rows, when I get
  11660. 5:55:53these, then we're going to let the AI
  11661. 5:55:55actually think through which result
  11662. 5:55:56which project it needs to use to then
  11663. 5:55:59make the sales email. So the sheet
  11664. 5:56:00document will be
  11665. 5:56:01CRM YouTube Human in the Loop Agent. The
  11666. 5:56:04sheet will be projects.
  11667. 5:56:07I'm going to leave this empty. So
  11668. 5:56:08execute step.
  11669. 5:56:11And now I'll see how it got the three
  11670. 5:56:13different uh four different rows.
  11671. 5:56:16Lead gen
  11672. 5:56:17responses
  11673. 5:56:18onboarding or content onboarding and
  11674. 5:56:20general tech. Right? Now to That's what
  11675. 5:56:21we're going to use to actually make the
  11676. 5:56:22email to incorporate the results into
  11677. 5:56:24the email.
  11678. 5:56:25All right, cool. So now that we did
  11679. 5:56:26this, we can now um I'm going to show
  11680. 5:56:29you exactly
  11681. 5:56:31why we have to add something else to the
  11682. 5:56:32agent because it's a bit more technical,
  11683. 5:56:34um but it's actually very very easy to
  11684. 5:56:35understand once you see why we need it
  11685. 5:56:37in the first place. So I'm going to run
  11686. 5:56:38this.
  11687. 5:56:40I'm going to show you exactly what we
  11688. 5:56:42need this for.
  11689. 5:56:43This agent right here
  11690. 5:56:45what it did is that it just wrote the
  11691. 5:56:47email. Okay? So Dear Mr. Kelly, we
  11692. 5:56:49specialize in custom AI-driven lead
  11693. 5:56:51generation systems and understand and
  11694. 5:56:52all that. Okay. The only problem with
  11695. 5:56:53this is that we
  11696. 5:56:56don't get the subject line and we don't
  11697. 5:56:57get the body of the email in two
  11698. 5:56:59different
  11699. 5:57:01Yeah, in two different uh variables. So,
  11700. 5:57:02if I paste this all into Gmail, there
  11701. 5:57:05will be no subject line. So, for us to
  11702. 5:57:07be able
  11703. 5:57:08to make an email that has a subject line
  11704. 5:57:10and an email body, we need it to be in a
  11705. 5:57:11very specific format.
  11706. 5:57:13Right? That's why we pressed we toggle
  11707. 5:57:15this on, which is required specific
  11708. 5:57:16output format, because you want the
  11709. 5:57:17subject line and the email to be in two
  11710. 5:57:20different variables.
  11711. 5:57:21So, once this is turned on, we have a
  11712. 5:57:23new option here, which is output parser.
  11713. 5:57:26We can just press this, structured
  11714. 5:57:28output parser, and don't worry um I'm
  11715. 5:57:30going to copy what I had before.
  11716. 5:57:33But, when you get the blueprint, you can
  11717. 5:57:34um you can directly have it.
  11718. 5:57:36But, what I'm basically saying is
  11719. 5:57:38let me just copy this.
  11720. 5:57:42That I want
  11721. 5:57:43the first property, so the first
  11722. 5:57:45variable here is subject line, which is
  11723. 5:57:47the subject line of the email, and then
  11724. 5:57:48the email body, which is the body of the
  11725. 5:57:50email, and then the required is for
  11726. 5:57:52subject line and the email body.
  11727. 5:57:53So, we want the actual output format to
  11728. 5:57:55be in a subject line and the body of the
  11729. 5:57:56email. So, let me show you the
  11730. 5:57:57difference now
  11731. 5:57:58when I run this.
  11732. 5:58:02Okay, let's see why there's an error.
  11733. 5:58:04All right, so after some error handling,
  11734. 5:58:05uh I realized that the code here was
  11735. 5:58:07wrong. I actually just pasted the right
  11736. 5:58:08one. Um so, in this case again, it was
  11737. 5:58:10just a few tweaks. A subject is subject
  11738. 5:58:13line, and then we have email body,
  11739. 5:58:15required. Again, if you have the the
  11740. 5:58:16whole setup, you can just have it here.
  11741. 5:58:18I don't worry. But, you want to make
  11742. 5:58:19sure that this is right. And by the way,
  11743. 5:58:20if you ask me, how did I get this code?
  11744. 5:58:22You can simply go to ChatGPT and you can
  11745. 5:58:24say, "Hey, I'm feeding the AI I'm
  11746. 5:58:26feeding the code parser an email with a
  11747. 5:58:28subject line and the body together. I
  11748. 5:58:30want to output it as two different
  11749. 5:58:32variables. One is subject, one is email
  11750. 5:58:33body." And it will give you this code
  11751. 5:58:34right here. So, you can see here we have
  11752. 5:58:36a subject line, and we have an email
  11753. 5:58:38body. Okay?
  11754. 5:58:40So, now we can go to the next step. The
  11755. 5:58:41next step is actually
  11756. 5:58:43setting this. So, setting the edit
  11757. 5:58:45fields set. Why do we do this? It's
  11758. 5:58:47because
  11759. 5:58:49ideally, when we go to the next step,
  11760. 5:58:50which is human in the loop agent, which
  11761. 5:58:52is what you're here for,
  11762. 5:58:53is we get the feedback, and then we get
  11763. 5:58:56the intent of the feedback. If it's
  11764. 5:58:57positive, we send it to the customer. If
  11765. 5:58:58it's negative, then we reroute it back.
  11766. 5:59:00But, the only problem is is that we want
  11767. 5:59:02to route the same variable back to the
  11768. 5:59:04agent or back to the human in the loop
  11769. 5:59:06agent. So, it's better if I show you
  11770. 5:59:08rather than tell you, uh cuz it makes
  11771. 5:59:09much more sense. But, in this case,
  11772. 5:59:11let's just set two variables, which is
  11773. 5:59:13subject.
  11774. 5:59:15I'm going to press here,
  11775. 5:59:17which in this case is JSON output
  11776. 5:59:18subject,
  11777. 5:59:20and
  11778. 5:59:21email body.
  11779. 5:59:22All right, which is email
  11780. 5:59:26body.
  11781. 5:59:27Okay, so these are the two different
  11782. 5:59:28variables.
  11783. 5:59:29Uh now, when we route it back to the
  11784. 5:59:31agent that actually has to do the
  11785. 5:59:32revision, we loop it back here. Okay, we
  11786. 5:59:34loop it back here for it to use these
  11787. 5:59:36variables to um to reroute it back.
  11788. 5:59:38Okay. So, now that we have the variables
  11789. 5:59:40set, we can then go to the human in the
  11790. 5:59:42loop element.
  11791. 5:59:43So, human in the loop will be
  11792. 5:59:46um human in the loop right here.
  11793. 5:59:48And you can see we don't have only
  11794. 5:59:49email, we have Google Chat, we have
  11795. 5:59:50Outlook, we have different softwares. In
  11796. 5:59:52this case, we are using Gmail, so we can
  11797. 5:59:54go here.
  11798. 5:59:55To connect your Gmail to N and N, we
  11799. 5:59:56have to go here, sign in with Google. It
  11800. 5:59:58will take you through the same thing
  11801. 5:59:59that we went through before.
  11802. 6:00:01Message, send, and waiting for response.
  11803. 6:00:03That's that's the thing that is human in
  11804. 6:00:05the loop. The email is who are we
  11805. 6:00:07sending the email to for it to give us
  11806. 6:00:08feedback. In this case, we can put my
  11807. 6:00:09email.
  11808. 6:00:11If I go here, uh on the email, I think
  11809. 6:00:13we added action required, new lead with
  11810. 6:00:15budget. Okay, so we put the budget here.
  11811. 6:00:16And then, here we put, "Hey Michele, we
  11812. 6:00:19have a new lead for you. Okay, we need
  11813. 6:00:20project description and the email
  11814. 6:00:21drafted." Okay, cool. So, here, subject
  11815. 6:00:24line will be this, new lead with budget
  11816. 6:00:26of
  11817. 6:00:27and this variable will be changed,
  11818. 6:00:28because that's the thing that changes
  11819. 6:00:29every single time.
  11820. 6:00:31Add fields.
  11821. 6:00:32No, it's actually form submissions.
  11822. 6:00:34I can go to budget right here. So, it
  11823. 6:00:36will change. And then, the message, like
  11824. 6:00:39I mentioned before, is, "Hey Michele,
  11825. 6:00:43we have a new
  11826. 6:00:45lead
  11827. 6:00:46form submission.
  11828. 6:00:50Please revise the email
  11829. 6:00:52and give feedback
  11830. 6:00:55on the
  11831. 6:00:56copy."
  11832. 6:00:57So, in this case, we can just add two
  11833. 6:01:00So, this just it's just two headings,
  11834. 6:01:01heading two. We can do project
  11835. 6:01:04description. So, the internal team knows
  11836. 6:01:06has a context to what we're giving
  11837. 6:01:08feedback on.
  11838. 6:01:09Project will be here.
  11839. 6:01:11And now, we can add the email. So,
  11840. 6:01:13subject I would add the subject line.
  11841. 6:01:17Subject. Actually, I do
  11842. 6:01:19email.
  11843. 6:01:22Uh
  11844. 6:01:24I think this would work with markdown.
  11845. 6:01:26This is markdown format. Um
  11846. 6:01:27subject line will be
  11847. 6:01:29used.
  11848. 6:01:32Which is this.
  11849. 6:01:36And we have email body.
  11850. 6:01:42Which is this.
  11851. 6:01:43Let's test this. Uh let's see if it
  11852. 6:01:45works, how it works, uh when it works,
  11853. 6:01:47why it works. So, waiting for input.
  11854. 6:01:49Um
  11855. 6:01:50okay, cool.
  11856. 6:01:51So, now we go here.
  11857. 6:01:53You can see Okay, so this didn't work.
  11858. 6:01:55So, we we have to take this out. Um
  11859. 6:01:58I can go here, I can see that we got the
  11860. 6:01:59email. So, it's all good. Okay, perfect.
  11861. 6:02:01Um okay, I also realized just now
  11862. 6:02:04that
  11863. 6:02:05So, let me just give me feedback so that
  11864. 6:02:07I can I can approve.
  11865. 6:02:10Perfect. Um
  11866. 6:02:12I realized that this
  11867. 6:02:15So, email doesn't As I just mentioned
  11868. 6:02:17before, email needs HTML, not um
  11869. 6:02:20it needs HTML, not markdown format. This
  11870. 6:02:21is markdown.
  11871. 6:02:22In order to put HTML, so in order to put
  11872. 6:02:24heading two on HTML, we have to use
  11873. 6:02:26this.
  11874. 6:02:28Uh here, and then to close it, we have
  11875. 6:02:30to use this, slash forward slash.
  11876. 6:02:33And then, same thing with this.
  11877. 6:02:39And then, we can just remove this. I
  11878. 6:02:40don't think we need it.
  11879. 6:02:42Output body.
  11880. 6:02:44Yeah, that's fine.
  11881. 6:02:45Okay.
  11882. 6:02:46Um okay, put And then, we can add,
  11883. 6:02:48"Please provide feedback on the email
  11884. 6:02:53if you have." Actually, no, previous if
  11885. 6:02:54you have.
  11886. 6:02:58Perfect. Now, as you can see, when I
  11887. 6:03:00went to the email, it actually just
  11888. 6:03:01asked me to approve. But, in this case,
  11889. 6:03:03we want to leave space for feedback. So,
  11890. 6:03:04in this case, we have want to add free
  11891. 6:03:06text.
  11892. 6:03:07So, what this means is that when he
  11893. 6:03:08sends us the email to revise, we don't
  11894. 6:03:10just press approve. We can also press
  11895. 6:03:12approve and deny, right?
  11896. 6:03:14But, we
  11897. 6:03:16want to add uh text. We want to add
  11898. 6:03:18feedback. So, we can say, "Hey, change
  11899. 6:03:20this, change that." And then, it will
  11900. 6:03:21then send it to the agent to revise it
  11901. 6:03:23and then change it, right? Um this free
  11902. 6:03:25text is what we need.
  11903. 6:03:27I want to take off append N and N
  11904. 6:03:29contribution, which is just this.
  11905. 6:03:33Automated N and
  11906. 6:03:34saying, "Hey, N and I did this."
  11907. 6:03:36Um so, we can do this. We can execute
  11908. 6:03:38the step again.
  11909. 6:03:40And now, if I get the email,
  11910. 6:03:42I can see that it says respond.
  11911. 6:03:45And the response,
  11912. 6:03:46now I can give feedback. Okay, so I can
  11913. 6:03:48say,
  11914. 6:03:49"Hey,
  11915. 6:03:50uh this needs to be more concise
  11916. 6:03:54and professional."
  11917. 6:03:57Submit. And now, that's the feedback
  11918. 6:03:59that's going to come through. So, hey,
  11919. 6:04:00this needs to be concise and
  11920. 6:04:01professional. So, ideally, we want to
  11921. 6:04:02then talk to the other agent, give it
  11922. 6:04:03the email that we drafted right now,
  11923. 6:04:05give it the feedback, and then let it
  11924. 6:04:06revise and then do the whole thing
  11925. 6:04:07again, and make it a repetitive loop.
  11926. 6:04:09Okay? So, now that we have the feedback,
  11927. 6:04:12as I mentioned on the mirror before,
  11928. 6:04:14we want to send it to the feedback
  11929. 6:04:16intent agent. So, so first, let's rename
  11930. 6:04:19this to
  11931. 6:04:20human
  11932. 6:04:23in the loop.
  11933. 6:04:28Rename.
  11934. 6:04:29Uh and then, now I can send it to the
  11935. 6:04:31text classifier. Cuz the text classifier
  11936. 6:04:33on N and N basically takes text and
  11937. 6:04:35classifies basically says, "Hey, based
  11938. 6:04:38on the text, this is what it is." Um
  11939. 6:04:39based on the options that we give it,
  11940. 6:04:40the categories, right? Um okay. So,
  11941. 6:04:44text classifier would be
  11942. 6:04:46the
  11943. 6:04:47this right here would be the text to
  11944. 6:04:49classify, which would be the the
  11945. 6:04:50feedback that we give it. And then,
  11946. 6:04:52there will be two categories. One is
  11947. 6:04:53approved and one is denied, right? So,
  11948. 6:04:55approve.
  11949. 6:04:57And then, let me just copy the
  11950. 6:04:58description from the agent that I built
  11951. 6:04:59this for.
  11952. 6:05:01Go here. I say the sales agent approved
  11953. 6:05:03the email accepted the way it was
  11954. 6:05:04written. The text that we're classifying
  11955. 6:05:06intends that it was accepted and that
  11956. 6:05:08everything was uh good. Example output,
  11957. 6:05:11yes,
  11958. 6:05:12that's fine.
  11959. 6:05:14Looks good.
  11960. 6:05:15Send it through. Now, this came from
  11961. 6:05:16actually testing, because
  11962. 6:05:18how does it The text classifier isn't
  11963. 6:05:20always 100% correct, right? Sometimes we
  11964. 6:05:22give it something, we say, "Hey, can you
  11965. 6:05:23change this part?" But, it assumes that
  11966. 6:05:25we accepted it, so it sends it to the
  11967. 6:05:26lead. Uh we want to make sure that we
  11968. 6:05:28give it examples of what someone might
  11969. 6:05:29say as a way for them to reference
  11970. 6:05:31whether it's accepted or denied. Um so,
  11971. 6:05:33that's why we had the examples.
  11972. 6:05:35And then, category will be denied,
  11973. 6:05:38which will be
  11974. 6:05:39the uh right here, expression. Let me go
  11975. 6:05:42here.
  11976. 6:05:43Here. The sales agent denied the email
  11977. 6:05:45and denied the way it was written. Uh
  11978. 6:05:46the text that we're classifying intends
  11979. 6:05:49that it needs updating or changing,
  11980. 6:05:50usually usually.
  11981. 6:05:52Um we'll provide it feedback on how to
  11982. 6:05:54do so, and then we give it a few
  11983. 6:05:55examples.
  11984. 6:05:56So, make it shorter.
  11985. 6:05:58I don't like it.
  11986. 6:06:00It's too long. Include other projects.
  11987. 6:06:02And no. So, these are
  11988. 6:06:05various things that you would um ask the
  11989. 6:06:07agent or you would tell the agent, and
  11990. 6:06:08then we tell it, "Hey, based on these
  11991. 6:06:11sort of examples, this is the denied
  11992. 6:06:13path." Now, [snorts] okay, this is good.
  11993. 6:06:15Um so, now, as you can see, we now have
  11994. 6:06:17two different paths. So, then we can go
  11995. 6:06:19to decide where we send the email to the
  11996. 6:06:20lead, and then the denied path where we
  11997. 6:06:22have to make the agent to revise. Uh
  11998. 6:06:23but, before we do that, we have to add a
  11999. 6:06:25model, because this thing's through an
  12000. 6:06:26AI. So, the model here will be
  12001. 6:06:29uh OpenAI model.
  12002. 6:06:31Again, we already connected it, so 4.1
  12003. 6:06:32mini is fine. And now that we
  12004. 6:06:33categorized the different types of
  12005. 6:06:35responses based on what's approved and
  12006. 6:06:36what's denied, we can now send it two
  12007. 6:06:38different ways. So,
  12008. 6:06:40let's do the easy one first, which is
  12009. 6:06:41approved. In this case, we just um use a
  12010. 6:06:44Gmail node to send it to the customer.
  12011. 6:06:46So, create
  12012. 6:06:48send a message? Yeah, send a message.
  12013. 6:06:50Um you already connected it, message
  12014. 6:06:51send to
  12015. 6:06:53in this case, we have to execute
  12016. 6:06:54previous nodes.
  12017. 6:06:56Uh okay, let me just add test email.
  12018. 6:07:04Subject line will be hello. Let me just
  12019. 6:07:06change this real quick later.
  12020. 6:07:09Uh, let me just run this.
  12021. 6:07:13Okay.
  12022. 6:07:14Pin this.
  12023. 6:07:17And then, now I believe that we have
  12024. 6:07:20Okay, we don't have data here. So, let
  12025. 6:07:21me just run this again.
  12026. 6:07:24Go here. It's my email.
  12027. 6:07:32Make it shorter.
  12028. 6:07:33Now, this right here I can pin.
  12029. 6:07:36And now I can use this. Okay? So, I can
  12030. 6:07:38use this to say for to classify whether
  12031. 6:07:40it's denied or approved. So, as you can
  12032. 6:07:41see, it went down the denied path
  12033. 6:07:43because we said make it shorter, we give
  12034. 6:07:44it feedback.
  12035. 6:07:46Um, okay. So, now we're here, I can then
  12036. 6:07:48pull information from the form.
  12037. 6:07:50It'll be email, which will be subject
  12038. 6:07:52line will be in this one right here.
  12039. 6:07:55Subject line.
  12040. 6:07:57Actually, need to remove hello first.
  12041. 6:08:01And then the body of the email, which in
  12042. 6:08:02this case again, it's HTML.
  12043. 6:08:04We can also put text, but we're using
  12044. 6:08:05HTML um, for this for the actual
  12045. 6:08:08message.
  12046. 6:08:10Okay? So, now if I test this,
  12047. 6:08:13Okay, I actually didn't get it for some
  12048. 6:08:14reason. I didn't get any email. Let me
  12049. 6:08:15try again to see if it works this time.
  12050. 6:08:19Okay, I think it's because it didn't go
  12051. 6:08:21down this path, but
  12052. 6:08:23or it's because these are pinned. Let me
  12053. 6:08:25just unpin this. Do each one
  12054. 6:08:26individually.
  12055. 6:08:28By the way, I'm just pressing P when I
  12056. 6:08:29hover over this.
  12057. 6:08:30I can try rerun this.
  12058. 6:08:34Okay, let me just go through the whole
  12059. 6:08:35phase. Um,
  12060. 6:08:37right here.
  12061. 6:08:38Go here. I can get an email. I can say
  12062. 6:08:40yes.
  12063. 6:08:43Looks good.
  12064. 6:08:44Submit. Go back. And now because it's
  12065. 6:08:46approved, it will go down this path.
  12066. 6:08:47Okay, cool. That's why. Uh, because the
  12067. 6:08:49text that we gave it before was the
  12068. 6:08:50denied path.
  12069. 6:08:52So, we go here.
  12070. 6:08:53Um, and then I can say we do usually
  12071. 6:08:55generation one week. We're specializing
  12072. 6:08:57developing new generation intelligent
  12073. 6:08:58systems for business. For instance, we
  12074. 6:08:59recently helped a real estate firm
  12075. 6:09:01generate 20 leads. Do you see how it
  12076. 6:09:02pulls in
  12077. 6:09:03these sort of projects? We recently
  12078. 6:09:04helped a firm generate 20 leads in 5
  12079. 6:09:06days after working with us, which
  12080. 6:09:08generated 100k pipeline. That's what it
  12081. 6:09:09uses
  12082. 6:09:11to uh, in the email, right? To generate
  12083. 6:09:13sort of authority and trust.
  12084. 6:09:15Uh, given your timeline and budget,
  12085. 6:09:16we're confident we can deliver. Okay.
  12086. 6:09:17Best regards. And now, this right here I
  12087. 6:09:19don't want. Okay, so this is where we go
  12088. 6:09:20here
  12089. 6:09:22to the email node and add options. We
  12090. 6:09:25can then, uh, append it we can turn this
  12091. 6:09:27off. Okay, append and end attribution.
  12092. 6:09:29Turn this off so that
  12093. 6:09:31we don't need um,
  12094. 6:09:32we don't have the sponsorship, which is
  12095. 6:09:34right here.
  12096. 6:09:36Okay. So, we're naming this to
  12097. 6:09:38send solely email.
  12098. 6:09:43And that's the first path for approved.
  12099. 6:09:44Uh, so the next step is the denied path.
  12100. 6:09:46So, in this case, we get the feedback
  12101. 6:09:47and then we give it to another agent to
  12102. 6:09:48revise it. Okay, so I'm going to press
  12103. 6:09:50add AI agent. In this case, we can name
  12104. 6:09:53it revision
  12105. 6:09:55agent.
  12106. 6:09:56We don't need to connect it to a chat
  12107. 6:09:57trigger node. I mean, we don't have it
  12108. 6:09:58connected, so we just have to define it
  12109. 6:09:59below. And the thing that we give it is
  12110. 6:10:02Let me go expression. Wait, is the
  12111. 6:10:04feedback and the email, right? So, it
  12112. 6:10:06knows the both of them. So, in this case
  12113. 6:10:08it will be feedback
  12114. 6:10:10received,
  12115. 6:10:13which will be this one here.
  12116. 6:10:15And the email body,
  12117. 6:10:17which will be this one here.
  12118. 6:10:20Right? And subject line.
  12119. 6:10:24So, we get it. Okay. Uh, and now we want
  12120. 6:10:26to give it a system message because we
  12121. 6:10:27want to take give it an identity in the
  12122. 6:10:28whole thing that we gave it before. The
  12123. 6:10:30only thing that changes now is the fact
  12124. 6:10:31that now it needs to revise. But it
  12125. 6:10:33still sends the it still does the actual
  12126. 6:10:35email. I'm just going to copy and paste
  12127. 6:10:36the prompt that I wrote before, uh, so
  12128. 6:10:38you don't have to waste time actually
  12129. 6:10:39writing it.
  12130. 6:10:40>> [snorts]
  12131. 6:10:41>> And I have you are helpful intelligent
  12132. 6:10:42email assistant who needs to update a
  12133. 6:10:43sales email based on the provided
  12134. 6:10:44feedback. When I add overview, which I
  12135. 6:10:46forgot to add. The tools is the same,
  12136. 6:10:48the rules are the same, and final notes
  12137. 6:10:50are the same. Um, okay, cool. And uh, we
  12138. 6:10:53still need to turn this on because we
  12139. 6:10:54still need it to be in a very specific
  12140. 6:10:56format. In this case, it's subject line
  12141. 6:10:57and email. Again, the only thing that
  12142. 6:10:59changes is that this makes a revision,
  12143. 6:11:01but the output is still the same, which
  12144. 6:11:02is an email. So, I'm going to put this
  12145. 6:11:04requires a specific format. And now, I
  12146. 6:11:06have to connect these to a chat model,
  12147. 6:11:08to a tool, and an output parser. The
  12148. 6:11:10good thing about N and N is that you
  12149. 6:11:11don't have to connect it again
  12150. 6:11:13to this to to a different thing. We can
  12151. 6:11:15use the previous
  12152. 6:11:16chat model, previous
  12153. 6:11:18tool, and the previous output parser.
  12154. 6:11:21Okay, so they're connected to the same
  12155. 6:11:22thing.
  12156. 6:11:23So, this goes here, uses these, then
  12157. 6:11:25goes here if it needs to go here, and
  12158. 6:11:27then uses this again. So, you don't have
  12159. 6:11:28to redo it. And I can press save.
  12160. 6:11:31And now, let's test it. So, let me go
  12161. 6:11:32here.
  12162. 6:11:34Let me use the feedback that we got uh,
  12163. 6:11:36from here.
  12164. 6:11:37Let me go here.
  12165. 6:11:39Hey Michele, we specialize in customized
  12166. 6:11:41lead generation systems. We recently
  12167. 6:11:42helped I told it to be more concise. I
  12168. 6:11:44think that's what Yeah, more concise and
  12169. 6:11:45professional.
  12170. 6:11:47We do a call to discuss how we can see.
  12171. 6:11:48Yeah, I think it's more concise.
  12172. 6:11:49Definitely more concise. I don't know
  12173. 6:11:50about professional. Um, but that's fine.
  12174. 6:11:52And now,
  12175. 6:11:53to make sure that we can send it back to
  12176. 6:11:55the human in the loop to make sure that
  12177. 6:11:56it's a whole repetitive process,
  12178. 6:11:58we have to
  12179. 6:11:59pin this across and put it in the edit
  12180. 6:12:01fields. Okay, so this is where it all
  12181. 6:12:03links together because we want it to be
  12182. 6:12:05a repetitive loop. So, we want to make
  12183. 6:12:07the email for the first agent, which
  12184. 6:12:08only writes the first email,
  12185. 6:12:10then send it to the human in the loop to
  12186. 6:12:11make sure that we revise.
  12187. 6:12:13If it's bad, it will revise it, send it
  12188. 6:12:16back again. If it's bad again, revise it
  12189. 6:12:18until we accept it. Okay, so it's a
  12190. 6:12:20whole repetitive process. So, there's no
  12191. 6:12:21human The only human in the loop is us
  12192. 6:12:24actually approving it or denying it. Uh,
  12193. 6:12:26but the automation is smart enough so
  12194. 6:12:28that we can loop it back. And the reason
  12195. 6:12:29why we're using this node right here,
  12196. 6:12:31which I explained before, is because the
  12197. 6:12:32output here,
  12198. 6:12:34subject and email body,
  12199. 6:12:35is the same
  12200. 6:12:37type of variables that we get here,
  12201. 6:12:38subject and email body. Okay, so this
  12202. 6:12:40basically gets the input from here and
  12203. 6:12:44from here, and they're all the same. The
  12204. 6:12:45only thing that changes is the actual
  12205. 6:12:46content, right? Uh, but the variable
  12206. 6:12:48name, the key, this is called the key,
  12207. 6:12:50is the same.
  12208. 6:12:51So, that's how we use that. Um, okay.
  12209. 6:12:54So, let me unpin this.
  12210. 6:12:55And we can run this from the start until
  12211. 6:12:56the end.
  12212. 6:12:58Save. Unpin this as well.
  12213. 6:13:01Save. And I can execute workflow. Let's
  12214. 6:13:03go here, and I can start filling out the
  12215. 6:13:05form.
  12216. 6:13:06James Michael.
  12217. 6:13:18Now, obviously this should be above. Um,
  12218. 6:13:20we can change it later in in the form,
  12219. 6:13:22but that's the whole form right there.
  12220. 6:13:23Submit.
  12221. 6:13:24Now, this starts the automation. Okay,
  12222. 6:13:26so it sends it to our CRM. So, if you go
  12223. 6:13:28here to uh, that was the old one.
  12224. 6:13:31To here.
  12225. 6:13:32C1.
  12226. 6:13:33James Michael, Media Corp, budget,
  12227. 6:13:35authority, uh, budget description,
  12228. 6:13:37timeline, intent, and date submitted.
  12229. 6:13:39It will now send it to us for revision.
  12230. 6:13:42Action required. Let's say we look at
  12231. 6:13:43this and we say,
  12232. 6:13:45respond.
  12233. 6:13:46We say,
  12234. 6:13:48>> [snorts]
  12235. 6:13:48>> you need to
  12236. 6:13:53ask him
  12237. 6:13:55at the end
  12238. 6:13:58to give you
  12239. 6:14:00a few times that work for them
  12240. 6:14:05next week for a call. Okay, so in this
  12241. 6:14:07case, it should send it to the denied
  12242. 6:14:09because we gave it feedback.
  12243. 6:14:10So, you see how it goes here. It will
  12244. 6:14:12use the AI.
  12245. 6:14:14It will use these tools as well. Send it
  12246. 6:14:15back. Another email.
  12247. 6:14:17So, could you please provide a few times
  12248. 6:14:18that work for you next week?
  12249. 6:14:20Let me say,
  12250. 6:14:22make this
  12251. 6:14:23a bit longer.
  12252. 6:14:25So, now when I submit it, it then goes
  12253. 6:14:26back to the same thing. You see how it's
  12254. 6:14:27a whole repetitive loop? It goes through
  12255. 6:14:29every single time. Um, and that's why
  12256. 6:14:31it's it's a great system to have because
  12257. 6:14:33it doesn't really end until you accept
  12258. 6:14:34it.
  12259. 6:14:35I go here again.
  12260. 6:14:37I can
  12261. 6:14:39respond
  12262. 6:14:40and say, yes.
  12263. 6:14:42All good.
  12264. 6:14:44Press submit. And now, because it's
  12265. 6:14:46approved, it then goes here. Okay, and
  12266. 6:14:48we get the email,
  12267. 6:14:50which is this. So, let's discuss your
  12268. 6:14:52AI-driven automation. It made it a bit
  12269. 6:14:54longer like we asked it to. It also made
  12270. 6:14:55the question here.
  12271. 6:14:56Um,
  12272. 6:14:58and it added the case study right here.
  12273. 6:15:01Okay, so that right there is One more
  12274. 6:15:04one step ahead that we can do is
  12275. 6:15:05actually make only the first name, not
  12276. 6:15:08the full name. So, let's just do that
  12277. 6:15:10right now.
  12278. 6:15:11Let me go here. Um,
  12279. 6:15:16Yeah, let me actually just put first
  12280. 6:15:18name. I think that would work in the
  12281. 6:15:19send. Yeah, I could do first name.
  12282. 6:15:25And I think this needs to be split.
  12283. 6:15:31I think it needs to be a space.
  12284. 6:15:35Yeah, and then I can
  12285. 6:15:37first.
  12286. 6:15:38So, this gets the first. Yeah, so this
  12287. 6:15:39gets James. So, a full name
  12288. 6:15:42is like this,
  12289. 6:15:43right?
  12290. 6:15:46And this is always good to know because
  12291. 6:15:47when you're building automations, you
  12292. 6:15:47want to have these sort of formulas uh,
  12293. 6:15:50at hand. So, the full name is first
  12294. 6:15:52name, space, last name. So, what we're
  12295. 6:15:53saying is split this by the space, so it
  12296. 6:15:55will be one and two, and I want the
  12297. 6:15:57first. So, it comes here.
  12298. 6:15:58The split with space, space here, and
  12299. 6:16:00then I want the first. If I said last,
  12300. 6:16:02it will get the last name. So, let me
  12301. 6:16:03say,
  12302. 6:16:05last. It will get Michael, right? James
  12303. 6:16:07Michael. Or Michele Torti. I mean, in
  12304. 6:16:08this case it would
  12305. 6:16:10because the full name is James Michael,
  12306. 6:16:12it will get Michael.
  12307. 6:16:13And if you're enjoying this n8n course,
  12308. 6:16:15then you might want to check out our AI
  12309. 6:16:16automation circle, which is a school
  12310. 6:16:18community for people who look into learn
  12311. 6:16:20AI automations from zero, either to
  12312. 6:16:22apply it in their own business or to
  12313. 6:16:24start their AI agency to provide
  12314. 6:16:26services to clients. We have people
  12315. 6:16:27introducing themselves every single day,
  12316. 6:16:29asking questions, sharing wins, getting
  12317. 6:16:31technical support, and also looking for
  12318. 6:16:33jobs and partnerships. We also have a
  12319. 6:16:34classroom full of courses, which is the
  12320. 6:16:37AI automations one-on-one course, an
  12321. 6:16:38extension to this course, the templates
  12322. 6:16:40vault, which is all the resources from
  12323. 6:16:43our YouTube channel in case you want to
  12324. 6:16:45work with us one-on-one to start and
  12325. 6:16:46scale your agency. We have all the
  12326. 6:16:48weekly recordings from every single call
  12327. 6:16:49that we do, plus over $20,000 in
  12328. 6:16:52discount codes. And we also have two
  12329. 6:16:54calls a week for weekly huddles to
  12330. 6:16:55answer any questions and also live
  12331. 6:16:57coding sessions where we actually build
  12332. 6:16:59systems from scratch. The only catch is
  12333. 6:17:00not everyone gets in, so feel free to
  12334. 6:17:03apply and make sure you put some
  12335. 6:17:04thoughts into your answers. With that
  12336. 6:17:06being said, let's get back to the
  12337. 6:17:07course.
  12338. 6:17:10I built an AI agent on N and that reads
  12339. 6:17:13my contacts, manages my emails, and my
  12340. 6:17:15calendar, and even writes my blog posts.
  12341. 6:17:17And honestly, it still blows my mind.
  12342. 6:17:19So, in today's video, I'm going to show
  12343. 6:17:20you exactly how I did it. All right, so
  12344. 6:17:21let me show you exactly how it works. We
  12345. 6:17:23have the agent pulled up here, and then
  12346. 6:17:25we also have Telegram, which is exactly
  12347. 6:17:26how I get to talk to the agent. Let me
  12348. 6:17:29just say,
  12349. 6:17:30"Can you send an email to James Low uh
  12350. 6:17:32telling him that we have dinner tomorrow
  12351. 6:17:34at 7:00 p.m. in Rome, and also can you
  12352. 6:17:37put that on the calendar to make sure
  12353. 6:17:39that we have it there for 7:00 p.m. and
  12354. 6:17:40send an invite to him?" And uh yeah, let
  12355. 6:17:43me know when it's done.
  12356. 6:17:44All right, so right now, the agent had a
  12357. 6:17:47task assigned to him. It's going on and
  12358. 6:17:49finding the different agents that he
  12359. 6:17:50needs to talk to in order to fulfill the
  12360. 6:17:51task. It's using both the email agent
  12361. 6:17:53and the calendar agents, as you can see.
  12362. 6:17:56The email is done, the calendar is done.
  12363. 6:17:58And I get a text saying that the email
  12364. 6:17:59to James Low about dinner tomorrow 7:00
  12365. 6:18:01p.m. in Rome has been sent, and a
  12366. 6:18:02calendar event for dinner is also being
  12367. 6:18:04created. So, if I go to my email right
  12368. 6:18:05here, I should expect an email saying we
  12369. 6:18:07have dinner tomorrow 7:00 p.m. in Rome,
  12370. 6:18:09which is fine. Calendar, I can see that
  12371. 6:18:11we have dinner in Rome, which is
  12372. 6:18:12scheduled for 7:00 to 8:00 p.m. and I
  12373. 6:18:13never told it to do 1 hour, but it was
  12374. 6:18:15smart enough to understand that for
  12375. 6:18:16dinner, uh 1 hour is fine, which is
  12376. 6:18:18great. And then it sent an invitation to
  12377. 6:18:20100 million dollar peanuts, which is the
  12378. 6:18:21email that I have uh unlisted under
  12379. 6:18:23James Low right here. The real ones know
  12380. 6:18:25what this is, and uh it was scheduled
  12381. 6:18:27automatically for me, and the email was
  12382. 6:18:28sent. All right, cool. So, now you got
  12383. 6:18:30to see what the AI agent does. Let's go
  12384. 6:18:32to Miro right here. So, I drew up this
  12385. 6:18:34diagram which shows exactly the
  12386. 6:18:35fundamentals or the way that this
  12387. 6:18:37multi-step AI agent works. Now, we still
  12388. 6:18:39have an input, and we have an output.
  12389. 6:18:41Sorry for that. Uh the input is
  12390. 6:18:43essentially what I told it. I said,
  12391. 6:18:44"Hey, can you do XYZ for me? Can you
  12392. 6:18:46schedule an email? Can you schedule um
  12393. 6:18:48can you put something on the calendar?"
  12394. 6:18:49Right? This is an instruction that we
  12395. 6:18:50told the AI agent to start with. That's
  12396. 6:18:52the input. Uh and the output is here,
  12397. 6:18:54everything was good. So, after we give
  12398. 6:18:56it the input, that goes on to the
  12399. 6:18:57multi-step AI agent. Now, think of this
  12400. 6:19:00as a CEO of the company, CEO of the AI
  12401. 6:19:02agents. It has system prompts and
  12402. 6:19:04instructions. So, what these are are
  12403. 6:19:06instructions that say, "Hey, you are a
  12404. 6:19:08helpful, intelligent assistant." Right?
  12405. 6:19:10The typical prompt that you put in for
  12406. 6:19:11an AI agent. And we also say, "Here are
  12407. 6:19:13the tools that you have access to. Here
  12408. 6:19:14are the agents that you have access to.
  12409. 6:19:16If this happens, if you're asked to send
  12410. 6:19:18an email, then choose this agent. If
  12411. 6:19:21you're asked to do the calendar, then
  12412. 6:19:22choose that agent." Right? So,
  12413. 6:19:24fundamentally, this multi-step AI agent
  12414. 6:19:27thinks with its brain, which is the LLM,
  12415. 6:19:29and also has a memory, which means it
  12416. 6:19:31remembers the previous conversations
  12417. 6:19:32that you had or the previous questions
  12418. 6:19:33that you asked. And on a high level, the
  12419. 6:19:35multi-step AI agent gets an input, which
  12420. 6:19:37means it gets a a request, right? And
  12421. 6:19:39then chooses which agent to talk to.
  12422. 6:19:42So, think of these as head of
  12423. 6:19:43departments. So, the CEO has different
  12424. 6:19:45head of departments in their company.
  12425. 6:19:48So, it gets a request and then chooses,
  12426. 6:19:49"Hey, based on what I was told, let's
  12427. 6:19:51say we do uh schedule calendar event for
  12428. 6:19:53tomorrow for dinner," which is exactly
  12429. 6:19:54what I did, then it would go out and
  12430. 6:19:56talk to the head of calendar, so the
  12431. 6:19:57calendar agent. It sends a request
  12432. 6:20:00saying, "Hey, I got a request saying
  12433. 6:20:02that we want to schedule a dinner for
  12434. 6:20:03tomorrow 7:00 p.m." And then that
  12435. 6:20:06calendar agent talks to its tools, which
  12436. 6:20:08are the employees, which actually do the
  12437. 6:20:10thing, which actually schedule the
  12438. 6:20:11event, create the event through a
  12439. 6:20:13request. And then they get a response,
  12440. 6:20:14which is, "Yeah, it was successful." And
  12441. 6:20:16they respond back to here saying, "Hey,
  12442. 6:20:18everything was good."
  12443. 6:20:19And obviously, these head of departments
  12444. 6:20:21think with their brain, which is the LLM
  12445. 6:20:23in this case. But, let's say we asked it
  12446. 6:20:25to send a calendar event or even send an
  12447. 6:20:27email.
  12448. 6:20:28In this case, because we have a contact
  12449. 6:20:31department, we because we have a contact
  12450. 6:20:32agent, the first step it has to do that
  12451. 6:20:34we instructed to is, "Hey, if we're told
  12452. 6:20:37or if you're told to schedule a calendar
  12453. 6:20:38event or schedule an email, the first
  12454. 6:20:40step you have to do is actually find the
  12455. 6:20:42contact of the person that we're talking
  12456. 6:20:44about because I'm just saying the name,
  12457. 6:20:46and then you can do the other things."
  12458. 6:20:48So, for the example that I gave you for
  12459. 6:20:49the calendar, they have the input, which
  12460. 6:20:51is calendar. Multi-step AI agent. First
  12461. 6:20:53step is contact agent, so to get the
  12462. 6:20:54contacts that it needs through a request
  12463. 6:20:57and a response, right? Talking to the
  12464. 6:20:58tools as well, which are the employees,
  12465. 6:20:59which gives the contacts and find the
  12466. 6:21:01contacts. And then it goes here, then it
  12467. 6:21:03says, "Okay, what do I have to do
  12468. 6:21:04first?" In this case, calendar agent, so
  12469. 6:21:07we schedule the calendar. So, head of
  12470. 6:21:09department goes to the employees saying,
  12471. 6:21:11"Hey guys, can you do it?" "Yes, it's
  12472. 6:21:12done." [music] Sends a response,
  12473. 6:21:13"Everything was good." And then talks to
  12474. 6:21:15the email agent, which is head of email
  12475. 6:21:17in this case for the company. Then from
  12476. 6:21:19the email agent, it assigns it to its
  12477. 6:21:20employees, which are tools, through a
  12478. 6:21:22request. So, sends a request like, "Hey
  12479. 6:21:23guys, can you do this?" Then sends a
  12480. 6:21:25response, which is, "Yeah, everything
  12481. 6:21:26was good." And then once everything is
  12482. 6:21:28executed based on what we told it to do,
  12483. 6:21:30it then gives me the output saying,
  12484. 6:21:31"Hey, everything was good." And so on.
  12485. 6:21:33And then we also have a blog agent,
  12486. 6:21:34which in this case wasn't used, but this
  12487. 6:21:36agent is just used when we tell it to
  12488. 6:21:37write a blog. Right? And then it goes
  12489. 6:21:39out to the head of content, per se, and
  12490. 6:21:41then head of content assigns it to its
  12491. 6:21:42employees, which are tools, through a
  12492. 6:21:44request, and then we get a response.
  12493. 6:21:45Right? And that's our whole repetitive
  12494. 6:21:46loop that happens every single time.
  12495. 6:21:48But, this is non-deterministic. So, what
  12496. 6:21:50does non-deterministic mean? It means
  12497. 6:21:51that the input can result in different
  12498. 6:21:54outputs. So, I can say, "Hey, send an
  12499. 6:21:56email." And it will send an email. But,
  12500. 6:21:57I can also say, "Send a blog." And it
  12501. 6:21:59will send a blog. So, it the one input
  12502. 6:22:02can result in multiple different
  12503. 6:22:03outputs. That's what non-deterministic
  12504. 6:22:04means. It's not determined, right? Uh
  12505. 6:22:06so, that's what it is. All right, so the
  12506. 6:22:07first step to this AI agent is the
  12507. 6:22:09trigger. So, the trigger is the first
  12508. 6:22:10thing that actually starts the
  12509. 6:22:11automation, starts the the AI agent
  12510. 6:22:13because there's a way that there's a
  12511. 6:22:14systematic way that we actually talk to
  12512. 6:22:16the AI agent. It's like you're talking
  12513. 6:22:17to an employee, there has to be an
  12514. 6:22:18input, right? And this is the input
  12515. 6:22:20right here. Uh so, if I go on here,
  12516. 6:22:22which you can find, by the way, if when
  12517. 6:22:23you go to Telegram,
  12518. 6:22:25go here, and then you go down to
  12519. 6:22:27triggers, which is essentially, I don't
  12520. 6:22:29know if you guys can see it, but
  12521. 6:22:32on message right here.
  12522. 6:22:33So, this is the one we're going to use
  12523. 6:22:36to then trigger. So, it says, "Hey,
  12524. 6:22:38whenever a message comes," so trigger on
  12525. 6:22:39message, "whenever a message comes, can
  12526. 6:22:41you please just um allow it to or can
  12527. 6:22:43you please just trigger the automation?
  12528. 6:22:45Can you start the automation?" And to
  12529. 6:22:46connect to your Telegram, all you have
  12530. 6:22:47to do is press here on credentials to
  12531. 6:22:50connect with. This is my account. You
  12532. 6:22:51can create new credentials. And then to
  12533. 6:22:53actually connect this, let me press this
  12534. 6:22:54here, which talks to the agent from N
  12535. 6:22:56and N, which gives you like a
  12536. 6:22:57step-by-step instructions. Uh there's a
  12537. 6:22:59clear process to it. You have to talk to
  12538. 6:23:01an agent called the BotFather, which is
  12539. 6:23:04Yeah, so create a Telegram account,
  12540. 6:23:05start a chat with the BotFather, so you
  12541. 6:23:07have to use this link right here.
  12542. 6:23:09And then you can uh you have to give it
  12543. 6:23:11a {slash} something. You have to start a
  12544. 6:23:12conversation with yeah, {slash} new bot.
  12545. 6:23:15And then you can get your API key or
  12546. 6:23:17your access token, which it gives you,
  12547. 6:23:19which then allows you to connect it to
  12548. 6:23:21your account. So, once you connect it to
  12549. 6:23:23your account, you want to just put
  12550. 6:23:24trigger on message, which allows you to
  12551. 6:23:26be able to trigger the the actual
  12552. 6:23:28workflow on the message that you sent
  12553. 6:23:30it. So, let's say I trigger this.
  12554. 6:23:32So, I go here.
  12555. 6:23:33And I just
  12556. 6:23:34I can write a text like, "Hey, how are
  12557. 6:23:36you?"
  12558. 6:23:38And then go inside and see that we got a
  12559. 6:23:40text saying, "Hey, how are you?" Right?
  12560. 6:23:42And this is a text. [music] Now, we use
  12561. 6:23:44a switch node after this because a
  12562. 6:23:46switch node allows us to differentiate
  12563. 6:23:47whether the text or whether the message
  12564. 6:23:49was in audio, whether it's a text.
  12565. 6:23:51Because if it's an audio, we have to get
  12566. 6:23:52the file, which because the audio itself
  12567. 6:23:54turns into a file, and then give it to
  12568. 6:23:56AI to say, "Hey, we have an audio. Can
  12569. 6:23:58you just turn it into text so we can use
  12570. 6:24:00it?" Okay? Because the input here has to
  12571. 6:24:02be text. Either way, whether it's an
  12572. 6:24:04audio, whether it's just text. So, we
  12573. 6:24:05want to make sure that we get text in
  12574. 6:24:07the AI agent, in the CEO, uh all the
  12575. 6:24:09time. So, switch here, go inside, and
  12576. 6:24:12then we want to make sure we're choosing
  12577. 6:24:14basically a field that only happens
  12578. 6:24:16whenever we send the audio. So, what I
  12579. 6:24:18mean by that is, let's say we send a
  12580. 6:24:19text. In this case, this is all the
  12581. 6:24:21fields that we get, right? Which is
  12582. 6:24:23this, message text. So, we know it's a
  12583. 6:24:25text because this says text, because
  12584. 6:24:27chat says text. But, let's say I did a
  12585. 6:24:28voice message, so let me go here and let
  12586. 6:24:30me rerun it.
  12587. 6:24:32Let me say, "Hello, this is me. Hello,
  12588. 6:24:34hello."
  12589. 6:24:36I can then go here, I can see that it
  12590. 6:24:37triggered. We can see here that it's
  12591. 6:24:38voice. So, when we go back here, we're
  12592. 6:24:40basically saying, "Hey,
  12593. 6:24:42set the rules." There's two different
  12594. 6:24:43rules. If it's an audio, so we know it's
  12595. 6:24:45an audio because we know that this
  12596. 6:24:47variable exists, mime type. And we know
  12597. 6:24:49it's a text when text exists, which we
  12598. 6:24:51already had before. So, we're splitting
  12599. 6:24:53into two different ways.
  12600. 6:24:54And we're using again two different
  12601. 6:24:55variables, the ones here. Right? This
  12602. 6:24:57looks like code, but it actually is just
  12603. 6:24:58me
  12604. 6:24:59dragging and dropping this one here.
  12605. 6:25:01Boom, like this, right? And you'll get
  12606. 6:25:03it there.
  12607. 6:25:04Uh and then we are splitting into two
  12608. 6:25:06different ways. So, if it's an audio, it
  12609. 6:25:07goes here. If it's a text, it will go
  12610. 6:25:09here. And then we'll send this, so this
  12611. 6:25:11right here is just the text of the
  12612. 6:25:12message, and it will send it both ways
  12613. 6:25:14to the AI agent. So, route it back and
  12614. 6:25:16then bring it back to the same place.
  12615. 6:25:18So, the AI agent always gets text.
  12616. 6:25:19There's a few things we have to set up
  12617. 6:25:21for the main AI agent. The first one is
  12618. 6:25:22source for prompt, which is the user
  12619. 6:25:24message. Now, in the simplest way
  12620. 6:25:25possible, this is asking us basically,
  12621. 6:25:26"What is the thing that you want to feed
  12622. 6:25:28in to the AI agent?" So, there's two
  12623. 6:25:31options. The first one is connect uh
  12624. 6:25:33connected chat trigger node. So, let me
  12625. 6:25:34zoom in. Connected chat trigger node,
  12626. 6:25:35which is basically saying, "Do you want
  12627. 6:25:37to connect it to the chat node of N and
  12628. 6:25:40N?" Which is because N and N has a uh
  12629. 6:25:42native chat node. So, we say no, we're
  12630. 6:25:44using Telegram, so we just want to
  12631. 6:25:45define it below. So, we're defining it
  12632. 6:25:47ourselves. And below, which in this case
  12633. 6:25:49is just json.text, which is the text
  12634. 6:25:51that we get from Telegram. Whether it's
  12635. 6:25:53a voice, whether it's a text, we always
  12636. 6:25:55give it the same thing. And then we
  12637. 6:25:57require specific output format. No, it
  12638. 6:25:58doesn't require any specific output
  12639. 6:25:59format because it changes. And then
  12640. 6:26:01enable fallback method. This says, "Hey,
  12641. 6:26:03since it's using an AI to actually
  12642. 6:26:05think, uh it says, 'If the AI doesn't
  12643. 6:26:07work, do you want to set another
  12644. 6:26:08fallback method?'" So, it uses another
  12645. 6:26:10AI. Well, in this case, we don't need
  12646. 6:26:11to, so we can just leave it there. And
  12647. 6:26:12now, for the most important part of the
  12648. 6:26:14agent is the system message. So, this is
  12649. 6:26:16the instructions. Let me press this
  12650. 6:26:17button right here, which basically puts
  12651. 6:26:19it full screen. And this is the general
  12652. 6:26:21structure that you would give an AI
  12653. 6:26:23agent for it to actually work. Because
  12654. 6:26:24the prompt is the most important thing.
  12655. 6:26:25Without a prompting, without you giving
  12656. 6:26:27instructions to someone, how are they
  12657. 6:26:28meant to know what to do? Right? So, we
  12658. 6:26:30say we give it an overview, so you are
  12659. 6:26:32the ultimate personal assistant. Your
  12660. 6:26:33job is to send the user's query to the
  12661. 6:26:35correct tool. Uh and these are the
  12662. 6:26:36different tools. So, I say first tool,
  12663. 6:26:38and then second tool, and then third
  12664. 6:26:39tool, and then content agent, so this is
  12665. 6:26:42a
  12666. 6:26:42another tool, and then we give it some
  12667. 6:26:43rules, instructions, and a final
  12668. 6:26:45reminder, here's the current date and
  12669. 6:26:46time. So, we always give it the date and
  12670. 6:26:48time because AI isn't the best at at
  12671. 6:26:50guessing what date and time it is.
  12672. 6:26:52I tried running it before. I said, run a
  12673. 6:26:54make an event for tomorrow and it made
  12674. 6:26:56an event for I think 6 months ago. So,
  12675. 6:26:58not the best. And the structure is
  12676. 6:27:00overall mainly the same. We have the
  12677. 6:27:02overview, which is some context. We have
  12678. 6:27:04tools. So, for the tools this app we
  12679. 6:27:05have contact agents. So, we say use this
  12680. 6:27:07tool to take contact actions. You might
  12681. 6:27:09use this before sending emails or
  12682. 6:27:11creating calendar events within
  12683. 6:27:12attendees. So, this is where we go into
  12684. 6:27:14prompting, right? Which I don't want to
  12685. 6:27:15get too deep in, but we're basically
  12686. 6:27:17saying, "Hey, before you use something
  12687. 6:27:19else, use this." So, let's say we say,
  12688. 6:27:21"Hey, can you send an email to James?"
  12689. 6:27:22How does it know James' email, right?
  12690. 6:27:24So, we're basically saying we're
  12691. 6:27:25prompting it saying, "Hey, before you
  12692. 6:27:26send an email, before you create a
  12693. 6:27:27calendar event, just go out to the
  12694. 6:27:29contact database and find the contacts,
  12695. 6:27:31which in this case is in a Google
  12696. 6:27:32Sheet." So, that's what we tell it to
  12697. 6:27:33do. And then we have the email agent,
  12698. 6:27:35which is use this tool to take action in
  12699. 6:27:37email, that's simple. Then we have
  12700. 6:27:39calendar agent, which is basically
  12701. 6:27:40saying use this tool to take action in
  12702. 6:27:41the calendar. I also reiterate it. So, I
  12703. 6:27:43said, "Hey, you must use a contact
  12704. 6:27:46agent before using calendar agent and
  12705. 6:27:48make sure you pass through the email of
  12706. 6:27:49the contact to the calendar agent. Now,
  12707. 6:27:51this only comes from actually testing
  12708. 6:27:52the agent and making sure that it works
  12709. 6:27:54because sometimes what it was giving me
  12710. 6:27:55it was when you know when I say send the
  12711. 6:27:57invite to the actual person, it was
  12712. 6:27:59sending me just the name. So, I say,
  12713. 6:28:00"Hey, no, that can't happen. Just send
  12714. 6:28:02me the email cuz that's the email is the
  12715. 6:28:03only thing that we can actually use to
  12716. 6:28:05send the invite." Then we have content
  12717. 6:28:07agent, so use this tool to generate a
  12718. 6:28:08blog and return the full text. And then
  12719. 6:28:10we have rules here. And the rules are
  12720. 6:28:12basically going towards telling the AI
  12721. 6:28:14agent some rules that it needs to do.
  12722. 6:28:16And this is a difference between
  12723. 6:28:17proactive and reactive prompting because
  12724. 6:28:19reactive prompting is essentially the
  12725. 6:28:21the act of iterating, so means changing
  12726. 6:28:24the prompt over time as you're testing
  12727. 6:28:26the agent. So, you're testing the agent,
  12728. 6:28:28you see that the email agent doesn't
  12729. 6:28:29work for this reason, you add rules
  12730. 6:28:30saying, "Hey, if this works,
  12731. 6:28:32do this." But, you wouldn't know it
  12732. 6:28:33didn't work if you didn't actually test
  12733. 6:28:34it. So, you always want to do reactive
  12734. 6:28:36prompting. Test the agent and then add
  12735. 6:28:37the rules.
  12736. 6:28:38That's what you want to do. And then
  12737. 6:28:39some instructions and then final
  12738. 6:28:41reminder again. All right, cool. So,
  12739. 6:28:43this is the prompt that we want to use.
  12740. 6:28:44And this is the one that is going to use
  12741. 6:28:45to then decide which AI agent it's then
  12742. 6:28:48going to offload the task to. Now, the
  12743. 6:28:50main AI agent is connected to a child
  12744. 6:28:52model. So, this is the brain, the LLM
  12745. 6:28:53that I was talking about. With in this
  12746. 6:28:55case we use ChatGPT 4.1 mini. To connect
  12747. 6:28:57your OpenAI, you just have to go here,
  12748. 6:28:59create a new credential.
  12749. 6:29:01And then you have to go to the actual
  12750. 6:29:03platform the OpenAI. So, you go here.
  12751. 6:29:09platform.openai.com
  12752. 6:29:11You log in. So, you have to log in and
  12753. 6:29:12then you have to go to dashboard, I
  12754. 6:29:14believe. API keys on the left-hand side.
  12755. 6:29:17Go here to create a new API key.
  12756. 6:29:19Name it. So, hello.
  12757. 6:29:21Test. YouTube, 19th of August.
  12758. 6:29:26Leave this as you. Project is default
  12759. 6:29:28and information is all, so it's fine.
  12760. 6:29:30Create a secret key and then copy this.
  12761. 6:29:33Bring it back to N and N.
  12762. 6:29:35And then this is the one you're going to
  12763. 6:29:36put here. So, API key, let's do YouTube
  12764. 6:29:40August 19th.
  12765. 6:29:42You don't need this. Base URL is fine.
  12766. 6:29:44All you have to do is press save
  12767. 6:29:46and you'll see this green check mark
  12768. 6:29:47here, which means that connection was
  12769. 6:29:49tested successfully. And bear in mind
  12770. 6:29:50that you need to add credits to OpenAI
  12771. 6:29:52for it to actually work. And I think $5
  12772. 6:29:54should do, it's enough. It's exactly
  12773. 6:29:56what I put I think 4 months ago and now
  12774. 6:29:58it's still going. So, it's very very
  12775. 6:29:59cheap. Now, the model itself, 4.1 mini
  12776. 6:30:01is actually very very good. Some models
  12777. 6:30:03don't work for this AI agent, like to to
  12778. 6:30:05actually run the AI agent. For example,
  12779. 6:30:074.0 would not work. So, leave this as
  12780. 6:30:094.1 mini, which is very fast. Then we
  12781. 6:30:11have think, which is a new node that was
  12782. 6:30:14added recently, which is just used to
  12783. 6:30:16add that extra person to think. So, it
  12784. 6:30:18does everything and then it consults is
  12785. 6:30:19like a consultant. It consults with the
  12786. 6:30:21AI agent saying, "Hey, I did all of
  12787. 6:30:23this. Am I doing it right or is there
  12788. 6:30:24something that I'm getting wrong?" It
  12789. 6:30:26will think through it and then it will
  12790. 6:30:27tell it if something is changed. And
  12791. 6:30:29then simple memories, if I go in here, I
  12792. 6:30:31can see that we have a session ID, which
  12793. 6:30:34will just be the chat ID that we have
  12794. 6:30:35with the agent. Then we have context
  12795. 6:30:37window length. This just means how many
  12796. 6:30:38text messages do you want the AI agent
  12797. 6:30:39to actually remember when it gives you
  12798. 6:30:41the output. Cuz let's say I say, "Hey,
  12799. 6:30:43can you send an email to James?" Then he
  12800. 6:30:45goes out and sends the email to James
  12801. 6:30:46and says, "Hey, we're done." And then
  12802. 6:30:48you say, "Can you actually schedule the
  12803. 6:30:49calendar event with him as well?" Now,
  12804. 6:30:51it needs to remember who James was,
  12805. 6:30:53right? That we actually said James for
  12806. 6:30:55it to actually do the thing. So, this is
  12807. 6:30:56basically saying if you put five, it
  12808. 6:30:58will just say, "Hey, remember the five
  12809. 6:31:00past conversations that we had with
  12810. 6:31:01you." So, that's what it means. And then
  12811. 6:31:03here is where the real sauce begins
  12812. 6:31:05because we have the contact agent, the
  12813. 6:31:07email agent, calendar agent, the content
  12814. 6:31:09creation [music] agent. All right, so
  12815. 6:31:10the first tool here, the first agent
  12816. 6:31:12that is hooked up with is the contact
  12817. 6:31:13agent. Now, this right here, again, is
  12818. 6:31:16the head of contacts. What it will do is
  12819. 6:31:18it will call this tool to take action
  12820. 6:31:19within the contact database. So, we add
  12821. 6:31:20a description, which is what it is, and
  12822. 6:31:22then we say the prompt. So, the prompt
  12823. 6:31:24is what do we tell the agent to do? In
  12824. 6:31:26this case we can define it automatically
  12825. 6:31:27by the model. And then we give it a
  12826. 6:31:29system message, which is exactly what we
  12827. 6:31:30gave it in the main model. Overview,
  12828. 6:31:32which is you are a contact manager, you
  12829. 6:31:33have tools to take action within the
  12830. 6:31:35contact database. The different tools
  12831. 6:31:37you have is get contacts, you use this
  12832. 6:31:38tool to get contact information, like
  12833. 6:31:40address or phone number, and then add or
  12834. 6:31:42update a contact, use this to add a new
  12835. 6:31:44contact to database or update an
  12836. 6:31:45existing contact. So, that's exactly
  12837. 6:31:47what it does. Those instructions allow
  12838. 6:31:48it to think about what it has to do and
  12839. 6:31:50choose which tool it needs to send the
  12840. 6:31:52information to. And we also have a
  12841. 6:31:54model, which is the brain, so in this
  12842. 6:31:56case the LLM, which is also hooked up to
  12843. 6:31:58the main agent, the same. So, in this
  12844. 6:32:00we're using 4.1 mini like I mentioned
  12845. 6:32:01before. Then we have the tools. We have
  12846. 6:32:03get contact and then we have add or
  12847. 6:32:05update contacts,
  12848. 6:32:06like [music] you saw here in the system
  12849. 6:32:07message. So, if I go here to the first
  12850. 6:32:08tool, we can see that get contacts is
  12851. 6:32:10hooked up to Google Sheets. So, the
  12852. 6:32:12first step you have to do is go here,
  12853. 6:32:14create a new credential. And all you
  12854. 6:32:15have to do is sign in with Google. You
  12855. 6:32:16can press this button right here, which
  12856. 6:32:17will take you through the main page
  12857. 6:32:19right here with Google, which will
  12858. 6:32:20basically allow you to connect to any
  12859. 6:32:22account that you want. And then you can
  12860. 6:32:23bring it back. It's as easy as that. You
  12861. 6:32:25can bring it back and it will be
  12862. 6:32:26connected, so that's fine.
  12863. 6:32:28Yes, delete. And then you want to set
  12864. 6:32:29this automatically because we're
  12865. 6:32:31allowing AI to actually set the tool
  12866. 6:32:33description, so what it actually needs
  12867. 6:32:35to do. And then the resource will be the
  12868. 6:32:36sheet within the document because
  12869. 6:32:38there's a sheet that we're using, which
  12870. 6:32:39is a contacts, which is this one right
  12871. 6:32:40here, which all the contacts. In this
  12872. 6:32:42case it will be more, but these are the
  12873. 6:32:43ones that we have now. And then we have
  12874. 6:32:45get rows because that's the action that
  12875. 6:32:47we have to do. In this case we're
  12876. 6:32:47getting contacts from the list. So,
  12877. 6:32:49which sheet are you using? Which Sorry,
  12878. 6:32:51which document are you using? So, which
  12879. 6:32:53Yeah, which main sheet are you using?
  12880. 6:32:54So, in this case it will be contact
  12881. 6:32:55database USB. And what sheet within the
  12882. 6:32:57sheet are we using? So, in this case it
  12883. 6:32:58will be sheet one. And then you want to
  12884. 6:33:00leave this blank because we want to let
  12885. 6:33:01the AI figure it out. Now, let's test
  12886. 6:33:03this. Let me show you exactly what this
  12887. 6:33:05just what this step does. Let me go to
  12888. 6:33:06Telegram. Let me execute the workflow
  12889. 6:33:09and say So, in this case we have James
  12890. 6:33:11Low.
  12891. 6:33:13So, hey, can you
  12892. 6:33:15quickly
  12893. 6:33:17get me James Low's
  12894. 6:33:20email?
  12895. 6:33:21So, through text it will then talk to
  12896. 6:33:23the main agent. It will think, "Hey,
  12897. 6:33:24what agent do I need to use in order for
  12898. 6:33:27me to do that task?" It will think and
  12899. 6:33:29then it will send it here and then this
  12900. 6:33:30will then send it here, bring it back,
  12901. 6:33:32and then give me the output. And it will
  12902. 6:33:33say, "Hey, James Low's email address is
  12903. 6:33:35100 million dollar peanuts. Is there
  12904. 6:33:37anything else you want me to do?" So,
  12905. 6:33:38this right here just used the agent, so
  12906. 6:33:39used this tool right here to do this
  12907. 6:33:41specific task. So, it will think through
  12908. 6:33:43which agent it will send it to. It will
  12909. 6:33:45then send it here and then based on what
  12910. 6:33:47it's told, it will then think through
  12911. 6:33:48exactly which tools or which employee is
  12912. 6:33:50it going to offload the task to. In this
  12913. 6:33:52case the employee will be the get
  12914. 6:33:53contacts. And the same thing is update a
  12915. 6:33:55contact, so right here we can update the
  12916. 6:33:57contact here. We're going to do the same
  12917. 6:33:59connection, set automatically. This is
  12918. 6:34:01all the same. The only thing you want to
  12919. 6:34:02change is you want to map the column
  12920. 6:34:04mode manually because you're manually
  12921. 6:34:06mapping each column. And then it says
  12922. 6:34:08based on cuz when we tell it, "Can you
  12923. 6:34:10update or can you change something?" It
  12924. 6:34:12needs to know what it needs to change.
  12925. 6:34:13So, we want to match the name to the
  12926. 6:34:15name in the sheet to make sure that it
  12927. 6:34:17knows exactly which one is updating. And
  12928. 6:34:19then it's updating the name, which is
  12929. 6:34:20defined automatically by the model, the
  12930. 6:34:22email
  12931. 6:34:23or the phone number. Right, based on
  12932. 6:34:25what it needs to update. And I give it a
  12933. 6:34:26description as well. So, this is the
  12934. 6:34:27name of the person, the email, and the
  12935. 6:34:29phone number. And leave everything else
  12936. 6:34:30the same. So, [music] these two are
  12937. 6:34:31called upon when it needs to do that
  12938. 6:34:33specific task. Now, let's get on to the
  12939. 6:34:34email agent, which is, again, the same
  12940. 6:34:36thing, same same sort of setup. We have
  12941. 6:34:38the description, so call this tool to
  12942. 6:34:39take action in email. Prompt, which
  12943. 6:34:41should be defined by the model. Then we
  12944. 6:34:43have system message. So, you're an email
  12945. 6:34:45assistant, you have tools to take action
  12946. 6:34:46in email. And then we have different
  12947. 6:34:48tools, so send, get, draft, create,
  12948. 6:34:52reply, create a draft, and then get
  12949. 6:34:54labels, actually label them. And then we
  12950. 6:34:56have rules and then final reminder.
  12951. 6:34:58In this case for the different tools, we
  12952. 6:35:00tell it we give it a small interaction.
  12953. 6:35:01So, in this case you have to use this to
  12954. 6:35:03send an email, use this to get emails.
  12955. 6:35:05And we give it different rules and
  12956. 6:35:06different logic. And this all comes from
  12957. 6:35:08actually testing and making sure that we
  12958. 6:35:09know exactly what hasn't worked [music]
  12959. 6:35:12based on our test and then what can we
  12960. 6:35:13add to the prompt to make sure that it
  12961. 6:35:15works every single time. So, that's what
  12962. 6:35:16we want there. And this is basically it.
  12963. 6:35:18So, all the same for the different
  12964. 6:35:19agents. And then it's hooked up to the
  12965. 6:35:21OpenAI brain, which again is the same
  12966. 6:35:23for every single agent. And then it's
  12967. 6:35:25hooked up to six different tools. Send
  12968. 6:35:27email, get emails, email reply, create a
  12969. 6:35:29draft, get labels, and label emails.
  12970. 6:35:31So, in this case let's go to send
  12971. 6:35:32emails. This will be the one tool that
  12972. 6:35:34will be used that will be called upon
  12973. 6:35:35when it needs to send an email. So, if I
  12974. 6:35:37go to credentials right here, all you
  12975. 6:35:38have to do to connect your Gmail to N
  12976. 6:35:40and N is go to create a new credential.
  12977. 6:35:43And just as we did for the Google Sheet,
  12978. 6:35:45we just have to sign in with Google. It
  12979. 6:35:47will take you through this page right
  12980. 6:35:48here. You can just choose which account
  12981. 6:35:49you want to use and that's the one that
  12982. 6:35:51will be brought back here and it will be
  12983. 6:35:52connected automatically.
  12984. 6:35:54Press delete. Let me go here. So, leave
  12985. 6:35:55this as set automatically. The resource
  12986. 6:35:57will be message because that's the thing
  12987. 6:35:58that we're actually doing. The operation
  12988. 6:35:59is basically what action are we taking?
  12989. 6:36:01So, we want to send in this case. And
  12990. 6:36:03it's asking us who do we send the email
  12991. 6:36:04to? What's the subject line? So, email
  12992. 6:36:06type, which is essentially either HTML
  12993. 6:36:08or text. In this case we just want to
  12994. 6:36:09leave it to HTML because if you want to
  12995. 6:36:11send a blog over email, then we want it
  12996. 6:36:14to have headers and all that sort of
  12997. 6:36:15stuff. And the only way to have headers
  12998. 6:36:16is to use HTML instead of text. And then
  12999. 6:36:19it's asking us what message So, what's
  13000. 6:36:20the body of the email? So, in this case
  13001. 6:36:22we're allowing the model to actually
  13002. 6:36:23think through exactly and define who are
  13003. 6:36:25we sending the email to. So, based on
  13004. 6:36:26So, let's say I say, "Hey, send the
  13005. 6:36:27email to James." It will first of all
  13006. 6:36:29get the contact, find the email, and
  13007. 6:36:31then it's smart enough to actually think
  13008. 6:36:33about
  13009. 6:36:34what email do we put here? In this case
  13010. 6:36:35it will be the email of the contact that
  13011. 6:36:36we just mentioned.
  13012. 6:36:38Subject line is the same. So, it will
  13013. 6:36:39think through the context that we give
  13014. 6:36:41it.
  13015. 6:36:41In this case let's say we we tell it to
  13016. 6:36:43write an email about going out for
  13017. 6:36:45dinner. The subject line will be created
  13018. 6:36:47based on that context. And the same
  13019. 6:36:48thing with message. So, let me test this
  13020. 6:36:50one right here so you get a feel of sort
  13021. 6:36:51of what it does just on this
  13022. 6:36:53>> [music]
  13023. 6:36:53>> this right here.
  13024. 6:36:55Let me execute workflow. Let me pull up
  13025. 6:36:57Telegram. And we can say, "Hey, can you
  13026. 6:36:59send
  13027. 6:37:01an email to him?" So, in this case,
  13028. 6:37:04we're actually testing the memory
  13029. 6:37:05itself.
  13030. 6:37:06Um saying,
  13031. 6:37:10uh "You are fired."
  13032. 6:37:13There you go.
  13033. 6:37:15So, then you execute the workflow. So,
  13034. 6:37:16it will think through what it needs to
  13035. 6:37:17do.
  13036. 6:37:18It will then know that it needs to use
  13037. 6:37:19this email agent to send the email,
  13038. 6:37:21bring it back
  13039. 6:37:23to Telegram. So, if I go to my email
  13040. 6:37:24here, I can see that I sent an email to
  13041. 6:37:27100 million other peanuts saying, "You
  13042. 6:37:29are fired." And the subject line was
  13043. 6:37:31already chosen by the model. So, that's
  13044. 6:37:33exactly what it does. So, based on what
  13045. 6:37:35it was instructed to do, it will choose
  13046. 6:37:37which tool it will use. This setup is
  13047. 6:37:38very much the same as the other tools.
  13048. 6:37:40So, if we go to get many, the connection
  13049. 6:37:42is the same, set automatically, message
  13050. 6:37:43is the same. In this case, we want to
  13051. 6:37:45change this from send to get many
  13052. 6:37:47because we want to get the different
  13053. 6:37:48emails that we need to get. Return all,
  13054. 6:37:50just let the AI handle this. It will
  13055. 6:37:52define whether it needs to return all or
  13056. 6:37:53just one
  13057. 6:37:55or what it needs to return in this case.
  13058. 6:37:57And then the sender. So, defined
  13059. 6:37:58automatically by the model and we also
  13060. 6:38:00give it a description. So, it sort of
  13061. 6:38:01has the guardrails when it needs to
  13062. 6:38:02think about who is the sender. So, in
  13063. 6:38:04this case, it can be a sender's name or
  13064. 6:38:05email address when it needs to pull
  13065. 6:38:07information. And then same thing with
  13066. 6:38:09email reply. So, in this case, we have
  13067. 6:38:10message and then we have reply. The
  13068. 6:38:12message ID will be obviously the message
  13069. 6:38:14that we previously got that we're
  13070. 6:38:15replying to.
  13071. 6:38:16And then we will leave this as HTML just
  13072. 6:38:18to make the email look pretty if it
  13073. 6:38:19needs to in case we're sending a blog.
  13074. 6:38:21And then the message here will be the
  13075. 6:38:22body.
  13076. 6:38:24Turn this off because then we don't have
  13077. 6:38:25to see any end on the email.
  13078. 6:38:28Same thing with create a draft. So, in
  13079. 6:38:31this case, instead of message, you can
  13080. 6:38:32put draft.
  13081. 6:38:33Create for operations. That's the actual
  13082. 6:38:35thing that we're doing. This is the
  13083. 6:38:37subject line, so we let it define by the
  13084. 6:38:38model. So, just press this button right
  13085. 6:38:40here or you can simply add
  13086. 6:38:42bracket bracket dollar sign from AI and
  13087. 6:38:44then you put subject. This is the
  13088. 6:38:45variable that we're pulling in or you
  13089. 6:38:46can just
  13090. 6:38:47do this. And then you can leave this as
  13091. 6:38:49HTML and then message is defined by the
  13092. 6:38:51model. And then whoever sending the
  13093. 6:38:52email to as a draft is defined by the
  13094. 6:38:54model as well. Same thing with get
  13095. 6:38:56labels. We're just getting labels. So,
  13096. 6:38:57label and get many and return all will
  13097. 6:38:59be defined by the model. And then label
  13098. 6:39:01emails as well
  13099. 6:39:02because this right here is a two-step
  13100. 6:39:04operation because we're first getting
  13101. 6:39:05emails to then label the email. In this
  13102. 6:39:07case, it will be the message. Add label.
  13103. 6:39:10Message ID will be the ID of that
  13104. 6:39:12specific thread of email. And then label
  13105. 6:39:14names or IDs will be the ones that will
  13106. 6:39:15be pulled in from this right here.
  13107. 6:39:17Because before this acts, this one
  13108. 6:39:19happens before cuz it needs to again get
  13109. 6:39:21labels before using the labels that it
  13110. 6:39:23was given to then do the thing. Then we
  13111. 6:39:26go to calendar agent. Very similar
  13112. 6:39:27setup. We have the description, the
  13113. 6:39:29prompt which is defined by the model.
  13114. 6:39:30Then we go here. As you can see that
  13115. 6:39:32this is a system message. So, this is
  13116. 6:39:33the instructions that we give the AI
  13117. 6:39:35agent in thinking through what it needs
  13118. 6:39:37to do.
  13119. 6:39:38Again, very very similar setup as the
  13120. 6:39:39one we have before, overview tools and
  13121. 6:39:41final reminder.
  13122. 6:39:42And most importantly here, we have date
  13123. 6:39:44and time because again AI is just the
  13124. 6:39:46worst at thinking through the times and
  13125. 6:39:47the dates. And now it will think through
  13126. 6:39:49what it needs to do. And then it's
  13127. 6:39:50hooked up to five different tools. So,
  13128. 6:39:51we have create an event with attendee.
  13129. 6:39:53So, this is basically creating an event
  13130. 6:39:55with someone, right? Um which is exactly
  13131. 6:39:57what I showed you at the start of the
  13132. 6:39:58video. In order to connect your Google
  13133. 6:40:00calendar to an end, all you have to do
  13134. 6:40:01is create a new credential. You go here,
  13135. 6:40:02sign in with Google. It will take you
  13136. 6:40:04through this page. Choose the account
  13137. 6:40:05that you want and this is will be the
  13138. 6:40:06one that will be connected here. And
  13139. 6:40:07then you want to put the resources as
  13140. 6:40:09event because it's an event, right? Uh
  13141. 6:40:12create because that's the task that
  13142. 6:40:13we're doing. That's the action that
  13143. 6:40:14we're doing. We're creating something.
  13144. 6:40:16The calendar will be your calendar. And
  13145. 6:40:17then it's going to ask you for the start
  13146. 6:40:18and end date. So, let's say I tell it to
  13147. 6:40:20schedule an event for tomorrow at 7:00
  13148. 6:40:22p.m. It will choose the start date. And
  13149. 6:40:24it will also choose the end date. So,
  13150. 6:40:25you see how before it shows the 8:00
  13151. 6:40:27p.m. 1-hour time frame. I didn't tell it
  13152. 6:40:29to. The AI automatically did it. Right?
  13153. 6:40:31This is what it is. Default reminders,
  13154. 6:40:33leave this as on because then Google
  13155. 6:40:35calendar can choose its own reminders.
  13156. 6:40:36And then it's going to ask us who the
  13157. 6:40:38attendees are. The attendees are
  13158. 6:40:39basically the people that are going to
  13159. 6:40:40be invited to that specific event that
  13160. 6:40:42we're doing. We're also giving it a
  13161. 6:40:43description and the summary as well. All
  13162. 6:40:45defined by the model itself because it
  13163. 6:40:47will be smart enough to know that it
  13164. 6:40:48will give the email, right? And we tell
  13165. 6:40:49it the description as well. And the
  13166. 6:40:50summary will be defined automatically by
  13167. 6:40:52the model as well.
  13168. 6:40:53And then let me actually do this. Let me
  13169. 6:40:55actually show you just this model right
  13170. 6:40:57here. So, you can see exactly the flow
  13171. 6:40:59that it goes through. So, just get
  13172. 6:41:00contact and then do this.
  13173. 6:41:02Let me go here.
  13174. 6:41:03Let me say,
  13175. 6:41:05"Can you
  13176. 6:41:07create
  13177. 6:41:09an event
  13178. 6:41:10for
  13179. 6:41:11tomorrow?
  13180. 6:41:13God, my spelling is horrible.
  13181. 6:41:14Event for tomorrow at 6:00 p.m.
  13182. 6:41:19and invite
  13183. 6:41:21him." Yeah, that's it.
  13184. 6:41:25Boom.
  13185. 6:41:26Then I'm waiting for it to do. It will
  13186. 6:41:28think through what it needs to do. It
  13187. 6:41:29will create the event. It will then give
  13188. 6:41:30me a response. If I go to my Google
  13189. 6:41:32calendar, I can see that event with
  13190. 6:41:35James Low was done at 6:00 p.m. to 7:00
  13191. 6:41:37p.m. Again, it was smart enough to think
  13192. 6:41:38that it's just a 1-hour slot. But of
  13193. 6:41:41course, it was given it was given the
  13194. 6:41:42context that it it wasn't given a 1-hour
  13195. 6:41:43thing. So, it will think through exactly
  13196. 6:41:45what it needs to do. It will just choose
  13197. 6:41:46the 1-hour and add it there. It will
  13198. 6:41:48send me the invite as well. That's cool.
  13199. 6:41:50And that's what this tool does.
  13200. 6:41:53And the same setup is for creating an
  13201. 6:41:54event without the attendee. So,
  13202. 6:41:56everything's the same apart from the
  13203. 6:41:57fact that we just don't add any
  13204. 6:41:58attendees here. Get events is the same.
  13205. 6:42:00So, in this case, we're just changing
  13206. 6:42:02this to get many.
  13207. 6:42:04So, let's say we go here
  13208. 6:42:05to Telegram and we ask it Let me just
  13209. 6:42:07execute the workflow.
  13210. 6:42:09Let me ask it,
  13211. 6:42:11"What events
  13212. 6:42:13do I have
  13213. 6:42:15this week?"
  13214. 6:42:17So, now it will think through what it
  13215. 6:42:18has to do. It will then think through
  13216. 6:42:19what it needs to use.
  13217. 6:42:20It first it will get the events and
  13218. 6:42:22bring it all back to Telegram. So, right
  13219. 6:42:24here it will tell me that I have the
  13220. 6:42:26out-school workshop this weekend,
  13221. 6:42:28James Low, dinner in Rome, and workshop
  13222. 6:42:30again. So, this right here is something
  13223. 6:42:32that I had Was it yesterday at 1:00
  13224. 6:42:34a.m.? Yeah, yesterday 1:00 a.m. That's
  13225. 6:42:36why it's telling me that it's from this
  13226. 6:42:37week as well. And that's how this tool
  13227. 6:42:39works. So, get an event. And then we
  13228. 6:42:40have delete events which is again the
  13229. 6:42:42same. The only thing we have to change
  13230. 6:42:43is the event and delete. Calendar will
  13231. 6:42:45be ours. Then it's asking us for the
  13232. 6:42:46event ID. It's sort of the same as
  13233. 6:42:48replying to an email because you need to
  13234. 6:42:49know the email ID first of the one that
  13235. 6:42:51you're replying to to then reply. In
  13236. 6:42:53this case, it's asking us what is the
  13237. 6:42:54event ID? What is the event that we're
  13238. 6:42:56deleting? And what's the ID? Because
  13239. 6:42:57that's the unique identifier for that
  13240. 6:42:59specific event. That's what we need. So,
  13241. 6:43:00we want to define it automatically by
  13242. 6:43:02the model. Which again, all of these
  13243. 6:43:04This right here wasn't before. It wasn't
  13244. 6:43:05here before. But now because the model's
  13245. 6:43:07got smarter, we're able to let AI
  13246. 6:43:09actually do it and let it handle it. And
  13247. 6:43:11that's fine. [music] And then we have
  13248. 6:43:12update an event which will be same
  13249. 6:43:14connection, set automatically, event
  13250. 6:43:16which will be update in this case.
  13251. 6:43:18Same calendar, event ID which is the
  13252. 6:43:20same as before. Use default reminders.
  13253. 6:43:22And now we give it a start and end date
  13254. 6:43:24which is the same as before. We're
  13255. 6:43:26basically saying, "Hey, this is the
  13256. 6:43:27start and this is the end, right? Of the
  13257. 6:43:29of the time frame that you want to
  13258. 6:43:31update." So, that there is for the
  13259. 6:43:32calendar agent. And then we go on to the
  13260. 6:43:34content creation agent. So, in this
  13261. 6:43:35case, we have descriptions. Call this
  13262. 6:43:37tool to create a blog post. The prompt
  13263. 6:43:38is automatically decided by the model.
  13264. 6:43:40It doesn't require any output format.
  13265. 6:43:42The fallback model, we don't need this.
  13266. 6:43:43And then we just have to use the system
  13267. 6:43:45message which in this case is you're an
  13268. 6:43:47expert blog writer. Use the appropriate
  13269. 6:43:49tool to write a blog post. In this case,
  13270. 6:43:51the only tool we have is Perplexity
  13271. 6:43:52which will be used to actually do the
  13272. 6:43:54research before we actually write the
  13273. 6:43:55blog post.
  13274. 6:43:56Um again, this is exactly what I told it
  13275. 6:43:58to do. And then some rules are that your
  13276. 6:43:59blog post should be less than 500 words
  13277. 6:44:01because we don't want it to be too big.
  13278. 6:44:03And also it can't send more than 500
  13279. 6:44:05words. Or I mean, I don't know how much
  13280. 6:44:06it can send. I don't know what the limit
  13281. 6:44:07is. But on Telegram, it can't send a
  13282. 6:44:08blog post to back to Telegram with more
  13283. 6:44:11than X words. So, we're just cutting it
  13284. 6:44:12off. And we're also saying output the
  13285. 6:44:14whole blog text. And then [music] final
  13286. 6:44:16reminder, we just give it a date and
  13287. 6:44:17time in case it needs to know. So, that
  13288. 6:44:19right there is the system prompt that we
  13289. 6:44:21tell the content creation agent to do.
  13290. 6:44:23And then we actually hook it up to
  13291. 6:44:24Claude. So, you see here we use OpenAI,
  13292. 6:44:26OpenAI, OpenAI.
  13293. 6:44:27Well, the reason why we're using Claude
  13294. 6:44:28in this case is because Claude is
  13295. 6:44:30extensively better at understanding and
  13296. 6:44:31making content. It's much better at
  13297. 6:44:33using words and creating words and
  13298. 6:44:35creating feelings out of words. That's
  13299. 6:44:36like the best way that I like to think
  13300. 6:44:37about it. So, that's why we use Claude.
  13301. 6:44:39If I go here, the way to connect your
  13302. 6:44:41Claude is
  13303. 6:44:42create a new credential. And all you
  13304. 6:44:43have to do is you have to go to
  13305. 6:44:45anthropic.com/console. So, let me go
  13306. 6:44:46here. anthropic.com/console.
  13307. 6:44:49You want to log in. And then you want to
  13308. 6:44:51get your API key right here.
  13309. 6:44:54Create a new key.
  13310. 6:44:55Name it whatever you want. So, let's do
  13311. 6:44:57test
  13312. 6:44:58N N
  13313. 6:45:00agent.
  13314. 6:45:01Add.
  13315. 6:45:02Copy the key. This will be the one that
  13316. 6:45:04you use to actually set back here.
  13317. 6:45:06Right? And then you'll save it. So, now
  13318. 6:45:08you connected your Claude. And then you
  13319. 6:45:09can leave this as Claude for Sonnet. And
  13320. 6:45:11now you want to hook up Perplexity to do
  13321. 6:45:12the research for this agent to make the
  13322. 6:45:14blog post. So, the way that we do that
  13323. 6:45:16is press plus, add Perplexity tool. And
  13324. 6:45:18then we go here, connect it. So, in this
  13325. 6:45:20case, the way that we connect it is go
  13326. 6:45:22here. And then in Perplexity, if you go
  13327. 6:45:24here, you can see that down below
  13328. 6:45:27to the account,
  13329. 6:45:28we go to API,
  13330. 6:45:30API keys.
  13331. 6:45:32You can create a new key.
  13332. 6:45:33Right? Or you can just copy here the one
  13333. 6:45:35that you already made. And this will be
  13334. 6:45:36the one that you then copy paste in
  13335. 6:45:38here, API key
  13336. 6:45:39to connect it. Set automatically,
  13337. 6:45:41message a model because that's the thing
  13338. 6:45:42that we're doing. Sonnet Pro is the
  13339. 6:45:44model that we're using.
  13340. 6:45:45You can use any other model. I think
  13341. 6:45:46this is fine, relatively fast. And then
  13342. 6:45:49the messages is what is the prompt that
  13343. 6:45:50we tell the AI to do. So, what is the
  13344. 6:45:52thing that we tell it to research? And
  13345. 6:45:54we let him this define it by the model
  13346. 6:45:55[music]
  13347. 6:45:56based on the context that we give. And
  13348. 6:45:58then you will leave it as user prompt
  13349. 6:45:59because user prompt is essentially your
  13350. 6:46:00task is to do XYZ. And that's fine. And
  13351. 6:46:03then we have maximum number of tokens
  13352. 6:46:05which will be automatically defined by
  13353. 6:46:06the model which just means that when a
  13354. 6:46:08blog is very very long and a lot of
  13355. 6:46:09words come out of it, it's usually token
  13356. 6:46:11intensive which means that it takes up a
  13357. 6:46:13lot of API credits. It's more expensive,
  13358. 6:46:14right? So, we would just want it to let
  13359. 6:46:17the AI handle the maximum number of
  13360. 6:46:18tokens. But we already told it to only
  13361. 6:46:20do 500 words. So, the tokens are already
  13362. 6:46:22restricted as to how many we're using
  13363. 6:46:24them. So, that's fine. And that's the
  13364. 6:46:26thing that we're going to use for
  13365. 6:46:26Perplexity.
  13366. 6:46:28So, let's actually test this cuz I
  13367. 6:46:29haven't tested the content agents. Let
  13368. 6:46:30me go here. Execute workflow. Let me go
  13369. 6:46:33to Telegram. "Can you send me a blog
  13370. 6:46:37about
  13371. 6:46:40why the Roman times
  13372. 6:46:43were the best
  13373. 6:46:46compared
  13374. 6:46:47to now.
  13375. 6:46:48Some random Okay, so we got here.
  13376. 6:46:50We'll then think through what he needs
  13377. 6:46:52to use.
  13378. 6:46:53He'll then know that he needs to use the
  13379. 6:46:54content creation agent. He'll talk to
  13380. 6:46:55Anthropic,
  13381. 6:46:57then Perplexity to do the research.
  13382. 6:46:58Again, it has different rounds, so it
  13383. 6:46:59does different types of research. And it
  13384. 6:47:01does take a bit longer than the others
  13385. 6:47:02just because it is content creation.
  13386. 6:47:03It's more uh time intensive. Now, it's
  13387. 6:47:05going back here. It's thinking through
  13388. 6:47:07what he needs to use. It'll now it'll
  13389. 6:47:08now format it in the right way so we can
  13390. 6:47:10send it to Telegram. And if I go here, I
  13391. 6:47:12can see that we have a blog about why
  13392. 6:47:15Roman times were better than compared to
  13393. 6:47:17I'm actually interested to see what it
  13394. 6:47:18says.
  13395. 6:47:18Why the glory rage of my phones?
  13396. 6:47:21Okay, it will probably say some some
  13397. 6:47:22stuff that um like smartphones are bad
  13398. 6:47:25for you or whatnot. Uh but yeah, this is
  13399. 6:47:27the whole blog that we have. All
  13400. 6:47:28automatically within what? Just a few
  13401. 6:47:30seconds. Well, I mean, like 20 seconds,
  13402. 6:47:31right? Uh so that's what we get there.
  13403. 6:47:33And this is the way [music] that we set
  13404. 6:47:35up the content creation agent. But
  13405. 6:47:36essentially, what this is, again, is a
  13406. 6:47:37multi-step agent. It's one agent that we
  13407. 6:47:40talk to you through Telegram through an
  13408. 6:47:41input and an output that has a memory
  13409. 6:47:44uh right here. It has a brain, which is
  13410. 6:47:46the LLM. And then it has different
  13411. 6:47:48tools. The tools are the things that it
  13412. 6:47:49calls when it needs to do something,
  13413. 6:47:51right? In this case, if it needs to get
  13414. 6:47:52a contact, it will talk to this tool.
  13415. 6:47:54Again, head of department uh of
  13416. 6:47:56contacts, head of emails, head of
  13417. 6:47:57calendar, head of content.
  13418. 6:47:59And then from there, it actually execute
  13419. 6:48:01the task, sends a response, and then
  13420. 6:48:02sends it back here. And then gives it to
  13421. 6:48:04us in a in a very clean, natural
  13422. 6:48:06language English way, right? That's what
  13423. 6:48:07it does. So that right there is a full
  13424. 6:48:09walk-through of the AI agent that I
  13425. 6:48:11built inside of N8N that manages my
  13426. 6:48:13contacts, calendar, emails, and even
  13427. 6:48:14drafts my content.
  13428. 6:48:19In today's video, I'm going to show you
  13429. 6:48:20step-by-step how I built a self-learning
  13430. 6:48:22AI agent inside of N8N that stores
  13431. 6:48:24long-term memory. It remembers past
  13432. 6:48:26[music] conversations from tools like
  13433. 6:48:27Telegram, and even improves itself over
  13434. 6:48:29time by writing new memories to our
  13435. 6:48:31database. All right, so the first thing
  13436. 6:48:32I want to do is actually show you the
  13437. 6:48:33live action of how it works. On the
  13438. 6:48:35left-hand side, we have Telegram because
  13439. 6:48:37Telegram is sort of like WhatsApp,
  13440. 6:48:39iMessage that you text the AI agent for
  13441. 6:48:40it to actually do something. On the
  13442. 6:48:42right-hand side here, we have
  13443. 6:48:44uh in the middle, we have the AI agent
  13444. 6:48:46in N8N. And right here, we have the
  13445. 6:48:48memory database. So database just stands
  13446. 6:48:50for a place where you put stuff, right?
  13447. 6:48:52In this case, it's going to be a Google
  13448. 6:48:53Sheet. And this is where we're going to
  13449. 6:48:55store information for the AI agent to
  13450. 6:48:57extract over time as it's giving us
  13451. 6:48:59answers. So I'm going to say
  13452. 6:49:01well, I mean, I like football. My
  13453. 6:49:03brother's name is James. I'm from Italy.
  13454. 6:49:06So let's do
  13455. 6:49:07what sport do I like?
  13456. 6:49:11In this case, it's talking to the
  13457. 6:49:13memory. It extracted all the
  13458. 6:49:14information, and now it tells us that I
  13459. 6:49:15like to play football.
  13460. 6:49:17Need some tips to want to talk to you
  13461. 6:49:18about strategies. What the hell, man?
  13462. 6:49:20Okay, there you go. All right, cool. And
  13463. 6:49:21we can ask any other questions. So let's
  13464. 6:49:22say I wanted to ask um
  13465. 6:49:25I also like dogs.
  13466. 6:49:28So let me run this first.
  13467. 6:49:30And then, let me put the message here.
  13468. 6:49:33And let me press go.
  13469. 6:49:35This will now this should add it to our
  13470. 6:49:36database.
  13471. 6:49:37You should see it right here. User also
  13472. 6:49:39likes dogs. As you can see, it's adding
  13473. 6:49:41information over time about the user so
  13474. 6:49:44that it comes to a place where you can
  13475. 6:49:45ask any questions about yourself or
  13476. 6:49:47whatever it is, or even your business or
  13477. 6:49:49your life in general, and it has
  13478. 6:49:50context, right? It has a database full
  13479. 6:49:52of contextualized information of who you
  13480. 6:49:54are, what you are, and sort of what what
  13481. 6:49:56it is that you're about, um and
  13482. 6:49:58different pieces of information like
  13483. 6:50:00this
  13484. 6:50:00that it can use to give you answers,
  13485. 6:50:02right? So it's much better than just a
  13486. 6:50:03normal AI agent that has no context to
  13487. 6:50:06you. All right, so before I get to
  13488. 6:50:07explaining the whole AI agent in N8N
  13489. 6:50:09step-by-step, I want to go through and
  13490. 6:50:11show you how this looks like in ChatGPT.
  13491. 6:50:13You're probably asking yourself, why is
  13492. 6:50:15this even relevant? Well,
  13493. 6:50:17the AI agent that we're building today
  13494. 6:50:18is an AI agent that has memory on you
  13495. 6:50:21and that updates itself over time
  13496. 6:50:23so that when it gives you answers, it
  13497. 6:50:24has context. You don't have to repeat
  13498. 6:50:26yourself. Now, with ChatGPT, we can go
  13499. 6:50:29to our profile. We can go to I believe
  13500. 6:50:31it's settings,
  13501. 6:50:33personalization. If you scroll all the
  13502. 6:50:35way down,
  13503. 6:50:36you can see here that it has memory.
  13504. 6:50:38Right now, it's 89% full, which means
  13505. 6:50:40that the memory of me that it has is 89%
  13506. 6:50:42full, and it goes to 100, and it can't
  13507. 6:50:44add more information. And if I go to
  13508. 6:50:45manage,
  13509. 6:50:47I can see now that it has different
  13510. 6:50:49pieces of information right here about
  13511. 6:50:50me
  13512. 6:50:51that it extracted or that it got
  13513. 6:50:54from the conversations that I've had
  13514. 6:50:55with it. Now, this is really really
  13515. 6:50:56powerful because it allows it to
  13516. 6:50:58reference saved memories
  13517. 6:51:00when responding.
  13518. 6:51:02And reference chat history as well. So
  13519. 6:51:04that every single time you go to
  13520. 6:51:04ChatGPT, you don't have to re-explain
  13521. 6:51:06who you are, what you've done, what your
  13522. 6:51:08business is, and so on. Um but the only
  13523. 6:51:10caveat to this is that it has a storage,
  13524. 6:51:13right? And the storage isn't a crazy
  13525. 6:51:15amount of information that you can add
  13526. 6:51:16there. Uh but it is still good to have
  13527. 6:51:18when you want to ask ChatGPT any
  13528. 6:51:19questions. So I wanted to give you this
  13529. 6:51:21as context when we explain how the AI
  13530. 6:51:23agent actually works on N8N. Now, I drew
  13531. 6:51:25up this diagram right here, which is the
  13532. 6:51:27easiest way for me to explain all these
  13533. 6:51:28concepts because it can get a bit
  13534. 6:51:29overwhelming with all this database,
  13535. 6:51:31storage, extract, information, XYZ. But
  13536. 6:51:34to put it in a simple way, what it is,
  13537. 6:51:35it's an AI agent that has an input,
  13538. 6:51:37okay? So we have an input, which is
  13539. 6:51:38Telegram. Hey, can you do XYZ?
  13540. 6:51:40What it does as a first step is that it
  13541. 6:51:42retrieves the information. Okay, so we
  13542. 6:51:44have this database right here,
  13543. 6:51:46which is called the memory AI agent,
  13544. 6:51:48which has different rows. And all these
  13545. 6:51:50different rows are pieces of information
  13546. 6:51:51that has about us. And this is what it
  13547. 6:51:53will use to then give us or use as
  13548. 6:51:56context to then give us the answer,
  13549. 6:51:57right?
  13550. 6:51:58And so that's what this is right here.
  13551. 6:52:00And when you hear database, it just
  13552. 6:52:02means an Airtable, it means a Notion, it
  13553. 6:52:03means a Google Sheet, right? Just so you
  13554. 6:52:05can store data. Then what it does is
  13555. 6:52:07that it sends the input plus the
  13556. 6:52:10retrieved information, so the memory,
  13557. 6:52:12all to the AI agent. And what the AI
  13558. 6:52:14agent does is the follows.
  13559. 6:52:16It looks at the information that it got,
  13560. 6:52:17and it thinks through itself.
  13561. 6:52:19Is this something that is worth me
  13562. 6:52:21adding to the memory database based on
  13563. 6:52:23the input? Or is it simply just a
  13564. 6:52:25question or a statement that we just
  13565. 6:52:26need to answer based on the context that
  13566. 6:52:28we got? So let's say I ask it like
  13567. 6:52:30before, I ask it, "Hey, what sport do I
  13568. 6:52:32like to play?" I say it says, "User like
  13569. 6:52:34to play sports." What it does, or user
  13570. 6:52:36like to play football. The input is,
  13571. 6:52:37"What sports do I play?" That's the
  13572. 6:52:38question. It retrieves all the
  13573. 6:52:40information from the database. Well,
  13574. 6:52:41clearly the AI agent knows that this
  13575. 6:52:43isn't a new piece of information. This
  13576. 6:52:45is just a question that we can simply
  13577. 6:52:47answer using the database that we have
  13578. 6:52:49here. So what it does is that it goes
  13579. 6:52:50straight here, and it generates a
  13580. 6:52:52contextualized answer. Now,
  13581. 6:52:53contextualized just means that it has
  13582. 6:52:55context. In this case, the context is
  13583. 6:52:57the database of memory of us,
  13584. 6:52:59right? And gives it the answer. And then
  13585. 6:53:00the output is
  13586. 6:53:02uh the output to the user. So in
  13587. 6:53:03Telegram, we get an answer back saying,
  13588. 6:53:04"Hey," or it just gives us the answer,
  13589. 6:53:06right? Like just like a general chatbot.
  13590. 6:53:09Now, there is a case where we give it
  13591. 6:53:11information, so we can say, "Hey, my
  13592. 6:53:12mom's name is Janette," or whatever it
  13593. 6:53:14is.
  13594. 6:53:15We give it here. Now, the AI agent will
  13595. 6:53:16have to classify whether that's worthy
  13596. 6:53:18of putting to the memory database.
  13597. 6:53:20If it is, then it adds the new
  13598. 6:53:22information there,
  13599. 6:53:23right? And it goes here. And so what it
  13600. 6:53:25becomes is again infinite loop that it
  13601. 6:53:26goes like round and round and round, and
  13602. 6:53:29it keeps getting smarter and smarter and
  13603. 6:53:30smarter. That's why we call it a
  13604. 6:53:31self-learning AI agent because it
  13605. 6:53:33self-learns, right? It self-learns based
  13606. 6:53:34on the questions and and statements and
  13607. 6:53:36the conversations that we give it. So in
  13608. 6:53:38N8N right here, essentially how it works
  13609. 6:53:40is that the first part is the input.
  13610. 6:53:41Okay, so all these nodes that you see
  13611. 6:53:43are actually quite easy. I'll take you
  13612. 6:53:44through exactly what it is. Uh the first
  13613. 6:53:46step is a Telegram trigger. So this
  13614. 6:53:47trigger right here is able for us to get
  13615. 6:53:51messages, right? So when I run this, let
  13616. 6:53:54me ex
  13617. 6:53:55Go here. Let me execute workflow.
  13618. 6:53:57Execute step. And I can pull up
  13619. 6:53:59Telegram.
  13620. 6:54:00And let's say I say, "My business name
  13621. 6:54:02is JM Solutions, and we help companies
  13622. 6:54:04be more efficient um
  13623. 6:54:06in their own workflows using AI and
  13624. 6:54:08automations." I can press go. What this
  13625. 6:54:11will now do, as you can see, it
  13626. 6:54:12triggered, which means that it sent the
  13627. 6:54:13information here for us to start the
  13628. 6:54:15conversation. Because a chatbot or an AI
  13629. 6:54:17agent needs to have an input, right?
  13630. 6:54:19Like what is the thing that we're
  13631. 6:54:20actually processing? What is the
  13632. 6:54:21information that we're processing? And
  13633. 6:54:23then output, which is giving us the
  13634. 6:54:24answer back. So right here in the schema
  13635. 6:54:26version, which is the normal person
  13636. 6:54:29version,
  13637. 6:54:30uh we can see that the text here is, "My
  13638. 6:54:32business is JM Solutions, XYZ." So now
  13639. 6:54:34that we have this part,
  13640. 6:54:36we send it two different ways. So the
  13641. 6:54:37first way will be to extract the memory
  13642. 6:54:40from here
  13643. 6:54:41because you're always extracting it over
  13644. 6:54:42and over again, right? So we have all
  13645. 6:54:44these pieces of information that we give
  13646. 6:54:46as context.
  13647. 6:54:47This is the first step that we do. So we
  13648. 6:54:49just connect it to the get rows in
  13649. 6:54:50sheet, which means that it gets all the
  13650. 6:54:51rows from the memory AI agent to Google
  13651. 6:54:53Sheet right here.
  13652. 6:54:55By the way, to connect your Google
  13653. 6:54:56Sheet, you have to go here,
  13654. 6:54:58sign in with Google.
  13655. 6:55:00That's it. And then we have to do sheet
  13656. 6:55:01one and leave all the filters alone
  13657. 6:55:03because in this case, we're just getting
  13658. 6:55:04all the rows,
  13659. 6:55:05and then we're giving it to the AI
  13660. 6:55:06agent.
  13661. 6:55:08Now, the only thing about this is, let
  13662. 6:55:10me just pin this. So if I pin this, I
  13663. 6:55:12don't have to rerun the whole thing
  13664. 6:55:13again.
  13665. 6:55:14The only thing about this is that it
  13666. 6:55:15gives it to us in nine items, okay? So
  13667. 6:55:18for those of you who are not familiar
  13668. 6:55:19with how arrays, iterating, aggregating
  13669. 6:55:22works, it's actually quite easy. So
  13670. 6:55:25as you can see here,
  13671. 6:55:27what this looks like is that this has
  13672. 6:55:28nine rows. So 1 2 3 4 5 6 7 8 9. Right?
  13673. 6:55:33These nine rows are the ones that we
  13674. 6:55:35get, right? So in logic, if we tell to
  13675. 6:55:38Google Sheet, "Hey, can you get all the
  13676. 6:55:39rows?" it gets nine. The only problem
  13677. 6:55:41with that is that it then processes each
  13678. 6:55:44row individually, and that's not
  13679. 6:55:45something that we want. We want it all
  13680. 6:55:47to be in one place. As in, we get all
  13681. 6:55:49these pieces of information, all the
  13682. 6:55:50rows, and it makes it into sort of like
  13683. 6:55:52a paragraph that it then gives the AI
  13684. 6:55:54agent as context. And so to do that, to
  13685. 6:55:57make it into a paragraph, or to make it
  13686. 6:55:58into
  13687. 6:56:00we call it we to aggregate it, right? We
  13688. 6:56:02use the aggregate node. So as you can
  13689. 6:56:03see here by the diagram, we're basically
  13690. 6:56:05getting all these nine rows, and we're
  13691. 6:56:07merging them, so we're putting all in
  13692. 6:56:09one place
  13693. 6:56:10to then give uh to ChatGPT as or to the
  13694. 6:56:13AI agent in this case as context. So we
  13695. 6:56:16use the aggregate node,
  13696. 6:56:18individual fields because we're doing
  13697. 6:56:19individual fields, and then the input
  13698. 6:56:21field name will be the memory.
  13699. 6:56:24Because this is the memory.
  13700. 6:56:25All I did here is I just drag this
  13701. 6:56:27across.
  13702. 6:56:28Right? And so if I execute the step,
  13703. 6:56:30what it will now do is that it will take
  13704. 6:56:31the nine items because before as you can
  13705. 6:56:33see here it's nine items. I can't see
  13706. 6:56:35all of them in the same place.
  13707. 6:56:37Also here we put them all together and
  13708. 6:56:39now this will be the thing that we give
  13709. 6:56:41to ChatGPT or to the AI agent in order
  13710. 6:56:44for it to get context before giving us
  13711. 6:56:46the answer, right? And that's all we do.
  13712. 6:56:48That's the first part. And that's what
  13713. 6:56:51we give as a first input to the AI
  13714. 6:56:54agent.
  13715. 6:56:55The second input here is the Telegram.
  13716. 6:56:58So all this is is saying hey, we can
  13717. 6:57:00either give you text or we can give you
  13718. 6:57:02audio messages, right? So if it's a text
  13719. 6:57:04we send it here, if it's an audio
  13720. 6:57:06message we send it here. So the switch
  13721. 6:57:08node, this is basically it's a node so
  13722. 6:57:10like a square that allows us to send the
  13723. 6:57:12automation two different ways based on
  13724. 6:57:14something. In this case the filter or
  13725. 6:57:16the condition is if this variable exists
  13726. 6:57:19which is audio then we send it one way
  13727. 6:57:21to extract the audio to make the audio
  13728. 6:57:23into text and then send it to the AI
  13729. 6:57:24agent. But if this variable exist then
  13730. 6:57:26what we do is we send it to the text way
  13731. 6:57:28and it just simply goes straight to the
  13732. 6:57:30AI agent. Now how do we know what
  13733. 6:57:32variables to use? Well in this case we
  13734. 6:57:34know that whenever we do an audio
  13735. 6:57:36we get this variable. So let me just
  13736. 6:57:39actually test this and show you exactly
  13737. 6:57:40what I mean just so I'm not waffling.
  13738. 6:57:42Uh let me
  13739. 6:57:43do this. There you go. I can execute the
  13740. 6:57:46step.
  13741. 6:57:48Why did not work?
  13742. 6:57:50Oh right cuz it's pinned. Let me unpin
  13743. 6:57:51this.
  13744. 6:57:53Then you go here. Execute step.
  13745. 6:57:56Okay, again execute step.
  13746. 6:57:59Never mind. Again execute step.
  13747. 6:58:02Let me go here. Execute workflow. So
  13748. 6:58:04we'll now put a new message and let me
  13749. 6:58:06go to Telegram. Let me say let me put it
  13750. 6:58:08here.
  13751. 6:58:09Let me say
  13752. 6:58:10um hello hello hello hello hello.
  13753. 6:58:13What this will now do is it will send
  13754. 6:58:15the information in Telegram to the
  13755. 6:58:17switch node.
  13756. 6:58:18And now you can see that this is green
  13757. 6:58:20because that was a voice message. So we
  13758. 6:58:22know it's a voice message because this
  13759. 6:58:24variable right here or here or here or
  13760. 6:58:26here or here, right? These are only
  13761. 6:58:29present if it's a voice message.
  13762. 6:58:31And the same thing with text. This
  13763. 6:58:33variable is only present when it's a
  13764. 6:58:35text message. And so what we do here is
  13765. 6:58:37we split it out. So we're saying hey, if
  13766. 6:58:38it's a text send it here, if it's an
  13767. 6:58:39audio send it here. Now if it's an audio
  13768. 6:58:41we have to get a file because it is file
  13769. 6:58:43and the file has a file ID. So file get
  13770. 6:58:47and then the file ID you can find
  13771. 6:58:50right here.
  13772. 6:58:51File ID.
  13773. 6:58:53To then download it to then give it to
  13774. 6:58:55AI
  13775. 6:58:57to transcribe the recording. So to
  13776. 6:58:58connect your OpenAI you have to go here.
  13777. 6:59:00You need an API key. You can simply go
  13778. 6:59:02to platform.openai.com.
  13779. 6:59:04Go to
  13780. 6:59:06Is it dashboard? Yeah. Go to API keys.
  13781. 6:59:10Press this button right here. Name it.
  13782. 6:59:12So N 8 10
  13783. 6:59:13test. I think I've made like 30,000 of
  13784. 6:59:16these.
  13785. 6:59:17And then you can copy the key and that's
  13786. 6:59:19what you bring back to the N 8 10.
  13787. 6:59:21Important thing here is that this is not
  13788. 6:59:22free as in you do have to pay.
  13789. 6:59:24But luckily for you this is not
  13790. 6:59:26expensive at all. Um you can add $5 of
  13791. 6:59:29credits for your credit card here and
  13792. 6:59:30just leave it as is. $5 can last you
  13793. 6:59:33a long while. Obviously it depends on
  13794. 6:59:35how much you use it but this is like a
  13795. 6:59:36fraction of cents when you run it. So
  13796. 6:59:38it's not noticeable.
  13797. 6:59:39Um okay. Once you connected your OpenAI
  13798. 6:59:41now you can transcribe the recording
  13799. 6:59:44audio and the input data field name
  13800. 6:59:46which is what is the thing that we're
  13801. 6:59:47giving OpenAI to take as audio and turn
  13802. 6:59:50it into text? Well that's data.
  13803. 6:59:52Because if I test this if I go here
  13804. 6:59:56So I put this. We can see that the
  13805. 6:59:58output is data and that is the input on
  13806. 7:00:00the next node data. We just drag this
  13807. 7:00:03across and we get this. So now if I
  13808. 7:00:05execute the step I should be able to see
  13809. 7:00:07hello hello hello hello. There you go.
  13810. 7:00:09Which is the audio that we gave
  13811. 7:00:11Telegram. And that's the first input.
  13812. 7:00:13The second input is simply text and we
  13813. 7:00:14turn this to text JSON message of text
  13814. 7:00:18because because this is very important
  13815. 7:00:20because when we send the input here and
  13816. 7:00:23the input here we want the output of
  13817. 7:00:26both of these to be similar or to be the
  13818. 7:00:28exact same named variable, right? What
  13819. 7:00:30that means is that
  13820. 7:00:32the output here is text so [music] we
  13821. 7:00:35also want the output here to be text. So
  13822. 7:00:38instead of message of text because this
  13823. 7:00:39wouldn't be present here in the audio it
  13824. 7:00:41would have to be something that we can
  13825. 7:00:42manipulate here.
  13826. 7:00:44Text, right? So now we have both the
  13827. 7:00:47inputs are basically the same variable
  13828. 7:00:49but it sends it different ways based on
  13829. 7:00:51the input that we give it whether it's a
  13830. 7:00:53voice message whether it's a text. Now
  13831. 7:00:54we have the merge node which merges so
  13832. 7:00:57all possible combinations. What this
  13833. 7:00:58does is that it takes this it takes the
  13834. 7:01:00uh Telegram
  13835. 7:01:02input and now if I execute the step
  13836. 7:01:05so let me actually
  13837. 7:01:07Does it work? No it didn't work. Uh so
  13838. 7:01:08let me actually start from from scratch
  13839. 7:01:10here so I can show you exactly what that
  13840. 7:01:11looks like.
  13841. 7:01:13Execute workflow.
  13842. 7:01:15Let me unpin this.
  13843. 7:01:17Go to Telegram.
  13844. 7:01:20And I can say
  13845. 7:01:23What is my brother's
  13846. 7:01:26name?
  13847. 7:01:28Right now this goes here. It extracts
  13848. 7:01:30all the memory. So you see how all nine
  13849. 7:01:31items went through here and only one
  13850. 7:01:33came out
  13851. 7:01:34because it I put them all together. And
  13852. 7:01:36now this went this way because it was
  13853. 7:01:38text and in the merge node what this did
  13854. 7:01:40is that it merged the chief on the name
  13855. 7:01:43it merged
  13856. 7:01:44the text from Telegram and also the
  13857. 7:01:45memory. So these two pieces of
  13858. 7:01:47information are the ones that are going
  13859. 7:01:48to be directly given to the AI agent to
  13860. 7:01:51do its own thing.
  13861. 7:01:53All right, enough of that. That was the
  13862. 7:01:54boring part. Now we get to the fun part
  13863. 7:01:56which is the actual AI agent. So this is
  13864. 7:01:57the thing that will think through its
  13865. 7:01:59answers. It will then call the
  13866. 7:02:01the Google Sheet tool to add memory and
  13867. 7:02:04yeah. So the first step we have to do is
  13868. 7:02:06actually define the input. So the input
  13869. 7:02:09in this case will be JSON.text.
  13870. 7:02:11And this is the one right here because
  13871. 7:02:13this is the one from Telegram. The one
  13872. 7:02:14from Telegram is the actual thing the
  13873. 7:02:15user message because the user sent us a
  13874. 7:02:17message and that's the thing that we
  13875. 7:02:18send to this here. Now we have the
  13876. 7:02:21system message and the system prompt.
  13877. 7:02:23Now I'm going to show you at the end of
  13878. 7:02:24the video how to get the whole system
  13879. 7:02:25for free so don't worry. You'll have
  13880. 7:02:27this whole prompt. But what it actually
  13881. 7:02:28tells it is an overview. So memory
  13882. 7:02:31handling so some rules and stuff,
  13883. 7:02:33response styles, the context awareness
  13884. 7:02:35and basically telling it hey
  13885. 7:02:37you're getting this memory. Basically
  13886. 7:02:39use the memory tool when you have to add
  13887. 7:02:41a new memory.
  13888. 7:02:42Don't feel forced to use memories only
  13889. 7:02:44when they add value and that's why we're
  13890. 7:02:46giving AI sort of that task to to think
  13891. 7:02:48through. Is this worth putting in the
  13892. 7:02:50memory database? If yes put it if not
  13893. 7:02:52then just answer the question and so on.
  13894. 7:02:54Um
  13895. 7:02:55and let me give it a few rules, right?
  13896. 7:02:57The example format and even the current
  13897. 7:02:58date and time because AI is not good at
  13898. 7:03:00determining date and times. So we give
  13899. 7:03:02that as well. So again you get the whole
  13900. 7:03:04prompt for free at the end of the video
  13901. 7:03:06so don't worry. But this right here is
  13902. 7:03:07really the sauce of the whole system
  13903. 7:03:08because the prompt is the thing that
  13904. 7:03:11really gives the instructions to the AI
  13905. 7:03:12agent. So if you don't instruct it well
  13906. 7:03:14then you won't get the output that you
  13907. 7:03:15want. All right, so once this is done we
  13908. 7:03:17added the system message and the user
  13909. 7:03:19message.
  13910. 7:03:20Now we have to connect the chat model.
  13911. 7:03:21So the chat model is basically the
  13912. 7:03:23brain. In this case we have to use
  13913. 7:03:24OpenAI. Again follow the same process
  13914. 7:03:26before to connect your OpenAI. I mean if
  13915. 7:03:28you connected it before you'll have the
  13916. 7:03:29same connection here. Uh the model you
  13917. 7:03:31can use 4.1 mini that's good enough.
  13918. 7:03:33Then we have the memory which is able to
  13919. 7:03:35remember the actual conversation on
  13920. 7:03:36chat. This isn't this kind of memory. Uh
  13921. 7:03:38this memory is just for conversations on
  13922. 7:03:40Telegram.
  13923. 7:03:42And then we have our nice tool right
  13924. 7:03:44here
  13925. 7:03:45which is connected to again the same
  13926. 7:03:47exact database memory AI agent. And the
  13927. 7:03:50only action it takes is just adding more
  13928. 7:03:52and more and more and more and more. So
  13929. 7:03:55you basically just feed it more and more
  13930. 7:03:56memories uh more and more sort of
  13931. 7:03:58details about yourself as context. And
  13932. 7:04:01the memory itself so the values to send
  13933. 7:04:04is just a memory. And all we do here is
  13934. 7:04:05just press this button cuz we're letting
  13935. 7:04:07N 8 10 define what is the thing or how
  13936. 7:04:09do we want to structure the input. For
  13937. 7:04:12example here I didn't tell Telegram user
  13938. 7:04:15also likes dogs. I told it hey, can you
  13939. 7:04:17also add that I like dogs, right? And so
  13940. 7:04:19what it did is that we let AI define
  13941. 7:04:21what goes in here
  13942. 7:04:22and AI defined that it should put it in
  13943. 7:04:24this way. User also likes dogs. So that
  13944. 7:04:26it's easier for for the actual system to
  13945. 7:04:28know exactly what I'm talking about,
  13946. 7:04:29right? And once this is done we have the
  13947. 7:04:31tool connected.
  13948. 7:04:33And this is where we actually add the
  13949. 7:04:35the piece of information. So let me run
  13950. 7:04:37this and I can show you exactly how this
  13951. 7:04:39looks.
  13952. 7:04:40Let me go here.
  13953. 7:04:42In this case what we can do is we can
  13954. 7:04:44say I also own a NBA team
  13955. 7:04:49called
  13956. 7:04:51Dallas Tories.
  13957. 7:04:55Wish that existed. Uh what this did is
  13958. 7:04:57that now I called the tool. So now I
  13959. 7:04:59should see here
  13960. 7:05:01that it says user owned an NBA team
  13961. 7:05:03called Dallas Tories, right? And that is
  13962. 7:05:05giving us context for the future things.
  13963. 7:05:07And that's why we call it self-learning,
  13964. 7:05:08right? That's all it is. Self-learning
  13965. 7:05:10just means that it learns over time. And
  13966. 7:05:11so that's the reason why we connect this
  13967. 7:05:12tool right here to the AI agent giving
  13968. 7:05:15the context as well. And then finally we
  13969. 7:05:17connect this to the response of
  13970. 7:05:19Telegram. So to connect your Telegram
  13971. 7:05:20account I did mention this before but
  13972. 7:05:22all you have to do is you have to ask
  13973. 7:05:25the assistant AI
  13974. 7:05:26cuz it has a whole process. So these
  13975. 7:05:28right here are the steps you have to
  13976. 7:05:29follow. For the sake of time I'm not
  13977. 7:05:31going to connect it now
  13978. 7:05:33um but if you follow these you'll be
  13979. 7:05:34fine. And you just have to press this
  13980. 7:05:36button right here. And now we can put
  13981. 7:05:37message which is what is the thing that
  13982. 7:05:39we're manipulating or changing and the
  13983. 7:05:42operation which is what is the action
  13984. 7:05:44that we're taking. In this case it's
  13985. 7:05:45sending a message but you can do a bunch
  13986. 7:05:47of stuff.
  13987. 7:05:49And then the chat ID is the ID of the
  13988. 7:05:51chat, right? Logically that's what it
  13989. 7:05:53is. But the way that Telegram works is
  13990. 7:05:55that every conversation that you have
  13991. 7:05:57has an ID attached to it, right? And so
  13992. 7:05:59if we get an input from this ID then we
  13993. 7:06:01have to give the output to that ID. So
  13994. 7:06:03logically if we get an input from this
  13995. 7:06:04ID
  13996. 7:06:06then we have to give back the output to
  13997. 7:06:07that ID because then it's in the same
  13998. 7:06:09conversation. And then the text will be
  13999. 7:06:11the JSON.output which is the one here.
  14000. 7:06:14So I just drag this across.
  14001. 7:06:17So you can see here it says got it bro.
  14002. 7:06:18I just added you
  14003. 7:06:20that you own an NBA team called Dallas
  14004. 7:06:21Tories. Anything else you want to add or
  14005. 7:06:24chat about? What the hell man? There you
  14006. 7:06:26go.
  14007. 7:06:27And everything else keep the same. So,
  14008. 7:06:29now when we get the output, this is the
  14009. 7:06:31message that we come back to Telegram uh
  14010. 7:06:33to do its own thing. And now you get to
  14011. 7:06:34see exactly how it works, but this is a
  14012. 7:06:36very simplistic version of a
  14013. 7:06:38self-learning agent. I mean, we're using
  14014. 7:06:39Google Sheets. Typically, you wouldn't
  14015. 7:06:40use Google Sheets. You maybe have an
  14016. 7:06:42airtable or even a rag database, right?
  14017. 7:06:44To store these different pieces of
  14018. 7:06:46information. Uh but, you get to see the
  14019. 7:06:48the theory, right? The theory behind it.
  14020. 7:06:50How it actually works. How it functions.
  14021. 7:06:52So, now you can apply this to any kind
  14022. 7:06:53of other database tool to store
  14023. 7:06:55information and have that retrieve it
  14024. 7:06:57every single time that it gives you
  14025. 7:06:58answers.
  14026. 7:07:02Hey, I'm about to show you how I built
  14027. 7:07:04an AI resume screening agent in N8N that
  14028. 7:07:07allows applicants to put their CVs and
  14029. 7:07:10apply for a job. What it does is that it
  14030. 7:07:12then extracts the text from that CV.
  14031. 7:07:14It then matches the text of that CV to
  14032. 7:07:16another PDF which contains the
  14033. 7:07:18requirements of what a good applicant
  14034. 7:07:20looks like for that specific job. Then
  14035. 7:07:21it uses an AI agent in order to score
  14036. 7:07:23the applicant based on different
  14037. 7:07:25criteria. Then it sends a confirmation
  14038. 7:07:27email to the applicant itself before
  14039. 7:07:28adding it to our Notion database. All
  14040. 7:07:30right, I'm going to show you the full
  14041. 7:07:31system first before we go step-by-step
  14042. 7:07:33into how it works. Uh just so you can
  14043. 7:07:34see the output. I'm going to press
  14044. 7:07:36execute workflow.
  14045. 7:07:37And this would be the form that the
  14046. 7:07:38applicant would fill out. All right, so
  14047. 7:07:40I just finished the application. And
  14048. 7:07:41also important to know that the job that
  14049. 7:07:43we're applying for is an investment
  14050. 7:07:46banking form or job, right? Um so, bear
  14051. 7:07:49in mind because the CV is tailored
  14052. 7:07:51towards that job. I'm going to press
  14053. 7:07:53submit. What this will now do is it will
  14054. 7:07:55go to Google Drive. It will upload the
  14055. 7:07:57resume. It will download the resume to
  14056. 7:07:58then extract the text. It will then go
  14057. 7:08:00to this folder right here which contains
  14058. 7:08:02a document which basically outlines the
  14059. 7:08:04qualification uh for that specific job
  14060. 7:08:07before giving it to the AI agent, the
  14061. 7:08:08text or the qualification plus the text
  14062. 7:08:10of a CV
  14063. 7:08:12before scoring it and sending the
  14064. 7:08:14applicant confirmation email and then
  14065. 7:08:16adding it to our Notion database. So, if
  14066. 7:08:17I go to my email here, I can see that I
  14067. 7:08:19have thank you for your application. Hi,
  14068. 7:08:20Mickey Kelly. Thanks for applying. We
  14069. 7:08:22received your application and our team
  14070. 7:08:23will review it shortly. We'll get back
  14071. 7:08:25to you soon with the next steps. Best
  14072. 7:08:27James Solutions. Obviously, we can
  14073. 7:08:29remove this, which is the N8N
  14074. 7:08:31attribution, and I'll show you exactly
  14075. 7:08:32how to do that. But just so you know, we
  14076. 7:08:33got it here. And if I go to my tracker,
  14077. 7:08:36I should be able to see myself in the
  14078. 7:08:37high ranking where we have Mickey Torti,
  14079. 7:08:40Kelly Torti, email, phone number. Not
  14080. 7:08:42only that, but we get to see the resume
  14081. 7:08:43link. We get to see the strength, the
  14082. 7:08:45weaknesses, the risk factor, the reward
  14083. 7:08:47factor, which are all different pieces
  14084. 7:08:49of information that's really really
  14085. 7:08:50really important for someone to then go
  14086. 7:08:52in and see exactly
  14087. 7:08:54why the person scored eight out of 10.
  14088. 7:08:56Why are they a high-ranking applicant
  14089. 7:08:57versus a medium or low-ranking
  14090. 7:08:59applicant? Like, what is that thing that
  14091. 7:09:00differentiates them and gives us data
  14092. 7:09:02based on that? Okay? So, with that said,
  14093. 7:09:05let's go step-by-step into the system
  14094. 7:09:06and how it works. And if you want a full
  14095. 7:09:08system for free, make sure to check out
  14096. 7:09:10the first link down below, which takes
  14097. 7:09:11you to my free school community right
  14098. 7:09:12here.
  14099. 7:09:13Then you go to classroom, go to the
  14100. 7:09:15templates vault, and then you'll be able
  14101. 7:09:17to see the AI resume screening agent.
  14102. 7:09:19Press this button to download it and
  14103. 7:09:21then import it into your own N8N
  14104. 7:09:22account. And if you have no clue how to
  14105. 7:09:24do that, no worries at all. You can also
  14106. 7:09:25go here, zoom in, and you will have a
  14107. 7:09:28tutorial right here. And by the way, if
  14108. 7:09:30you apply and you get in, you also get
  14109. 7:09:31access to the AI automations 101 course,
  14110. 7:09:34which is a comprehensive guide that
  14111. 7:09:35takes you from a real beginner in AI
  14112. 7:09:36automation to someone who's able to
  14113. 7:09:38build automations for themselves or for
  14114. 7:09:40their businesses. All right, so let's go
  14115. 7:09:42through this step-by-step and I'll walk
  14116. 7:09:44you through my thought process as I
  14117. 7:09:45would wanted to build this. Um I
  14118. 7:09:47basically wanted a system that could
  14119. 7:09:48process resumes, right?
  14120. 7:09:51And so, when we think of structuring a
  14121. 7:09:53system, we always think in inputs and
  14122. 7:09:55outputs, right? If I go here to my Miro,
  14123. 7:09:58which is where I basically map
  14124. 7:10:00everything out. Um the input in this
  14125. 7:10:02case would be the application, but
  14126. 7:10:04realistically it would just be the CV,
  14127. 7:10:05right? Cuz that's the thing that we're
  14128. 7:10:06that we're going towards. And the output
  14129. 7:10:08would be
  14130. 7:10:09read data, like results,
  14131. 7:10:11and data
  14132. 7:10:13on the CV
  14133. 7:10:14based on job,
  14134. 7:10:16right? qualification.
  14135. 7:10:19So, it's basically saying, "Hey, we have
  14136. 7:10:20a CV. How well did they compare to that
  14137. 7:10:22job uh from the CV that we have?"
  14138. 7:10:25So, the input CV and the last thing is
  14139. 7:10:27this, which is typically what a HR role
  14140. 7:10:29is. It's just simply to look at the
  14141. 7:10:31applicant. Are they good enough or are
  14142. 7:10:33they not good enough? Uh now, the next
  14143. 7:10:34step here
  14144. 7:10:36is to obviously extract the text.
  14145. 7:10:38There's a few steps before, but extract
  14146. 7:10:40text from CV.
  14147. 7:10:44Then match
  14148. 7:10:46against
  14149. 7:10:48qualification.
  14150. 7:10:50And then we want to use
  14151. 7:10:53AI agent to score.
  14152. 7:10:56All right, this is why I do this. Then
  14153. 7:10:57we want to send applicant email.
  14154. 7:11:01Be connected. This will be connected
  14155. 7:11:03right here, right here.
  14156. 7:11:05And then we get the results and data on
  14157. 7:11:08the CV based on job qualification, which
  14158. 7:11:09will then be added to our Notion
  14159. 7:11:11database. Cool. This is important
  14160. 7:11:13because this is how you structure
  14161. 7:11:14systems. Like, how do we think about
  14162. 7:11:15doing things? Like, what is that
  14163. 7:11:16sequential order that we go through when
  14164. 7:11:18building these automations? Now, the CV
  14165. 7:11:20itself has to be an input coming from
  14166. 7:11:23somewhere. It can be a Google Drive. It
  14167. 7:11:24can be a Google Form. It can be in this
  14168. 7:11:26case an N8N [music] form, a native form,
  14169. 7:11:29uh where someone can just submit it and
  14170. 7:11:30just give us the CV, which then kicks
  14171. 7:11:32off the um well, you could say the
  14172. 7:11:34automation, right? And so, the first
  14173. 7:11:36step to this automation is the job
  14174. 7:11:38application. It's us actually getting
  14175. 7:11:40the details. So, if I go in here, I can
  14176. 7:11:43see that we have job application. Please
  14177. 7:11:45fill out this form right here. Uh we
  14178. 7:11:46have the full name,
  14179. 7:11:48the email,
  14180. 7:11:50the phone number,
  14181. 7:11:51and then the resume. So, the resume is
  14182. 7:11:53really the thing that we I mean, we care
  14183. 7:11:54about the others as well, right? Cuz we
  14184. 7:11:55have to know their name. But, the resume
  14185. 7:11:57is the thing that we actually use to be
  14186. 7:11:59able to then score the applicant based
  14187. 7:12:01on the qualifications for that job. And
  14188. 7:12:03so, [music]
  14189. 7:12:04the way that we do this is make sure
  14190. 7:12:06that the element type So, this is
  14191. 7:12:07saying, "Hey, what is the kind of
  14192. 7:12:08response format that we want from this
  14193. 7:12:10field?" In this case, it's a file. It's
  14194. 7:12:12a bunch of fields that you can use, but
  14195. 7:12:14in this case it's a file because we want
  14196. 7:12:16a file from the applicant. Multiple
  14197. 7:12:18files is the same thing. Hey, do we
  14198. 7:12:19accept multiple files? Honestly, I don't
  14199. 7:12:21know why I have this on. I would
  14200. 7:12:22typically have this off because a CV is
  14201. 7:12:24one. Uh and we don't want multiple CVs
  14202. 7:12:26to then cuz there's one applicant. Um
  14203. 7:12:28and then the accepted file types, you
  14204. 7:12:30can leave empty to allow all the types
  14205. 7:12:32of files. So, it can be a PNG image,
  14206. 7:12:34JPG, can be a HEIC.
  14207. 7:12:37It can also be a PDF. In this case, uh I
  14208. 7:12:39would just like a PDF version. That's
  14209. 7:12:41the best way that we can use to then be
  14210. 7:12:43able to extract the text and I guess
  14211. 7:12:45compare it to the other one. Um and
  14212. 7:12:47that's it. So, we have a form which
  14213. 7:12:48looks like this. Full name, email, phone
  14214. 7:12:50number, and resume. And resume, as you
  14215. 7:12:52can see,
  14216. 7:12:53makes you choose a file.
  14217. 7:12:55And it doesn't let you choose
  14218. 7:12:56everything. It only lets you choose the
  14219. 7:12:58things that are PDFs, which is great.
  14220. 7:13:00All right, cool. Um so, once this is
  14221. 7:13:02done, the first part is obviously
  14222. 7:13:04connecting our Google Drive to N8N.
  14223. 7:13:06>> [music]
  14224. 7:13:06>> You have to go right here, create a new
  14225. 7:13:07credential, and you need a client ID and
  14226. 7:13:09client secret. For the sake of time, I'm
  14227. 7:13:11not going to go into this, but you can
  14228. 7:13:12check out this video up here if you want
  14229. 7:13:14to um see how you can do that, which
  14230. 7:13:16will take like 5 minutes. Uh and [music]
  14231. 7:13:18then we want to do file upload resume
  14232. 7:13:20because that is the name of the file
  14233. 7:13:22that we get.
  14234. 7:13:24The file name will be the person's name
  14235. 7:13:26/CV. And then you could add it to a a
  14236. 7:13:29folder called resumes or uh new
  14237. 7:13:31applicant resumes, right? For in this
  14238. 7:13:33case,
  14239. 7:13:34the root folder will be no folder. It
  14240. 7:13:35will be anywhere in the Google Drive.
  14241. 7:13:37But you could obviously put it in a
  14242. 7:13:38folder if you want everything organized
  14243. 7:13:40in one place.
  14244. 7:13:41After this, uh in order for us to be
  14245. 7:13:43able to extract the text from the CV,
  14246. 7:13:48first have to upload it. Then we have to
  14247. 7:13:50download it. So, we're downloading the
  14248. 7:13:51file, which you can find right here, ID.
  14249. 7:13:54And that's the thing that we use to then
  14250. 7:13:55download the file using the same
  14251. 7:13:57connection, right? And we get the data.
  14252. 7:14:00And this is where we're able to then
  14253. 7:14:01pull through to the next node, which is
  14254. 7:14:03extract from file. So, we're extracting
  14255. 7:14:06text from a PDF. And fundamentally, the
  14256. 7:14:08reason why we're doing these steps
  14257. 7:14:10before adding it to the AI agent is
  14258. 7:14:13because we can't give the AI agent two
  14259. 7:14:14files, right? Which is why we have to
  14260. 7:14:16download well, upload them in this case,
  14261. 7:14:18download them, and extract the text
  14262. 7:14:21right from the PDF.
  14263. 7:14:23And in this case, the uh operation,
  14264. 7:14:26which is what is the action that we're
  14265. 7:14:27taking, is extract from PDF. The input
  14266. 7:14:30binary field because this is binary.
  14267. 7:14:32When a file is uploaded and is
  14268. 7:14:34downloaded, it's binary. Uh that's just
  14269. 7:14:36a format. And then the data itself is
  14270. 7:14:38the data, right? Which is this one right
  14271. 7:14:40here. Always match this with this. As
  14272. 7:14:42you can see here, the output will be
  14273. 7:14:44text that would then be used, right?
  14274. 7:14:47The one I have here.
  14275. 7:14:49Now, once this is done, this is the
  14276. 7:14:50first step where we actually have to
  14277. 7:14:52extract the text from the CV that we're
  14278. 7:14:54getting from the applicant because
  14279. 7:14:55that's the first step. The second step
  14280. 7:14:57is this. So, we have this Google uh
  14281. 7:14:59Drive folder. And this is where this
  14282. 7:15:01part comes in, right? Matching against
  14283. 7:15:03qualifications. So, when we have to
  14284. 7:15:05match a CV against qualifications, you
  14285. 7:15:08can either add the qualifications or
  14286. 7:15:09rules in the AI agent or you can simply
  14287. 7:15:13just have another document, which can be
  14288. 7:15:15as long as you want, that will then be
  14289. 7:15:17used extract the text from here, of
  14290. 7:15:18course, and then be used to match the
  14291. 7:15:21text of the CV that we then give to the
  14292. 7:15:23AI agent to then qualify the applicant
  14293. 7:15:26and give us the results, right? And so,
  14294. 7:15:28what we do in this step is we have the
  14295. 7:15:29CV from the applicant. We basically turn
  14296. 7:15:31that into text. Then we have the initial
  14297. 7:15:33job, which is this one right here from
  14298. 7:15:35this folder. And the reason why we're
  14299. 7:15:36doing it in a Google Drive folder is
  14300. 7:15:38because we can then add more files and
  14301. 7:15:40we don't have to change this one right
  14302. 7:15:42here, the prompt here, because the
  14303. 7:15:44prompt will be dynamic based on the um
  14304. 7:15:46the thing here. And we're downloading
  14305. 7:15:48it,
  14306. 7:15:49right? Which is the investment banking
  14307. 7:15:50intern PDF, which again is the
  14308. 7:15:52qualifications. Like, what does good
  14309. 7:15:54look like for this job? We extract the
  14310. 7:15:56text from here because we're extracting
  14311. 7:15:59the text to then have the second pillar
  14312. 7:16:01because you have the CV and then we have
  14313. 7:16:02what does good look like for that
  14314. 7:16:04specific job.
  14315. 7:16:05And then these two pieces of data cuz
  14316. 7:16:07again, here will be job description
  14317. 7:16:10will then be used to send
  14318. 7:16:12to the AI agent, okay? And this is where
  14319. 7:16:15we start to analyze the CV.
  14320. 7:16:17So again, we get the CV
  14321. 7:16:19text and then get the job application,
  14322. 7:16:21which is what does good look like for
  14323. 7:16:22that specific job. He then turns that
  14324. 7:16:24into text. So, we have two pieces of
  14325. 7:16:26text and then add all of that into the
  14326. 7:16:28AI agent. If I go in here,
  14327. 7:16:30I can see that the prompt that I have is
  14328. 7:16:33a user prompt and a system prompt. The
  14329. 7:16:35first step here is making sure that we
  14330. 7:16:37have defined below because we want to
  14331. 7:16:39define exactly what the input is. This
  14332. 7:16:41is not a chat to the AI agent type
  14333. 7:16:43agent. And so, the user prompt in this
  14334. 7:16:45case is like what is the information
  14335. 7:16:46that we give the AI agent for it to
  14336. 7:16:48actually think through through its
  14337. 7:16:50system message what it needs to do,
  14338. 7:16:52right? And so, the prompt that we give
  14339. 7:16:54it is a candidate's resume, which we
  14340. 7:16:56pull in from the first extract from
  14341. 7:16:59file, which is the text right here.
  14342. 7:17:01Put it through.
  14343. 7:17:02And the [snorts] job description
  14344. 7:17:04requirements, which you get, which is
  14345. 7:17:05the one here.
  14346. 7:17:06You put it here.
  14347. 7:17:07Right. So, we have the candidate resume
  14348. 7:17:09and the job description resumes. And we
  14349. 7:17:11turn this on. So, require specific
  14350. 7:17:13output format and I'll show you exactly
  14351. 7:17:14why we do that. But, the system message
  14352. 7:17:17is really the thing that matters the
  14353. 7:17:18most. And this is quite extensive. We
  14354. 7:17:21have the overview. So, you're an expert
  14355. 7:17:22technical recruiter specializing in XYZ.
  14356. 7:17:25The output should be in the following
  14357. 7:17:27exact formats. So, we have candidate
  14358. 7:17:28strength, weaknesses, risk factor,
  14359. 7:17:30reward factor, overall fit, and
  14360. 7:17:32justification for rating. So, these are
  14361. 7:17:34the different pieces of information that
  14362. 7:17:36we want from the AI to do. So, it's an
  14363. 7:17:39extensive analysis of both the CV and
  14364. 7:17:42the qualification of what it looks to be
  14365. 7:17:44good for that specific job. And then we
  14366. 7:17:45give the job description here, which
  14367. 7:17:47again is basically like a double input
  14368. 7:17:49because we give it also here. Um I don't
  14369. 7:17:51think you have to give it in both ways,
  14370. 7:17:53but you can.
  14371. 7:17:54Now, one important thing is that I did
  14372. 7:17:56tell it to give me the output as
  14373. 7:17:57candidate strength, which is one
  14374. 7:17:59variable, weakness, another one, risk
  14375. 7:18:00factor, reward factor, and overall fit
  14376. 7:18:03and justification. So, six variables.
  14377. 7:18:05When we give AI the ability to give us
  14378. 7:18:07six variables,
  14379. 7:18:08we want the output to look like this.
  14380. 7:18:11Right? And for the output to look like
  14381. 7:18:12this, we have to get it in a very very
  14382. 7:18:14specific format. And in order for us to
  14383. 7:18:16get something in a very specific format,
  14384. 7:18:18we have to make sure that we have a
  14385. 7:18:20structured output parser. So, this is
  14386. 7:18:22saying, "Hey, this is the data that's
  14387. 7:18:23unstructured. That's a block of text,
  14388. 7:18:25right? Which contains weaknesses,
  14389. 7:18:26strength, XYZ." And then we run it
  14390. 7:18:29through this right here.
  14391. 7:18:31This code, which is defined using JSON.
  14392. 7:18:33And if you're looking at this and
  14393. 7:18:34thinking, "What even is this?" It's
  14394. 7:18:36actually quite easy. Ah, so don't worry.
  14395. 7:18:38But, what it is, it's JSON that tells
  14396. 7:18:40us, "Hey, we want the output in
  14397. 7:18:42description. We want the candidate
  14398. 7:18:44strength. We want the weaknesses. We
  14399. 7:18:45want the um the risk factor, which is an
  14400. 7:18:48object, explanation, which is a string."
  14401. 7:18:50So, these are all different types of
  14402. 7:18:51variables and we give the explanation of
  14403. 7:18:53what each one does, right? We'll do
  14404. 7:18:55description, description, and so on. And
  14405. 7:18:57so, [music] what happens here is that it
  14406. 7:18:59first talks to this chatbot, which you
  14407. 7:19:00connect here.
  14408. 7:19:01Go to OpenAI.
  14409. 7:19:04And then connect your OpenAI by going to
  14410. 7:19:05platform.openai.com.
  14411. 7:19:07You can go to dashboard
  14412. 7:19:09right here. You can go to API keys.
  14413. 7:19:12Create a new secret key. Make a key
  14414. 7:19:13right here. And then paste that key back
  14415. 7:19:15into N 8 N, right? And then you press
  14416. 7:19:17save and you connect it. GPT-4.1 mini is
  14417. 7:19:20great.
  14418. 7:19:21Once you have this connected, right?
  14419. 7:19:22This is the thing that it will use to
  14420. 7:19:24then think through exactly what the
  14421. 7:19:26rating could be. Yeah, how it would rate
  14422. 7:19:28the applicant based on the requirements
  14423. 7:19:29for that job. And so, again, we get two
  14424. 7:19:31different pieces of information here. It
  14425. 7:19:33then ranks or it then rates this. Let me
  14426. 7:19:35show you exactly what if we don't have
  14427. 7:19:36this.
  14428. 7:19:37Pin this.
  14429. 7:19:38Pin. I believe you can pin this.
  14430. 7:19:41Okay, cool.
  14431. 7:19:42Here I can execute step. Please unpin
  14432. 7:19:44extract text and try again. Okay, I
  14433. 7:19:46think I have to start from zero. That's
  14434. 7:19:48okay. That is okay. That is okay. I'll
  14435. 7:19:50start from zero. Let's do it. Let me
  14436. 7:19:52unpin this. Let me extract that. [music]
  14437. 7:19:54Let me go here.
  14438. 7:19:55Let me put a CV. Just submit this. Put
  14439. 7:19:58some random email. I just want you to
  14440. 7:19:59see exactly like what it would look like
  14441. 7:20:01if we didn't have this plus when we do
  14442. 7:20:02have this.
  14443. 7:20:03So, it's doing everything that we want.
  14444. 7:20:05And now the AI agent, well, as you can
  14445. 7:20:07see, we got the output. And the output
  14446. 7:20:09in this case, as you can see, is just a
  14447. 7:20:11block of text.
  14448. 7:20:13It's a block of text that looks like
  14449. 7:20:15this,
  14450. 7:20:16which has all the weaknesses, all the
  14451. 7:20:18strength, and so on. So, something like
  14452. 7:20:20this we can't add into a database in
  14453. 7:20:22Notion,
  14454. 7:20:23right? Or anywhere in Google Sheets,
  14455. 7:20:24whatever it is they use,
  14456. 7:20:26in a very structured format with each
  14457. 7:20:27column. And so, what we do is then we
  14458. 7:20:30add this here, right? We are able to
  14459. 7:20:32then um
  14460. 7:20:33make sure the information is in
  14461. 7:20:34different variables.
  14462. 7:20:36The next step, once we have this, once
  14463. 7:20:38you have the whole rating, weaknesses,
  14464. 7:20:39strength, XYZ, or we go to the next
  14465. 7:20:41step, which is sending an email. So, we
  14466. 7:20:43send a confirmation email.
  14467. 7:20:45Uh this is a Gmail node. All you have to
  14468. 7:20:47do is first connect your account. Sign
  14469. 7:20:49in with Google,
  14470. 7:20:50which will take you to this page. Make
  14471. 7:20:52sure you have the right account.
  14472. 7:20:53Then bring it back. Very very easy.
  14473. 7:20:56And then we want to do message because
  14474. 7:20:57that is the thing we're manipulating.
  14475. 7:20:58Send because that is the action we're
  14476. 7:21:00taking.
  14477. 7:21:01To, so who are we sending the email to?
  14478. 7:21:03Well, this is something that we get from
  14479. 7:21:04here, the email.
  14480. 7:21:06Subject line, thank you for application.
  14481. 7:21:08And then we want to put the body um
  14482. 7:21:11the text, right? And the way that we do
  14483. 7:21:13that is through HTML. HTML is just the
  14484. 7:21:15way that you make your emails look
  14485. 7:21:16pretty. You could also not use HTML and
  14486. 7:21:19it doesn't really matter.
  14487. 7:21:21You were not adding any links or
  14488. 7:21:21anything. Um
  14489. 7:21:23and the email is hey.
  14490. 7:21:26So, hey us in this case because S is a
  14491. 7:21:28the full name. Let me go here for a
  14492. 7:21:29second.
  14493. 7:21:31Let me manipulate the the full name so
  14494. 7:21:33you get to see what an actual full name
  14495. 7:21:35looks like.
  14496. 7:21:36Mikaela Torti.
  14497. 7:21:37There we go. Save.
  14498. 7:21:39And here
  14499. 7:21:40you get to see
  14500. 7:21:42that the full name turns into a first
  14501. 7:21:44name. And the way that we do that is
  14502. 7:21:45using formulas. So, the formula here,
  14503. 7:21:47the way that it works, and this might
  14504. 7:21:48look complex to someone who has never
  14505. 7:21:50seen uh this type of formulas, but it
  14506. 7:21:52looks like this, right? And the logic
  14507. 7:21:54that I go through when I make formulas
  14508. 7:21:55is the following. So, we have the full
  14509. 7:21:57name,
  14510. 7:21:58which is Mikaela Torti.
  14511. 7:21:59And the full name, ideally, is Mikaela
  14512. 7:22:02Torti. is separated into the first name
  14513. 7:22:05and the last name. And between the first
  14514. 7:22:07name and the last name, there is a a
  14515. 7:22:09space.
  14516. 7:22:10So, if we split this and this by the
  14517. 7:22:13presence of a space, then we get
  14518. 7:22:15this. We get one
  14519. 7:22:17and we get two.
  14520. 7:22:18And now, if you want to get the first
  14521. 7:22:20one,
  14522. 7:22:21then we just have to use
  14523. 7:22:23first
  14524. 7:22:24to then get
  14525. 7:22:25the uh the first name. So, the way that
  14526. 7:22:27this works is that we're saying, "Okay,
  14527. 7:22:28this is the full name cuz this is the
  14528. 7:22:30variable.
  14529. 7:22:32Let's split this by the presence of a
  14530. 7:22:34space because this is the space.
  14531. 7:22:36And then let's get the first one.
  14532. 7:22:39Mikaela.
  14533. 7:22:40Right? And it's actually quite easy once
  14534. 7:22:41you actually break it down that way.
  14535. 7:22:42But, if you look at this
  14536. 7:22:43at hand side, you think, "What what the
  14537. 7:22:45is this?" Um but, that's what it
  14538. 7:22:47means. So, "Hey Mikaela, thanks for
  14539. 7:22:48applying. We received your application
  14540. 7:22:50and our team will review it shortly.
  14541. 7:22:51We'll get back to you with the next
  14542. 7:22:52steps um as well. We should probably be
  14543. 7:22:55able to put this right here,
  14544. 7:22:58which by the way, this stands for
  14545. 7:23:00>> [music]
  14546. 7:23:00>> break.
  14547. 7:23:01This is a new line, right? So, we have
  14548. 7:23:03new lines here.
  14549. 7:23:04That's it.
  14550. 7:23:05And then we have Notion. So, the way
  14551. 7:23:08that Notion works is that we set up a
  14552. 7:23:09workspace so that we have one database.
  14553. 7:23:12So, this is the same exact database,
  14554. 7:23:13right? This, this, this, and this. It's
  14555. 7:23:16just the way that we look at the
  14556. 7:23:17database just different. So, in here, we
  14557. 7:23:20have a filter,
  14558. 7:23:21which is like, "Hey, the low applicants
  14559. 7:23:23are everybody that has a score less than
  14560. 7:23:26five.
  14561. 7:23:27Medium applicants are the ones that have
  14562. 7:23:28a score more than four and less than
  14563. 7:23:30seven. And then high-ranking applicants
  14564. 7:23:32have a score
  14565. 7:23:34um more than six, right? And that's it."
  14566. 7:23:37But, if I just took the filter out
  14567. 7:23:39right here, you could see that I have
  14568. 7:23:41the applicant right here. It's just
  14569. 7:23:42because we have a filter that we don't
  14570. 7:23:43see the applicants. So, we're able to
  14571. 7:23:45just basically sort or filter by all the
  14572. 7:23:47low applicants, medium, and high-ranking
  14573. 7:23:49as well. And then we have applications,
  14574. 7:23:51which shows us the amount of
  14575. 7:23:51applications that we get over time,
  14576. 7:23:53right? Now, you could use a Google
  14577. 7:23:55Sheets for this. It's not really crazy
  14578. 7:23:56one of a difference. It's just the fact
  14579. 7:23:57that we can filter and we can do so much
  14580. 7:23:59more in Notion than we can on Google
  14581. 7:24:00Sheets. So, when we set this up, the
  14582. 7:24:02first thing you have to do is go in
  14583. 7:24:03here.
  14584. 7:24:04You have to make sure that you can
  14585. 7:24:06create a new credential. I recommend
  14586. 7:24:08that you ask the AI assistant for what
  14587. 7:24:09to do here
  14588. 7:24:11cuz it is a bit of a longer process, but
  14589. 7:24:12actually takes 2 minutes.
  14590. 7:24:14Um and get the internal um integration
  14591. 7:24:16secret. By the way, the alternative of
  14592. 7:24:18this is Google Sheets, so you can use
  14593. 7:24:19either.
  14594. 7:24:20And it walks you through everything. Um
  14595. 7:24:22yeah.
  14596. 7:24:23And then, once you have that, make a
  14597. 7:24:25database that has these columns right
  14598. 7:24:27here. Applicant name, first name, last
  14599. 7:24:28name, email, phone number, application
  14600. 7:24:30date, resume, strength, weakness, risk
  14601. 7:24:31factor, reward factor, overall fit, and
  14602. 7:24:33justification. And these are the fields.
  14603. 7:24:35So, in this case, we have a title, which
  14604. 7:24:37is
  14605. 7:24:37the name,
  14606. 7:24:39first name, which is the name first
  14607. 7:24:40name, last name, last name, email,
  14608. 7:24:41email, phone, and so on. And now, we
  14609. 7:24:44actually forgot to put the date.
  14610. 7:24:46So, you can put a date as now. And the
  14611. 7:24:47way that that works is it's asking me
  14612. 7:24:49for a date.
  14613. 7:24:50And I know that the
  14614. 7:24:53the date in N 8 N is curly brackets
  14615. 7:24:55because it's inside a variable, right?
  14616. 7:24:57So, we have a variable here,
  14617. 7:25:00which is like this. Inside, what you do
  14618. 7:25:02a dollar sign.
  14619. 7:25:03Now.
  14620. 7:25:05And this is the output that we get. Now,
  14621. 7:25:06ideally, we don't want it in this output
  14622. 7:25:07because we still have words.
  14623. 7:25:09So, we put a format
  14624. 7:25:12like this.
  14625. 7:25:13So, we format it in this way, which will
  14626. 7:25:15then be good to then send it to Notion.
  14627. 7:25:17And then we have the resume,
  14628. 7:25:18uh strength, and weaknesses, and risk
  14629. 7:25:20factor, reward factor, overall fit, and
  14630. 7:25:22justification. So, these are all the
  14631. 7:25:23fields that we're going to Notion to
  14632. 7:25:25then uh rate the applicant. And that's
  14633. 7:25:26how we get everything
  14634. 7:25:28to here.
  14635. 7:25:29Right? Applications, uh high-ranking,
  14636. 7:25:31and low-ranking, and so on.
  14637. 7:25:33All right. Let's start from zero and
  14638. 7:25:34I'll take you through exactly like the
  14639. 7:25:36the data and so on, which I did before,
  14640. 7:25:37but now we go into detail. Want to
  14641. 7:25:39execute a workflow.
  14642. 7:25:40I'm going to call this
  14643. 7:25:42let's say James Low.
  14644. 7:25:45My email still. Phone number.
  14645. 7:25:48Then my CV, which is not really my CV.
  14646. 7:25:50It's one of my friends. So, if you're
  14647. 7:25:51looking at this, man, we'll we'll break
  14648. 7:25:52it out to everyone. Uh press submit.
  14649. 7:25:55And then this now goes to the to the
  14650. 7:25:57Google Drive folder. It downloads the
  14651. 7:25:58file. It extracts the text.
  14652. 7:26:00Right? So, we have the text.
  14653. 7:26:02It extracts this uh PDF's text,
  14654. 7:26:05right? Right here. It then uses AI
  14655. 7:26:07to think through its output right here.
  14656. 7:26:10And now I get me an error. So, what was
  14657. 7:26:11the error?
  14658. 7:26:12Send email confirmation. Unable to sign
  14659. 7:26:14in. Oh, okay, cuz I put the wrong
  14660. 7:26:16account. There we go.
  14661. 7:26:17Yeah, I think this works. Execute step.
  14662. 7:26:20Yeah, send. And then lastly,
  14663. 7:26:22we have notion, right? Which adds the
  14664. 7:26:24applicant, James Low, should be able to
  14665. 7:26:27add it to the high ranking, James Low.
  14666. 7:26:29There you go, with everything.
  14667. 7:26:31Even the date right here. As you can
  14668. 7:26:32see, it's different from this one
  14669. 7:26:34because we forgot to add it there. We
  14670. 7:26:36have the resume link right here.
  14671. 7:26:38And then we have the strength, weakness,
  14672. 7:26:39risk factor, reward factor, overall fit,
  14673. 7:26:41and justification. That's it. Now,
  14674. 7:26:43something like this could be very, very
  14675. 7:26:44beneficial for any kind of business that
  14676. 7:26:45is hiring new applicants. And there's so
  14677. 7:26:48much more that you can do with hiring.
  14678. 7:26:49Because stuff like these takes 10, 15
  14679. 7:26:52minutes, or even 5 minutes for someone
  14680. 7:26:53to match a CV to someone else or to
  14681. 7:26:56another qualification. And if they have
  14682. 7:26:58hundreds of applicants, then that's
  14683. 7:26:59hundreds of hours that they have to
  14684. 7:27:00spend to actually doing this tedious
  14685. 7:27:02task that AI could literally do in
  14686. 7:27:05seconds. And teams literally spend tens
  14687. 7:27:06of thousands of dollars of for people or
  14688. 7:27:09team members to be able to do this task,
  14689. 7:27:11which is insane. Cuz now AI could
  14690. 7:27:13actually do them for you.
  14691. 7:27:17Hey, in this video I'm going to build an
  14692. 7:27:18email classifier AI agent inside of N8N
  14693. 7:27:22that watches your emails coming through.
  14694. 7:27:24It then classifies them based on
  14695. 7:27:25different criterias. It then uses a
  14696. 7:27:27series of AI agents that will now write
  14697. 7:27:30back an email, which will then be
  14698. 7:27:31drafted into our inbox. All right, so
  14699. 7:27:33this right here is the email classifier
  14700. 7:27:34system. All I have to do is send myself
  14701. 7:27:36an email. I'm going to go here. So I
  14702. 7:27:38said, "Hey, question about company. Hey
  14703. 7:27:40Mick Kelly, I have a quick question.
  14704. 7:27:41What do you guys do and what is your
  14705. 7:27:42service?" I'm going to press send.
  14706. 7:27:44This should now come to this inbox. As
  14707. 7:27:46you can see, we just got the email,
  14708. 7:27:47question about company. All I have to do
  14709. 7:27:49here, I'm going to test this. I'm going
  14710. 7:27:50to press execute workflow. This will now
  14711. 7:27:52get the email that it used. It
  14712. 7:27:54classified it as a customer support
  14713. 7:27:55email. It will now generate a draft
  14714. 7:27:57email that we can find here. If I go to
  14715. 7:27:59support, I can see that this email right
  14716. 7:28:01here, question about company.
  14717. 7:28:03See here? And we generated a draft email
  14718. 7:28:05to that question that we can now
  14719. 7:28:07double-check before sending it to the
  14720. 7:28:08customer who wrote the email. And this
  14721. 7:28:10is the exact same concept when it comes
  14722. 7:28:12to high priority, promotion, and finance
  14723. 7:28:14and billing. Right. Here we have
  14724. 7:28:16promotion, priority, and finance and
  14725. 7:28:18billing. All right, so let's build the
  14726. 7:28:19whole system step-by-step. As I always
  14727. 7:28:21say, we shouldn't build it first, we
  14728. 7:28:22should map it out first to then have a
  14729. 7:28:24strategy or an action plan when we build
  14730. 7:28:26it, cuz it makes it so much easier for
  14731. 7:28:28us. I'm going to go here, and for every
  14732. 7:28:30automation that we do, we have an input
  14733. 7:28:33and we have an output. All right, so in
  14734. 7:28:35this case, the input would be the email
  14735. 7:28:37coming through. So, watch your emails.
  14736. 7:28:40Then we want to classify the email,
  14737. 7:28:43right? Cuz we want to have that first
  14738. 7:28:44before
  14739. 7:28:46labeling it and before writing a draft
  14740. 7:28:48email that will then be drafted into our
  14741. 7:28:49inbox, right? So, we have this step
  14742. 7:28:52right here. We have uh label email.
  14743. 7:28:57Or was it classify email? Yeah, classify
  14744. 7:28:58email. And we can classify it based on
  14745. 7:29:03support.
  14746. 7:29:04We had What was it? Priority.
  14747. 7:29:07We then had urgent. No, that was urgent.
  14748. 7:29:10Was it urgency?
  14749. 7:29:12Promotion, finance and billing, and
  14750. 7:29:13priority. Yeah.
  14751. 7:29:14Promotion.
  14752. 7:29:18Finance and billing.
  14753. 7:29:20All right, so we are taking
  14754. 7:29:22the new emails that come through from
  14755. 7:29:23our inbox.
  14756. 7:29:24We are then sending it to an AI to
  14757. 7:29:26classify emails based on whether they
  14758. 7:29:28are support, priority, promotion, and
  14759. 7:29:29finance and billing. Then what we're
  14760. 7:29:31doing at that point is we are
  14761. 7:29:33sending it. Let me put it here. We're
  14762. 7:29:35sending it
  14763. 7:29:36to the appropriate AI agent.
  14764. 7:29:39To AI agent.
  14765. 7:29:41To correct AI agent.
  14766. 7:29:43No, actually no, we should label the
  14767. 7:29:45email first, right? Label the email.
  14768. 7:29:47And then we
  14769. 7:29:52use
  14770. 7:29:53AI agent
  14771. 7:29:55to
  14772. 7:29:57draft email reply.
  14773. 7:30:00And then we actually draft a reply
  14774. 7:30:04to inbox.
  14775. 7:30:07So, that's I think that's the I think
  14776. 7:30:09that's what we want to do. Keep it
  14777. 7:30:11simple, right? We're getting an email,
  14778. 7:30:12classifying it, then we're sending it to
  14779. 7:30:14the appropriate AI agent to do its own
  14780. 7:30:16thing, to label it first.
  14781. 7:30:18Or you can do that you can do the
  14782. 7:30:19inverse as well. You can
  14783. 7:30:20generate a reply and then label it, but
  14784. 7:30:22I feel like
  14785. 7:30:24um it'd be easier to just label it first
  14786. 7:30:26and then draft it. And then we actually
  14787. 7:30:28draft a reply to the inbox. I do think
  14788. 7:30:30though that when the email is urgent, we
  14789. 7:30:33shouldn't draft a reply to the inbox. We
  14790. 7:30:35should send message to team on Telegram.
  14791. 7:30:42Okay? Because the fact that they're
  14792. 7:30:43urgent makes it so that we have to
  14793. 7:30:45notify our team to do its thing. To
  14794. 7:30:47actually go there and and and check it
  14795. 7:30:49and send it through. Um
  14796. 7:30:50or reply themselves, right? In that
  14797. 7:30:51case.
  14798. 7:30:52All right, so we're going to use this
  14799. 7:30:53when we actually build the system. So,
  14800. 7:30:54let me go to a new workflow. All right,
  14801. 7:30:56I have a new workflow right here. I can
  14802. 7:30:57put email classifier AI agent. And now,
  14803. 7:31:02the way that we start is with the first
  14804. 7:31:03step. So, the first step is watching
  14805. 7:31:05your emails. So, I go here.
  14806. 7:31:06And I go to Gmail, because that is the
  14807. 7:31:08provider. If you're using Outlook, I
  14808. 7:31:10believe that you can do it.
  14809. 7:31:12Outlook. On message received. Yeah, so
  14810. 7:31:15you can do it.
  14811. 7:31:16Um
  14812. 7:31:17but we're using Gmail cuz we're Google
  14813. 7:31:18folks.
  14814. 7:31:19And then, the first step of the
  14815. 7:31:21automation is a trigger. So, the trigger
  14816. 7:31:23is what is the thing that starts
  14817. 7:31:25automation? Like how do how do we start
  14818. 7:31:26it? Well, in this case, we only have one
  14819. 7:31:28trigger, which is on message received.
  14820. 7:31:30Which is basically saying, "Hey,
  14821. 7:31:32when we receive a message, in this case
  14822. 7:31:33a message is an email, then we start the
  14823. 7:31:35automation." And the first thing we have
  14824. 7:31:37to do is connect our account to N8N. All
  14825. 7:31:39you have to do is create new credential.
  14826. 7:31:41You can press sign in with Google. This
  14827. 7:31:43will take you to this page right here.
  14828. 7:31:44Choose an account and then bring it
  14829. 7:31:45back.
  14830. 7:31:46I already have it connected.
  14831. 7:31:48Which would be James Solutions email.
  14832. 7:31:52And now, we are given different options.
  14833. 7:31:54So, we're given poll times, which means
  14834. 7:31:57do you want to check it every minute? Do
  14835. 7:31:59you want to check it every hour, every
  14836. 7:32:01day, every week, every month, every X
  14837. 7:32:02custom? In this case, we can just do
  14838. 7:32:07we can just leave it. Leave it blank.
  14839. 7:32:09And the event itself will be message
  14840. 7:32:10received, right? Because that is the
  14841. 7:32:12action that we're doing. We're receiving
  14842. 7:32:13a message and then we're starting the
  14843. 7:32:14automation. Simplify just means you want
  14844. 7:32:16to simplify the data that we get
  14845. 7:32:17through. And I'll show you exactly what
  14846. 7:32:19what that looks like. And
  14847. 7:32:22that's it.
  14848. 7:32:23So, we're going to need to test this by
  14849. 7:32:25sending ourselves an email
  14850. 7:32:27to the inbox of the email that you
  14851. 7:32:29connected the Gmail with.
  14852. 7:32:31So, I'm going to go here, send myself an
  14853. 7:32:32email.
  14854. 7:32:35Customer su-
  14855. 7:32:37support question.
  14856. 7:32:40Hey, what's your return policy?
  14857. 7:32:43I'm going to press send.
  14858. 7:32:45I'm going to go to my inbox. All right,
  14859. 7:32:47so we have the email here, customer
  14860. 7:32:48support question. And now I can press
  14861. 7:32:50execute workflow. So, this is now
  14862. 7:32:52testing the the actual automation. Cuz
  14863. 7:32:54when we build automations,
  14864. 7:32:55uh even AI agents, I mean everything in
  14865. 7:32:57general with N8N, we want to be able to
  14866. 7:32:58test every single time.
  14867. 7:33:00So, we have this here.
  14868. 7:33:02This is the data that we got.
  14869. 7:33:03Hey, what's your return policy? I
  14870. 7:33:06believe this is because we put an
  14871. 7:33:07apostrophe, and this is how it um
  14872. 7:33:10classifies it.
  14873. 7:33:11I'm going to pin this so that when I go
  14874. 7:33:13to the next steps, I don't have to rerun
  14875. 7:33:15the automation every single time. All
  14876. 7:33:16right, now once this is done, I can go
  14877. 7:33:18to the next step. So, this is green
  14878. 7:33:21to classify the email based on whether
  14879. 7:33:22it's support, priority, promotion, and
  14880. 7:33:24finance and billing.
  14881. 7:33:25I'm going to go here, press plus. I'm
  14882. 7:33:27going to go classify text classifier
  14883. 7:33:29right here. It's actually a pretty good
  14884. 7:33:31feature, I'm not going to lie.
  14885. 7:33:32Um because we are
  14886. 7:33:35as in the system is set up so that we
  14887. 7:33:36give a text, which is the snippet,
  14888. 7:33:38which is the actual email. [music] And
  14889. 7:33:39then, what we do is we start adding
  14890. 7:33:41categories. So, categories would be
  14891. 7:33:43maybe the support, and you put a
  14892. 7:33:45description of what a support email is.
  14893. 7:33:47So,
  14894. 7:33:48this is for support emails asking just
  14895. 7:33:50general questions. Then category, you
  14896. 7:33:52can do priority.
  14897. 7:33:55Can do email require attention, action
  14898. 7:33:57typically from key stakeholders,
  14899. 7:33:59clients, ASAP, immediate deadlines, all
  14900. 7:34:01that stuff. Then we have the next one,
  14901. 7:34:02which is uh promotions.
  14902. 7:34:05I'm going to go here, promotions. And
  14903. 7:34:07then, this will be emails related to
  14904. 7:34:09marketing campaigns and so on. Or
  14905. 7:34:11description, emails related to finance
  14906. 7:34:12matters such as invoices, billing
  14907. 7:34:14statements, payment reminders, uh or
  14908. 7:34:16expense reports, anything involved
  14909. 7:34:17transactions and so on. Okay? So, again,
  14910. 7:34:19we have the support, which is this, and
  14911. 7:34:21I'm going to paste the one that I had
  14912. 7:34:22before cuz it it is more sophisticated.
  14913. 7:34:25So, emails related to ongoing
  14914. 7:34:26communication with current clients or
  14915. 7:34:28including stakeholders, including
  14916. 7:34:29service requests, feedback, support
  14917. 7:34:31tickets, and inquiries, keyword
  14918. 7:34:32requests, and So, we give it a few
  14919. 7:34:34examples of also keywords. Same thing
  14920. 7:34:36with priority.
  14921. 7:34:37Promotions. And we have
  14922. 7:34:41finance and billing.
  14923. 7:34:43And one thing we also have is the system
  14924. 7:34:45prompt template. We'll leave it like
  14925. 7:34:47this. I think it's pretty good. Please
  14926. 7:34:48classify the text provided by the user
  14927. 7:34:50into one of the following categories,
  14928. 7:34:52categories, which is the ones up here.
  14929. 7:34:54And use the provided formatting
  14930. 7:34:55instructions below. Don't explain and
  14931. 7:34:57only output the JSON.
  14932. 7:34:59Which is perfect. So, now if I execute
  14933. 7:35:01this step,
  14934. 7:35:04a model subnode must be connected.
  14935. 7:35:05Right. I don't know why I'm tripping,
  14936. 7:35:07but we have to connect the model to this
  14937. 7:35:09because it is run by AI.
  14938. 7:35:11Uh and feel free to choose anything,
  14939. 7:35:13even OpenAI, it's fine. In order to
  14940. 7:35:15connect your OpenAI, make sure to go to
  14941. 7:35:17platform.openai.com.
  14942. 7:35:20You can go to the dashboard.
  14943. 7:35:22Go to API keys.
  14944. 7:35:25Make a key right here.
  14945. 7:35:26And then copy the key and bring it all
  14946. 7:35:28the way back to N8N.
  14947. 7:35:30And then connect your account. Press
  14948. 7:35:31sign in.
  14949. 7:35:32Once this is done, you will have your
  14950. 7:35:33account connected. You can use 4.1 mini.
  14951. 7:35:36We have different models as well that we
  14952. 7:35:37can use. I think 4.1 mini is great. In
  14953. 7:35:40my previous video, I spoke about how you
  14954. 7:35:41can use OpenRouter, which is the thing
  14955. 7:35:43that allows us to be able to choose any
  14956. 7:35:45model that we want without having to
  14957. 7:35:47make a cloud connection, OpenAI
  14958. 7:35:48connection, everything else. Check it
  14959. 7:35:50out up here. Um
  14960. 7:35:51good video.
  14961. 7:35:53But now we use OpenAI. So, now we can
  14962. 7:35:55execute this step. This should now work.
  14963. 7:35:58And we can see that
  14964. 7:36:01these are all the branches that we have,
  14965. 7:36:02support, priority, and promotions,
  14966. 7:36:04finance and billing. And it went down
  14967. 7:36:05the support branch.
  14968. 7:36:08Because the question was, "Hey, what's
  14969. 7:36:10your return policy?" So, that is a
  14970. 7:36:11support question.
  14971. 7:36:13So, you can see here, we have different
  14972. 7:36:15options, right? Cuz we put different
  14973. 7:36:16categories and each category represents
  14974. 7:36:18a path that the automation can go
  14975. 7:36:20through. Like priority, promotions,
  14976. 7:36:21finance and billing. So, what we're
  14977. 7:36:23going to do now is we're going to go to
  14978. 7:36:24the next steps, which is
  14979. 7:36:27not this. This is green.
  14980. 7:36:29Labeling the emails, right? And so, if I
  14981. 7:36:31go to here, I can then add the node,
  14982. 7:36:34which is Gmail.
  14983. 7:36:36I believe this is add label to message.
  14984. 7:36:38Same connection.
  14985. 7:36:40The resource, which is what is the thing
  14986. 7:36:41that we're actually manipulating, it
  14987. 7:36:42will be message. The action that we're
  14988. 7:36:44taking is operation. The message ID is
  14989. 7:36:47something that you can actually get
  14990. 7:36:49down here.
  14991. 7:36:50So, this will be
  14992. 7:36:53ID.
  14993. 7:36:56And if that's not the right one, then
  14994. 7:36:57we'll we'll change it later. But, I
  14995. 7:36:58believe this Yeah, this is ID. And then,
  14996. 7:37:00the label names or IDs, you can choose
  14997. 7:37:03from your inbox right here, right? Now,
  14998. 7:37:06as you can see here, I already have the
  14999. 7:37:08different labels. So, if you don't see
  15000. 7:37:10them here,
  15001. 7:37:11it's because you didn't add them here.
  15002. 7:37:13So, if I add, let's say
  15003. 7:37:16test, right? If I press create,
  15004. 7:37:18now I have test. If I go here,
  15005. 7:37:21I should be able to see
  15006. 7:37:23test. Let me refresh actually. It
  15007. 7:37:25doesn't show immediately.
  15008. 7:37:29There you go, test, right? So, it's only
  15009. 7:37:31because you don't have them here that it
  15010. 7:37:33doesn't show up on end-to-end. So, make
  15011. 7:37:35sure to add your labels to your emails
  15012. 7:37:37uh to then be able to see them in your
  15013. 7:37:39automation so you can add them to the
  15014. 7:37:40inbox.
  15015. 7:37:42Cool. So, now this will be the first
  15016. 7:37:44category, which I believe is support.
  15017. 7:37:48So, support.
  15018. 7:37:50There we go.
  15019. 7:37:51Can do label
  15020. 7:37:53equal
  15021. 7:37:54support.
  15022. 7:37:57What we're going to do now is we're
  15023. 7:37:58going to hover over this. We're going to
  15024. 7:38:00copy and paste.
  15025. 7:38:02And this will be priority. High
  15026. 7:38:04priority. Yeah, priority right here.
  15027. 7:38:07Change the name to
  15028. 7:38:10priority.
  15029. 7:38:13Same thing with here. Promotions. And
  15030. 7:38:16then, finance and billing.
  15031. 7:38:18You could You could put a Gmail
  15032. 7:38:21label thing every single time, but just
  15033. 7:38:23to save yourself those
  15034. 7:38:25>> [snorts]
  15035. 7:38:25>> few minutes, you can just copy and
  15036. 7:38:26paste. Here will be promotions. So, this
  15037. 7:38:28will be promotions.
  15038. 7:38:32And this will be
  15039. 7:38:34promotions.
  15040. 7:38:37And down here, we finance and billing.
  15041. 7:38:40Finance and billing.
  15042. 7:38:43And down here, you can put finance and
  15043. 7:38:46billing.
  15044. 7:38:47So, now, in theory, when it classifies
  15045. 7:38:50it, it should classify it and actually
  15046. 7:38:52label the email on our inbox. So, if I
  15047. 7:38:54pin this,
  15048. 7:38:56I should Actually, no. Never mind. Let
  15049. 7:38:59me not pin this. Let me just run this.
  15050. 7:39:01Execute workflow. This should now
  15051. 7:39:03classify to support and this should be
  15052. 7:39:04labeled as support. So, if I go here,
  15053. 7:39:06the email that we received, customer
  15054. 7:39:08support question,
  15055. 7:39:10this is now labeled as support. As you
  15056. 7:39:11can see, it just changed. So, which is
  15057. 7:39:13good. And now that we know that this
  15058. 7:39:14works, we can go to the next step, which
  15059. 7:39:16is
  15060. 7:39:17um using AI to draft an email reply.
  15061. 7:39:21So,
  15062. 7:39:22in order for us to draft a reply, we can
  15063. 7:39:24use the AI agent.
  15064. 7:39:25Because the thing is, we can also
  15065. 7:39:28connect it to the tool, which is draft
  15066. 7:39:30an email, right? So, it does two in one.
  15067. 7:39:31It drafts a reply and also drafts it in
  15068. 7:39:33our inbox. So, the first thing I have to
  15069. 7:39:35do is
  15070. 7:39:37create a chat model,
  15071. 7:39:38right? And connect it to our chat model.
  15072. 7:39:40One hack that we typically do with AI
  15073. 7:39:42agents, especially when you have five or
  15074. 7:39:43six,
  15075. 7:39:45is you connect them all to the same
  15076. 7:39:47tool. You could just duplicate it here.
  15077. 7:39:49You can just go
  15078. 7:39:50delete and then choose open AI.
  15079. 7:39:54But,
  15080. 7:39:55for it to look less tools and less stuff
  15081. 7:39:57on the screen, you can just drag it
  15082. 7:39:59across here.
  15083. 7:40:00So, now this is connected to the chat
  15084. 7:40:01model. Then, we're going to go inside
  15085. 7:40:02here. We're going to name this
  15086. 7:40:04uh customer
  15087. 7:40:06support agent.
  15088. 7:40:08The user message will not be chat to
  15089. 7:40:11your node because we're not chatting to
  15090. 7:40:13it in this case.
  15091. 7:40:14We are just defining it below.
  15092. 7:40:16And now here, I should add the text for
  15093. 7:40:18the email.
  15094. 7:40:20Okay, I think we're missing something.
  15095. 7:40:22I think we are. Because if I go here, I
  15096. 7:40:23don't actually see the text. I see the
  15097. 7:40:25snippet. But, the snippet is basically
  15098. 7:40:27the the cut version of the email. So, if
  15099. 7:40:29the email is longer, then it will cut
  15100. 7:40:30it. It will give us a snippet of it. So,
  15101. 7:40:32all we have to do, I think, is simplify.
  15102. 7:40:35Yeah.
  15103. 7:40:36I'm going to run this again.
  15104. 7:40:38Uh I'm going to send myself an email.
  15105. 7:40:40What's your policy for returns and what
  15106. 7:40:43do you guys do as a company?
  15107. 7:40:44I'm going to press send. As you can see,
  15108. 7:40:46we have the email right here. Uh
  15109. 7:40:47customer support. And now if I go here
  15110. 7:40:49to end-to-end, I can fetch test event.
  15111. 7:40:52Okay, there we go. So,
  15112. 7:40:54when I added simplify, it didn't show me
  15113. 7:40:56all these things, but we want the text.
  15114. 7:40:58Like we want the actual text.
  15115. 7:41:00Perfect. Let me pin this. If I go here
  15116. 7:41:02to the AI agent, I can give it the
  15117. 7:41:05uh email text
  15118. 7:41:08and email from.
  15119. 7:41:11Or maybe I do the opposite. Yeah, I do
  15120. 7:41:12the opposite.
  15121. 7:41:14Uh email from and email text.
  15122. 7:41:17Gmail trigger, the email
  15123. 7:41:20from.
  15124. 7:41:22Let's see if I can just go here.
  15125. 7:41:26From. There we go.
  15126. 7:41:28From my character right here. And then,
  15127. 7:41:29the email text
  15128. 7:41:33will be this.
  15129. 7:41:36Right? And this is what we give the AI
  15130. 7:41:37as a user message because there's two
  15131. 7:41:39types of messages or prompts in this
  15132. 7:41:40case. There is a user and there's a
  15133. 7:41:42system. The user in this case is like
  15134. 7:41:44what is the thing that we're giving it
  15135. 7:41:45every single time.
  15136. 7:41:47As in variables that change. Then, do we
  15137. 7:41:49have a system message,
  15138. 7:41:51which is simply the instructions, right?
  15139. 7:41:53So, we give it the information on user.
  15140. 7:41:54We then give it the instructions on
  15141. 7:41:55system so that it uses the instructions
  15142. 7:41:58with the the variables that we give it
  15143. 7:41:59every single time to do the task. And
  15144. 7:42:02so, right here, I'm going to paste the
  15145. 7:42:03prompt that I have made before.
  15146. 7:42:06I'll go here.
  15147. 7:42:08Expression.
  15148. 7:42:09Go big and then paste it.
  15149. 7:42:11And
  15150. 7:42:13so, for the system message, I'm going to
  15151. 7:42:14go full screen. I'm going to say
  15152. 7:42:16we typically structure our prompts with
  15153. 7:42:19an overview. Then, we have tools.
  15154. 7:42:22And then, we have rules.
  15155. 7:42:24Tools and rules.
  15156. 7:42:25So, overview would be I want to say
  15157. 7:42:28you're a customer support representative
  15158. 7:42:30named Kelly. Your job is to respond to
  15159. 7:42:31customer inquiries in a friendly and
  15160. 7:42:32professional manner. Then, the tools.
  15161. 7:42:35So, what is it What tool are you
  15162. 7:42:36connecting to this? Well, in this case,
  15163. 7:42:37we're connecting the draft email. Right?
  15164. 7:42:40So, if we go here to eGmail, we can do
  15165. 7:42:42draft.
  15166. 7:42:44Message draft.
  15167. 7:42:47Or was it draft? Yeah, draft here.
  15168. 7:42:49Create the draft. The subject line, I'm
  15169. 7:42:51going to let it do its thing.
  15170. 7:42:53Like this is basically means let AI
  15171. 7:42:55define this based on the context that it
  15172. 7:42:56was given.
  15173. 7:42:57Then,
  15174. 7:42:59the message as well.
  15175. 7:43:01Let the model define this parameter.
  15176. 7:43:02This is great for us because we don't
  15177. 7:43:05have to give it a variable every single
  15178. 7:43:07time. We can just press this button,
  15179. 7:43:09which makes it so much easier for us to
  15180. 7:43:10draft emails and reply things back uh
  15181. 7:43:12because of this feature as well. And
  15182. 7:43:14then, we're also doing the email to
  15183. 7:43:18email to and the email to will be the
  15184. 7:43:19email that we get the email from, which
  15185. 7:43:22will be
  15186. 7:43:23this right here.
  15187. 7:43:26And also, in addition to that, we want
  15188. 7:43:28the thread ID.
  15189. 7:43:30Now, the thread ID makes it so that when
  15190. 7:43:31we go to, let's say, support,
  15191. 7:43:35here. Yeah. You see how it replied on
  15192. 7:43:37the thread? So, the thread just means in
  15193. 7:43:38the same conversation. Because the
  15194. 7:43:40opposite of that could be that we have
  15195. 7:43:43this just as a reply as a draft on a
  15196. 7:43:45separate email, but it's not in the same
  15197. 7:43:47thread. So, this allows us to be able to
  15198. 7:43:48have the same conversation. It's sort of
  15199. 7:43:50like a chat ID on on Telegram.
  15200. 7:43:52Um it's the same. So,
  15201. 7:43:53you can say uh thread ID and we can find
  15202. 7:43:57the thread ID.
  15203. 7:43:59Where can we find it? There we go.
  15204. 7:44:01Thread ID.
  15205. 7:44:02This will be the tool that we use that
  15206. 7:44:04we connect all the tools to. Cuz again,
  15207. 7:44:06just like we can connect the chat model
  15208. 7:44:07to the same tool, we can also create a
  15209. 7:44:09draft an email tool and we can connect
  15210. 7:44:11it to all the AI agents who make the
  15211. 7:44:12emails. So, in this case, we have
  15212. 7:44:13customer support agent
  15213. 7:44:15with small g. I don't know why it spaces
  15214. 7:44:17me off. Um and then, we have
  15215. 7:44:20this is it. I'm going to test this. I'm
  15216. 7:44:22going to go execute workflow.
  15217. 7:44:26Text to classify. Oh, okay. Okay. Got
  15218. 7:44:28you.
  15219. 7:44:28Cuz we also have to change this. So, if
  15220. 7:44:30I go here,
  15221. 7:44:32text.
  15222. 7:44:33And then, we paste this.
  15223. 7:44:35Again, make sure this is not simplify.
  15224. 7:44:38Because simplify gives you less
  15225. 7:44:40variables.
  15226. 7:44:41Um I'm going to press execute workflow
  15227. 7:44:43again. This will now classify it. It
  15228. 7:44:45will label it as support. And then, it
  15229. 7:44:47will use the AI agent to reply an email
  15230. 7:44:49or to make a reply. I'll put subject
  15231. 7:44:51line.
  15232. 7:44:53Now, the one thing
  15233. 7:44:55that I don't know why it didn't do
  15234. 7:44:56is it didn't call the tool. I know why.
  15235. 7:44:59Because we didn't tell what tool it
  15236. 7:45:00needs to call. So, I'm going to rename
  15237. 7:45:02this draft
  15238. 7:45:04email.
  15239. 7:45:05I'm going to go inside.
  15240. 7:45:06I'm going to go in the prompt and going
  15241. 7:45:08to say draft email. Use this to send an
  15242. 7:45:11email reply to customer. Always sign off
  15243. 7:45:13as James from ABC Corp.
  15244. 7:45:15And the rules is
  15245. 7:45:17keep the emails
  15246. 7:45:20concise.
  15247. 7:45:22That's it. Keep the email concise. Um
  15248. 7:45:25I'm going to execute the workflow again
  15249. 7:45:26so you get to see how it now calls the
  15250. 7:45:28tool. It's all prompting, right? Like AI
  15251. 7:45:30agents are all prompting.
  15252. 7:45:32Because if it wasn't for the prompt, it
  15253. 7:45:33wouldn't have called this tool. The text
  15254. 7:45:35right here, I believe. Yeah, return
  15255. 7:45:36policy. What's your return policy? And
  15256. 7:45:38this is the answer that it gives. Our
  15257. 7:45:40return policy allows customers to do
  15258. 7:45:41XYZ.
  15259. 7:45:43All right. Now that we have this, we can
  15260. 7:45:45now replicate this for pretty much all
  15261. 7:45:47the other agents.
  15262. 7:45:48I'm going to copy this. I'm going to
  15263. 7:45:50paste this.
  15264. 7:45:51I'm going to paste this here.
  15265. 7:45:54I'm going to paste this here.
  15266. 7:45:56The only thing we'd have to do is that
  15267. 7:45:58for label priority,
  15268. 7:46:00let me actually see if I can change the
  15269. 7:46:01order. Let me change the order here.
  15270. 7:46:03Because
  15271. 7:46:06I want priority to be first cuz priority
  15272. 7:46:07goes to a different way. And go here,
  15273. 7:46:10and put a space, paste this.
  15274. 7:46:12Then go back here, and then this be the
  15275. 7:46:15thing here. So, I just switched it
  15276. 7:46:16because I want
  15277. 7:46:20priority to go to goes first, and then
  15278. 7:46:22support to go second. All right, cool.
  15279. 7:46:23Now that you have this, we are able to
  15280. 7:46:25then rename the agents.
  15281. 7:46:28So, the chat model here will be
  15282. 7:46:29connected to here.
  15283. 7:46:31This will be connected to here. It looks
  15284. 7:46:33a bit messy, cuz we need to space it
  15285. 7:46:34out. So, let me
  15286. 7:46:35space this out a little bit. And then go
  15287. 7:46:37here.
  15288. 7:46:38Chat model will go here.
  15289. 7:46:39And now I'm going to
  15290. 7:46:41add this here.
  15291. 7:46:43Put this down here.
  15292. 7:46:45It's also important for you, when you
  15293. 7:46:46build automations, for it to actually
  15294. 7:46:47look
  15295. 7:46:49clean or structured.
  15296. 7:46:51Um so, it makes the, I guess, visual
  15297. 7:46:52when you're debugging it and so on, a
  15298. 7:46:54lot better.
  15299. 7:46:55Um and so, now we have customer support.
  15300. 7:46:57We can do promotional
  15301. 7:47:00promotional agent.
  15302. 7:47:03We can do finance agent.
  15303. 7:47:08Let's hook this up to the same tool.
  15304. 7:47:11Right? Because the only difference
  15305. 7:47:12really is is a label, right? And then we
  15306. 7:47:14make a reply. But And we do have to
  15307. 7:47:16change part of the prompt, right? So, we
  15308. 7:47:18have to go inside finance and say, "You
  15309. 7:47:20are a
  15310. 7:47:21finance support representative team
  15311. 7:47:23Kelly."
  15312. 7:47:25to customer inquiries to finance
  15313. 7:47:28inquiries.
  15314. 7:47:30This will be promotional. So, you are a
  15315. 7:47:32promotion no support representative
  15316. 7:47:35to promotional queries.
  15317. 7:47:39That's it. And then this one will be
  15318. 7:47:41priority.
  15319. 7:47:42And the message will be different. So,
  15320. 7:47:45when I paste this, you're an agent in
  15321. 7:47:46charge of high priority emails. Your job
  15322. 7:47:47is to summarize incoming emails and
  15323. 7:47:49escalate them to the human. And the tool
  15324. 7:47:50will change, right? So, we're not using
  15325. 7:47:51the draft email anymore. We're using
  15326. 7:47:53Telegram.
  15327. 7:47:54So, in this case, tool
  15328. 7:47:56we can search for Telegram.
  15329. 7:47:58Telegram tool. And in order to connect
  15330. 7:47:59your Telegram here,
  15331. 7:48:01just follow this step-by-step guide. For
  15332. 7:48:02the sake of time, I'm not going to be
  15333. 7:48:03able to show you step-by-step how to do
  15334. 7:48:06it, but
  15335. 7:48:07if you follow these instructions, you'll
  15336. 7:48:08be good.
  15337. 7:48:10And now,
  15338. 7:48:11you have this. So, the message is the
  15339. 7:48:12thing that we're manipulating. The
  15340. 7:48:14operation will be send the message. The
  15341. 7:48:16chat ID, I don't think we need it,
  15342. 7:48:18right? To be honest. Yeah, we don't need
  15343. 7:48:19it. And the text itself will be
  15344. 7:48:24defined by the model. I mean, we do need
  15345. 7:48:26it, right? But we can define this. We
  15346. 7:48:28can let We can let this be defined. Or
  15347. 7:48:30not, right? Like I mean, if I'm wrong,
  15348. 7:48:31I'll we'll fix it, but there we go.
  15349. 7:48:33Reply markup none.
  15350. 7:48:35Okay.
  15351. 7:48:35So,
  15352. 7:48:37Telegram.
  15353. 7:48:40And what I'm going to say here is,
  15354. 7:48:42"You're an agent in charge of high
  15355. 7:48:43priorities, and the tool you're going to
  15356. 7:48:44use is Telegram. Use this email to send
  15357. 7:48:47the summary of the email once it's
  15358. 7:48:49summarized."
  15359. 7:48:52Look at that English. Use this email to
  15360. 7:48:54send the summary of the email once it's
  15361. 7:48:55summarized. That's fine.
  15362. 7:48:57And now, what we can do is test it. So,
  15363. 7:48:59test this right here.
  15364. 7:49:01I'm going to go here. Want to press this
  15365. 7:49:03little pencil right here, which
  15366. 7:49:05basically manipulates the data.
  15367. 7:49:07I can go
  15368. 7:49:10Okay.
  15369. 7:49:11>> [laughter]
  15370. 7:49:11>> I think we're cooked here. Received.
  15371. 7:49:13Where's the text?
  15372. 7:49:14Text. There we go.
  15373. 7:49:17Want to take this out and say, "Hey
  15374. 7:49:19there.
  15375. 7:49:20We have a client emergency.
  15376. 7:49:23We She wants to know or they want to
  15377. 7:49:25know
  15378. 7:49:27how much we charge.
  15379. 7:49:29Urgent."
  15380. 7:49:31Well, actually, let's not put this.
  15381. 7:49:33Cuz it's clearly obvious that it's
  15382. 7:49:34urgent, right? Want to press save. And
  15383. 7:49:36now, if I
  15384. 7:49:37execute workflow,
  15385. 7:49:40this should
  15386. 7:49:41send Telegram message, but it didn't.
  15387. 7:49:45Because the chat ID, I believe, was
  15388. 7:49:46wrong. Chat not found. Okay, so what we
  15389. 7:49:49have to do here is this.
  15390. 7:49:51Yeah, yeah, yeah. Okay, okay, okay.
  15391. 7:49:53Cool, cool.
  15392. 7:49:54Yeah, cuz the chat ID here isn't isn't a
  15393. 7:49:55number. It's not It's not text. So, it
  15394. 7:49:57doesn't It doesn't categorize it as
  15395. 7:49:58that.
  15396. 7:50:00Yeah, so the problem here was that the
  15397. 7:50:02chat ID
  15398. 7:50:04it gave it as urgent emails, but the
  15399. 7:50:06chat ID is numbers. So, that's wrong.
  15400. 7:50:10So, what we have to do is we have to use
  15401. 7:50:13Telegram.
  15402. 7:50:14Go here. Telegram.
  15403. 7:50:17And follow me through here. There's a
  15404. 7:50:18clear thought process to why we're doing
  15405. 7:50:20it. Uh we're going to
  15406. 7:50:23Um actually, let me go back.
  15407. 7:50:26Add another trigger. Telegram.
  15408. 7:50:30On message
  15409. 7:50:32received. On message and then message
  15410. 7:50:34Yeah, on message. I cannot go to
  15411. 7:50:35Telegram.
  15412. 7:50:37I mean, we can see that the it worked,
  15413. 7:50:38right? Like the email was sent. Um
  15414. 7:50:41what I'm going to do though is I'm going
  15415. 7:50:42to
  15416. 7:50:43execute step. So, this is now watching
  15417. 7:50:45for
  15418. 7:50:46Yeah, watching for messages. Want to
  15419. 7:50:48say, "Hello."
  15420. 7:50:50Okay, with this here, I cannot get the
  15421. 7:50:52chat ID. Okay, so now if I get the chat
  15422. 7:50:54ID, I can then move this. I can hardcode
  15423. 7:50:57it right here.
  15424. 7:50:59So, the chat ID can be the same, right?
  15425. 7:51:01Because it it can be in the same exact
  15426. 7:51:02chat that we have. Um
  15427. 7:51:04so, let's try this again.
  15428. 7:51:06Let me go to execute workflow.
  15429. 7:51:09And here we should see an email coming
  15430. 7:51:10through at any time. So, high priority
  15431. 7:51:12email from Michele Torti, a client
  15432. 7:51:13emergency requires XYZ.
  15433. 7:51:16And we can remove this. We can remove
  15434. 7:51:17this message was sent automatically with
  15435. 7:51:18N8N.
  15436. 7:51:19I believe it's here. Add field.
  15437. 7:51:22Append N8N attribution. We can turn this
  15438. 7:51:24off.
  15439. 7:51:26Okay, so we got to see the message was
  15440. 7:51:27sent successfully.
  15441. 7:51:29>> [sighs]
  15442. 7:51:30>> And now, let's try with let's see
  15443. 7:51:32finance, right? So, let's say we send
  15444. 7:51:34ourselves an email.
  15445. 7:51:35Say, "Hey there, can you provide us with
  15446. 7:51:36a billing statement?
  15447. 7:51:38Um
  15448. 7:51:39James."
  15449. 7:51:40Want to press send. All right, so we got
  15450. 7:51:41the email, billing statement. I can
  15451. 7:51:43press execute workflow.
  15452. 7:51:46This should now send it down here,
  15453. 7:51:47finance and billing. It should label it.
  15454. 7:51:50It should make a reply, a draft, and
  15455. 7:51:52then I should see it right here.
  15456. 7:51:54Finance and billing.
  15457. 7:51:55Finance and billing right here. I can
  15458. 7:51:56see that we have uh information. Now,
  15459. 7:51:59one thing that you should be asking
  15460. 7:52:00yourself here, cuz if you're not asking
  15461. 7:52:01yourself this, then I don't know.
  15462. 7:52:04This is obviously hallucinating, right?
  15463. 7:52:06Like let's be honest. Like how how this
  15464. 7:52:08can't be accurate, cuz we're simply
  15465. 7:52:10using AI,
  15466. 7:52:12which is not trained on any data.
  15467. 7:52:14And so, to mitigate this, what we would
  15468. 7:52:16have to do is you can add a step right
  15469. 7:52:19here, where we can basically pull in
  15470. 7:52:21information from a Superbase. So, you
  15471. 7:52:23can have Superbase back to store, which
  15472. 7:52:26is trained on all our company's data.
  15473. 7:52:29And then, we can then pull the
  15474. 7:52:31information and then draft a reply.
  15475. 7:52:33Cuz then we have context. Like the the
  15476. 7:52:35actual agent doesn't just hallucinate.
  15477. 7:52:37Because obviously, this right here will
  15478. 7:52:39prepare a billing statement and send it
  15479. 7:52:40to you shortly. This is obviously not
  15480. 7:52:42true.
  15481. 7:52:43And so, this just makes it up. And so,
  15482. 7:52:44in real life, in actual business, you
  15483. 7:52:45can't have something like this
  15484. 7:52:47specifically. You would need an extra
  15485. 7:52:48step here of pulling information from a
  15486. 7:52:51vector database, which is a basically
  15487. 7:52:53like a Google Sheet. That's better.
  15488. 7:52:54Which you pull information from before
  15489. 7:52:56sending it to the client, before
  15490. 7:52:57actually replying to the client. Because
  15491. 7:52:59it actually is accurate by that point.
  15492. 7:53:01So, that right there is a full email
  15493. 7:53:02classifier AI agent built inside of N8N.
  15494. 7:53:09In today's video, I'm going to show you
  15495. 7:53:10step-by-step how I built a full
  15496. 7:53:12AI-powered blog generation system inside
  15497. 7:53:14of N8N that can write highly effective,
  15498. 7:53:17well-researched blogs by a team of AI
  15499. 7:53:19agents. All right, so this right here is
  15500. 7:53:20the system. I'm going to run it from
  15501. 7:53:22scratch and show you exactly how it
  15502. 7:53:23works before we uh go step-by-step and
  15503. 7:53:25show you how I built it. I'm going to
  15504. 7:53:27press execute workflow.
  15505. 7:53:29I'm going to put the post topic. Let's
  15506. 7:53:30do AI in finance.
  15507. 7:53:33And let's do investment bankers.
  15508. 7:53:36So, the post topic for the blog is AI in
  15509. 7:53:38finance. Then we do investment bankers.
  15510. 7:53:40Let me just
  15511. 7:53:42finance. There we go. And tone of voice
  15512. 7:53:44will be direct.
  15513. 7:53:46So, these are the three different inputs
  15514. 7:53:47that we give it. We press submit. What
  15515. 7:53:49this will now do is it will send the
  15516. 7:53:51information to the first AI agent, which
  15517. 7:53:54is a newsletter expert, which basically
  15518. 7:53:55does research on the topic that we're
  15519. 7:53:57doing. Then what we do is we generate an
  15520. 7:53:59outline using an AI step, which will
  15521. 7:54:01then be split into four different parts,
  15522. 7:54:03cuz the outline has four different parts
  15523. 7:54:04of uh of the blog. We'll have a research
  15524. 7:54:06agent, which is this one right here,
  15525. 7:54:08which will do more research on the
  15526. 7:54:10actual topic that is written on that
  15527. 7:54:12first paragraph or first section of the
  15528. 7:54:14blog,
  15529. 7:54:15uh and second and third and fourth as
  15530. 7:54:16well. Then what we do here is using the
  15531. 7:54:19outline, which is split up into four
  15532. 7:54:20different parts, we send it to the
  15533. 7:54:22research agent, which is this one right
  15534. 7:54:23here, which is now doing research on
  15535. 7:54:26each part of the blog using Perplexity.
  15536. 7:54:28And it's actually writing the snippet
  15537. 7:54:30for that specific part. Then what we do
  15538. 7:54:32here is we merge the output from here
  15539. 7:54:35and here as well. We aggregate them,
  15540. 7:54:37which means we put them all into one
  15541. 7:54:38place before sending it to the editor AI
  15542. 7:54:40agent, which in this case is an AI agent
  15543. 7:54:43that will edit the actual newsletter.
  15544. 7:54:44So, that's that's going to be the final
  15545. 7:54:46version. And we use Claude here because
  15546. 7:54:47Claude is a better model to write
  15547. 7:54:49content. Then we use it just an AI step
  15548. 7:54:51to generate a title, and then we send
  15549. 7:54:53the [music] actual newsletter to our
  15550. 7:54:54inbox. If I go to my inbox, and on my
  15551. 7:54:56inbox, I can see that I have generative
  15552. 7:54:58AI transforming investment bank
  15553. 7:55:00operations, and this is the full blog
  15554. 7:55:02that we use.
  15555. 7:55:03And a good thing about this is that it
  15556. 7:55:05uses It actually references which
  15557. 7:55:06sources. If you go here to two, it
  15558. 7:55:09references the source that we're using,
  15559. 7:55:11right? Also, you can see it down here.
  15560. 7:55:13First, second, third, fourth, fifth, and
  15561. 7:55:15sixth. And this right here is just a
  15562. 7:55:17prompting thing. Um and now you have a
  15563. 7:55:18fully optimized blog, which gives us
  15564. 7:55:21highly in-depth research from the top
  15565. 7:55:24sources, from top credible sources, that
  15566. 7:55:26we can use. And a good thing about this
  15567. 7:55:28is you can have this running daily. Cuz
  15568. 7:55:30right now, we have a form, but you can
  15569. 7:55:32replace this with a Google Sheet that
  15570. 7:55:33will have different topics, and then a
  15571. 7:55:36on-time schedule, which means that it
  15572. 7:55:37will run every week, every day, and so
  15573. 7:55:38on. And you have a fully optimized blog
  15574. 7:55:41in your inbox. So, with that said, let's
  15575. 7:55:43see exactly how this works, and let's go
  15576. 7:55:44step-by-step. All right, so let's go
  15577. 7:55:46through the first step, which is the
  15578. 7:55:47form input. So, we added a form. Again,
  15579. 7:55:50this can be any kind of input, right?
  15580. 7:55:51The form is just the easiest because we
  15581. 7:55:53can just simply execute step, and we can
  15582. 7:55:56have access to this form right here,
  15583. 7:55:57which is a very very simple form that we
  15584. 7:55:59just create natively within N8N.
  15585. 7:56:01And for the forms itself on N8N, we have
  15586. 7:56:03the test URL and we have the production
  15587. 7:56:05URL. Now, bear in mind the test URL is
  15588. 7:56:08just a URL that you use when you're
  15589. 7:56:10testing, okay? Hence the name, test URL.
  15590. 7:56:13When you're going to production, which
  15591. 7:56:14means that you are turning this on,
  15592. 7:56:15you're activating this, that's when you
  15593. 7:56:17use the production URL. So, in theory,
  15594. 7:56:19what this would look like is you
  15595. 7:56:20wouldn't have to go inside here and
  15596. 7:56:21press execute step and then run the
  15597. 7:56:23whole thing. You would just activate it,
  15598. 7:56:25you would use the production URL, and
  15599. 7:56:27that's the thing that you paste into
  15600. 7:56:28your browser when you're doing whatever
  15601. 7:56:30you're doing, right? As you can see
  15602. 7:56:31here,
  15603. 7:56:32this is not activated, so this is
  15604. 7:56:33deactivated. Um so, we can't see it.
  15605. 7:56:35Then, we have authentication right here,
  15606. 7:56:37and authentication can be used to
  15607. 7:56:38basically add a password between the
  15608. 7:56:40person that wants to fill out the form
  15609. 7:56:42and actually filling out the form.
  15610. 7:56:43Because if you don't want anybody or if
  15611. 7:56:45you don't want everybody to have access
  15612. 7:56:46to the form, then you want a password.
  15613. 7:56:48Well, in this case, we can just leave it
  15614. 7:56:49blank um cuz this URL is pretty unique.
  15615. 7:56:52Then, we have the form title, in this
  15616. 7:56:54case, newsletter form. And then, these
  15617. 7:56:55are the fields. So, the fields is what
  15618. 7:56:57are we asking the user to fill out? In
  15619. 7:56:59this case, we are asking the post topic,
  15620. 7:57:01which is in text field.
  15621. 7:57:03And the placeholder can be AI in
  15622. 7:57:04finance.
  15623. 7:57:06Placeholder just means this, right? So,
  15624. 7:57:07if you execute a step, this is a
  15625. 7:57:09placeholder, which means what is a thing
  15626. 7:57:10that they see,
  15627. 7:57:12and typically you add this as
  15628. 7:57:13inspiration for what they could add,
  15629. 7:57:15right? [music] Let's make this a
  15630. 7:57:17required field, actually. Target
  15631. 7:57:18audience, text, required field, and then
  15632. 7:57:21tone of voice, drop down. So, we have
  15633. 7:57:22three different choices. So, we have
  15634. 7:57:23authoritative tone, humorous, and
  15635. 7:57:25direct.
  15636. 7:57:27These are the three different choices.
  15637. 7:57:28So, this will be the input again when we
  15638. 7:57:29press execute workflow, this will
  15639. 7:57:31execute the actual workflow. So, I can
  15640. 7:57:32do AI in
  15641. 7:57:34computer science. Target audience,
  15642. 7:57:3750-year-old men.
  15643. 7:57:39Tone of voice can be authoritative. And
  15644. 7:57:41then, we see here that this is the
  15645. 7:57:43answer that we get.
  15646. 7:57:45Okay, and this is the variables that we
  15647. 7:57:46then pull into the next step. Now, I'm
  15648. 7:57:48going to pin this. I don't have to rerun
  15649. 7:57:50it again every single time.
  15650. 7:57:52The next step we're doing is we're
  15651. 7:57:52setting variables. Now, honestly, you
  15652. 7:57:54don't have to do this. I don't know why
  15653. 7:57:55I did this, to be honest. Um you can go
  15654. 7:57:57without this, but I just wanted to set
  15655. 7:57:59the variable topic, target audience, and
  15656. 7:58:01tone of voice for no reason, actually.
  15657. 7:58:03So, we can actually delete this. Uh but
  15658. 7:58:04because this is connected to all of
  15659. 7:58:05these, then it makes sense to have this.
  15660. 7:58:07I typically have this just to have
  15661. 7:58:08things organized. Um
  15662. 7:58:10and basically, what this looks like is
  15663. 7:58:13we're replicating this, these variables,
  15664. 7:58:15to just have topic, target audience, and
  15665. 7:58:17tone of voice. And typically, why you do
  15666. 7:58:19this is because on the form submission,
  15667. 7:58:21we also get the submitted at and form
  15668. 7:58:23mode, which is extra variables that I
  15669. 7:58:25don't want to see, but at the same time,
  15670. 7:58:27you can go without this because I mean,
  15671. 7:58:28these these fields are only two fields,
  15672. 7:58:30right? There's not a crazy amount. Um
  15673. 7:58:32but we usually use set variables when we
  15674. 7:58:35have an input, which is a ton of
  15675. 7:58:37different variables. I think you can use
  15676. 7:58:38like Apify or any of these softwares,
  15677. 7:58:41they give you like a hundred variables,
  15678. 7:58:42and then you basically want to extract
  15679. 7:58:44the variables that you actually need,
  15680. 7:58:46and that's where you use a set variable.
  15681. 7:58:48In this case, it didn't make much sense
  15682. 7:58:49of why I used it, but you can still use
  15683. 7:58:51it. Cuz we don't get charged by step, we
  15684. 7:58:53get charged by execution.
  15685. 7:58:54Then, we have the first AI agent, which
  15686. 7:58:56is a newsletter expert. We can use AI
  15687. 7:58:58tools agent. There's three different
  15688. 7:58:59types of agents, OpenAI functions agent,
  15689. 7:59:02which uses OpenAI to just do its thing,
  15690. 7:59:04conversations agent, so you can talk to
  15691. 7:59:06it. We leave this as tools agent because
  15692. 7:59:07we are using tools with the agent. Uh
  15693. 7:59:09the source of prompt, which is what is
  15694. 7:59:11the input that we're getting? In this
  15695. 7:59:12case, if I execute the previous notes, I
  15696. 7:59:14can see that the input is this.
  15697. 7:59:16So, we give it the prompt user message
  15698. 7:59:18because every AI agent has two different
  15699. 7:59:20types of prompts. Okay? It has a user
  15700. 7:59:22prompt and it has a system prompt.
  15701. 7:59:24Also, assistant, but the main ones are
  15702. 7:59:26user and system. And the user prompt in
  15703. 7:59:29this case would be what are the
  15704. 7:59:30variables that we're feeding into the
  15705. 7:59:31actual AI agent for it to do its thing.
  15706. 7:59:34And the prompt user message here is what
  15707. 7:59:36are the variables like newsletter topic,
  15708. 7:59:37tone of voice, and target audience,
  15709. 7:59:39which we're pulling in from here that it
  15710. 7:59:41uses to actually do its thing, right?
  15711. 7:59:43So, that's for the user message. And
  15712. 7:59:44then, we have the system message.
  15713. 7:59:48Now, the system message is a prompt that
  15714. 7:59:50gives it the
  15715. 7:59:51instructions, right? The instructions
  15716. 7:59:52for the thing. It doesn't actually give
  15717. 7:59:53it the variables because the variables
  15718. 7:59:55go in the user message, but we give it
  15719. 7:59:56the overview, the context, the
  15720. 7:59:58instructions,
  15721. 8:00:00the tools
  15722. 8:00:01that it uses, um examples as well,
  15723. 8:00:04input, output, input, output. So, these
  15724. 8:00:07are assistant prompts because we're
  15725. 8:00:10giving it an example here, example here,
  15726. 8:00:13example here, example here, to make it I
  15727. 8:00:15guess to give it more context as to what
  15728. 8:00:16we want to do. Uh cuz sometimes AI is so
  15729. 8:00:19creative sometimes that it just spits
  15730. 8:00:20out what it wants to spit out. So, if
  15731. 8:00:22you give it a few example, it sort of
  15732. 8:00:23like guides it and narrows down the the
  15733. 8:00:25focus that it needs to have when making
  15734. 8:00:27the blog for you.
  15735. 8:00:29Um and so, this is the full prompt. And
  15736. 8:00:30again, at the end of the video, I'll
  15737. 8:00:31show you exactly how you can get the
  15738. 8:00:33whole system for free, so don't worry.
  15739. 8:00:35Uh but you can also take a screenshot of
  15740. 8:00:36this and drop it into ChatGPT and ask it
  15741. 8:00:38to extract the text. Uh that's what I
  15742. 8:00:40used to do all the time.
  15743. 8:00:42And now, you have the system message
  15744. 8:00:43right here and you have the user
  15745. 8:00:45message. We can see we ran this before,
  15746. 8:00:47and this is the output that we get. Of
  15747. 8:00:49course, this is cut, but if I go to
  15748. 8:00:50JSON, I can see here that this is a full
  15749. 8:00:53thing. So, table of contents. So, we are
  15750. 8:00:55generating table of contents
  15751. 8:00:57for the newsletter, right? And we're
  15752. 8:00:59using Perplexity
  15753. 8:01:00as a tool to do so.
  15754. 8:01:02Why? It's because you want to do more
  15755. 8:01:03research on the actual topic to then
  15756. 8:01:05give it proper table of contents. And
  15757. 8:01:08table of contents is like, okay, what's
  15758. 8:01:09going to be in the actual newsletter?
  15759. 8:01:11What's going to be in the blog?
  15760. 8:01:12Once we have this, let me pin this.
  15761. 8:01:14Then, we go ahead in the next step,
  15762. 8:01:15which is generate an outline. And here,
  15763. 8:01:17we're not using an AI agent, we're just
  15764. 8:01:18using a simple step. Now, to connect
  15765. 8:01:21your OpenAI to N8N, all you have to do
  15766. 8:01:23is press create a new credential. You
  15767. 8:01:24can go to platform.openai,
  15768. 8:01:26platform.openai.com.
  15769. 8:01:28You can go to login, choose your
  15770. 8:01:30account,
  15771. 8:01:34and then you want to go to dashboard,
  15772. 8:01:36get your API key right here.
  15773. 8:01:38Press this button, get a key. You can
  15774. 8:01:41copy and paste back
  15775. 8:01:42right [music] here. Bear in mind, this
  15776. 8:01:44is not free, as in you still have to pay
  15777. 8:01:46for this. Um and you pay for this using
  15778. 8:01:48something called an API credit. Now, the
  15779. 8:01:50API credit is something that you can
  15780. 8:01:52see, where is it? Billing,
  15781. 8:01:54on the left-hand side, and you will add
  15782. 8:01:56money here.
  15783. 8:01:57It is very, very cheap, so it will only
  15784. 8:02:00cost
  15785. 8:02:01a tenth of a cent when you run this. Um
  15786. 8:02:03so, yeah. But make sure you have about
  15787. 8:02:05$5 cuz that is the recommended amount
  15788. 8:02:07that we use.
  15789. 8:02:08All right. Now that we have this, we
  15790. 8:02:09have connected our OpenAI to uh N8N, we
  15791. 8:02:12can use text because that is the thing
  15792. 8:02:14that we're manipulating. The action that
  15793. 8:02:15we're taking is messaging model, which
  15794. 8:02:17means that it's sort of like we're going
  15795. 8:02:18to ChatGPT and we're typing something to
  15796. 8:02:20get an answer back. Then, we're using
  15797. 8:02:22the model 4o mini because it is the um
  15798. 8:02:25it's we're going for like speed and
  15799. 8:02:26quality, right? And 4o mini is great.
  15800. 8:02:29And the prompt is this. Your job is to
  15801. 8:02:30split out the table of contents into an
  15802. 8:02:32individual item for each section. Output
  15803. 8:02:35each section separately in a field
  15804. 8:02:36called newsletter sections.
  15805. 8:02:38When doing so, keep in mind that the
  15806. 8:02:39newsletter target audience is this and
  15807. 8:02:41the tone of the newsletter is this. So,
  15808. 8:02:43now we're pulling in the variables from
  15809. 8:02:44here, set variables.
  15810. 8:02:46Here's the table of contents. So, what
  15811. 8:02:48we're asking it to do is this. We're
  15812. 8:02:49asking it to basically
  15813. 8:02:52get the table of contents, which is a
  15814. 8:02:53block of text, and then output an array,
  15815. 8:02:56right? An array, I'll show you exactly
  15816. 8:02:57what it is.
  15817. 8:02:59An array is a something, right?
  15818. 8:03:02Where it contains different items inside
  15819. 8:03:04that something. So, in this case, it
  15820. 8:03:06contains the four different sections. Uh
  15821. 8:03:08each section has a title and has a
  15822. 8:03:10description. Title and description,
  15823. 8:03:11title and description. Why do we do
  15824. 8:03:13this? Well, you can simply And by the
  15825. 8:03:14way, this whole system, you can simply
  15826. 8:03:16replace by just using one prompt from
  15827. 8:03:18ChatGPT to make a blog. But because you
  15828. 8:03:19want to make it higher quality, right?
  15829. 8:03:21And go through basically generating an
  15830. 8:03:23outline and taking each bucket of that
  15831. 8:03:25outline. What I mean by this is taking
  15832. 8:03:27each newsletter section and then giving
  15833. 8:03:30it to AI to do the research and then
  15834. 8:03:31making it more optimized and then making
  15835. 8:03:33it better, right? And so, what we're
  15836. 8:03:34doing here is we're asking it to take
  15837. 8:03:36this text, which is unstructured,
  15838. 8:03:39because it's a block of text,
  15839. 8:03:40which doesn't make much sense to us and
  15840. 8:03:42we can't really do anything with it, and
  15841. 8:03:43then giving it to AI and saying, "Hey,
  15842. 8:03:45take this block of text that we have
  15843. 8:03:47here.
  15844. 8:03:48So, this is the input.
  15845. 8:03:50And basically, it's split it out. So, I
  15846. 8:03:51want you to split out an array,
  15847. 8:03:55which is something that has different
  15848. 8:03:56items in it, and you know it's an array
  15849. 8:03:57because typically has a square bracket.
  15850. 8:04:01Square bracket? Yeah, square bracket
  15851. 8:04:02here and here. And inside the square
  15852. 8:04:04bracket, there are a bunch of items,
  15853. 8:04:06which is this
  15854. 8:04:08and here, and this and here,
  15855. 8:04:11and this here as well, and same thing
  15856. 8:04:13with this, right? And so, these items
  15857. 8:04:15are all pretty much the same, and those
  15858. 8:04:16are the four items, which means that
  15859. 8:04:18they're four table of contents, four
  15860. 8:04:20different parts of the blog that we want
  15861. 8:04:22to iterate, want to split it out, right?
  15862. 8:04:24Each one, and then use each one for
  15863. 8:04:26research, use each one to write the
  15864. 8:04:27blog, and use each one to make the blog
  15865. 8:04:29better. So, once we have this, then we
  15866. 8:04:31can split out, right? So, I mentioned
  15867. 8:04:33that we Let me pin this.
  15868. 8:04:34If I press this,
  15869. 8:04:37you can see this is now four items. Why?
  15870. 8:04:39It's because the array itself is best
  15871. 8:04:42for us to use when we want to get the
  15872. 8:04:45array,
  15873. 8:04:46which can be found here. So, if I go
  15874. 8:04:48here,
  15875. 8:04:49newsletter section,
  15876. 8:04:50this now will split out four different
  15877. 8:04:52items.
  15878. 8:04:53First, second, third, and fourth. And
  15879. 8:04:56that's exactly what we then feed into
  15880. 8:04:58our AI agent, which is the research
  15881. 8:05:00agent right here,
  15882. 8:05:02to do more research. So, the input, of
  15883. 8:05:04course, is a tools agent cuz we're using
  15884. 8:05:05tools. Uh the source of prompt is user
  15885. 8:05:07message, which we'll define below. And
  15886. 8:05:09then, the user message itself, which is
  15887. 8:05:10what are the variables that are going
  15888. 8:05:12into the AI agent for it to use to do
  15889. 8:05:14its thing, are the section title,
  15890. 8:05:17which is this, section description,
  15891. 8:05:19which will be this right here. Where is
  15892. 8:05:21it? Generate outline. There we go.
  15893. 8:05:23Description,
  15894. 8:05:25newsletter target audience,
  15895. 8:05:27which will be this right here,
  15896. 8:05:29the target audience. There we go.
  15897. 8:05:31And newsletter tone of voice.
  15898. 8:05:33And so, we feed all of this in so that
  15899. 8:05:35it has context as to what the actual
  15900. 8:05:38section is, right? And so, this being
  15901. 8:05:40the user message, and this is the prompt
  15902. 8:05:43that we use for the research agent. And
  15903. 8:05:45so, we have an overview, which is you
  15904. 8:05:46are an AI agent responsible for
  15905. 8:05:47delivering only the final content for a
  15906. 8:05:49newsletter. Then, we have context, uh
  15907. 8:05:52which is all necessary details including
  15908. 8:05:53the section title, the description, the
  15909. 8:05:55target audience, and the tone will be
  15910. 8:05:56provided. Then the goal and the content
  15911. 8:05:59must be supported by research, and then
  15912. 8:06:01we give it instructions. And this is
  15913. 8:06:02usually how the the actual prompt goes,
  15914. 8:06:05right? We have overview, context,
  15915. 8:06:07instructions. Now, in this case, we have
  15916. 8:06:08tools. It's only one tool because we're
  15917. 8:06:10connecting this to Perplexity to do the
  15918. 8:06:12research.
  15919. 8:06:14And with that said,
  15920. 8:06:16we have citations, examples. So, we give
  15921. 8:06:18it examples and SOPs as well.
  15922. 8:06:20And this is a very, very good prompt. As
  15923. 8:06:22in, it has markdown formatting, which is
  15924. 8:06:24the hashtags,
  15925. 8:06:26which is basically saying, "Hey, this is
  15926. 8:06:27heading one, this is heading two," and
  15927. 8:06:29so on.
  15928. 8:06:31And then it has a bunch of stuff as
  15929. 8:06:32well. So, rules, guidelines, all that
  15930. 8:06:33stuff that it needs.
  15931. 8:06:35>> [music]
  15932. 8:06:35>> And from here, we start using Claude in
  15933. 8:06:37comparison to OpenAI right here because
  15934. 8:06:38Claude because now we're actually
  15935. 8:06:40writing content, right? And Claude is
  15936. 8:06:41the best content. And to connect your
  15937. 8:06:43Claude account, press create a new
  15938. 8:06:45credential, anthropic.console,
  15939. 8:06:47and then you can go to get an API key.
  15940. 8:06:50You can go to create an API key.
  15941. 8:06:52Just name it whatever you want. You get
  15942. 8:06:53a key, then you can then paste back
  15943. 8:06:55here. Now, 3.5 Sonnet is one of the best
  15944. 8:06:58for content. Let me actually search it
  15945. 8:06:59up.
  15946. 8:07:00Um which Claude model is best for
  15947. 8:07:02content?
  15948. 8:07:05I believe it's 3.5 Sonnet.
  15949. 8:07:07I think so.
  15950. 8:07:08Not Claude. It's Claude.
  15951. 8:07:10Let's see. Claude.
  15952. 8:07:12Showing you guys the full raw content uh
  15953. 8:07:14because that's what it is.
  15954. 8:07:16Claude's Opus 4. Okay.
  15955. 8:07:20Claude Opus 4. Do we have that available
  15956. 8:07:21to us?
  15957. 8:07:23I don't think we do.
  15958. 8:07:25Yeah, we don't have an API version. So,
  15959. 8:07:27let's do
  15960. 8:07:29API model.
  15961. 8:07:32Cuz not all models are given to us for
  15962. 8:07:34an API.
  15963. 8:07:35Um Claude 4 generation, Opus 4, and
  15964. 8:07:38Sonnet 4 are hybrid models.
  15965. 8:07:40Opus 4 is the most scalable. Yeah, I
  15966. 8:07:43think Sonnet 4. Right, Sonnet 4. Um it's
  15967. 8:07:45designed for speed plus quality as well.
  15968. 8:07:47And since we don't have four here, we're
  15969. 8:07:48just going to use 3.5.
  15970. 8:07:50And that's the thing that it uses as its
  15971. 8:07:51brain because again, an AI agent usually
  15972. 8:07:52has a brain, which in this case is the
  15973. 8:07:54LLM, and then it has tools that it's
  15974. 8:07:56connected to, which are in this case,
  15975. 8:07:58Perplexity, the thing that it actually
  15976. 8:07:59uses to take action. And if you want to
  15977. 8:08:01build your first AI agent from scratch,
  15978. 8:08:03check out this video up here.
  15979. 8:08:05What we do here is we run this.
  15980. 8:08:07What this will now do is it will go
  15981. 8:08:08through each section one by one. So,
  15982. 8:08:10four different items at the same time.
  15983. 8:08:12Not at the same time, obviously,
  15984. 8:08:13separately.
  15985. 8:08:14And it does research on each one.
  15986. 8:08:16And the reason why we're adding two
  15987. 8:08:18different inputs is because the first
  15988. 8:08:19input is
  15989. 8:08:21the actual research that it does. And
  15990. 8:08:24the second input is the description. All
  15991. 8:08:26right, so now we've finished the actual
  15992. 8:08:27research, and bear in mind that each
  15993. 8:08:29section of the blog will be researched,
  15994. 8:08:32right? And that's what this does. So,
  15995. 8:08:33I'm going to pin this
  15996. 8:08:35so we don't have [music] to rerun it
  15997. 8:08:35again cuz it does take a while.
  15998. 8:08:38Obviously, it got cut in the video, but
  15999. 8:08:39I've been here for about 4 minutes
  16000. 8:08:41waiting. Um
  16001. 8:08:43and [music] now, with the merge node,
  16002. 8:08:45what we do here is let me press execute
  16003. 8:08:47step.
  16004. 8:08:48This will now get the output of the
  16005. 8:08:51research agent,
  16006. 8:08:52but it will also get the title
  16007. 8:08:55and the description. So, the merge node
  16008. 8:08:57is usually combining,
  16009. 8:08:59right? Two inputs
  16010. 8:09:01because we have one and two,
  16011. 8:09:03and we're putting them all together. So,
  16012. 8:09:04you see how it went from here, here, and
  16013. 8:09:06here to all three right here. And these
  16014. 8:09:08are four different items, which means
  16015. 8:09:09that it does it for every single section
  16016. 8:09:11of the blog.
  16017. 8:09:13All right. Now that we have this, we can
  16018. 8:09:14then aggregate it because we don't want
  16019. 8:09:16to send four items individually to the
  16020. 8:09:18editor AI agent. We want to send all
  16021. 8:09:20together, right? Cuz we have four items,
  16022. 8:09:22let's put them all together.
  16023. 8:09:24And as you can see by the diagram here,
  16024. 8:09:25this node right here is to take all the
  16025. 8:09:27different separate items and put them
  16026. 8:09:29all together into one paragraph.
  16027. 8:09:31Let me go here.
  16028. 8:09:33Execute step.
  16029. 8:09:35And here we get all the titles, and we
  16030. 8:09:36get all the outputs. Because again, four
  16031. 8:09:38items, four the four outputs in this
  16032. 8:09:40case for the research agent. And that's
  16033. 8:09:42why we put individual fields, the input
  16034. 8:09:44field name will be title because it's
  16035. 8:09:46title. Same thing with output, which is
  16036. 8:09:48this one right here. And that's what it
  16037. 8:09:49takes to merge the list. Again, merge
  16038. 8:09:52list just means merge everything
  16039. 8:09:53together like this.
  16040. 8:09:55So, we're able to then feed it into the
  16041. 8:09:57editor AI agent, which will be the thing
  16042. 8:10:00to actually write the blog, right? To
  16043. 8:10:02actually put everything together.
  16044. 8:10:04Um it will be a tools agent. The prompt
  16045. 8:10:05will be the list of titles and the list
  16046. 8:10:07of article content, which we get from
  16047. 8:10:09here and here.
  16048. 8:10:11So, we're giving it Let me show you
  16049. 8:10:12this.
  16050. 8:10:13We give it this.
  16051. 8:10:15A full user input.
  16052. 8:10:17So, it's going to be a big prompt. Plus,
  16053. 8:10:19we give it a system message as well.
  16054. 8:10:21So, this system message will have an
  16055. 8:10:22overview. So, you're an expert editor
  16056. 8:10:24specializing in creating and finding
  16057. 8:10:25content to output a high-quality
  16058. 8:10:27formatted article. You're given a list
  16059. 8:10:29of titles and outputs, and you will use
  16060. 8:10:31these to create a newsletter tailored
  16061. 8:10:32towards the defined target audience.
  16062. 8:10:34Create a section in the article for each
  16063. 8:10:36title with a hyperlink source in each
  16064. 8:10:38section based on the content. So, when I
  16065. 8:10:40was making this workflow or this AI
  16066. 8:10:42agent,
  16067. 8:10:43I thought of the fact that obviously you
  16068. 8:10:44want to have insight What's it called?
  16069. 8:10:46Hyperlink um yeah, hyperlink um
  16070. 8:10:48citations. So, for example, when you go
  16071. 8:10:50into the actual word, and then when you
  16072. 8:10:52press that word, it goes directly to the
  16073. 8:10:53source of that news. And that's exactly
  16074. 8:10:55what this is.
  16075. 8:10:57This is a fancy way, a HTML way of
  16076. 8:10:59saying, "Hey,
  16077. 8:11:00this is the URL that we're giving,
  16078. 8:11:02and this is the name of the actual thing
  16079. 8:11:04that when we press this, it takes us
  16080. 8:11:05here." And so, that's what it is. And we
  16081. 8:11:07have the objective as well to create
  16082. 8:11:09content. Uh we have the citation
  16083. 8:11:11management. We have the source section.
  16084. 8:11:13We have the output format. We have a ton
  16085. 8:11:14of stuff in this prompt right here. And
  16086. 8:11:16then we want to output 1,000 word
  16087. 8:11:17maximum, or else the automation breaks,
  16088. 8:11:19right? Because there's a limit. Uh and
  16089. 8:11:21today's date is this. Why do we give it
  16090. 8:11:23today's date? It's because sometimes
  16091. 8:11:25within the actual blog, it needs to sort
  16092. 8:11:27of cite um it says tomorrow, right?
  16093. 8:11:30Like, how does it know what today is? AI
  16094. 8:11:32is not the best at this. So, that's why
  16095. 8:11:33we give it the actual date.
  16096. 8:11:35So, now with this prompt right here, I
  16097. 8:11:36can press execute step. This will now
  16098. 8:11:38give all of this and these uh this
  16099. 8:11:42prompt right here to be able to give us
  16100. 8:11:43a final optimized sort of blog that we
  16101. 8:11:46can use to send ourselves an email. All
  16102. 8:11:48right, so we have the output right here.
  16103. 8:11:49You see here with all these lines and
  16104. 8:11:52MPs and As and H2.
  16105. 8:11:55This is called HTML. HTML is basically
  16106. 8:11:58the way that we make our
  16107. 8:12:00text look pretty. You know when you see
  16108. 8:12:02emails, when you get emails with
  16109. 8:12:03headings, you get with colors and
  16110. 8:12:05beautiful things, that's all HTML,
  16111. 8:12:07right? And so,
  16112. 8:12:09we want to do that because
  16113. 8:12:11of the fact that we want headings, we
  16114. 8:12:12want a text [music] when you press on
  16115. 8:12:14it, hyperlinked, right? When you press
  16116. 8:12:15on it, it goes to the source, all that
  16117. 8:12:17stuff to make it look pretty, and to
  16118. 8:12:18make it look more formatted, we use
  16119. 8:12:20HTML. And then we use another AI right
  16120. 8:12:23here, which is an AI step. Again, same
  16121. 8:12:25connection, message model 4 or mini,
  16122. 8:12:27which is fine. And the prompt is
  16123. 8:12:30create a title for the incoming
  16124. 8:12:31newsletter. The tone of the newsletter
  16125. 8:12:32is
  16126. 8:12:34authoritative.
  16127. 8:12:35The target audience is 50-year-old men.
  16128. 8:12:38And here's your newsletter. So, we give
  16129. 8:12:39it the full newsletter, and then we say,
  16130. 8:12:41"Only output the title in plain uh in
  16131. 8:12:43plain text, no quotation marks, and
  16132. 8:12:45capitalize the first letter of each
  16133. 8:12:47word. Example, is artificial
  16134. 8:12:49intelligence a friend or foe?" So,
  16135. 8:12:51basically, this is making the title for
  16136. 8:12:53the newsletter, which you can then feed
  16137. 8:12:55into the subject line of the email that
  16138. 8:12:56we're making. I can press execute step.
  16139. 8:12:59This now gives us the actual content,
  16140. 8:13:01which is the title of the blog. Quantum
  16141. 8:13:03computing and AI transforming the future
  16142. 8:13:05of technology. And that's the thing that
  16143. 8:13:07we would use
  16144. 8:13:08to then be able Let me pin this. To send
  16145. 8:13:10ourselves an email. So, in the email
  16146. 8:13:11section, just connect your email, and go
  16147. 8:13:14here and sign in with Google.
  16148. 8:13:16Connect your account, bring it back, and
  16149. 8:13:17you're all good. And then the thing that
  16150. 8:13:18we are manipulating is message. The
  16151. 8:13:21action that we're taking is we're
  16152. 8:13:22sending. The email that we're sending it
  16153. 8:13:24to, of course, is my personal email. The
  16154. 8:13:25subject line in this case will be the
  16155. 8:13:27title here.
  16156. 8:13:28Right, it will be this right here,
  16157. 8:13:29content. We bring it across
  16158. 8:13:31here.
  16159. 8:13:32And this is now the title that we use.
  16160. 8:13:34And then the email type because again,
  16161. 8:13:36Gmail gives us two options, whether you
  16162. 8:13:38do text, whether you use HTML. Well, in
  16163. 8:13:40this [music] case, because we wrote the
  16164. 8:13:41email in HTML, then we get this, right?
  16165. 8:13:44We get a full thing, which is the thing
  16166. 8:13:46that you saw in my email. And then we
  16167. 8:13:47want to turn the append and and
  16168. 8:13:49attribution off, which just means that
  16169. 8:13:51usually when you send yourself an email,
  16170. 8:13:53at the end, it will say
  16171. 8:13:55and it ends in this, or sent by Anydan,
  16172. 8:13:57right? We want to take that off. And as
  16173. 8:13:59well, we want the name of the actual
  16174. 8:14:01person to be daily newsletter, which is
  16175. 8:14:02why we add here sender name, daily
  16176. 8:14:05newsletter.
  16177. 8:14:07All right, we can just test this.
  16178. 8:14:08Execute step.
  16179. 8:14:10What this will now do is it will send us
  16180. 8:14:11another email.
  16181. 8:14:12We go here and refresh. Quantum
  16182. 8:14:14computing and AI. And this is a newly
  16183. 8:14:16written email
  16184. 8:14:17with hyperlink text that I can go here
  16185. 8:14:20and I can go to the actual source
  16186. 8:14:22of the research, which is amazing.
  16187. 8:14:25And has settings, has more research,
  16188. 8:14:28and the citations are coming from
  16189. 8:14:30credible citations, right?
  16190. 8:14:32Which are great to have. And at the end,
  16191. 8:14:34we have sources as well.
  16192. 8:14:36Here.
  16193. 8:14:37And now this you can use as a way to
  16194. 8:14:39keep yourself updated, but also to post
  16195. 8:14:41it on your You can say on WordPress or
  16196. 8:14:44any of the sites that you make blogs in.
  16197. 8:14:46Right? Because you have a ton of
  16198. 8:14:46research, a ton of value that you can
  16199. 8:14:48get because this workflow right here is
  16200. 8:14:50a series of AI agents. And the reason
  16201. 8:14:52why we do a series of AI agents is
  16202. 8:14:54because when you break things down and
  16203. 8:14:56you actually go in depth into each topic
  16204. 8:14:58or each section, the quality is just
  16205. 8:15:00much better. And so, as I mentioned
  16206. 8:15:01before, you can have a form, which is
  16207. 8:15:04the input, which is the thing that what
  16208. 8:15:06what do we feed in to the actual system,
  16209. 8:15:08but you can also have a Google Sheet
  16210. 8:15:10that you can run through every single
  16211. 8:15:11row. And you can then add a
  16212. 8:15:14you can say
  16213. 8:15:16on the schedule
  16214. 8:15:17right here
  16215. 8:15:19at the start, which runs maybe every
  16216. 8:15:20day.
  16217. 8:15:21Right? So, every day.
  16218. 8:15:22And then it runs, and then it takes the
  16219. 8:15:24topic from a Google Sheet, and then it
  16220. 8:15:25runs through the whole system step by
  16221. 8:15:27step. Now, within our agency, we've
  16222. 8:15:28implemented these sort of systems,
  16223. 8:15:30especially with blogs and content, into
  16224. 8:15:32tons of businesses just because of the
  16225. 8:15:34fact that businesses know they need to
  16226. 8:15:36make content, yet they don't have the
  16227. 8:15:37time. They use AI anyways, so might as
  16228. 8:15:40well automate the whole process and save
  16229. 8:15:42them a ton of time and make it actually
  16230. 8:15:44valuable and and with actual research
  16231. 8:15:46and with good prompting so they can
  16232. 8:15:47actually get results. And so, these
  16233. 8:15:49systems right here are are for them
  16234. 8:15:51because it allows them to have such an
  16235. 8:15:53efficient process to generate this
  16236. 8:15:55content that can either be sent to our
  16237. 8:15:57email, that can either be sent to a
  16238. 8:15:58WordPress. WordPress is just a way that
  16239. 8:16:00you host your website. You can have
  16240. 8:16:02blogs on your website, blogs on
  16241. 8:16:03LinkedIn, blogs on whatever platform you
  16242. 8:16:06use,
  16243. 8:16:06uh that is highly effective, highly
  16244. 8:16:08researched, well researched, right? Cuz
  16245. 8:16:10if it is well researched. And so the
  16246. 8:16:11system is great because it saves the
  16247. 8:16:13company tons of time into making
  16248. 8:16:14content, and we know it's good because
  16249. 8:16:16we have good prompting, which companies
  16250. 8:16:18usually don't.
  16251. 8:16:22Hey, in this video I'm going to show you
  16252. 8:16:24step-by-step how you can build your own
  16253. 8:16:26research AI agent inside of n8n. And the
  16254. 8:16:29best part is that it actually takes less
  16255. 8:16:30than 5 minutes to set up. So I'm going
  16256. 8:16:32to show you exactly how it works, how
  16257. 8:16:34you can set it up, and how you can use
  16258. 8:16:35it within your automations. So if that
  16259. 8:16:37sounds like something that you want to
  16260. 8:16:38learn, let's dive in. All right, so
  16261. 8:16:39fundamentally we have an input and we
  16262. 8:16:41have an output. This is the same exact
  16263. 8:16:42structure as a normal AI agent, and the
  16264. 8:16:45input could be research XYZ. Then the AI
  16265. 8:16:47agent has system prompt or instructions.
  16266. 8:16:50System prompt just means what is the
  16267. 8:16:51thing that we tell the AI agent to do.
  16268. 8:16:53Um and it can be, "Hey, research this."
  16269. 8:16:55Or if this happens, then call this or do
  16270. 8:16:57something else.
  16271. 8:16:58And [music] the output would be the
  16272. 8:16:59actual research. Now between the input
  16273. 8:17:01and the output,
  16274. 8:17:02the AI agent, now it's hooked up to
  16275. 8:17:04OpenAI, which is basically ChatGPT, and
  16276. 8:17:07that's its brain. That's how it thinks.
  16277. 8:17:09And then for its tools, cuz tools are
  16278. 8:17:11like the things that the AI agent calls,
  16279. 8:17:13that it sends the request to when it
  16280. 8:17:15wants to get something back, on this
  16281. 8:17:17case we're using Perplexity. Because
  16282. 8:17:18Perplexity is the research LLM. LLM
  16283. 8:17:21stands for large language model. It's
  16284. 8:17:22like ChatGPT, Claude, they're all LLMs,
  16285. 8:17:25and this right here is specifically done
  16286. 8:17:26for research. So I can go to Perplexity
  16287. 8:17:28here, and I can show you that this
  16288. 8:17:30uh LLM is like ChatGPT, it looks like
  16289. 8:17:33it, but it's known for research. So I
  16290. 8:17:34can say, "Find the latest news on AI."
  16291. 8:17:39What this will do is that it will get
  16292. 8:17:40sources.
  16293. 8:17:42It will start getting all the sources,
  16294. 8:17:43and it's known for because it's really
  16295. 8:17:45good at finding research.
  16296. 8:17:46And it gives you the full breakdown of
  16297. 8:17:48everything, even giving you all the
  16298. 8:17:50sources that it used for that specific
  16299. 8:17:52research, which is insane. Cuz it does
  16300. 8:17:54research over 20, 30, 40 research papers
  16301. 8:17:57all within seconds to give you an
  16302. 8:17:58answer. Something that ChatGPT could do,
  16303. 8:18:01but isn't meant or prompted to do. And
  16304. 8:18:03so that's what we're going to use to
  16305. 8:18:04connect to the AI agent in order to do
  16306. 8:18:06the research. And again, we're doing it
  16307. 8:18:07automatically, so we're using the API
  16308. 8:18:09version, just like we're using the API
  16309. 8:18:11version for OpenAI. So we're just
  16310. 8:18:12creating an AI agent that is hooked up
  16311. 8:18:14to Perplexity to do the research, and
  16312. 8:18:16then we get the output.
  16313. 8:18:17So if I go to n8n, I can go to n8n
  16314. 8:18:19workflows. All right, so I'm currently
  16315. 8:18:21in n8n. I can go to create a workflow.
  16316. 8:18:24As you can see, we have two options. And
  16317. 8:18:25if you want to watch the video of me
  16318. 8:18:26building it with AI, check it up here.
  16319. 8:18:29But we're going to press add first step.
  16320. 8:18:31We can go to agent. Just press agent,
  16321. 8:18:33and this is how you add an AI agent in
  16322. 8:18:35n8n.
  16323. 8:18:36So this is where we start configuring
  16324. 8:18:37things. And so we're sending the chat
  16325. 8:18:38here. This will then send a signal to
  16326. 8:18:40the AI agent. If I go inside, I can see
  16327. 8:18:42that the user message, which is what is
  16328. 8:18:44the thing that's going inside the AI
  16329. 8:18:45agent, it will be the chat input, which
  16330. 8:18:48I'll show you exactly what it looks
  16331. 8:18:49like. And then,
  16332. 8:18:51after the user message, we can add an
  16333. 8:18:53option, we can have a system message.
  16334. 8:18:54The system message is the instructions,
  16335. 8:18:58this part right here.
  16336. 8:18:59And so that's what we add here. We can
  16337. 8:19:00say, "You're helpful intelligent
  16338. 8:19:01assistant that does research." I'm going
  16339. 8:19:03to give it a better prompt later, but
  16340. 8:19:05for now we can leave it this. And now,
  16341. 8:19:07as we mentioned before, we have the chat
  16342. 8:19:08model, which is what is the brain of
  16343. 8:19:10this LLM. In this case, it can be
  16344. 8:19:12OpenAI,
  16345. 8:19:13which is the one right here. And I can
  16346. 8:19:15connect OpenAI to my account. The way to
  16347. 8:19:17do that is to go to platform.openai.com.
  16348. 8:19:20I can go to dashboard. I can go to API
  16349. 8:19:23keys. And the API key is sort of like a
  16350. 8:19:25password that says to n8n, "Hey, you
  16351. 8:19:27feel free to use my API key for my
  16352. 8:19:29account in OpenAI." And top right,
  16353. 8:19:31create a new secret key.
  16354. 8:19:33And name it, so it can be n8n.
  16355. 8:19:36You can create a new secret key. Leave
  16356. 8:19:37everything as is, no restrictions.
  16357. 8:19:40And now you have this key that you can
  16358. 8:19:42paste within n8n and name it. I can name
  16359. 8:19:45it Michele
  16360. 8:19:4715th of October.
  16361. 8:19:50I can save it.
  16362. 8:19:51And now I have my account connected.
  16363. 8:19:53Bear in mind that this is not free. So
  16364. 8:19:54you have to go to here, to profile, to
  16365. 8:19:58billing,
  16366. 8:19:59and add money here. $5 is more than
  16367. 8:20:01enough cuz it it's only taking 1/10 of a
  16368. 8:20:04cent, right? So it's fine.
  16369. 8:20:06All right, now that we have this done,
  16370. 8:20:07we have this connected, we can choose
  16371. 8:20:084.1 mini. This is basically the brain
  16372. 8:20:11again, how it actually thinks. And now
  16373. 8:20:13we can connect it to a tool. Now we also
  16374. 8:20:15have a memory here, and the memory is
  16375. 8:20:16usually used when we are using the AI
  16376. 8:20:19agent sort of like a chatbot like this.
  16377. 8:20:21We want it to remember the previous
  16378. 8:20:22conversation or the previous answer or
  16379. 8:20:24question that we gave it as context for
  16380. 8:20:27the next steps. Well, in this case, uh
  16381. 8:20:29we can add it. We go here, I can put
  16382. 8:20:30simple memory. And we have context
  16383. 8:20:32window length, which is how many past
  16384. 8:20:34interactions does the model receive as
  16385. 8:20:35context. We can leave five, that's fine.
  16386. 8:20:37And now for the fun part, is Perplexity.
  16387. 8:20:40So this is how we actually do the
  16388. 8:20:41research. So I can go to Perplexity.
  16389. 8:20:43You can go to Perplexity tool right
  16390. 8:20:45here. We're just talking to the API of
  16391. 8:20:46Perplexity and generating um responses
  16392. 8:20:49with citations. I can go [music] in
  16393. 8:20:51here, and we get introduced to this. Now
  16394. 8:20:53you will not get introduced to this
  16395. 8:20:54because you will not have an account.
  16396. 8:20:55All you have to do is press create a new
  16397. 8:20:57credential. And now you need an API key.
  16398. 8:20:59So all you have to do is go to
  16399. 8:21:01Perplexity.
  16400. 8:21:02ai
  16401. 8:21:03up here.
  16402. 8:21:04And you want to make an account. Once
  16403. 8:21:05you make an account, you can go down to
  16404. 8:21:07account, you can go to API,
  16405. 8:21:10and I believe that you have API keys on
  16406. 8:21:14the left-hand side.
  16407. 8:21:15Right here. You can accept terms and
  16408. 8:21:17generate a key. I can do n8n research
  16409. 8:21:20agent test. I can create a key.
  16410. 8:21:23I can now copy it
  16411. 8:21:25and paste it here.
  16412. 8:21:27I can say Michele
  16413. 8:21:2915th of October.
  16414. 8:21:32Put it here. There you go. And press
  16415. 8:21:33save. And now you should be able to see
  16416. 8:21:35it here, and you have successfully
  16417. 8:21:36connected n8n to Perplexity. But as we
  16418. 8:21:39mentioned before, just like OpenAI, this
  16419. 8:21:41is not free. So you have to go to API
  16420. 8:21:43billing. You would have to buy credits.
  16421. 8:21:45I think I put $5 on a few months ago,
  16422. 8:21:48and I still have it. $4 in 2017. So it's
  16423. 8:21:50very, very cheap. And once you have
  16424. 8:21:52this, now you can actually use the API.
  16425. 8:21:54For tool description, we can set
  16426. 8:21:55automatically. Operation, which is what
  16427. 8:21:57is the action that we're doing, is
  16428. 8:21:58messaging a model.
  16429. 8:22:00And you can do custom API call, but in
  16430. 8:22:01this case, messaging a model just says,
  16431. 8:22:03"Hey, I'm going to automatically go into
  16432. 8:22:06Perplexity. I'm going to automatically
  16433. 8:22:07type something and get an answer back."
  16434. 8:22:10And now we have the different models.
  16435. 8:22:12I'm going to go to Perplexity API models
  16436. 8:22:15to see the difference each one. There
  16437. 8:22:16you go, models.
  16438. 8:22:18So here we have all the models, and we
  16439. 8:22:20have the search models, which are
  16440. 8:22:22inherently the models that you just use
  16441. 8:22:24uh to retrieve information, just like a
  16442. 8:22:27general searching model, which is the
  16443. 8:22:28one that we're going to use. We have
  16444. 8:22:29reasoning, so more for multi-step tasks
  16445. 8:22:32and research.
  16446. 8:22:34So this is really for conducting
  16447. 8:22:35in-depth research. The only thing about
  16448. 8:22:37this is that it does take a lot longer
  16449. 8:22:38than uh something like Sonar or Sonar
  16450. 8:22:40Pro. So we're just going to use Sonar in
  16451. 8:22:42this case.
  16452. 8:22:43I'm going to try both actually. Um let's
  16453. 8:22:45start with Sonar, and then we can put it
  16454. 8:22:47there. We can go inside, and now I can
  16455. 8:22:48change the model to again Sonar. We can
  16456. 8:22:50use Sonar Pro as well. And now we have
  16457. 8:22:53the user prompt. So the user prompt is
  16458. 8:22:55what is the thing that we're giving
  16459. 8:22:56Perplexity, so this sort of the input,
  16460. 8:22:59right, that it uses when it's doing the
  16461. 8:23:01research. So in this case, if you press
  16462. 8:23:02this button right here, what this will
  16463. 8:23:03now do is it will let the model define
  16464. 8:23:05its parameter. So the AI agent is smart
  16465. 8:23:07enough so that it decides what goes into
  16466. 8:23:09Perplexity for it to actually do the
  16467. 8:23:11research for and then giving us the
  16468. 8:23:12output. So I'm going to press this, and
  16469. 8:23:15we can leave everything as is. All
  16470. 8:23:16right, now we have this, I can test it.
  16471. 8:23:18So I can go here, open chat, and I can
  16472. 8:23:20say,
  16473. 8:23:21"What is the latest news on why 95% of
  16474. 8:23:23AI products fail?" I can press go.
  16475. 8:23:26What it should now do is it will talk to
  16476. 8:23:27the uh Perplexity tool, and it will talk
  16477. 8:23:29back to the OpenAI to structure the
  16478. 8:23:31output
  16479. 8:23:33for us to get it back on the chat. So
  16480. 8:23:35you can see we have the research here,
  16481. 8:23:37which is in-depth research. So you can
  16482. 8:23:38see it's pretty good research compared
  16483. 8:23:39to something like ChatGPT. The key
  16484. 8:23:41reasons why 95% of AI products fail,
  16485. 8:23:43poor data quality, lack of business
  16486. 8:23:45alignment, execution, cost, privacy,
  16487. 8:23:47hype versus hard work. Uh and then the
  16488. 8:23:495% of AI projects that succeed typically
  16489. 8:23:52is XYZ. So we get a full report or full
  16490. 8:23:54answer, researched, right, which is
  16491. 8:23:56actually pretty good. This is the thing
  16492. 8:23:57that Perplexity is giving us back,
  16493. 8:23:59right, which is the responses. We can
  16494. 8:24:01see the prompt tokens, uh the amount
  16495. 8:24:03that it took us, so 0.006,
  16496. 8:24:06which is very, very cost-effective. And
  16497. 8:24:08then citations, so the citations that it
  16498. 8:24:10uses.
  16499. 8:24:11It actually goes to YouTube videos,
  16500. 8:24:12which is interesting.
  16501. 8:24:13Who is this?
  16502. 8:24:15Let's see. The AI bubble, why 95% of AI
  16503. 8:24:17products fail. 1.1 million. It's cool.
  16504. 8:24:20Um and we have more search results,
  16505. 8:24:23right, which you can then use as
  16506. 8:24:26citations or as more evidence as well.
  16507. 8:24:28And the content is what is the actual
  16508. 8:24:29message back that it gives to the user
  16509. 8:24:31with all the citations. You can see 2 4
  16510. 8:24:337 obviously refers to
  16511. 8:24:36um citation two, citation four, citation
  16512. 8:24:38seven. So that's pretty much how you can
  16513. 8:24:39set up an AI agent uh that can do
  16514. 8:24:41research. Now I'm going to apply this to
  16515. 8:24:42a business use case. So let's say we had
  16516. 8:24:44a business which had a form on the
  16517. 8:24:45website, which you're going to make. And
  16518. 8:24:47the form on the website asked someone to
  16519. 8:24:49add the website. Right? So they say,
  16520. 8:24:51"Hey, what's your name? What's your
  16521. 8:24:52email? What's your phone number? And
  16522. 8:24:54what's your website?" Right? And so what
  16523. 8:24:56this does is that it takes the details
  16524. 8:24:57from someone filling out the form on the
  16525. 8:24:58website, and then it uses Perplexity to
  16526. 8:25:01do the research on that website before
  16527. 8:25:03giving us an answer that we can add to
  16528. 8:25:05our CRM. So let's build it.
  16529. 8:25:07This right here is going to be
  16530. 8:25:08um the same because it's pretty much
  16531. 8:25:10standard. Uh I'm going to change the
  16532. 8:25:12prompts a little bit, but apart from
  16533. 8:25:14that it's fine. And I can do on form
  16534. 8:25:15submission
  16535. 8:25:16because we're making a form.
  16536. 8:25:18And this will be the first step in this
  16537. 8:25:19case. I can go inside, and I can put a
  16538. 8:25:23name for the form, which is website
  16539. 8:25:25form.
  16540. 8:25:27By the way, don't worry about these.
  16541. 8:25:28Test URL is just a URL that we use when
  16542. 8:25:29you're testing. Production we use when
  16543. 8:25:32we set the automation to active.
  16544. 8:25:33Authentication is if you want to put a
  16545. 8:25:35password, but we don't want to. Uh we
  16546. 8:25:37have the title, and this is, "Please
  16547. 8:25:38fill out the form with your details."
  16548. 8:25:40Then we can add form element, which is
  16549. 8:25:42saying, "Hey, what are the questions?"
  16550. 8:25:43In this case, we can ask them actually
  16551. 8:25:45full name. Yeah.
  16552. 8:25:47And we can say company name.
  16553. 8:25:50We can say
  16554. 8:25:52uh company website,
  16555. 8:25:54which is the thing that we'll actually
  16556. 8:25:55use.
  16557. 8:25:57I believe that it has
  16558. 8:25:59date checkboxes? No. Oh, email only.
  16559. 8:26:02Um that's it.
  16560. 8:26:03Right? We can just ask three different
  16561. 8:26:05questions. Of course, a company would
  16562. 8:26:07probably want to know what is your
  16563. 8:26:08budget, what are you looking to to do,
  16564. 8:26:10and so on. But these are three simple
  16565. 8:26:12questions. So, I can execute step, and I
  16566. 8:26:14can say Michele Torti.
  16567. 8:26:17Company name is JM Solutions.
  16568. 8:26:19My website is jmsolutions.com.
  16569. 8:26:22Submit.
  16570. 8:26:23They should now send a signal here
  16571. 8:26:25with the details that we can then use
  16572. 8:26:26for the next steps. So, I can pin the
  16573. 8:26:28information, which means that now I
  16574. 8:26:30don't have to rerun it again every
  16575. 8:26:31single time that I want to run the
  16576. 8:26:33automation.
  16577. 8:26:34And now, the only thing that goes into
  16578. 8:26:36this is not the chat input, because
  16579. 8:26:38we're not chatting to it anymore. What
  16580. 8:26:40we're doing is we can define
  16581. 8:26:42the user message below. And again, user
  16582. 8:26:44message is the thing that we actually
  16583. 8:26:45give to the AI agent every single time
  16584. 8:26:47that is different. In this case, it will
  16585. 8:26:49be
  16586. 8:26:50the company website. And what we can do
  16587. 8:26:52is actually
  16588. 8:26:53do company website,
  16589. 8:26:56company name, actually,
  16590. 8:26:58and then company website.
  16591. 8:27:02Company name.
  16592. 8:27:04There we go here.
  16593. 8:27:05Company name.
  16594. 8:27:08And there you go. Company name and
  16595. 8:27:09company website is the thing that goes
  16596. 8:27:10into the AI agent
  16597. 8:27:12for it to use when making research of
  16598. 8:27:15that company. So, I'm going to say
  16599. 8:27:17you are a helpful assistant that helps
  16600. 8:27:19to do research on new companies that
  16601. 8:27:23come through. You could say that, right?
  16602. 8:27:24Assistant account Yeah, you can say
  16603. 8:27:26that.
  16604. 8:27:26Uh and then let's say uh for rules,
  16605. 8:27:30so I'm going to say
  16606. 8:27:31we are or actually the
  16607. 8:27:34the research
  16608. 8:27:35that we are looking for from the company
  16609. 8:27:40should contain
  16610. 8:27:41target audience, and let's do
  16611. 8:27:45offer.
  16612. 8:27:46So, we want to know the offer of the
  16613. 8:27:48company and target audience. That's it.
  16614. 8:27:51I believe this should work. Uh let's see
  16615. 8:27:52if it doesn't. If it doesn't, we'll
  16616. 8:27:53change the prompt.
  16617. 8:27:54And now, this will be the same. Yeah,
  16618. 8:27:57this will be the same. Let's test this
  16619. 8:27:58out. Let's go
  16620. 8:28:00here.
  16621. 8:28:01Oh, actually no. Yeah, we can't use the
  16622. 8:28:02simple memory because
  16623. 8:28:04the simple memory only works when we're
  16624. 8:28:06using a chat model. So, when we're
  16625. 8:28:07chatting to it like a chatbot. But in
  16626. 8:28:09this case, we're not doing it. So, we're
  16627. 8:28:11just using um these two.
  16628. 8:28:13And we press go.
  16629. 8:28:15Execute workflow.
  16630. 8:28:16You see how I didn't have to fill out
  16631. 8:28:17the form every single time? Now it's
  16632. 8:28:19doing research, and then at the end, it
  16633. 8:28:21gives us JM Solutions targets SMBs
  16634. 8:28:23looking to improve operational
  16635. 8:28:24efficiency through innovative workflow
  16636. 8:28:26automation solutions, XYZ. [music] Cool.
  16637. 8:28:29Which now we can add to our CRM. So, I
  16638. 8:28:31can just make a new Google Sheet. I can
  16639. 8:28:32name it say CRM.
  16640. 8:28:36New
  16641. 8:28:38website
  16642. 8:28:39leads.
  16643. 8:28:40I can say company name, or full name.
  16644. 8:28:44Oh, there we go. Full name.
  16645. 8:28:46Company name.
  16646. 8:28:48Let me zoom in so you can see here.
  16647. 8:28:51We'll ask I can do company
  16648. 8:28:54website
  16649. 8:28:55and research. I can make this black,
  16650. 8:28:59white, bold.
  16651. 8:29:02And freeze up to row one. I'm going to
  16652. 8:29:04do like this. I can still see it. Cool.
  16653. 8:29:06And now I have to connect Google Sheets
  16654. 8:29:07to Any Ten.
  16655. 8:29:09And to do that, I can go here.
  16656. 8:29:11I can press plus. I can go to Google
  16657. 8:29:13Sheets.
  16658. 8:29:14I can then append a row in a sheet.
  16659. 8:29:16Append just means you're adding a row
  16660. 8:29:18into a sheet.
  16661. 8:29:20Connect your account by going here. Just
  16662. 8:29:22press sign in with Google, which will
  16663. 8:29:23take you to this page. You can press
  16664. 8:29:24your account that you are connected
  16665. 8:29:26with. And once you're connected, you can
  16666. 8:29:27go to sheet within a document, append a
  16667. 8:29:29row, because that is the action that
  16668. 8:29:30we're taking. The document would be CRM
  16669. 8:29:33new website leads.
  16670. 8:29:34The sheet will be sheet one. Yep.
  16671. 8:29:38And then, the values to send. So, this
  16672. 8:29:40is saying, "Hey, what do we want to add
  16673. 8:29:41here, here, here, and here every single
  16674. 8:29:44time that it runs?"
  16675. 8:29:46We like to add the full name, which you
  16676. 8:29:47can get on the left-hand side
  16677. 8:29:49on the form. It's the full name.
  16678. 8:29:51Company name.
  16679. 8:29:53Company website.
  16680. 8:29:55Research.
  16681. 8:29:57And something more that we want to add
  16682. 8:29:59is submission date.
  16683. 8:30:01So, submission
  16684. 8:30:03date.
  16685. 8:30:06Because we ideally want to know exactly
  16686. 8:30:07what date and time they submitted the
  16687. 8:30:09form. This now refreshes because it saw
  16688. 8:30:11that I changed something within the
  16689. 8:30:12sheet. I can then add submitted at right
  16690. 8:30:15here. But the problem is that if I go
  16691. 8:30:19if I press this to go full screen,
  16692. 8:30:21this right here is very messy. And so,
  16693. 8:30:23what I want to do here is actually
  16694. 8:30:24format it so it's readable to a normal
  16695. 8:30:26human who has no clue what T01, all of
  16696. 8:30:29this stuff is.
  16697. 8:30:30So, what I can do is I can go in here,
  16698. 8:30:33and I can put dot
  16699. 8:30:35to date format, I believe.
  16700. 8:30:37And I can say, what is it? Format date?
  16701. 8:30:41Format. Yeah, okay, cool.
  16702. 8:30:44Let me go into the formatting guide so I
  16703. 8:30:45can see how to make a date look normal.
  16704. 8:30:49Got this horrible. Let me see here.
  16705. 8:30:52August 6th, 2014.
  16706. 8:30:54This will be DD.
  16707. 8:30:56All I have to do here is just put DD.
  16708. 8:31:00There we go. 16th of October, 2025. And
  16709. 8:31:03this will be format that we add the date
  16710. 8:31:05inside of the Google Sheet.
  16711. 8:31:07So, now I can pin this data,
  16712. 8:31:09which means that I don't have to rerun
  16713. 8:31:10this again. I can just press go.
  16714. 8:31:12What this should now do is she would
  16715. 8:31:13send the information here to the Google
  16716. 8:31:16Sheet. Michele, JM Solutions with the
  16717. 8:31:18website, with the research, which
  16718. 8:31:20is very long. Let me make this a bit
  16719. 8:31:22bigger.
  16720. 8:31:23Come on.
  16721. 8:31:25Go here.
  16722. 8:31:27She can then read about offer and who
  16723. 8:31:29they're targeting, and submission date
  16724. 8:31:30as well. So, you get to know exactly
  16725. 8:31:32when they submitted the form. And there
  16726. 8:31:34we there is a use case that you can use
  16727. 8:31:35the research AI agent for to do research
  16728. 8:31:38on someone when they come through from
  16729. 8:31:39the website or some sort of input from
  16730. 8:31:42somewhere else. And we built this type
  16731. 8:31:43of system for a company before. Uh a bit
  16732. 8:31:46more extensive, so a bit more stuff. Um
  16733. 8:31:48but it did research on new leads that
  16734. 8:31:50came through the website, and then it
  16735. 8:31:52looked at their social media, it looked
  16736. 8:31:53at their website, it looked at
  16737. 8:31:54everything that they had to then give it
  16738. 8:31:56to the sales reps right in their CRM
  16739. 8:31:59before the sales reps actually called
  16740. 8:32:01the lead, right? Because they had more
  16741. 8:32:02information, they were more prepared um
  16742. 8:32:04before actually going out and selling to
  16743. 8:32:06customers.
  16744. 8:32:10In this video, I'm going to show you
  16745. 8:32:11exactly how I built a voice agent inside
  16746. 8:32:13of Eleven Labs and connected it to Any
  16747. 8:32:15Ten that allows us to be able to send
  16748. 8:32:17emails, get contacts, [music]
  16749. 8:32:19and schedule calendar events. All right.
  16750. 8:32:21So, on the left-hand side, I have the
  16751. 8:32:22voice agent in Eleven Labs. On the
  16752. 8:32:24right-hand side, I have the AI agent in
  16753. 8:32:25Any Ten. I'm going to press execute
  16754. 8:32:27workflow, which is now waiting for the
  16755. 8:32:29voice agent to send information to the
  16756. 8:32:31AI agent. And I'm going to go and talk
  16757. 8:32:33to the AI agent here. Hey, my man. How's
  16758. 8:32:34it going? What's up, brother? Um can we
  16759. 8:32:37schedule a calendar event for tomorrow
  16760. 8:32:39at 5:00 p.m. with Michael James?
  16761. 8:32:41And just say that it's for celebratory
  16762. 8:32:45meeting. All righty, I'm setting up that
  16763. 8:32:46celebratory meeting for you with Michael
  16764. 8:32:48James for tomorrow at 5:00 p.m. Boom.
  16765. 8:32:51Your celebratory meeting with Michael
  16766. 8:32:52James is all set for tomorrow at 5:00
  16767. 8:32:54p.m. Is there anything else I can help
  16768. 8:32:56you with today, you magnif- That's it.
  16769. 8:32:57Magnificent what? Magnif-
  16770. 8:33:00There we go. So, we have a calendar
  16771. 8:33:01here, and the name celebratory meeting
  16772. 8:33:04scheduled for this email, which is
  16773. 8:33:06Michael James, which you can find right
  16774. 8:33:08here in our database
  16775. 8:33:09with Michael James and this email as
  16776. 8:33:11well.
  16777. 8:33:12There we go. All right. So, we're going
  16778. 8:33:13to go through the whole process step by
  16779. 8:33:14step. The first step is actually going
  16780. 8:33:16to Eleven Labs and seeing how we
  16781. 8:33:18actually set this up. So, if I go here
  16782. 8:33:20to the actual home page. So, when you
  16783. 8:33:22make an account on Eleven Labs, you will
  16784. 8:33:25have this dashboard right here. All you
  16785. 8:33:27have to go is here, and you go to agent
  16786. 8:33:29platform. So, typically you would be in
  16787. 8:33:31the creative platform, which is for
  16788. 8:33:32voices and so on. In this case, we want
  16789. 8:33:34to go to agent platform.
  16790. 8:33:36Want to press agent.
  16791. 8:33:37New agent right here.
  16792. 8:33:39When you press a new agent, you will
  16793. 8:33:40come on this page right here, and this
  16794. 8:33:42is where you start adding all the
  16795. 8:33:43settings. So, the first message is what
  16796. 8:33:45is the first thing that the AI voice
  16797. 8:33:46agent will say. In this case, as you can
  16798. 8:33:48see by or as you could have heard
  16799. 8:33:51um by the voice agent, it said, "Hey, my
  16800. 8:33:52man. How's it going?" And this is
  16801. 8:33:53important because it's the first thing
  16802. 8:33:55that the AI agent says.
  16803. 8:33:56Then the system prompt in this case is
  16804. 8:33:59this. So, so we said, "You are a
  16805. 8:34:01friendly and funny personal assistant
  16806. 8:34:02who loves helping the user with tasks in
  16807. 8:34:04an upbeat and approachable way. Your
  16808. 8:34:06role is to assist the user with sending
  16809. 8:34:07emails and scheduling calendar events.
  16810. 8:34:09When the user provides details like who
  16811. 8:34:11the email is for and what it's about,
  16812. 8:34:12you will pass the information to Any Ten
  16813. 8:34:14tool and wait for its response. If the
  16814. 8:34:16user tells you that you want to schedule
  16815. 8:34:17a calendar event, then you will pass the
  16816. 8:34:19information to the Any Ten tool and wait
  16817. 8:34:20for its response. Once you get the
  16818. 8:34:22confirmation from Any Ten that the email
  16819. 8:34:23has been sent, cheerfully let the user
  16820. 8:34:25know it's done, and ask if there's
  16821. 8:34:27anything else you can help with." And I
  16822. 8:34:28can also add
  16823. 8:34:31something else here. Once you get
  16824. 8:34:32confirmation from Any Ten that the event
  16825. 8:34:35was created, cheerfully let the user
  16826. 8:34:37know once it's done. [music]
  16827. 8:34:39Now, basically the way this works is
  16828. 8:34:40that we have the voice agent that we
  16829. 8:34:42speak to, sort of like a person. And
  16830. 8:34:43when we give information to the voice
  16831. 8:34:45agent, what that does is that it sends
  16832. 8:34:47information to our AI agent in Any Ten,
  16833. 8:34:49sort of acting as a back end, to then do
  16834. 8:34:52it the actual thing that we told it to
  16835. 8:34:53do, and then send back a response right
  16836. 8:34:56to the actual voice agent saying, "Hey,
  16837. 8:34:57everything is good." It's sort of like
  16838. 8:34:58you have the CEO who talks to the head
  16839. 8:35:00of sales. The sales guy in this case
  16840. 8:35:02does the action, then he goes back to
  16841. 8:35:03the head of sales saying, "Yeah,
  16842. 8:35:05everything was good." And then the head
  16843. 8:35:06of sales talks to the CEO. Right? The
  16844. 8:35:08CEO doesn't actually talk to the um the
  16845. 8:35:11actual sales guy because there's a
  16846. 8:35:12intermediate step. There's a step in
  16847. 8:35:14between. And so, this is the exact same
  16848. 8:35:16thing here. Between me and Any Ten, it's
  16849. 8:35:19Eleven Labs. It's me talking to Eleven
  16850. 8:35:21Labs, which then speaks [music] to the
  16851. 8:35:22back end system, which is Any Ten. And
  16852. 8:35:24so, what we have here, again, is a
  16853. 8:35:26prompt.
  16854. 8:35:27Dynamic variables, leave this blank.
  16855. 8:35:29LLM, I use Gemini 2.5 flash cuz it's
  16856. 8:35:31pretty cheap plus fast. Uh the backup
  16857. 8:35:34LLM configuration, leave this default.
  16858. 8:35:36You can leave this as default. The
  16859. 8:35:38thinking budget is fine right here. We
  16860. 8:35:40We need to control any internal
  16861. 8:35:41reasoning tokens. The temperature right
  16862. 8:35:43here is basically controlling how
  16863. 8:35:45creative do you want the AI agent to be.
  16864. 8:35:47The higher the temperature, the more
  16865. 8:35:49creative it is. The lower the
  16866. 8:35:50temperature, which means it's
  16867. 8:35:51deterministic, so we can determine
  16868. 8:35:53exactly what it's going to say. It's
  16869. 8:35:55less temperature. Now, for voice agent,
  16870. 8:35:57you want to be careful with this. You
  16871. 8:35:58want to make sure that it's not too
  16872. 8:36:00creative because then it goes outside of
  16873. 8:36:02the instructions that we give it, but
  16874. 8:36:04you also want to make sure that it's not
  16875. 8:36:06too deterministic, which means that it's
  16876. 8:36:07not too fixed into the instructions
  16877. 8:36:09because then we'll have the problem that
  16878. 8:36:11it starts sounding like a robot. Limit
  16879. 8:36:13token usage, and so we're basically
  16880. 8:36:14predicting or we're limiting the amount
  16881. 8:36:16of money, the amount of tokens, which
  16882. 8:36:18equals to money, credits,
  16883. 8:36:20that we're using for the LLM. LLM just
  16884. 8:36:22stands for large language model. It's
  16885. 8:36:24like ChatGPT, Claude, Gemini, Grok. All
  16886. 8:36:27these are LLMs. Then you can also add a
  16887. 8:36:29agent knowledge base in case you want to
  16888. 8:36:31add documents that you want the AI
  16889. 8:36:33agent, in this case the voice agent, to
  16890. 8:36:35have access to when giving you back the
  16891. 8:36:37answer, which is great. And now for the
  16892. 8:36:39thing that we really care about is the
  16893. 8:36:41tools, custom tools. So this is how we
  16894. 8:36:43connect custom tools to Anytown or how
  16895. 8:36:47we connect voice agent to Anytown. So if
  16896. 8:36:49you can just press add a tool, you will
  16897. 8:36:51get to this page right here. You have to
  16898. 8:36:53put a name, in this case you can just
  16899. 8:36:54put Anytown, and the description is use
  16900. 8:36:56this tool to take action upon the user's
  16901. 8:36:57request. And then the first thing we're
  16902. 8:36:59doing is adding a webhook. Now for those
  16903. 8:37:01of you who don't know what a webhook is,
  16904. 8:37:03a webhook is a URL, which in this case
  16905. 8:37:05looks like this, which in Anytown the
  16906. 8:37:07way to set it up is go here,
  16907. 8:37:10add a trigger, and then a webhook call.
  16908. 8:37:13So on the webhook call right here.
  16909. 8:37:15And now this is the thing that is used
  16910. 8:37:17when we want to receive a signal. So
  16911. 8:37:18from the voice agent, we say, "Hey, can
  16912. 8:37:20you do this for me?"
  16913. 8:37:21It sends all the signal to the
  16914. 8:37:24automation to actually do it, and that's
  16915. 8:37:26what a webhook is used for. Make sure
  16916. 8:37:27that it's post because
  16917. 8:37:30post is the way that we send
  16918. 8:37:31information, get is the way that we get
  16919. 8:37:33information. By get, I mean get here.
  16920. 8:37:35Now I've made a full video showing you
  16921. 8:37:36exactly webhooks, HTTP APIs, all that
  16922. 8:37:39good stuff. You can check it out up
  16923. 8:37:41here, but that's what we use to send
  16924. 8:37:42information to the actual AI agent
  16925. 8:37:44inside of Anytown. Response timeout is
  16926. 8:37:46how long to wait for the client tool to
  16927. 8:37:48respond before timing out. The default
  16928. 8:37:50is 20 seconds. This is great in case
  16929. 8:37:52your actual workflow, your AI agent
  16930. 8:37:55inside of Anytown, has an error and it
  16931. 8:37:57doesn't actually send back the
  16932. 8:37:59information. And so we're just putting
  16933. 8:38:01some precaution saying, "Hey, if it
  16934. 8:38:02doesn't send back the information, just
  16935. 8:38:04let the user know." Leave this all as
  16936. 8:38:06is. Leave headers the same, path
  16937. 8:38:08parameters the same, query parameters
  16938. 8:38:09the same. And finally we have body
  16939. 8:38:11parameters. So body parameters are the
  16940. 8:38:13thing that we say, the instructions or
  16941. 8:38:15the variables that we send [music] to
  16942. 8:38:17Anytown's AI agent for it to actually
  16943. 8:38:19take action. So in this case there are
  16944. 8:38:21three things that we have to send over.
  16945. 8:38:23As you can see by the description, I
  16946. 8:38:24said, "Ask the user to provide the name
  16947. 8:38:26of the email recipient and what the
  16948. 8:38:28email is about unless they already
  16949. 8:38:30provided the information. And ask them
  16950. 8:38:32for the calendar event date and time if
  16951. 8:38:35they're looking to schedule an event."
  16952. 8:38:36Now in terms of properties, we have to
  16953. 8:38:38send different variables to the actual
  16954. 8:38:40workflow. Why? As you can see here, if I
  16955. 8:38:43go inside the webhook, which is the
  16956. 8:38:45thing that we use again to send the
  16957. 8:38:46data. Once we said, "Hey, I want to
  16958. 8:38:47schedule a calendar event with Michael
  16959. 8:38:49James, call it celebratory dinner at
  16960. 8:38:515:00 p.m." What it did is that it sent
  16961. 8:38:54the body parameters. So who are we doing
  16962. 8:38:57the thing for?
  16963. 8:38:58What is the event description? And what
  16964. 8:39:00is the calendar event time?
  16965. 8:39:02And so these variables are crucial in
  16966. 8:39:04making sure that the AI agent in Anytown
  16967. 8:39:07understands what it is that we want to
  16968. 8:39:09do, and as well
  16969. 8:39:11who are we doing it for or what other
  16970. 8:39:12variables need to be taken into account
  16971. 8:39:15when actually doing the actual thing.
  16972. 8:39:17And so [music] in Eleven Labs, we want
  16973. 8:39:18to start adding properties. So the first
  16974. 8:39:20property is two, which is who the email
  16975. 8:39:22is going to or who to schedule the event
  16976. 8:39:24with or for.
  16977. 8:39:27For you. And make this required because
  16978. 8:39:28we're going to need this either way.
  16979. 8:39:30And leave this [snorts] as LLM prompt
  16980. 8:39:32because we're leaving AI to decide this
  16981. 8:39:34variable right here.
  16982. 8:39:35The second one is email content, so what
  16983. 8:39:37the email is about. I made sure that
  16984. 8:39:39this is not required just because
  16985. 8:39:40sometimes we want to schedule a calendar
  16986. 8:39:42event and we don't need to send the
  16987. 8:39:44email content. So this is not required.
  16988. 8:39:46Leave this as LLM prompt because it
  16989. 8:39:48allows us to let AI define this. As
  16990. 8:39:50well, I didn't mention this, but string,
  16991. 8:39:52which just means text, right? In this
  16992. 8:39:54case you can do integer, number, object
  16993. 8:39:56array. We just want to keep it simple.
  16994. 8:39:58This is literally just text that's going
  16995. 8:40:00into the webhook, so leave this as is.
  16996. 8:40:02This is the name of the event for the
  16997. 8:40:03calendar. Now that I'm thinking of it,
  16998. 8:40:05this doesn't have to be required because
  16999. 8:40:07sometimes we just want to send an email.
  17000. 8:40:09We don't want to schedule a calendar
  17001. 8:40:11event. And finally, calendar event time,
  17002. 8:40:14which is what the event time and date is
  17003. 8:40:16at, which is not required, which is used
  17004. 8:40:18when we want to schedule a calendar
  17005. 8:40:20event. And leave the last thing as this.
  17006. 8:40:22So there we there is just setting up the
  17007. 8:40:23tool, which is all we really need in
  17008. 8:40:25order to connect Eleven Labs to Anytown.
  17009. 8:40:27Now once we have this, let's go to
  17010. 8:40:29Anytown and see exactly how it looks. So
  17011. 8:40:30this right here is the AI agent that
  17012. 8:40:32we're using. In case it's your first
  17013. 8:40:34time looking at the AI agent inside of
  17014. 8:40:35Anytown, stop this video, watch this
  17015. 8:40:38video up here where I show you the AI
  17016. 8:40:39agent fundamentals. Trust me, it will
  17017. 8:40:41make much more sense once you watch that
  17018. 8:40:43video.
  17019. 8:40:44Um but essentially an AI agent is
  17020. 8:40:45consisted of an input and an output. In
  17021. 8:40:47this case the input can be who are we
  17022. 8:40:49sending the email to or who are we
  17023. 8:40:51scheduling the calendar event uh for.
  17024. 8:40:53Then we have the event description, we
  17025. 8:40:55have the email content, or we have all
  17026. 8:40:57the different variables that I spoke to
  17027. 8:40:58you about based on what the user wants
  17028. 8:41:00to do. Then we have the output, which is
  17029. 8:41:03a message that is sent back to the voice
  17030. 8:41:04agent saying, "Yeah, everything was
  17031. 8:41:06good." Then we have the AI agent in the
  17032. 8:41:08middle, which is the thing that actually
  17033. 8:41:10takes action, right? Then we have the
  17034. 8:41:12brain, which in this case it's OpenAI.
  17035. 8:41:14It's the way it actually thinks. And
  17036. 8:41:16then we have the different tools, which
  17037. 8:41:17is what are the softwares that are
  17038. 8:41:18connected to the AI agent for it to
  17039. 8:41:21actually do the thing that it needs to
  17040. 8:41:22do. So the first thing is a webhook.
  17041. 8:41:25We want to make sure that this is post
  17042. 8:41:26because that's the method that we use on
  17043. 8:41:28the Eleven Labs. And when you get the
  17044. 8:41:29data here, you will see a ton of
  17045. 8:41:31variables. Honestly, I have no clue what
  17046. 8:41:32any of them are,
  17047. 8:41:34but the only thing that you really have
  17048. 8:41:35to care about is the body. So the body
  17049. 8:41:38is the actual variables that we get from
  17050. 8:41:41the voice agent for us to use when we
  17051. 8:41:42want to actually take action on whatever
  17052. 8:41:44it is. And so we get in this case to
  17053. 8:41:47Michael James, event description
  17054. 8:41:49celebratory meeting, and calendar event
  17055. 8:41:51time tomorrow at 5:00 p.m. [music]
  17056. 8:41:53And that's all you need to then send to
  17057. 8:41:55the AI agent
  17058. 8:41:57with a user prompt, which is usually a
  17059. 8:41:58message that we give to the AI agent
  17060. 8:42:00that changes every single time cuz in
  17061. 8:42:02this case we have the prompt user
  17062. 8:42:03message and we have the system message.
  17063. 8:42:05The system message is more so for
  17064. 8:42:06instructions. So we say, "Hey, here's
  17065. 8:42:09who you are. Here's the instructions.
  17066. 8:42:10Just follow this."
  17067. 8:42:11>> [music]
  17068. 8:42:11>> And then here is where we give the
  17069. 8:42:13variables that change every single time.
  17070. 8:42:15Now as you can see, this is code right
  17071. 8:42:16here, but what this means is
  17072. 8:42:19the person details, so who are we
  17073. 8:42:21sending the email to, which we get from
  17074. 8:42:22here. All right, make this smaller.
  17075. 8:42:25Two. If I drag this across,
  17076. 8:42:28I can see that it's JSON.body.two.
  17077. 8:42:30Email content is not something that
  17078. 8:42:32always shows up depending on what the
  17079. 8:42:33user wants to do.
  17080. 8:42:35And calendar event time and event
  17081. 8:42:36description is something that we add
  17082. 8:42:38here.
  17083. 8:42:39Event title and uh calendar event time
  17084. 8:42:42as well. And so we drag these variables
  17085. 8:42:43across right here. And again, if you
  17086. 8:42:46want to add this right here, you would
  17087. 8:42:47have to run the voice agent and tell it,
  17088. 8:42:49"Hey, can you send an email?" And that
  17089. 8:42:51will send an email here, and it will
  17090. 8:42:52give you this variable because this
  17091. 8:42:54variable is only available when you want
  17092. 8:42:55to send an email. And that's it for the
  17093. 8:42:57user prompt. So very very easy. We just
  17094. 8:42:58give it the variables, and now we get on
  17095. 8:43:00to the system message, which is the
  17096. 8:43:01instructions. Now if you get the full
  17097. 8:43:03blueprint for free, you will be able to
  17098. 8:43:05have the whole prompt, so don't worry.
  17099. 8:43:06Um or else take a screenshot of this and
  17100. 8:43:08then put it through ChatGPT and tell it
  17101. 8:43:10to extract the text from the image. But
  17102. 8:43:12what we're doing here is we're using the
  17103. 8:43:14typical prompt format, which is
  17104. 8:43:15overview. So you're a friendly, witty
  17105. 8:43:18personal assistant who helps users send
  17106. 8:43:19emails, get contacts, and schedule
  17107. 8:43:21meetings, XYZ.
  17108. 8:43:23Then we give the tools. So the tool name
  17109. 8:43:25plus the description. It sends an email
  17110. 8:43:27only when instructed or when email
  17111. 8:43:28content is provided. So when the
  17112. 8:43:30variable email content is given. And
  17113. 8:43:32then schedule calendar event and so on.
  17114. 8:43:34And then instructions, the rule, and
  17115. 8:43:35finally current date and time. Now the
  17116. 8:43:37reason why we give the AI current date
  17117. 8:43:39and time is because AI isn't the best at
  17118. 8:43:42guessing or knowing the date and time of
  17119. 8:43:44today. So with this prompt, we're then
  17120. 8:43:46able to take action, right? And the next
  17121. 8:43:48step we have to do is connect our AI
  17122. 8:43:50agent to the brain, which is in this
  17123. 8:43:52case is OpenAI. And to connect OpenAI,
  17124. 8:43:55you have to go to platform.openai.com.
  17125. 8:43:58Log in, make an account, and then go to
  17126. 8:44:00dashboard. You can go to API keys,
  17127. 8:44:03go to create a new secret key,
  17128. 8:44:05name it, get the key, and then bring it
  17129. 8:44:07back to Anytown right here,
  17130. 8:44:09which is basically a password that says,
  17131. 8:44:11"Hey, you can use my OpenAI account."
  17132. 8:44:13And then you press save. Now leave this
  17133. 8:44:15as GPT-4.1 Mini is more than good for
  17134. 8:44:19what we want to do.
  17135. 8:44:20And then we have the tools. So we
  17136. 8:44:22connected this to three different tools.
  17137. 8:44:23The first tool is Google Sheets to get
  17138. 8:44:25contacts, which is this right here. Then
  17139. 8:44:27we have Google Calendar right here to
  17140. 8:44:29schedule calendar events, which is this
  17141. 8:44:31right here. And finally, we want to send
  17142. 8:44:32emails to our Gmail, which is this right
  17143. 8:44:34here. And so the theory behind this is
  17144. 8:44:36that if you noticed, I didn't actually
  17145. 8:44:38give the voice agent an email. I just
  17146. 8:44:41gave it a name. And so that's why we
  17147. 8:44:43have the step of retrieving the contact
  17148. 8:44:46email from the Google Sheets here.
  17149. 8:44:49We have the name, and then we have the
  17150. 8:44:51email. So if I said to the voice agent,
  17151. 8:44:52"Hey, can you send an email to Michael
  17152. 8:44:54James?" I instructed the AI agent to
  17153. 8:44:57know that it has to look at here first
  17154. 8:44:59to be able to get the email to then take
  17155. 8:45:00the action, right? And so it will go
  17156. 8:45:02here. It will say Michael James. Michael
  17157. 8:45:04James has this email, and this is the
  17158. 8:45:06email that we're going to use to be able
  17159. 8:45:08to schedule the calendar event or send
  17160. 8:45:09the email to the actual person. And so
  17161. 8:45:11we go in here. To connect your Google
  17162. 8:45:13Sheets, all you have to do is create a
  17163. 8:45:14new credential, sign in with Google. It
  17164. 8:45:16will take you to the standard
  17165. 8:45:18um login with Google page. Once you
  17166. 8:45:20connected your account, make sure to
  17167. 8:45:21have sheet within document. You want to
  17168. 8:45:23get rows, which is the action that we're
  17169. 8:45:25taking. Again, get rows just means get
  17170. 8:45:27all the rows from the actual Google
  17171. 8:45:28Sheet,
  17172. 8:45:29which is that one right here as I
  17173. 8:45:31mentioned. So it gets all of them, and
  17174. 8:45:33then it decides who is who. Then you
  17175. 8:45:35want to choose the exact Google Sheet,
  17176. 8:45:37uh contacts database USB, and then the
  17177. 8:45:39sheet within the Google Sheet will be
  17178. 8:45:41sheet one. And finally, that's when you
  17179. 8:45:43get the actual output, which is row
  17180. 8:45:44number two, the name is Michael James,
  17181. 8:45:47the name is John Laurie, James Low,
  17182. 8:45:48James Arthur, with the emails as well.
  17183. 8:45:50And based on what the user added as a um
  17184. 8:45:53sort of input, it will then choose the
  17185. 8:45:55corresponding email.
  17186. 8:45:56So, if it's Michael James, it will
  17187. 8:45:57choose this. If it's John Laurie, it
  17188. 8:45:59will choose this. If it's James Low,
  17189. 8:46:01this. James Arthur, this. And that's for
  17190. 8:46:03the first tool. Then we have schedule
  17191. 8:46:04calendar event. Again, same exact
  17192. 8:46:06concept. Go here, sign in with Google,
  17193. 8:46:08so you can connect your calendar. Tool
  17194. 8:46:10description, set automatically. The
  17195. 8:46:11resource, which is what is the thing
  17196. 8:46:13that we're manipulating. In this case,
  17197. 8:46:14it will be the event. The operation,
  17198. 8:46:17which is what is the action that we're
  17199. 8:46:18taking. We're creating an event. The
  17200. 8:46:20calendar will be my calendar. And then
  17201. 8:46:22start and end, we can simply just press
  17202. 8:46:24these two buttons,
  17203. 8:46:25>> [music]
  17204. 8:46:26>> which basically means that we're letting
  17205. 8:46:27the model, we're letting AI define these
  17206. 8:46:29two parameters. We want to turn this on
  17207. 8:46:31so that we don't have to do it manually,
  17208. 8:46:33which is the beauty of AI agents. Then
  17209. 8:46:34we have two different fields that we
  17210. 8:46:36want to fill out. The first one is
  17211. 8:46:37attendees, which you can find here,
  17212. 8:46:39attendees.
  17213. 8:46:40And then you simply do the same thing
  17214. 8:46:41here, which is just pressing the AI,
  17215. 8:46:44which in this case, the model itself
  17216. 8:46:46will send the attendee email over, right
  17217. 8:46:48here. And then the summary, you can pull
  17218. 8:46:50from the Where is it? Event description.
  17219. 8:46:53Over here.
  17220. 8:46:55And that will be the title of the actual
  17221. 8:46:56meeting. And that's how we get the
  17222. 8:46:57calendar event to look like this, where
  17223. 8:46:59we have the title, and it sends it to
  17224. 8:47:01the right person. And then finally, we
  17225. 8:47:03have the send email. So, if I go here,
  17226. 8:47:05same exact concept. Just go here, sign
  17227. 8:47:07in with Google. Set automatically. The
  17228. 8:47:09resource that we are manipulating will
  17229. 8:47:11be message. The action that we're taking
  17230. 8:47:12is we're sending a message. The
  17231. 8:47:13beautiful thing about Anythink AI agents
  17232. 8:47:15to set up tools is that we literally
  17233. 8:47:17just have to press
  17234. 8:47:19three buttons, and that's it. So, we're
  17235. 8:47:21letting AI define who are we sending the
  17236. 8:47:23email to, what is the subject line, and
  17237. 8:47:25what is the message. And what we could
  17238. 8:47:26do here as well is turn this off, append
  17239. 8:47:28Anythink attribution, so that the end of
  17240. 8:47:30the email, it doesn't say this was sent
  17241. 8:47:31by Anythink. And finally, we use a
  17242. 8:47:33respond to webhook node, which responds
  17243. 8:47:37with the first incoming item, which is
  17244. 8:47:38this right here. The celebratory meeting
  17245. 8:47:40with Michael James has been scheduled
  17246. 8:47:41for tomorrow. If you need me to send any
  17247. 8:47:43emails or add more details, then let me
  17248. 8:47:45know. And that will be the thing that's
  17249. 8:47:47sent to the actual voice agent in Eleven
  17250. 8:47:48Labs. So, think of this as a boomerang,
  17251. 8:47:51right? We have the voice agent here.
  17252. 8:47:53It then goes here, and then it brings it
  17253. 8:47:54back to the voice agent. Right? Sort of
  17254. 8:47:56like again, we're talking to an
  17255. 8:47:57employee, to head of department,
  17256. 8:47:59employee, back to the head of
  17257. 8:48:00department, to the CEO. All right, so
  17258. 8:48:02I'm going to test this again. And in
  17259. 8:48:04this case, let's do sending an email.
  17260. 8:48:05And we can send the email to James
  17261. 8:48:07Arthur. So, right here, I can call the
  17262. 8:48:09AI agent.
  17263. 8:48:10Hey, my man. How's it going?
  17264. 8:48:12What's up, brother?
  17265. 8:48:13Uh can you send an email to James
  17266. 8:48:16Arthur, and can you say that we are
  17267. 8:48:19disappointed in your work? You should
  17268. 8:48:21have done better in yesterday's meeting,
  17269. 8:48:23and that you're almost about to get
  17270. 8:48:25fired.
  17271. 8:48:25>> All right, I am sending that email to
  17272. 8:48:27James Arthur right away. Hold there. I
  17273. 8:48:29found a James Arthur with the email
  17274. 8:48:30[email protected].
  17275. 8:48:32Should I send it to that address? Also,
  17276. 8:48:34that message is a bit strong. Would you
  17277. 8:48:36like me to help you rephrase it a little
  17278. 8:48:38more gently? Nah, you're good. Just send
  17279. 8:48:40that email over. Understood. Sending
  17280. 8:48:41that email now, no holds barred. Oopsie.
  17281. 8:48:44Yeah, it seems like there was a little
  17282. 8:48:45hiccup, and I couldn't send that email.
  17283. 8:48:47Don't worry, it's not you. It's probably
  17284. 8:48:49just a
  17285. 8:48:49glitch with my system.
  17286. 8:48:51Can you try Can you try again? I'm on
  17287. 8:48:53it. Let's try sending that email one
  17288. 8:48:54more time. Dread. Seems like I'm still
  17289. 8:48:57having a bit of trouble sending that
  17290. 8:48:58email. Okay, so there was trouble
  17291. 8:48:59sending the email. Let's see why.
  17292. 8:49:02I thought it was because it needed to
  17293. 8:49:04confirm.
  17294. 8:49:05But in this case, let's just go inside
  17295. 8:49:07here,
  17296. 8:49:08and we actually did get the email
  17297. 8:49:10content. So, that's weird. So, I think
  17298. 8:49:12that is within the prompt itself. Uh
  17299. 8:49:14send an email only when instructed or
  17300. 8:49:16when email content is provided. Mm,
  17301. 8:49:18interesting.
  17302. 8:49:19So, in this case,
  17303. 8:49:21what I would do it I would just test it
  17304. 8:49:23again, and [music] it might have been a
  17305. 8:49:25hiccup on the Eleven Labs side. And by
  17306. 8:49:27the way, when you go live, you don't
  17307. 8:49:28have to execute a workflow every single
  17308. 8:49:30time. Just for testing purposes, we do,
  17309. 8:49:33which is why when he was trying again,
  17310. 8:49:35he said there was a hiccup because I had
  17311. 8:49:36to rerun this again, and I didn't give
  17312. 8:49:38enough time for me to press run and it
  17313. 8:49:40actually sending the information. Uh so,
  17314. 8:49:42let's test the AI agent again. Hey, my
  17315. 8:49:44man. How's it going? Yo, can you send an
  17316. 8:49:46email to Michael James saying that we
  17317. 8:49:48have dinner tomorrow at 5:00 p.m., uh
  17318. 8:49:50and just send it through. All right, I'm
  17319. 8:49:52sending that email right away. Oops, it
  17320. 8:49:54looks [clears throat] like I need a
  17321. 8:49:55little more information to send that
  17322. 8:49:56email to Michael James. Seems I didn't
  17323. 8:49:58get the full email content or a clear
  17324. 8:50:00event title. Could you please tell me
  17325. 8:50:02exactly what you'd like the email to
  17326. 8:50:03say? And if you want me to schedule this
  17327. 8:50:06as a calendar event, what should the
  17328. 8:50:07event be called?
  17329. 8:50:08>> Mm.
  17330. 8:50:09Uh just just name the email um the
  17331. 8:50:12email's about just having dinner
  17332. 8:50:13tomorrow, and it's to Michael James, and
  17333. 8:50:16no, we don't have to schedule any
  17334. 8:50:17calendar event. Got it. Just the email
  17335. 8:50:19then. Sending [music] it off to Michael
  17336. 8:50:21James now. Oh, no, it seems like there
  17337. 8:50:22was a little hiccup. The email didn't go
  17338. 8:50:24through. My apologies, it looks like I'm
  17339. 8:50:26having some trouble connecting right
  17340. 8:50:28now. Could you perhaps try again in a
  17341. 8:50:30little bit, or is there something else I
  17342. 8:50:31can help you with in the meantime? Yeah,
  17343. 8:50:33try again. Try again. You got it. Let's
  17344. 8:50:36get that email another shot for Michael
  17345. 8:50:37James. Oh, shucks. Seems like I'm still
  17346. 8:50:40getting a bit confused.
  17347. 8:50:41>> All right, so I think it's because I
  17348. 8:50:42don't have the variable here, which is
  17349. 8:50:43called email content. So, I'm going to
  17350. 8:50:45add this there and try again. Hey, my
  17351. 8:50:46man. How's it going?
  17352. 8:50:48Yo, can you send an email to Michael
  17353. 8:50:50James saying that we have a meeting
  17354. 8:50:51tomorrow at 5:00 p.m.? All right, I'm
  17355. 8:50:53sending that email for you. Consider it
  17356. 8:50:55done. I've sent your email to Michael
  17357. 8:50:57James with the message about the meeting
  17358. 8:50:59tomorrow at 5:00. Is there anything else
  17359. 8:51:01Great. So, we know why now. If I go to
  17360. 8:51:03my email, I can see that we have the
  17361. 8:51:06meeting reminder at 5:00 p.m. from James
  17362. 8:51:09Solutions, which is the email that I
  17363. 8:51:10connected to Anythink. Now, to explain
  17364. 8:51:12the problem that I just got, cuz you're
  17365. 8:51:13going to have a similar problem as well,
  17366. 8:51:16uh is
  17367. 8:51:17>> [music]
  17368. 8:51:17>> that inside the prompt, I actually told
  17369. 8:51:20in the rules that you should only send
  17370. 8:51:22an email
  17371. 8:51:23if you actually receive a variable
  17372. 8:51:26called email content. But here,
  17373. 8:51:29I actually had this deleted, and I
  17374. 8:51:31didn't have the name for the email
  17375. 8:51:32content. It was just the actual email
  17376. 8:51:33content. And so, by adding the name, it
  17377. 8:51:36then recognizes that we got this
  17378. 8:51:37variable, which means that now it's
  17379. 8:51:39allowed to send an email. So, that right
  17380. 8:51:41there is how you can make a voice agent
  17381. 8:51:42inside of Eleven Labs and connect it to
  17382. 8:51:44our AI agent inside of Anythink.
  17383. 8:51:49In this video, I'm going to show you how
  17384. 8:51:50I built a trading analyst [music]
  17385. 8:51:52AI agent inside of Anythink. You can
  17386. 8:51:54chat with it on Telegram and ask it to
  17387. 8:51:56check any stock. [music] It'll find the
  17388. 8:51:58chart, study it with AI, and tell you
  17389. 8:52:00exactly what it sees, like [music] if
  17390. 8:52:01it's going up or down, and how strong it
  17391. 8:52:03looks. It can even compare two stocks
  17392. 8:52:06and tell you which one looks better. All
  17393. 8:52:07right, so the AI agent is divided into
  17394. 8:52:09two different parts. We have the AI
  17395. 8:52:10agent here, and then we have the tool
  17396. 8:52:12that we call, which is the next
  17397. 8:52:14workflow, which is this one right here,
  17398. 8:52:15which is made to then get this sort of
  17399. 8:52:17chart, analyze it with AI, and give us
  17400. 8:52:19the answer back. All right, so I just
  17401. 8:52:20turned this on, so it's now waiting for
  17402. 8:52:21a message. I can say,
  17403. 8:52:23can you
  17404. 8:52:24analyze Microsoft?
  17405. 8:52:29And then go. What this will now do is it
  17406. 8:52:30will talk to the AI agent, which again
  17407. 8:52:32is prompted with instructions. It then
  17408. 8:52:34starts calling the tool right here,
  17409. 8:52:36which is this right here. So, if I go
  17410. 8:52:37here to executions, I can see down that
  17411. 8:52:39this is running. So, there's a current
  17412. 8:52:41workflow running, which means that it's
  17413. 8:52:43giving us the answer, and it's getting
  17414. 8:52:44it back. And then it's going to be able
  17415. 8:52:48to then give us the whole analysis back
  17416. 8:52:49on Telegram. And now it's going to give
  17417. 8:52:51us the actual analysis over here. So,
  17418. 8:52:54overall trend, recent price and action,
  17419. 8:52:56support and resistance levels, MACD,
  17420. 8:52:59which in case you don't know, I also
  17421. 8:53:01don't know, and volume analysis, overall
  17422. 8:53:04market sentiment. So, basically a full
  17423. 8:53:05breakdown of the stock because traders
  17424. 8:53:07go look at this pretty much every single
  17425. 8:53:09day, right? They look at this, they look
  17426. 8:53:10if it's going up or down. And so, this
  17427. 8:53:12AI will do that for you, saving you the
  17428. 8:53:13time of doing it yourself. And one more
  17429. 8:53:15thing that it can do as well is it can
  17430. 8:53:16compare two different stocks. So, I can
  17431. 8:53:18say here,
  17432. 8:53:19can you now compare Apple with
  17433. 8:53:21Microsoft? And I can go
  17434. 8:53:23>> [music]
  17435. 8:53:23>> play.
  17436. 8:53:24What this will now do is it will send it
  17437. 8:53:25again to the actual tool, but the only
  17438. 8:53:27difference now is that it will do it
  17439. 8:53:29twice. So, it will send the first item,
  17440. 8:53:31which in this case will be either
  17441. 8:53:33Microsoft or Apple, and then [music]
  17442. 8:53:35analyzes Microsoft, it will get the
  17443. 8:53:36graph, then will get the graph of Apple,
  17444. 8:53:38and then it will give us the full
  17445. 8:53:39analysis of both stocks together. As you
  17446. 8:53:41[music] can see, it was smart enough to
  17447. 8:53:42know that it already sent us the graph
  17448. 8:53:44for Microsoft. So, what it did is it
  17449. 8:53:45sent us the graph for Apple right here,
  17450. 8:53:47and it then
  17451. 8:53:49gave us the actual
  17452. 8:53:50>> [music]
  17453. 8:53:50>> analysis of overall trend, recent price,
  17454. 8:53:52MACD, volume analysis, support and
  17455. 8:53:54resistance, and current market
  17456. 8:53:55positioning for both Apple and
  17457. 8:53:57Microsoft. So, now you're able to
  17458. 8:53:59actually compare each one individually
  17459. 8:54:01in all the different uh categories right
  17460. 8:54:03here, which are about six. And we have
  17461. 8:54:04[music] the key takeaways as well. And
  17462. 8:54:06to me, this is insane cuz now we're able
  17463. 8:54:08to analyze stocks individually, but also
  17464. 8:54:10compare them and have AI do the whole
  17465. 8:54:12thing for us. With that said, let's go
  17466. 8:54:13through step by step exactly how it
  17467. 8:54:15works and how we set it up. So, this
  17468. 8:54:17right here is a typical structure of an
  17469. 8:54:19AI agent, right? We have the input, we
  17470. 8:54:21have the output. Now, in this case, the
  17471. 8:54:22input will be Telegram. So, the first
  17472. 8:54:24step is actually [music] connecting our
  17473. 8:54:25Telegram account. You can do this by
  17474. 8:54:27going here, press this button, let AI
  17475. 8:54:29tell you step by step what you have to
  17476. 8:54:30do. It's a longer process than than I
  17477. 8:54:32would explain in just 2 minutes. And as
  17478. 8:54:34you can see right here, this is the
  17479. 8:54:35output, right? And the output in this
  17480. 8:54:37case is update ID, message ID, from ID
  17481. 8:54:40is bot first name, language, all these
  17482. 8:54:42things. We don't really have to know.
  17483. 8:54:43The only two variables that we really
  17484. 8:54:45care about is chat ID because this
  17485. 8:54:48allows us to actually send back a
  17486. 8:54:50message in the same thread. It's sort of
  17487. 8:54:52like you're having a conversation with,
  17488. 8:54:53let's say, your friend. You don't want
  17489. 8:54:55to be sending a reply to another guy,
  17490. 8:54:57right? You want to be sending the reply
  17491. 8:54:58to the same exact conversation. And so,
  17492. 8:55:00this right here is the conversation.
  17493. 8:55:01It's just numbered. And then we have the
  17494. 8:55:03text. So, the text right here is the
  17495. 8:55:05actual text, right? It's the actual text
  17496. 8:55:06of what we ask the AI agent to do, and
  17497. 8:55:09that's what it will use to then send to
  17498. 8:55:11the AI agent, which is instructed It's
  17499. 8:55:13prompted to do different things uh to
  17500. 8:55:14then take action. We connect the input
  17501. 8:55:16to an AI agent, which has a prompt
  17502. 8:55:18inside, so I'll go through that in just
  17503. 8:55:19a second. But the AI agent in this case
  17504. 8:55:21is connected to a brain, which in this
  17505. 8:55:22case, it's Claude. And to connect your
  17506. 8:55:24Claude account, you have to go here, go
  17507. 8:55:26to anthropic.console,
  17508. 8:55:28log in.
  17509. 8:55:31Go here, create a key.
  17510. 8:55:33Put a name for it, so let's do any 10.
  17511. 8:55:36Add.
  17512. 8:55:37And then you will get this key [music]
  17513. 8:55:38that you will then paste to go back
  17514. 8:55:39here. Then choose the model. In this
  17515. 8:55:41case, we have different models. Claude
  17516. 8:55:433.5 Sonnet is fine. We usually look for
  17517. 8:55:46quality plus speed, but for something
  17518. 8:55:48like this, I think quality is more
  17519. 8:55:49important than speed because it is quite
  17520. 8:55:51a technical short topic, so we want to
  17521. 8:55:53make sure that it actually is good. Then
  17522. 8:55:54we have the memory, so connect this
  17523. 8:55:56right here, memory.
  17524. 8:55:58Which in this case is just a simple
  17525. 8:55:59memory tool, which is any 10's memory
  17526. 8:56:01tool, and we give it the context window
  17527. 8:56:03of five. Now, what this means is that it
  17528. 8:56:05takes the previous five conversations or
  17529. 8:56:07the previous five messages sent by me.
  17530. 8:56:10Which is great because, like you saw, I
  17531. 8:56:12told it, "Hey, now compare Apple with
  17532. 8:56:13Microsoft." So, it remembered already
  17533. 8:56:15that we already analyzed Microsoft. So,
  17534. 8:56:17what it has to do now is just analyze
  17535. 8:56:19Apple. And it's all because we have this
  17536. 8:56:21exact memory [music] tool. And one more
  17537. 8:56:23thing that we add here is a chat ID.
  17538. 8:56:25This is so that it remembers the actual
  17539. 8:56:27chat that we're having with the AI And
  17540. 8:56:30then finally, we have a tool. Now,
  17541. 8:56:31before I get to the tool, let's go
  17542. 8:56:32through the prompt inside here. It will
  17543. 8:56:34be a tools agent because we're using
  17544. 8:56:35tools, defined below, which is a user
  17545. 8:56:37prompt, which is what is the thing that
  17546. 8:56:39we're telling the AI agent to do, which
  17547. 8:56:40in this case, like I mentioned, is the
  17548. 8:56:42text.
  17549. 8:56:43Right here.
  17550. 8:56:44So, we drag this across.
  17551. 8:56:47And then we have the system message. So,
  17552. 8:56:48if I go here, this prompt is quite
  17553. 8:56:50extensive as in it's pretty detailed.
  17554. 8:56:52And by the way, if you want a full
  17555. 8:56:53blueprint, I'll show you at the end how
  17556. 8:56:55you can get it. And right here, we're
  17557. 8:56:56not doing any rocket science. We're
  17558. 8:56:57using the exact same prompt structure
  17559. 8:56:59that I mentioned in my video up here,
  17560. 8:57:01which is prompting AI agents. And that
  17561. 8:57:03is using an overview, so you are a AI
  17562. 8:57:05agent specializing in XYZ, giving it an
  17563. 8:57:07identity. Then we have context, so
  17564. 8:57:09things that it needs to know, and then
  17565. 8:57:11instructions because it's important for
  17566. 8:57:13it to know exactly step-by-step what to
  17567. 8:57:14do.
  17568. 8:57:15Then we have tools. So, tools is very
  17569. 8:57:17important because then it knows what to
  17570. 8:57:19call, what action to take based on what
  17571. 8:57:21we tell it to do.
  17572. 8:57:23Then we have examples, which is the
  17573. 8:57:24assistant prompt, which means that we
  17574. 8:57:26give it a few examples, so it has some
  17575. 8:57:28context when it actually does the thing.
  17576. 8:57:30And in this case, we give it three
  17577. 8:57:31examples. And then finally, SOPs, which
  17578. 8:57:34is pretty much the same as instructions.
  17579. 8:57:37And then final notes, which are some
  17580. 8:57:38final things, final rules to give it.
  17581. 8:57:40And so, in this prompt, what we
  17582. 8:57:41basically say is, "Look, the user is
  17583. 8:57:43going to ask you for stock to analyze.
  17584. 8:57:45What you have to do is just call this
  17585. 8:57:47tool when you want to analyze any
  17586. 8:57:50stock." And so, this tool right here,
  17587. 8:57:51what it is, it's connecting or it's
  17588. 8:57:53calling a different workflow inside of
  17589. 8:57:56any 10, which is the one right here,
  17590. 8:57:57which I'll go in it in just a second.
  17591. 8:57:59And so, this isn't a typical AI agent
  17592. 8:58:01where you just connect a software
  17593. 8:58:03directly here and it takes action on the
  17594. 8:58:05same workflow. This is an AI agent that
  17595. 8:58:07calls a different workflow and then gets
  17596. 8:58:08a response back, just like a boomerang.
  17597. 8:58:10Now, if I go inside here, the only thing
  17598. 8:58:12we have to do is name it, so get chart.
  17599. 8:58:14And the reason why we added get chart on
  17600. 8:58:16the prompt is so that it knows that this
  17601. 8:58:18is the get chart tool. And now that I
  17602. 8:58:20think of it, I think I [music] called it
  17603. 8:58:22I think I added a space in the prompt.
  17604. 8:58:24So, let me go here and edit it. Uh
  17605. 8:58:28Get chart is fine, actually. Get chart
  17606. 8:58:30Okay, that's fine then.
  17607. 8:58:31Make sure that the name of the tool is
  17608. 8:58:33exactly the same as the name in the
  17609. 8:58:35prompt. So, get chart and then the
  17610. 8:58:37description, which is what does it
  17611. 8:58:39actually do? In this case, call this
  17612. 8:58:41tool to get an analysis of a requested
  17613. 8:58:42[music] stock. Please return the URL
  17614. 8:58:44from this tool in markdown formatting.
  17615. 8:58:46For example, this URL. And the reason
  17616. 8:58:49why we asked the image to be in this
  17617. 8:58:51format, it's so that it can then send it
  17618. 8:58:53over to us on Telegram
  17619. 8:58:54>> [music]
  17620. 8:58:54>> in a format in a way where it actually
  17621. 8:58:56makes sense. Then we have the source.
  17622. 8:58:57So, this is saying, "Okay, we're calling
  17623. 8:58:59this tool, which is calling another
  17624. 8:59:01workflow, which in this case is here,
  17625. 8:59:03called any 10 workflow tool." And right
  17626. 8:59:04here, we give it a description of the
  17627. 8:59:05workflow. And then we have source. And
  17628. 8:59:07source and workflow just means, "What do
  17629. 8:59:09you want to call?" In this case, we want
  17630. 8:59:11to call the name of the workflow, which
  17631. 8:59:13we have right here.
  17632. 8:59:15So, to set this up, you have to make a
  17633. 8:59:17completely new workflow
  17634. 8:59:19and make sure that you have this node
  17635. 8:59:22right here, which is
  17636. 8:59:23I believe
  17637. 8:59:25uh
  17638. 8:59:26when executed by another workflow,
  17639. 8:59:28which is the one right here.
  17640. 8:59:30And so, you're sending the data and then
  17641. 8:59:31you're getting the data back. Which in
  17642. 8:59:33this case, the from list, it will be two
  17643. 8:59:36technical analyst agent because that is
  17644. 8:59:37the name of this right here. And again,
  17645. 8:59:39I will give you the whole blueprint for
  17646. 8:59:40free, so you can just play around with
  17647. 8:59:41it. And so, with this done, what we get
  17648. 8:59:44in the technical analysis agent, if I go
  17649. 8:59:46here to executions, I go to the previous
  17650. 8:59:48one,
  17651. 8:59:49and I can press this button copy to
  17652. 8:59:50editor, which will show me exactly the
  17653. 8:59:52data that I previously mentioned before.
  17654. 8:59:54We get
  17655. 8:59:56this. Now, for those of you who are new
  17656. 8:59:58to the trading world in stocks, it
  17657. 8:59:59actually isn't that hard. If I go to
  17658. 9:00:01Apple stock,
  17659. 9:00:03I can see that Apple stock isn't
  17660. 9:00:05actually called Apple. It's called AAPL,
  17661. 9:00:08right? NASDAQ, which is again the boss
  17662. 9:00:09of all the different stocks in the US.
  17663. 9:00:11And then we have AAPL, which is in this
  17664. 9:00:14case called a ticker, which is a short
  17665. 9:00:16version of Apple Inc., right? And so,
  17666. 9:00:18when we want to send it to the actual
  17667. 9:00:19thing to make the chart and so on, we
  17668. 9:00:21have to give it in a way where it
  17669. 9:00:22actually understands. So, we can't say
  17670. 9:00:24Apple Inc. We have to say AAPL. Which is
  17671. 9:00:26why we call them tickers. Once we
  17672. 9:00:28receive the ticker from these AI agent
  17673. 9:00:31right here. And so, what would happen
  17674. 9:00:32here is that we give it a, "Can you now
  17675. 9:00:34compare Apple with Microsoft?" And it
  17676. 9:00:36will know that now Apple needs to be
  17677. 9:00:37turned into a ticker, which will then be
  17678. 9:00:39sent here to the tool, which will then
  17679. 9:00:41be sent here,
  17680. 9:00:43which is the actual workflow, and which
  17681. 9:00:44is this.
  17682. 9:00:45And then this will be the thing that we
  17683. 9:00:47now use to actually make the chart and
  17684. 9:00:49download it. Now, the question you've
  17685. 9:00:50been asking yourself is, "How do we make
  17686. 9:00:52charts like these? How does this
  17687. 9:00:53happen?" We have to go to a platform
  17688. 9:00:55called chart/image.com,
  17689. 9:00:56which is the one right here,
  17690. 9:00:57chart/image.com.
  17691. 9:00:59And you want to be able to make an
  17692. 9:01:00account, so sign in.
  17693. 9:01:09And this is completely free. The only
  17694. 9:01:11caveat to this is that we have a daily
  17695. 9:01:13limit of 50, so you can only call this
  17696. 9:01:1550 times. The next step you want to do
  17697. 9:01:17is go to the API documentation, which is
  17698. 9:01:20just a documentation that says, "Hey,
  17699. 9:01:21here's how you can use it," right? On
  17700. 9:01:23the left-hand side, just understand the
  17701. 9:01:25D base URL, which is a URL that we have
  17702. 9:01:27to call. It is always sort of like a
  17703. 9:01:29link that you say, "Hey server, do this
  17704. 9:01:30for me." This is the start of the link.
  17705. 9:01:33And then to actually be able to call the
  17706. 9:01:34right exact graph because we have tons
  17707. 9:01:37of graphs that we can call.
  17708. 9:01:38We can get this, we can get this, we can
  17709. 9:01:41get all these. In this case, we have to
  17710. 9:01:43choose the right one. So, if I go here
  17711. 9:01:44to the graph that we want, if I go
  17712. 9:01:46under,
  17713. 9:01:47I can then see something called a curl.
  17714. 9:01:50Now, a curl is something that we just
  17715. 9:01:52literally just paste into a HTTP node,
  17716. 9:01:54which is a justice where
  17717. 9:01:55>> [music]
  17718. 9:01:56>> inside of any 10, that will do
  17719. 9:01:57everything for us. So, all you have to
  17720. 9:01:59do really is copy this curl
  17721. 9:02:02right here.
  17722. 9:02:04Go to any 10
  17723. 9:02:05and then be able to just add a HTTP
  17724. 9:02:08request. And then all you have to do
  17725. 9:02:09here is import curl.
  17726. 9:02:12So, you go here, paste this, and you
  17727. 9:02:14import it. And you will have this.
  17728. 9:02:16And that's when you start filling things
  17729. 9:02:17out. Now, if you get the blueprint, you
  17730. 9:02:19won't have to set this up, but at least
  17731. 9:02:21now you know exactly how it works. And
  17732. 9:02:22right here is where we start adding
  17733. 9:02:23everything. Now, one thing you have to
  17734. 9:02:25add is /storage because then it allows
  17735. 9:02:27us to be able to get this as a URL
  17736. 9:02:29format and make sure that everything's
  17737. 9:02:31good. Make sure to dispose so that we
  17738. 9:02:32send the information of the ticker and
  17739. 9:02:34then we get something back, which in
  17740. 9:02:36this case is a URL of the actual
  17741. 9:02:39stock.
  17742. 9:02:40And then we have to put the X API key.
  17743. 9:02:43Again, the API key is something that you
  17744. 9:02:44can find here,
  17745. 9:02:46API key, generate a new key here, and
  17746. 9:02:48then copy it.
  17747. 9:02:51And then content type, make sure this is
  17748. 9:02:52application/json
  17749. 9:02:54because all in all, you just want it to
  17750. 9:02:56give you the right format, right? And
  17751. 9:02:57then finally, the thing that matters the
  17752. 9:02:58most is this right here, which is what
  17753. 9:03:01are we actually telling the the server
  17754. 9:03:03to do. As you can see here, this is the
  17755. 9:03:05body. We call this the body, which is
  17756. 9:03:07what is the instructions that we tell
  17757. 9:03:09the actual server to do. Like what stock
  17758. 9:03:10are we asking it to to get? In this
  17759. 9:03:12[music] case, you can see that we have a
  17760. 9:03:14symbol, which is NASDAQ
  17761. 9:03:16colon
  17762. 9:03:17ticker, which we get from the actual
  17763. 9:03:20previous steps. Now, as I showed you
  17764. 9:03:21before, the way that the stock is
  17765. 9:03:22represented is NASDAQ colon Apple,
  17766. 9:03:25right? Ticker. So, we want to do the
  17767. 9:03:27exact same thing right here. NASDAQ
  17768. 9:03:29colon ticker.
  17769. 9:03:31And so, with that said, what it returns
  17770. 9:03:32to us is the URL of the actual stock
  17771. 9:03:35right here, like I've showed you. And
  17772. 9:03:36then finally, you want to put response
  17773. 9:03:38format JSON because we added up here
  17774. 9:03:40that we want the content type to be JSON
  17775. 9:03:42as well. So, just make sure you have
  17776. 9:03:43this and you have this here so you're
  17777. 9:03:45[music] able to get the URL of the
  17778. 9:03:46actual stock. Once this is done, then we
  17779. 9:03:48want to be able to download the chart,
  17780. 9:03:51so download the actual URL because this
  17781. 9:03:52isn't publicly available so that OpenAI
  17782. 9:03:54or AI can actually go inside the image
  17783. 9:03:56and analyze it.
  17784. 9:03:57>> [music]
  17785. 9:03:57>> So, the next step is just using a simple
  17786. 9:04:00HTTP request to get the link and
  17787. 9:04:03download it. Execute the step, which
  17788. 9:04:05looks like this. We get it in a binary
  17789. 9:04:06format.
  17790. 9:04:08Binary is just the way that an image or
  17791. 9:04:09a file is represented in the web.
  17792. 9:04:12Which then goes to the next step, which
  17793. 9:04:14is stock analysis, which is an AI. So,
  17794. 9:04:16we choose OpenAI. And the way to connect
  17795. 9:04:18your OpenAI is just by going to
  17796. 9:04:20platform.openai.com.
  17797. 9:04:21You can log in, you can go to dashboard.
  17798. 9:04:23On the left-hand side, you can go to API
  17799. 9:04:25keys, create a new secret key right
  17800. 9:04:27here, and then put a name and then
  17801. 9:04:28create the key like we did for Claude.
  17802. 9:04:31Bring it back here, put the API key
  17803. 9:04:32here.
  17804. 9:04:33And then make sure you choose image,
  17805. 9:04:35which is the thing that we're actually
  17806. 9:04:36using. And the action that we're taking
  17807. 9:04:38is analyzing image. The model can be
  17808. 9:04:40GPT-4o, that is good enough. And then we
  17809. 9:04:42give it a whole prompt, so text input,
  17810. 9:04:44which is telling it, "Hey, you'll be
  17811. 9:04:45given an image. Now, just assess the
  17812. 9:04:48image, analyze the output chart based on
  17813. 9:04:50the candlestick analysis, MACD analysis,
  17814. 9:04:52volume, support, actionable, other
  17815. 9:04:55observations
  17816. 9:04:56that it then uses based on the binary
  17817. 9:04:59data,
  17818. 9:05:00data here,
  17819. 9:05:01data data, that we give it as an input.
  17820. 9:05:03So, you want to make sure that this is
  17821. 9:05:04binary. And I remember thinking that
  17822. 9:05:06binary was uh was such a complex thing,
  17823. 9:05:08but what it actually is, it's just
  17824. 9:05:10literally a way for the web server to
  17825. 9:05:11represent files. And so, what we say
  17826. 9:05:13here is we say, "Hey, here's the input,
  17827. 9:05:16which is in a binary file,
  17828. 9:05:17and the name of the input is data
  17829. 9:05:19because that is the name of the variable
  17830. 9:05:20that we get. So, just put data here. And
  17831. 9:05:22then detail can be auto, that's fine.
  17832. 9:05:24And now, what it does is that it takes
  17833. 9:05:26the actual stock and then it gives us
  17834. 9:05:28the output which is this right here,
  17835. 9:05:30which is candlestick analysis. If I go
  17836. 9:05:32to JSON, I can see the whole thing.
  17837. 9:05:33Right here, potential breakout zone, the
  17838. 9:05:35price is approaching 270. It's giving us
  17839. 9:05:37a whole breakdown analysis of that
  17840. 9:05:39stock, which we keep for now and we go
  17841. 9:05:40to the next step which is Telegram. And
  17842. 9:05:42if you have the connection that you made
  17843. 9:05:43before, use the exact same connection.
  17844. 9:05:45In this case, it will be message which
  17845. 9:05:46is the actual thing that we're
  17846. 9:05:47manipulating or changing. The action
  17847. 9:05:49that we're taking is send the photo,
  17848. 9:05:51which is we're sending the actual graph.
  17849. 9:05:52We're not actually sending the
  17850. 9:05:53explanation first.
  17851. 9:05:55And the chat ID is the thing that I
  17852. 9:05:57mentioned that we called or that we had
  17853. 9:05:59right here.
  17854. 9:06:00Chat ID, schema, chat ID.
  17855. 9:06:03This is only a one-time thing, right?
  17856. 9:06:04Because once you copy this here, it will
  17857. 9:06:06send everything to that specific
  17858. 9:06:08conversation. So once you copy this from
  17859. 9:06:10there,
  17860. 9:06:11you will then be able to have the photo
  17861. 9:06:13URL be sent from here, URL, which is the
  17862. 9:06:17thing that makes it look like this in
  17863. 9:06:19Telegram. And then finally, the actual
  17864. 9:06:20thing that goes back to the AI agent
  17865. 9:06:22here
  17866. 9:06:23for it to actually finish is the last
  17867. 9:06:25step of the workflow, which in this case
  17868. 9:06:27is here, which is response. And the
  17869. 9:06:28response will just be the analysis that
  17870. 9:06:30we get from
  17871. 9:06:33where is it? Stock analysis here, which
  17872. 9:06:35is the content.
  17873. 9:06:36Right here.
  17874. 9:06:37And this is the thing that then goes
  17875. 9:06:39back to the AI agent inside here as an
  17876. 9:06:42output.
  17877. 9:06:44And finally, we made the graph, it sent
  17878. 9:06:45to our channel, it then sent the
  17879. 9:06:47analysis back to the AI agent, it
  17880. 9:06:49formatted it in a way where it actually
  17881. 9:06:50makes sense, and finally it sent it to
  17882. 9:06:52Telegram right here
  17883. 9:06:54with the chat ID, which you can get
  17884. 9:06:56here, chat ID.
  17885. 9:06:58And the output, which in this case is
  17886. 9:07:00here, output. And make sure that this is
  17887. 9:07:02message and send a message. So let's try
  17888. 9:07:03this out one more time. I can go here, I
  17889. 9:07:05can say, "Can you analyze Amazon?"
  17890. 9:07:09And by the way, not all stocks are going
  17891. 9:07:11to be recognized here, right? Like
  17892. 9:07:12something like Samsung isn't part of
  17893. 9:07:14Nasdaq to my understanding, to my
  17894. 9:07:17knowledge. Um and so if you put Samsung
  17895. 9:07:19or something like that, it will not
  17896. 9:07:21detect it on the next workflow because
  17897. 9:07:22it is not part of that subset of stocks.
  17898. 9:07:25And so make sure that whatever stock you
  17899. 9:07:26ask it to do is within the category that
  17900. 9:07:29we added when we asked to make the
  17901. 9:07:31chart. So now it's giving us the chart
  17902. 9:07:33which did it in the other workflow.
  17903. 9:07:35And then finally here, it gave us the
  17904. 9:07:37actual trend. Now I'm going to do
  17905. 9:07:39something interesting that I haven't
  17906. 9:07:40done before. So let me actually execute
  17907. 9:07:41the workflow again.
  17908. 9:07:43Let me go here and let me ask it, "Can
  17909. 9:07:45you now
  17910. 9:07:47compare Amazon with Apple and with uh
  17911. 9:07:52Microsoft?"
  17912. 9:07:54I'm going to go here.
  17913. 9:07:55I'm interested to see what this does, if
  17914. 9:07:57it remembers this, if it remembers the
  17915. 9:07:59other one as well, and what the output
  17916. 9:08:01will give us. And it seems like it
  17917. 9:08:02doesn't actually call the tool because
  17918. 9:08:05it already analyzed the three of them,
  17919. 9:08:08which is amazing, brilliant, because now
  17920. 9:08:10we have the full analysis here. So
  17921. 9:08:11overall trend, Amazon, Apple, Microsoft,
  17922. 9:08:14recent price action, MCD analysis. So
  17923. 9:08:17let me say, "Which one should I
  17924. 9:08:20buy?"
  17925. 9:08:21When I go enter,
  17926. 9:08:24let's see which one it tells me that I
  17927. 9:08:25should buy based on this analysis right
  17928. 9:08:27here. As you can see, we have this here.
  17929. 9:08:29As an AI assistant, I'm not able to
  17930. 9:08:31provide specific investment advice or
  17931. 9:08:32recommendation. Fair enough. Yeah, so I
  17932. 9:08:34guess we'll just have to look at this
  17933. 9:08:35right here and decide for ourselves.
  17934. 9:08:37There you go. All right, so this right
  17935. 9:08:38here is obviously a very cool use case,
  17936. 9:08:40but it should give you ideas for other
  17937. 9:08:42use cases that you can build, right? And
  17938. 9:08:43the ability for us to call different
  17939. 9:08:45tools within our AI agents and then
  17940. 9:08:47bring it back all in one place. And
  17941. 9:08:49that's the beauty of tools within the AI
  17942. 9:08:50agent cuz you can talk to it as if it's
  17943. 9:08:52a normal human, but it can take actions
  17944. 9:08:54on different things. And again, it all
  17945. 9:08:55depends on what tools there are out
  17946. 9:08:57there like the image chart tool. Cuz if
  17947. 9:09:00it wasn't for this, we wouldn't be able
  17948. 9:09:02to actually do this.
  17949. 9:09:09Hey, I'm about to build a live Instagram
  17950. 9:09:11parasite system right in front of you
  17951. 9:09:12that scripts posts from the top AI news
  17952. 9:09:15Instagram account in the world, rewrites
  17953. 9:09:17them in your tone of voice using AI, and
  17954. 9:09:18turns them into a stream of content that
  17955. 9:09:20you can post automatically. [music] All
  17956. 9:09:21right, so this right here is a system. I
  17957. 9:09:23can press execute workflow. This will
  17958. 9:09:24now run on your machine. Ideally, we run
  17959. 9:09:26this every single week.
  17960. 9:09:27Uh then we scrape the Instagram post
  17961. 9:09:29from the top AI news account in the
  17962. 9:09:31world on Instagram using Apify. [music]
  17963. 9:09:34As we can see here, this is currently
  17964. 9:09:35running. Then we wait 5 seconds before
  17965. 9:09:37actually getting all the data and then
  17966. 9:09:39looping it through. So we only let 20
  17967. 9:09:41posts at a time. In this case here,
  17968. 9:09:43we're checking whether it's actually
  17969. 9:09:44relevant to our target audience before
  17970. 9:09:46sending it to the next AI to actually
  17971. 9:09:48rewrite the post and then adding it all
  17972. 9:09:50back to our Google Sheet database. All
  17973. 9:09:51right, we can see it just ran
  17974. 9:09:52successfully. I can go to the Google
  17975. 9:09:53Sheet database. I can see here that we
  17976. 9:09:55have the username of the account, in
  17977. 9:09:57this case it's the same, the date when
  17978. 9:09:59the post was posted, the post URL we
  17979. 9:10:02have here. We can always look back. The
  17980. 9:10:03original post and the rewritten post
  17981. 9:10:06using our tone of voice, target
  17982. 9:10:07audience, and so on. So [music] we have
  17983. 9:10:09every single week a stream of content
  17984. 9:10:10ideas that we can then post
  17985. 9:10:11automatically that are repurposed using
  17986. 9:10:13our tone of voice. So now let me save
  17987. 9:10:15this. Let me make a new automation. All
  17988. 9:10:18right, we start from scratch. And again,
  17989. 9:10:19the first uh step of all this building
  17990. 9:10:21the automation is not actually building
  17991. 9:10:22it itself. It's going on Miro to map
  17992. 9:10:25things out, to break it down step by
  17993. 9:10:26step before we actually go out and build
  17994. 9:10:27it. So if I go here, I always look at an
  17995. 9:10:30automation as an input
  17996. 9:10:34and an output.
  17997. 9:10:36And then in between is different steps
  17998. 9:10:38that we have to just figure it out.
  17999. 9:10:39Well, the input in this case is I guess
  18000. 9:10:41someone else's content because we are
  18001. 9:10:43doing a parasite system and parasite
  18002. 9:10:45just means that you that you just steal
  18003. 9:10:46someone else's idea and then you
  18004. 9:10:48repurpose it for your own uh target
  18005. 9:10:50audience. [music] In this case, if I
  18006. 9:10:51wanted to get the latest AI news and I
  18007. 9:10:53want to use Instagram, I have to find an
  18008. 9:10:55account where they posted the latest AI
  18009. 9:10:58news and it was the top in the world. So
  18010. 9:11:01initially what I would do is I would go
  18011. 9:11:02here and say, "What is the top AI news
  18012. 9:11:07Instagram account in the world?"
  18013. 9:11:10And then I would get this right here,
  18014. 9:11:12Evolving AI. So I go here, let me see
  18015. 9:11:14what they have. Yeah, they're so they're
  18016. 9:11:16pretty big.
  18017. 9:11:17Ready use this go viral after revealing
  18018. 9:11:19AI prompt tricks and ChatGPT that almost
  18019. 9:11:21feel like cheat hack. Yeah, I think it's
  18020. 9:11:22pretty good. Um sort of new AI news and
  18021. 9:11:24they're posting pretty regularly. I
  18022. 9:11:25mean, this is
  18023. 9:11:264 hours ago, 6 hours ago. Okay, so they
  18024. 9:11:28post like twice a day.
  18025. 9:11:30Yeah, three times a day, four times a
  18026. 9:11:32day.
  18027. 9:11:33Four times a day,
  18028. 9:11:34um which is great because now we have a
  18029. 9:11:35lot of news, a lot of content to then
  18030. 9:11:37repurpose. So the input is this. So
  18031. 9:11:39we're going to put input in this case
  18032. 9:11:42post
  18033. 9:11:44from Evolving
  18034. 9:11:46AI.
  18035. 9:11:47That's for Instagram.
  18036. 9:11:49We put a note here,
  18037. 9:11:51Instagram, IG.
  18038. 9:11:53Now the next step after this is actually
  18039. 9:11:55extracting the text from the post. So
  18040. 9:11:57this is called scraping. When I go here
  18041. 9:11:59to let's say this post right here every
  18042. 9:12:00single week, and we want to take this
  18043. 9:12:02whole text
  18044. 9:12:04and this is what we're going to use to
  18045. 9:12:05then repurpose, which means that we're
  18046. 9:12:07going to change the tone of voice, but
  18047. 9:12:09the message is the same, so the overall
  18048. 9:12:11information is the same, and we're going
  18049. 9:12:12to make it our own content. So the next
  18050. 9:12:14step here is scraping
  18051. 9:12:18post text.
  18052. 9:12:19>> [music]
  18053. 9:12:19>> Now for us to actually scrape the post
  18054. 9:12:21text from Instagram, we would use a
  18055. 9:12:23platform called Apify. So Apify is I
  18056. 9:12:26mean, the way that I would represent it
  18057. 9:12:27is just the Amazon for scrapers, the
  18058. 9:12:29Amazon for all of these things that a
  18059. 9:12:31smart dude in the world created using
  18060. 9:12:34code. Um but of course, we're not using
  18061. 9:12:36any code, we're just using it
  18062. 9:12:38automatically using our no-code platform
  18063. 9:12:39Any Ten. Um so if I go to go to console,
  18064. 9:12:43you have to make an account and [music]
  18065. 9:12:45you go to Apify store. On the bottom,
  18066. 9:12:47you get to see that you have usage which
  18067. 9:12:48is $5 because Apify actually gives you
  18068. 9:12:50$5 for free every single month that you
  18069. 9:12:52can use. And so let's go to the example
  18070. 9:12:55here.
  18071. 9:12:56We can see this is in the best example.
  18072. 9:12:58Let me go here.
  18073. 9:13:00Yeah. That [music]
  18074. 9:13:02we have the scraper. So this is the
  18075. 9:13:03thing that we use to actually scrape and
  18076. 9:13:05I'll I mean, if this looks complicated,
  18077. 9:13:06don't worry, I'll break it down. And we
  18078. 9:13:07have to use $1.50 or we have to pay
  18079. 9:13:09$1.50 for 1,000 leads. So if we get $5
  18080. 9:13:13for free and we have to pay $1.50 for
  18081. 9:13:141,000 leads, and this changes every
  18082. 9:13:16single scraper, depends on what they
  18083. 9:13:17are, then do the math there and it
  18084. 9:13:20should be around 4,000 leads if I'm
  18085. 9:13:23right. The math dudes in the comments,
  18086. 9:13:25let me know. But that's how much you
  18087. 9:13:27have to pay. So ideally what I would do
  18088. 9:13:29is I would go to the Apify store. Again,
  18089. 9:13:31it's like you're looking for a product
  18090. 9:13:32on Amazon. And the product that I want
  18091. 9:13:33is a product that is able to scrape IG
  18092. 9:13:37posts. Okay, so I want to sput scrape uh
  18093. 9:13:42or let's just do Instagram
  18094. 9:13:44post scraper. And we have two options.
  18095. 9:13:47>> [music]
  18096. 9:13:47>> Instagram post scraper and Apify
  18097. 9:13:49Instagram post scraper. So Apify is the
  18098. 9:13:51actual platform name, so I typically
  18099. 9:13:52would go for something that's Apify
  18100. 9:13:54based because again, it's a platform.
  18101. 9:13:56[music] 50,000, I think that's pretty
  18102. 9:13:58good. And $2.70 for 1,000 posts. That's
  18103. 9:14:00a bit steep, but I think it's fine. I
  18104. 9:14:02mean, we're not going to scrape 1,000
  18105. 9:14:04posts. I think we're going to do maybe
  18106. 9:14:0550 a week, so it's basically free cuz we
  18107. 9:14:07get $5 a month. And this is what the the
  18108. 9:14:10sort of UI looks like. So on the top, we
  18109. 9:14:13have the name of the scraper, then we
  18110. 9:14:15have the description, then we have the
  18111. 9:14:17input. So there's two different ways
  18112. 9:14:19that you can run the scraper that you
  18113. 9:14:20can actually use this. You can either go
  18114. 9:14:22on the platform and run it here, so run
  18115. 9:14:24the um start the actual scraper,
  18116. 9:14:27>> [music]
  18117. 9:14:27>> or you can use the JSON, you can connect
  18118. 9:14:30Apify to Any Ten, and [music] then be
  18119. 9:14:33able to run it automatically within the
  18120. 9:14:34no-code platform. And if that made no
  18121. 9:14:36sense to you, no worries, I'll explain
  18122. 9:14:38exactly what it is step by step, so
  18123. 9:14:39don't worry. Um but we can see here that
  18124. 9:14:42the inputs are
  18125. 9:14:43uh are
  18126. 9:14:44well, there's really only one. There's
  18127. 9:14:45one input,
  18128. 9:14:46>> [music]
  18129. 9:14:46>> which is either an Instagram username, a
  18130. 9:14:48profile URL, or a post URL. So if I go
  18131. 9:14:51to what was it? Evolving AI. I think
  18132. 9:14:53it's Evolving Yeah, there we go.
  18133. 9:14:54Evolving AI. If I go here, on the top is
  18134. 9:14:58a URL, and this is the post URL or the
  18135. 9:15:00profile URL that I get to paste here.
  18136. 9:15:03Right, and this is the I mean, the thing
  18137. 9:15:05I already had pasted, uh but it's the
  18138. 9:15:07input that we have that we give Apify
  18139. 9:15:08saying, "Hey, here's a profile URL, just
  18140. 9:15:10scrape these posts on this time frame,
  18141. 9:15:13this many posts." For this many posts in
  18142. 9:15:15this time frame. It says extract posts
  18143. 9:15:17that are newer than date. So the input
  18144. 9:15:19that has to go here is the URL of the of
  18145. 9:15:22the actual account, which you can change
  18146. 9:15:23with your own URLs if you want, then the
  18147. 9:15:25number of posts that we make, whether we
  18148. 9:15:27scrape, and then we scrape um
  18149. 9:15:30we're only scraping the posts that are
  18150. 9:15:32newer than this date [music] right here.
  18151. 9:15:34So, again, you can run this. If I press
  18152. 9:15:35start,
  18153. 9:15:36what this will basically do
  18154. 9:15:38is it will now say it's running right
  18155. 9:15:40here. And over time it will start giving
  18156. 9:15:42me results. So, results are just
  18157. 9:15:43basically here here's the output. As you
  18158. 9:15:45can see here, the actor is getting your
  18159. 9:15:46data. All right, so we're already seeing
  18160. 9:15:47some outputs come up. These are the
  18161. 9:15:49different uh text posts that we ideally
  18162. 9:15:51want to be able to then repurpose using
  18163. 9:15:54our tone of voice. Full name, the post
  18164. 9:15:56URL,
  18165. 9:15:57which comes from here. So, this is the
  18166. 9:15:58text that it extracted. Uh and we get a
  18167. 9:16:00bunch of them, which is great.
  18168. 9:16:02All right, so I mean, ideally you would
  18169. 9:16:04have to run this. Let me abort, which
  18170. 9:16:05means
  18171. 9:16:07that you stop the automation. Well, it
  18172. 9:16:09doesn't really mean that in real life,
  18173. 9:16:10but in the automation context it does.
  18174. 9:16:13But now we stopped the scraper. We said,
  18175. 9:16:14"Hey, stop scraping." But now we have
  18176. 9:16:17the different text posts that we would
  18177. 9:16:18like to use. So, we know this works cuz
  18178. 9:16:20we get the output.
  18179. 9:16:21So, all right, cool. [music]
  18180. 9:16:23Scraping IG posts using Apify. Then, the
  18181. 9:16:26next step would be
  18182. 9:16:27using AI
  18183. 9:16:29to check
  18184. 9:16:31if it's relevant. [music]
  18185. 9:16:33It is great that we get all this AI
  18186. 9:16:35news, but are they actually relevant to
  18187. 9:16:37who we're targeting and who our audience
  18188. 9:16:38is?
  18189. 9:16:39Um so, in this case we use AI.
  18190. 9:16:42Well, we can say ChatGPT, but I think AI
  18191. 9:16:44is fine. And then we ideally want to
  18192. 9:16:48rewrite
  18193. 9:16:50the post
  18194. 9:16:52using our tone of voice.
  18195. 9:16:54And then we would add it to a Google
  18196. 9:16:58Sheet. Now, this right here, this
  18197. 9:17:00automation, we ideally want to run it
  18198. 9:17:02every single week. So, the first step
  18199. 9:17:04actually is run
  18200. 9:17:07automation weekly
  18201. 9:17:09on a Monday
  18202. 9:17:11cuz we have fresh new ideas that we can
  18203. 9:17:12post. So, run automation weekly on a
  18204. 9:17:14Monday, post from Evolving AI, which is
  18205. 9:17:16an account on Instagram, scrape IG posts
  18206. 9:17:18using Apify, use the AI to check if it's
  18207. 9:17:21relevant.
  18208. 9:17:24Uh and then we rewrite the post using
  18209. 9:17:27our tone of voice and add it to the
  18210. 9:17:28Google Sheet. So, in this case, the
  18211. 9:17:29output is a Google Sheet full of
  18212. 9:17:31content. All right, we can get to
  18213. 9:17:32building now. All right, let's go to
  18214. 9:17:33n8n. And the first step that we have to
  18215. 9:17:36do is let me just do a trigger manually,
  18216. 9:17:38which means that just to test, but later
  18217. 9:17:40on we're going to replace this with a on
  18218. 9:17:42schedule, which will run every single
  18219. 9:17:44week. Uh so, we do trigger manually
  18220. 9:17:46right here. So, the first step
  18221. 9:17:49is to scrape IG posts using Apify.
  18222. 9:17:52So, how do we do this? Well, we have to
  18223. 9:17:53connect Apify to n8n. I can go here to
  18224. 9:17:56Apify.
  18225. 9:17:57And I have this node.
  18226. 9:17:59And I can now run an actor because,
  18227. 9:18:00again, these are all different actors
  18228. 9:18:02that we have within the actual platform.
  18229. 9:18:04But this is an actor. So, I can run an
  18230. 9:18:06actor. And then in order for us to
  18231. 9:18:07connect Apify, we have to go to create a
  18232. 9:18:09new credential.
  18233. 9:18:10You have to go to API key. I believe
  18234. 9:18:12that the API key you can find on
  18235. 9:18:14settings.
  18236. 9:18:15Yeah, API integrations and then you can
  18237. 9:18:17copy this right here.
  18238. 9:18:18If not, you have to create a new token
  18239. 9:18:19and I think when you're new to Apify.
  18240. 9:18:22Uh and then you paste it right here.
  18241. 9:18:24Let's do 100 million
  18242. 9:18:26connection
  18243. 9:18:28and press save.
  18244. 9:18:29And we're good to go.
  18245. 9:18:31And the resource is actor because we're
  18246. 9:18:33running an actor. The operation, so what
  18247. 9:18:34is the action that we're doing? In this
  18248. 9:18:36case it's running an actor. And then the
  18249. 9:18:37actor source, recently used actors is
  18250. 9:18:39fine. Now, one of the important thing
  18251. 9:18:41here is that if you go to the actors, so
  18252. 9:18:43again, went to Instagram. We can also go
  18253. 9:18:46to runs cuz we already run this already.
  18254. 9:18:49Apify Instagram Yeah, this is right
  18255. 9:18:50here. Apify Instagram post scraper.
  18256. 9:18:53In order for us to see it here, in order
  18257. 9:18:55for us to have it in our list of
  18258. 9:18:56scrapers,
  18259. 9:18:57we already have to run this in the
  18260. 9:18:59platform. So, if you don't see it here,
  18261. 9:19:00it's because we need to press start and
  18262. 9:19:02save.
  18263. 9:19:03And it will start the automation. It
  18264. 9:19:04will start the actual actor. You have to
  18265. 9:19:05run it once in order for then for you to
  18266. 9:19:07see it right here. Which in this case is
  18267. 9:19:10Instagram post scraper, Apify Instagram
  18268. 9:19:12post scraper. Cool. Now, it's asking us
  18269. 9:19:14for the input JSON. So, the input JSON
  18270. 9:19:16is essentially what is the thing that
  18271. 9:19:17we're feeding to the scraper saying,
  18272. 9:19:18"Hey, do this and then give us the data
  18273. 9:19:20back." Well, in this case,
  18274. 9:19:22we can either do it manually or we can
  18275. 9:19:24use JSON like I mentioned.
  18276. 9:19:25So, for us to use JSON, all we have to
  18277. 9:19:27do is copy this whole thing
  18278. 9:19:29and we delete this and paste it right
  18279. 9:19:31here.
  18280. 9:19:32So, I'm basically saying, "Hey, I'm
  18281. 9:19:33running it automatically. I'm using the
  18282. 9:19:35JSON that we have to use."
  18283. 9:19:37And that's it. And now what we're going
  18284. 9:19:39to do is we're going to be changing
  18285. 9:19:44the date. So, first I'm going to run
  18286. 9:19:45this just to get some test data. You can
  18287. 9:19:47wait for finish. This means that we're
  18288. 9:19:49waiting for the scraper to be done.
  18289. 9:19:51Let me execute step.
  18290. 9:19:54I go here, I can see that on the runs
  18291. 9:19:57now this is running. This is starting
  18292. 9:19:58the crawler, which means that it's
  18293. 9:19:59starting to scrape.
  18294. 9:20:02Well, what I was thinking here is
  18295. 9:20:03because this is saying, "Hey, only get
  18296. 9:20:05the posts newer than this date."
  18297. 9:20:07We want the date to be dynamic. We want
  18298. 9:20:08it to be the date that we're running it
  18299. 9:20:11minus [music] 7 days from the last week.
  18300. 9:20:13So, we only want to run posts from the
  18301. 9:20:14last 7 week. Have we finished? Yeah.
  18302. 9:20:17Yeah, yeah, yeah, cool. Okay, so
  18303. 9:20:19we got the data. In this case, we didn't
  18304. 9:20:21actually get the post, but we got
  18305. 9:20:23something called a default data set ID.
  18306. 9:20:26Now, Apify, the way it works is that we
  18307. 9:20:28run the actor.
  18308. 9:20:29And then we don't actually get the post
  18309. 9:20:30there. We have to give it to another
  18310. 9:20:32node in Apify, which is called the
  18311. 9:20:36get data set items. [music]
  18312. 9:20:37Yeah, right here.
  18313. 9:20:41And this node right here will be the one
  18314. 9:20:43with the same connection that we then do
  18315. 9:20:45a data set and get items and paste the
  18316. 9:20:47data set ID that we have from here,
  18317. 9:20:48which in this case
  18318. 9:20:50we can get from here. Default data set
  18319. 9:20:53ID.
  18320. 9:20:54So, I'm dragging it across.
  18321. 9:20:56This will be the thing that we use to
  18322. 9:20:57then extract the data. So, if I remove
  18323. 9:21:00the limit, I think you can remove it.
  18324. 9:21:01Yeah, yeah, yeah.
  18325. 9:21:02And I can pin this, [music] which means
  18326. 9:21:03that I don't have to rerun this again in
  18327. 9:21:05order to do the whole thing. I can now
  18328. 9:21:07execute the step.
  18329. 9:21:08And this will now give me the post. So,
  18330. 9:21:10the caption
  18331. 9:21:12for all the different items that we
  18332. 9:21:12have. This is a long, long list.
  18333. 9:21:15Uh yeah.
  18334. 9:21:17We can see it in schema. We can see it
  18335. 9:21:18in JSON and table as well.
  18336. 9:21:21All right, now that we got the data, now
  18337. 9:21:22we can move on to the next steps. And by
  18338. 9:21:24the way, all we did is run this run the
  18339. 9:21:25actor, send it here to then get the
  18340. 9:21:26data, so all the different post text
  18341. 9:21:28that we want for the next steps.
  18342. 9:21:30And that's it. Uh then we go here to
  18343. 9:21:32Miro.
  18344. 9:21:33This right here is [music] good.
  18345. 9:21:36This right here is also good.
  18346. 9:21:39And now we have to use AI to check if
  18347. 9:21:40it's actually relevant. So, the next
  18348. 9:21:42step right here is to add another node.
  18349. 9:21:45In this case it's an AI step. We're not
  18350. 9:21:47using an AI agent. We're using an AI
  18351. 9:21:48step, which in this case I think OpenAI
  18352. 9:21:50is I think pretty good at this. We can
  18353. 9:21:52now message a model.
  18354. 9:21:54In order to connect your OpenAI, you
  18355. 9:21:55have to create a new credential. You
  18356. 9:21:57have to go to platform.openai.com.
  18357. 9:21:59You have to go to dashboard.
  18358. 9:22:01Go to API keys.
  18359. 9:22:03Make a new secret key. Name it whatever
  18360. 9:22:04you want. You will have a code that you
  18361. 9:22:06will then paste back here as an API key
  18362. 9:22:09and press save. Now, bear in mind, this
  18363. 9:22:10is not free. Like all of this is not
  18364. 9:22:12free. You have to pay for API tokens,
  18365. 9:22:14which you can find in your profile,
  18366. 9:22:15billing, and then put some money here. I
  18367. 9:22:17think $5 is more than enough. It I mean,
  18368. 9:22:19it lasted me 6 months, so I think it
  18369. 9:22:21will last you, hopefully. Um
  18370. 9:22:24unless you completely bombard it with
  18371. 9:22:26with different scrapers. But that should
  18372. 9:22:27be fine. Now, once you have this
  18373. 9:22:28connected, the resource is text. The
  18374. 9:22:30operation, so what is the action that
  18375. 9:22:31we're doing? In this case it's message a
  18376. 9:22:32model. The model that we want to use
  18377. 9:22:35is mini 4.1 mini cuz I'm going for
  18378. 9:22:37quality and speed,
  18379. 9:22:39which is fine. So, again, for prompt we
  18380. 9:22:40have a system prompt, which is you are a
  18381. 9:22:42helpful, intelligent XYZ assistant. I'm
  18382. 9:22:45going to paste this.
  18383. 9:22:46If I go here full screen, then you can
  18384. 9:22:47see the whole prompt.
  18385. 9:22:48You're a helpful, intelligent, precise
  18386. 9:22:49Instagram post classifier for an
  18387. 9:22:51AI-focused audience, people who build
  18388. 9:22:52with or want to learn AI,
  18389. 9:22:55uh understand cool news that come out of
  18390. 9:22:57it and that actually strike and have an
  18391. 9:22:58interesting take.
  18392. 9:23:00I think it's a pretty good overall. I
  18393. 9:23:01mean, you would have to change this with
  18394. 9:23:02your audience and who you're targeting.
  18395. 9:23:04Um and then for the second message we
  18396. 9:23:06use a user message. For the user
  18397. 9:23:08message, I'm going to paste this.
  18398. 9:23:11If I go here,
  18399. 9:23:12zoom in, I can say, "Hey, classify the
  18400. 9:23:14Instagram post for an automation-focused
  18401. 9:23:15audience. Return only a verdict,
  18402. 9:23:18relevant or not relevant."
  18403. 9:23:20It's relevant if it's something
  18404. 9:23:21interesting news on AI that come out.
  18405. 9:23:23Not relevant if it's a motivational,
  18406. 9:23:25personal, non-automation, coding,
  18407. 9:23:26crypto, politics, finance, or tool
  18408. 9:23:28discounts, or vague hype with no build
  18409. 9:23:31{slash} impact. And then we want to
  18410. 9:23:33output this as JSON. Now, what what do
  18411. 9:23:34we use JSON here? It's because we only
  18412. 9:23:36want the output to be either one of
  18413. 9:23:38these items. We want it to say relevant
  18414. 9:23:40or not relevant. Right? And we toggle
  18415. 9:23:43this on.
  18416. 9:23:44Output confidence JSON because then
  18417. 9:23:46we're basically saying, "Hey, I told you
  18418. 9:23:47to do it JSON. Now, I'm telling the
  18419. 9:23:49system that the only output that it can
  18420. 9:23:51do is JSON." That's fine.
  18421. 9:23:53Uh now we have to add the actual data
  18422. 9:23:55that we're giving the
  18423. 9:23:56um the AI, which in this case is the
  18424. 9:23:58caption.
  18425. 9:24:00If I go here,
  18426. 9:24:01I'm basically saying, "Hey, here is the
  18427. 9:24:03Instagram
  18428. 9:24:05post to
  18429. 9:24:07analyze."
  18430. 9:24:08It did give me an output, but it's
  18431. 9:24:09because I ran it when I shouldn't have
  18432. 9:24:10run it. Uh and now I can drag this
  18433. 9:24:12across
  18434. 9:24:15and have this as a caption. So, the
  18435. 9:24:16caption is basically the text of the
  18436. 9:24:17post.
  18437. 9:24:19Let me execute the step again.
  18438. 9:24:21So, this is now running.
  18439. 9:24:24And now it should give me like an
  18440. 9:24:25accurate answer as well.
  18441. 9:24:27Let me rename this formatted. [music]
  18442. 9:24:29Classify.
  18443. 9:24:31Got it.
  18444. 9:24:32Classify relevance.
  18445. 9:24:36Rename.
  18446. 9:24:37Did it run? No, it didn't run. So, I
  18447. 9:24:38renamed it. Right.
  18448. 9:24:40Now it's running. Now, I actually forgot
  18449. 9:24:41to put one step in the middle because
  18450. 9:24:43ideally we're doing 20 items now because
  18451. 9:24:46in here
  18452. 9:24:46>> [music]
  18453. 9:24:47>> we're saying, "Hey, only get 20 items."
  18454. 9:24:49And we can put this to 100, whatever it
  18455. 9:24:50is. Let's put it to 100 cuz that's more
  18456. 9:24:52realistic. Um I mean, they post four
  18457. 9:24:54times a day.
  18458. 9:24:56What is it? Four times a day?
  18459. 9:24:57Let's do 30, actually. Or 50. Let's do
  18460. 9:25:0050. Yeah, we ideally don't want to send
  18461. 9:25:02all 50 here. Maybe we want to send 20 at
  18462. 9:25:04a time.
  18463. 9:25:05And now we can see
  18464. 9:25:06that we start to get the different
  18465. 9:25:08outputs. So, not relevant, not relevant,
  18466. 9:25:10relevant, not relevant, relevant, not
  18467. 9:25:11relevant, not relevant, relevant. So,
  18468. 9:25:13it's good because it's not giving us all
  18469. 9:25:14the information as relevant. It's only
  18470. 9:25:16uh filtering out the ones that we
  18471. 9:25:17actually care about based on audience.
  18472. 9:25:19So,
  18473. 9:25:20in order for us to actually not send 20
  18474. 9:25:22at a time, we can do we can batch it.
  18475. 9:25:24So, instead of cuz I put 50 here, when
  18476. 9:25:26we run this now, it will give us 50
  18477. 9:25:27posts. I don't want to send all 50 posts
  18478. 9:25:29through. I want to basically loop over
  18479. 9:25:32it. So, which means that we send only 20
  18480. 9:25:34through, then at the end of the
  18481. 9:25:36automation we bring it all back, and we
  18482. 9:25:38do another 20, and we do another 10
  18483. 9:25:40until it's finished. So, in order to do
  18484. 9:25:41that, we have to use the loop over
  18485. 9:25:43items.
  18486. 9:25:45This is saying, so we connect this to
  18487. 9:25:47this, by the way.
  18488. 9:25:49You can delete this
  18489. 9:25:51and delete this.
  18490. 9:25:52You're basically saying, "Hey, after
  18491. 9:25:53this, [music] loop over only 20 items.
  18492. 9:25:57So, I only want to send 20 posts through
  18493. 9:25:58at a time."
  18494. 9:26:00And the next step is here. And then at
  18495. 9:26:02the end, the last step of the
  18496. 9:26:03automation, we bring it all back to
  18497. 9:26:05here. So, it takes the ones that are
  18498. 9:26:06remaining. Now, one thing I also forgot
  18499. 9:26:07to put here is the date. So, [music]
  18500. 9:26:10if I go here inside, so now I can
  18501. 9:26:12manipulate the data.
  18502. 9:26:14So, here,
  18503. 9:26:15>> [music]
  18504. 9:26:15>> um ideally, it's telling us, "Hey,
  18505. 9:26:18this post have to be newer than a date."
  18506. 9:26:20Well, in this case, I want it [music] to
  18507. 9:26:21be the date that is running minus 7
  18508. 9:26:23days. The way to do that is to put
  18509. 9:26:26square brackets.
  18510. 9:26:28Put now, I believe.
  18511. 9:26:30dot
  18512. 9:26:32minus
  18513. 9:26:34seven. Let's see if I got this right.
  18514. 9:26:36days. No. It's giving us the actual
  18515. 9:26:38text.
  18516. 9:26:39We don't want that.
  18517. 9:26:41So, in this case, what I would do,
  18518. 9:26:43well, actually I can do
  18519. 9:26:45format. I think that works. Yeah, yeah,
  18520. 9:26:47yeah. I think that works.
  18521. 9:26:48So, we're formatting the date. I mean,
  18522. 9:26:50first of all, we're minusing, so now now
  18523. 9:26:52is today, then we're removing or we're
  18524. 9:26:54we're subtracting 7 days from now, so
  18525. 9:26:56last week, the past week.
  18526. 9:26:58And we're formatting it as YYYY and
  18527. 9:27:01MMDD, which outputs this as this. So,
  18528. 9:27:04let's try this out. I mean, could or
  18529. 9:27:06could not work.
  18530. 9:27:07So, we'll see. We'll only The only way
  18531. 9:27:08to know is to actually test.
  18532. 9:27:10So, let me unpin this and let me execute
  18533. 9:27:11this step. Okay, cool. It worked. Cuz if
  18534. 9:27:13it didn't work, it would give us an
  18535. 9:27:14error. Perfect. Okay, cool.
  18536. 9:27:16All [music] right, we know this works.
  18537. 9:27:18Let me stop the automation. And let me
  18538. 9:27:20Yeah, unpin this. It's fine. And now
  18539. 9:27:22after we classify the relevance, which
  18540. 9:27:23in this case
  18541. 9:27:24>> [music]
  18542. 9:27:24>> this step, now we want to be able to
  18543. 9:27:26rewrite the post using our tone of
  18544. 9:27:28voice.
  18545. 9:27:29So,
  18546. 9:27:30first step before we even go there, we
  18547. 9:27:32have to set different variables. Cuz I
  18548. 9:27:33want to extract the variables that I
  18549. 9:27:34actually care about from the data set
  18550. 9:27:37items. Cuz there's so many variables. I
  18551. 9:27:38mean, this overwhelms me. Ideally, I
  18552. 9:27:40want to get
  18553. 9:27:41the like count, comment count, views
  18554. 9:27:43count, and some other stuff as well. So,
  18555. 9:27:45in order to do that, I can go to edit
  18556. 9:27:48fields.
  18557. 9:27:49I can then go to
  18558. 9:27:51I think I have to run this.
  18559. 9:27:53Yeah, I think I have to run this.
  18560. 9:27:54[music]
  18561. 9:27:55Maybe not.
  18562. 9:27:56Let me try this.
  18563. 9:28:00There we go.
  18564. 9:28:01Little hack.
  18565. 9:28:02Um
  18566. 9:28:03And now I can put the
  18567. 9:28:05comment count.
  18568. 9:28:08Let me actually
  18569. 9:28:09one click hack. Instead of you [music]
  18570. 9:28:10putting the name, you can just drag it
  18571. 9:28:11across.
  18572. 9:28:12And it'll put the name itself.
  18573. 9:28:14And then I think it's like views,
  18574. 9:28:16if I'm not mistaken.
  18575. 9:28:18View Yeah, video view count. Put it
  18576. 9:28:21here.
  18577. 9:28:22And then I think it's likes, likes
  18578. 9:28:24count.
  18579. 9:28:25And then I think that is pretty much it.
  18580. 9:28:28So, likes count, comment count, views
  18581. 9:28:30count, and a full text and date posted.
  18582. 9:28:32Yeah. So, full text and date posted. The
  18583. 9:28:35full text in this case will be the
  18584. 9:28:36caption.
  18585. 9:28:37And the date posted will be the
  18586. 9:28:39timestamp right here. In this one. I
  18587. 9:28:42think it should be this one. Yeah, yeah,
  18588. 9:28:44yeah. It's this one.
  18589. 9:28:45But, I don't want it in this way. So,
  18590. 9:28:47later on we're going to change it.
  18591. 9:28:49But, it's fine.
  18592. 9:28:50So, for now we can set We can actually
  18593. 9:28:52leave this here. So, we can set the
  18594. 9:28:53variables and then go to the next step.
  18595. 9:28:55And this will make more sense once I
  18596. 9:28:56once I actually show you later. But,
  18597. 9:28:57essentially why I'm doing this is
  18598. 9:28:58because later on when I want to pull
  18599. 9:29:00information here from the
  18600. 9:29:03I'm not sure I want this.
  18601. 9:29:04From here,
  18602. 9:29:05I don't have to go all the way into here
  18603. 9:29:07and then start finding information.
  18604. 9:29:09I can just simply go here and find the
  18605. 9:29:11things that I need.
  18606. 9:29:12Right?
  18607. 9:29:13So, in this case,
  18608. 9:29:15the caption. We can leave this as is,
  18609. 9:29:17but I feel like I want this here.
  18610. 9:29:20Caption.
  18611. 9:29:23And I think this is fine.
  18612. 9:29:25The next step is in your automation to
  18613. 9:29:27be able to then filter.
  18614. 9:29:29Filter based on the ones that are
  18615. 9:29:30relevant. Some are relevant, some are
  18616. 9:29:32not relevant. So, I'm going to put a
  18617. 9:29:33filter here. You simply have to press
  18618. 9:29:35filter.
  18619. 9:29:36And the verdict
  18620. 9:29:39has to be equal to relevant.
  18621. 9:29:43So, the filter's saying, "Hey, only let
  18622. 9:29:45the ones that are relevant through to
  18623. 9:29:46the next steps."
  18624. 9:29:47So, if I
  18625. 9:29:49if I pin this,
  18626. 9:29:51and again, amazing feature and then
  18627. 9:29:54and I run this,
  18628. 9:29:56now I see that out of 20, only 12 went
  18629. 9:29:58through. Which means that only 12 were
  18630. 9:30:00accepted and were actually relevant.
  18631. 9:30:02Once this is done, now we can send it to
  18632. 9:30:04an AI, in this case Claude, because
  18633. 9:30:06Claude is better at making content.
  18634. 9:30:08We're able to rewrite the post using our
  18635. 9:30:09tone of voice. If I go here,
  18636. 9:30:12bot,
  18637. 9:30:13Anthropic in this case,
  18638. 9:30:14we can generate now message a model,
  18639. 9:30:18which again, you can find
  18640. 9:30:20I'm thinking you could find it.
  18641. 9:30:22Anthropic
  18642. 9:30:24down below.
  18643. 9:30:25There you go. Message a model. And
  18644. 9:30:26[music] you go inside, and now you to
  18645. 9:30:28connect your Claude, you have to go to
  18646. 9:30:30get the API key. You can go to Anthropic
  18647. 9:30:32the console, the console to Anthropic
  18648. 9:30:34the dashboard, and then get the API key.
  18649. 9:30:36You can create a key.
  18650. 9:30:37Name it whatever you want. And also,
  18651. 9:30:39make sure to add money into your billing
  18652. 9:30:41because it's not free.
  18653. 9:30:45But again, just like OpenAI, this is
  18654. 9:30:46very, very cheap. All right, cool. So,
  18655. 9:30:48now we can go back to n8n and we can
  18656. 9:30:51paste the API key. We can connect The
  18657. 9:30:52operation, [music] which is what is the
  18658. 9:30:54action we're doing? Again, message a
  18659. 9:30:55model. The list we can actually use
  18660. 9:30:59I think 3.5 Haiku is good.
  18661. 9:31:01Let me actually go to ChatGPT. That's
  18662. 9:31:02good.
  18663. 9:31:04Which Anthropic
  18664. 9:31:06model is good
  18665. 9:31:08>> [music]
  18666. 9:31:08>> is best
  18667. 9:31:09for content?
  18668. 9:31:11I mean, this is realistically what I
  18669. 9:31:12would do if I didn't really know.
  18670. 9:31:13And now ChatGPT will tell me.
  18671. 9:31:15It depends.
  18672. 9:31:17No, not complex. Yeah, 3.5 Sonnet.
  18673. 9:31:21So, we can use Sonnet, 3.5 Sonnet.
  18674. 9:31:24Yeah, that's fine. And now we can put
  18675. 9:31:26the prompt. Now, for the sake of time,
  18676. 9:31:27I'm not going to write the prompt from
  18677. 9:31:29scratch. I'm going to paste the one I
  18678. 9:31:30had before. But, it's fine because you
  18679. 9:31:32get to have the system for free. I'll
  18680. 9:31:34show you exactly how to get it, so don't
  18681. 9:31:35worry. Um now, this has the overview,
  18682. 9:31:37which is you are a helpful, intelligent
  18683. 9:31:38writing assistant. And now that I think
  18684. 9:31:40of it, this should probably be a system
  18685. 9:31:42prompt. Because as I [music] mentioned,
  18686. 9:31:43the system prompt is the prompt where
  18687. 9:31:46you tell it Oh, that's why. Okay.
  18688. 9:31:48All right. Take my words away. Uh
  18689. 9:31:50there's no system prompt option, so we
  18690. 9:31:52just leave it in the user prompt.
  18691. 9:31:54And you are a helpful, intelligent
  18692. 9:31:55writing assistant. The task is to
  18693. 9:31:57rewrite the Instagram post that I'm
  18694. 9:31:58going to give you in a way that
  18695. 9:31:59encapsulates encapsulates the original
  18696. 9:32:01theme but uses different words. I'm
  18697. 9:32:03targeting an audience that are people
  18698. 9:32:04who build
  18699. 9:32:05>> [music]
  18700. 9:32:05>> with or want to learn AI, and they are
  18701. 9:32:07always fascinated by new discoveries or
  18702. 9:32:09news that actually make an impact. My
  18703. 9:32:10results over the last year have
  18704. 9:32:11generated six figures, worked with over
  18705. 9:32:1340 businesses, and taught 17,000 people.
  18706. 9:32:15I've never gotten to do a bunch of fun
  18707. 9:32:16stuff like travel, enjoy my life, etc.
  18708. 9:32:18Rules uh use a youthful, young tone when
  18709. 9:32:20rewriting the Instagram post. Only
  18710. 9:32:21output the Instagram post and that's it.
  18711. 9:32:23Perfect. Now, on a technical level, the
  18712. 9:32:27prompt right here, where we use hashtag,
  18713. 9:32:28this is called markdown formatting.
  18714. 9:32:30Markdown formatting, you know when you
  18715. 9:32:31go to docs,
  18716. 9:32:33right? And you type something. When you
  18717. 9:32:34write an essay, you have the title,
  18718. 9:32:37which in this case is
  18719. 9:32:38heading one. So, title.
  18720. 9:32:41Then we have heading two.
  18721. 9:32:42Then we have heading three, right? Then
  18722. 9:32:44we have heading four, and then we have
  18723. 9:32:46text.
  18724. 9:32:47Right? And so, the same thing. One One
  18725. 9:32:49of this
  18726. 9:32:51I believe that it's title. Yeah.
  18727. 9:32:54And this right here is
  18728. 9:32:57heading two.
  18729. 9:32:58This right here is heading three.
  18730. 9:33:01And same thing with heading four as
  18731. 9:33:02well. So, this is why we add markdown
  18732. 9:33:04formatting in our prompts because then
  18733. 9:33:06AI can basically it knows the hierarchy
  18734. 9:33:08of the actual prompt, so it looks so it
  18735. 9:33:10knows to look at the overview first, the
  18736. 9:33:12task, and then my results and rules as
  18737. 9:33:14well. All right. Uh and now we can add
  18738. 9:33:16another user prompt, I believe, which is
  18739. 9:33:19the IG post because we want to give it
  18740. 9:33:21the post to actually rewrite. You can
  18741. 9:33:23say, "Hey, here is
  18742. 9:33:25the IG post to rewrite."
  18743. 9:33:28I can go
  18744. 9:33:30I think Yeah, it's here. Add a fields
  18745. 9:33:32and put caption. Drag it across. And the
  18746. 9:33:34good thing is that we actually get to
  18747. 9:33:35see the output before it's even
  18748. 9:33:38run, which is great. Um okay, cool. So,
  18749. 9:33:41this is good. Simplify output is good.
  18750. 9:33:44Now we can run this. Press this.
  18751. 9:33:46And this should run.
  18752. 9:33:48So [music] again, we only sent 12 items.
  18753. 9:33:50Yeah, 12 items.
  18754. 9:33:51We're We're ready to go. Okay, cool. Uh
  18755. 9:33:54in the meantime, let me make a Google
  18756. 9:33:55Sheet,
  18757. 9:33:57which is the database where we actually
  18758. 9:33:58get to store all the content. And I
  18759. 9:34:00believe I want the username,
  18760. 9:34:02the post URL,
  18761. 9:34:04the original post text,
  18762. 9:34:08and the re-
  18763. 9:34:09written
  18764. 9:34:10post text.
  18765. 9:34:12Okay, cool.
  18766. 9:34:13Make this white. [music]
  18767. 9:34:15Make this the middle.
  18768. 9:34:17Let me freeze that to row one. We're
  18769. 9:34:19good to go. Let me make this a bit
  18770. 9:34:20larger. So, now it's going to be a bit
  18771. 9:34:22bigger than that.
  18772. 9:34:23If I go back here, I should see that
  18773. 9:34:25this is not over. Cuz it does take a
  18774. 9:34:27while. Cuz Claude is time-consuming. But
  18775. 9:34:29now it's finished. We have
  18776. 9:34:31So, here, "Yo, this is actually insane.
  18777. 9:34:33Apple just dropped a game-changer.
  18778. 9:34:34AirPods Pro can actually now be your
  18779. 9:34:35personal translator.
  18780. 9:34:37Just tap both stems and booms. It picks
  18781. 9:34:39up your foreign language, cancels noise.
  18782. 9:34:40I know it could do that." All right, now
  18783. 9:34:42we bring it all back to the sheet. So,
  18784. 9:34:43this right here
  18785. 9:34:45So, I'm good. And look at how I'm
  18786. 9:34:46actually structuring the automation. So,
  18787. 9:34:48I map it out, and then every time that I
  18788. 9:34:49finish something, I go here to green cuz
  18789. 9:34:51[music] I'm It's called iterative
  18790. 9:34:53testing. So, we test every single step
  18791. 9:34:54to make sure that it's good. And then we
  18792. 9:34:56want to make sure some sort of
  18793. 9:34:57confirmation checklist that we can then
  18794. 9:34:59say, "Yes, it's good." before going to
  18795. 9:35:01the next step. So, the next step here is
  18796. 9:35:02adding everything to the Google Sheet.
  18797. 9:35:04Let me rename this.
  18798. 9:35:06IG.
  18799. 9:35:07Again, not ideal. Let me do IG.
  18800. 9:35:09And then here, let me do Google Sheets.
  18801. 9:35:12I can append a row on a sheet. Append a
  18802. 9:35:13row just means add a row. To connect
  18803. 9:35:15your Google Sheets, you have to go here
  18804. 9:35:17and sign in to Google.
  18805. 9:35:18>> [music]
  18806. 9:35:18>> This is a simple page. You can just
  18807. 9:35:20choose your account and so on.
  18808. 9:35:21Um that's fine.
  18809. 9:35:23Once you're done with this, you can do
  18810. 9:35:24sheet within document append a row cuz
  18811. 9:35:26this is the action that we're doing. The
  18812. 9:35:28document will be IGGGG.
  18813. 9:35:32Choose the right account.
  18814. 9:35:34Yeah, there we go. The sheet will be
  18815. 9:35:36sheet one.
  18816. 9:35:37Which is this one right here.
  18817. 9:35:40And now we want to be able to map all
  18818. 9:35:42the fields. So mapping just means that
  18819. 9:35:44we want the username to be something
  18820. 9:35:45from here. We drag it across. Post URL,
  18821. 9:35:47original post, and rewritten post as
  18822. 9:35:48well.
  18823. 9:35:49So the username
  18824. 9:35:50I believe we can find I mean what was
  18825. 9:35:52his name? Evolving AI? Yeah, there we
  18826. 9:35:54go. Owner full name.
  18827. 9:35:56I can drag it across. Now what do we
  18828. 9:35:57actually want? This is because what if
  18829. 9:35:58we change the URL of another person
  18830. 9:36:01later on? We still want to know exactly
  18831. 9:36:02where the post came from.
  18832. 9:36:04And then we want the post URL.
  18833. 9:36:07Post URL.
  18834. 9:36:10There we
  18835. 9:36:13This right?
  18836. 9:36:15Yep, it's good. Uh and now the original
  18837. 9:36:17post text is I can get from the
  18838. 9:36:20I might have been beginning to actually
  18839. 9:36:21use N 8 N for the first time. Maybe
  18840. 9:36:23[music] I get so confused here.
  18841. 9:36:25There's so much to so much to look at.
  18842. 9:36:27Um and then the caption is this.
  18843. 9:36:30It's good. And now the
  18844. 9:36:32message of model which is the text. The
  18845. 9:36:35rewritten post. I like how we just
  18846. 9:36:37translated it in our own tone of voice.
  18847. 9:36:38Yo, this is actually insane. This is
  18848. 9:36:41wild. [music] I like that.
  18849. 9:36:42Apple just dropped a game changer. All
  18850. 9:36:44right, cool. Um all right. We can test
  18851. 9:36:46this as always. We can pin this I think.
  18852. 9:36:49Yep.
  18853. 9:36:50We're good. So now we should see this.
  18854. 9:36:51It's going to be formatted weird or not.
  18855. 9:36:54Yeah, it's good. [music] Uh what I'm
  18856. 9:36:55going to do is I'm going to make this
  18857. 9:36:57smaller.
  18858. 9:36:59I want to see the username, the post
  18859. 9:37:00URL.
  18860. 9:37:05Perfect. The original post and then
  18861. 9:37:06[music] rewritten post. I like all of
  18862. 9:37:08this apart from this. Yeah, like this I
  18863. 9:37:11mean this is obviously not ours, right?
  18864. 9:37:13Yeah, this is not ours. So let me go to
  18865. 9:37:14AI hello rules.
  18866. 9:37:18Do not use any CTA
  18867. 9:37:21at the end. Not the best change in
  18868. 9:37:23prompt, but it's fine.
  18869. 9:37:24>> [music]
  18870. 9:37:24>> We're going to run it from scratch um
  18871. 9:37:26again so don't worry. But now that we're
  18872. 9:37:28finished with this
  18873. 9:37:30so we said hey, okay. We run this actor.
  18874. 9:37:32We got the data.
  18875. 9:37:33We set the fields cuz it's easier for us
  18876. 9:37:35to actually map later on. I mean this
  18877. 9:37:36should work on its own. Um then we said
  18878. 9:37:39okay, we maybe we can get 50 posts, but
  18879. 9:37:42I only want to run 20 posts at a time.
  18880. 9:37:44So [music] we run 20 posts here.
  18881. 9:37:46Classify the relevance. If it's
  18882. 9:37:47relevant, then we go to actually make
  18883. 9:37:49the post. Then we add it to the sheet
  18884. 9:37:50and then we go back here and we run
  18885. 9:37:53[music] the next 20 and the next 20
  18886. 9:37:55until it's finished. Well, in this case
  18887. 9:37:56it's 50, right? So it will run twice and
  18888. 9:37:58then it will run three times. On the
  18889. 9:38:00third it only get 10. Finish. Let me
  18890. 9:38:02unpin all of this. There we go. Let me
  18891. 9:38:04save this. Let me refresh the page. And
  18892. 9:38:07now I should be able to run this.
  18893. 9:38:11Yeah.
  18894. 9:38:13Yeah.
  18895. 9:38:14Execute workflow. I can now wait. If I
  18896. 9:38:17go to the post creator, I can see that
  18897. 9:38:19this is now running. And this usually
  18898. 9:38:20takes about 20 per seconds. It can be a
  18899. 9:38:22minute depending on how many results you
  18900. 9:38:24want.
  18901. 9:38:2546 seconds.
  18902. 9:38:27Yeah, depends.
  18903. 9:38:28You can start to see the posts that are
  18904. 9:38:30being scraped right now. And we only get
  18905. 9:38:32the data.
  18906. 9:38:33Okay. That was 19. 19 posts. Okay, cool.
  18907. 9:38:36We get the data when it's finished.
  18908. 9:38:38So it goes here. Now it's going to
  18909. 9:38:39classify the relevance. Let me check in
  18910. 9:38:40here. Yeah, it's good. I guess it only
  18911. 9:38:42found 20 posts uh from the last 7 days
  18912. 9:38:45which is fine.
  18913. 9:38:46Cuz we did put a time frame, right? And
  18914. 9:38:47it's going to rewrite them and then put
  18915. 9:38:49them into the IGGGG database.
  18916. 9:38:52>> [music]
  18917. 9:38:52>> Now the reason why we see we give it
  18918. 9:38:54like hey, you can script 50 posts, but
  18919. 9:38:56in the past 7 days they only had 20. So
  18920. 9:38:58>> [music]
  18921. 9:38:59>> uh I didn't find 50. I mean you can see
  18922. 9:39:00here that the content is now being added
  18923. 9:39:02to the Google Sheets. So if I go here
  18924. 9:39:06I can see that more content has been
  18925. 9:39:07added.
  18926. 9:39:09I mean this is 24.
  18927. 9:39:10>> [music]
  18928. 9:39:11>> And we made 11.
  18929. 9:39:14So 1 2 3 4 5 6 7 8 9 10 11. So these 11
  18930. 9:39:19are the ones that have just been added,
  18931. 9:39:21right?
  18932. 9:39:22Which is great. And we have more
  18933. 9:39:23content. As you can see, there's no CTA.
  18934. 9:39:26Changed it compared to this.
  18935. 9:39:28Where is the CTA?
  18936. 9:39:30So we made that change.
  18937. 9:39:32Perfect. Um
  18938. 9:39:34All right. Now the only thing we have to
  18939. 9:39:35change in this automation is that we
  18940. 9:39:37have to run this every week.
  18941. 9:39:39I can delete this. Now I can go here
  18942. 9:39:41on a schedule.
  18943. 9:39:43And say weeks.
  18944. 9:39:45One week. We can trigger this on a
  18945. 9:39:46Sunday at midnight which is Oh actually
  18946. 9:39:48no, I set it on Monday. Let's do Monday.
  18947. 9:39:50Um Monday at 6:00 a.m. [music] Cuz who
  18948. 9:39:53wakes up before then? Um and then we
  18949. 9:39:56press save.
  18950. 9:39:58And now you should have a working
  18951. 9:39:59automation that runs every week. It will
  18952. 9:40:01scrape the different posts. It will get
  18953. 9:40:02the data set items. It will then set the
  18954. 9:40:03nodes or set the variables. [music] It
  18955. 9:40:05will then only run 20 at a time.
  18956. 9:40:07It will classify whether it is actually
  18957. 9:40:08relevant for our target audience. It
  18958. 9:40:10would only send the ones through that
  18959. 9:40:12are actually relevant. It would then
  18960. 9:40:13rewrite them. So let me rename this to
  18961. 9:40:15rewrite
  18962. 9:40:18post
  18963. 9:40:20before adding them to our Google Sheet
  18964. 9:40:22database with all the content right
  18965. 9:40:24here.
  18966. 9:40:27Hey, I'm about to build a live Twitter
  18967. 9:40:29parasite system right in front of you
  18968. 9:40:31that scrapes tweets from top performing
  18969. 9:40:32posts on Twitter based on a keyword that
  18970. 9:40:34we give it, rewrites them in your tone
  18971. 9:40:36of voice using AI, and turns them into a
  18972. 9:40:38stream of content that you can post on
  18973. 9:40:40automatically. So I'm just going to run
  18974. 9:40:41it and show you exactly the outcome that
  18975. 9:40:42we get. We have a form where we can add
  18976. 9:40:44a keyword. So in this case let's just
  18977. 9:40:45put AI agents.
  18978. 9:40:47And I submit. This now starts the
  18979. 9:40:49automation. It calls a scraper on Apify
  18980. 9:40:51so you can scrape the top 100 tweets on
  18981. 9:40:54Twitter based on that specific keyword
  18982. 9:40:56that we give it.
  18983. 9:40:57If we go here, we can see that this is
  18984. 9:40:59running.
  18985. 9:41:01It's got 80 so far.
  18986. 9:41:03So you can see now it went to the wait
  18987. 9:41:05because we're waiting 5 seconds before
  18988. 9:41:06adding it to the next Apify node to get
  18989. 9:41:08all the data and then add to the first
  18990. 9:41:10AI step which will classify the
  18991. 9:41:12relevance of the tweet whether it's it's
  18992. 9:41:15actually good for us to actually post it
  18993. 9:41:17or whether it could be considered a good
  18994. 9:41:18content idea.
  18995. 9:41:20And we're only letting 50 items through
  18996. 9:41:21at one time cuz we want to make sure
  18997. 9:41:22that we don't give all the AI
  18998. 9:41:24all the context and all 217 tweets.
  18999. 9:41:28This now sends only the relevant tweets
  19000. 9:41:31now to the other agent or to the other
  19001. 9:41:32AI step which will rewrite it in our
  19002. 9:41:34tone of voice before adding it to the
  19003. 9:41:36Google Sheet. All right, if you go here
  19004. 9:41:38to our Google Sheet, we can see that we
  19005. 9:41:40have the AI agent keyword, the original
  19006. 9:41:42post or the original tweet, and the
  19007. 9:41:44rewritten tweet [music] that we take in
  19008. 9:41:46order for us to then be able to post it
  19009. 9:41:47to our platform. All right, so let's
  19010. 9:41:49dive in. I'm going to go to a new
  19011. 9:41:50workflow.
  19012. 9:41:52Workflow personal right here. We start
  19013. 9:41:54from zero. Now in theory I would have to
  19014. 9:41:56go to Miro which is a platform where we
  19015. 9:41:58actually map out the automation before
  19016. 9:41:59actually building it. We're going to
  19017. 9:42:01start strategizing behind what is it
  19018. 9:42:03that we want, right? Now initially a
  19019. 9:42:05parasite system is using someone else's
  19020. 9:42:07content to be able to repurpose it for
  19021. 9:42:09our own.
  19022. 9:42:10And so because we're talking about
  19023. 9:42:12Twitter
  19024. 9:42:13Twitter operates with keywords. As in
  19025. 9:42:15like you give a keyword and you can get
  19026. 9:42:16a bunch of tweets. So the input has to
  19027. 9:42:18be a keyword, right? The input is a
  19028. 9:42:20keyword. That's the input.
  19029. 9:42:22Now the keyword can be can be a form,
  19030. 9:42:24can be a button, can be
  19031. 9:42:26a message. It can be different things.
  19032. 9:42:29Um we can Sorry, we can give the input
  19033. 9:42:30in different different ways. A form, a
  19034. 9:42:32message, whatever it is, an email. But
  19035. 9:42:33in this case because we have Notion
  19036. 9:42:35Sorry, N 8 N forms integrated within N 8
  19037. 9:42:37N, we can use the form right here.
  19038. 9:42:40Okay. Actually, let me just put N 8 N
  19039. 9:42:41form here.
  19040. 9:42:43And this will be the keyword. That will
  19041. 9:42:44be like the only question that will be
  19042. 9:42:45asked. Now after we have the form uh
  19043. 9:42:48with the N 8 N keyword
  19044. 9:42:50we would be able to we should send it to
  19045. 9:42:52a scraper. In this case we use Apify and
  19046. 9:42:55I'll talk about which one's the best,
  19047. 9:42:56how we actually find them, and all that
  19048. 9:42:57sort of stuff. Um but in this case we So
  19049. 9:43:00um scraper
  19050. 9:43:03scrapes
  19051. 9:43:06tweets
  19052. 9:43:08based on keyword.
  19053. 9:43:11Scrape tweets. I can just put scrape
  19054. 9:43:12tweets.
  19055. 9:43:14Based on keyword. Let's make it bigger.
  19056. 9:43:16And now we want to be able to send it to
  19057. 9:43:18an AI because not all tweets that come
  19058. 9:43:20from that keyword are relevant to what
  19059. 9:43:21we do. So use AI
  19060. 9:43:24to check
  19061. 9:43:25if
  19062. 9:43:26to check relevance.
  19063. 9:43:28And then if it's relevant, we want to
  19064. 9:43:30rewrite it. Okay?
  19065. 9:43:32Rewrite
  19066. 9:43:35relevant
  19067. 9:43:37tweets.
  19068. 9:43:39Okay, so that's exactly how it's going
  19069. 9:43:40to go and then we're going to be adding
  19070. 9:43:41it to a Google Sheet.
  19071. 9:43:43N 8 N form scrape tweets based on
  19072. 9:43:44keyword that we have using the form.
  19073. 9:43:46Then we use AI to check the relevance.
  19074. 9:43:47Then we rewrite the relevant tweets. Uh
  19075. 9:43:49so this will be a filter in here. It
  19076. 9:43:51will be a filter whether it's actually
  19077. 9:43:52relevant or not.
  19078. 9:43:54And then we can rewrite it and then add
  19079. 9:43:55it to a Google Sheet. Okay, I think
  19080. 9:43:57that's pretty
  19081. 9:43:58pretty It's pretty standard, pretty
  19082. 9:43:59easy. Um
  19083. 9:44:01The first step here is N 8 N form.
  19084. 9:44:03So let me actually make that on N 8 N.
  19085. 9:44:05And again this is step by step so you'll
  19086. 9:44:06see everything. The first step right
  19087. 9:44:07here I can press add. I can go here and
  19088. 9:44:09now I can add the different options. In
  19089. 9:44:10this case it will be on form submission
  19090. 9:44:12because we're using the N 8 N form right
  19091. 9:44:14right here.
  19092. 9:44:15So if I press this
  19093. 9:44:16I'll have this page.
  19094. 9:44:17Now again N 8 N forms, we have a test
  19095. 9:44:19URL, we have production URL. The test
  19096. 9:44:21URL is something that we use when we're
  19097. 9:44:22actually testing the automation. But
  19098. 9:44:24once this button right here is turned
  19099. 9:44:25on, we actually activate the automation
  19100. 9:44:27so we don't have to keep executing your
  19101. 9:44:29workflow every time manually.
  19102. 9:44:32Uh we will be using production URL. But
  19103. 9:44:34in this case let's leave it here cuz
  19104. 9:44:35we're testing. Authentication will leave
  19105. 9:44:37it uh we don't need any password.
  19106. 9:44:38Authentication is sort of saying do you
  19107. 9:44:40want a password to your form? We don't
  19108. 9:44:41need it. Uh the form title can be
  19109. 9:44:44Twitter
  19110. 9:44:47parasite
  19111. 9:44:48system.
  19112. 9:44:50Yeah, there we go. Uh I don't know for
  19113. 9:44:51some reason I always put the Y instead
  19114. 9:44:52of the I. And then here you can add
  19115. 9:44:56Please
  19116. 9:44:57add a keyword to activate
  19117. 9:45:00this system.
  19118. 9:45:03And now we can So this will be the form
  19119. 9:45:05description as in what you'll see in the
  19120. 9:45:06form. And now we can add we can start
  19121. 9:45:08adding the questions.
  19122. 9:45:09So we if we add add from element, this
  19123. 9:45:11just means add a question. Uh the field
  19124. 9:45:13name will be keyword.
  19125. 9:45:15It will be a text and placeholder let's
  19126. 9:45:17just put an example AI automation.
  19127. 9:45:20Okay, and this will be an example thing
  19128. 9:45:22they they see before they even write it
  19129. 9:45:23to get an idea what they have to put. We
  19130. 9:45:25put required.
  19131. 9:45:26And it's asking us respond when form is
  19132. 9:45:28submitted. Yes, because you want the
  19133. 9:45:29trigger
  19134. 9:45:30we want to send information there when
  19135. 9:45:32the form is submitted.
  19136. 9:45:33And that's it.
  19137. 9:45:35Uh so let me execute the step. Let me
  19138. 9:45:36test this out.
  19139. 9:45:38Let me do AI agents.
  19140. 9:45:40I submit and now here I should be able
  19141. 9:45:42to see the output.
  19142. 9:45:43And it's green, all good. And the
  19143. 9:45:45keyword is AI agents. Followed by the
  19144. 9:45:46date, the form mode which is in test
  19145. 9:45:48mode, right? Because we're using the
  19146. 9:45:49test URL. Uh so that's good.
  19147. 9:45:51>> [music]
  19148. 9:45:51>> Uh so that's the first step done. Now we
  19149. 9:45:53can go on to the next step which is the
  19150. 9:45:56Apify. So scrape tweets based on
  19151. 9:45:57keywords. Uh let me delete this. We'll
  19152. 9:45:59go to Apify from scratch. We'll go to
  19153. 9:46:01apify.com which is a platform where
  19154. 9:46:03it's sort of like a Amazon and the thing
  19155. 9:46:06the products that you're buying are
  19156. 9:46:07scrapers. Okay, and scraper and the the
  19157. 9:46:09Amazon products someone makes them, you
  19158. 9:46:11just use them. Okay? So in this case
  19159. 9:46:13that's exactly what this is. People make
  19160. 9:46:14scrapers, you just use them
  19161. 9:46:16to do whatever. Uh and it's all code in
  19162. 9:46:18the back end, right? Again, we don't
  19163. 9:46:19want to use code. So that's why we use
  19164. 9:46:21Automate.io system.
  19165. 9:46:22Um
  19166. 9:46:23so
  19167. 9:46:25typically when it comes to to scraping
  19168. 9:46:27like the first thing you do is go here
  19169. 9:46:29and search up
  19170. 9:46:30the thing that you want to do. In this
  19171. 9:46:31case it's Twitter scraping.
  19172. 9:46:34What's there you should have a look at
  19173. 9:46:35the reviews. Like that's the first thing
  19174. 9:46:36I would look at. Reviews, reviews,
  19175. 9:46:38reviews.
  19176. 9:46:39And the ratings and then I would go out
  19177. 9:46:41and look for the price. Now because I
  19178. 9:46:43already did this, um I have on home
  19179. 9:46:47this this scraper right here which is if
  19180. 9:46:49you want to if you want the actual
  19181. 9:46:50thing, just copy this x data {slash}
  19182. 9:46:52Twitter x scraper. You can copy this,
  19183. 9:46:54you can go here Apify store, you can
  19184. 9:46:56paste it.
  19185. 9:46:57And you will have this one right here.
  19186. 9:47:00Okay, so this is the one that we're
  19187. 9:47:00going to use because of the fact that
  19188. 9:47:02it's actually very cheap. So Apify
  19189. 9:47:04actually gives us $5 to anybody who
  19190. 9:47:06signs up
  19191. 9:47:07every month. Okay? And we have 8 GB.
  19192. 9:47:10This is more than enough to be using
  19193. 9:47:12this scraper which is 35 cents per 1,000
  19194. 9:47:14tweets. If we scrape 100 tweets per
  19195. 9:47:16keyword
  19196. 9:47:17we have to do and that's that's what?
  19197. 9:47:19That's very that's not even like that's
  19198. 9:47:21not something to even mention, right? In
  19199. 9:47:22terms of price. So it's basically free.
  19200. 9:47:25Um so you can use it as much as you
  19201. 9:47:26want.
  19202. 9:47:27Uh obviously again, not infinite, right?
  19203. 9:47:29Because we still have 35 cents per 1,000
  19204. 9:47:31tweets, we have $5. So with that being
  19205. 9:47:32said um
  19206. 9:47:35we have basically the scraper tells us
  19207. 9:47:36that the input in this case can either
  19208. 9:47:38be a start URL, it can be a URL of a
  19209. 9:47:40tweet or whatever it is.
  19210. 9:47:42It can be a search term
  19211. 9:47:43which is a keyword
  19212. 9:47:45or it can be a Twitter handle.
  19213. 9:47:47Okay? In this case, we want to be able
  19214. 9:47:49to add a keyword because that's the
  19215. 9:47:50thing that we're inputting
  19216. 9:47:52which is why we add so if I press X, I
  19217. 9:47:54can add here.
  19218. 9:47:56I'm going to do AI
  19219. 9:47:57automation, whatever it is. And for you
  19220. 9:47:59to actually see it on end to end, you
  19221. 9:48:01have to actually start and run it once
  19222. 9:48:04for it to save.
  19223. 9:48:05So I already did this, so I don't have
  19224. 9:48:07to do this again, but you can start and
  19225. 9:48:08then save it.
  19226. 9:48:10And then maximum number of atom output,
  19227. 9:48:12that's good. All right, so let me go to
  19228. 9:48:13end to end and actually cuz I have this
  19229. 9:48:14scraper already
  19230. 9:48:16I'm going to go to Apify
  19231. 9:48:18right here and I'm going to run an actor
  19232. 9:48:19because the actor is the scrapers like
  19233. 9:48:21the scraper itself is called an actor.
  19234. 9:48:23Uh so if I press run an actor, it gives
  19235. 9:48:25you the option to um to actually connect
  19236. 9:48:27Apify to end to end. I press here, I can
  19237. 9:48:30now put the API key which I can find
  19238. 9:48:32when I go to settings.
  19239. 9:48:35I go to API integrations and this will
  19240. 9:48:36be
  19241. 9:48:37the one here. Default API token. I copy
  19242. 9:48:40this and I go out here and I paste it
  19243. 9:48:43this will now let me put
  19244. 9:48:45100
  19245. 9:48:47connection
  19246. 9:48:49100
  19247. 9:48:50connection
  19248. 9:48:52second [music]
  19249. 9:48:53September
  19250. 9:48:55I press save, this will now save. As you
  19251. 9:48:57can see here
  19252. 9:48:58you can't see it cuz I'm there, but uh
  19253. 9:49:00it will be credentials successfully
  19254. 9:49:01created.
  19255. 9:49:02I go here and now I will have the
  19256. 9:49:03connection. Okay? The resource will be
  19257. 9:49:05actor, the operation will be run an
  19258. 9:49:06actor cuz that's the action that we're
  19259. 9:49:07doing.
  19260. 9:49:09Actor we can be uh actor source recently
  19261. 9:49:11used actors.
  19262. 9:49:12You should do Apify store actors in case
  19263. 9:49:14you haven't used it yet.
  19264. 9:49:15From the list now you have a list of
  19265. 9:49:17actors that you've probably used. If you
  19266. 9:49:19did this the first time you'll see none
  19267. 9:49:20of them. Um
  19268. 9:49:21but
  19269. 9:49:22you I mean you will see the one that you
  19270. 9:49:23just you just run which is the one that
  19271. 9:49:24I would just spoke about which is the
  19272. 9:49:26one here.
  19273. 9:49:27So this is the one that you have to use.
  19274. 9:49:28Look for the handle x data Twitter
  19275. 9:49:30scraper or look for the name xcom uh
  19276. 9:49:32x.com Twitter API scraper. I go here, I
  19277. 9:49:35can then look the thing, right? And it
  19278. 9:49:37tells us the name. So we know that it's
  19279. 9:49:38this one. I want to press this
  19280. 9:49:40and now it's asking me for a few things.
  19281. 9:49:42It's asking me what's the input JSON? So
  19282. 9:49:43how do you know the input JSON? Well
  19283. 9:49:46you can actually scrape on Apify using
  19284. 9:49:48two different ways. You can scrape on
  19285. 9:49:48the platform, so you can go here and
  19286. 9:49:50actually put the keyword and run it and
  19287. 9:49:52get the results manually and download as
  19288. 9:49:53a CSV or whatever it is. Or you can
  19289. 9:49:55actually use it automatically. Use it
  19290. 9:49:58automatically, you need the JSON here.
  19291. 9:49:59So this is the manual process. In in
  19292. 9:50:01case you want to use JSON, we have to
  19293. 9:50:02press this button right here. And now it
  19294. 9:50:04gives us
  19295. 9:50:05the JSON that we can copy
  19296. 9:50:08right? And the only thing we have to
  19297. 9:50:09change in this case is the search term
  19298. 9:50:11>> [music]
  19299. 9:50:11>> which is the variable that we get from
  19300. 9:50:13the form that we fill out. Okay? So if
  19301. 9:50:15we
  19302. 9:50:16copy this whole thing
  19303. 9:50:17we go here, we paste it back
  19304. 9:50:21Uh okay, so if you do this, we just copy
  19305. 9:50:23it. And now
  19306. 9:50:25the only thing we have to change here
  19307. 9:50:27because the search term is the thing
  19308. 9:50:29that's dynamic we have to change the
  19309. 9:50:30search term which we get from the
  19310. 9:50:32keyword. If I delete this
  19311. 9:50:34and I pull this across
  19312. 9:50:35keyword
  19313. 9:50:36in the middle
  19314. 9:50:38right?
  19315. 9:50:39Make sure that it is in the middle. Make
  19316. 9:50:40sure that it's
  19317. 9:50:41uh that it's not here.
  19318. 9:50:43Make sure that it is in the middle
  19319. 9:50:44between the two quotes.
  19320. 9:50:46So now what this will do is this
  19321. 9:50:47variable right here will be changed.
  19322. 9:50:49Okay, it will be dynamic. It will be
  19323. 9:50:50something that changes as the form
  19324. 9:50:51submissions change. So what did we do
  19325. 9:50:52here? We created the actor, we connected
  19326. 9:50:54the actor, we said okay, this actor is
  19327. 9:50:56fine. Then I went to Apify and said
  19328. 9:50:58okay, if this is the normal way of doing
  19329. 9:50:59things with these with these settings AI
  19330. 9:51:01automation 100 and so on top
  19331. 9:51:03the JSON for it is this.
  19332. 9:51:06Top AI automation 100 and so on, right?
  19333. 9:51:08So you want to copy this. You're going
  19334. 9:51:10to paste it here and then the only thing
  19335. 9:51:11you want to replace is the actual
  19336. 9:51:12keyword that you use uh to actually
  19337. 9:51:14scrape the tweets.
  19338. 9:51:16And it's asking us for um wait for
  19339. 9:51:18finished. In this case, yes we want to
  19340. 9:51:19wait for finished. What this means is
  19341. 9:51:21that we can if we toggle this off, we
  19342. 9:51:23can basically send the data to the
  19343. 9:51:26the actor but it will run it will say
  19344. 9:51:29it's successful as in it won't give us
  19345. 9:51:30the the data back, it will just run it.
  19346. 9:51:32But if you press wait for finished, what
  19347. 9:51:33it will do is that it will send the
  19348. 9:51:35information to the actor like this. It
  19349. 9:51:37will wait for the actor which in this
  19350. 9:51:39case can take 45 seconds to finish and
  19351. 9:51:41then it will give us the data. Okay? So
  19352. 9:51:43in this case that's exactly what we
  19353. 9:51:44want.
  19354. 9:51:46Uh time out, we don't need time out.
  19355. 9:51:48Memory is fine.
  19356. 9:51:49That's fine.
  19357. 9:51:50So let me actually test this. Uh in this
  19358. 9:51:52case I can press execute step.
  19359. 9:51:54I believe, yeah.
  19360. 9:51:55So what this will do is it will go here.
  19361. 9:51:56You see how now
  19362. 9:51:58it's running. So it's running a new
  19363. 9:51:59search term uh based on the
  19364. 9:52:02keyword AI agents which we just run
  19365. 9:52:04before.
  19366. 9:52:05Again, execute step. The good thing
  19367. 9:52:06about end to end is that you can
  19368. 9:52:07actually test it using the data from the
  19369. 9:52:08previous steps. So now it's waiting. So
  19370. 9:52:10we're we're actually waiting for the
  19371. 9:52:12data to come back. We scraped 60 so far.
  19372. 9:52:15And now we have to wait another 20 more
  19373. 9:52:16seconds for it to to load. Um but this
  19374. 9:52:18right here is is basically what's
  19375. 9:52:19happening. It's giving us a whole log of
  19376. 9:52:21the whole of everything that's happening
  19377. 9:52:22within the actual platform and how it
  19378. 9:52:24scripts. All right, cool. So it's
  19379. 9:52:25finished. If I go here, I can see that I
  19380. 9:52:28get different data. But we don't
  19381. 9:52:29actually get like you can see here we
  19382. 9:52:30don't actually get the tweets. What we
  19383. 9:52:32get is a bunch of fields and
  19384. 9:52:35the thing that you really have to care
  19385. 9:52:36about is this right here, default data
  19386. 9:52:38set ID. Because this right here is the
  19387. 9:52:40thing that we're going to feed into the
  19388. 9:52:41next node
  19389. 9:52:42the Apify for us to actually extract the
  19390. 9:52:44information. So if I copy this code
  19391. 9:52:47and I go here and I put another Apify
  19392. 9:52:48node, Apify
  19393. 9:52:50in this case it can be get data set
  19394. 9:52:52items.
  19395. 9:52:53So let me I mean I can just find it.
  19396. 9:52:55There we are, right here. Get data set
  19397. 9:52:57items. So if I go to get a get data set
  19398. 9:52:59items, what this means is that
  19399. 9:53:01the only thing that we have to feed it
  19400. 9:53:02is the data set ID.
  19401. 9:53:04So if I paste it manually, in this case
  19402. 9:53:05we have to be automatic.
  19403. 9:53:07I execute the step. Now this will give
  19404. 9:53:09me all the data just 50 items, 50 tweets
  19405. 9:53:12for that specific keyword. Where we can
  19406. 9:53:14where we can go through. I go on table
  19407. 9:53:16and see that it's a bunch of data and
  19408. 9:53:18it's divided into pages.
  19409. 9:53:19This is how we get the data from Apify.
  19410. 9:53:21This actor runs, we wait for it to
  19411. 9:53:22finish, then we get the data set ID
  19412. 9:53:23which we feed into the second node which
  19413. 9:53:25will get all the data from that data set
  19414. 9:53:26ID and then we can go out and uh and use
  19415. 9:53:29it for whatever. Now the limit we can
  19416. 9:53:31leave to 500.
  19417. 9:53:33So if I go to execute step
  19418. 9:53:35now we see 179. It was 50 because that's
  19419. 9:53:37the limit. Um
  19420. 9:53:39well that was the limit.
  19421. 9:53:40Data set ID, well that's the thing we
  19422. 9:53:42have to replace. In this case you can go
  19423. 9:53:43here to default data set ID.
  19424. 9:53:45And you want to drag it across here.
  19425. 9:53:48And the connection is the same. The
  19426. 9:53:50resource is data set. Operation is get
  19427. 9:53:51items.
  19428. 9:53:52Uh offset, limits and that's all good.
  19429. 9:53:55All right, so now that we have the data,
  19430. 9:53:57we can go to the next step. So if I go
  19431. 9:53:58here to Miro
  19432. 9:54:00uh the next step is to use AI to check
  19433. 9:54:02the relevance. There's only one problem
  19434. 9:54:03here is that we're sending 179 items to
  19435. 9:54:06the AI step which you can't do because
  19436. 9:54:08sometimes it can overload which means
  19437. 9:54:10that it's too much information and will
  19438. 9:54:11not run, it will error out. Uh so
  19439. 9:54:13[music] in this case, in order for us to
  19440. 9:54:14actually be able to send
  19441. 9:54:16let's say 50 and then 50 again and then
  19442. 9:54:1850 again until it finishes we have to
  19443. 9:54:20use a loop over items. So I go loop
  19444. 9:54:23over items.
  19445. 9:54:25And now it's asking me for a batch size.
  19446. 9:54:27So batch size is saying okay, what is
  19447. 9:54:28that number how many items do you want
  19448. 9:54:30to send through before we loop back and
  19449. 9:54:32get another, right? So in this case we
  19450. 9:54:33can do 50
  19451. 9:54:35and leave everything else as is.
  19452. 9:54:37So in theory now
  19453. 9:54:39it will get 179 or whatever it is it
  19454. 9:54:41needs to get. It will send it it will
  19455. 9:54:43send only send 50 through
  19456. 9:54:44based on here and then it will go back
  19457. 9:54:4650 again, 50 again until it finishes.
  19458. 9:54:48Okay, so I'm going to delete this.
  19459. 9:54:50Let me delete this. And now I can start
  19460. 9:54:51adding the next steps of the automation.
  19461. 9:54:53So in this case again is the AI to check
  19462. 9:54:55the relevance. So we can go here loop to
  19463. 9:54:57AI
  19464. 9:54:58we can go to open AI
  19465. 9:55:00message a model because we're messaging
  19466. 9:55:02a model.
  19467. 9:55:03And now, in order for us to connect our
  19468. 9:55:04OpenAI to n8n, we have to go here to
  19469. 9:55:07create a new credential.
  19470. 9:55:09We have to get the API key. Now, the API
  19471. 9:55:10key is something is sort of like a
  19472. 9:55:11password that says, "Hey, and then you
  19473. 9:55:13have access to my account. You can talk
  19474. 9:55:15to it. You can talk to the GPTs,
  19475. 9:55:17whatever it is you have to do."
  19476. 9:55:18automatically. In order for us to get
  19477. 9:55:20the API key, we have to go to here to
  19478. 9:55:21platform.openai.com.
  19479. 9:55:24We can go to uh you have to sign in, of
  19480. 9:55:26course. Go to dashboard. Go to API keys
  19481. 9:55:28on the left-hand side. You can create a
  19482. 9:55:30new secret key on the top right. Uh name
  19483. 9:55:32it whatever you want. So, we can do n8n
  19484. 9:55:34workflow.
  19485. 9:55:35When you create a secret key,
  19486. 9:55:36this now will be the API key that we
  19487. 9:55:38will use
  19488. 9:55:39when you have to go back to n8n and
  19489. 9:55:41paste it here.
  19490. 9:55:42Okay? Now, make sure you don't share
  19491. 9:55:44this API key with anyone cuz it is um
  19492. 9:55:46it is something that if someone else has
  19493. 9:55:48access to it, they'll start spamming
  19494. 9:55:49your money. Um so, don't do it. So, copy
  19495. 9:55:52this, bring it back here, paste it, and
  19496. 9:55:53then you will have the connection
  19497. 9:55:55sorted. Now, once this is done, you'll
  19498. 9:55:56have the connection here. The resource
  19499. 9:55:58is text. The operation will be message a
  19500. 9:55:59model. The operation is sort of saying,
  19501. 9:56:01"What is it that we're doing?" Uh and
  19502. 9:56:02then from the list, the models, we can
  19503. 9:56:03just use Let's do 4.0 latest. I think
  19504. 9:56:07that's fine.
  19505. 9:56:08Or 4.0 mini.
  19506. 9:56:10I think 4.0 mini is 4.0 Yeah, 4.1 mini.
  19507. 9:56:13That's like
  19508. 9:56:14We're looking for something that's like
  19509. 9:56:15quality plus speed, right? Um so, 4.1
  19510. 9:56:18mini. That's fine. All right, so we have
  19511. 9:56:20the prompt right here, which is in this
  19512. 9:56:21case a system prompt because again, we
  19513. 9:56:23give it an identity. Uh if I go in here,
  19514. 9:56:26let me just zoom in.
  19515. 9:56:27You can say, "You are a helpful, precise
  19516. 9:56:29tweet classifier for an
  19517. 9:56:30automation-focused audience, uh people
  19518. 9:56:32who build or learn automations, n8n,
  19519. 9:56:33make.com, Zapier, uh APIs and webhooks,
  19520. 9:56:35AI agents, RPA, workflow ops,
  19521. 9:56:37integration patterns, rebuild tool
  19522. 9:56:38releases that impact automation work."
  19523. 9:56:40Now, this will obviously be replaced
  19524. 9:56:41with whatever you're doing. Um so, you
  19525. 9:56:43can change this to to your kind of
  19526. 9:56:45audience. Uh but for me, it's AI
  19527. 9:56:46automation. And now, I'm going to start
  19528. 9:56:47adding the user and assistant. So, for
  19529. 9:56:50the user, I'm going to add a prompt that
  19530. 9:56:53allows it to
  19531. 9:56:54So, user.
  19532. 9:56:56Uh to see whether this is relevant or
  19533. 9:56:57not. So again, system is for you are a
  19534. 9:57:00helpful, intelligent XYZ. So, it knows
  19535. 9:57:01it's that thing. So, if it thinks it's
  19536. 9:57:03that thing, it's going to the output of
  19537. 9:57:04quality is going to go better uh cuz you
  19538. 9:57:06give it an identity. And now, for the
  19539. 9:57:07user prompt, we say, "Hey, classify a
  19540. 9:57:09tweet for an automation-focused
  19541. 9:57:10audience. Return only verdict uh
  19542. 9:57:12relevant or not relevant." So, this is
  19543. 9:57:13using JSON.
  19544. 9:57:14We're saying, "Hey, only output this.
  19545. 9:57:16This is the key. This is the value.
  19546. 9:57:18Relevant or not relevant um based on
  19547. 9:57:21these rules. Relevant if it contains
  19548. 9:57:23actual automation content, how-tos,
  19549. 9:57:24rebuild, API, webhooks, integrations,
  19550. 9:57:26agent, RPA, workflows, templates, or ops
  19551. 9:57:28patterns." Cuz in this case, we only
  19552. 9:57:30want things that are actually relevant
  19553. 9:57:32to what we do. And then not relevant if
  19554. 9:57:33it's generic AI tech news, motivational,
  19555. 9:57:35personal, non-automation, coding, uh
  19556. 9:57:37politics, finance, or tool discounts, or
  19557. 9:57:39vague hype with no build impact. And we
  19558. 9:57:41only tell it to output JSON only. Okay?
  19559. 9:57:43Because that's the only variable that we
  19560. 9:57:45want. We don't really care about
  19561. 9:57:46anything else. We just want to say,
  19562. 9:57:47"Hey, is this relevant or is this not
  19563. 9:57:49relevant?" Uh once this is done,
  19564. 9:57:51now
  19565. 9:57:52we can give it the tweet. Um so, if I
  19566. 9:57:55add another user message,
  19567. 9:57:57so in this case, I have to I believe I
  19568. 9:57:59have to run the previous steps.
  19569. 9:58:01Yeah, I have to run the previous steps.
  19570. 9:58:02For me to see here, I have to execute
  19571. 9:58:04previous nodes. This case, it's running.
  19572. 9:58:06So, we have to wait about 40 seconds,
  19573. 9:58:07but then we'll be able to pin the data,
  19574. 9:58:09and then we can we don't have to rerun
  19575. 9:58:10everything again.
  19576. 9:58:11All right, so it just finished running.
  19577. 9:58:12Um I mean, now we're using AI.
  19578. 9:58:15But we have the variables on the
  19579. 9:58:16left-hand side that we can use to
  19580. 9:58:17actually add it here.
  19581. 9:58:19Uh I'm just going to stop this.
  19582. 9:58:20There we go. Okay.
  19583. 9:58:22Now, all we have to add is this. So, we
  19584. 9:58:24added, "You are a a helpful, intelligent
  19585. 9:58:25um whatever assistant." And the prompt
  19586. 9:58:28is, "You need to check whether the
  19587. 9:58:29actual tweet is relevant or not." Uh but
  19588. 9:58:32now, we have to give it the tweet. So,
  19589. 9:58:34the last user message will be, "Here's
  19590. 9:58:36the tweet
  19591. 9:58:37that you need to classify."
  19592. 9:58:41And now, we have to find the tweet here.
  19593. 9:58:43So, if I go to not loop over items, it
  19594. 9:58:44will be get it data set items for sure
  19595. 9:58:46because that's where the data's all at.
  19596. 9:58:48If I scroll, something you have to do
  19597. 9:58:51with these sort of things cuz there's so
  19598. 9:58:51many fields. Most of them don't matter.
  19599. 9:58:54Okay. Okay. Yeah, it's definitely
  19600. 9:58:55description.
  19601. 9:58:56Description.
  19602. 9:58:57That's the closest thing that looks like
  19603. 9:58:58a tweet. Yeah, description. So, now we
  19604. 9:59:00can
  19605. 9:59:02drag this across.
  19606. 9:59:04Not loop over items.
  19607. 9:59:06This one right here. We can [music] drag
  19608. 9:59:07this across. Make sure it's a verify.
  19609. 9:59:10Right here. And now, this will be the
  19610. 9:59:11thing that will be used to actually
  19611. 9:59:13check whether it's relevant or not. So,
  19612. 9:59:15here we can rename this to relevance
  19613. 9:59:17agent. Although, it's not really an
  19614. 9:59:19agent, right? Cuz it's just a step. It's
  19615. 9:59:20an AI step. All right, cool. So, once we
  19616. 9:59:22do this, now we can
  19617. 9:59:27We can go to the next step, which in
  19618. 9:59:28this case is actually filtering. Okay?
  19619. 9:59:30So, we want to actually run this
  19620. 9:59:32because
  19621. 9:59:33we want to make sure that we have the
  19622. 9:59:36data to test.
  19623. 9:59:38Uh but I actually forgot to do one
  19624. 9:59:39thing. So, this agent's going to run,
  19625. 9:59:41but I forgot to do one thing, which is
  19626. 9:59:42turn this on. Uh output content as JSON
  19627. 9:59:44because we tell it, "Hey, output this as
  19628. 9:59:45JSON." So, we have to turn this on to
  19629. 9:59:47let it know the output is JSON. That's
  19630. 9:59:49all it is. Uh so, now what it's doing is
  19631. 9:59:51it's uh running through 50.
  19632. 9:59:54So, I mean, we still get the data. And
  19633. 9:59:55I'll show you exactly what it looks
  19634. 9:59:56like.
  19635. 9:59:57Um but now, it's running through all the
  19636. 9:59:58prompts. It's checking every single
  19637. 9:59:59first or every single Twitter um post
  19638. 10:00:01that's made.
  19639. 10:00:03And that's the thing we're going to use
  19640. 10:00:04to go into the next steps. All right, so
  19641. 10:00:05you can see now uh it's null. There's no
  19642. 10:00:07data.
  19643. 10:00:09So, now we have to turn this on, output
  19644. 10:00:11content as JSON, and let's rerun it
  19645. 10:00:12again. I said execute the step again.
  19646. 10:00:15Now, it will take the data from these
  19647. 10:00:16steps, and now it will run it again to
  19648. 10:00:18make sure that we can now actually test
  19649. 10:00:20the data or test the the step to make
  19650. 10:00:22sure that we we have the correct things.
  19651. 10:00:24All right, cool. So, now that it's
  19652. 10:00:25finished, I can see here
  19653. 10:00:27schema.
  19654. 10:00:28Okay, why did it error out? Why did it
  19655. 10:00:30not work as we expected it to? Okay,
  19656. 10:00:33this is part of the process, so let's
  19657. 10:00:34see.
  19658. 10:00:35I think it might be because of it's not
  19659. 10:00:38actually the author description, it's
  19660. 10:00:39the text.
  19661. 10:00:40Let me just press text here, and let's
  19662. 10:00:42see what I get.
  19663. 10:00:44It should be full Okay, that's why.
  19664. 10:00:46Okay. Full text.
  19665. 10:00:48I think that might be it. Yeah, yeah,
  19666. 10:00:49yeah. I think I'm right. Full text is
  19667. 10:00:51the full text of the Twitter post. So,
  19668. 10:00:53let me execute the step again.
  19669. 10:00:55And again, this is part of the process.
  19670. 10:00:56I mean, we we mess up. We have to see.
  19671. 10:00:58We have to check the variables, not
  19672. 10:00:59check the variables, see what works or
  19673. 10:01:00what doesn't work. Um And if I didn't
  19674. 10:01:02show this part of the process, I'd be
  19675. 10:01:03lying cuz that's always what we go
  19676. 10:01:05through when we build automations.
  19677. 10:01:07I'm just going to wait again until it
  19678. 10:01:09finishes. All right, cool. So, now if I
  19679. 10:01:10go in here, I can see that now we have
  19680. 10:01:12relevant, not relevant, and so on. Now,
  19681. 10:01:14the next step here is to add a filter
  19682. 10:01:16because we're asking it to give us the
  19683. 10:01:18relevant and not relevant so that we can
  19684. 10:01:19filter out the ones that are not
  19685. 10:01:20relevant and only send the ones that
  19686. 10:01:21are. In this case, to add a filter, we
  19687. 10:01:23just press plus and put filter.
  19688. 10:01:26Remove items matching a condition. This
  19689. 10:01:28case, the filter would be
  19690. 10:01:30if the verdict is equal to relevant,
  19691. 10:01:34then we send only those one through.
  19692. 10:01:36That's it.
  19693. 10:01:37That's all we're doing. So, if I run
  19694. 10:01:38this,
  19695. 10:01:41believes that it will do it.
  19696. 10:01:43Yes. Should do it.
  19697. 10:01:46Or it's running Oh, it's going to run it
  19698. 10:01:47again. Okay.
  19699. 10:01:48I forgot to pin the data. Okay, I should
  19700. 10:01:50have pinned the data so that I don't
  19701. 10:01:51have to run it again. For always for
  19702. 10:01:53always remember to pin the data cuz then
  19703. 10:01:55you see how now to rerun this to only
  19704. 10:01:57run the step, I have to start everything
  19705. 10:01:59again, and I have to wait like 40
  19706. 10:02:00seconds. Um so, lesson learned. Uh we're
  19707. 10:02:03going to pin the data in the next uh in
  19708. 10:02:05the next round. All right, so it just
  19709. 10:02:06finished, and you see how of the 50 that
  19710. 10:02:08went through, only 27 stayed. Only 27
  19711. 10:02:11were relevant. Now, let me pin this
  19712. 10:02:13data. I can drag it across, and press P.
  19713. 10:02:16So, now if I wanted to test this again,
  19714. 10:02:18I would just um
  19715. 10:02:20have this finished.
  19716. 10:02:22And now, to get into the next steps, uh
  19717. 10:02:25we have to go to the rewrite relevant
  19718. 10:02:28tweet. Okay, we're still going to use an
  19719. 10:02:30AI, but in this case, we're not using
  19720. 10:02:31OpenAI, we're using Claude. Now, the
  19721. 10:02:33reason why we're using Claude is cuz
  19722. 10:02:35Claude is extensively better at writing
  19723. 10:02:36content. Okay? So, if I go here and I
  19724. 10:02:39type Claude, Anthropic,
  19725. 10:02:42I can go to generate a prompt.
  19726. 10:02:45Zoom out. Now, to connect your Claude to
  19727. 10:02:49the uh n8n, we have to go here, create a
  19728. 10:02:52new credential. You have to get the API
  19729. 10:02:53key. So, we can go to anthropic.console.
  19730. 10:02:56Um get the API key.
  19731. 10:02:59Create a key right here.
  19732. 10:03:00You can name it whatever you want, and
  19733. 10:03:02then you can add, and you'll get the API
  19734. 10:03:03key.
  19735. 10:03:04Once that's done, you bring it back, and
  19736. 10:03:05you will paste it here.
  19737. 10:03:07All right. So, now that you pasted it
  19738. 10:03:08and now you connected your API key to
  19739. 10:03:10Claude, the resource is text. We want to
  19740. 10:03:12message a model. The list uh let's do
  19741. 10:03:153.5 Haiku. That's fine.
  19742. 10:03:19I think that is one of the best at
  19743. 10:03:20writing content.
  19744. 10:03:22Or is it Sonnet? Okay, let's just do
  19745. 10:03:23Haiku in this case. I think this is like
  19746. 10:03:24the fastest. It takes the most context,
  19747. 10:03:26uh the most amount of words. And the
  19748. 10:03:28prompt in this case, let me just copy it
  19749. 10:03:30from the automation I made before.
  19750. 10:03:31It's the one here.
  19751. 10:03:34It says, "Overview. You're a helpful,
  19752. 10:03:35intelligent writing assistant.
  19753. 10:03:37Uh rewrite the tweet that I'm going to
  19754. 10:03:38give you in a in a way that encapsulates
  19755. 10:03:39the original theme, but uses different
  19756. 10:03:41words." So, that's what paraphrase and
  19757. 10:03:42just means. We're taking something and
  19758. 10:03:43rewriting it in our own words. "I'm
  19759. 10:03:45targeting this audience. My results uh
  19760. 10:03:47are this. So, worked with over generated
  19761. 10:03:49just under six figures, worked with 40
  19762. 10:03:50businesses, and taught over 17,000
  19763. 10:03:52people. And I got to do a bunch of fun
  19764. 10:03:53stuff like travel, enjoy my life, etc.
  19765. 10:03:55The rules is use a non-fluffy, young
  19766. 10:03:56tone when rewriting the tweet because
  19767. 10:03:58that's me. Young. Um and then only
  19768. 10:04:00output the tweet, and that's it."
  19769. 10:04:02That's a pretty standard prompt. That's
  19770. 10:04:03a pretty good prompt. It has overview.
  19771. 10:04:05It has task, and it has my results. Now,
  19772. 10:04:06what you see here is hashtags. Hashtags
  19773. 10:04:08are in mark They're used for markdown
  19774. 10:04:10formatting. So, this right here means
  19775. 10:04:12it's heading one. This right here is
  19776. 10:04:13heading two. Heading two. Heading one.
  19777. 10:04:15Okay? We do this because that way, the
  19778. 10:04:18GPT knows what's the title, and it can
  19779. 10:04:20it can basically categorize or has the a
  19780. 10:04:22hierarchy to what to look at first.
  19781. 10:04:24All right, so now that this is done, we
  19782. 10:04:26can now prompt the same model to uh we
  19783. 10:04:29have to give it tweet essentially for it
  19784. 10:04:30to actually do something.
  19785. 10:04:32So, we can add a message, user. In this
  19786. 10:04:34case, we can say, "Here is the tweet
  19787. 10:04:39to rewrite."
  19788. 10:04:42Rewire. Rewrite.
  19789. 10:04:44All right, and now we can pull the tweet
  19790. 10:04:46from
  19791. 10:04:47So, if
  19792. 10:04:48uh was it full text?
  19793. 10:04:50Yeah, full text.
  19794. 10:04:51There we go.
  19795. 10:04:53All right. So, now that this is done, uh
  19796. 10:04:55we can I believe test.
  19797. 10:04:58Yeah, we can test.
  19798. 10:05:00Let me actually me pin this.
  19799. 10:05:03Pin this as well.
  19800. 10:05:05Pin this as well.
  19801. 10:05:07Cuz I don't want any problems having to
  19802. 10:05:09run everything.
  19803. 10:05:10Uh let's uh let's execute the step. So,
  19804. 10:05:12now it's actually running.
  19805. 10:05:15This is running, taking the data from
  19806. 10:05:16here and from here.
  19807. 10:05:18And it's going to give us an output.
  19808. 10:05:20Which you then need. All right, in the
  19809. 10:05:21meantime,
  19810. 10:05:22uh once we finish this, we have to make
  19811. 10:05:24a Google Sheet. Okay, so let's make the
  19812. 10:05:25Google Sheet right now.
  19813. 10:05:27Let's go to
  19814. 10:05:28sheet.new.
  19815. 10:05:30Let me copy the headers that I had
  19816. 10:05:31before, keywords, original post, and
  19817. 10:05:33rewritten post. Cuz again, we want the I
  19818. 10:05:36mean that what I wanted here when I
  19819. 10:05:37actually thought of the system was the
  19820. 10:05:39keyword. I I want to see exactly what uh
  19821. 10:05:41where the comment came from, the
  19822. 10:05:42keyword. The original post, so in this
  19823. 10:05:44case, it'll be the original tweet,
  19824. 10:05:46rewritten tweet.
  19825. 10:05:49Okay, that's fine.
  19826. 10:05:50All right, so you can see this is taking
  19827. 10:05:52uh a bit long, but that's fine.
  19828. 10:05:54Cuz it is taking I mean it is Claude. It
  19829. 10:05:56is 27 items as well to rewrite
  19830. 10:05:58something, so that's uh that's normal.
  19831. 10:06:00So, now let's rename the sheet to
  19832. 10:06:04Twitter.
  19833. 10:06:06Mhm, Twitter system, cuz I already named
  19834. 10:06:08this parasite system. Twitter system.
  19835. 10:06:10The sheet is one. Uh let's put this to
  19836. 10:06:12new
  19837. 10:06:14tweets
  19838. 10:06:15ideas.
  19839. 10:06:17And now okay, we have the output here,
  19840. 10:06:18which in this case is rewritten uh
  19841. 10:06:22rewritten tweets that we can use. And
  19842. 10:06:23now we want to store everything in a
  19843. 10:06:24Google Sheet. So, I'm going to go here,
  19844. 10:06:25press plus, sheet, Google Sheet, add
  19845. 10:06:28row, so append a row. Append just means
  19846. 10:06:29add.
  19847. 10:06:31And now you have to connect your Google
  19848. 10:06:32Sheet. So, you have to go here, create a
  19849. 10:06:33new credential. You can sign in with
  19850. 10:06:34Google. It will take you to a page. You
  19851. 10:06:36can just press the account. In this
  19852. 10:06:37case, this is my account.
  19853. 10:06:39Press okay.
  19854. 10:06:41It's successful. Means it's all good.
  19855. 10:06:43You can go back to N8N.
  19856. 10:06:44Name this
  19857. 10:06:45Kelley connection.
  19858. 10:06:47And then update. Press save.
  19859. 10:06:50That's fine. The connection's made. Now
  19860. 10:06:51we want to do a sheet within the
  19861. 10:06:52document. We want to append a row.
  19862. 10:06:54Again, operation just means what's the
  19863. 10:06:55action that we're doing.
  19864. 10:06:57And the document is Twitter
  19865. 10:06:59system.
  19866. 10:07:01Twitter system. Cool. And the sheet is
  19867. 10:07:04new tweet ideas.
  19868. 10:07:06We want to leave this as map each column
  19869. 10:07:08manually because this is the manual
  19870. 10:07:09step. We want to basically map the
  19871. 10:07:11variables to the columns so that they
  19872. 10:07:12change and they add every single time.
  19873. 10:07:14In this case, the keyword is
  19874. 10:07:17where can I find the keyword somewhere
  19875. 10:07:18here? No, I think I think we have to run
  19876. 10:07:19this. Yeah, yeah, we have to run this.
  19877. 10:07:23Execute step.
  19878. 10:07:26Okay, wait. Let me get the Let me get
  19879. 10:07:27the link. Execute step.
  19880. 10:07:30AI agents.
  19881. 10:07:33Now I have this. I can pin this.
  19882. 10:07:36So, that here I think now
  19883. 10:07:38I'll have access. Okay, I think I need
  19884. 10:07:40to rerun.
  19885. 10:07:41Oh, no, here right here.
  19886. 10:07:43Mhm.
  19887. 10:07:45Yeah, I'm going to have to rerun all the
  19888. 10:07:46steps
  19889. 10:07:47in order to get the data.
  19890. 10:07:49That's fine.
  19891. 10:07:50That is okay. That is okay, it happens.
  19892. 10:07:52I should definitely get better at
  19893. 10:07:53pinning data and
  19894. 10:07:55making sure the data is not we don't
  19895. 10:07:56have to rerun the whole thing.
  19896. 10:07:58And we can have previous steps pinned.
  19897. 10:08:00So, we can use it for the next steps.
  19898. 10:08:04And learning process here, so it's fine.
  19899. 10:08:06Okay, so now this is done. When this is
  19900. 10:08:08done, we have to pin this. Uh we'll be
  19901. 10:08:09able to access this variable right here,
  19902. 10:08:11I believe.
  19903. 10:08:13And then we can add everything to the
  19904. 10:08:14sheet. All right, cool. So, now it uh it
  19905. 10:08:16ran successfully. Let me pin this as
  19906. 10:08:18well.
  19907. 10:08:19And here,
  19908. 10:08:20uh at least one value has to be added.
  19909. 10:08:21Yeah, that's fine cuz we didn't add any
  19910. 10:08:22keywords. Uh here I should be able to
  19911. 10:08:24see the keyword. Perfect.
  19912. 10:08:26Original tweet, this is
  19913. 10:08:29the text, so full text.
  19914. 10:08:33Let me do something actually cuz I I
  19915. 10:08:34keep having to be looking at this. Let
  19916. 10:08:35me just put a set
  19917. 10:08:39a set variables node. Like I'll show you
  19918. 10:08:41exactly what it is, but um let's do
  19919. 10:08:43keyword.
  19920. 10:08:45It just makes it so I don't have to go
  19921. 10:08:46back to here and and find everything.
  19922. 10:08:48But if I put keyword here
  19923. 10:08:50and I put uh
  19924. 10:08:51get data set items,
  19925. 10:08:53I put text. This is like the tweet.
  19926. 10:08:56Original tweet.
  19927. 10:08:59And this is re
  19928. 10:09:01written tweet.
  19929. 10:09:04I can go to Claude
  19930. 10:09:07and get this.
  19931. 10:09:10Now
  19932. 10:09:11if I go here to
  19933. 10:09:13to Google
  19934. 10:09:15Sheets. Let me run this. Using the item
  19935. 10:09:17method does not work when pinned data in
  19936. 10:09:18this scenario. Please unpin get data set
  19937. 10:09:19items and try again. [music]
  19938. 10:09:21Okay.
  19939. 10:09:23So,
  19940. 10:09:24we're in a bad position again.
  19941. 10:09:26That's fine. Let me just do AI agents
  19942. 10:09:29and then I can change this later.
  19943. 10:09:31Let me just
  19944. 10:09:32start this.
  19945. 10:09:35Simple filter.
  19946. 10:09:38Okay, cool. Then this runs. Okay, I just
  19947. 10:09:40wanted the data here so I can I can just
  19948. 10:09:42send it here.
  19949. 10:09:43Okay, now you see how I don't have to go
  19950. 10:09:45back and forth in the form.
  19951. 10:09:48Find it here, find it here, find it
  19952. 10:09:49here. I already have it here. Keyword,
  19953. 10:09:51original tweet,
  19954. 10:09:53and rewritten post or tweet. Okay, so
  19955. 10:09:55it's much easier for me to uh to
  19956. 10:09:57actually use it.
  19957. 10:09:59Now if I go here, I need to send this
  19958. 10:10:00back
  19959. 10:10:02to the keyword.
  19960. 10:10:05I don't know why I did I don't know why
  19961. 10:10:06I did that. There you go. It's here.
  19962. 10:10:09Keyword.
  19963. 10:10:10So, that's fine.
  19964. 10:10:11Because again, we're mapping it from
  19965. 10:10:13from the previous steps.
  19966. 10:10:15And lastly, I'm just going to run
  19967. 10:10:16everything from scratch
  19968. 10:10:18to see how everything works. And one
  19969. 10:10:20more thing we have to do is this right
  19970. 10:10:22here. When it finishes, we have to get
  19971. 10:10:24back
  19972. 10:10:26uh here
  19973. 10:10:28to make sure that we get the rest that
  19974. 10:10:30are finished. Because we have 100 uh
  19975. 10:10:32215, only 50 go through all this. We
  19976. 10:10:34want to go all the way back to get
  19977. 10:10:36another 50 until it finishes.
  19978. 10:10:38Let me unpin this.
  19979. 10:10:42Let me unpin this.
  19980. 10:10:43I'm just pressing P. I'm hovering over
  19981. 10:10:45it, pressing P.
  19982. 10:10:46Now we're going to start the whole thing
  19983. 10:10:47from scratch. Let me reload.
  19984. 10:10:51Let me get this whole thing good.
  19985. 10:10:52Let me execute workflow.
  19986. 10:10:55Let me do
  19987. 10:10:57MCP.
  19988. 10:11:00Mhm, yeah, I think I think it's fine. I
  19989. 10:11:01think it's pretty it's a pretty hot
  19990. 10:11:03topic right now. So, submit.
  19991. 10:11:05We can go here. So, now it's running the
  19992. 10:11:06actors. If I go to Apify,
  19993. 10:11:09I can go to running and I can see here
  19994. 10:11:11that is running, which is great to see.
  19995. 10:11:14I guess most most of the times when
  19996. 10:11:15you're building automations, things
  19997. 10:11:16don't go your way and things don't work,
  19998. 10:11:18but it's about figuring it out. That
  19999. 10:11:19that's how you really become the system
  20000. 10:11:21architect. Uh when things don't go your
  20001. 10:11:23way, you just build, you iterate, you
  20002. 10:11:25just get better. And now we can see all
  20003. 10:11:26of this is running, which is great.
  20004. 10:11:28Um how many workers did I get? Okay,
  20005. 10:11:30we've got 97 so far. All right, now it
  20006. 10:11:32went to get the data set items.
  20007. 10:11:34It then sent it to the first AI step to
  20008. 10:11:35check the relevance of the agent. Then
  20009. 10:11:37again, as you can see here, only 50 went
  20010. 10:11:39through. And also, if you're asking what
  20011. 10:11:41done is, this just means once everything
  20012. 10:11:43is looped and everything's fine, what is
  20013. 10:11:45the thing [music] we do? In this case,
  20014. 10:11:46if you leave it blank, nothing will
  20015. 10:11:47happen. Uh but you can maybe send an
  20016. 10:11:48email to yourself saying, "Hey, uh we
  20017. 10:11:50just finished looping through all the
  20018. 10:11:51items." In this case, we don't it's not
  20019. 10:11:53really necessary, so we don't have to do
  20020. 10:11:54it. All right, so it's good. Out of 50,
  20021. 10:11:56only 27 went through. Now we're using
  20022. 10:11:58Claude to rewrite the posts, which will
  20023. 10:12:00take about 40 seconds uh before we add
  20024. 10:12:02everything to the sheet. All right, so
  20025. 10:12:03now it's finished and now it's going to
  20026. 10:12:04the Google Sheet.
  20027. 10:12:06Now it's going back to get the other 50.
  20028. 10:12:08So, I can see here that I mean it is a
  20029. 10:12:10bit messed up. So, if I go here and I
  20030. 10:12:12actually format it,
  20031. 10:12:13I can see that now the keyword is MCP.
  20032. 10:12:15This is the original tweets. This is the
  20033. 10:12:17rewritten tweets.
  20034. 10:12:19Now I can use this for whatever it is I
  20035. 10:12:20have to use.
  20036. 10:12:22All right, which I have a stream of
  20037. 10:12:23content ideas just come through based on
  20038. 10:12:24a topic tweets based on that topic in uh
  20039. 10:12:26in Twitter that I can use.
  20040. 10:12:31Hey, I'm about to show you an AI system
  20041. 10:12:32that I built that scripts YouTube
  20042. 10:12:34comments from any video and turns them
  20043. 10:12:35into fresh, high-converting video ideas.
  20044. 10:12:38Pulls in real feedback from your
  20045. 10:12:39audience or even your competitors so you
  20046. 10:12:40can see exactly what people want, what
  20047. 10:12:42they're confused by, and what they're
  20048. 10:12:44asking for next. All right, so this
  20049. 10:12:45right here is a full end-to-end
  20050. 10:12:46automation that I built. Uh and by the
  20051. 10:12:48way, if you want the free resource, the
  20052. 10:12:49whole template that you can download for
  20053. 10:12:51your account, all you have to do is go
  20054. 10:12:52to my free school community, go to
  20055. 10:12:54classroom, go to tap it's vault, and
  20056. 10:12:55right here you'll see the latest video
  20057. 10:12:57that I posted with the resource that you
  20058. 10:12:59can download. And if you're unsure as to
  20059. 10:13:01how to import it onto your account,
  20060. 10:13:03there's also a tutorial right here that
  20061. 10:13:04I made, which is import blueprint to
  20062. 10:13:06N8N.
  20063. 10:13:07All right, with that being said,
  20064. 10:13:09let's dive in. So, the automation itself
  20065. 10:13:11is is a workflow. So, this is not an AI
  20066. 10:13:13agent and there's a very specific reason
  20067. 10:13:14for that and we'll talk about that in
  20068. 10:13:16just a second. But it's separated into
  20069. 10:13:17six different steps. The first step is
  20070. 10:13:19list of YouTube channels. So, we have a
  20071. 10:13:20list of YouTube channels in the a
  20072. 10:13:22channel ID. So, we have a channel ID
  20073. 10:13:23from each channel. From each channel, we
  20074. 10:13:26took the 15 posts that are most recent
  20075. 10:13:29from the feed. We script comments from
  20076. 10:13:31those posts, the most recent ones. Then
  20077. 10:13:33we check with AI if it's relevant to
  20078. 10:13:35what we do and who we help and who we
  20079. 10:13:37serve. Uh if it's relevant, it makes a
  20080. 10:13:39title for that idea or comment, a
  20081. 10:13:42YouTube channel, a video idea that could
  20082. 10:13:43happen based on that comment. Then
  20083. 10:13:46based on if it's relevant, we also
  20084. 10:13:49generated hook and outline and we store
  20085. 10:13:50everything in Notion, which is where we
  20086. 10:13:52store everything for YouTube ideas and
  20087. 10:13:53so on that you can then use to actually
  20088. 10:13:55draft it and post it and so on. All
  20089. 10:13:57right, cool. So, the way it's going to
  20090. 10:13:58work, I'm going to run this. Um so,
  20091. 10:14:00typically you would have this running
  20092. 10:14:01every month, but I'm going to add a
  20093. 10:14:02manual trigger.
  20094. 10:14:04So, I'm going to go here.
  20095. 10:14:06Otherwise, trigger manually, right here.
  20096. 10:14:08Connect it.
  20097. 10:14:10So, I want to see I want to show you
  20098. 10:14:11exactly how it works and how it looks
  20099. 10:14:13and everything around it and then we can
  20100. 10:14:14go into step by step how it actually uh
  20101. 10:14:16works and all the settings and stuff.
  20102. 10:14:18All right, so I'm going to execute
  20103. 10:14:19workflow, which starts the workflow from
  20104. 10:14:20the start.
  20105. 10:14:21It ran over here. We script the YouTube
  20106. 10:14:23channels. Now it's using Apify, which is
  20107. 10:14:25an external software to be able to
  20108. 10:14:27scrape. Scrape just means extract
  20109. 10:14:29comments from these videos.
  20110. 10:14:31It is going to take a while just because
  20111. 10:14:33it's 14 items, so it's 14 uh videos that
  20112. 10:14:35it has to scrape, right, for each each
  20113. 10:14:38time. As you can see right here, the
  20114. 10:14:40actor is running. So, the automation's
  20115. 10:14:42running. So, we have to wait it until we
  20116. 10:14:43get the actual uh result back from here.
  20117. 10:14:46Okay, then once it's done, which took
  20118. 10:14:47about a minute or two, uh it goes to the
  20119. 10:14:49wait because we're waiting until we get
  20120. 10:14:51the results back from Apify, and I'll
  20121. 10:14:52explain exactly what that means.
  20122. 10:14:54And then once we get the actual items
  20123. 10:14:56and the results, we only In this case,
  20124. 10:14:58we have 505 comments. These 505 comments
  20125. 10:15:01will go to the first agent. So, in this
  20126. 10:15:02case, it's an AI step. It's not really
  20127. 10:15:04an agent that checks whether it's
  20128. 10:15:05relevant. If it's relevant, it makes the
  20129. 10:15:07title for our video.
  20130. 10:15:09And then send it through here to be able
  20131. 10:15:11to then make the hook and the outline,
  20132. 10:15:13right? Uh in this case, we're only
  20133. 10:15:14passing 50 items at the time, which is
  20134. 10:15:17why we're using loop over items, which
  20135. 10:15:18means that out of 500 it doesn't send
  20136. 10:15:20all 500 at the same time. It sends 50,
  20137. 10:15:23right? And then we do 50 again and 50
  20138. 10:15:24again until it's done, right? Um to make
  20139. 10:15:26sure that we don't we don't time out, we
  20140. 10:15:28don't get we don't exceed exceed the
  20141. 10:15:30token limit, which is something that
  20142. 10:15:32happens with AI when you add way too
  20143. 10:15:34much text way too much information.
  20144. 10:15:36Okay, now that is done, it only passes
  20145. 10:15:38through the ones that are valid. In this
  20146. 10:15:39case, it's only seven. So, from those
  20147. 10:15:41seven, we generate the hook and the
  20148. 10:15:42outline to then send it to Notion, which
  20149. 10:15:45is where we add we store everything
  20150. 10:15:47right here. As you can see, the topics
  20151. 10:15:49are being added right now.
  20152. 10:15:50We have the content idea, we have the
  20153. 10:15:52hook, and we have the outline, right?
  20154. 10:15:54So, let's take an example. So, we have
  20155. 10:15:56how to automate meta ads inside and
  20156. 10:15:57manage unlimited videos. Then here,
  20157. 10:16:00I have the hook. So, based on this idea,
  20158. 10:16:02we have
  20159. 10:16:03I've helped over 40 businesses automate
  20160. 10:16:05their AI and workflows. Uh today, I'm
  20161. 10:16:06going to show you how to automate meta
  20162. 10:16:07ads inside and manage So, this is a very
  20163. 10:16:09simple hook. It follows a very specific
  20164. 10:16:10framework that I use, uh which is
  20165. 10:16:12credibility and then talking about what
  20166. 10:16:14we're doing. And then we also have the
  20167. 10:16:15outline right here, which is basically
  20168. 10:16:16giving you a structured outline for the
  20169. 10:16:18video that you can make uh from 1 to 8,
  20170. 10:16:21which is great because when we're
  20171. 10:16:22filming YouTube videos, it's Sometimes
  20172. 10:16:24it's hard uh to think through an outline
  20173. 10:16:26or you take some time to think through
  20174. 10:16:27how you can position the video, how you
  20175. 10:16:29can talk about from step by step um
  20176. 10:16:32instead of just going on the camera and
  20177. 10:16:33just just speaking out of nothing,
  20178. 10:16:35right? Um so, that's exactly what we're
  20179. 10:16:36doing the outline as well.
  20180. 10:16:37And now what it's doing is that it's
  20181. 10:16:38going back here.
  20182. 10:16:41It's then doing the whole process again
  20183. 10:16:44until all the 505 comments are being
  20184. 10:16:46passed through.
  20185. 10:16:48Okay, in this case, only 100 went
  20186. 10:16:49through.
  20187. 10:16:50And
  20188. 10:16:51as you can see, more and more being
  20189. 10:16:52added to Notion. More and more comments.
  20190. 10:16:54So, you just have a stream of video
  20191. 10:16:56ideas that you can use for your channel,
  20192. 10:16:58uh which is awesome, especially for I'm
  20193. 10:17:00in YouTube game, so I'm I always did
  20194. 10:17:02YouTube, and that's what I that's what I
  20195. 10:17:03do right now. Um so, this is awesome.
  20196. 10:17:06I'm using this myself to be able to
  20197. 10:17:08>> [music]
  20198. 10:17:08>> just figure out what people want, what
  20199. 10:17:09people don't want. I feel like you don't
  20200. 10:17:10really run out of ideas in the AI space,
  20201. 10:17:13but it's still good to know what people
  20202. 10:17:14want, what people are struggling with,
  20203. 10:17:16um the sort of problems that they want
  20204. 10:17:17solved, the sort of videos that you can
  20205. 10:17:18make based on feedback from other videos
  20206. 10:17:21other comments that they put on videos,
  20207. 10:17:22right? Which is such an underrated
  20208. 10:17:24strategy. So,
  20209. 10:17:26as you can see, now I have a list of
  20210. 10:17:27topics. And again, this is running until
  20211. 10:17:29it's finished until all the 500 items
  20212. 10:17:31are finished. So, I'm just going to skip
  20213. 10:17:32to the part where it's done.
  20214. 10:17:34So, because it will take about 5 to 10
  20215. 10:17:35minutes, I'm going to stop the
  20216. 10:17:36automation.
  20217. 10:17:39So, it'll take too long. Uh but as you
  20218. 10:17:40can see, now what it will do literally
  20219. 10:17:42was
  20220. 10:17:43based on this one channel, so only one
  20221. 10:17:45channel went through. It took all the
  20222. 10:17:46videos, it scraped all the comments from
  20223. 10:17:47those videos, it sent it through here to
  20224. 10:17:49check the relevance. If it was relevant
  20225. 10:17:52to us, what we want and what we do and
  20226. 10:17:53who we serve, then it made the hook and
  20227. 10:17:55the outline. Then it sent it to our
  20228. 10:17:56database, and then it goes back here
  20229. 10:17:58to get through all the comments. And
  20230. 10:18:00then once that comment is done, at least
  20231. 10:18:02all these comments are done, then it
  20232. 10:18:03goes back and does the second channel
  20233. 10:18:05and the third channel or how many
  20234. 10:18:06channels you put. So, it's a whole
  20235. 10:18:07repetitive loop that you don't have to
  20236. 10:18:09really do nothing apart from adding the
  20237. 10:18:11channels there. And you can run this
  20238. 10:18:12every month, and this just runs
  20239. 10:18:14automatically. Um and you just have the
  20240. 10:18:16content ideas that just have here with
  20241. 10:18:17the hook and with the outline. You can
  20242. 10:18:19then obviously review, approve, or or
  20243. 10:18:22reject, right? Whatever you want. Uh
  20244. 10:18:24okay, cool. So, I'm going to save this.
  20245. 10:18:27I'm going to refresh. Um
  20246. 10:18:29We can go through step by step how I
  20247. 10:18:30actually build this. This is I would say
  20248. 10:18:32one of the more complex automations, but
  20249. 10:18:34it actually is very simple once you
  20250. 10:18:35break it down step by step and go
  20251. 10:18:37through the logic of what you have to do
  20252. 10:18:39when you're building. So, again, the
  20253. 10:18:41first step would typically be
  20254. 10:18:43uh on on time trigger. Typically, every
  20255. 10:18:45single month because you're only
  20256. 10:18:46scraping 15 videos, and 15 videos is
  20257. 10:18:48typically what someone uploads every
  20258. 10:18:49month if they're on it, right? Um which
  20259. 10:18:52a lot of YouTubers are, which is great.
  20260. 10:18:54So, we get to pull comments from their
  20261. 10:18:55videos or even our videos, right? This
  20262. 10:18:57can work for our videos or their videos.
  20263. 10:18:58So, on time trigger would be the first
  20264. 10:19:00thing. So, we would have
  20265. 10:19:02with this ready
  20266. 10:19:04on a schedule. So, the schedule would be
  20267. 10:19:06once a month.
  20268. 10:19:07And then the the first step here is to
  20269. 10:19:10like the logic here is to have a list of
  20270. 10:19:12YouTube channels that you can then run
  20271. 10:19:14through each one and then go through go
  20272. 10:19:16through the whole flow, right? Um so,
  20273. 10:19:18this node right here is for us to
  20274. 10:19:20actually set the channels. So, when you
  20275. 10:19:22want to set the channels,
  20276. 10:19:24um you don't necessarily you don't have
  20277. 10:19:26the you don't have to put the link to
  20278. 10:19:27the channel. You add the channel ID,
  20279. 10:19:29right? Which is what we're adding here.
  20280. 10:19:30I'll explain exactly what this is, um
  20281. 10:19:32what an array is and all that sort of
  20282. 10:19:33stuff. But when you go to YouTube,
  20283. 10:19:35let's say I go to Alex Hormozi, right?
  20284. 10:19:37Alex Hormozi right here on the URL,
  20285. 10:19:40he has subscriptions and he has this
  20286. 10:19:41long code.
  20287. 10:19:42So, I can if I just pull everything in,
  20288. 10:19:44I'll go to Miro so I can show you
  20289. 10:19:45exactly where the ID comes from.
  20290. 10:19:48Okay, the ID
  20291. 10:19:50So, we have the fixed part, which is
  20292. 10:19:52where this one.
  20293. 10:19:53And then we have the ID, which is this.
  20294. 10:19:56So, we would need the ID for each
  20295. 10:19:58channel to be able to actually scrape
  20296. 10:20:00the channel, okay? So, when you go to
  20297. 10:20:02the YouTube um and you want to use a
  20298. 10:20:04channel for this, in this case, you
  20299. 10:20:05would just copy this. I mean, copy only
  20300. 10:20:08this part, right? Which is the ID of the
  20301. 10:20:10channel. And then you would add it here.
  20302. 10:20:12So, the channel ID. [snorts] Now, the
  20303. 10:20:13reason why we are And these are three
  20304. 10:20:15different channel IDs of different
  20305. 10:20:16competitors that I have in the space.
  20306. 10:20:18And the reason why [snorts] I have this
  20307. 10:20:20as an array is because
  20308. 10:20:22when you want to run
  20309. 10:20:23three different things at three
  20310. 10:20:25different times, you need it to be in an
  20311. 10:20:27array and then split it out.
  20312. 10:20:29Split it out just means that it takes an
  20313. 10:20:30array, which is a list of different
  20314. 10:20:32items inside like here, for example, let
  20315. 10:20:34me show you.
  20316. 10:20:36It will give you three different things.
  20317. 10:20:37So, schema, channel ID zero, channel ID
  20318. 10:20:39one, channel ID two. And then take each
  20319. 10:20:41one individually and start running the
  20320. 10:20:43automation. It will split it out, start
  20321. 10:20:45running the automation individually,
  20322. 10:20:47right? It will go through the first one,
  20323. 10:20:48then it will go back, second one, go
  20324. 10:20:50back, third one, right? Um so,
  20325. 10:20:52again, we have this, which is channel
  20326. 10:20:54IDs, which is I just added channel IDs
  20327. 10:20:55of my competitors that I can go through
  20328. 10:20:57every single time. If I wanted to add or
  20329. 10:20:58remove, I can just simply remove this or
  20330. 10:21:01add, right? In this case, if I wanted to
  20331. 10:21:02add Alex Hormozi, all I have to do is go
  20332. 10:21:05here, bracket, channel
  20333. 10:21:09ID,
  20334. 10:21:10and then with the small L.
  20335. 10:21:14And then you add the the code.
  20336. 10:21:17And now this is pretty much set. Now,
  20337. 10:21:19these right here are called key value
  20338. 10:21:20pairs. This is a key, and this is a
  20339. 10:21:22value.
  20340. 10:21:23Okay, the key is channel ID, which is
  20341. 10:21:25the same for each one. And the value is
  20342. 10:21:27what is the actual thing. Yeah, you need
  20343. 10:21:29a space. There you go. Okay, cool. So,
  20344. 10:21:31that's how you do it. Um and this is
  20345. 10:21:33JSON. So, the JSON has an array, and
  20346. 10:21:35that's sort of the the technical part to
  20347. 10:21:37this. But if you just had an array, you
  20348. 10:21:39have three different things, you can
  20349. 10:21:40then split it up. So, the next thing,
  20350. 10:21:42again, is splitting it out. So, we have
  20351. 10:21:43the array. The array itself, it doesn't
  20352. 10:21:45run through each one individually. It
  20353. 10:21:47doesn't run through them cuz the array
  20354. 10:21:48only has
  20355. 10:21:50one thing, which is channel IDs. In this
  20356. 10:21:51case, we want one, two, and three,
  20357. 10:21:53right? If I go here, execute step. Now,
  20358. 10:21:55we can see that we have three items. So,
  20359. 10:21:57on the table, you can see that we go
  20360. 10:21:59through the first one, then we go
  20361. 10:22:00through the second one, and then we go
  20362. 10:22:01through the third one. Okay, so now
  20363. 10:22:02we're able to actually run the
  20364. 10:22:04automation one, first, second, and then
  20365. 10:22:06third, okay? So, what are we doing here?
  20366. 10:22:09The settings here are basically channel
  20367. 10:22:11ID because that's the variable that
  20368. 10:22:12we're using. In this case, channel ID,
  20369. 10:22:14which is the one here. Channel ID,
  20370. 10:22:15channel ID. It's all the same, right?
  20371. 10:22:16Which is why we're able to split it out.
  20372. 10:22:18Include no other fields. We just want
  20373. 10:22:19this, which is where we take these and
  20374. 10:22:23then take one individually, run it,
  20375. 10:22:24second individually, run it, and third
  20376. 10:22:26individually, run it. Okay, so that's
  20377. 10:22:27what we do. Now, the reason why we're
  20378. 10:22:29using this loop items is because
  20379. 10:22:31um n8n natively runs three of them at
  20380. 10:22:33the same time, right? Not obviously in
  20381. 10:22:35three different things, but it runs
  20382. 10:22:37three of them at the same time. We don't
  20383. 10:22:38want that. We we want to run each one
  20384. 10:22:41individually. So, to be able to only run
  20385. 10:22:44one at a time,
  20386. 10:22:45we have to use loop over items so that
  20387. 10:22:47we can run this. And then at the end,
  20388. 10:22:50when it does everything, it goes back.
  20389. 10:22:51So, that's what this is. It goes back to
  20390. 10:22:53here and it runs the second one. So,
  20391. 10:22:55when we add batch size, which means how
  20392. 10:22:57many items do you want to let through?
  20393. 10:22:59In this case, it would just be one. We
  20394. 10:23:01have three, you can see here, three
  20395. 10:23:02items, but we just want one, which is
  20396. 10:23:04why we put one here.
  20397. 10:23:05Uh once we do this, we can then
  20398. 10:23:09add a field. So, this In this case, we
  20399. 10:23:10just have the channel ID. This is not
  20400. 10:23:11necessary, but I just wanted to extract
  20401. 10:23:13the channel ID so I can so I can have
  20402. 10:23:15it. Um let me execute the node right
  20403. 10:23:17here. And now I can just drag this
  20404. 10:23:19across and put it here. So, I have the
  20405. 10:23:21channel ID to then feed in to the next
  20406. 10:23:22step, which is where we actually scrape
  20407. 10:23:24the videos.
  20408. 10:23:25Um but this is something that's not
  20409. 10:23:26necessary. You can just simply add this
  20410. 10:23:28to the next step. I just wanted to have
  20411. 10:23:29something that's more clean. So, channel
  20412. 10:23:31ID right here, which is just mapping
  20413. 10:23:34field.
  20414. 10:23:35And now we go to the list of top 15
  20415. 10:23:38videos that we have to scrape. Now, in
  20416. 10:23:39order for us to scrape something, we
  20417. 10:23:41typically we use Apify. So, let me go
  20418. 10:23:43here, Apify, which is basically a
  20419. 10:23:45platform where people make their own
  20420. 10:23:46scrapers. So, they code scrapers. They
  20421. 10:23:47do the hard part, we do the easy part,
  20422. 10:23:49which is just using it, right? And the
  20423. 10:23:50good thing about Apify is that we um
  20424. 10:23:55it's actually free. So, not necessarily
  20425. 10:23:57free because we still have to pay, but
  20426. 10:23:59if I go here to the one that I actually
  20427. 10:24:00used before, and I'll explain exactly
  20428. 10:24:01what this is,
  20429. 10:24:02we can see that for this scraper to
  20430. 10:24:04scrape a thousand results, which in this
  20431. 10:24:05case is a thousand comments, we have to
  20432. 10:24:07pay 40 cents.
  20433. 10:24:09Okay? And we're basically scraping about
  20434. 10:24:1120 comments 20 30 comments per video. Um
  20435. 10:24:14so, we're paying nothing really. And we
  20436. 10:24:16have $5 for free
  20437. 10:24:18from Apify.
  20438. 10:24:19So, if you do the math there, you're
  20439. 10:24:20basically paying nothing. So, that's why
  20440. 10:24:22we use Apify here. But
  20441. 10:24:24for the YouTube videos, we also can use
  20442. 10:24:26something called an RSS feed. Now, the
  20443. 10:24:28RSS feed is basically a way for you to
  20444. 10:24:30tell the web, like, "Hey,
  20445. 10:24:32using this URL, go out and scrape go out
  20446. 10:24:34and find um the YouTube videos that we
  20447. 10:24:36can use." Now, in order for us to set up
  20448. 10:24:38the RSS feed, we can go here,
  20449. 10:24:40RSS feed,
  20450. 10:24:42and then we go to this page right here.
  20451. 10:24:43And then we have to add our URL. So, the
  20452. 10:24:45URL is something that is fixed. The only
  20453. 10:24:47thing that changes is the channel ID.
  20454. 10:24:50So, we go through here. Within channel
  20455. 10:24:52ID one, we scrape all the videos.
  20456. 10:24:53Channel ID two, scrape all the videos.
  20457. 10:24:55Channel ID three, until we finish all
  20458. 10:24:56the videos, right? Now, how do we know
  20459. 10:24:58this URL? How does this happen? Well, if
  20460. 10:25:00I just go to Google and search up um RSS
  20461. 10:25:04feed YouTube channels, I can see that if
  20462. 10:25:07I I usually go to Reddit or you can see
  20463. 10:25:09here as well that you can use this. So,
  20464. 10:25:11https www.youtube.com. So, this is just
  20465. 10:25:14a format
  20466. 10:25:16for the YouTube videos. If I go here, I
  20467. 10:25:17can see that this follows a very
  20468. 10:25:19specific format. It follows the https
  20469. 10:25:21www.youtube.com feeds subscriptions and
  20470. 10:25:23then the code, right? In this case, it
  20471. 10:25:24would be this. Uh it wouldn't be
  20472. 10:25:27subscriptions. Yeah, it would be feed.
  20473. 10:25:28So, you go here, you copy this. You
  20474. 10:25:30would paste it here.
  20475. 10:25:33Right? And then the only thing you have
  20476. 10:25:34to change is this part right here.
  20477. 10:25:36Channel ID here.
  20478. 10:25:38Which is where we pull in the variable
  20479. 10:25:40from the previous step to here.
  20480. 10:25:41That's exactly what I did. So, in this
  20481. 10:25:43case, if we execute the step, we can see
  20482. 10:25:47that now
  20483. 10:25:48we
  20484. 10:25:49Uh I think this is next arrived. Yeah,
  20485. 10:25:50next arrived. We um we scraped the
  20486. 10:25:53videos from next arrived and we have 15
  20487. 10:25:55of them. So, 15 items means that we have
  20488. 10:25:5615 videos. And this only scripts the top
  20489. 10:25:5815 videos. If you want to script more,
  20490. 10:26:00you could use Apify um to scrape a list
  20491. 10:26:02of 100, but I feel like for the most
  20492. 10:26:04recent ones are good because they are
  20493. 10:26:06the most recent ones, so they're on top
  20494. 10:26:07of they're on top of like the the most
  20495. 10:26:09recent one, which is great to scrape. Uh
  20496. 10:26:11which is exactly what we want. So, here
  20497. 10:26:14you can see the 15 videos, right? Why
  20498. 10:26:16automation beginners should start this
  20499. 10:26:17platform and all this sort of stuff. So,
  20500. 10:26:19that's what we want to see and that's
  20501. 10:26:20what this does essentially. And if you
  20502. 10:26:21change the channel ID, you change the
  20503. 10:26:23videos that you're scraping.
  20504. 10:26:24So, it's very very easy. And you can see
  20505. 10:26:26we just ask Google and they give us the
  20506. 10:26:28URL. Okay? If I go here, then what we
  20507. 10:26:31want to do is this is comes from
  20508. 10:26:34testing. A lot of the videos that people
  20509. 10:26:35post, not a lot of them, but some of
  20510. 10:26:37them are shorts. They're not long form
  20511. 10:26:38videos. So, we want to be able to filter
  20512. 10:26:41based on whether it's a long form video
  20513. 10:26:42or short form video. So, if I go here, I
  20514. 10:26:44can see that the link, so the link right
  20515. 10:26:47here, yeah, the link right here.
  20516. 10:26:49If it's a short, it will say it's a
  20517. 10:26:51short. It will add the word the name of
  20518. 10:26:53shorts here. Okay? And that's what tell
  20519. 10:26:55us that it is a short. Now, you can't
  20520. 10:26:57see here because this is a long form
  20521. 10:26:58video, but if it was a short,
  20522. 10:27:01I think it would say https
  20523. 10:27:02www.youtube.com watch I think shorts
  20524. 10:27:03something. Uh and that tell us that it
  20525. 10:27:06is a short. Okay? You can't see here
  20526. 10:27:07just because this is a long form video,
  20527. 10:27:09but bear in mind that we're just saying,
  20528. 10:27:10"Hey, don't let any shorts through. I
  20529. 10:27:13just want long form videos because
  20530. 10:27:14they're more validated like that's what
  20531. 10:27:15they're actually posting." And usually
  20532. 10:27:17shorts are just a way for people to
  20533. 10:27:19repurpose their long form videos and
  20534. 10:27:20then bring them to
  20535. 10:27:22uh which is exactly what we do, right?
  20536. 10:27:24So, okay. So, JSON link, we're saying,
  20537. 10:27:25"Hey, let me drag this across. If the
  20538. 10:27:27JSON link does not contain shorts, then
  20539. 10:27:30send it through." Okay, so there are
  20540. 10:27:31cases. Let me go here.
  20541. 10:27:33So, see how 14 items went through? It's
  20542. 10:27:36because Let me go here and show you. I
  20543. 10:27:38think there there has to be a short here
  20544. 10:27:39because only 14 went through. There we
  20545. 10:27:41go.
  20546. 10:27:43So, you see how on this URL why uh why
  20547. 10:27:45saturation doesn't matter? This is a
  20548. 10:27:47short. And if I go here,
  20549. 10:27:50I can see
  20550. 10:27:50>> Just cuz something. This is a short from
  20551. 10:27:52next arrived.
  20552. 10:27:53Right? And this
  20553. 10:27:55comparison is a long form video.
  20554. 10:27:59So, we basically don't want any shorts.
  20555. 10:28:01We want the long form videos. So, and
  20556. 10:28:03the only thing difference between each
  20557. 10:28:04one is that the short contains shorts
  20558. 10:28:06here.
  20559. 10:28:07All right. So, the filter's done. And
  20560. 10:28:09then we go through the Apify. So, third
  20561. 10:28:12step is scrape 100 comments from the
  20562. 10:28:13videos. So, if you go to Apify
  20563. 10:28:16and you go to actors. So, again, Apify
  20564. 10:28:18is a way for us to be able to scrape
  20565. 10:28:20Scrape just means extract different
  20566. 10:28:22information from the web um for the
  20567. 10:28:24YouTube videos that we're that we're
  20568. 10:28:25talking about. We want to scrape the
  20569. 10:28:27comments. So, typically what I would do
  20570. 10:28:29is you would go to actors or Apify
  20571. 10:28:32store, sorry. And you can search for
  20572. 10:28:33actors. Actors, again, are just
  20573. 10:28:35different pieces of code, different
  20574. 10:28:37different scrapers that you can use to
  20575. 10:28:39scrape whatever you want. So, if I added
  20576. 10:28:41YouTube comments
  20577. 10:28:44scraper,
  20578. 10:28:46what I would do first is I would look at
  20579. 10:28:48payment method because I typically want
  20580. 10:28:50the pay on results or pay per output,
  20581. 10:28:53right? Like 40 cents per 1,000 comments
  20582. 10:28:55because then I don't have to pay. Some
  20583. 10:28:56of them make you have to get a
  20584. 10:28:58subscription for Apify, which is the
  20585. 10:29:00ones that we don't want. But let's say I
  20586. 10:29:01go here.
  20587. 10:29:03This is two uh $2.40 for 1,000 comments.
  20588. 10:29:06This is Yeah, this right here is $20 per
  20589. 10:29:09month plus usage. So, we would typically
  20590. 10:29:11have to pay for the scraper, so we don't
  20591. 10:29:12want this.
  20592. 10:29:13Uh 50 cents per 1,000 scrapers, that's
  20593. 10:29:15fine.
  20594. 10:29:17And then 25 a month, so we definitely
  20595. 10:29:18don't want this. I found a scraper. What
  20596. 10:29:21was this?
  20597. 10:29:22YouTube comment scraper. So, grow social
  20598. 10:29:24grow social media YouTube comment
  20599. 10:29:26scraper. So, if I go here, I'm searching
  20600. 10:29:27it up.
  20601. 10:29:30Yeah, there we go.
  20602. 10:29:32I found one that's 40 cents per 1,000
  20603. 10:29:34results. Okay? So, this is right You
  20604. 10:29:35just have to copy this. You can copy
  20605. 10:29:37grow media YouTube comment scraper and
  20606. 10:29:38you'll find this. This is the cheapest
  20607. 10:29:39that I found
  20608. 10:29:41and gives you the best results, right?
  20609. 10:29:42And the thing that we can add to this uh
  20610. 10:29:45that we can actually the the fields,
  20611. 10:29:47right, itself are the YouTube video URL
  20612. 10:29:49and the maximum comments. So, what's the
  20613. 10:29:51video and how many comments you want to
  20614. 10:29:52scrape? So, if I go to Apify, if I go
  20615. 10:29:54here, back to NNN, I can add a run an
  20616. 10:29:57actor. So, run an actor just means we're
  20617. 10:29:58giving you the the actual video. Go out
  20618. 10:30:01and scrape, right? So, we scrape it.
  20619. 10:30:04And then, so let's say I go to execute
  20620. 10:30:06step.
  20621. 10:30:07What this will do is it will take the
  20622. 10:30:08URL from here. It will give it
  20623. 10:30:11the JSON link and it'll tell you, "Hey,
  20624. 10:30:13maximum comments is 100."
  20625. 10:30:15So, if I go here to runs,
  20626. 10:30:17now you can see that it's running. And
  20627. 10:30:19we got 45 comments so far.
  20628. 10:30:21And these are all the comments, right?
  20629. 10:30:22We can have a lot of comments from these
  20630. 10:30:23videos, which is exactly what we want
  20631. 10:30:25when we are scraping videos. And that's
  20632. 10:30:27exactly what we have with Apify. Now, to
  20633. 10:30:29connect your Apify account, you just
  20634. 10:30:30have to go here, create a new
  20635. 10:30:31credential, and then you need an API
  20636. 10:30:33key. The API key you can find, I believe
  20637. 10:30:36it's settings, API integrations and then
  20638. 10:30:39you can have Yeah, this right here.
  20639. 10:30:41Default API token, yeah. You can copy
  20640. 10:30:43this and then you can paste it to right
  20641. 10:30:46here and you can save it and you have
  20642. 10:30:47the connection. And then you have to
  20643. 10:30:49choose the actor. By the way, you have
  20644. 10:30:51to save the actor first. So, if I go to
  20645. 10:30:53actors,
  20646. 10:30:54uh YouTube comment scraper, you have to
  20647. 10:30:55save it. So, save here or start it at
  20648. 10:30:58least and make a test run to be able to
  20649. 10:31:00see it here.
  20650. 10:31:01That's one of the the things that I
  20651. 10:31:02struggled with at the start. You want to
  20652. 10:31:03run an actor, that's the action.
  20653. 10:31:05Recently used actors, that's fine.
  20654. 10:31:06Actors here. And then the input JSON is
  20655. 10:31:08what we get from here.
  20656. 10:31:10Which is basically saying, "Hey, what's
  20657. 10:31:11that thing that's going into the actor?"
  20658. 10:31:14So, we put this and now we're waiting
  20659. 10:31:15for the feedback or for the actual
  20660. 10:31:17output. So, if I go here to runs,
  20661. 10:31:19I can see that this is still running. Um
  20662. 10:31:22I believe we got it back.
  20663. 10:31:24Or I think Okay, I think it's going
  20664. 10:31:25through all the 14 items. Okay, I know
  20665. 10:31:27why.
  20666. 10:31:28Let me just stop this.
  20667. 10:31:30This will still keep on running. The
  20668. 10:31:31reason why it kept on running is because
  20669. 10:31:33we go through the 14 items and it's
  20670. 10:31:34going through all the 14 videos, which
  20671. 10:31:35is why it's it takes quite a bit. Uh it
  20672. 10:31:37takes like two one to two minutes or two
  20673. 10:31:39to three minutes based on um yeah, the
  20674. 10:31:41type of video it is. Um okay. So, once
  20675. 10:31:44we have that,
  20676. 10:31:45we can add a wait because of the fact
  20677. 10:31:47that here the output, yeah, it isn't the
  20678. 10:31:49actual comments. We get a database uh
  20679. 10:31:52data set ID. So, if I go here to save
  20680. 10:31:54executions, I can see the previous one
  20681. 10:31:55that I had. Okay, I went to one that I
  20682. 10:31:57would that I did yesterday. If I go
  20683. 10:31:58here, copy to editor, I can see that
  20684. 10:32:01this one it ran, it gave it to Apify.
  20685. 10:32:04And as you can see here, we don't get
  20686. 10:32:05the actual comments. So, we don't get
  20687. 10:32:07the comments anywhere here. There's a
  20688. 10:32:08bunch of stuff. What we need is this.
  20689. 10:32:11What we need is default data set ID. So,
  20690. 10:32:13default data set ID is a thing that we
  20691. 10:32:15then feed into the next node, which is
  20692. 10:32:17get data set items.
  20693. 10:32:19Which needs the default data set ID. So,
  20694. 10:32:21what we do here is we go to
  20695. 10:32:24the run an actor. We then look for
  20696. 10:32:26default data set ID, which is something
  20697. 10:32:28you have to do every single time with
  20698. 10:32:28Apify. It's just the way it works.
  20699. 10:32:31So, we drag it across and this is a
  20700. 10:32:32thing that is now going to use
  20701. 10:32:34to be able to get the results. And now
  20702. 10:32:36this is giving us the comment ID,
  20703. 10:32:37comment text, like count, replies, all
  20704. 10:32:39that sort of stuff, right? That we want.
  20705. 10:32:41Once we get the actual results, the way
  20706. 10:32:42we want to do now is because of the fact
  20707. 10:32:44that we get, let's say, 500 comments
  20708. 10:32:46like you saw before here, which is the
  20709. 10:32:48output of the actual get data set items.
  20710. 10:32:50We don't want to run through 500 items
  20711. 10:32:52all at once. We want to be able to batch
  20712. 10:32:54them. So, basically saying, just like
  20713. 10:32:56before, we don't want to run through all
  20714. 10:32:58the channels at once. We want to say,
  20715. 10:32:59"Hey, we have 500 comments, but I'm only
  20716. 10:33:01letting 50 through." And this is where
  20717. 10:33:03the relevance and title come in. Because
  20718. 10:33:04now we're using a loop item again, which
  20719. 10:33:06is where we're saying, "Hey,
  20720. 10:33:08I know we're getting all these comments,
  20721. 10:33:09but I only want to let 50 through." And
  20722. 10:33:10then you can run it back and get the
  20723. 10:33:11others that are left. And then do it all
  20724. 10:33:13and over and over again until the
  20725. 10:33:15comments are finished. So, loop items,
  20726. 10:33:18once this is done is we add it to an
  20727. 10:33:19agent. I mean, in this case it's not an
  20728. 10:33:21agent, it's an AI step.
  20729. 10:33:23To connect your OpenAI to NNN, you have
  20730. 10:33:26to create a new credential. API key, you
  20731. 10:33:27can find it at platform. the openai.com
  20732. 10:33:32under dashboard. API keys. Create a new
  20733. 10:33:35secret key, create it, and then you can
  20734. 10:33:36paste it right here. You can save it.
  20735. 10:33:40Now, once this is done, this will be
  20736. 10:33:41text message a model. Uh the model will
  20737. 10:33:42be 4.1 mini uh because I usually use a
  20738. 10:33:45mini because it doesn't it can take more
  20739. 10:33:47information, right?
  20740. 10:33:49And because right now we're giving it 50
  20741. 10:33:50comments
  20742. 10:33:51at once all at once in the AI, it will
  20743. 10:33:54take a while to process. Uh and the
  20744. 10:33:56prompt that we give it is first
  20745. 10:33:57assistant prompt, which is a prompt that
  20746. 10:33:59we give that we give the AI when we want
  20747. 10:34:01to say, "Hey, you are a helpful
  20748. 10:34:03intelligent whatever it is." In this
  20749. 10:34:04case is you are helpful intelligent
  20750. 10:34:06content writing assistant. So, we give
  20751. 10:34:07it an identity, so the AI thinks it is
  20752. 10:34:09that thing and it will the output will
  20753. 10:34:10be higher, the quality. And then the
  20754. 10:34:12user prompt will be "Below is a YouTube
  20755. 10:34:15comment for one of the videos. Your task
  20756. 10:34:17is to determine if the comment is
  20757. 10:34:19relevant and if it includes any
  20758. 10:34:20questions, inquiries, or suggestions
  20759. 10:34:21that we can use W
  20760. 10:34:24as an idea [snorts] for future video. We
  20761. 10:34:25Turn your output as JSON."
  20762. 10:34:27And then we can um add a few examples.
  20763. 10:34:32So, in this case, you would have a
  20764. 10:34:33system, a user prompt, and then to give
  20765. 10:34:35it a few examples, you give it a user
  20766. 10:34:37and assistant. Okay? So, what this means
  20767. 10:34:39is that we give it, "Hey, if I give you
  20768. 10:34:41this comment,
  20769. 10:34:42this will be the output. Okay, so the
  20770. 10:34:44user is me giving it something. The
  20771. 10:34:46assistant is what's the output that you
  20772. 10:34:47want you want to have and I'm giving it
  20773. 10:34:49two examples in this case.
  20774. 10:34:51Or three. Yeah, three examples. So the
  20775. 10:34:53first example would be
  20776. 10:34:54Um, is there any reason to use an AI
  20777. 10:34:57agent node instead of basic LLM chain,
  20778. 10:34:58which is an actual comment that someone
  20779. 10:35:00put in a video.
  20780. 10:35:01And here will be relevant. So content
  20781. 10:35:03ideas AI agent versus basic LLM node,
  20782. 10:35:05when should you use each one? That could
  20783. 10:35:07be a solid content idea. Or
  20784. 10:35:09something else.
  20785. 10:35:11This is a video from Nate uh Nate
  20786. 10:35:13O'Brien um someone said a small request,
  20787. 10:35:15can you please make a video on client
  20788. 10:35:16onboarding? So these sort of things is
  20789. 10:35:18exactly what we want to see. Right? So
  20790. 10:35:19someone's asking for a client onboarding
  20791. 10:35:21for N&N projects. The content idea in
  20792. 10:35:22this case would be how to onboard your
  20793. 10:35:24clients for an N&N projects and this is
  20794. 10:35:25relevant. But if someone puts thank you
  20795. 10:35:27cuz they put thank you and you're great
  20796. 10:35:28and all that sort of stuff,
  20797. 10:35:30we don't want to put it as a as a
  20798. 10:35:31relevant idea because there's no idea
  20799. 10:35:33here. Okay, so that's what we're doing.
  20800. 10:35:34We are giving it a system prompt to say
  20801. 10:35:36you are a helpful intelligent whatever
  20802. 10:35:38it is. Then here we're saying hey, this
  20803. 10:35:40is what you have to do and then we want
  20804. 10:35:42to be able to add the comment first,
  20805. 10:35:44what's the output that I that I want?
  20806. 10:35:46Comment output comment output. So it has
  20807. 10:35:48three different examples, one that's
  20808. 10:35:50relevant a one that two that are
  20809. 10:35:51relevant and one that's irrelevant. So
  20810. 10:35:53it knows exactly sort of what what to go
  20811. 10:35:55and then this is the comment. So the
  20812. 10:35:57last
  20813. 10:35:58prompt which is the user prompt which
  20814. 10:36:00you can add message here. Uh it will be
  20815. 10:36:02the alpha comment. Yeah, so we're using
  20816. 10:36:03JSON here because of the fact that we
  20817. 10:36:05want the verdict and we want the
  20818. 10:36:08uh content idea as separate variables
  20819. 10:36:10that we can then feed in to
  20820. 10:36:13the filter and the other steps. Okay, so
  20821. 10:36:14in this case 502 went through.
  20822. 10:36:18In the filter, only 199 went through
  20823. 10:36:20based on the 502 based on the response
  20824. 10:36:23from the actual uh AI and the filter in
  20825. 10:36:25this case it's if the verdict is
  20826. 10:36:28relevant. If the variable verdict is
  20827. 10:36:30relevant. Let me add a
  20828. 10:36:32uh in this case it would be
  20829. 10:36:34verdict
  20830. 10:36:38relevant
  20831. 10:36:40and then content
  20832. 10:36:42idea
  20833. 10:36:45how to make a N&N agent from scratch.
  20834. 10:36:50I'm going to pin this and then
  20835. 10:36:52this is basically what it's going to
  20836. 10:36:53see. It's going to see verdict which is
  20837. 10:36:55the one that I put here.
  20838. 10:36:57And then it's going to see the content
  20839. 10:36:58idea. But in this case we're saying only
  20840. 10:37:00if this is relevant, then send it
  20841. 10:37:01through. Okay? So once this is done, we
  20842. 10:37:04can now
  20843. 10:37:06add some fields. So these are the fields
  20844. 10:37:07that will be added to the hook and
  20845. 10:37:08outline. We can this is again is an
  20846. 10:37:10optional step but I do want it to add
  20847. 10:37:12fields cuz I like adding fields to be
  20848. 10:37:14able to separate information cuz again
  20849. 10:37:16we what we did is we scraped 100
  20850. 10:37:18comments, we sent it to the AI and we
  20851. 10:37:20said hey, only run 50 at once. The AI
  20852. 10:37:22checks whether it's relevant or not. If
  20853. 10:37:24it's relevant, it will send it through
  20854. 10:37:25to the hook and outline because it's a
  20855. 10:37:27relevant comment, it's a relevant idea.
  20856. 10:37:29We could use it. Now we want to generate
  20857. 10:37:31the hook and outline which we did before
  20858. 10:37:32here here, hook and outline.
  20859. 10:37:35Which is why we're using this AI step
  20860. 10:37:37but in order to generate the hook and
  20861. 10:37:38the outline, it needs to sort of
  20862. 10:37:40understand what we do. So what I added
  20863. 10:37:42here is two variables which is social
  20864. 10:37:43proof which is basically some results
  20865. 10:37:45that I have
  20866. 10:37:46and what I do
  20867. 10:37:49and some tone of voice of direction.
  20868. 10:37:51This is the tone of voice and direction.
  20869. 10:37:52And this is what I feed into my next AI
  20870. 10:37:56step which is an AI step that generates
  20871. 10:37:58the hook and the outline like I
  20872. 10:37:59mentioned before. And this the settings
  20873. 10:38:01will be the same. The system prompt will
  20874. 10:38:03be you are a helpful intelligent content
  20875. 10:38:04writing assistant. We can also write
  20876. 10:38:06intelligent hook and
  20877. 10:38:09outline
  20878. 10:38:10YouTube hook
  20879. 10:38:12and outline writing assistant. That's
  20880. 10:38:14more contextual to what we're doing. And
  20881. 10:38:16then we're saying your task is to
  20882. 10:38:18generate high quality engaging hooks and
  20883. 10:38:19outlines for content ideas. You receive
  20884. 10:38:22a content idea in JSON and you'll return
  20885. 10:38:24it in the following format hook string
  20886. 10:38:26outline string and then these are the
  20887. 10:38:27different things that we give it.
  20888. 10:38:29So you can see this is the projected
  20889. 10:38:31output that we get. And now we give it a
  20890. 10:38:34few examples I believe. Yeah, we give it
  20891. 10:38:35a few examples. So in this case the
  20892. 10:38:38content idea will be build a rag agent
  20893. 10:38:40inside of N&N and the assistant will be
  20894. 10:38:42this. Right now we're giving it the
  20895. 10:38:43content idea. And because we give it to
  20896. 10:38:45we told it to give it to us in JSON
  20897. 10:38:48which is
  20898. 10:38:49just a programming language.
  20899. 10:38:51It will give us
  20900. 10:38:52the JSON language into two different
  20901. 10:38:53variables. So it will be hook and it
  20902. 10:38:54will be outline. And the string is just
  20903. 10:38:56something we we say when we want it to
  20904. 10:38:57say it's just text. Right? So we say
  20905. 10:38:59give me the hook in text, give me the
  20906. 10:39:01outline in text.
  20907. 10:39:02Given an example and now you can see red
  20908. 10:39:05because it's not this is not correct or
  20909. 10:39:07like this
  20910. 10:39:09What is it? This? Yeah, this is not
  20911. 10:39:10correct. But
  20912. 10:39:12this will pass through the content idea
  20913. 10:39:14again which is something like this,
  20914. 10:39:16content idea build a rag agent inside of
  20915. 10:39:17N&N. And now this will give us the hook
  20916. 10:39:19and the outline which we can then send
  20917. 10:39:21to another set variables which takes all
  20918. 10:39:23the variables and puts them onto one
  20919. 10:39:24place. Again, not needed but I love to
  20920. 10:39:27split information so we're more we're
  20921. 10:39:29more structured with the way that we do
  20922. 10:39:30things. And now once this is done once
  20923. 10:39:32we once we set the variables, we can
  20924. 10:39:34send it to notion um the YouTube comment
  20925. 10:39:37database where we have everything here.
  20926. 10:39:39We want to see all the [snorts] comment
  20927. 10:39:40ideas. All you have to do to connect
  20928. 10:39:42notion is go to here, create a new
  20929. 10:39:43credential and then you can get an
  20930. 10:39:44internal integration secret.
  20931. 10:39:46You should follow this guide. It will
  20932. 10:39:47take you through everything that you
  20933. 10:39:48need to do. It's a bit more of a longer
  20934. 10:39:50process.
  20935. 10:39:51Um you can use Google Sheets as much as
  20936. 10:39:52you can use notion. I'm just a notion
  20937. 10:39:54fanboy so I love to use notion. And in
  20938. 10:39:57this case it will be in database page
  20939. 10:39:58because this is a database. Right? This
  20940. 10:40:01right here is a page. From the list in
  20941. 10:40:02this case the database is called the
  20942. 10:40:04YouTube comment script database. So we
  20943. 10:40:06can do YouTube comment script database.
  20944. 10:40:07The title will be what's that first
  20945. 10:40:09thing which is this content idea. So it
  20946. 10:40:11will be the content idea. The hook will
  20947. 10:40:12be this. The outline will be this.
  20948. 10:40:15Initial comment will be this. Because I
  20949. 10:40:17want to see also what the initial
  20950. 10:40:18comment was to make sure that I know
  20951. 10:40:19exactly if the AI has messed up or not.
  20952. 10:40:21Right? So we get the hook, the outline
  20953. 10:40:22and the initial comment. If I go here as
  20954. 10:40:24well, I can see the initial comment.
  20955. 10:40:27For example, what's the average time
  20956. 10:40:28most of students take to get their first
  20957. 10:40:30client?
  20958. 10:40:31So how long does it take to you take to
  20959. 10:40:32get your first client and what are the
  20960. 10:40:33short investment or need to be on the
  20961. 10:40:34and what investments do you need? So you
  20962. 10:40:36can make a video about how to get your
  20963. 10:40:38first client automation journey with
  20964. 10:40:40zero dollars up front. Right? And that
  20965. 10:40:42will solve this sort of pain point that
  20966. 10:40:43this person has.
  20967. 10:40:44Um so that's something you could do.
  20968. 10:40:46So we get the comments. We get the hook
  20969. 10:40:48and we get the outline. We put it all
  20970. 10:40:49into and the title. We get it we put it
  20971. 10:40:51all into notion. And now once this is
  20972. 10:40:53done, it will then loop back so we go
  20973. 10:40:55here, loop it back
  20974. 10:40:57to here to get the other comments that
  20975. 10:41:00are valid.
  20976. 10:41:01And it will do it all and over and over
  20977. 10:41:03again until it's finished and then we
  20978. 10:41:05wait and then we send it all the way
  20979. 10:41:07back here
  20980. 10:41:09where we can do the other channels. So
  20981. 10:41:12we'll go through the three different
  20982. 10:41:13channels. And let's say you have 10
  20983. 10:41:14channels, it will go through the 10
  20984. 10:41:15channels. Right? And it will just run it
  20985. 10:41:17every single month. Uh now typically
  20986. 10:41:19[snorts]
  20987. 10:41:20I would suggest that you run this every
  20988. 10:41:22month or every week. It depends on the
  20989. 10:41:24amount of channels that you have to be
  20990. 10:41:25honest.
  20991. 10:41:26Um but because we're scraping 15 YouTube
  20992. 10:41:27videos, we also don't want duplicate
  20993. 10:41:29comments. Right? Um
  20994. 10:41:31and we don't want to give it the same
  20995. 10:41:32content ideas. So think of a YouTuber a
  20996. 10:41:34normal YouTuber, they typically post
  20997. 10:41:36like what? Once every three days
  20998. 10:41:38uh and in a month um that's about 10.
  20999. 10:41:41Yeah, 10 videos.
  21000. 10:41:42So if [snorts] you put that in mind you
  21001. 10:41:44can run this every month in five days.
  21002. 10:41:47And it will be free. Right? I'm I mean
  21003. 10:41:49you would only have to pay for N&N from
  21004. 10:41:50the start until the end which is which
  21005. 10:41:52is a very good pricing model that they
  21006. 10:41:53have. So that right there is for the
  21007. 10:41:57way that it's set up. Or we obviously
  21008. 10:41:58have the different steps and make it as
  21009. 10:41:59structured as possible. And when you
  21010. 10:42:02look at cost and how much it actually
  21011. 10:42:03takes to run this, Apify as I mentioned
  21012. 10:42:06right here. So let's say we have 29
  21013. 10:42:09results
  21014. 10:42:10and 1,000 results is 40 40 cents. So do
  21015. 10:42:13the math there, it's 0.000. It's not
  21016. 10:42:15even a noticeable amount of money that I
  21017. 10:42:17have to even mention. Right? So
  21018. 10:42:19it's not really expensive or at all,
  21019. 10:42:21it's free because we all we get the $5
  21020. 10:42:23free from Apify that you can use to be
  21021. 10:42:25able to run this. And the other expenses
  21022. 10:42:28really are the AI
  21023. 10:42:30which because we're using 4.1 mini, it's
  21024. 10:42:33relatively cheap. So there's nothing
  21025. 10:42:35really to worry about. I think it will
  21026. 10:42:36be a few cents or 0.01
  21027. 10:42:39um whatever
  21028. 10:42:40um because it's very very cheap like I
  21029. 10:42:42mentioned and N&N. So N&N charges you
  21030. 10:42:45per execution.
  21031. 10:42:47Which means from the start until the
  21032. 10:42:48end.
  21033. 10:42:49So if you're doing it maybe 10 20 times,
  21034. 10:42:51again, this is very very cheap because
  21035. 10:42:53you're running it every month and so on.
  21036. 10:42:54Right? So this is very very cost
  21037. 10:42:55effective when it comes to an actual
  21038. 10:42:56system. And that's exactly what we have
  21039. 10:42:57this for. Now who can you actually sell
  21040. 10:42:59this to? Well, YouTubers content
  21041. 10:43:01creation agencies, they always need to
  21042. 10:43:03done for you especially done for you
  21043. 10:43:05YouTube content agencies, they need to
  21044. 10:43:06always come up with new ideas for their
  21045. 10:43:08clients. So if they have a system that
  21046. 10:43:10scripts through all the different
  21047. 10:43:11comments for their clients and sees it's
  21048. 10:43:13actually validated data, it's not just
  21049. 10:43:15stuff that they make up because that's
  21050. 10:43:16what people are actually asking for.
  21051. 10:43:17Right? So if they have a system like
  21052. 10:43:19that, it saves them a bunch of time in
  21053. 10:43:20the actual strategy and titles and hooks
  21054. 10:43:23and outline all that sort of stuff that
  21055. 10:43:24they can that they have to allocate
  21056. 10:43:25right now. So you can save them that
  21057. 10:43:27time of actually doing the actual work.
  21058. 10:43:30That right there marks the end of the
  21059. 10:43:31video where I showed you exactly how I
  21060. 10:43:33built an AI system that scripts YouTube
  21061. 10:43:35comments from any videos and turns them
  21062. 10:43:36into fresh high converting ideas. And by
  21063. 10:43:38the way, if you're looking for all the
  21064. 10:43:39blueprints and resources that I'm
  21065. 10:43:41talking about in the video, check the
  21066. 10:43:42second link down below. You can go to
  21067. 10:43:44the classroom section. You can go to the
  21068. 10:43:46templates vault and you'll be able to
  21069. 10:43:47see the N&N course right here and all
  21070. 10:43:50the different resources that you can
  21071. 10:43:51simply download the automation blueprint
  21072. 10:43:53for and import it into your own account.
  21073. 10:43:55And if you have no clue how to do that,
  21074. 10:43:57no worries at all. You can always go to
  21075. 10:43:58the welcome here and you have the
  21076. 10:44:00tutorial which walks you through exactly
  21077. 10:44:01how to do it.
  21078. 10:44:05In this video, I'm going to show you
  21079. 10:44:06exactly how we automated 95% of our
  21080. 10:44:09onboarding processes using Notion and
  21081. 10:44:11N&N. All right, so this right here is
  21082. 10:44:13exactly what we're building.
  21083. 10:44:14Essentially, it's an onboarding system.
  21084. 10:44:16Now the onboarding system starts with
  21085. 10:44:17this step right here which is filling
  21086. 10:44:19out an onboarding form. Now the
  21087. 10:44:20onboarding form is filled out whenever
  21088. 10:44:22we close the client. So we're on a call,
  21089. 10:44:23we close the client, after the call we
  21090. 10:44:25fill out the onboarding form as soon as
  21091. 10:44:27possible which kicks off the actual
  21092. 10:44:29automation until the end. Now the
  21093. 10:44:31onboarding form contains the name of the
  21094. 10:44:32client, the website and small details or
  21095. 10:44:34general details about the client. Then
  21096. 10:44:35we're adding it to the Notion client HQ,
  21097. 10:44:37the headquarters, which is exactly how
  21098. 10:44:39we manage all our clients internally all
  21099. 10:44:40in one place. Uh tasks, team, meetings,
  21100. 10:44:43all that sort of stuff. So, we add the
  21101. 10:44:44details of the new client which we just
  21102. 10:44:45closed to our client HQ, uh which
  21103. 10:44:48auto-populates the client portal. And
  21104. 10:44:50that's I put it here just because it's
  21105. 10:44:51not a an automation, it's a Notion-based
  21106. 10:44:53automation. So, we have it here. Then we
  21107. 10:44:56automatically add four onboarding tasks.
  21108. 10:44:59We make the drive folder, which is the
  21109. 10:45:00drive folder that we're going to use to
  21110. 10:45:01store different assets for that client
  21111. 10:45:03specifically. We create a Slack channel
  21112. 10:45:04internally, which we'll then manually
  21113. 10:45:06share access to with the client. And
  21114. 10:45:08then we send an onboarding email to the
  21115. 10:45:10client, which is saying, "Hey, welcome
  21116. 10:45:11to the team. Super excited to have you
  21117. 10:45:13going. Here's the drive link that we
  21118. 10:45:15actually created for you. Uh we also
  21119. 10:45:17sent the Slack access. We're going to
  21120. 10:45:18send you the Slack access in just a
  21121. 10:45:19bit." And yeah, that's pretty much it.
  21122. 10:45:21All right, so let's go to n8n, which is
  21123. 10:45:23a platform where we're actually building
  21124. 10:45:24automations, which is an automation
  21125. 10:45:25platform. Essentially, it's taking a
  21126. 10:45:26task, breaking it down, automating it
  21127. 10:45:28step by step so we don't have to do it.
  21128. 10:45:30The automation does it itself. So, we
  21129. 10:45:31all start with the the onboarding form
  21130. 10:45:33right here, which is this one right
  21131. 10:45:34here,
  21132. 10:45:35right, where we have full name, email,
  21133. 10:45:36company name, and website.
  21134. 10:45:38Then we have the client folder. We share
  21135. 10:45:40the file because we want it to be
  21136. 10:45:41accessible to everyone. We add the
  21137. 10:45:43company to our database. We add the
  21138. 10:45:45contact related to the company cuz every
  21139. 10:45:47company has a contact, which in this
  21140. 10:45:49case is the CEO or whoever it is. Then
  21141. 10:45:50we set the onboarding tasks. In this
  21142. 10:45:52case, there are four. Uh the first one
  21143. 10:45:53is audit, which is the first step of our
  21144. 10:45:56delivery process. Then we have setting
  21145. 10:45:57up this access, which means softwares.
  21146. 10:45:59Then there is start implementation,
  21147. 10:46:01which is essentially starting the
  21148. 10:46:02structure for the system we're going to
  21149. 10:46:04build for the client. And then
  21150. 10:46:05automation structure, which is layering
  21151. 10:46:07automations in the bigger system as
  21152. 10:46:09well. Uh then we obviously this is just
  21153. 10:46:11some formatting for the drive link. Then
  21154. 10:46:14we create a Slack channel for the
  21155. 10:46:15client. Slack is just the way that
  21156. 10:46:17agencies talk to clients. Uh you can use
  21157. 10:46:18WhatsApp, whatever it is, Telegram. Uh
  21158. 10:46:20probably not Telegram. I don't think
  21159. 10:46:21that's for agencies. Uh but uh but yeah,
  21160. 10:46:23we use Slack. And then send email uh
  21161. 10:46:26onboarding email to the client with some
  21162. 10:46:27different variables. And by the way,
  21163. 10:46:28this is templated. So, if I go here,
  21164. 10:46:30don't get overwhelmed by all of this. Uh
  21165. 10:46:32but it's saying, "So pumped to
  21166. 10:46:33officially kick things off with you. I
  21167. 10:46:35know investing in a service like this is
  21168. 10:46:37a big decision, and our job here is to
  21169. 10:46:38make sure it feels like the best
  21170. 10:46:40decision you made all year. Uh below is
  21171. 10:46:41your personal onboarding folder with
  21172. 10:46:42everything you need to get started." The
  21173. 10:46:44link right here. We also made a Slack
  21174. 10:46:45channel. Uh we're thrilled to have you
  21175. 10:46:47join the JMT and can't wait to get
  21176. 10:46:48started. Cheers, Mikayla. Now, this
  21177. 10:46:50right here is something that a lot of
  21178. 10:46:51agencies don't have, which is touching
  21179. 10:46:52on the psychological angle of onboarding
  21180. 10:46:55uh because not everything's technical.
  21181. 10:46:56Not everything is folders, drives, all
  21182. 10:46:57that sort of stuff. It is still an
  21183. 10:46:59investment that a company is making, so
  21184. 10:47:00you want to make sure that they don't
  21185. 10:47:01have buyer's remorse. They don't feel
  21186. 10:47:02like they have not made the right
  21187. 10:47:03decision. Um so,
  21188. 10:47:05let's actually try this out. Let's see
  21189. 10:47:07how it works. So, all I have to do now
  21190. 10:47:09is press execute workflow, which will
  21191. 10:47:10essentially run the automation once. We
  21192. 10:47:12have to fill full name, email, company
  21193. 10:47:13name, and website. So, let's do it and
  21194. 10:47:15then press submit.
  21195. 10:47:17If you go back to our n8n automation, it
  21196. 10:47:18shows that it's running.
  21197. 10:47:20All these green steps just says it's
  21198. 10:47:21successful. It's making the different
  21199. 10:47:23tasks, which all have due dates as well.
  21200. 10:47:24Um one is I think one day, then two
  21201. 10:47:26days, then three days, and four days
  21202. 10:47:27when the automation is running. It's
  21203. 10:47:29finishing up the task,
  21204. 10:47:30Slack channel, and then getting the
  21205. 10:47:31email. So, now if you go to our Notion
  21206. 10:47:33HQ,
  21207. 10:47:35where we manage everything from clients,
  21208. 10:47:36contacts, tasks, meetings, and
  21209. 10:47:37analytics. If I go to clients right
  21210. 10:47:39here, we can see that we have One Media
  21211. 10:47:40here added to the Kanban board, which is
  21212. 10:47:42where we manage all our clients, all our
  21213. 10:47:44delivery uh statuses. And if I go to One
  21214. 10:47:46Media, I can see that the client portal
  21215. 10:47:48was automatically generated. If I go to
  21216. 10:47:50the client portal, which is essentially
  21217. 10:47:51a place where we manage everything for
  21218. 10:47:52our clients because this saves the time
  21219. 10:47:55of us having to email the clients for
  21220. 10:47:57different stuff, having to find
  21221. 10:47:58information. We want to keep everything
  21222. 10:47:59in one place for every single client,
  21223. 10:48:01which is exactly what this is doing. In
  21224. 10:48:02this case, if this is set to complete,
  21225. 10:48:05this automatically sends an email to the
  21226. 10:48:06client saying, "Hey, the name of the of
  21227. 10:48:09the actual task," which in this case the
  21228. 10:48:10audit, right, "the audit is finished.
  21229. 10:48:12The next step is software access. The
  21230. 10:48:13next step is database building and so
  21231. 10:48:15on." So, it goes step by step, so it's
  21232. 10:48:16all automatic as well, the updates to
  21233. 10:48:18the clients. So, you don't have to
  21234. 10:48:19manually do it. Uh we can keep software
  21235. 10:48:21access here. We can then have databases.
  21236. 10:48:23So, in this case, it will be resource
  21237. 10:48:24area. We can add any folders and so on.
  21238. 10:48:26And then the Miro would be the Miro for
  21239. 10:48:29the audit because our first step of the
  21240. 10:48:30delivery process is actually auditing
  21241. 10:48:32what they have and mapping everything
  21242. 10:48:33out step by step with the whole team.
  21243. 10:48:35So, we put this whole stuff here. They
  21244. 10:48:36have access to this. If I go back to the
  21245. 10:48:38client, if I go to tasks, I can see that
  21246. 10:48:40these four tasks were auto-populated for
  21247. 10:48:41this specific client with due dates that
  21248. 10:48:43are two days, three days, four days in
  21249. 10:48:45advance depending on what you want. Uh
  21250. 10:48:47but this is what we like to have. You
  21251. 10:48:49can see the task progress, which is So,
  21252. 10:48:50if I say I put complete, it shows 25%
  21253. 10:48:52task progress. And if you have a bunch
  21254. 10:48:54of clients here, you can see all the
  21255. 10:48:55tasks you've done, the percentages, and
  21256. 10:48:57so on. Uh so, we have everything in
  21257. 10:48:58Notion right here, which is
  21258. 10:48:59auto-populated again. And also one more
  21259. 10:49:01thing, the tasks are stored in Notion as
  21260. 10:49:03well. So, you don't need another project
  21261. 10:49:04management tool. You don't need to store
  21262. 10:49:05clients in other places, right?
  21263. 10:49:06Everything is in one place for Notion.
  21264. 10:49:08So, tasks are here, companies are here.
  21265. 10:49:09If I go here, I can see that the website
  21266. 10:49:12is stored here. The address, the email
  21267. 10:49:13can be stored separately. If I go to
  21268. 10:49:15contacts, I can see that one contact was
  21269. 10:49:17here, which is the uh person from the
  21270. 10:49:19email. You can connect with her too with
  21271. 10:49:20the with my email as well. We can also
  21272. 10:49:22add more fields like phone number, type,
  21273. 10:49:24right? Uh role title, time zone, and so
  21274. 10:49:26on. But just for this case, to make it
  21275. 10:49:27simple, we just want to leave it like
  21276. 10:49:29this. And then if I go back to the email
  21277. 10:49:32right here, I can see that I got an
  21278. 10:49:33email from JMT Solutions saying, "Hey
  21279. 10:49:35Mikayla, so pumped to officially kick
  21280. 10:49:37things off with you. I know investing in
  21281. 10:49:38a service like this is a big decision,
  21282. 10:49:40so our job here is to make sure blah
  21283. 10:49:41blah blah." And then we have the
  21284. 10:49:43onboarding drive folders. If I press
  21285. 10:49:44here, this will take me to the drive
  21286. 10:49:45folder, which is named with my company
  21287. 10:49:48name, so One Media onboarding folder in
  21288. 10:49:49this case. And this is where we can
  21289. 10:49:51store any creatives or anything that
  21290. 10:49:52they have, brand assets, and so on.
  21291. 10:49:54Whatever it is that they have, um they
  21292. 10:49:56can store here in the drive folder. And
  21293. 10:49:58the client itself just gets a nice email
  21294. 10:50:00sent to them uh automatically without
  21295. 10:50:02the team having to do it themselves. And
  21296. 10:50:03if I go to Slack, we can see that we
  21297. 10:50:05have the One Media channel right here,
  21298. 10:50:06which is a channel exactly for that
  21299. 10:50:08client specifically where we can store
  21300. 10:50:09anything. We can communicate with the
  21301. 10:50:10client uh cuz for any agency service
  21302. 10:50:12that you have, it's a good way to
  21303. 10:50:14communicate with the client itself, not
  21304. 10:50:15being on email uh cuz when you want to
  21305. 10:50:17do quick things, it's good to be on
  21306. 10:50:18something like this, WhatsApp, whatever
  21307. 10:50:20you have, works. So, this is
  21308. 10:50:21automatically generated as well. And
  21309. 10:50:23that's the full onboarding process right
  21310. 10:50:24there. So, again, we all started with a
  21311. 10:50:25form. We then put it to Notion where we
  21312. 10:50:27have a place where we can store
  21313. 10:50:28everything. We generated the client
  21314. 10:50:30portal, which is something else that a
  21315. 10:50:31lot of agencies don't have because they
  21316. 10:50:32scatter in different tools to find
  21317. 10:50:34client information. In this case, I
  21318. 10:50:35said, "Look, let's put everything in one
  21319. 10:50:37place in one portal where we can manage
  21320. 10:50:38everything for that client," which is so
  21321. 10:50:40so good, especially cuz it sets the
  21322. 10:50:41expectations. But it also increases the
  21323. 10:50:43way that the client views you because
  21324. 10:50:44you're more professional. You have your
  21325. 10:50:46together, basically, uh all in one
  21326. 10:50:47place. You then we have the onboarding
  21327. 10:50:48tasks as well so the team knows exactly
  21328. 10:50:50what to do. They're alerted as well, uh
  21329. 10:50:52so they can get started on the project.
  21330. 10:50:53The drive folder is automatically
  21331. 10:50:54generated. The Slack channel's done uh
  21332. 10:50:56so that everybody knows exactly that we
  21333. 10:50:57have a new client rolling. And then the
  21334. 10:50:59onboarding email sent to the client.
  21335. 10:51:01Now, something like this, depending on
  21336. 10:51:02the agency really, uh it would take
  21337. 10:51:04around well, anywhere from an hour to
  21338. 10:51:06days. I've worked with agencies which
  21339. 10:51:08take days to do this, uh which is which
  21340. 10:51:10is utterly insane uh when we have this
  21341. 10:51:12automation right here that does it in
  21342. 10:51:14seconds all by filling out a form. So,
  21343. 10:51:16this is such a powerful automation. It's
  21344. 10:51:18high leverage. For the time that you put
  21345. 10:51:19in, the output is so so good and it's so
  21346. 10:51:21so powerful, which is exactly why we
  21347. 10:51:22recommend it to all these agencies. And
  21348. 10:51:24this was all done using Notion right
  21349. 10:51:26here and then using n8n right here.
  21350. 10:51:32Hey, about to build a live LinkedIn
  21351. 10:51:33outreach system right in front of you.
  21352. 10:51:35We start by filling out a form with the
  21353. 10:51:37details of who we are targeting. From
  21354. 10:51:38there, it actually scrapes thousands of
  21355. 10:51:40leads from Apollo, pulls in their
  21356. 10:51:42LinkedIn URLs, and automatically drafts
  21357. 10:51:43hyper-personalized connection messages
  21358. 10:51:45that we can plug straight into our
  21359. 10:51:47outbound campaigns. Okay, so as always,
  21360. 10:51:49I want to run it from the start until
  21361. 10:51:50the end, and then we're going to go to
  21362. 10:51:51actually building it step by step. So,
  21363. 10:51:53let me execute the workflow.
  21364. 10:51:55This will then bring me to the form
  21365. 10:51:56right here. So, let me say I am
  21366. 10:51:58targeting real estate agencies in the
  21367. 10:52:01US.
  21368. 10:52:02I'm going to press submit. What this
  21369. 10:52:03will do is it will send it to the first
  21370. 10:52:05AI to generate a URL, which will then
  21371. 10:52:07add or send to the scraper to then
  21372. 10:52:09scrape the leads. Um and by leads, we
  21373. 10:52:12mean
  21374. 10:52:13LinkedIn URLs. So, you can see this is
  21375. 10:52:14running right here cuz we're using
  21376. 10:52:15Apify. As you can see here, we're
  21377. 10:52:17starting to get results.
  21378. 10:52:18Let me get the first name, last name,
  21379. 10:52:19LinkedIn URLs, and the ID as well. Then
  21380. 10:52:22we send it to the next node in order to
  21381. 10:52:24extract the details. Then we only send
  21382. 10:52:2720 um details of people or we just send
  21383. 10:52:2920 people through the first loop. And
  21384. 10:52:32then we draft a hyper-personalized
  21385. 10:52:34connection message for that specific
  21386. 10:52:36person based on their bio, based on who
  21387. 10:52:38they are, and so on.
  21388. 10:52:39Before adding it to our Google Sheet
  21389. 10:52:40database, which is where we store
  21390. 10:52:42everything right here. [music]
  21391. 10:52:44So, you can see we have the different
  21392. 10:52:45first name, last name, the name as well,
  21393. 10:52:47the LinkedIn URL, the title,
  21394. 10:52:49the email status, the photo URL, and
  21395. 10:52:51also the icebreaker that we can um
  21396. 10:52:54generate based on their profile. And if
  21397. 10:52:56I go here, I can see that we're still
  21398. 10:52:58running the system because we let 97
  21399. 10:53:00items through, and then we're sending 20
  21400. 10:53:02and 20 and 20 until it's actually
  21401. 10:53:04finished. If I go here, I can see that
  21402. 10:53:06we have more and more leads that are
  21403. 10:53:07being added.
  21404. 10:53:09So, I'm going to stop the workflow right
  21405. 10:53:10here cuz you got to see exactly what it
  21406. 10:53:11is. By the way, these are just
  21407. 10:53:13icebreakers, so connection messages that
  21408. 10:53:15you send [music] to the lead when you
  21409. 10:53:16want to connect with them, uh which
  21410. 10:53:18increases drastically increases the
  21411. 10:53:20likelihood of them connecting back and
  21412. 10:53:22you being able to have a conversation
  21413. 10:53:23with that person and it being actually
  21414. 10:53:25personalized. So,
  21415. 10:53:28let's start from scratch. Let me make a
  21416. 10:53:29new workflow right here.
  21417. 10:53:32Personal, there we go.
  21418. 10:53:34Let me start from zero. But as always,
  21419. 10:53:36as you guys know, we're going to be
  21420. 10:53:37mapping things out step by step into our
  21421. 10:53:40Miro. So, let's dive in. All right, so
  21422. 10:53:41here we can start mapping things out.
  21423. 10:53:43Again, an automation has an input.
  21424. 10:53:46Let me make this smaller. We can zoom
  21425. 10:53:48in.
  21426. 10:53:49And the output,
  21427. 10:53:51right? And in this case, the input
  21428. 10:53:53because we want to basically uh we want
  21429. 10:53:55the thing to be dynamic, so it changes
  21430. 10:53:57every single time. But the input in this
  21431. 10:53:58case is who we are targeting. So, target
  21432. 10:54:00audience.
  21433. 10:54:04And then we start thinking about how can
  21434. 10:54:06we actually give it the input? Well, as
  21435. 10:54:07you saw, we used n8n forms, but you
  21436. 10:54:09could also use a Telegram message or
  21437. 10:54:11Gmail coming through or something else.
  21438. 10:54:13So, in this case, it can be target
  21439. 10:54:14audience
  21440. 10:54:15from
  21441. 10:54:18n8n form.
  21442. 10:54:20Okay?
  21443. 10:54:21Let me make this smaller.
  21444. 10:54:23Uh let's put this like this. Cool.
  21445. 10:54:25Then the next step is actually scraping
  21446. 10:54:28the leads
  21447. 10:54:29using Apify, which is a software that
  21448. 10:54:32allows us to strip leads and I'll show
  21449. 10:54:33you exactly what I mean.
  21450. 10:54:35And then we're going to be able to
  21451. 10:54:37generate
  21452. 10:54:39personalized
  21453. 10:54:42connection message
  21454. 10:54:44to that person.
  21455. 10:54:47And then we want to be able to
  21456. 10:54:49send it, so add details to Google Sheet
  21457. 10:54:55database.
  21458. 10:54:56Perfect.
  21459. 10:54:57>> [snorts]
  21460. 10:54:57>> All right, so we have target audience
  21461. 10:54:59from n8n form, then we have scraping the
  21462. 10:55:01leads using Apify, then we have generate
  21463. 10:55:03personalized connection message
  21464. 10:55:05um using the the details of course, and
  21465. 10:55:07then we want to add everything to our
  21466. 10:55:08Google Sheet database, which is the one
  21467. 10:55:10right here.
  21468. 10:55:12So,
  21469. 10:55:13what I'd like to do when I make
  21470. 10:55:14automations is I actually like to go
  21471. 10:55:15step by step and show you exactly my
  21472. 10:55:17thought process, how I think through
  21473. 10:55:18building automations um just so you can
  21474. 10:55:21see everything, you can see the whole
  21475. 10:55:22scope. So,
  21476. 10:55:23the first step here is target audience.
  21477. 10:55:26So, we need a way for us to be able to
  21478. 10:55:28give the input. So, as you saw before, I
  21479. 10:55:30used an n8n form. So, this is where we
  21480. 10:55:31go to n8n and we start actually building
  21481. 10:55:33the automation. So, I'm going to add the
  21482. 10:55:35first step, which is in this case called
  21483. 10:55:36a trigger. A trigger is the thing that
  21484. 10:55:38starts the automation, and we can go to
  21485. 10:55:40on form submission.
  21486. 10:55:42Right here. And this is where you
  21487. 10:55:43basically make a form. Now, the form can
  21488. 10:55:47Well, in this case it can compile of the
  21489. 10:55:50I guess describe your target audience or
  21490. 10:55:52describe your audience that you want to
  21491. 10:55:53target. So, we can name this
  21492. 10:55:56LinkedIn
  21493. 10:55:57lead outreach
  21494. 10:56:00trigger.
  21495. 10:56:01Description can be insert
  21496. 10:56:03an audience
  21497. 10:56:05for your LinkedIn outreach
  21498. 10:56:08campaigns here.
  21499. 10:56:11And then the form elements, which is in
  21500. 10:56:13this case the What are we actually
  21501. 10:56:14asking the user to input to then start
  21502. 10:56:16the automation,
  21503. 10:56:17we can add a field name called describe
  21504. 10:56:20your audience
  21505. 10:56:22in plain English.
  21506. 10:56:25And we want to leave this as text.
  21507. 10:56:28Yeah, text text area. I actually don't
  21508. 10:56:30know the difference between text and
  21509. 10:56:31text area. I believe that this is
  21510. 10:56:33uh wider text, so it can be uh long form
  21511. 10:56:36rather than
  21512. 10:56:38short text. Uh so, let's leave this as
  21513. 10:56:39it is. So, we can leave this as is, and
  21514. 10:56:42the placeholder can be company name,
  21515. 10:56:44company types, sorry.
  21516. 10:56:47Location, etc. So, this is the thing
  21517. 10:56:48that they see before actually writing,
  21518. 10:56:50which gives them some ideas as to what
  21519. 10:56:52input they can give. And let's make this
  21520. 10:56:53required. So, now if I go to execute
  21521. 10:56:55step, which means that I'm just testing
  21522. 10:56:57the automation,
  21523. 10:56:58it brings me to this page where I can
  21524. 10:56:59see the title, the description,
  21525. 10:57:04the um the first question, and then we
  21526. 10:57:06can see that we have an area for us to
  21527. 10:57:07actually make the text.
  21528. 10:57:09Which we can Oh, that's why. That's
  21529. 10:57:11cool. Um so, let's do again like we did
  21530. 10:57:13before, real estate
  21531. 10:57:16agencies in the US. I'm going to press
  21532. 10:57:18submit.
  21533. 10:57:20As you can see, this is a test version
  21534. 10:57:21of your form.
  21535. 10:57:23And here we can see that we got the
  21536. 10:57:24results, which is this right here.
  21537. 10:57:26If you go to schema, we can see that we
  21538. 10:57:28have it in this way, which is exactly
  21539. 10:57:30what we need in order to go to the next
  21540. 10:57:31step. All right, so once this is done,
  21541. 10:57:33uh this is good. Let me go here and make
  21542. 10:57:35this green.
  21543. 10:57:36Again, cuz it's all step by step. We
  21544. 10:57:39want to be scraping the leads. So, based
  21545. 10:57:41on the input, based on uh What is it
  21546. 10:57:43right here? Real estate agencies in US,
  21547. 10:57:45we want to be able to then send it to
  21548. 10:57:47Apify,
  21549. 10:57:48which is apify.com, which is the one
  21550. 10:57:50right here. And I like to think of Apify
  21551. 10:57:52as the Amazon for scrapers. So, you go
  21552. 10:57:54here, you basically choose your product.
  21553. 10:57:56In this case, it's a scraper. And for
  21554. 10:57:58those of you who don't know what a
  21555. 10:57:59scraper is, it's basically saying Let's
  21556. 10:58:01do Let's say we do um Google Maps
  21557. 10:58:02Scraper.
  21558. 10:58:03This basically extracts. So, you go to
  21559. 10:58:05Google Maps, it extracts the text, it
  21560. 10:58:07extracts the location of businesses,
  21561. 10:58:08reviews, all the stuff that we want from
  21562. 10:58:10that specific software, and then we can
  21563. 10:58:12use it for whatever we want. And for us,
  21564. 10:58:13for this automation, we want to be using
  21565. 10:58:15Apollo. So, Apollo is another software
  21566. 10:58:17that allows us to be able to scrape
  21567. 10:58:19LinkedIn profiles based on a specific
  21568. 10:58:21criteria. So, it can be um real estate
  21569. 10:58:23agencies in the US, which is the one
  21570. 10:58:25that we have right here. All right, we
  21571. 10:58:27want to put this in,
  21572. 10:58:28and the output we want a list of leads.
  21573. 10:58:30So, for us to be able to do that, we
  21574. 10:58:32have to make an account, and then you'll
  21575. 10:58:34be able to come to this page right here.
  21576. 10:58:36You have the Apify store. By the way, if
  21577. 10:58:37you're asking yourself, "Is this paid or
  21578. 10:58:38is this free?" Well, um the scraper that
  21579. 10:58:41we're going to be using today is
  21580. 10:58:43free depending on how much you use it.
  21581. 10:58:45So, the way that Apify works is that
  21582. 10:58:46they give you $5 for free every single
  21583. 10:58:47month.
  21584. 10:58:49And the scraper that we're going to use
  21585. 10:58:50is about $1 for 1,000 leads. Okay, so if
  21586. 10:58:53you use uh $5, that means you will have
  21587. 10:58:555,000 leads for free every single month.
  21588. 10:58:58But anything that you use above $5,
  21589. 10:59:00that's something that you're going to
  21590. 10:59:01have to pay.
  21591. 10:59:02Um okay, so
  21592. 10:59:04once you come to the Apify store, again
  21593. 10:59:05like an Amazon store, we just look for a
  21594. 10:59:07product, and the product is Apollo
  21595. 10:59:09Scraper.
  21596. 10:59:10And then we have different options. So,
  21597. 10:59:12how do you know which one to choose?
  21598. 10:59:13Well, the first thing I do is actually
  21599. 10:59:14look at how many people used it and the
  21600. 10:59:17price. This right here is good. I know
  21601. 10:59:19Curious Coder is a guy who makes a lot
  21602. 10:59:20of co Yeah, as you can see, he's already
  21603. 10:59:22here as well. But the one that I used is
  21604. 10:59:24actually this.
  21605. 10:59:25I used it because of price, uh but also
  21606. 10:59:27because the amount of people that
  21607. 10:59:28actually used it. And the way that this
  21608. 10:59:30works is you pay this per event. So, you
  21609. 10:59:32pay per event. What this means is that
  21610. 10:59:34you pay per usage.
  21611. 10:59:36And the price is right here. So, $1 for
  21612. 10:59:371,000 leads. And you can do up to 50,000
  21613. 10:59:39leads, which is exactly what we like. Um
  21614. 10:59:42and this page right here, it might look
  21615. 10:59:44intimidating, is actually quite easy to
  21616. 10:59:45understand. The only thing you have to
  21617. 10:59:47understand here is like what's the
  21618. 10:59:48input? What is the thing that I'm giving
  21619. 10:59:49the scraper in order for us to get the
  21620. 10:59:52data back? Well, in this case, the input
  21621. 10:59:54is the Apollo URL. Now, the Apollo URL
  21622. 10:59:56is a URL, so let me show you here. Let
  21623. 10:59:58me copy this and paste it. It's a URL
  21624. 11:00:00that allows us to basically say, "Hey,
  21625. 11:00:03we want this type of person." Look,
  21626. 11:00:05person title, uh contact email, exclude,
  21627. 11:00:07catch all. All this stuff is a criteria
  21628. 11:00:09for the person that we want to extract,
  21629. 11:00:11and this will now make a list of leads
  21630. 11:00:13that we can use for whatever we want.
  21631. 11:00:15So, so the input here is the Apollo URL.
  21632. 11:00:18That's the only thing that we have to
  21633. 11:00:19get in order to give the scraper the
  21634. 11:00:22thing that it needs to use to then give
  21635. 11:00:23us the leads. Well, in this case, one
  21636. 11:00:26thing we didn't add here is the AI that
  21637. 11:00:28we used to make the URL, because URL
  21638. 11:00:31changes based on who we're targeting.
  21639. 11:00:33So, in this case, it can be AI to make
  21640. 11:00:36Apollo
  21641. 11:00:37URL.
  21642. 11:00:40That way, when we put the target
  21643. 11:00:41audience, we give it to AI, AI knows the
  21644. 11:00:43framework of that URL and how it usually
  21645. 11:00:45works. Um and I'll show you exactly what
  21646. 11:00:47I mean here, cuz it is a very specific
  21647. 11:00:49thing.
  21648. 11:00:50And then we have that URL, which we can
  21649. 11:00:51then feed into the scraper on Apify to
  21650. 11:00:54then give us the leads back, give it to
  21651. 11:00:55AI to make the personalized connection
  21652. 11:00:57message, and then we can add all the
  21653. 11:00:58details to the Google Sheet. All right,
  21654. 11:01:00uh let me go back here, and now we can
  21655. 11:01:02use the next node, which is an AI. So,
  21656. 11:01:05we can go AI. We're not using an AI
  21657. 11:01:06agent because we just want the AI step.
  21658. 11:01:08Let's use OpenAI. That's fine.
  21659. 11:01:11And we're going to use message a model.
  21660. 11:01:14And in order for us to be able to
  21661. 11:01:15connect our OpenAI to uh n8n, we have to
  21662. 11:01:17go to platform.openai.com.
  21663. 11:01:20Make an account, go to dashboard,
  21664. 11:01:22go to API keys. On the top right, create
  21665. 11:01:24a new secret key. You can go here and
  21666. 11:01:25name it whatever you want, so n8n test.
  21667. 11:01:28You will then have this key right here,
  21668. 11:01:30which you can copy and paste it back
  21669. 11:01:32here.
  21670. 11:01:34API key. And don't worry about any of
  21671. 11:01:36this, okay? The only thing you have to
  21672. 11:01:37worry about is the API key.
  21673. 11:01:39All right, once you connected your API
  21674. 11:01:41key, let me take this off. Um we can do
  21675. 11:01:43text message a model. The model that we
  21676. 11:01:45want to use is uh let's say GPT-5.
  21677. 11:01:50GPT-5. Let's see if we have that.
  21678. 11:01:53Cuz it is something that we
  21679. 11:01:55don't want any errors on.
  21680. 11:01:56Um
  21681. 11:01:58let's see if we have GPT-5 here.
  21682. 11:02:00Yeah, let's do chat latest, the latest
  21683. 11:02:02GPT-5 model. And
  21684. 11:02:04for the prompt, I'm going to give it a
  21685. 11:02:05system prompt, which is basically
  21686. 11:02:07saying, "Hey, you are a identity. You
  21687. 11:02:09are a helpful, intelligent, whatever it
  21688. 11:02:10is." And then a user prompt. So,
  21689. 11:02:13system,
  21690. 11:02:15and I'm going to say, "You're a helpful,
  21691. 11:02:18intelligent
  21692. 11:02:19sales
  21693. 11:02:21assistant." And for the user prompt, I'm
  21694. 11:02:23going to paste the prompt that I had
  21695. 11:02:24before, so you guys can see it. Uh but
  21696. 11:02:26again, you can grab the whole template
  21697. 11:02:27at the end. I'll show you exactly how to
  21698. 11:02:29do it. As you can see here, it says,
  21699. 11:02:30"Your task is to take as input a natural
  21700. 11:02:32language description of a prospect
  21701. 11:02:34audience and turn that into an Apollo
  21702. 11:02:36search URL." Now, here's an example of
  21703. 11:02:38an Apollo search URL, so I give it a few
  21704. 11:02:39examples. Not Not few, just an example
  21705. 11:02:41right here. You can see it has United
  21706. 11:02:43States. And this is in a very, very
  21707. 11:02:44specific order, which Apollo likes when
  21708. 11:02:47we want to be able to scrape leads. Uh
  21709. 11:02:48the URL describes a search for people
  21710. 11:02:50that are located in the US, hold the
  21711. 11:02:52title owner, CEO, founder, and partner,
  21712. 11:02:54have a keyword associated with creative
  21713. 11:02:55agency. And these are the fields that
  21714. 11:02:57you can change: organization location,
  21715. 11:02:59keywords, person titles, and
  21716. 11:03:00organization number of employee ranges.
  21717. 11:03:02Do not add a change any fields. Use the
  21718. 11:03:04above template. Return your response in
  21719. 11:03:05JSON using this format: search URL,
  21720. 11:03:08search URL it goes here.
  21721. 11:03:09Okay? So, that way, we basically say,
  21722. 11:03:12"Hey,
  21723. 11:03:13this is what the structure is like.
  21724. 11:03:14These are the things that you can
  21725. 11:03:15change." And as the last input, we're
  21726. 11:03:17going to give it another user prompt,
  21727. 11:03:18which is the target audience.
  21728. 11:03:22Okay? So, let me say, "Here is the
  21729. 11:03:26audience I am targeting."
  21730. 11:03:29And by the way, I just dropped it in
  21731. 11:03:31from the form. So, this is a variable
  21732. 11:03:33that I can pull in here
  21733. 11:03:35and then start the automation. And
  21734. 11:03:37that's how automation fundamentally
  21735. 11:03:38works, cuz it's all dynamic. It changes
  21736. 11:03:39every single time. Cuz you see here, it
  21737. 11:03:41might look like code, cuz it is code, uh
  21738. 11:03:43but it's just a variable from here. And
  21739. 11:03:45then lastly, we have to output the
  21740. 11:03:46content as JSON, because as you can see
  21741. 11:03:48here, I I told it to return your
  21742. 11:03:50response in JSON, cuz I just want a
  21743. 11:03:52variable.
  21744. 11:03:53So, what I'm going to do now is I'm
  21745. 11:03:54going to execute this step, which means
  21746. 11:03:56I'm going to test this. And as you can
  21747. 11:03:57see, I got the search URL, which I will
  21748. 11:04:00then be using to give to the scraper to
  21749. 11:04:02then be able to scrape the leads.
  21750. 11:04:04So, now that this is done, um
  21751. 11:04:06perfect. Let me rename this to
  21752. 11:04:09generate
  21753. 11:04:10search URL.
  21754. 11:04:13The next step is actually using Apify to
  21755. 11:04:15be able to scrape the leads. So, I'm
  21756. 11:04:17going to go here, look at Apify.
  21757. 11:04:19I'm going to run an actor, because
  21758. 11:04:21again, those different things are
  21759. 11:04:22actors, the scrapers.
  21760. 11:04:24And then to connect your Apify, you have
  21761. 11:04:25to go to create a new credential, you
  21762. 11:04:26need an API key right here.
  21763. 11:04:29I believe that
  21764. 11:04:31you can get your API key on settings,
  21765. 11:04:34API integrations, and you can um copy
  21766. 11:04:36this.
  21767. 11:04:37Default API token.
  21768. 11:04:38And then you can paste it here, have the
  21769. 11:04:40connection, and that's it.
  21770. 11:04:41Once you connected it, uh which one is
  21771. 11:04:43it?
  21772. 11:04:44Okay, I'm going to bet on this one.
  21773. 11:04:46This one right here. Uh the actor is a
  21774. 11:04:48thing that we're using. The uh action is
  21775. 11:04:50the run an actor.
  21776. 11:04:52And then actor source, this is fine. Uh
  21777. 11:04:54very very important though, if you don't
  21778. 11:04:55see it here, if you don't see it in the
  21779. 11:04:57list, which I do, which is this one
  21780. 11:04:58right here, you need to actually run
  21781. 11:05:00this once, because yours will say start
  21782. 11:05:02and save. Once you start and save, it
  21783. 11:05:04will run it once. That way you can
  21784. 11:05:06actually save it to your account, so
  21785. 11:05:08you're able to see it here.
  21786. 11:05:09And then the next thing it shows us is
  21787. 11:05:11an input JSON. So, if we look at this,
  21788. 11:05:13you're like, what the hell even is this?
  21789. 11:05:15Uh well, if you go here to the input,
  21790. 11:05:18there's two different ways that we can
  21791. 11:05:19run scrapers in Apify. We can either use
  21792. 11:05:21the platform itself and just run it and
  21793. 11:05:23then get the data, or we can use it
  21794. 11:05:25automatically within their automations,
  21795. 11:05:26or N8N, or Make, or Zapier, whatever it
  21796. 11:05:28is, um to be able to automatically do
  21797. 11:05:31it. And so, because we're using N8N as
  21798. 11:05:32our automation software, we have to give
  21799. 11:05:34a JSON. So, this right here
  21800. 11:05:36is an input JSON, like the input that we
  21801. 11:05:38give the scraper, which we can find
  21802. 11:05:40right here.
  21803. 11:05:41Right, we can just copy this.
  21804. 11:05:44And we can
  21805. 11:05:46delete this, and we can paste it here.
  21806. 11:05:47Okay? And the only thing that we have to
  21807. 11:05:49change is this. Because right now it's
  21808. 11:05:51fixed. If I run this, it will always
  21809. 11:05:53take this URL. I want to change the URL
  21810. 11:05:55based on the URL that we have here. So,
  21811. 11:05:56search URL, which we can drop in here.
  21812. 11:05:59Okay, so
  21813. 11:06:01copy this, and put it here. I think this
  21814. 11:06:03always happens.
  21815. 11:06:05There we go. So, now [music]
  21816. 11:06:07the green variable is the thing that
  21817. 11:06:08changes every single time, and all these
  21818. 11:06:10other ones are the same, apart from max
  21819. 11:06:13search result, which we can leave to
  21820. 11:06:16100.
  21821. 11:06:17Or actually, yeah, you can do 100. What
  21822. 11:06:19this says is like, hey, scrape the
  21823. 11:06:21leads. These are the maximum amount of
  21824. 11:06:23leads that I want you to scrape. Okay?
  21825. 11:06:25And we do this because, as I mentioned,
  21826. 11:06:27this is paid. So, you basically want to
  21827. 11:06:29maximize, or you want to limit, sorry,
  21828. 11:06:30you want to limit the amount of leads
  21829. 11:06:32that you want to scrape from that
  21830. 11:06:33scraper. Okay? So, now we have this,
  21831. 11:06:35then we want to wait for finish, which
  21832. 11:06:37means that we send the data, we then
  21833. 11:06:38wait until we get the data back, and
  21834. 11:06:40then we can move on to the next steps.
  21835. 11:06:42So, I'm going to execute this step right
  21836. 11:06:44here. Let me actually pin this. P, and
  21837. 11:06:46then P.
  21838. 11:06:48I'm going to run this.
  21839. 11:06:49So, you can see now this is running, and
  21840. 11:06:51if I go to here, to runs, I can see that
  21841. 11:06:53we have a new run running right here.
  21842. 11:06:57And this is fundamentally how you test.
  21843. 11:06:58You go to the Apify platform, and then
  21844. 11:07:00you go back to N8N, and so on. So, now
  21845. 11:07:01you can see that we got a list of leads,
  21846. 11:07:03and I mentioned the maximum amount of
  21847. 11:07:04result that I put was 100. So, we're
  21848. 11:07:06going to have to wait until we get 100,
  21849. 11:07:07or we can just simply stop the
  21850. 11:07:09automation and just test. That's how I
  21851. 11:07:12usually do it, uh but let's wait until
  21852. 11:07:13we get 100 results, then be able to go
  21853. 11:07:15to the next steps. All right, we can see
  21854. 11:07:16here that we have 97 results, uh close
  21855. 11:07:19to 100.
  21856. 11:07:20And if I go to N8N, at any second now,
  21857. 11:07:23we should be able to
  21858. 11:07:25get the run, um or finish the results of
  21859. 11:07:28the run. All right, we got 100, and you
  21860. 11:07:30go here.
  21861. 11:07:31And at any second now, we should see the
  21862. 11:07:32output that is generated. Cool. So, as
  21863. 11:07:35you can see, this is what we get out of
  21864. 11:07:37the scraper. But, the one thing about
  21865. 11:07:39Apify that most people get confused
  21866. 11:07:41about is they start thinking, where are
  21867. 11:07:43the leads? Like, where did they where
  21868. 11:07:45did they come? Well, there's an
  21869. 11:07:46additional step that we have to do
  21870. 11:07:48before we actually get the leads.
  21871. 11:07:51Because right here, this is running the
  21872. 11:07:52actor. Once we finish running the actor,
  21873. 11:07:54what we get is something called a
  21874. 11:07:56default data set ID, which you can find
  21875. 11:07:58here. Default data set ID. This is the
  21876. 11:08:00ID that we then give to the next node,
  21877. 11:08:03which is, let me pin this real quick, so
  21878. 11:08:05I don't have to run this again, the
  21879. 11:08:06Apify
  21880. 11:08:08uh get data set items, right here.
  21881. 11:08:13Same connection, data set, get all
  21882. 11:08:15items, and now we give the ID to this
  21883. 11:08:17node, which is the one below here,
  21884. 11:08:22to then be able to extract the details
  21885. 11:08:24from that output. And I'm going to put
  21886. 11:08:26the limit to 500.
  21887. 11:08:27I'm going to execute this step.
  21888. 11:08:29So, you can see now we get 100 items,
  21889. 11:08:31which are the 100 leads, which is first
  21890. 11:08:33name, last name, name, LinkedIn URL,
  21891. 11:08:35title, email status, photo URL, Twitter,
  21892. 11:08:37we get employment history, we get a
  21893. 11:08:39bunch of stuff, employment history, a
  21894. 11:08:40bunch of employment history. We get
  21895. 11:08:42street address, we get organization, we
  21896. 11:08:44get a bunch of stuff. We get everything
  21897. 11:08:45about the actual profile, which is
  21898. 11:08:46amazing. [music] And once this is done,
  21899. 11:08:48then we have to go to the next steps.
  21900. 11:08:49So, let me go here. Let me make this
  21901. 11:08:51green. Let me make this green. The next
  21902. 11:08:53step is actually generating a
  21903. 11:08:54personalized connection message using
  21904. 11:08:57AI.
  21905. 11:08:57>> [music]
  21906. 11:08:57>> Now, there's only one thing in between
  21907. 11:08:59this and the AI. Because when we think
  21908. 11:09:01about this, if I just add an AI step, so
  21909. 11:09:03AI, OpenAI,
  21910. 11:09:05message model, and so on, right? Let me
  21911. 11:09:07just configure this later.
  21912. 11:09:08This will basically send 100 items all
  21913. 11:09:11at the same time to the AI. And if you
  21914. 11:09:13want to something more scalable, ideally
  21915. 11:09:15you want to send maybe 20 at first, and
  21916. 11:09:17then loop back and do another 20, and
  21917. 11:09:20another 20, another 20, until it's
  21918. 11:09:22finished. Because [music] then you give
  21919. 11:09:22it space, you give it time or room to
  21920. 11:09:24breathe, to then be able to actually
  21921. 11:09:26generate a better output, or for it not
  21922. 11:09:28to fail. So, in order for us to be able
  21923. 11:09:30to send only 20 at a time, and then it
  21924. 11:09:32finishes the whole thing, and then goes
  21925. 11:09:33back in 20 at a time, we use something
  21926. 11:09:35called loop over items. So, if I go to
  21927. 11:09:37loop over items right here,
  21928. 11:09:40the only thing that this ask you is,
  21929. 11:09:41hey, how many items do you want to send
  21930. 11:09:43through at a time?
  21931. 11:09:44Well, in this case, we want to send 20,
  21932. 11:09:46right? Let me delete this.
  21933. 11:09:48So, you can go here, delete,
  21934. 11:09:50and delete. And now, using the loop
  21935. 11:09:53output, we're going to go here.
  21936. 11:09:55And it's basically saying, hey, okay, we
  21937. 11:09:56have 100 items. If I run this,
  21938. 11:09:59it should run.
  21939. 11:10:00Or not. Oh, it shouldn't run, yeah, cuz
  21940. 11:10:02this is just the the actual node. Oh, it
  21941. 11:10:04should run. Then it shows us that out of
  21942. 11:10:05100 items, it only sent 20 items
  21943. 11:10:07through.
  21944. 11:10:08So, that we have 20 items, and then we
  21945. 11:10:10use the AI to generate the personal
  21946. 11:10:12message, we then give it to the Google
  21947. 11:10:13Sheet, then we send it back here, and
  21948. 11:10:15get the next 20 items, and do the whole
  21949. 11:10:17thing again, until it's actually
  21950. 11:10:18finished.
  21951. 11:10:19And this works for any amount of items,
  21952. 11:10:21even if you have 5,000. It will always
  21953. 11:10:23loop back, right? And this is a a cheat
  21954. 11:10:25code that I like to use whenever you
  21955. 11:10:26want to make your automations more
  21956. 11:10:27scalable over time. Cuz again, adding
  21957. 11:10:29one more step, you're not going to pay
  21958. 11:10:30more, cuz the N8N you pay by workflow
  21959. 11:10:33execution, not by step, uh which is
  21960. 11:10:35exactly why I like to use this. So, now
  21961. 11:10:37we want to be able to
  21962. 11:10:39generate
  21963. 11:10:41connection
  21964. 11:10:42message.
  21965. 11:10:43Okay?
  21966. 11:10:45I'll go in here. Again, you already
  21967. 11:10:47connected your OpenAI
  21968. 11:10:48on these steps, you can use the same
  21969. 11:10:50exact connection. Let's just use GPT-4
  21970. 11:10:521. Yeah, you can use this. 4.1 mini, I
  21971. 11:10:54think it's good. Um and the user, so in
  21972. 11:10:56this case, system prompt first, because
  21973. 11:10:57we always use a system prompt to give it
  21974. 11:10:59an identity, to make itself think that
  21975. 11:11:01it actually is that thing, and the
  21976. 11:11:02quality of output would be better, um
  21977. 11:11:04is, you are a helpful
  21978. 11:11:07intelligent writing assistant. And this
  21979. 11:11:10is always how you should structure your
  21980. 11:11:11prompts. Always a system prompt first,
  21981. 11:11:13and then, sorry about that, um and then
  21982. 11:11:15a user prompt, and then you can do
  21983. 11:11:17another user prompt, or whatever it is
  21984. 11:11:18you have to do. Now, for the sake of
  21985. 11:11:19time, I'm not going to be writing the
  21986. 11:11:21prompts from scratch again, um I'm going
  21987. 11:11:23to paste them here and then show you
  21988. 11:11:24exactly why they're there and how they
  21989. 11:11:26work. All right, so I just pasted the
  21990. 11:11:27prompt. Let's go through one by one. We
  21991. 11:11:28have a system prompt, as I wrote before.
  21992. 11:11:30Then we have the user prompt, the first
  21993. 11:11:32one, which is, your task is to take an
  21994. 11:11:33input of a bunch of LinkedIn profiles,
  21995. 11:11:35and then you basically have to return an
  21996. 11:11:37icebreaker. So, the icebreaker is the
  21997. 11:11:38connection message. Um in order to
  21998. 11:11:40ensure the icebreaker punchy and high
  21999. 11:11:41quality, make them follow this template.
  22000. 11:11:43So, we give it a template that they can
  22001. 11:11:45use, um
  22002. 11:11:46and they can say, hey, hey name, love
  22003. 11:11:49seeing thing about them, so you can say
  22004. 11:11:50something specific about them. I'm also
  22005. 11:11:52into plausible tie-in, which is
  22006. 11:11:53something more specific about them. Um
  22007. 11:11:56and then you can say, four thing about
  22008. 11:11:57them and plausible tie-in. Never use the
  22009. 11:11:59exact information provided in LinkedIn
  22010. 11:12:00field, instead always paraphrase. This
  22011. 11:12:02makes it seem more human written. You
  22012. 11:12:04basically give it a few instructions
  22013. 11:12:05that they can use. But this is
  22014. 11:12:07essentially the structure that we use.
  22015. 11:12:09Okay, and these variables are the thing
  22016. 11:12:10that we change every single time, that
  22017. 11:12:11the AI is smart enough to change, um
  22018. 11:12:14when we give it the actual data from
  22019. 11:12:15that person. The next prompt that we
  22020. 11:12:17give it is another user prompt. So, now
  22021. 11:12:20this is where we start to get to
  22022. 11:12:21examples. So, this is where we start to
  22023. 11:12:23use the assistant prompt. Uh the first
  22024. 11:12:25thing is a user and then assistant. So,
  22025. 11:12:27in this case, we're giving it an example
  22026. 11:12:28because we want it to, I guess, have
  22027. 11:12:30something in mind that it can come back
  22028. 11:12:32to as expectations of what we expect the
  22029. 11:12:34output to be. So, we give it an example,
  22030. 11:12:36in this case, LinkedIn fields, Daniel,
  22031. 11:12:38um founder and CEO, creative agency, uh
  22032. 11:12:40regional sales director, previous
  22033. 11:12:42experiences. And then we actually give
  22034. 11:12:43an assistant prompt, which is the output
  22035. 11:12:46that we should expect in JSON, which is,
  22036. 11:12:48hey Daniel, love seeing your creative
  22037. 11:12:49agency journey. I'm also building brands
  22038. 11:12:51that I connect. Something short and
  22039. 11:12:52sweet, very very uh personalized, and
  22040. 11:12:54very human, right? Um
  22041. 11:12:57which is what we want. So, we give it a
  22042. 11:12:58user and assistant. And then lastly, we
  22043. 11:13:00give it the actual data that we want it
  22044. 11:13:02to use, uh to be able to then make the
  22045. 11:13:04icebreaker. So, LinkedIn fields can be
  22046. 11:13:07first name, the last name, which we get
  22047. 11:13:09from here. The first name, last name,
  22048. 11:13:11LinkedIn URL, title, uh I believe that
  22049. 11:13:13we have previous experience. So, the
  22050. 11:13:15company they work for, and there's a
  22051. 11:13:16bunch of fields here. Again, if you get
  22052. 11:13:18the template, you can copy this like
  22053. 11:13:19literally word for word, and prompt by
  22054. 11:13:21prompt, um so you don't have to do this
  22055. 11:13:23again. But we give it different fields,
  22056. 11:13:25as you can see here, for it to use to
  22057. 11:13:27then make the icebreaker. Okay? So, now,
  22058. 11:13:29let me pin this.
  22059. 11:13:31Let me pin this, I think. I can pin
  22060. 11:13:33this. No, I can't pin this.
  22061. 11:13:34Um and let me execute this step. So, now
  22062. 11:13:37I'm testing [music] this. All right, so
  22063. 11:13:38the output uh was done, and as you can
  22064. 11:13:40see here, I actually messed up because I
  22065. 11:13:42forgot to turn this on.
  22066. 11:13:45So, you can see here, the content that
  22067. 11:13:46we got was actual JSON. Well, we don't
  22068. 11:13:49want the actual JSON, we want this right
  22069. 11:13:50here.
  22070. 11:13:52Right, so what we do to fix that is turn
  22071. 11:13:54this on.
  22072. 11:13:55And now, if we execute this step again,
  22073. 11:13:57what this should do now is it should
  22074. 11:14:00actually output the icebreaker not in
  22075. 11:14:02JSON, but as an actual sentence. All
  22076. 11:14:03right, so you can see here we have the
  22077. 11:14:04icebreaker, uh different from before
  22078. 11:14:06because it's not in JSON anymore, it's
  22079. 11:14:08an actual like something that we can
  22080. 11:14:09actually use.
  22081. 11:14:10And lastly, this is where we get to the
  22082. 11:14:13Google Sheet. So,
  22083. 11:14:14this right here, all good, and now we
  22084. 11:14:17get to the Google Sheet part. Let's go
  22085. 11:14:18here.
  22086. 11:14:19I'm going to press plus.
  22087. 11:14:21Google Sheet.
  22088. 11:14:22Uh append a row in a sheet.
  22089. 11:14:25First of all, make your connection. Just
  22090. 11:14:26sign in with Google.
  22091. 11:14:28Or yeah, sign in with Google right here.
  22092. 11:14:30It will take you to a page like this.
  22093. 11:14:32You can choose your account and then you
  22094. 11:14:33will come back say successful and
  22095. 11:14:34everything's good.
  22096. 11:14:36Now, I already made the sheet, but I'm
  22097. 11:14:37going to make it again um because I want
  22098. 11:14:39to show you exactly what it looks like
  22099. 11:14:40even making the sheet. Let's go to
  22100. 11:14:41sheets.new, quick hack to make a new
  22101. 11:14:43Google Sheet. And then, as you can see,
  22102. 11:14:46we need different fields. So, if I go
  22103. 11:14:47here, I can see that the different
  22104. 11:14:48fields are ID, first name, last name,
  22105. 11:14:50LinkedIn URL. So, ID,
  22106. 11:14:52first name,
  22107. 11:14:55last name.
  22108. 11:14:57Let's do LinkedIn
  22109. 11:15:00URL cuz I noticed that
  22110. 11:15:02this is just a name, the first name as
  22111. 11:15:04well. Then we have title,
  22112. 11:15:06email status.
  22113. 11:15:08I don't know if you need this cuz
  22114. 11:15:09there's no email that we're getting. Uh
  22115. 11:15:10so, title, photo URL, and icebreaker.
  22116. 11:15:12Title,
  22117. 11:15:13photo URL,
  22118. 11:15:15and then connection message.
  22119. 11:15:18Let me make this
  22120. 11:15:20um
  22121. 11:15:21dark blue. Make this white.
  22122. 11:15:24Let me make it look pretty.
  22123. 11:15:27Perfect. Go here.
  22124. 11:15:29And then, quick hack.
  22125. 11:15:31View this. Please have the row numbers.
  22126. 11:15:33If I go like this, I can still see it.
  22127. 11:15:35All right. So, now that we have this, I
  22128. 11:15:36can do connection
  22129. 11:15:39message
  22130. 11:15:41LinkedIn
  22131. 11:15:42and N YouTube tutorial. Really long
  22132. 11:15:45name. Just so I know exactly what this
  22133. 11:15:46is. If I go back here, I can see that
  22134. 11:15:48now I can uh resource is the sheet
  22135. 11:15:51within document. Then we want to append
  22136. 11:15:53a row. Append just means add. And then,
  22137. 11:15:55the document that we want to use is the
  22138. 11:15:57connection message LinkedIn and N
  22139. 11:15:58YouTube tutorial. There we go. Right
  22140. 11:16:00here. And the sheet will be sheet one.
  22141. 11:16:02We want to map each column manually.
  22142. 11:16:04And now, this is where we start adding
  22143. 11:16:06the different fields. So, I can go to
  22144. 11:16:07ID.
  22145. 11:16:08Yeah, this is the ID.
  22146. 11:16:11I think. Yeah, yeah, this is ID. Let me
  22147. 11:16:12go first name.
  22148. 11:16:15First name
  22149. 11:16:17right here.
  22150. 11:16:18Last name
  22151. 11:16:20Again, you could like you could spend a
  22152. 11:16:22few minutes like trying to figure out
  22153. 11:16:24where everything is right here.
  22154. 11:16:26I just like to put everything here. I
  22155. 11:16:28mean, you could also do this, right? Or
  22156. 11:16:29title.
  22157. 11:16:31Or photo URL. Yeah, maybe I was just
  22158. 11:16:33tripping. Maybe we should do this
  22159. 11:16:35uh save us more time. And then, the
  22160. 11:16:36icebreaker is the thing that we use as
  22161. 11:16:38the connection message. I think that's
  22162. 11:16:40it.
  22163. 11:16:42Right?
  22164. 11:16:43Let's rename this. Add leads
  22165. 11:16:47to Google
  22166. 11:16:48Sheets.
  22167. 11:16:50Let me save this. Uh and now, you see
  22168. 11:16:53this ends.
  22169. 11:16:54This right here now needs to go back to
  22170. 11:16:57loop of items behind.
  22171. 11:16:59There we go.
  22172. 11:17:00So, that we loop 20
  22173. 11:17:02and then we go back here, get the next
  22174. 11:17:0320, the next 20, the next 20 until we
  22175. 11:17:05get these many items.
  22176. 11:17:07Okay? So, we do everything we split
  22177. 11:17:09Basically, we split it. We loop over
  22178. 11:17:10items. That's what this is. All right.
  22179. 11:17:12So,
  22180. 11:17:13let me execute the step. Let me test
  22181. 11:17:15this thing right here.
  22182. 11:17:16Um I should be able to see different
  22183. 11:17:19leads coming through. If I don't, then
  22184. 11:17:21something is wrong.
  22185. 11:17:22We can fix it. Okay.
  22186. 11:17:25This has to run first.
  22187. 11:17:27And then, we can wait for everything to
  22188. 11:17:28go to the Google Sheet. Right now, it's
  22189. 11:17:29running. We can see that now we have the
  22190. 11:17:31different leads. So, ID, first name,
  22191. 11:17:33last name, LinkedIn URL.
  22192. 11:17:35Let's go here. There we go. Gino, what
  22193. 11:17:37is up, my man? Real estate agency.
  22194. 11:17:41There we go. This is so good. I mean,
  22195. 11:17:42you can actually just
  22196. 11:17:44I can't. Yeah, you can actually just
  22197. 11:17:46connect to them. So, connect add a note,
  22198. 11:17:48and then literally just go here.
  22199. 11:17:50Uh no, here. Copy this. Go here, paste
  22200. 11:17:53it, and then actually just send it.
  22201. 11:17:56Let me actually just send it. There we
  22202. 11:17:57go.
  22203. 11:17:58Boom.
  22204. 11:17:59That's it. And that's how your outbound
  22205. 11:18:00campaigns can actually run. And you can
  22206. 11:18:02do this for every single one. And the
  22207. 11:18:03best thing is you saw me do it manually,
  22208. 11:18:05but there's so many softwares that can
  22209. 11:18:07automate this. See, you simply can have
  22210. 11:18:09a machine running through in the back
  22211. 11:18:10end that's personalized like hyper
  22212. 11:18:12personalized to each person because
  22213. 11:18:14again, you can only send 30 connections
  22214. 11:18:16a day maximum. I mean, you can, but you
  22215. 11:18:18you you risk getting banned on LinkedIn.
  22216. 11:18:20So, if you have an automated platform,
  22217. 11:18:22you can only send 30 a day. So, 30 * 30
  22218. 11:18:26900.
  22219. 11:18:27Like typically, you would only need a
  22220. 11:18:28900 leads right here every single month.
  22221. 11:18:31God, why do I keep going back to this?
  22222. 11:18:32Um you would only need 900 leads right
  22223. 11:18:34here every single month you can go
  22224. 11:18:36through. And again, we can script 5,000
  22225. 11:18:38for free every single month. So, this is
  22226. 11:18:40literally a no-brainer. Like everyone
  22227. 11:18:41should be using this if you want um to
  22228. 11:18:44to I guess run a campaign or run
  22229. 11:18:46something in the back end that can work.
  22230. 11:18:47Because
  22231. 11:18:48the alternative is just you doing it
  22232. 11:18:50manually.
  22233. 11:18:53Hey, in this video, I'm going to build a
  22234. 11:18:55full sales coach system inside of N and
  22235. 11:18:58N that takes the transcript of every
  22236. 11:18:59single one of my calls. It sends it to a
  22237. 11:19:01custom sales coach GPT that is trained
  22238. 11:19:04on the best sales frameworks in the
  22239. 11:19:06world. And then, it delivers a full
  22240. 11:19:07[music] breakdown on Slack with
  22241. 11:19:08everything that I could have done
  22242. 11:19:09better. By the way, this is literally
  22243. 11:19:11the exact system that we sold [music] to
  22244. 11:19:12a business for 3K. So, the first part of
  22245. 11:19:14the automation is actually me ending the
  22246. 11:19:16call, which triggers a webhook. Means it
  22247. 11:19:18sends the data to N and saying, "Hey, we
  22248. 11:19:20just finished a call. Review it." Right?
  22249. 11:19:22Now, obviously, I can't do that right
  22250. 11:19:23now cuz I'm not on call. But what I'll
  22251. 11:19:24do is I'll send a request to this
  22252. 11:19:26webhook so you can see what it actually
  22253. 11:19:28looks like. So, we finished the call.
  22254. 11:19:29Let me send the data here.
  22255. 11:19:31What it does then is it uses Fireflies,
  22256. 11:19:32which is the software that we're using
  22257. 11:19:34for meeting notes to extract the
  22258. 11:19:35transcript. Then we're sending it to a
  22259. 11:19:37sales coach GPT, which is on our
  22260. 11:19:39platform the OpenAI
  22261. 11:19:41platform here, which is trained on a
  22262. 11:19:44document,
  22263. 11:19:45which is this one right here, which has
  22264. 11:19:47a bunch of frameworks and questions that
  22265. 11:19:49you should ask uh for different parts of
  22266. 11:19:51the call, which analyzes the full call
  22267. 11:19:52based on our framework, and then sends
  22268. 11:19:54us a message on Slack right here. We can
  22269. 11:19:56see that it broke down the start of the
  22270. 11:19:58call and also the objections, clarifying
  22271. 11:20:00objections. So, you missed an
  22272. 11:20:01opportunity to clarify the prospect's
  22273. 11:20:03objectives early on. A question like,
  22274. 11:20:04"What specific outcomes are you hoping
  22275. 11:20:06to achieve from this automation?" would
  22276. 11:20:08have set clear expectations and
  22277. 11:20:09direction. That's pretty true. Instead,
  22278. 11:20:11you asked, "Can you run me through your
  22279. 11:20:12company first?" which turned the focus
  22280. 11:20:14away from the immediate needs. Now,
  22281. 11:20:15that's pretty good uh framework. I of
  22282. 11:20:17course I was this few months back, so I
  22283. 11:20:19wasn't the best closer.
  22284. 11:20:21I was trying my best. But there you go.
  22285. 11:20:23So, it took all the call and it analyzed
  22286. 11:20:25it based on this exact framework, right?
  22287. 11:20:28Which is a framework that we use in
  22288. 11:20:29sales. I'm going to start from zero, so
  22289. 11:20:30I'm going to go plus
  22290. 11:20:32workflow, personal, and then start from
  22291. 11:20:34zero.
  22292. 11:20:35So, you get to see what it actually
  22293. 11:20:36looks like. And we can start. And as
  22294. 11:20:38always, we never start here, but we
  22295. 11:20:40start here, right? Because we want to
  22296. 11:20:42map things out before we build it. So,
  22297. 11:20:43every automation that we build has an
  22298. 11:20:45input
  22299. 11:20:46and has an output.
  22300. 11:20:48Right?
  22301. 11:20:50So, the input in this case, let me make
  22302. 11:20:52this unbold.
  22303. 11:20:54And by the way, if you're wondering what
  22304. 11:20:55platform I'm using, it's Miro. Very
  22305. 11:20:56good.
  22306. 11:20:57Uh the input in this case will be
  22307. 11:20:59the call
  22308. 11:21:01recording.
  22309. 11:21:02Or call transcript, right?
  22310. 11:21:06This is a pretty easy system. I'm not
  22311. 11:21:07going to lie. But it is one of the most
  22312. 11:21:09ROI. I mean, you'll find is that the
  22313. 11:21:10easiest systems, not the easiest, but uh
  22314. 11:21:12the ones that are easier to build that
  22315. 11:21:14are not super complex with 50 AI agents,
  22316. 11:21:16uh they're typically the ones that give
  22317. 11:21:17the business the most value.
  22318. 11:21:20Okay. So, call transcript, which is a
  22319. 11:21:21transcript of the call. And by
  22320. 11:21:22transcript, we mean what's everything
  22321. 11:21:24that has been said. And we know this
  22322. 11:21:26works because we have meeting note
  22323. 11:21:28takers. So, for those of you who don't
  22324. 11:21:29know what meeting note takers are, let's
  22325. 11:21:31go to Fireflies, for example.
  22326. 11:21:33Right here.
  22327. 11:21:34Fireflies, not this, but this
  22328. 11:21:37is a note taker, right? What this does
  22329. 11:21:39is that it joins the calls when you're
  22330. 11:21:41on a call with a client. So, you hop on
  22331. 11:21:43a call with the client and you let it
  22332. 11:21:44in, and it's sort of like a
  22333. 11:21:46like a live note taker. So, it's there.
  22334. 11:21:48It doesn't speak, of course. It just
  22335. 11:21:49takes notes and it transcribes the call
  22336. 11:21:52so you can then use it for whatever it
  22337. 11:21:53is. I typically have uh the note taker
  22338. 11:21:56on every single call just because it's
  22339. 11:21:58great if you missed anything on the call
  22340. 11:21:59that you want to look back or action
  22341. 11:22:01items or things like these, which are
  22342. 11:22:02great.
  22343. 11:22:04That's what we would typically do. So,
  22344. 11:22:05call transcript, we would use Fireflies.
  22345. 11:22:07Let me put here
  22346. 11:22:09Fireflies. You also have Fathom, you
  22347. 11:22:11have Sybill.ai, you have Loom. Uh
  22348. 11:22:14there's a ton of stuff that you that you
  22349. 11:22:15have in the market. Um they're all
  22350. 11:22:17pretty good. So, call transcript, and
  22351. 11:22:18then we want to basically send it
  22352. 11:22:22to the GPT, sales GPT.
  22353. 11:22:26We'll have to make a GPT on the OpenAI
  22354. 11:22:29platform, which is actually very easy,
  22355. 11:22:30so don't worry. Uh to
  22356. 11:22:33to analyze call.
  22357. 11:22:37Let me make this here.
  22358. 11:22:38And then,
  22359. 11:22:40we have to
  22360. 11:22:41send Slack message
  22361. 11:22:45with breakdown.
  22362. 11:22:46With feedback.
  22363. 11:22:50There we go.
  22364. 11:22:51See, crazy system. $3,000 for something
  22365. 11:22:53like this uh that took me about what, 1
  22366. 11:22:56to 2 hours cuz it was the first time. Uh
  22367. 11:22:58but if I were to sell it to another
  22368. 11:22:59person, it would take maybe 30 minutes.
  22369. 11:23:03It all really depends on what document
  22370. 11:23:04you're using to the GPT to actually
  22371. 11:23:05compare the sales call. All right. So,
  22372. 11:23:08with that said, let's start here. Uh
  22373. 11:23:09let's start with the first step, which
  22374. 11:23:11is call transcript. So, because we're
  22375. 11:23:12using Fireflies, what I'm going to do is
  22376. 11:23:14I'm going to open up.
  22377. 11:23:16And you're going to have to make an
  22378. 11:23:16account. I have the free account, so I'm
  22379. 11:23:18not paying for this. And you can see
  22380. 11:23:20here I have meetings.
  22381. 11:23:21I have all the meetings with everyone
  22382. 11:23:23that I've had. I believe that I'm above
  22383. 11:23:24the rate, which is cuz they give you
  22384. 11:23:25like
  22385. 11:23:26600 minutes of free free calls. But
  22386. 11:23:29here's all the meetings that I have. And
  22387. 11:23:31so, with every single meeting that I've
  22388. 11:23:32had,
  22389. 11:23:33we can transcribe it and use this exact
  22390. 11:23:35automation, which is amazing. And
  22391. 11:23:36especially cuz I've had days where I've
  22392. 11:23:38had five calls, and so I wanted every
  22393. 11:23:41single call transcribed and give me
  22394. 11:23:42feedback and so on. And it happens
  22395. 11:23:44instantly cuz it's right after the call.
  22396. 11:23:45So, where am I going with this? We have
  22397. 11:23:47to go here
  22398. 11:23:48to the settings. And then, we go to
  22399. 11:23:50developer settings here, and we can see
  22400. 11:23:52that we have two different things. So,
  22401. 11:23:53we're just going to play around with
  22402. 11:23:54these two different things. So, the
  22403. 11:23:55first thing is the API key, which is
  22404. 11:23:57sort of like a password. If you use
  22405. 11:23:58ChatGPT in your automations or Claude or
  22406. 11:24:00Gemini or Grok or OpenRouter, you always
  22407. 11:24:02need an API key, which is a password.
  22408. 11:24:04>> [music]
  22409. 11:24:04>> And then, we have a webhook. And this is
  22410. 11:24:06really why we're able to make this
  22411. 11:24:07automation happen is because we
  22412. 11:24:11can transcribe. It's triggered when
  22413. 11:24:13transcription is completed. What this
  22414. 11:24:15means is that you go on a call with the
  22415. 11:24:16client, it finishes, it then finishes
  22416. 11:24:18transcribing the call, which takes about
  22417. 11:24:203-5 seconds, and then it sends a signal
  22418. 11:24:23to the automation saying, "Hey, this is
  22419. 11:24:24the meeting recording, or this is the
  22420. 11:24:26meeting ID." And then [music]
  22421. 11:24:28we send it to the next step to take the
  22422. 11:24:29meeting ID and then take the transcript
  22423. 11:24:31from the call, okay? It will make much
  22424. 11:24:33more sense once I actually build it. Uh
  22425. 11:24:35but bear in mind that we are able to
  22426. 11:24:36send a notification to the automation
  22427. 11:24:38once a meeting is finished.
  22428. 11:24:40So, the first step is actually adding
  22429. 11:24:41the webhook. So, if I go to N and N
  22430. 11:24:43right here, I can add a first step,
  22431. 11:24:44which is a trigger, which is what is the
  22432. 11:24:46thing [music] that starts the
  22433. 11:24:47automation. And here we have on webhook
  22434. 11:24:49call.
  22435. 11:24:50So, again, webhook is just a URL of that
  22436. 11:24:52people use, or that servers use, to send
  22437. 11:24:54signals back and forth, right? So, the
  22438. 11:24:57webhook is made right here. You don't
  22439. 11:24:58have to do anything. Just get this.
  22440. 11:25:01Just press on it, you copy it, and then,
  22441. 11:25:03if you go back to Fireflies,
  22442. 11:25:05you can paste it here.
  22443. 11:25:06And you press save.
  22444. 11:25:08Now, very important thing that we
  22445. 11:25:10currently have a test webhook,
  22446. 11:25:12right? If you want to go in production,
  22447. 11:25:14so if you want to
  22448. 11:25:15make this live, activate this, you have
  22449. 11:25:17to change this to a production URL. The
  22450. 11:25:20only difference is is that this
  22451. 11:25:23has this,
  22452. 11:25:25and production doesn't, right? That's
  22453. 11:25:26it. So, [music] in theory now, if you
  22454. 11:25:28have a call with the client, and you
  22455. 11:25:29bring in Fireflies, then once the call
  22456. 11:25:31is finished, it will send a signal to
  22457. 11:25:32this webhook. So, as I mentioned, I'm
  22458. 11:25:34not able to be on a call right now, but
  22459. 11:25:36I have the request that we typically get
  22460. 11:25:38from the call recording, right? Now, in
  22461. 11:25:40order for us to send a example request,
  22462. 11:25:42we're going to go to Postman API,
  22463. 11:25:44which is a new thing that I haven't
  22464. 11:25:45introduced before. Uh but it actually is
  22465. 11:25:47a really, really good software. It's
  22466. 11:25:49actually very easy to use. It looks a
  22467. 11:25:50bit fancy and techy as well. Um but we
  22468. 11:25:53use this when we are testing webhooks,
  22469. 11:25:56right? Because something like this to
  22470. 11:25:58test it, you would have to go on a call,
  22471. 11:26:00you have to finish the call, you need to
  22472. 11:26:01say something on the call, and it will
  22473. 11:26:03take too much time for it to test. So,
  22474. 11:26:05what we do here is we set up a sample
  22475. 11:26:07request, example request. [music]
  22476. 11:26:09The first thing we need is to
  22477. 11:26:11um to add a URL,
  22478. 11:26:13which is this right here.
  22479. 11:26:16So, copy this
  22480. 11:26:18and paste it here.
  22481. 11:26:20And we want to make sure that this is
  22482. 11:26:21post
  22483. 11:26:22because get is getting information, post
  22484. 11:26:23is sending information. So, in this
  22485. 11:26:25case, we're sending information to the
  22486. 11:26:26webhook, and because that is post, we
  22487. 11:26:28also have to change this to post. There
  22488. 11:26:30you go.
  22489. 11:26:31And then we need the body, raw. So, this
  22490. 11:26:33is a JSON. JSON is just a language that
  22491. 11:26:35we communicate software to software, and
  22492. 11:26:37we have to set up the request. So, we
  22493. 11:26:39have to set up the actual variables that
  22494. 11:26:41go into the webhook for it to start the
  22495. 11:26:43automation, which are the ones right
  22496. 11:26:44here. So, you get a meeting ID and event
  22497. 11:26:46type. So, right here, if I listen for
  22498. 11:26:48test events,
  22499. 11:26:49I can press send,
  22500. 11:26:51and this will send the information here.
  22501. 11:26:53So, again, if this looks a bit
  22502. 11:26:54complicated, just understand that we're
  22503. 11:26:56not able to test this. Okay, I have to
  22504. 11:26:57be on a call. So, we're using Postman
  22505. 11:26:59API to send a sample request here. And
  22506. 11:27:01this is exactly what we would get every
  22507. 11:27:03single time when the call finishes. So,
  22508. 11:27:04it's purely just for testing. As in,
  22509. 11:27:06when we go live, we don't use Postman
  22510. 11:27:08API, we just use the webhook from the
  22511. 11:27:09Fireflies. Now that we have the meeting
  22512. 11:27:11ID, and we don't have the transcript,
  22513. 11:27:13we now have to figure out how to take
  22514. 11:27:15this transcript from this meeting ID.
  22515. 11:27:17So, meeting ID is like a unique
  22516. 11:27:19identifier for every single call that
  22517. 11:27:20you have.
  22518. 11:27:21And so, if I go to Fireflies meetings,
  22519. 11:27:24and I go to like a random one, say on
  22520. 11:27:27here, this one right here.
  22521. 11:27:29The URL on the top,
  22522. 11:27:31if I go here, I can see that this is the
  22523. 11:27:33meeting ID. So, the URL is pretty
  22524. 11:27:34standard, and the only thing that
  22525. 11:27:36changes is the meeting ID and the
  22526. 11:27:38meeting name. So, going back here, we
  22527. 11:27:39have to take the meeting ID, which I can
  22528. 11:27:41pin now. I don't have to use Postman API
  22529. 11:27:42anymore.
  22530. 11:27:44Uh and then we can
  22531. 11:27:46um look for Fireflies
  22532. 11:27:48right here, Fireflies. You would have to
  22533. 11:27:50install the thing. It only takes like 5
  22534. 11:27:51seconds, so it's fine.
  22535. 11:27:52>> [music]
  22536. 11:27:53>> And now we want to get the transcript,
  22537. 11:27:55get transcript.
  22538. 11:27:57So, as you can see, to get the
  22539. 11:27:58transcript, we just have to put the
  22540. 11:27:59transcript ID. Now, the first thing you
  22541. 11:28:01have to do is go here,
  22542. 11:28:02create a new credential, you have to get
  22543. 11:28:04the API key, which you can get here.
  22544. 11:28:06Uh what was it? Settings, developer
  22545. 11:28:09settings, and API key. Just copy this
  22546. 11:28:11and paste it here to connect your
  22547. 11:28:12account. Choose the right account. And
  22548. 11:28:14now the resource, which is what is the
  22549. 11:28:16thing that we are changing, or in
  22550. 11:28:18general, what are we doing? In this
  22551. 11:28:19case, it'll be transcript. The
  22552. 11:28:20operation, which is what is the action
  22553. 11:28:22that we're doing? And you can do a bunch
  22554. 11:28:23of stuff.
  22555. 11:28:25And the transcript ID, which we get from
  22556. 11:28:27here,
  22557. 11:28:28meeting ID.
  22558. 11:28:30By the way, most of these variables,
  22559. 11:28:31you don't actually have to know
  22560. 11:28:32anything. You just have to know the
  22561. 11:28:33body, which is the actual variables that
  22562. 11:28:35we get, which is the meeting ID and
  22563. 11:28:37event type. And that's it. So, now that
  22564. 11:28:38we have the transcript ID, we can press
  22565. 11:28:40execute step.
  22566. 11:28:42This will now, I believe, take the
  22567. 11:28:43transcript. Yep. And the problem is that
  22568. 11:28:46we have an array. So, it didn't give us
  22569. 11:28:48the transcript all together. It gave us
  22570. 11:28:50different bits of the transcript.
  22571. 11:28:52Sentence one, sentence two, and this,
  22572. 11:28:55well, being a 12-minute call, is really,
  22573. 11:28:57really long.
  22574. 11:28:58See, we have about 444 sentences. It
  22575. 11:29:01breaks up the transcript into sentences.
  22576. 11:29:03But naturally, the thing you want to do
  22577. 11:29:04here is take the sentences and put them
  22578. 11:29:06all together. So, the next step is to do
  22579. 11:29:08that. So, we have to pin this,
  22580. 11:29:10and then And by the way, I'm pinning
  22581. 11:29:11this so I don't have to rerun it again.
  22582. 11:29:13I can go to edit fields, which is
  22583. 11:29:15basically taking a sort of variable and
  22584. 11:29:16changing it, manipulating data, right?
  22585. 11:29:19And we're trying to get the sentences,
  22586. 11:29:21which are all the way here, really,
  22587. 11:29:22really long, and put them all together.
  22588. 11:29:25To do that, we can just call this
  22589. 11:29:26transcript. So, I'm setting a variable.
  22590. 11:29:29And now if I go full screen, I can
  22591. 11:29:32sentences, cuz this is the array. Again,
  22592. 11:29:34an array is this whole thing full of all
  22593. 11:29:36the variables together.
  22594. 11:29:38And we just want to extract the raw
  22595. 11:29:39text. And to do that, you have to go
  22596. 11:29:41here.
  22597. 11:29:44I believe that is map.
  22598. 11:29:46Yeah, map, cuz we're mapping. We're
  22599. 11:29:48saying, "Hey, inside this, I want raw
  22600. 11:29:50text."
  22601. 11:29:52So, it'll be item
  22602. 11:29:53equals item. dot
  22603. 11:29:56uh raw underscore text.
  22604. 11:30:00There you go.
  22605. 11:30:01You see how we have all the sentences
  22606. 11:30:02here right now?
  22607. 11:30:04All the sentences.
  22608. 11:30:05And the last thing is to actually join
  22609. 11:30:08them. So, join,
  22610. 11:30:09which is basically taking out all the
  22611. 11:30:10quote marks, and we just have a full
  22612. 11:30:12transcript of a call instead
  22613. 11:30:15of
  22614. 11:30:17this, right? Sentences.
  22615. 11:30:19With a bunch of variables that are so,
  22616. 11:30:21so long.
  22617. 11:30:22Cuz we could, theoretically, feed this
  22618. 11:30:23to AI, but it would just be way too
  22619. 11:30:25large. It would break, definitely break.
  22620. 11:30:27So, we just have the transcript that we
  22621. 11:30:28need.
  22622. 11:30:29Okay, so what do we do? We took the
  22623. 11:30:30sentences, cuz there's 450 sentences or
  22624. 11:30:33more. Let me just scroll a little bit
  22625. 11:30:34down.
  22626. 11:30:35And we're taking the raw text, which is
  22627. 11:30:37the actual text from that sentence. So,
  22628. 11:30:38we just have all the sentences together.
  22629. 11:30:40And this is the formula that we use.
  22630. 11:30:42Map,
  22631. 11:30:43item, item. The actual name of the item,
  22632. 11:30:45which is raw text,
  22633. 11:30:47plus [music] join, so dot join, which is
  22634. 11:30:49joining everything together. And that's
  22635. 11:30:51it. So, now that we have the transcript,
  22636. 11:30:53we can execute step,
  22637. 11:30:54and the JSON will just be the whole
  22638. 11:30:56transcript. So, I'm going to rename this
  22639. 11:30:58to
  22640. 11:31:00clean
  22641. 11:31:01transcript.
  22642. 11:31:04The next step is actually the
  22643. 11:31:05the sauce of the whole system. So, this
  22644. 11:31:07is done.
  22645. 11:31:10So, the next step here is to make a GPT.
  22646. 11:31:11And by the way, a GPT is just a thing,
  22647. 11:31:14like an AI assistant, you could say,
  22648. 11:31:16that is just trained on a specific
  22649. 11:31:17thing, right? That allows us to be able
  22650. 11:31:19to analyze, to talk to, to do XYZ. And
  22651. 11:31:22why is it better than just a normal one?
  22652. 11:31:23It's because we give it examples. So,
  22653. 11:31:25for [music] example, Mosey GPT
  22654. 11:31:28is trained on 200 hours of content and
  22655. 11:31:30two of his books, [music]
  22656. 11:31:31right? So, you ideally want to use this
  22657. 11:31:32instead of using the general ChatGPT
  22658. 11:31:35search bar because this is trained on
  22659. 11:31:36these documents. [music]
  22660. 11:31:38So, it's more specific. And so, in this
  22661. 11:31:39case, we're not going to use a GPT here,
  22662. 11:31:41but we're going to go to
  22663. 11:31:42platform.openai.com,
  22664. 11:31:44which is the API platform, right? Where
  22665. 11:31:46we actually use automations back and
  22666. 11:31:48forth. By the way, I made a full video
  22667. 11:31:49showing you how you can build with
  22668. 11:31:50AgentKit, video up here. But the thing
  22669. 11:31:52that we want to do is to be able to
  22670. 11:31:54create a project. So, if you just logged
  22671. 11:31:56into platform.openai.com,
  22672. 11:31:57you most likely don't have a project.
  22673. 11:31:59So, create one. Let's name it
  22674. 11:32:01N and test.
  22675. 11:32:03Create.
  22676. 11:32:05Go to dashboard.
  22677. 11:32:07Go to assistants
  22678. 11:32:09because these are the assistants that we
  22679. 11:32:10make. And by the way, if I go to my
  22680. 11:32:11previous project, you can see that I
  22681. 11:32:13already have assistants.
  22682. 11:32:16You can press create an assistant.
  22683. 11:32:19Create. And now this is where we make
  22684. 11:32:21the GPT, okay? The thing that actually
  22685. 11:32:24uh is going to be able to analyze our
  22686. 11:32:26calls. So, I'm going to name this sales
  22687. 11:32:28coach.
  22688. 11:32:30And the instructions is the prompt. So,
  22689. 11:32:32let's say I want an AI assistant to just
  22690. 11:32:35give me feedback on my sales calls. I am
  22691. 11:32:37taking sales calls every day for and I
  22692. 11:32:38have an AI automation agency that helps
  22693. 11:32:40clients to
  22694. 11:32:42automate their processes and be more
  22695. 11:32:44efficient [music] in the business. And
  22696. 11:32:45the founder is Michele, M I C H E L E.
  22697. 11:32:48I'm the one who's hopping on the calls,
  22698. 11:32:49and I'm also the sales rep.
  22699. 11:32:52I'm doing everything. Um
  22700. 11:32:54so,
  22701. 11:32:55there you go. Press create.
  22702. 11:32:57And I'm using AI because typically
  22703. 11:32:59that's what you guys would do. But I'll
  22704. 11:33:00show you exactly if this is a good
  22705. 11:33:01prompt or not good prompt. And this
  22706. 11:33:03right here wasn't here, I believe, few
  22707. 11:33:05months ago. I think it's almost recent.
  22708. 11:33:08And
  22709. 11:33:09it gave us a full
  22710. 11:33:11um prompt.
  22711. 11:33:13It's actually not bad. So, the founder
  22712. 11:33:14is Michele. You don't have to spell it.
  22713. 11:33:16Stop.
  22714. 11:33:18I just didn't want it to say Michelle.
  22715. 11:33:19That's cool.
  22716. 11:33:20Uh providing actual feedback on sales
  22717. 11:33:22calls for an AI automation agency.
  22718. 11:33:23Founder is Michele. I am not saying
  22719. 11:33:24about user. Let's write in markdown
  22720. 11:33:26formatting. So, overview. This just
  22721. 11:33:28means heading one. So, it's just
  22722. 11:33:30hierarchy of like text, just [music] as
  22723. 11:33:32you would for a normal essay. And then
  22724. 11:33:33here it would be objective. Your
  22725. 11:33:35objective is to analyze each submitted
  22726. 11:33:37sales call, identify strength. That is
  22727. 11:33:40pretty decent.
  22728. 11:33:42I'm not going to give it any examples.
  22729. 11:33:46And one thing we need to add here is a
  22730. 11:33:47document that the GPT will use to
  22731. 11:33:51actually
  22732. 11:33:52give feedback on the call.
  22733. 11:33:54So, I'm going to put file,
  22734. 11:33:56and I'm going to drop in the file that
  22735. 11:33:58we're going to use
  22736. 11:33:59to be able to um
  22737. 11:34:02to transcribe, or not transcribe, to
  22738. 11:34:03give feedback on the call. And it's this
  22739. 11:34:05file. So, this is the file that I'm
  22740. 11:34:06going to using. This is a PDF that has
  22741. 11:34:0710 steps framework. Has introduction.
  22742. 11:34:09So, "Hey John, how's everything going?"
  22743. 11:34:11Uh agenda. "What I'd like to do in this
  22744. 11:34:13call is really just ask you a few
  22745. 11:34:14questions, get to know a little bit more
  22746. 11:34:16about you, and really see if and how I
  22747. 11:34:18could actually help.
  22748. 11:34:19Does that sound fair?
  22749. 11:34:20It's crazy. I used to because I used to
  22750. 11:34:21be in sales, so well,
  22751. 11:34:24I can't call me a closer, but I was a I
  22752. 11:34:26was a setter.
  22753. 11:34:27Vision-based questions, challenge-based
  22754. 11:34:29questions.
  22755. 11:34:30And these are considered good, right?
  22756. 11:34:31And this is a course program that I was
  22757. 11:34:33in.
  22758. 11:34:35And they gave us this framework.
  22759. 11:34:36So, I'm going to use this to be able to
  22760. 11:34:38compare it to our call. And yeah, that's
  22761. 11:34:40it. So, with that said, we have the
  22762. 11:34:41framework PDF. I can attach it.
  22763. 11:34:44And what this will now do is it will
  22764. 11:34:47turn this into a vector store. And what
  22765. 11:34:49that means is that it's taking the PDF,
  22766. 11:34:51in this case it's text, it's
  22767. 11:34:53transforming it into embeddings, and
  22768. 11:34:55then it's vectorizing the data. That's
  22769. 11:34:57why it's called a Let me go here. It's
  22770. 11:34:59called a vector vector store.
  22771. 11:35:01And then we're adding it to a vector
  22772. 11:35:03database, right? Database. So, you hear
  22773. 11:35:05back to database, it just means that it
  22774. 11:35:06is full of like information, whether
  22775. 11:35:08it's an image, audio, video, and text.
  22776. 11:35:09In this case, it's just a PDF that is
  22777. 11:35:11turned into a number so that we then can
  22778. 11:35:14text say, "Can you pull information from
  22779. 11:35:16XYZ?" Which will then vectorize my
  22780. 11:35:18question, which means it will take my
  22781. 11:35:19question, turn that into 010001.
  22782. 11:35:22It will then check it against the vector
  22783. 11:35:24store that we have, which are all
  22784. 11:35:25different vectors, lines, and stuff with
  22785. 11:35:27all numbers. It would match the numbers
  22786. 11:35:29and then give us the answer, okay? Which
  22787. 11:35:30is much more efficient than anything
  22788. 11:35:32else. That's why RAG systems are very
  22789. 11:35:33very good. Um I need to turn this on,
  22790. 11:35:36but it's telling me that the file search
  22791. 11:35:38is not enabled for this model.
  22792. 11:35:41Let's try GPT-5 or GPT-4 1.
  22793. 11:35:44Yeah, there we go. So, not all models I
  22794. 11:35:46can retrieve data. In this case, we can
  22795. 11:35:48use 4 1. File search. And now
  22796. 11:35:51we can say, "What is it that is called?"
  22797. 11:35:54Millionaire Closers Framework, okay. So,
  22798. 11:35:56when it's giving feedback, I want it to
  22799. 11:35:57give feedback from like taking
  22800. 11:35:59information from the Millionaire Closers
  22801. 11:36:01Framework.pdf
  22802. 11:36:03that I uploaded in the file search, um
  22803. 11:36:06and just give feedback based on that.
  22804. 11:36:08So, now it's doing its thing and we also
  22805. 11:36:10have a few settings that we can change
  22806. 11:36:11down below, which I'll explain in just a
  22807. 11:36:13second.
  22808. 11:36:14All right, so it just finished this.
  22809. 11:36:16And then full screen.
  22810. 11:36:17Let me change this again. It keeps
  22811. 11:36:19changing it to the other one. Overview.
  22812. 11:36:23Uh you're an AI assistant closers
  22813. 11:36:25[music] or PDF. So, we're saying, "Hey,
  22814. 11:36:27you are a assistant specializing in
  22815. 11:36:28providing actionable feedback." So, the
  22816. 11:36:30reason why most of the prompts that you
  22817. 11:36:32see out there start with you are an AI
  22818. 11:36:33assistant uh AI assistant is because
  22819. 11:36:37we are giving it a system prompt. A
  22820. 11:36:39system prompt is a prompt that we give
  22821. 11:36:41an AI in general
  22822. 11:36:43with an identity. So, if you tell an AI,
  22823. 11:36:45"You are this type of person," it will
  22824. 11:36:47psych itself to think that it actually
  22825. 11:36:49is that thing, is that identity, so then
  22826. 11:36:51the output will be better, right? It
  22827. 11:36:52will be better in in every single way
  22828. 11:36:54possible. So, for this example right
  22829. 11:36:55here, imagine you had a sales call come
  22830. 11:36:57through. You have to analyze this sales
  22831. 11:36:59call, and you have to use AI to do it.
  22832. 11:37:01If one AI was given the A, "You were a
  22833. 11:37:03helpful, intelligent sales assistant
  22834. 11:37:05that's done this for 10 years," versus
  22835. 11:37:07another one that doesn't have it, this
  22836. 11:37:09will be higher quality because it's now
  22837. 11:37:11given an identity. That's it.
  22838. 11:37:13Uh analyze each submitted user's call
  22839. 11:37:15referencing only the Millionaire Closers
  22840. 11:37:16Framework. Yeah, I'm just taking off the
  22841. 11:37:18apostrophes because
  22842. 11:37:19that's not what the the actual thing
  22843. 11:37:21has. And now it's really just about
  22844. 11:37:22testing, right? So, I want to press
  22845. 11:37:24save, and we can test it right here. But
  22846. 11:37:26before that, I also have these model
  22847. 11:37:28configurations. So, the response format
  22848. 11:37:30will be text, that's fine. Then we have
  22849. 11:37:32temperature, and the higher the
  22850. 11:37:33temperature, the more random the model
  22851. 11:37:35will be. The lower the temperature, the
  22852. 11:37:37more strict the AI is with the rules
  22853. 11:37:40that we've given, okay? Then we have top
  22854. 11:37:42P, which is the higher the top P, the
  22855. 11:37:45more it will use different words. The
  22856. 11:37:47lower top P, the more it will use the
  22857. 11:37:49same words, right? So, it will start
  22858. 11:37:51using actually the same words. All
  22859. 11:37:52right, so I'm going to test this. I'm
  22860. 11:37:53just going to drop in a transcript,
  22861. 11:37:55which I can get right here.
  22862. 11:37:59Let me just copy this.
  22863. 11:38:00Copy selection. I can paste this.
  22864. 11:38:04Yeah, that's good. That's good.
  22865. 11:38:06Paste this here. I can run.
  22866. 11:38:08And you're basically running this actual
  22867. 11:38:10like agent GPT. So, you don't have to
  22868. 11:38:12run it through the automation, you can
  22869. 11:38:13just run it here. So, reasoning.
  22870. 11:38:18Frame control and agenda.
  22871. 11:38:21The prospect volunteered extensive
  22872. 11:38:22details about the business.
  22873. 11:38:24The rep asked several questions.
  22874. 11:38:26I don't know if I like this too much,
  22875. 11:38:27I'm not going to lie, cuz it also gives
  22876. 11:38:29us null, which is a bit mad. Yeah, I
  22877. 11:38:31don't want any of this. Like this is
  22878. 11:38:32this is pretty pretty so
  22879. 11:38:36it's not that good. Um plus it took a
  22880. 11:38:38lot of tokens to do it. So,
  22881. 11:38:40I'm actually going to paste the prompt
  22882. 11:38:41that I had before.
  22883. 11:38:43Just from right here.
  22884. 11:38:44Uh which is much shorter.
  22885. 11:38:46And I said, "You're a sales closer
  22886. 11:38:47expert. I want to do overview."
  22887. 11:38:51With over 30 years of experience in
  22888. 11:38:53teaching sales, you know the exact
  22889. 11:38:54framework that will get a prospect to
  22890. 11:38:56buy and are expert in reviewing people's
  22891. 11:38:57calls and so on. Then I give it my
  22892. 11:38:59context and then rules and guidelines.
  22893. 11:39:01Now, the important thing here and the
  22894. 11:39:03actual use case is that the this will
  22895. 11:39:06not be the CEO, well, most likely,
  22896. 11:39:07right? It will be his sales team that
  22897. 11:39:09does calls, and then you review the
  22898. 11:39:10calls using a GPT here, and then you
  22899. 11:39:12give feedback on the calls so they can
  22900. 11:39:14actually get better. And that's
  22901. 11:39:15literally it. So, let me paste this
  22902. 11:39:16again, the the actual call.
  22903. 11:39:19Let me go back to and then I can copy
  22904. 11:39:21this. Copy selection.
  22905. 11:39:24Paste this here.
  22906. 11:39:25Run.
  22907. 11:39:26And now it should give us a shorter
  22908. 11:39:28answer.
  22909. 11:39:29Opportunities null.
  22910. 11:39:31Okay, let's just see how it looks like
  22911. 11:39:32on the actual
  22912. 11:39:34automation. I'm not going to judge here,
  22913. 11:39:36so
  22914. 11:39:37let's just see what it looks like. But I
  22915. 11:39:38like this more cuz it's it's uh it's
  22916. 11:39:40shorter,
  22917. 11:39:41right? And it also seems like it's a bit
  22918. 11:39:42more random. So, let me turn this down a
  22919. 11:39:44little bit. Let's do
  22920. 11:39:46uh
  22921. 11:39:48eight.
  22922. 11:39:49Let me try this again. And this is all
  22923. 11:39:50about testing, right? So, theoretically,
  22924. 11:39:52you won't have the actual answer like in
  22925. 11:39:54your head. You just have to test.
  22926. 11:39:57So, by putting it lower, I'm saying,
  22927. 11:39:58"Hey, you can't don't be so creative,"
  22928. 11:40:00right? Like just follow the framework,
  22929. 11:40:02follow the prompt that we give it.
  22930. 11:40:03And it's actually better. Well,
  22931. 11:40:07I don't know if it's better, but
  22932. 11:40:08it's giving us Yeah, it's giving us
  22933. 11:40:09better answer, to be honest. We'll just
  22934. 11:40:11put it to test in the automation and
  22935. 11:40:12we'll see how
  22936. 11:40:13how it does. Cool, I like the I like
  22937. 11:40:15this one right here. Sample script
  22938. 11:40:16experts from the next call. All right,
  22939. 11:40:18now that we have this, we can now
  22940. 11:40:19connect this to our n8n workflow. So,
  22941. 11:40:22all we have to do is go to plus,
  22942. 11:40:25look for OpenAI,
  22943. 11:40:26and then usually you actually message a
  22944. 11:40:28model, right? In this case, you want to
  22945. 11:40:30assistant. Create an
  22946. 11:40:32uh message an assistant. There we go.
  22947. 11:40:35To connect your OpenAI, you have to go
  22948. 11:40:37to get the API key, which you can get
  22949. 11:40:39from from the openai.com.
  22950. 11:40:41Go to dashboard, go to API keys,
  22951. 11:40:46press create a new secret key.
  22952. 11:40:48So, n8n test.
  22953. 11:40:51Create a key, and then you can copy this
  22954. 11:40:54and bring it back here and put me
  22955. 11:40:56calendar
  22956. 11:40:5819th of October.
  22957. 11:41:00Save.
  22958. 11:41:01Now you have the connection to your
  22959. 11:41:02account saved. And now the resource will
  22960. 11:41:04be assistant, the action that we're
  22961. 11:41:06taking is messaging an assistant. So,
  22962. 11:41:07we're doing the same thing that we did
  22963. 11:41:08before here. We're doing it
  22964. 11:41:10automatically.
  22965. 11:41:12And now from the list, we want to
  22966. 11:41:15uh get the sales coach. That's it. Bear
  22967. 11:41:17in mind that when you make an assistant
  22968. 11:41:20on this project [clears throat]
  22969. 11:41:21and then you make an API key on this
  22970. 11:41:23project, you will not be able to see
  22971. 11:41:25this assistant here. So, make sure that
  22972. 11:41:26you make the assistant on the project
  22973. 11:41:29where you also get the API key in,
  22974. 11:41:31right? It's important. So, you can see
  22975. 11:41:33here, I got the API key from this
  22976. 11:41:35project, n8n test. Then we have to add
  22977. 11:41:37the user message. So, the user message
  22978. 11:41:39will be uh not chat trigger node, it
  22979. 11:41:41will be defined below because we're
  22980. 11:41:43defining the user message. If I make
  22981. 11:41:45this bigger, it's expression. Make this
  22982. 11:41:47bigger, I can copy the prompt. And I can
  22983. 11:41:49say, "Your task is to give feedback on
  22984. 11:41:50this call by looking at the transcript.
  22985. 11:41:52Uh rules, make the feedback concise and
  22986. 11:41:54break tactical, pointing out exactly
  22987. 11:41:56what I could have done better on the
  22988. 11:41:57call. Provide specific quotes in the
  22989. 11:41:58call when giving feedback, and remove
  22990. 11:42:01this right here, which is typically what
  22991. 11:42:02it gives us um when it sources the
  22992. 11:42:05actual data or the the text.
  22993. 11:42:07That's it. And then don't use markdown
  22994. 11:42:09formatting because the next step is
  22995. 11:42:11Slack, and Slack doesn't have markdown
  22996. 11:42:12formatting. Uh if you don't know what
  22997. 11:42:14markdown formatting is, it's this sheet
  22998. 11:42:15here. This.
  22999. 11:42:17Heading one is this.
  23000. 11:42:19Then we have heading two.
  23001. 11:42:21But it doesn't actually This is great if
  23002. 11:42:22you have like some softwares that read
  23003. 11:42:24markdown formatting. So, it wouldn't
  23004. 11:42:25actually output this. It would just
  23005. 11:42:26output the heading two in the format of
  23006. 11:42:28heading two.
  23007. 11:42:30But in this case, we don't have it with
  23008. 11:42:31Slack, so it's fine.
  23009. 11:42:32And now this is finished.
  23010. 11:42:34So, make this green.
  23011. 11:42:36The last thing is send a Slack message
  23012. 11:42:37with the feedback.
  23013. 11:42:39I want to go here. First, rename this to
  23014. 11:42:41sales
  23015. 11:42:42coach.
  23016. 11:42:44Let me actually run this so I can see
  23017. 11:42:45what
  23018. 11:42:46how it works. This is now
  23019. 11:42:48theoretically talking
  23020. 11:42:50to this agent, [music]
  23021. 11:42:52my agent GPT,
  23022. 11:42:54and getting the answer. As you can see
  23023. 11:42:56here, we have
  23024. 11:42:58the output, which is sales call
  23025. 11:42:59feedback, Millionaire Closers Framework,
  23026. 11:43:01opening, report strength, okay.
  23027. 11:43:04Cool.
  23028. 11:43:06And now let me pin this.
  23029. 11:43:08We can add Slack. Just the last uh node.
  23030. 11:43:11And we can message a channel, send a
  23031. 11:43:12message.
  23032. 11:43:13To connect our Slack, just go here to
  23033. 11:43:15create your credential. You can connect
  23034. 11:43:16your account
  23035. 11:43:18and just log in. Literally just choose
  23036. 11:43:20your organization that you have. For me,
  23037. 11:43:21it's JM Solutions.
  23038. 11:43:23And then you can allow. Connection
  23039. 11:43:24successful. Go back to n8n. You can put
  23040. 11:43:27JM Solutions.
  23041. 11:43:29As you can see, I've already done it
  23042. 11:43:30before.
  23043. 11:43:31Right here. I'll add another one.
  23044. 11:43:33Another thing that we're changing is the
  23045. 11:43:34message or manipulating. The action that
  23046. 11:43:36we're taking is sending. Send a message
  23047. 11:43:38to channel. If I go to Slack, I can see
  23048. 11:43:41that all the channels that I have are
  23049. 11:43:43these ones, which are all for testing.
  23050. 11:43:45So, when you make a Slack account, this
  23051. 11:43:47is a free account as well, so you will
  23052. 11:43:48have the free account. Just literally
  23053. 11:43:49make a channel. You can create a
  23054. 11:43:50channel,
  23055. 11:43:51and you can name it call reviews or
  23056. 11:43:52whatever it is.
  23057. 11:43:54And this will be the channel that we
  23058. 11:43:55use. Now, bear in mind that the channel
  23059. 11:43:56ID is also here. I believe it's either
  23060. 11:43:58this or this. I think it's this. Um
  23061. 11:44:01but we don't have to use the ID. We can
  23062. 11:44:02just simply select from the options
  23063. 11:44:05cuz it will be call reviews.
  23064. 11:44:06And then it will be send a simple text
  23065. 11:44:08message and the message text will be the
  23066. 11:44:10output which is a feedback of the call.
  23067. 11:44:13If I press execute step,
  23068. 11:44:16we should now see that we have a
  23069. 11:44:18um feedback. This is way too long. I'm
  23070. 11:44:21going to lie.
  23071. 11:44:22If I had to read this for every single
  23072. 11:44:23call that I have, I probably wouldn't
  23073. 11:44:26want to take calls anymore. Um
  23074. 11:44:28So we definitely need to say make it
  23075. 11:44:30shorter.
  23076. 11:44:31Yeah, I think it will have to be here.
  23077. 11:44:34Um rules
  23078. 11:44:36make a concise
  23079. 11:44:39without writing massive paragraphs.
  23080. 11:44:45Not the best prompt, I'm not going to
  23081. 11:44:46lie.
  23082. 11:44:47Um
  23083. 11:44:48So let me execute this step again. Now
  23084. 11:44:50let me execute this step.
  23085. 11:44:51Unpin and let me execute the step.
  23086. 11:44:55And now I'm running this, we have the
  23087. 11:44:57output. Let me pin this and let me test
  23088. 11:44:59this again. Let me run this.
  23089. 11:45:02If I go here, I can see that I have the
  23090. 11:45:04Okay, that's much better.
  23091. 11:45:06You see how a changing prompt can just
  23092. 11:45:07change everything here? We control an
  23093. 11:45:09agenda setting. Early in the call you
  23094. 11:45:11let the prospect take the lead. I'm
  23095. 11:45:12quite direct and I can just go cut
  23096. 11:45:14straight to the chase.
  23097. 11:45:15It's true.
  23098. 11:45:17Um
  23099. 11:45:17Yeah, cool. I I love the fact that
  23100. 11:45:19they're putting in quotes. Like the
  23101. 11:45:21quote stuff is really really good cuz it
  23102. 11:45:22tells you exactly what you said and what
  23103. 11:45:24you could have said better. So for
  23104. 11:45:25example, it says here when she said, I
  23105. 11:45:28just probably won't have the time to do
  23106. 11:45:29it basically. You moved on to technical
  23107. 11:45:31detail. Instead, drill down the tell me
  23108. 11:45:33more about what not having the time is
  23109. 11:45:35costing the business. Where have things
  23110. 11:45:37broken down or gone wrong because of
  23111. 11:45:38this?
  23112. 11:45:39Not bad. Not bad.
  23113. 11:45:41Um
  23114. 11:45:43Okay, so we have the full exact
  23115. 11:45:45framework
  23116. 11:45:46that we want. Ideally, I want to see the
  23117. 11:45:48name of the call at the top so what I
  23118. 11:45:50can do here
  23119. 11:45:51in Slack is
  23120. 11:45:53I can go down to get a transcript and I
  23121. 11:45:55should be able to see the name of the
  23122. 11:45:57call
  23123. 11:45:59right here. Title.
  23124. 11:46:01And then you can say break down
  23125. 11:46:04feedback.
  23126. 11:46:05And now if I execute the step, I can now
  23127. 11:46:07see that I have basically the same thing
  23128. 11:46:09which you can now use and we have the
  23129. 11:46:10full breakdown.
  23130. 11:46:14Hey, in this video I'm going to show you
  23131. 11:46:16step by step how I built a lead
  23132. 11:46:17generation system inside of that allows
  23133. 11:46:20us to scrape thousands of leads using
  23134. 11:46:22Google Maps. Then we extract the URLs of
  23135. 11:46:25the websites,
  23136. 11:46:26>> [music]
  23137. 11:46:26>> then we look for the emails inside the
  23138. 11:46:27websites before adding it to our Google
  23139. 11:46:29Sheet database which allows us to then
  23140. 11:46:30reach out to them and get business. All
  23141. 11:46:32right, so this [music] right here is the
  23142. 11:46:33system. I'm going to run it from
  23143. 11:46:34scratch.
  23144. 11:46:35We're going to walk through how it
  23145. 11:46:36works. The first part is scraping a URL
  23146. 11:46:39which is a link of Google Maps.
  23147. 11:46:41Now that's a link you typically go to
  23148. 11:46:42Google Maps for in case you want to cold
  23149. 11:46:44call or cold email. And what this will
  23150. 11:46:46now do is it will extract the URLs which
  23151. 11:46:48is the the websites that are in here. It
  23152. 11:46:50will remove any duplicates. It will
  23153. 11:46:52filter the ones that actually have a URL
  23154. 11:46:54like a real one. And then it goes here
  23155. 11:46:56to scraping the website,
  23156. 11:46:58finding the emails of each website.
  23157. 11:47:00And then at the end after having scraped
  23158. 11:47:03every single one that's in the Google
  23159. 11:47:05Maps URL, it will add it to our Google
  23160. 11:47:07Sheet database. And then once it scraped
  23161. 11:47:09every single URL
  23162. 11:47:11and emails inside the URLs, then adds
  23163. 11:47:13them all to our Google Sheet database.
  23164. 11:47:16Where we can see here that we have 25
  23165. 11:47:18emails, right? Out of 32 websites that
  23166. 11:47:20we scraped. And so these right here are
  23167. 11:47:23all the emails that we can now use to
  23168. 11:47:25run our cold outreach. Now cold outreach
  23169. 11:47:27just stands for reaching out to people
  23170. 11:47:29who are cold, who have no idea who we
  23171. 11:47:30are. So what I would do after this is
  23172. 11:47:32hook them up to an email sequence uh
  23173. 11:47:34software which means that there's some
  23174. 11:47:36software that allow you to write emails
  23175. 11:47:38automatically to each person. And so
  23176. 11:47:40that you just run email campaign
  23177. 11:47:41automatically and you can use the system
  23178. 11:47:43every other day uh to scrape new leads,
  23179. 11:47:45to scrape new emails and then reach out
  23180. 11:47:47to them. All right, so let's go through
  23181. 11:47:48the whole system step by step and show
  23182. 11:47:50you how it works. The first part is the
  23183. 11:47:52Google Maps data extraction. So if I go
  23184. 11:47:54here, we're running this manually right
  23185. 11:47:56now, but it would typically be a
  23186. 11:47:59What would it be? On on schedule because
  23187. 11:48:01ideally we don't want to go to Any.do to
  23188. 11:48:03have to run this manually every single
  23189. 11:48:04time. So we use something like this
  23190. 11:48:07which allows us to be able to run the
  23191. 11:48:08system every day or every second,
  23192. 11:48:12minute, hour, days, weeks, months. It
  23193. 11:48:14has very custom formulas. So we can put
  23194. 11:48:17this as an automatic first step, but in
  23195. 11:48:18this case we have this manually. And now
  23196. 11:48:20the real first step to why this is
  23197. 11:48:21possible, so if we go in here, we're
  23198. 11:48:23using a HTTP request. Now HTTP stands
  23199. 11:48:26for Hypertext Transfer Protocol. Yeah,
  23200. 11:48:29there you go. Hypertext Transfer
  23201. 11:48:30Protocol which is a very fancy word to
  23202. 11:48:32say, hey, we're taking a URL like this.
  23203. 11:48:35So let me just copy this and paste it in
  23204. 11:48:38Google
  23205. 11:48:39which is literally us going to Google
  23206. 11:48:40Maps and putting agencies in New York
  23207. 11:48:43which are all the agencies in New York
  23208. 11:48:44right here. And we're scraping this this
  23209. 11:48:47this all the websites that are here. All
  23210. 11:48:48of them. Right, we're going to each one
  23211. 11:48:51so you don't have to essentially. And so
  23212. 11:48:53the HTTP request allows us to be able to
  23213. 11:48:55get
  23214. 11:48:56The method is just what are we doing? In
  23215. 11:48:58this case we're getting information.
  23216. 11:49:00All of this, right? And if I go here
  23217. 11:49:02and show you exactly how this actually
  23218. 11:49:04works
  23219. 11:49:05to inspect. On the right hand side, this
  23220. 11:49:08is what it's scraping. The HTML behind
  23221. 11:49:11the page. Network. There's a ton of
  23222. 11:49:13stuff, a ton of different little codes
  23223. 11:49:15and language here, but that allows the
  23224. 11:49:16HTTP request to be able to extract the
  23225. 11:49:19whole information out of this page which
  23226. 11:49:21then is useful for us for the next
  23227. 11:49:22steps. And as you can see here the data
  23228. 11:49:24which is the output like what is the
  23229. 11:49:25thing that this the system is giving us
  23230. 11:49:28to start with is just this.
  23231. 11:49:31Right? Doc type HTML and there's a ton
  23232. 11:49:33of stuff here. So I go to JSON which is
  23233. 11:49:35the way that you can also represent
  23234. 11:49:37this. It's a long long JSON string
  23235. 11:49:40which again is the JSON not JSON, it is
  23236. 11:49:42the HTML behind the actual website,
  23237. 11:49:45right? Which you can then use. And by
  23238. 11:49:46the way, if this is the first time that
  23239. 11:49:47you see this node right here, HTTP, or
  23240. 11:49:50maybe you never used it before, then
  23241. 11:49:52check out this video up here where I
  23242. 11:49:53show you the fundamentals of how it
  23243. 11:49:54works. All right, now that we have this,
  23244. 11:49:56let me pin this because now the output
  23245. 11:49:58is just this, right? HTML.
  23246. 11:50:00We use a code node, right? Again, we're
  23247. 11:50:02coding now. But we're using a JavaScript
  23248. 11:50:04code to be able to turn this long long
  23249. 11:50:07HTML into this.
  23250. 11:50:09Right? Which are all websites. I go to
  23251. 11:50:11schema, I can see that we have 229 items
  23252. 11:50:13which means that it found 229 websites.
  23253. 11:50:17For example, we have schema.org and we
  23254. 11:50:18have a ton more, right? Let's say let's
  23255. 11:50:19go https fonts.gstatic.com.
  23256. 11:50:24This is a invalid URL, right? For
  23257. 11:50:26example. And so what this does, let me
  23258. 11:50:28paste it into ChatGPT.
  23259. 11:50:30That's usually what I would do if I
  23260. 11:50:31didn't know what the code did and say,
  23261. 11:50:33can you break this down into one
  23262. 11:50:37sentence
  23263. 11:50:39explain what this does.
  23264. 11:50:44Typically the input is the HTML which is
  23265. 11:50:47the long string of HTML text that we
  23266. 11:50:50get.
  23267. 11:50:51And we take the first input JSON. We
  23268. 11:50:53find all the website URLs using regular
  23269. 11:50:56expression. So we call this regex. It's
  23270. 11:50:58just a a fancy way to say that we let's
  23271. 11:51:00say we have a long text and it finds
  23272. 11:51:02things that are like prominent, right?
  23273. 11:51:04So for example, every website that we
  23274. 11:51:05know has https semicolon slash slash. So
  23275. 11:51:09it finds all the websites that are
  23276. 11:51:10within that we're occurring sort of
  23277. 11:51:12text, right? And then it extracts all of
  23278. 11:51:14them.
  23279. 11:51:15And then it returns them as a list of
  23280. 11:51:18separate JSON objects. And that's
  23281. 11:51:19essentially what it does. Because again,
  23282. 11:51:20here we have these, right? So it
  23283. 11:51:22extracts these which it finds. It knows
  23284. 11:51:25because well sort of every website has
  23285. 11:51:26https and then it has .com or .it or
  23286. 11:51:30.whatever depending on what country. And
  23287. 11:51:32it leaves these alone which are not
  23288. 11:51:34websites. We want to make this run once
  23289. 11:51:36for all items and we want to use JSON
  23290. 11:51:38which is JavaScript Object Notation. And
  23291. 11:51:40then we're just giving it this data,
  23292. 11:51:42right? Which is
  23293. 11:51:43this first.json.data.
  23294. 11:51:45And we get this.
  23295. 11:51:47Now once we have this, we now have a
  23296. 11:51:48list of 229 websites that we can now use
  23297. 11:51:52to be able to scrape, right? Now as you
  23298. 11:51:55can see here, 229 websites entered this
  23299. 11:51:59new node, but 34 only went out. It's
  23300. 11:52:01because we have a filter here. We filter
  23301. 11:52:04by the URLs that schema.org, right?
  23302. 11:52:07Which is not a real website or Google
  23303. 11:52:09websites or GG websites or GStatic
  23304. 11:52:11websites. These are not websites that we
  23305. 11:52:13can scrape that have emails in them. And
  23306. 11:52:15so what we do here is we say the website
  23307. 11:52:17does not contain
  23308. 11:52:19right? Which is a string. Does not
  23309. 11:52:20contain because string is just saying,
  23310. 11:52:21hey, it does not contain within the text
  23311. 11:52:24schema and it does not contain Google
  23312. 11:52:26and it does not contain GG and GStatic
  23313. 11:52:28because these are the signs that it's
  23314. 11:52:30not an actual website. For example, as
  23315. 11:52:32you can see here, we have all the ones
  23316. 11:52:34that were invalid. I go here, https
  23317. 11:52:37gstatic.
  23318. 11:52:38These are all invalid websites. And so
  23319. 11:52:40we don't want to scrape those websites.
  23320. 11:52:41We only want to scrape the ones that are
  23321. 11:52:43actual websites. For example, this right
  23322. 11:52:45here.
  23323. 11:52:46I go here
  23324. 11:52:48and I can see that this is an actual
  23325. 11:52:50business. And that's the ones that we
  23326. 11:52:51use for the next steps. So we have this
  23327. 11:52:52filter step right here. And then once we
  23328. 11:52:54have 34 websites that are actual
  23329. 11:52:56websites that we can scrape, we are
  23330. 11:52:58removing duplicates which means that we
  23331. 11:53:00are taking a list of 20 for example like
  23332. 11:53:02these. And we're looking, hey, is there
  23333. 11:53:04any duplicates in the actual list?
  23334. 11:53:05[music] Well, as you can see here, yes,
  23335. 11:53:07we have this.
  23336. 11:53:08This, that's duplicate.
  23337. 11:53:10And these three, so on. And so we just
  23338. 11:53:13take them.
  23339. 11:53:14We say, hey, remove items repeated
  23340. 11:53:16within the current input which is this.
  23341. 11:53:19And we want to compare all fields.
  23342. 11:53:21And this is the output that we get. We
  23343. 11:53:23get a list of websites that are actual
  23344. 11:53:25websites that are not repeated that we
  23345. 11:53:27can use to then extract the emails from.
  23346. 11:53:29There we go.
  23347. 11:53:32I'm going to pin this. I'll pin this as
  23348. 11:53:34well. Now this up here actually doesn't
  23349. 11:53:36have to be here. Uh it's just for
  23350. 11:53:38production. Uh sorry, for testing
  23351. 11:53:40because we're limiting the amount of
  23352. 11:53:41items, the amount of websites that we're
  23353. 11:53:42sending through just to test. But you
  23354. 11:53:44could delete this and have this pass
  23355. 11:53:46through all the items from remove
  23356. 11:53:47duplicates. But here we have the um
  23357. 11:53:50we're basically saying, hey, only let
  23358. 11:53:5110,000 websites through as a limit. And
  23359. 11:53:54now this is where we start the scraping.
  23360. 11:53:55Now so far, these are nodes that you
  23361. 11:53:57probably never seen before in an actual
  23362. 11:53:59automation together, right? The HTTP
  23363. 11:54:00code uh filter, remove duplicates, and
  23364. 11:54:03limit. And we also have the loop over
  23365. 11:54:05items again. So, we script the websites,
  23366. 11:54:08we extract the URLs of the websites, and
  23367. 11:54:10we go here and we filter and we say,
  23368. 11:54:11"Hey, is this a Google website or is
  23369. 11:54:13this an actual website?" If it's an
  23370. 11:54:15actual one, then we send it to the next
  23371. 11:54:17step, which basically takes the whole
  23372. 11:54:18list, it removes all the duplicates, and
  23373. 11:54:21then what we do here is now we go into
  23374. 11:54:24the process of scraping. Now, scraping
  23375. 11:54:26just means that you go inside Let's say
  23376. 11:54:28I go to uh
  23377. 11:54:31Let me go Let me take an example here.
  23378. 11:54:33Custom Staffing, there we go. This one
  23379. 11:54:35right here. And what we're doing here is
  23380. 11:54:36we are extracting all the text, which
  23381. 11:54:38you can find here. So, every single
  23382. 11:54:40website that you see in the internet has
  23383. 11:54:42HTML. It's consisted of HTML,
  23384. 11:54:44which is why we're able to
  23385. 11:54:47put these buttons, make this orange,
  23386. 11:54:48make this white, make this blue, right?
  23387. 11:54:50We're able to make websites not just a
  23388. 11:54:52Google document, right? Make them look
  23389. 11:54:54pretty. It's all HTML. So, what the
  23390. 11:54:56server does is it just goes here and
  23391. 11:54:57extracts that to be able for us to go to
  23392. 11:54:59the next step, which is, again, going
  23393. 11:55:02down the loop way, which is just
  23394. 11:55:04looping. So, going through each website
  23395. 11:55:06over and over again. And we're only
  23396. 11:55:07sending one item, so one website through
  23397. 11:55:10at the same time.
  23398. 11:55:11So, we're sending one item, which is a
  23399. 11:55:12website. We then script the website
  23400. 11:55:14using just a simple HTTP again get
  23401. 11:55:17request. So, we're getting the whole
  23402. 11:55:19HTML
  23403. 11:55:20of the website here. We just drag this
  23404. 11:55:22across. So, this is all the code that we
  23405. 11:55:24spoke about. And one thing that I also
  23406. 11:55:25added here is the ability for the
  23407. 11:55:27workflow to continue even though there's
  23408. 11:55:29an error. Why? Well, it's because some
  23409. 11:55:31websites, when you script them, they
  23410. 11:55:33don't allow you to script the website.
  23411. 11:55:34As in there's a there's an encryption
  23412. 11:55:35that that says, "Hey, this is private.
  23413. 11:55:37You need a password or you need some
  23414. 11:55:38sort of authentication to get inside."
  23415. 11:55:41And if that happens, this will error
  23416. 11:55:43out. There'll be an error. So, we're
  23417. 11:55:44saying, "Hey, you can still continue the
  23418. 11:55:45automation even though it might fail at
  23419. 11:55:47the same time." And so, what we do for
  23420. 11:55:48the next steps after we extracted all
  23421. 11:55:50the language behind the website is we
  23422. 11:55:52wait. Now, the reason why we wait about,
  23423. 11:55:54yeah, 1 second is because of the fact
  23424. 11:55:57that we don't want to run into any rate
  23425. 11:55:58limits. And rate limits usually happens
  23426. 11:56:00when you script websites over and over
  23427. 11:56:02and over again really really fast. So,
  23428. 11:56:03you want to give it some room to
  23429. 11:56:04breathe. 1 second is enough. Um you can
  23430. 11:56:06even put two.
  23431. 11:56:08So, you're able to make sure that you
  23432. 11:56:09are actually able to script all these
  23433. 11:56:11websites. And then what we do here is we
  23434. 11:56:13go to a similar
  23435. 11:56:16sort of node right here. Well, it's the
  23436. 11:56:17same node, right? But it's a similar
  23437. 11:56:18function.
  23438. 11:56:19And we extract the emails. So, the input
  23439. 11:56:22is this, which is the data here. So,
  23440. 11:56:24this right here, this this this whole
  23441. 11:56:25thing that you see that you probably get
  23442. 11:56:26confused about,
  23443. 11:56:28this just says, "Hey, this is the
  23444. 11:56:30typical way that people write emails,
  23445. 11:56:32okay? And the email is usually text
  23446. 11:56:35here,
  23447. 11:56:36right? Before
  23448. 11:56:38the @ and then gmail.com and then
  23449. 11:56:39something.com or something.it.
  23450. 11:56:42And so, what we're seeing here is this.
  23451. 11:56:43We're saying, "Hey, we're basically
  23452. 11:56:44looking at patterns." So, every email
  23453. 11:56:47usually has these characters before the
  23454. 11:56:49@, these characters after the @,
  23455. 11:56:51and then some sort of text.
  23456. 11:56:54And so, that's what we extract from the
  23457. 11:56:56website to then get the emails. And
  23458. 11:56:58sometimes [music]
  23459. 11:57:00it cannot read properties of undefined
  23460. 11:57:01reading match, which means that it
  23461. 11:57:03didn't find it. But if I go here to
  23462. 11:57:06Let's say 21, so on,
  23463. 11:57:09you can see that it found a ton of
  23464. 11:57:11emails from the same company that he
  23465. 11:57:13uses. And so, again, we're using code to
  23466. 11:57:15be able to extract all the emails from
  23467. 11:57:18the script of the website, so from the
  23468. 11:57:19HTML, from the language behind the
  23469. 11:57:20website, that we can then do for every
  23470. 11:57:22single website that we have. And when
  23471. 11:57:24this is finished, we then send it up
  23472. 11:57:25here to wait again. We give it 5 seconds
  23473. 11:57:28just to give it some room to breathe.
  23474. 11:57:30And then we have to filter out the
  23475. 11:57:32websites that don't have any emails. So,
  23476. 11:57:33we're saying, "Hey, does it JSON.email
  23477. 11:57:36right here?
  23478. 11:57:37If this exists, then send it through. If
  23479. 11:57:39it doesn't exist, then don't send it
  23480. 11:57:40through." In this case, you see that we
  23481. 11:57:42had uh these emails come up, and the
  23482. 11:57:45emails that didn't come up were these
  23483. 11:57:46ones because we couldn't find them or it
  23484. 11:57:48was just, yeah, null just means that
  23485. 11:57:50there's nothing there. This just means
  23486. 11:57:51that it was an error that we can't read
  23487. 11:57:53the property.
  23488. 11:57:54And we're only keeping the ones that we
  23489. 11:57:55can find
  23490. 11:57:57right here. Before taking these emails,
  23491. 11:57:59which are in an array. Array just means
  23492. 11:58:01that it's in a way where we have
  23493. 11:58:02different information inside the
  23494. 11:58:03information. And we're taking this block
  23495. 11:58:06and we're splitting it out.
  23496. 11:58:08Right? So, what this means is that we're
  23497. 11:58:09taking all these emails and we're
  23498. 11:58:11processing each one individually. Okay,
  23499. 11:58:14that's what an array is. Array is just
  23500. 11:58:15something that has this inside. It's
  23501. 11:58:17like you go to the grocery store and the
  23502. 11:58:19groceries is banana, strawberries,
  23503. 11:58:21fruits, XYZ. These is the different
  23504. 11:58:24items within the grocery list. We're
  23505. 11:58:25splitting it out into each one. So, you
  23506. 11:58:27can see now we have 110 emails,
  23507. 11:58:29different pages.
  23508. 11:58:31Right? That you can then send to another
  23509. 11:58:33remove duplicate because, as you can see
  23510. 11:58:35here, there are some duplicates as well
  23511. 11:58:37within the emails.
  23512. 11:58:39And so, we want to remove those.
  23513. 11:58:41And so, out of 110 emails,
  23514. 11:58:43we only kept 25. Which I'm going here, I
  23515. 11:58:45can see that it's the same exact
  23516. 11:58:47setting, remove items repeated within a
  23517. 11:58:48current input. With the input is this.
  23518. 11:58:51And this is the output.
  23519. 11:58:53List of emails, which you can now use to
  23520. 11:58:55be able to add to our Google Sheet
  23521. 11:58:57database right here.
  23522. 11:59:00Which you can then use for email
  23523. 11:59:02campaigns.
  23524. 11:59:03Now, can you use Apify to do all of
  23525. 11:59:05this? Yes, but Apify isn't free. As in
  23526. 11:59:08you still have to pay for it. Um I guess
  23527. 11:59:11it is more reliable in a sense as in
  23528. 11:59:12Apify has their own scrapers, you can
  23529. 11:59:15add more stuff there. But just the fact
  23530. 11:59:16that we're able to put a URL right here,
  23531. 11:59:18and we can change this to
  23532. 11:59:20agencies in I don't know.
  23533. 11:59:24Canada.
  23534. 11:59:26Right here.
  23535. 11:59:28Agencies is in Ontario. I don't know if
  23536. 11:59:31that thing come up. Agencies. Zoom
  23537. 11:59:32agencies.
  23538. 11:59:36Again, we can do agencies in a specific
  23539. 11:59:38location.
  23540. 11:59:40And then these are all the agencies that
  23541. 11:59:41it will use, that it will extract the
  23542. 11:59:43information from.
  23543. 11:59:44In this case, we're in New York,
  23544. 11:59:46the one and only. Um and this [music]
  23545. 11:59:49will be the thing that it will extract
  23546. 11:59:50to then be able to then get all the
  23547. 11:59:52emails. Now, one thing that we could do
  23548. 11:59:53actually is this. We could, instead of
  23549. 11:59:55running this on a daily basis because it
  23550. 11:59:57would extract the same exact websites,
  23551. 11:59:59now that I thought of it, you can have
  23552. 12:00:01another page here,
  23553. 12:00:03and the page would be websites or
  23554. 12:00:05businesses
  23555. 12:00:07to scrape.
  23556. 12:00:09And you can have,
  23557. 12:00:12I don't know, like agencies in New York,
  23558. 12:00:17agencies in Canada,
  23559. 12:00:20or whatever, like flooring businesses.
  23560. 12:00:23You can have a ton of businesses here
  23561. 12:00:24that you can use.
  23562. 12:00:25And then you can hook this up. So, if I
  23563. 12:00:27go here,
  23564. 12:00:28I can press plus. I can then look for
  23565. 12:00:31sheets.
  23566. 12:00:34Get rows.
  23567. 12:00:36Look for our Google Sheet, which is
  23568. 12:00:38Apify emails.
  23569. 12:00:40It will be sheet one,
  23570. 12:00:42I believe. No, sheet two. Let's call
  23571. 12:00:44this businesses.
  23572. 12:00:48So, you know, we can keep track. Okay,
  23573. 12:00:50it'll be sheet two.
  23574. 12:00:51And now we can run this.
  23575. 12:00:55So, if I run this here, I can now get
  23576. 12:00:57these agencies in New York.
  23577. 12:00:59Right? And so, what will happen here is
  23578. 12:01:02that we have to hook this up to the
  23579. 12:01:04Google Sheet, to the actual Google Maps.
  23580. 12:01:07And we know that everything that goes
  23581. 12:01:08after the search
  23582. 12:01:10is something that changes.
  23583. 12:01:12Right? Because Google Maps will search
  23584. 12:01:13everything behind here because
  23585. 12:01:15everything before here is a static,
  23586. 12:01:17which means it's the exact same for
  23587. 12:01:18every single URL. But here is something
  23588. 12:01:20that we can change. And so, what we can
  23589. 12:01:22do, pretty high level, but we can take
  23590. 12:01:25this. We can put it here.
  23591. 12:01:27Right? And watch this. We can go inside.
  23592. 12:01:30I don't think I've done this before, but
  23593. 12:01:32uh we can
  23594. 12:01:34press plus, and then
  23595. 12:01:37replace all
  23596. 12:01:39um space
  23597. 12:01:41spaces with plus. Why did I do that?
  23598. 12:01:44It's because Apify, or not Apify, HTTP
  23599. 12:01:47requests don't allow you to have spaces.
  23600. 12:01:50And so, as you can see here, we had SO
  23601. 12:01:52agencies in New York. We had agencies
  23602. 12:01:55plus
  23603. 12:01:57in plus New plus York. And so, that's
  23604. 12:02:00what we're doing here. We're taking this
  23605. 12:02:01and we're saying, "Okay, make it so that
  23606. 12:02:03in the spaces, we only have plus."
  23607. 12:02:06And now if I run this, let me go
  23608. 12:02:09here.
  23609. 12:02:11Okay, I need to unpin this though.
  23610. 12:02:14If I run this, now this should work from
  23611. 12:02:15the Google Sheet.
  23612. 12:02:17Three.
  23613. 12:02:19Went through all three.
  23614. 12:02:21Each one individually that we can then
  23615. 12:02:23use to go through the whole system. So,
  23616. 12:02:25where was I going with this? Well, I was
  23617. 12:02:26going to say that you can have a list of
  23618. 12:02:29businesses to scrape
  23619. 12:02:32here.
  23620. 12:02:33And then at the end of the the actual
  23621. 12:02:35thing, you can have a update a row,
  23622. 12:02:37which is updating here and saying,
  23623. 12:02:39"Added."
  23624. 12:02:40And you can put yes. And then now here,
  23625. 12:02:42you can also put a filter that says,
  23626. 12:02:44"Hey, don't send the ones that have yes
  23627. 12:02:46in here." So, you always send the ones
  23628. 12:02:47that are new that you haven't script
  23629. 12:02:48before. You can have a whole list right
  23630. 12:02:50here. Congrats on finishing the ultimate
  23631. 12:02:52course on n8n, which took you from a
  23632. 12:02:54real beginner in automations in general
  23633. 12:02:56and n8n to someone who's actually able
  23634. 12:02:59to build automations for themselves and
  23635. 12:03:01for other businesses. We answered the
  23636. 12:03:03question of what is automation, and then
  23637. 12:03:05going diving deep into the exact tool,
  23638. 12:03:07which is n8n, which allows us to build
  23639. 12:03:09automations step by step. Then we looked
  23640. 12:03:11at more of the theoretical standpoint to
  23641. 12:03:12automations and understanding how
  23642. 12:03:14softwares speak to softwares, along with
  23643. 12:03:16actually building AI agents, building
  23644. 12:03:18workflows, and then putting them into
  23645. 12:03:20practice by building tangible systems
  23646. 12:03:22that you can implement into businesses.
  23647. 12:03:24And I hope that now gave you a lot of
  23648. 12:03:26use cases that you can think of when
  23649. 12:03:27going out to businesses or even for
  23650. 12:03:29yourself to implement. With that said, I
  23651. 12:03:31really hope that you enjoyed this n8n
  23652. 12:03:33course, and I recommend that you keep
  23653. 12:03:35this unnecessarily long course of n8n
  23654. 12:03:37and automations in the back pocket
  23655. 12:03:39whenever you want to go back to it. With
  23656. 12:03:41that being said, I hope you found value
  23657. 12:03:43from this video, and I'll see you in the
  23658. 12:03:45next one.

About this transcript

This page contains the full transcript of N8N Full Course: Build AI Automations in 2026 (For Beginners) by Michele Torti, generated from the public captions YouTube serves with the video. The transcript has 158,590 words across 23,658 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.