TubeSum ← Transcribe a video

n8n Now Runs My Entire Homelab

0h 47m video Published Oct 3, 2025 Transcribed Aug 5, 2026 N NetworkChuck
Intermediate 25 min read For: IT enthusiasts and homelab owners with basic knowledge of n8n and Docker, interested in automating network management.
AI Trust Score 75/100
⚠️ Average / Some Fluff

"Delivers on the promise of running a homelab with n8n, but includes sponsor segments and some fluff."

AI Summary

This video demonstrates how to build a super-intelligent AI agent, named Terry, using n8n, to monitor, troubleshoot, and fix issues in a home lab or network. The tutorial covers setting up n8n on a cloud VPS, creating workflows with tools like HTTP requests and SSH, implementing human-in-the-loop approvals, and integrating with services like UniFi, Proxmox, and Plex. The video emphasizes the power and potential risks of giving AI agents autonomous control, advocating for guardrails and approval mechanisms.

[00:38]
Introduction to Terry the AI Agent

The video introduces Terry, an AI agent built with n8n, designed to act as an IT employee that can monitor, troubleshoot, and fix issues in a home lab or network with explicit permission.

[01:49]
Choosing a Hosting Option

Two options for hosting Terry: in the home lab (downside: if lab goes down, Terry goes down) or in the cloud (self-hosted n8n on a VPS). The cloud option is preferred for reliability and ease of setup.

[02:18]
Setting Up n8n on Hostinger

Step-by-step guide to set up n8n on a Hostinger VPS (KVM2 plan) using coupon code 'network chuck'. Includes creating an account, choosing a plan, and deploying the n8n app.

[03:13]
Creating the First Workflow

In n8n, create a new workflow with a manual trigger and an AI agent node. Configure the AI model (ChatGPT 4.1 mini) and add simple memory.

[03:55]
Teaching Terry to Monitor a Website

Create a simple website in a Docker container on the same server. Add an HTTP request tool to the AI agent so it can check if the website is up. Test the tool and configure the system prompt to instruct Terry.

[06:28]
Testing Website Monitoring

Ask Terry 'Is the website up?' and observe it using the HTTP tool to visit the website and report status. Then stop the Docker container to simulate a failure and test Terry's ability to detect it.

[07:27]
Adding SSH Tool for Troubleshooting

To troubleshoot, add an SSH node to allow Terry to log into servers via CLI. Since there's no direct SSH tool, convert the SSH node into a subworkflow and expose it as a tool.

[10:36]
Creating a Docker Tool

Convert the SSH subworkflow into a tool named 'docker tool' and configure it to run 'docker ps' to check container status. Update Terry's prompt to use this tool for troubleshooting.

[12:10]
Giving Terry More Freedom

Allow Terry to decide which commands to run by removing the fixed command and using the 'let the agent decide' option. Update the prompt to include more troubleshooting steps like 'docker inspect' and 'docker logs'.

[13:58]
Scheduling Terry to Monitor Continuously

Add a schedule trigger to run every 5 minutes. Fix issues with the chat input by adding an 'edit fields' node to set the prompt and chat ID manually.

[17:36]
Notifying via Telegram

Add a Telegram node to send messages. Configure it to send Terry's output. Use structured output to have Terry respond in JSON format with fields like 'website_up' and 'message'.

[21:36]
Filtering Notifications with IF Node

Add an IF node to only send notifications when the website is down. This uses the 'website_up' boolean from the structured output.

[23:12]
Letting Terry Fix the Website

Update Terry's prompt to allow it to run 'docker start website' if the website is down, then verify. Test by stopping the container and observing Terry fix it.

[24:50]
Testing with a Port Conflict

Introduce a port conflict by running a Python server on port 8090. Terry fails to fix it because it only knows the specific command. This highlights the need for more general troubleshooting.

[26:01]
Giving Terry More Power

Update the prompt to allow Terry to do whatever it needs to fix the website. Also provide documentation about the setup. Test again, but Terry stops the container running itself, causing a problem.

[28:33]
Implementing Human-in-the-Loop Approval

Add a Telegram approval node so Terry must ask for permission before running commands that modify the system. Update the prompt to require approval for such commands.

[31:43]
Testing the Approval Flow

Break the website again and test. Terry requests approval to kill the Python process and start the container. Approve and observe Terry fix the issue.

[35:41]
Using Switch for Multiple Conditions

Replace the IF node with a switch to notify when a fix is applied or when the website is down. This allows more flexible notification logic.

[37:03]
Integrating with Home Lab Services

Use Twingate to securely connect the cloud VPS to the home lab. Then add tools for UniFi API, Proxmox CLI, and Plex API to allow Terry to manage these services.

[42:13]
Conclusion and Next Steps

Recap what was built: Terry can monitor, troubleshoot, and fix issues with human approval. Encourage viewers to build their own Terry and share ideas. Mention future plans: sub-agents, documentation, and help desk.

The video successfully demonstrates how to build a powerful AI agent with n8n that can monitor, troubleshoot, and fix IT issues, with human-in-the-loop approval for safety. It highlights the potential for AI to manage entire infrastructures, but emphasizes the need for guardrails and documentation.

Mentioned in this Video

Tutorial Checklist

