n8n এখন আমার পুরো Homelab চালায়! | n8n Now Runs My ENTIRE Homelab

Spread the love
video
play-rounded-fill

🏠 n8n দিয়ে পুরো Homelab অটোমেশন

NetworkChuck এই ভিডিওতে দেখিয়েছেন কীভাবে তিনি n8n ব্যবহার করে তার পুরো Homelab সম্পূর্ণ অটোমেট করেছেন। n8n একটি ওপেন-সোর্স ওয়ার্কফ্ল অটোমেশন টুল যা আপনাকে বিভিন্ন সার্ভিস এবং API-কে কানেক্ট করে জটিল টাস্ক অটোমেট করতে দেয়।

ভিডিওতে NetworkChunk দেখান কীভাবে তিনি তার সম্পূর্ণ হোমল্যাব — Docker containers, server monitoring, backups, notifications — সবকিছু n8n-এর মাধ্যমে অটোমেট করেছেন। এটি দেখায় যে n8n কেবল একটি simple automation tool নয়, বরং এটি একটি সম্পূর্ণ homelab orchestration platform হতে পারে।

🔑 মূল পয়েন্টসমূহ | Key Takeaways

  • n8n দিয়ে Homelab-এর প্রতিটি component মনিটর করা যায়
  • Docker containers, Proxmox, এবং অন্যান্য সার্ভিসের সাথে integration
  • Automated backup এবং notification workflows
  • Open-source এবং self-hosted — সম্পূর্ণ কন্ট্রোল আপনার হাতে
  • 200+ integrations বিভিন্ন API এবং সার্ভিসের সাথে

📥 সম্পূর্ণ ট্রান্সক্রিপ্ট | Full Transcript

ভিডিও লিংক: https://youtu.be/budTmdQfXYU