1 02:18 Sign up for Hostinger and choose KVM2 plan, use coupon code 'network chuck'.
2 02:46 Deploy n8n app on the VPS and complete setup.
3 03:13 In n8n, create a new workflow with a manual trigger and an AI agent node.
4 03:27 Configure the AI agent with a chat model (e.g., ChatGPT 4.1 mini) and simple memory.
5 03:55 Create a website in Docker on the same server (commands provided).
6 05:31 Add an HTTP request tool to the AI agent, rename to 'website tool', and set URL.
7 06:15 Set system prompt for Terry to define its role and how to use the tool.
8 07:27 Add an SSH node to the workflow (since no SSH tool exists).
9 08:19 Create SSH credentials for the server (host, port 22, username root, password).
10 08:57 Convert the SSH node to a subworkflow and rename it to 'SSH_N server'.
11 09:28 In the subworkflow, connect start node to SSH node, set input data mode to 'define using fields below', add field 'command' (string).
12 10:07 Drag the 'command' field from start node to the SSH node's command parameter.
13 10:36 Back in main workflow, remove the old SSH node and add a 'call n8n workflow' tool, select the subworkflow, set command to 'docker ps', rename tool to 'docker tool'.
14 11:16 Update Terry's system prompt to include instructions for using the docker tool.
15 12:10 In the tool configuration, remove the fixed command and enable 'let the agent decide'.
16 12:49 Update Terry's prompt to include more troubleshooting steps like 'docker inspect' and 'docker logs'.
17 14:26 Add a schedule trigger to run every 5 minutes.
18 15:32 Add an 'edit fields' node between schedule trigger and Terry to set 'prompt' and 'chat ID'.
19 16:15 In Terry's config, change the source for prompt and chat ID to 'define below' and map from edit fields.
20 17:36 Add a Telegram node to send messages. Set up credentials and test.
21 19:25 Enable 'require specific output format' on Terry and add a structured output parser with JSON schema.
22 21:36 Add an IF node to filter notifications: only send when website is down.
23 23:12 Update Terry's prompt to allow fixing the website by running 'docker start website' and verify.
24 28:33 Add a Telegram approval node (send and wait for response) to require human approval for commands.
25 30:22 Update Terry's prompt to request approval before running commands that modify the system.
26 31:30 Update the structured output parser to include fields like 'apply_fix' and 'needs_approval'.
27 32:08 Add an IF node to check 'needs_approval' and route to approval node.
28 33:42 Add an 'edit fields' node after approval to set 'prompt' to the approval message and 'chat ID'.
29 35:41 Replace IF node with a switch to notify when fix applied or website down.
30 37:03 Set up Twingate to connect cloud VPS to home lab.
31 37:42 Add UniFi API tool (HTTP request) and create API key.
32 38:55 Add Proxmox SSH tool (similar to previous SSH subworkflow).
33 40:11 Add Plex API tool (HTTP request) and configure.

Study Flashcards (9)

What is the main purpose of the AI agent 'Terry' in this video?

easy Click to reveal answer

To monitor, troubleshoot, and fix issues in a home lab or network using n8n.

00:38

What are the two hosting options for n8n mentioned?

easy Click to reveal answer

Home lab (self-hosted) or cloud VPS (e.g., Hostinger).

01:49

What tool is used to allow Terry to check if a website is up?

easy Click to reveal answer

HTTP request tool.

05:31

How do you convert an SSH node into a tool for the AI agent?

medium Click to reveal answer

Convert the node to a subworkflow and then use the 'call n8n workflow' tool.

08:57

What is the purpose of the 'structured output' feature in n8n?

medium Click to reveal answer

To have the AI agent respond in a predefined JSON format for easier processing.

19:25

How does the human-in-the-loop approval work?

medium Click to reveal answer

Terry sends a message requesting approval via Telegram, and the user approves or denies before Terry runs the command.

28:33

What is the purpose of the 'switch' node in the final workflow?

medium Click to reveal answer

To route notifications based on multiple conditions, such as when a fix is applied or when the website is down.

35:41

What is Twingate used for in this setup?

easy Click to reveal answer

To securely connect the cloud VPS to the home lab network.

37:03

What are the three future improvements mentioned for Terry?

medium Click to reveal answer

Sub-agents, documentation, and a help desk.

43:19

💡 Key Takeaways

💡

Introducing Terry

Sets the stage for building an AI agent that can manage IT infrastructure.

00:38
📊

Hosting Options

Explains the trade-offs between self-hosting and cloud hosting for reliability.

01:49
🔧

Teaching Terry to Monitor

Demonstrates the core concept of giving an AI agent tools to perform tasks.

03:55
🔧

SSH Tool Workaround

Shows how to convert a node into a subworkflow to create a custom tool.

07:27
⚖️

Letting the Agent Decide

Illustrates the balance between control and autonomy in AI agents.

12:10
🔧

Structured Output

Enables reliable data extraction from AI responses for automation.

19:25
⚖️

Human-in-the-Loop

Highlights the importance of safety and control when giving AI autonomous actions.

28:33
💡

Integrating with Home Lab

Shows the potential for AI to manage real-world infrastructure services.

37:03

[00:03] >> Fix my game. Chuck never the toilet again, man. I really need this thing to flush. >> I would normally stress about this, but >> I would normally stress about this, but N manages my home lab.

[00:23] >> Did you just see that? My new AI employee, Terry, fixed everything before employee, Terry, fixed everything before I could even start trouble. Cancel. Cancel. Terry. No. Okay. So, that right there, that's Terminator

[00:38] Terry, and we're going to avoid that at all cost. So, in this video, we're going to build your very own super intelligent AI agent, aka your new IT employee. It even with your explicit permission, fix things in your network and home lab. Get

[00:53] your stinky coffee ready. Let's try and avoid Skynet. In part one, we built Baby Terry with N8. He was okay. He could monitor your websites, but he definitely could not troubleshoot your home lab at 3:00 a.m.

[01:07] Let's change that. Welcome to employee onboarding. First day, fresh pot of coffee. We're going to give our AI agent access to real tools. The ability to lab and network so it can monitor, troubleshoot, and yes, even fix stuff.

[01:20] Now, talking UniFi, Proxmbox, Plex, your NAS. If it has a CLI or API, Terry can treat Terry like a new hire. You don't give the new guy root access in the It won't be long. Give him a few cups of

[01:34] coffee and he'll be unstoppable. Unstoppable. Unstoppable. Anyway, he's an AI agent powered by N8N, he still needs a home. He needs a desk. You

[01:49] carefully. Option one, you can put him in your home lab. Terry's in the house. But the downside is that if your home lab goes down, so does Terry. That's why I like the option of putting Terry in the cloud. A self-hosted NAN instance on

[02:04] option for two reasons. First, Terry's immune to my tinkering. Two, this is so crazy easy to set up. Wait, hold on. You don't have an N instance. Let's fix that right now. By the time I'm done sipping this cup of coffee, just taking one sip,

[02:18] you're going to have one. Ready, set, go. All right. First, head out to hostinger.com/ncn or check the link in the description. Choose your plan. KVM2 is perfect. Look at those muscles. Yes, I am purposely

[02:31] moving in slow motion right now for this bit. Enter coupon code network chuck and magic happens. Continue. Enter your stuff. Yes, this is pretty dumb, but password. Say yes to a free malware scanner. Take a quick coffee break while

[02:46] I'm sipping mine. Click on manage VPS. and then click on manage app and finish your setup. And then you're good to go. Done. And thank you to Hostinger for making this video possible. Terry now has his desk in the cloud. Now the

[02:59] Gate to securely connect back to your network at your house or your business. This way Terry can reach your home lab securely 24/7. And he's up even when that looks like later. Okay, day one. Terry's going to learn how to monitor

[03:13] and troubleshoot. It's a big day for Terry. I'm excited. Here we are in 8. here at the top. And then we'll add our first step. We'll make that a manual trigger. And then we'll add one more node, our AI agent. AI and AI agent.

[03:27] Don't do anything just yet. Click out of there. And here is our starting point. Actually, let's make him smart. Let's give him a chat model and AI model. I'm of options for this. For more info on how to set this up, I got it all covered

[03:41] in my first video. I'm going chat GBT with the 4.1 mini model. It's very fast. what we're talking about. We'll add some simple memory right there. Perfect. Now to teach Terry, we're going to give him a few simple tasks. First,

[03:55] make sure this website is up. That's it. What website? We're going to make one walk through it together. We're going to throw this website inside a Docker container on the same N host we're working on right now. If you have no

[04:08] through it right now. Now, if you followed along with me on Hostinger, and you'll see a button for browser terminal right here at the top right. Go hosting somewhere else, what you want to do is get CLI access to the server

[04:22] that's running your NAN instance. And here we are, Home Sweet Home, the we're going to run two commands. First, we'll copy and paste this. I'm going to have all the commands below. This will run a simple website on port 8090.

[04:34] Ready, set, go. Then, we'll run this docker exec command. We're just adding a nice H1 header to our website. Hit enter and we'll do a docker restart website. way. And now it should be ready. Let's test it out real quick. I'm going to

[04:49] grab the IP address of my server. Open up a new tab, paste that in, and type in colon port 8090. Perfect. We have a website. Now, hold on think. How did you make sure that website was up? What did you do? You're

[05:04] like, Chuck, all I did was take the URL, open up a new tab, and made sure it do with Terry. We're going to teach him to do that. And that's going to be a You're going to think about how you would monitor something, how you would

[05:17] troubleshoot something, how you would even fix something, and then show Terry the same process. I'm telling you, this stuff is crazy. And it feels kind of like we're training another human, but it's AI. It's weird. Anyways, just got

[05:31] to stuff those thoughts down. Can't dwell on that. Now, for Terry to visit a here. So, we're going to add a tool to his tool belt. This will be the HTTP request tool right here. It'll pop open for us. And we're going to change a few

[05:45] parameters. First, I'll just rename it. I'm going to call it website tool. And say what he's supposed to use it for. Use this tool to see if the website is up. And we'll paste in our URL right here. Let's do a little test to make

[06:00] sure it works. Execute step. And there we go. It returns the data that we saw. to use it. Let's tell him who he is. Actually, let's open up Terry and we're doesn't have a crisis. We're going to click on add option and then system

[06:15] system prompt. I'm going to paste in this. Again, I'll have all this below. is. He's an IT administrator. He has one job. Make sure the website is up. And I'm telling him how to use the tool and how to report back to me if the website

[06:28] out. So, I'm going to open this chat message here. By default, the AI agent's box attached to it. That's how he's triggered. And I'll say, "Hey, Terry, is the website up?" And watch what happens here. He's going to think about it. He's

[06:43] going to use his tool. You saw that. And he's done. And there's our message. The website is indeed up. And he did what we would do. He visited the website. Now, happens. We'll go over here to our terminal, and I'll say docker stop

[06:58] If I type in docker ps, I'll be able to see that my server is not running in our tray fit container. Those are supposed to be running. Don't touch those. Terry can't fix that yet. Now, let's run Terry. I'm going to reset my

[07:12] chat session and say the same message. Hey, Terry, is the website up? And it's down. Okay, cool. But why is it down? What would you do to troubleshoot this? Well, we know that it's a Docker container running on this server. We go

[07:27] over here and start doing things like, I don't know, Docker or PS to see if it's that. Let's teach our new employee how to log into a server and check if a Docker container is running. For that, we're going to need a new tool, the SSH

[07:39] tool, giving our AI agent the ability to log into servers via CLI. That is so log into servers via CLI. That is so stinking powerful. Coffee break. in a while. You don't want to lose your work. Now, there's one annoying thing

[07:53] here, though. If I click on add tool and I'll go over here to search, there's no SSH tool. I got a workar around, don't worry. Instead of adding a tool, we're plus sign at the top right here. Search for SSH. Notice there is an SSH node.

[08:07] Click on that and we'll choose the execute a command option. Now, node configuration. Let's go ahead and make this happen right now. Let's which we're not going to have one yet. Let's click on create new credential

[08:19] the credentials for your server. And for our situation right now, it's going to be the host server where NAN lives. I'm going to give it the external IP address here as the host, taking away all the HTTP and bracket stuff. Port 22 is good.

[08:32] Username will be root and then password is one I set when I set up Hostinger. Click on save. It'll test the connection. Good to go. And then we have real quick. We'll do a simple command like host name. Click on execute this

[08:45] step. And cool, it works. Host name is this guy right here. I'm going to remove the host name because we're not quite done because right now our AI agent has no way to use this node. It needs to be a tool, but right now it's just a

[08:57] standalone node. Let's change that. If I hover over this SSH node, I'll see some those and I'll choose the option convert node to subworkflow. Watch what happens. Boom. Nothing crazy. It's like rename this please. We're going to call this

[09:12] SSH_N server. Confirm. That's it. Now, what new suit, some new clothes. It actually converted this SSH node into its own workflow. Go back to personal over here on the left. We now have two workflows.

[09:28] The one we were working on and the one we just created with the SSH node. Let's while we're here, we're going to do a couple things. First, we'll connect the start node to our SSH node. Then, we're going to edit this start node. Just