📖 সম্পূর্ণ ট্রান্সক্রিপ্ট দেখুন / View Full Transcript / पूरा ट्रांसक्रिप्ट देखें ▼
0:00 Babe, Netflix is broken. I’m seriously
0:03 so mad.
0:03 >> Fix my game. Chuck never
0:06 the toilet again, man. I really need
0:09 this thing to flush.
0:11 >> I would normally stress about this, but
0:13 N manages my home lab.
0:20 >> Yay, it works.
0:23 >> Did you just see that? My new AI
0:25 employee, Terry, fixed everything before
0:27 I could even start trouble.
0:32 No, Terry. No, don’t optimize. Quit.
0:34 Cancel. Cancel. Terry. No. Okay. So,
0:37 that right there, that’s Terminator
0:38 Terry, and we’re going to avoid that at
0:40 all cost. So, in this video, we’re going
0:42 to build your very own super intelligent
0:44 AI agent, aka your new IT employee. It
0:48 can monitor, it can troubleshoot, and
0:49 even with your explicit permission, fix
0:51 things in your network and home lab. Get
0:53 your stinky coffee ready. Let’s try and
0:56 avoid Skynet.
0:58 In part one, we built Baby Terry with
1:00 N8. He was okay. He could monitor your
1:03 websites, but he definitely could not
1:04 troubleshoot your home lab at 3:00 a.m.
1:07 Let’s change that. Welcome to employee
1:09 onboarding. First day, fresh pot of
1:11 coffee. We’re going to give our AI agent
1:13 access to real tools. The ability to
1:15 actually connect to things in our home
1:16 lab and network so it can monitor,
1:18 troubleshoot, and yes, even fix stuff.
1:20 Now, talking UniFi, Proxmbox, Plex, your
1:22 NAS. If it has a CLI or API, Terry can
1:25 handle it. But hold on. We’re going to
1:26 treat Terry like a new hire. You don’t
1:28 give the new guy root access in the
1:30 first day. You got to build that trust.
1:32 It won’t be long. Give him a few cups of
1:34 coffee and he’ll be unstoppable.
1:36 Unstoppable.
1:38 Anyway,
1:42 now before Terry gets to work, we got to
1:44 set him up properly. And even though
1:45 he’s an AI agent powered by N8N, he
1:47 still needs a home. He needs a desk. You
1:49 got two options for this. Think
1:50 carefully. Option one, you can put him
1:52 in your home lab. Terry’s in the house.
1:54 I show you how to do that right here.
1:55 But the downside is that if your home
1:57 lab goes down, so does Terry. That’s why
1:59 I like the option of putting Terry in
2:01 the cloud. A self-hosted NAN instance on
2:04 the hosting your cloud. I love this
2:05 option for two reasons. First, Terry’s
2:07 immune to my tinkering. Two, this is so
2:09 crazy easy to set up. Wait, hold on. You
2:11 don’t have an N instance. Let’s fix that
2:14 right now. By the time I’m done sipping
2:16 this cup of coffee, just taking one sip,
2:18 you’re going to have one. Ready, set,
2:21 go. All right. First, head out to
2:22 hostinger.com/ncn
2:25 or check the link in the description.
2:26 Choose your plan. KVM2 is perfect. Look
2:29 at those muscles. Yes, I am purposely
2:31 moving in slow motion right now for this
2:33 bit. Enter coupon code network chuck and
2:35 magic happens. Continue. Enter your
2:38 stuff. Yes, this is pretty dumb, but
2:41 you’re still here. Create a root
2:42 password. Say yes to a free malware
2:44 scanner. Take a quick coffee break while
2:46 I’m sipping mine. Click on manage VPS.
2:49 and then click on manage app and finish
2:51 your setup. And then you’re good to go.
2:54 Done. And thank you to Hostinger for
2:55 making this video possible. Terry now
2:57 has his desk in the cloud. Now the
2:59 hacker move is to have Terry use Twin
3:00 Gate to securely connect back to your
3:02 network at your house or your business.
3:04 This way Terry can reach your home lab
3:06 securely 24/7. And he’s up even when
3:08 your home lab isn’t. I’ll show you what
3:10 that looks like later. Okay, day one.
3:11 Terry’s going to learn how to monitor
3:13 and troubleshoot. It’s a big day for
3:15 Terry. I’m excited. Here we are in 8.
3:17 Let’s create a new workflow right up
3:18 here at the top. And then we’ll add our
3:20 first step. We’ll make that a manual
3:22 trigger. And then we’ll add one more
3:23 node, our AI agent. AI and AI agent.
3:27 Don’t do anything just yet. Click out of
3:28 there. And here is our starting point.
3:31 Man, Terry’s going to be so smart.
3:32 Actually, let’s make him smart. Let’s
3:34 give him a chat model and AI model. I’m
3:36 going to choose chat GBT. You have a lot
3:38 of options for this. For more info on
3:39 how to set this up, I got it all covered
3:41 in my first video. I’m going chat GBT
3:43 with the 4.1 mini model. It’s very fast.
3:46 And then for memory so he doesn’t forget
3:47 what we’re talking about. We’ll add some
3:48 simple memory right there.
3:51 Perfect. Now to teach Terry, we’re going
3:53 to give him a few simple tasks. First,
3:55 make sure this website is up. That’s it.
3:57 What website? We’re going to make one
3:59 real quick. Just a test one so we can
4:01 walk through it together. We’re going to
4:02 throw this website inside a Docker
4:04 container on the same N host we’re
4:07 working on right now. If you have no
4:08 idea what I’m talking about, that’s
4:09 totally cool. I’m going to walk you
4:10 through it right now. Now, if you
4:11 followed along with me on Hostinger,
4:13 we’re going to go back to our VPS panel,
4:15 and you’ll see a button for browser
4:16 terminal right here at the top right. Go
4:18 ahead and click on that. If you’re
4:19 hosting somewhere else, what you want to
4:20 do is get CLI access to the server
4:22 that’s running your NAN instance. And
4:24 here we are, Home Sweet Home, the
4:26 terminal, my favorite place to be. And
4:27 we’re going to run two commands. First,
4:29 we’ll copy and paste this. I’m going to
4:30 have all the commands below. This will
4:31 run a simple website on port 8090.
4:34 Ready, set, go. Then, we’ll run this
4:36 docker exec command. We’re just adding a
4:38 nice H1 header to our website. Hit enter
4:41 and we’ll do a docker restart website.
4:44 That’s the name of our container by the
4:45 way. And now it should be ready. Let’s
4:47 test it out real quick. I’m going to
4:49 grab the IP address of my server. Open
4:52 up a new tab, paste that in, and type in
4:54 colon port 8090.
4:57 Perfect. We have a website. Now, hold on
4:59 one second. I want you to stop and
5:00 think. How did you make sure that
5:02 website was up? What did you do? You’re
5:04 like, Chuck, all I did was take the URL,
5:06 open up a new tab, and made sure it
5:09 looks good. That’s what we’re going to
5:10 do with Terry. We’re going to teach him
5:12 to do that. And that’s going to be a
5:14 common thread throughout this video.
5:15 You’re going to think about how you
5:16 would monitor something, how you would
5:17 troubleshoot something, how you would
5:18 even fix something, and then show Terry
5:21 the same process. I’m telling you, this
5:23 stuff is crazy. And it feels kind of
5:25 like we’re training another human, but
5:28 it’s AI. It’s weird. Anyways, just got
5:31 to stuff those thoughts down. Can’t
5:33 dwell on that. Now, for Terry to visit a
5:35 website, we got to give him a tool right
5:37 here. So, we’re going to add a tool to
5:38 his tool belt. This will be the HTTP
5:41 request tool right here. It’ll pop open
5:43 for us. And we’re going to change a few
5:45 parameters. First, I’ll just rename it.
5:46 I’m going to call it website tool. And
5:49 then here in the description, I’ll just
5:50 say what he’s supposed to use it for.
5:52 Use this tool to see if the website is
5:56 up. And we’ll paste in our URL right
5:58 here. Let’s do a little test to make
6:00 sure it works. Execute step. And there
6:02 we go. It returns the data that we saw.
6:04 So, Terry has a tool. Let’s tell him how
6:06 to use it. Let’s tell him who he is.
6:07 Actually, let’s open up Terry and we’re
6:09 going to give Terry an identity so he
6:11 doesn’t have a crisis. We’re going to
6:12 click on add option and then system
6:15 message. This is also referred to as his
6:17 system prompt. I’m going to paste in
6:18 this. Again, I’ll have all this below.
6:20 Essentially, I’m telling Terry who he
6:21 is. He’s an IT administrator. He has one
6:23 job. Make sure the website is up. And
6:24 I’m telling him how to use the tool and
6:26 how to report back to me if the website
6:28 is up or down. That’s it. Let’s try it
6:30 out. So, I’m going to open this chat
6:31 message here. By default, the AI agent’s
6:33 going to have a chat message or a chat
6:34 box attached to it. That’s how he’s
6:36 triggered. And I’ll say, “Hey, Terry, is
6:38 the website up?” And watch what happens
6:41 here. He’s going to think about it. He’s
6:43 going to use his tool. You saw that. And
6:45 he’s done. And there’s our message. The
6:47 website is indeed up. And he did what we
6:49 would do. He visited the website. Now,
6:53 let’s make it go down. Let’s see what
6:54 happens. We’ll go over here to our
6:55 terminal, and I’ll say docker stop
6:58 website.
6:59 If I type in docker ps, I’ll be able to
7:01 see that my server is not running
7:03 because right now we only have n running
7:04 in our tray fit container. Those are
7:06 supposed to be running. Don’t touch
7:07 those. Terry can’t fix that yet. Now,
7:10 let’s run Terry. I’m going to reset my
7:12 chat session and say the same message.
7:14 Hey, Terry, is the website up?
7:19 And it’s down. Okay, cool. But why is it
7:21 down? What would you do to troubleshoot
7:23 this? Well, we know that it’s a Docker
7:25 container running on this server. We go
7:27 over here and start doing things like, I
7:29 don’t know, Docker or PS to see if it’s
7:31 running. Let’s show Terry how to do
7:32 that. Let’s teach our new employee how
7:34 to log into a server and check if a
7:35 Docker container is running. For that,
7:37 we’re going to need a new tool, the SSH
7:39 tool, giving our AI agent the ability to
7:41 log into servers via CLI. That is so
7:44 stinking powerful. Coffee break.
7:49 Oh, also don’t forget to save every once
7:50 in a while. You don’t want to lose your
7:51 work. Now, there’s one annoying thing
7:53 here, though. If I click on add tool and
7:55 I’ll go over here to search, there’s no
7:57 SSH tool. I got a workar around, don’t
7:59 worry. Instead of adding a tool, we’re
8:01 going to add a new node. So, hit that
8:02 plus sign at the top right here. Search
8:04 for SSH. Notice there is an SSH node.
8:07 Click on that and we’ll choose the
8:08 execute a command option. Now,
8:11 immediately we’re thrust into the SSH
8:12 node configuration. Let’s go ahead and
8:14 make this happen right now. Let’s
8:15 configure it. I’ll select my credential,
8:16 which we’re not going to have one yet.
8:17 Let’s click on create new credential
8:19 here. All you’re going to do is put in
8:20 the credentials for your server. And for
8:22 our situation right now, it’s going to
8:23 be the host server where NAN lives. I’m
8:25 going to give it the external IP address
8:27 here as the host, taking away all the
8:29 HTTP and bracket stuff. Port 22 is good.
8:32 Username will be root and then password
8:34 is one I set when I set up Hostinger.
8:36 Click on save. It’ll test the
8:38 connection. Good to go. And then we have
8:40 our command field. Let’s test it out
8:42 real quick. We’ll do a simple command
8:43 like host name. Click on execute this
8:45 step. And cool, it works. Host name is
8:48 this guy right here. I’m going to remove
8:50 the host name because we’re not quite
8:51 done because right now our AI agent has
8:53 no way to use this node. It needs to be
8:55 a tool, but right now it’s just a
8:57 standalone node. Let’s change that. If I
8:59 hover over this SSH node, I’ll see some
9:01 dots right here. I’m going to click
9:02 those and I’ll choose the option convert
9:04 node to subworkflow. Watch what happens.
9:08 Boom. Nothing crazy. It’s like rename
9:10 this please. We’re going to call this
9:12 SSH_N
9:14 server. Confirm. That’s it. Now, what
9:17 did that just do? It’s like you put on a
9:19 new suit, some new clothes. It actually
9:20 converted this SSH node into its own
9:23 workflow. So, let’s actually save this
9:25 workflow. Go back to personal over here
9:26 on the left. We now have two workflows.
9:28 The one we were working on and the one
9:30 we just created with the SSH node. Let’s
9:32 jump in there. Ah, look at that. Now,
9:34 while we’re here, we’re going to do a
9:35 couple things. First, we’ll connect the
9:37 start node to our SSH node. Then, we’re
9:40 going to edit this start node. Just
9:41 double click that real quick. And we’ll
9:43 change the input data mode from accept
9:45 all data to define using fields below.
9:47 And then we’ll click on add field. For
9:49 name, we’re going to type in command.
9:51 The type will be string. And then click
9:53 on execute step. Right now, it’s going
9:54 to be nothing null. That’s fine though.
9:57 Click out of that. And then go to your
9:59 SSH node right here. Double click that.
10:01 And we’re going to do one thing. Notice
10:03 here on the left, we have our start node
10:04 as input. And then that command string
10:07 that we created. We’re going to drag
10:09 that over right to the command field.
10:14 Perfect. Now, what did we just do? What
10:16 is all that? What we did is made it
10:18 possible for Terry to use this workflow
10:20 and he’s going to fill in that command
10:22 variable we made with whatever command
10:24 he wants. So let’s say he wants to say
10:26 host name. That is what’s going to be
10:28 fed to this execute a command SSH node.
10:30 Let’s test it out. We’re going to save
10:32 this workflow. Go back to our original
10:33 workflow. And first let’s remove this uh
10:36 sub workflow right here. It’s not going
10:38 to delete it. It’s just going to remove
10:39 it from our current workflow. And then
10:41 we’ll add a tool for Terry. And the tool
10:43 we’re going to use is call nan workflow
10:45 tool. And then down here at the bottom,
10:46 we’ll have our workflow and we have a
10:48 choose option or a choose drop-own box.
10:50 We’re going to click on choose and
10:51 choose our SSH nan server, the one we
10:54 just created. And notice we’re
10:55 immediately given the option to say
10:56 which command do you want to run. Well,
10:58 getting back to our example, we want
10:59 Terry to see if that Docker container is
11:01 running the same way we would check. So,
11:04 let’s have him run docker ps. That’s our
11:06 command. And then also one more thing,
11:07 I’m going to change the name of this
11:09 tool to docker tool so Terry knows what
11:12 to use. Done. Just going to move things
11:15 around. and make it clean. And now let’s
11:16 tell Terry how to use the tool. Again,
11:18 I’ll have all these prompts below. We’re
11:20 going to double click on Terry and we’re
11:21 going to copy and paste this in. Now,
11:23 pretty much the same story as before.
11:24 We’re telling Terry he can use the
11:26 website tool to check if the website is
11:27 up. He’s actually looking at the website
11:28 for network chuck coffee header. But
11:30 then we’re saying, “Hey, the website is
11:32 down. See if the container is up.”
11:33 That’s it. Let’s get out of there and
11:35 save. And then let’s see if Terry can
11:37 check it out for us. Hey, Terry. Is the
11:40 website up?
11:43 Watch Terry go checks the website uses
11:45 our Docker tool. Ah, look at that. So
11:48 he’s like, “Yeah, the website is down.”
11:50 Additionally, the container is not
11:52 running in the list. Now, think about
11:53 what we just did here. We taught Terry
11:55 how to troubleshoot like us. And yes,
11:58 this was simple, but we’re just
12:00 scratching the surface. Now, I don’t
12:01 know about you, but I’m starting to
12:02 trust Terry a bit more. Let’s give him
12:04 some more power. So far, we have him
12:06 pretty locked down to the one command he
12:09 can run. That’s docker ps. What do you
12:10 say we let him choose? Watch this. I can
12:13 jump back into that SSH tool or the nan
12:16 workflow call tool. And here where it
12:18 says command docker ps. Let’s not
12:20 specify a command. Let’s take that away
12:23 and click this magic fairy dust button
12:25 here. That will say let the agent decide
12:29 what to set that variable to. Or in
12:31 other words, let the agent decide what
12:33 the command he’ll run will be. I know. I
12:36 know it’s a bit more trust. I feel like
12:37 I’m there. Now, let’s tell Terry about
12:39 our new trust in him. Let’s change his
12:41 prompt. And we’re going to add a few
12:43 more troubleshooting steps. Again,
12:45 website down. Run docker ps, but also
12:47 now maybe run a docker inspect command
12:49 to see why the container is down. Maybe
12:52 look at the docker logs and see if
12:54 there’s anything weird. I mean, that’s
12:55 what you and I would do. Right now,
12:56 we’re teaching Terry. Let’s try it out.
12:58 Let’s save, reset our chat session, and
13:01 ask him one more time, “Hey, Terry, is
13:03 the website up?” And watch this magic
13:06 happen.
13:08 And it’s done. Notice a couple things
13:10 real quick. He used the Docker tool
13:12 twice for two commands. Let’s see what
13:14 he came up with. Websites down. He found
13:16 the exit code for the container at zero.
13:18 And let’s see what commands he ran. So
13:20 let’s go to our logs down here. Click on
13:22 Docker logs. He ran See, he ran Docker
13:26 PS and then he ran Docker inspect, but
13:28 he didn’t run the logs. Did we tell him
13:30 to? I thought we told him to. Let’s be
13:33 more specific. Always check logs.
13:38 Let’s try it again.
13:41 Ah, he ran it three times. Good boy,
13:43 Terry. See, he’s learning. We’re
13:44 teaching him well. Recent logs, graceful
13:46 shutdown, and exit messages. Terry, I’m
13:49 so proud of you. Employee of the
13:50 stinking month.
13:52 So dumb. But here is where Terry can
13:54 become more powerful. He can do what a
13:56 human can do. Troubleshoot like a human.
13:58 But he can do it constantly. This next
14:01 part is pretty crazy.
14:05 Now, we’re kind of promoting Terry to a
14:07 level two engineer here. We’re going to
14:08 give him two things that’ll make him
14:10 overpowered. One of those things is
14:11 fixing things.
14:14 Here we go. Now, first, this is kind of
14:17 an annoying thing. Like, I hate this. I
14:19 don’t want to have to ask Terry to check
14:21 if my website’s up. Come on, Terry. Do
14:23 your job. I want you to check all the
14:26 time. Let’s make that happen right now.
14:28 To do that, it’s simple. We have a new
14:30 trigger. Right now, we have a manual
14:32 trigger. We have a chat trigger. Let’s
14:34 add a schedule trigger. Go up here,
14:36 click on the plus sign, click on add
14:38 another trigger, and then we got where
14:40 did it go? On a schedule. Boom. Now,
14:42 Terry, I own you, buddy. You’re on the
14:44 clock 24/7. I want you every five
14:48 minutes checking my website. Let’s make
14:51 some room for him. We’ll connect this
14:52 trigger to Terry. Can I change the way
14:54 Terry looks? No. They should really add
14:57 that to NAN. That would really just be
14:58 the extra oomph to really juzj it up,
15:02 you know, stupid.
15:05 Now, doing this is actually going to
15:06 break a few things. So, watch. I’m going
15:09 to execute my trigger. Excute workflow.
15:11 Boom. And it’s like, whoa, what are you
15:14 talking about? You can’t do this.
15:15 Terry’s brain is fried. Let’s fix that.
15:18 There are two things blowing him up
15:19 here. First, he’s expecting a chat
15:21 message telling him what to do. That
15:23 initial, “Hey, Terry, check if the
15:24 website is up.” It’s not happening right
15:26 here with the schedule trigger. we have
15:27 to make it happen artificially. Let’s do
15:30 that. So, right here in between schedule
15:32 trigger and Terry, click on that plus
15:34 icon and we’re going to add a set field
15:37 node or edit fields. It’s going to pop
15:39 open for us. We’re going to add two
15:41 fields first. First will be the prompt.
15:43 We’ll name it prompt and the value will
15:45 be whatever we want Terry to do. This is
15:47 his user message. I’ll simply say check
15:50 if the website is up and then we’ll add
15:52 one more field. This is the second thing
15:54 tripping up Terry. It’s the chat ID or
15:57 session ID. We’ll call it chat ID. Chat
15:59 ID just like this. And we’ll put a value
16:01 in. Let’s just say Terry 1 2 3 4 5.
16:04 Cool. Those are set. Now we have to tell
16:05 Terry about these new things. Click out
16:07 of that. Go to Terry. And notice here in
16:10 Terry’s config, the prompt for the user
16:12 message was tied to that chat input. We
16:15 don’t want that. We want the schedule.
16:16 So let’s back out for a sec. Go back to
16:18 edit fields. Let’s execute that step so
16:20 it actually produces data Terry can look
16:22 at. Get back into Terry. And for this
16:24 chat message, if we drop down the edit
16:27 fields over here on the left, we want it
16:29 to be that prompt right here. So we’re
16:30 going to change the source for prompt
16:32 from connected chat trigger node to
16:35 define below. And then we’ll drag over
16:37 our prompt
16:39 right there. So now whatever we set in
16:42 that prompt is going to show up here as
16:44 Terry’s user prompt. Cool. But what
16:46 about this chat ID? What are we doing
16:48 with that? Well, if we go to our simple
16:49 memory right here, Terry’s little
16:51 short-term memory. Double click that. It
16:53 will remember conversations but based on
16:55 ID. Again, this ID was tied to the chat
16:58 node, but we’re not going to use that.
17:00 So, we have to set that manually. We’ll
17:01 change it from connected chat trigger
17:02 node to define below. And here, I’m
17:04 going to type it in manually. It’ll be
17:06 opening brackets dollar sign JSON.
17:10 ID. And look, it even kind of filled in
17:11 right there for us. And that’s it. Cool.
17:14 So, Terry should be good now to have
17:16 this trigger scheduled. Ready, set,
17:18 execute workflow. Boom. And he’s working
17:21 fine. No errors. And we can check his
17:22 work down here. If we click on the last
17:24 OpenAI chat model log down here, it’ll
17:27 show us what he would have told us in a
17:28 chat message. Perfect. Well, actually,
17:30 not so perfect. We’re kind of moving
17:32 away from the chat message. In fact,
17:34 let’s delete it. Goodbye, chat message.
17:36 We’re now more focused on the schedule
17:38 trigger. I’m not going to micromanage
17:39 you, Terry. You do it yourself. But how
17:41 is Terry going to tell us how the
17:43 website’s doing? When Terry is done
17:45 checking all these things, he’s going to
17:47 output all that stuff he would have
17:49 normally told us to the next step. That
17:51 next step needs to come to us. Let’s
17:53 make that happen. I’m going to click on
17:54 the plus icon right here and I’m going
17:56 to search for Telegram. Now, this is the
17:58 example I’m going for right now.
18:00 Telegram is a chat app. You can use
18:02 Slack if you wanted to or Discord. You
18:05 got options. Essentially, Terry’s going
18:07 to yell at us and tell us, “Hey, here’s
18:09 what’s going on.” I’ll choose Telegram
18:10 and say, “Uh, the action will be Gosh,
18:13 there’s so many actions. Just send me a
18:15 stinking chat. Where’s it at?” Oh, send
18:17 a text message. There we go. Now, like
18:18 every node that connects to an external
18:20 service, you’ll often need a credential.
18:22 I’ll select mine, but I don’t have one.
18:23 Let’s create one. Now, depending on the
18:25 chat app you select, Slack, Telegram,
18:28 Discord, they’re going to have different
18:29 ways to set this up. I’m not going to
18:31 detail it right here, but I will have a
18:32 document below. And also, if you click
18:34 on open documents, they’ll give you some
18:36 help. Like Telegram involves chatting
18:38 with the botfather. So, I went through
18:40 the setup. Let’s see if it works. Test.
18:44 Awesome. There’s my message. Now, we
18:46 don’t want the output to be test. We
18:48 want it to be what Terry says to us. So,
18:50 I’ll take the output of our agent and
18:51 put that right here in text. So, now let
18:54 me step out of here real quick with my
18:56 send a message as the last in line here
18:59 or the end of the line. Let’s trigger
19:01 Terry. Do your work, Terry.
19:04 Boom. Message sent. There’s our report.
19:07 Okay, that’s pretty cool. But, you know,
19:08 also if Terry’s going to be checking
19:10 this every 5 minutes, I don’t want him
19:12 to tell me if there’s nothing wrong.
19:14 Such a noob mistake, Terry. Come on, new
19:16 guy. Only tell me if there’s something
19:18 wrong, dude. Let’s teach him. Let’s show
19:20 him how to do it. And this is what makes
19:22 n so powerful. Watch this. It’s a thing
19:25 called structured output. Because right
19:27 now, we need some logic right here to
19:29 determine if a message should be sent to
19:31 us. So, we’ll start here. Click on
19:33 Terry. Double click Terry. Notice we
19:35 have an option that says require
19:37 specific output format. Let’s click on
19:39 that. Let’s see what happens. Boom.
19:41 Nothing. Let’s click out of Terry. But
19:44 notice there’s a new guy floating
19:45 around. Or actually, not a new guy, a
19:47 new little connector sticking out of
19:49 him. He’s got an output parser with
19:51 nothing attached. Let’s attach one.
19:53 Click on plus sign. And for this, we’re
19:55 going to click on structured output
19:56 parser. And it opens something up for
19:58 us. And it seems kind of weird, right?
20:00 Like what’s what’s happening here?
20:02 Generate from JSON example. Then it has
20:04 like California, Los Angeles.
20:05 Essentially, what it’s enabling us to do
20:07 is have Terry respond to us in a way we
20:09 always want to be responded to. For
20:11 example, we could do this. Again, I’ll
20:13 have everything in the description
20:15 below. I’m going to remove all this San
20:17 Diego business and paste in this. With
20:20 this, we’re telling Terry, when you send
20:22 us a message after you check the
20:24 website, I want you to tell us in this
20:26 nice clean JSON. If the website’s up or
20:29 not, I want you to output a boolean true
20:32 or false. Don’t tell me a story, just
20:34 say true or false. Now, I want to give
20:36 you the option to tell me a story.
20:38 That’s what the message field is for.
20:40 send me a message. Let’s test it out.
20:42 Let’s jump out of there. Notice how the
20:44 output parser is just like another
20:45 little thing hanging off here like a
20:46 tool. Let’s test Terry once more. Okay,
20:49 let’s go check our message. Oh, you know
20:50 what we forgot? Look at this. It’s like
20:52 object object. What is that? We got to
20:55 change how our message is sent. Let’s go
20:57 into our telegram here real quick. We
20:59 got to change our text box here. Let’s
21:01 remove that JSON.output. And we need to
21:03 actually add these individual fields.
21:05 And that’s the power of the structured
21:06 data. Notice how it’s like one item
21:08 false one item the message. So we’ll say
21:12 website up and we’ll put the result
21:15 which would be true or false and we’ll
21:17 say I don’t know just message
21:20 and we’ll put the message content right
21:22 there. Okay, now let’s try it again.
21:24 Here we go. Okay, we got our message.
21:26 Let’s check it out. That’s better.
21:28 Website up false message whatever wants
21:32 to tell us. Now why is that important?
21:34 Because we can do this. We can now
21:36 filter what’s being sent to us and what
21:38 isn’t. Right in between Terry and our
21:40 Telegram message sent, we’re going to
21:42 add a new node. Click on the plus sign
21:44 right there. And we’re going to search
21:46 for if just the if. Add the if and it
21:49 opens up for us here. We’re going to
21:50 grab the website up field and put it
21:52 right here in the first value. We’re
21:54 then going to change the logic right
21:55 here in the middle from is equal to to
21:58 boolean is true. So, let’s get out of
22:01 there real quick. And notice coming out
22:03 of our if node here is a true path and a
22:06 false path. The logic right now is if
22:08 the website is up, then it’ll go down
22:10 the true path. If the website is down,
22:12 it should go down the false path. And
22:14 that should be all we really care about,
22:15 right? So, I’m going to actually put the
22:17 message on the false path because that’s
22:19 going to tell us when it’s down. Let’s
22:20 test it out. Boom. We got our message.
22:22 And notice the path it took. It went
22:24 down the false path. Let’s look at our
22:26 output or the input the if box received.
22:28 See, it got the false. It evaluated it.
22:31 sent it down the false branch. Let’s
22:32 bring that website back up. We’ll do
22:34 docker start website. Let’s see what
22:37 happens when it is up and all good to
22:38 go. Ready, Terry, go. Boom. Terry
22:41 noticed, hey, the website’s up. Should I
22:43 tell my boss? Should I tell Chuck? No,
22:46 Terry. You’re learning. You went down
22:47 the true path. And that goes nowhere. We
22:49 don’t get notified. That’s the power of
22:51 the structured output. It’s so cool.
22:54 Okay, cool. Terry’s on his own. He’s
22:55 checking the website by himself. He’s
22:57 visiting the website. He’s running
22:58 Docker commands. Not too bad for a first
23:00 day. I’m feeling kind of confident with
23:02 Terry. What do you say we let him fix
23:04 the website? This is where
23:08 so many things unlock. And what’s crazy
23:10 is all we have to do is change his
23:12 prompt just a little bit for him to fix
23:13 it. Let’s do it again. Everything will
23:15 be below. Let’s jump into Tererry’s
23:17 prompt here.
23:19 Change it up. And everything is pretty
23:21 much the same except for two things.
23:23 We’re saying if the website’s down, go
23:25 ahead and try to start it up. Run the
23

📝 ট্রান্সক্রিপ্ট NetworkChuck-এর YouTube ভিডিও “n8n Now Runs My ENTIRE Homelab” থেকে নেওয়া হয়েছে।
🔗 YouTube-এ ভিডিওটি দেখুন

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.