[09:41] double click that real quick. And we'll change the input data mode from accept all data to define using fields below. And then we'll click on add field. For name, we're going to type in command. The type will be string. And then click

[09:53] on execute step. Right now, it's going to be nothing null. That's fine though. Click out of that. And then go to your SSH node right here. Double click that. here on the left, we have our start node as input. And then that command string

[10:07] that we created. We're going to drag that over right to the command field. Perfect. Now, what did we just do? What is all that? What we did is made it possible for Terry to use this workflow and he's going to fill in that command

[10:22] variable we made with whatever command he wants. So let's say he wants to say host name. That is what's going to be fed to this execute a command SSH node. this workflow. Go back to our original workflow. And first let's remove this uh

[10:36] to delete it. It's just going to remove it from our current workflow. And then we'll add a tool for Terry. And the tool we're going to use is call nan workflow we'll have our workflow and we have a choose option or a choose drop-own box.

[10:50] We're going to click on choose and choose our SSH nan server, the one we immediately given the option to say which command do you want to run. Well, Terry to see if that Docker container is running the same way we would check. So,

[11:03] let's have him run docker ps. That's our command. And then also one more thing, I'm going to change the name of this tool to docker tool so Terry knows what to use. Done. Just going to move things around. and make it clean. And now let's

[11:16] tell Terry how to use the tool. Again, I'll have all these prompts below. We're going to copy and paste this in. Now, pretty much the same story as before. website tool to check if the website is up. He's actually looking at the website

[11:28] for network chuck coffee header. But then we're saying, "Hey, the website is That's it. Let's get out of there and save. And then let's see if Terry can check it out for us. Hey, Terry. Is the website up?

[11:43] Watch Terry go checks the website uses our Docker tool. Ah, look at that. So he's like, "Yeah, the website is down." Additionally, the container is not what we just did here. We taught Terry how to troubleshoot like us. And yes,

[11:58] scratching the surface. Now, I don't know about you, but I'm starting to trust Terry a bit more. Let's give him some more power. So far, we have him pretty locked down to the one command he can run. That's docker ps. What do you

[12:10] say we let him choose? Watch this. I can jump back into that SSH tool or the nan workflow call tool. And here where it says command docker ps. Let's not specify a command. Let's take that away and click this magic fairy dust button

[12:25] and click this magic fairy dust button here. That will say let the agent decide what to set that variable to. Or in other words, let the agent decide what the command he'll run will be. I know. I know it's a bit more trust. I feel like

[12:37] I'm there. Now, let's tell Terry about our new trust in him. Let's change his prompt. And we're going to add a few more troubleshooting steps. Again, website down. Run docker ps, but also now maybe run a docker inspect command

[12:49] to see why the container is down. Maybe look at the docker logs and see if what you and I would do. Right now, we're teaching Terry. Let's try it out. Let's save, reset our chat session, and ask him one more time, "Hey, Terry, is

[13:03] the website up?" And watch this magic happen. And it's done. Notice a couple things real quick. He used the Docker tool twice for two commands. Let's see what he came up with. Websites down. He found

[13:16] the exit code for the container at zero. And let's see what commands he ran. So let's go to our logs down here. Click on Docker logs. He ran See, he ran Docker PS and then he ran Docker inspect, but he didn't run the logs. Did we tell him

[13:30] to? I thought we told him to. Let's be more specific. Always check logs. Let's try it again. Ah, he ran it three times. Good boy,

[13:43] teaching him well. Recent logs, graceful shutdown, and exit messages. Terry, I'm stinking month. So dumb. But here is where Terry can become more powerful. He can do what a human can do. Troubleshoot like a human.

[13:58] But he can do it constantly. This next part is pretty crazy. give him two things that'll make him overpowered. One of those things is

[14:11] fixing things. Here we go. Now, first, this is kind of an annoying thing. Like, I hate this. I don't want to have to ask Terry to check if my website's up. Come on, Terry. Do your job. I want you to check all the

[14:26] time. Let's make that happen right now. To do that, it's simple. We have a new trigger. Right now, we have a manual trigger. We have a chat trigger. Let's add a schedule trigger. Go up here, click on the plus sign, click on add

[14:38] another trigger, and then we got where did it go? On a schedule. Boom. Now, Terry, I own you, buddy. You're on the clock 24/7. I want you every five minutes checking my website. Let's make some room for him. We'll connect this

[14:52] trigger to Terry. Can I change the way Terry looks? No. They should really add that to NAN. That would really just be the extra oomph to really juzj it up, you know, stupid. Now, doing this is actually going to

[15:06] break a few things. So, watch. I'm going to execute my trigger. Excute workflow. Boom. And it's like, whoa, what are you talking about? You can't do this. Terry's brain is fried. Let's fix that. There are two things blowing him up

[15:19] here. First, he's expecting a chat message telling him what to do. That website is up." It's not happening right here with the schedule trigger. we have to make it happen artificially. Let's do that. So, right here in between schedule

[15:32] trigger and Terry, click on that plus icon and we're going to add a set field node or edit fields. It's going to pop open for us. We're going to add two fields first. First will be the prompt. We'll name it prompt and the value will

[15:45] be whatever we want Terry to do. This is his user message. I'll simply say check if the website is up and then we'll add one more field. This is the second thing tripping up Terry. It's the chat ID or session ID. We'll call it chat ID. Chat

[15:59] ID just like this. And we'll put a value in. Let's just say Terry 1 2 3 4 5. Terry about these new things. Click out of that. Go to Terry. And notice here in Terry's config, the prompt for the user message was tied to that chat input. We

[16:15] So let's back out for a sec. Go back to edit fields. Let's execute that step so it actually produces data Terry can look at. Get back into Terry. And for this chat message, if we drop down the edit fields over here on the left, we want it

[16:29] going to change the source for prompt from connected chat trigger node to define below. And then we'll drag over our prompt right there. So now whatever we set in that prompt is going to show up here as

[16:44] about this chat ID? What are we doing memory right here, Terry's little short-term memory. Double click that. It will remember conversations but based on ID. Again, this ID was tied to the chat

[16:58] So, we have to set that manually. We'll change it from connected chat trigger node to define below. And here, I'm going to type it in manually. It'll be going to type it in manually. It'll be opening brackets dollar sign JSON.

[17:10] right there for us. And that's it. Cool. So, Terry should be good now to have this trigger scheduled. Ready, set, execute workflow. Boom. And he's working fine. No errors. And we can check his

[17:22] work down here. If we click on the last OpenAI chat model log down here, it'll chat message. Perfect. Well, actually, not so perfect. We're kind of moving let's delete it. Goodbye, chat message.

[17:36] trigger. I'm not going to micromanage you, Terry. You do it yourself. But how is Terry going to tell us how the website's doing? When Terry is done checking all these things, he's going to output all that stuff he would have

[17:49] normally told us to the next step. That next step needs to come to us. Let's the plus icon right here and I'm going to search for Telegram. Now, this is the example I'm going for right now. Telegram is a chat app. You can use

[18:02] Slack if you wanted to or Discord. You got options. Essentially, Terry's going what's going on." I'll choose Telegram and say, "Uh, the action will be Gosh, there's so many actions. Just send me a stinking chat. Where's it at?" Oh, send

[18:17] every node that connects to an external service, you'll often need a credential. I'll select mine, but I don't have one. Let's create one. Now, depending on the chat app you select, Slack, Telegram, Discord, they're going to have different

[18:29] detail it right here, but I will have a document below. And also, if you click on open documents, they'll give you some help. Like Telegram involves chatting with the botfather. So, I went through the setup. Let's see if it works. Test.

[18:44] Awesome. There's my message. Now, we don't want the output to be test. We I'll take the output of our agent and put that right here in text. So, now let me step out of here real quick with my send a message as the last in line here

[18:59] or the end of the line. Let's trigger Terry. Do your work, Terry. Boom. Message sent. There's our report. Okay, that's pretty cool. But, you know, also if Terry's going to be checking this every 5 minutes, I don't want him

[19:12] to tell me if there's nothing wrong. Such a noob mistake, Terry. Come on, new wrong, dude. Let's teach him. Let's show him how to do it. And this is what makes n so powerful. Watch this. It's a thing

[19:25] called structured output. Because right now, we need some logic right here to determine if a message should be sent to us. So, we'll start here. Click on Terry. Double click Terry. Notice we have an option that says require

[19:37] specific output format. Let's click on that. Let's see what happens. Boom. Nothing. Let's click out of Terry. But notice there's a new guy floating around. Or actually, not a new guy, a new little connector sticking out of

[19:49] him. He's got an output parser with nothing attached. Let's attach one. going to click on structured output parser. And it opens something up for us. And it seems kind of weird, right? Like what's what's happening here?

[20:02] like California, Los Angeles. Essentially, what it's enabling us to do is have Terry respond to us in a way we always want to be responded to. For example, we could do this. Again, I'll have everything in the description

[20:15] below. I'm going to remove all this San Diego business and paste in this. With this, we're telling Terry, when you send us a message after you check the website, I want you to tell us in this nice clean JSON. If the website's up or

[20:29] not, I want you to output a boolean true or false. Don't tell me a story, just say true or false. Now, I want to give you the option to tell me a story. That's what the message field is for. send me a message. Let's test it out.

[20:42] output parser is just like another little thing hanging off here like a tool. Let's test Terry once more. Okay, let's go check our message. Oh, you know what we forgot? Look at this. It's like object object. What is that? We got to

[20:55] change how our message is sent. Let's go into our telegram here real quick. We got to change our text box here. Let's remove that JSON.output. And we need to And that's the power of the structured data. Notice how it's like one item

[21:08] data. Notice how it's like one item false one item the message. So we'll say website up and we'll put the result which would be true or false and we'll say I don't know just message and we'll put the message content right

[21:22] there. Okay, now let's try it again. Here we go. Okay, we got our message. Let's check it out. That's better. Website up false message whatever wants Because we can do this. We can now

[21:36] filter what's being sent to us and what isn't. Right in between Terry and our Telegram message sent, we're going to add a new node. Click on the plus sign right there. And we're going to search for if just the if. Add the if and it

[21:49] grab the website up field and put it right here in the first value. We're then going to change the logic right here in the middle from is equal to to boolean is true. So, let's get out of there real quick. And notice coming out

[22:03] of our if node here is a true path and a false path. The logic right now is if the website is up, then it'll go down the true path. If the website is down, that should be all we really care about, right? So, I'm going to actually put the

[22:17] going to tell us when it's down. Let's test it out. Boom. We got our message. And notice the path it took. It went down the false path. Let's look at our output or the input the if box received. See, it got the false. It evaluated it.

[22:31] bring that website back up. We'll do docker start website. Let's see what happens when it is up and all good to go. Ready, Terry, go. Boom. Terry noticed, hey, the website's up. Should I tell my boss? Should I tell Chuck? No,

[22:45] Terry. You're learning. You went down the true path. And that goes nowhere. We don't get notified. That's the power of the structured output. It's so cool. Okay, cool. Terry's on his own. He's checking the website by himself. He's

[22:57] Docker commands. Not too bad for a first day. I'm feeling kind of confident with Terry. What do you say we let him fix the website? This is where is all we have to do is change his

[23:12] it. Let's do it again. Everything will be below. Let's jump into Tererry's prompt here. Change it up. And everything is pretty much the same except for two things. We're saying if the website's down, go

[23:25] ahead and try to start it up. Run the Docker container start website command. website. And then we're telling them, hey, once you start it, go verify once more. Try to visit the website and tell us if it's up and then give us our

[23:38] This is going to be crazy. Actually, let's make the website go down first. Docker, stop website. So, website is down. If I try to visit it real quick, again. Terry will be doing this every

[23:52] five minutes. Ready, set, go. Terry's thinking. Terry's working. He's running commands. He's being Oh. Oh, look at that. Okay, so it went down the true path, which means the website was up. Let's see his last message. Initially,

[24:05] refused. I restarted the container successfully. After restart, the website responded correctly with the expected content. Therefore, the website is now operational. Are you kidding me right now? Terry.

[24:18] While this is a simple example, I know Terry monitored an issue, he troubleshooted an issue, he fixed an issue. If Terry can be taught to do that, what else can Terry be taught to do? That felt like a tongue twister 10

[24:33] times fast. But let's get real here. Terry, he did a good job, but he's on Like, we told him exactly how to fix this thing when he encounters it. What if we give him something he's never seen before? Can he solve it? Let's see.

[24:50] pretty mean to Terry on his first day. Eh, oh well. Let's introduce a port conflict issue. Let's see how Terry does troubleshooting something he's never terminal here. Type in docker ps. Make sure our container is running. It is.

[25:04] There it is. Let's change that. We'll say docker stop website. Now, Terry knows how to fix that, but he doesn't know how to fix this. We're going to run a Python server with this command here. Python 3-mTP.Server

[25:19] port 8090. Just run that command. Boom. What that's going to do is run a web server, just a quick one, on that same port, but it's not our site. And if Terry tries to spin up that container, there's going to be a port conflict and

[25:32] it won't happen. How's Terry going to deal with that? Let's see. Terry, let's see what you stinking got. Ready, set, go. Oh, we got the message. It means he failed. Let's see. websites down. He tried to restart the container, didn't

[25:45] Terry because he did exactly what he knew how to do and nothing more. That's engineer. You don't want them getting too crazy. But now I want Terry to get me. I don't want to sit here and troubleshoot this. I want him to. Let's

[26:01] give Terry some more power. And it's kind of scary easy to do this. Watch. change. I'll simply tell Terry he can do whatever he needs to do to bring this website up. No more limits on his

[26:14] commands. So notice this prompt is kind of thin. The differences here are if the troubleshoot the issue. Once you figure fix you need to bring the that container up and fix the website. Also, we gave

[26:27] is he just like, "Oh, website, I'm going to follow instructions." Let's let's we're running a website and a Docker container. It's on this port. So he's not troubleshooting blind. He's got documentation. Let's see what he can do.

[26:40] I'm so curious if he can solve it. Okay, let's make sure our Python server is Terry, let's see what you got, buddy. Dude, he's going Oh, problem. So, here's we run into a problem here. Obviously, I too many iterations. Notice he ran that

[26:55] Docker tool like nine times. I think the limit is 10 by default. And also notice tool name. So, let's change it to CLI tool because I told Terry in his prompt, use the CLI tool. Now, let's describe it. Use this tool to run commands on

[27:11] this server. Running our website for troubleshooting purposes. All right, Python server is running. Let's see if Terry can do this. Terry's user message, too, because right now it just says in our user prompt,

[27:25] check if the website is up. I'm going to tell him monitor this website. If it's down, fix it. Simple. Let's see what we got. Here we go. Terry, can you fix it with it being kind of ambiguous? He's going. He's running tools. He's

[27:39] sweating. His first real test. He's thinking there. What? What did he run? No. Terry, you stuffed yourself.

[27:51] That's a problem. He stopped the container that's running him. Let's see. container that's running him. Let's see. Yeah, Trafic is done. again. Okay, we start it up again. Now, let's

[28:05] try to access stuff. Terry, you broke yourself, dude. That right there brings with letting AI do anything on my network. I would have stopped Terry from doing that, but I didn't know. But I still want him to try and troubleshoot

[28:18] things. I want him to work, but I want to be in the loop. And this is called going to implement right now. We're going to solve two problems actually. was trying to stop himself and trying to fix this container. And second, let's be

[28:33] human in the loop works is very similar to our message here we received from have the opportunity to approve a message. So, Terry will go, "Huh, I'm permission from my boss first. He's going to send it to us. We click approve

[28:47] and then he can continue working." This involves two steps. First, set up human Tell Terry his new rules. And then kind of a side note like how we'd fix that issue where he was trying to destroy

[29:00] himself. That would just be a better prompt, better documentation, like don't stop these containers. They are running you. If there's a port conflict, we can and how he might find those. Actually, I'm curious if we gave Terry a smarter

[29:13] brain. Let's do a smarter GBT model like 4.1. That was 4.1 mini. Let's do four full 4.1 real quick. All right, smarter Terry. See what you got. Oh, I think smarter Terry did it. Let's go see. Website up is true. Let's go. Let's go

[29:27] look. Yeah, it is. He did it. Oh, it found the Python 3 process and it did it's that reason like it's inconsistent. We want to be in control. We want to it happen right now. So, let's add a new node. Top right here, and we're going to

[29:40] It's actually right there. It's a main category. Click on that. And they're apps like we've seen before. We'll choose Telegram. And this is just going different operation. The other one was like send message. Now we're send and

[29:55] the opportunity to approve something. And notice how the response type is approval versus let's see what other options we have. Free text. We could like respond back with free text. It's still a wait for response situation or a

[30:08] Right now I'm going to add back in my chat ID from the Telegram setup. I'll use that same uh channel we're using. But then there's a few things we have to wire up here to make sure this works. First, Terry's going to have to know

[30:22] when to seek approval. How do we do that? We tell him. It's a prompt. I got one right here. Let's change it up. Notice it says right here, critical explicit approval before running any commands that could modify the system. I

[30:35] checks any logs. I don't care about that. Anything that will change the system, I care about. And we give a few examples here. Giving examples to AI is first. One of the main things we're changing is down here at the bottom, and

[30:49] had him telling us before, like, hey, is the website up true or false? And then send us a message about what you did. We're going to add a few more here to help us control the flow of things, like, hey, did you apply a fix? True or

[31:02] false? Or, hey, do you need approval for this command? True or false? What are tell him to tell us that. Now, notice I'm actually adding it to the prompt now might figure it out by himself, but I like to explicitly tell him what he's

[31:17] And then we'll take the same stuff here and add it to our output parser. So he's telling us, we're going to change that to all of this, making sure it's

[31:30] all proper JSON with no errors here. Now I'm going to test the output. So I'm actually going to delete the uh line going out here and just see if he anything, I'm actually going to break things again. run our Python web server.

[31:43] Run Terry. Let's see if he actually runs these commands first of all. He permission permission first. Come on, Terry. Don't be a dummy. Okay, cool. Website's down. Here's the message. Apply fix. False. Needs approval. True.

[31:56] Here's the commands he's requesting. He wants to kill that process and start up the website. That's perfect. But now we need that logic to play out and for us to approve it. So, I'm going to add another if, another if node here. I'll

[32:08] drag him over here. Connect them up. Jump it to the if and say if needs approval. I'll drag that over to the first value. Boolean is true. Then we're going to do off the true branch our approval message. So actually real

[32:22] quick, I'm going to jump into our agent and pen this data so we don't have to run him again. Let's go into our if and run that. It's going to pass it forward. Go down the true branch. Perfect. That worked. And then here for the approval,

[32:34] we're going to say website status or website up false message needs approval. And finally, commands requested. So now

[32:46] then we still have a problem here. When we respond to that message, it's going to go nowhere. So we have to actually send him back to the agent. We have to create the loop ourselves. So, I'm going to grab this and and put it all the way

[33:01] back over to Terry. And it's kind of messy and weird, but you can see what's It's going to be sent back to him. But one more problem we have to solve right here. The only thing being sent is an approve message. And here's why that's a

[33:15] problem. When it arrives at Terry with a simple approve, Terry's going to be about? Let me check my simple memory to see if that's a current chat I'm working on." He can't because he has no chat ID to reference. We need to not just send

[33:30] the approved message. We also need to send the chat ID we were working with. So he knows like, oh, you're talking about those commands. Okay, I'm on the simple set. So right here between

[33:42] to add a new node. The set or edit fields. Notice how it's sitting right in the telegram real quick. I'm going to execute it so we have some data. Cool. I got it. Look, there's the message. Needs approval. True. I'll click on approve.

[33:57] It's going to open up a web page. Cool. Got it. Thanks. If we go to N. Boom. It on the edit fields, we're going to drag over the approved field. And we'll

[34:09] to rename it to prompt because that's what Terry's looking for when he The user message will be JSON.prompt. So we're going to set that to prompt. And change from boolean to string. And then finally, we'll set one more thing back

[34:24] in our earlier edit fields where we were originally setting our chat ID. We're the chat ID. And that's it. So, what's happening here? Terry's going to go, "Oh, I have commands to run. I'm setting needs approval to true." That's going to

[34:37] to be sent to us. We're going to have the option to approve those commands. If approved message." That's going to go to our set fields node. This node is going to go, "Oh, okay. Let me prep this message for Terry because Terry needs

[34:49] approved and we're going to tell him the chat ID. That way, Terry has the context it out. Currently, our website is still down. Let's trigger Terry and we'll connect up our false path. So, when it doesn't need approval, it'll go to this

[35:03] if statement, which will only notify us when the website is down. Let's see if Terry can do this. Ready, set, go. Okay, he's asking for permission. He wants to do the kill and docker start. Let's prove it, buddy. Good job. I approve.

[35:16] Let's see what happens. Okay, he's running the stuff. Okay, there's the fast. Actually, let's see the message he outputed first. This is the final one. Website up. True. The Python process was terminated. I started the Docker

[35:29] container website fully operational. You apply a fix. True. Doesn't need approval. Commands are empty. And then it went through to the true path. Now, that's we're not being notified when he does fix something. So, let's change

[35:41] this up. We're actually going to remove this if and replace it with a switch. A switch is like an if, but we get more options than just two. So if you apply a fix, I want to know about it. So I'll say if that's true, it's going to create

[35:55] a path, which is zero. Send me a message. Also, if the website is down, me a message. And this is going out branch one. Let's duplicate this and all we care about. Let's run it one more time to see if it works. Me unpin my

[36:09] data here. Break our website again. Come on, Terry. You got this, buddy. Okay, he sends me a message wanting approval. Let's approve it. Okay, we got a message. Website up. True. Website is fully operational. That's perfect. Look

[36:21] what we just did here. Terry can now identify problems, troubleshoot a problem, and fix the problems, but only if we approve it. We get a message on our phone saying, "Oh, problems. Yeah, you can run those commands." Boom. He

[36:35] finishes the job and then tells us when it's done. Again, I know this is a simple example, but I wanted you to be able to follow along. And are you seeing the power of this? If you're like me, you're bursting with ideas. Like,

[36:47] imagine if we connected Terry to our actual home lab, to everything we have. actual home lab, to everything we have. Unifi, Plex, our NAS. What do you say we Unifi, Plex, our NAS. What do you say we do that right now? Yeah, let's do that.

[37:03] levels. Let's change that. Let's give him access to real tools in my home lab, think he's ready for it. I trust him kind of. Now, right now, he does have hosting your cloud and he can't access my HomeLab stuff. Right now, I'm going

[37:17] to use Twinate to change that real quick. I'll just run a simple Twingate headless client and run just a few commands on running. And by few, I mean two. And

[37:30] Let me see if I can ping my UniFi gateway here, my dream machine, which is my router. Yep, there it is. We got access. That's the first thing I want to control is my network. Let's give Terry access to that. Again, anything with the

[37:42] with Terry. For UniFi, we'll do the UniFi API. So, I'm going to add a new HTTP request tool. Create a new API key. not going to show you step by step unless you want to see that in another

[37:56] video because I can't show every service. Let's give Terry a new persona. set up a new schedule trigger, a new edit fields, connect all that up, and we'll have them do something like, I don't know, identify the top five

[38:09] don't know, identify the top five bandwidth hogs on the network right now. And then we'll give him a system prompt, too. Right here, telling him how to use the UniFi API, which by the way, I just grabbed this from the website. I had AI

[38:21] tell Terry to look at that system prompt. Cool. Now, let's see what he does using the unified tool. And then we have all this flow in here that doesn't quite match the network. We got a message.

[38:39] message. Let's see what it says. Oh, cool. Found the top users. And it's but think about what you could do with that. The troubleshooting you could do. What about Proxmox? Let's add that. Proxmox is fun because they have an API

[38:55] powerful. So I'll create a new SSH node for Proxmox CLI, convert that into a sub workflow, set up the sub workflow,

[39:18] all the more powerful. We'll add a new set of triggers and edit fields. We can duplicate. For the prompt, we'll just say how many VMs are currently running.

[39:32] Let's see if it works. Using the Proxmox tool, we got a message. Currently, three VMs running. Home Assistant, Keith, Docker, and my That's a whole other video coming out. But think about that. Anything you can

[39:47] do in the CLI, including creating virtual machines, deleting them, stopping them, restarting, whatever you got to do, you can have Terry do that. Walk through a flow and teach him. What about Plex? Let's do that.

[40:11] anything right now? And this will be using the uh Plex API.

[40:26] way. All right, let's test it out. All right, let's see what we got. One active stream. Chuck Keith is watching The Mummy, 1999. Yes, look at all that info it gives me. All right, let's go stop that. Great

[40:39] we don't have time right now. like my NAS. I've got one here in my studio running Seth on my 45 drive server. You guys have seen that. I've got a ZMA Cube Pro running at my house. This can all be accessed via CLI. Terry can control

[40:52] everything. Now, similar to the first video, I'm showing you all this just to not sure why I'm doing this. Like, I'm not providing a full IT blueprint. Here's Terry fully configured. No, no, no. I'm showing you what Terry can do,

[41:06] through and do this. Now, think about this. This is going to make you so much engineer how you would troubleshoot things. You're having to think about how business network is actually put

[41:20] together so you can describe it properly to an AI agent, Terry. So, not only will you come out with something amazing that will save you time hopefully and stress, You're going to know so much more. And also notice here like we're doing a

[41:33] chatting with Terry. You don't have to throw out everything you have right now. Uptime Kuma. You can have those things work with Terry. Like maybe when Uptime Kuma detects that something is down your website, normally it would just say it's

[41:47] down, fix it. But maybe he'll kick off a web hook that goes to Terry who can receive that and Terry can troubleshoot and fix it. So whatever monitoring tool you have, Terry can be connected to that to help you. And it's okay. You may not

[41:59] want Terry fixing things for you right away. Let him troubleshoot. Let them dig through logs. Just think about what you can do with this tool. This is crazy. getting a little too excited. So, here we are. Conclusion of this video. Look

[42:13] at what we stinking built. This is a lot from where we first started, especially Terry is now an IT wizard. He can monitor stuff. He can troubleshoot. He can even fix things. Please comment below and tell me if you built your own

[42:26] Terry. And also, we set up approvals. Like, that's a pretty amazing thing. Putting yourself, the human, in the loop. That's people's biggest fears know what it's doing, man. I can't control it. Like fine, put yourself in

[42:39] the middle. Put in guard rails. And please become crazier than what I've strict approval process, stricter guard rails. But beyond all that, if you're like me, your mind has got to be exploding with ideas. What can you do

[42:53] with this? Build something right now. Do something simple. Solve one problem. Let Terry help you troubleshoot one thing. Comment below what that is. And also than this. I want to know. But hold on a second. We have a problem here. Terry,

[43:06] him too much to do. I mean, look at all different personas. We have one guy managing our entire IT infrastructure when we really should have specialized people. So, there's actually three

[43:19] glaring problems I see. First, Terry needs help. We're going to hire Terry promotion CTO because he's going to be managing a network engineer, a storage engineer, a Linux admin. We're going to give him sub agents that he can manage.

[43:32] Two, notice that we don't really have our network documented. Well, any good home lab or IT infrastructure, it's going to have a lot going on. This I Terry has no idea yet, and it's still

[43:44] create documentation, have it centralized, and make it available to Terry and our future agents to be able to access easily. We want to maintain the state of our IT network. So, like, hey, here's how it looks, agents, our IT

[43:58] team. If you ever change anything, update it. Or, hey, be aware of what's change anything so you know it doesn't break anything. And then three, we need a help desk because sometimes Terry and team are not going to always catch

[44:12] something. Sometimes it's the user, my editors, my family. They are the ones who first identify an issue and they're usually calling me. I want them to talk to a help desk. We need a help desk or even like submit a ticket and our AI

[44:24] to accomplish all of that in the next video. I'll see you there. Hey, you're wanting to start with my videos, and that's I want to pray over you. Now, I

[44:36] know that sounds weird, and if you're immediately like, uh, no, that's fine. at the end of my videos, but if you do want to stick around, here's what I'm you. Pray for your career. Pray for this thing you're learning right now to help

[44:49] it. That's pretty much it. So, I'll go ahead and start. God, I thank you for whoever is watching right now. I thank you that uh they're part of my team, my audience, and that they are excited about it and their career. Lord, I ask

[45:05] that you bless their life, that as they watch this video, that that as they watch this video, that their mind would just erupt with ideas, that this would propel them forward to help them gain skills, skills they can

[45:18] put on their resume, and that will help them to either get a job or get a new job or just make themselves more valuable at their current job. Lord, give them fulfillment and joy in what they're doing. And whatever fear

[45:32] they have right now, the job market, any uh insecurities, any imposttor syndrome, Lord, I ask that that would just melt away from them right now. And Lord, while they may be getting a lot of fulfillment through it in their careers,

[45:48] I ask that they would come to know you, who you are, Jesus, and have a relationship with you. And if they're doubting or questioning or just are having a rough time, just be there with them, God.

[46:06] I pray favor over their families, which is probably their their why, their why for doing any of this. Let their families prosper and grow and be blessed through the the work they're doing in it and through the skills

[46:20] my videos, and whatever they're doing. Lord, It's in your name we pray. Amen. Anyways, I know that's probably kind of weird to be seeing this at the end of my video, but I'm a man of faith. It's who

[46:35] I am. If you're ever wondering why I am the way I am, it's because of Jesus. guys have a great day. I'll catch you next time. Let their families prosper and grow and be blessed through the the work they're

[46:50] they're learning through school, through my videos, and whatever they're doing. we thank you, Jesus, for everything. It's in your name we pray. Amen. Anyways, I know that's probably kind of weird to be seeing this at the end of my

[47:04] video, but I'm a man of faith. It's who I am. If you're ever wondering why I am the way I am, it's because of Jesus. Anyways, that's all I got. I hope you guys have a great day. I'll catch you next time.

More from NetworkChuck

View all

⚡ Saved you 0h 47m reading this? Transcribe any YouTube video for free — no signup needed.