the shed // n8n tutorial

n8n lets an AI agent do the boring first pass on alerts, reviews, and tickets, while you keep the approve button. Here are seven workflows worth building this week.

See the workflow in action, tap through the tabs below:

Featured illustration: n8n AI Agents, 7 DevOps workflows with a human approval gate+THA-SHED.COMn8n AI Agents7 DevOps workflows with a human gateTriage, review, approve, recover. Nobody babysits.trigger > agent > reviewtool: restart_demo_svcstatus: waiting for approval(Illustration with example data)
n8n-agent-playbook.sh

$ run n8n locally

docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n

# then open http://localhost:5678
# add: Chat Trigger -> AI Agent
# attach: Chat Model + Simple Memory + one tool

AI Agent node > System Message

You are an on-call triage assistant for a small DevOps team.
For every alert you receive:
1. Classify severity: low, medium, or high.
2. Give the most likely cause in two sentences.
3. Suggest up to three read-only checks.
Never claim a fix is done. If a tool needs approval,
say so and wait for the reviewer decision.

AI Agent node > Tools panel > human review

1. Click the Tools connector on the AI Agent node
2. Pick a review channel (Chat, Slack, Teams, Gmail...)
3. Add credentials for that channel
4. Connect your write tools (restart, ticket, deploy)
   to the review step

Message template idea:
Approve tool call? Name and inputs shown to reviewer.

Gotchas: treat logs, emails, and alert text as untrusted input (prompt injection is real). Start with read-only tools. Put tool and approval rules in the system prompt. Set an error workflow so silent failures reach you. Check the official human-in-the-loop docs before shipping.

What n8n AI Agents Actually Are

n8n is a workflow automation platform you can self-host or run in the cloud. Its AI Agent node is the interesting part. In n8n's own words, an agent is a chain that knows how to make decisions: instead of following a fixed sequence, a language model picks which actions to take, uses memory for context, and calls tools to touch other systems. That makes it a great fit for DevOps and security chores that are 80 percent reading and 20 percent acting.

Diagram: trigger feeds an AI agent, risky tools pass a human review step, then the action runs+THA-SHED.COMThe pattern behind every workflowTriggerChat / Webhook / GmailAI AgentModel + memory + toolsHuman reviewApprove or denyActionTool runsread-only tools run freelywrite tools wait hereError workflow catches failed runs and pings you(Illustration with example data)

Quick Setup in Ten Minutes

Run the official Docker image from the widget above, open port 5678, and create your owner account. Then build the smallest useful agent: a Chat Trigger wired into an AI Agent node, a chat model with your own API credentials, Simple Memory, and exactly one tool. Send it a test message from the built-in chat panel. If that works, you have the skeleton for everything below.

The Mindset: Hire a Junior, Not a Root User

Treat the agent like a sharp junior engineer on their first on-call week. It reads fast and writes decent summaries, but it does not get production write access on day one. Give it narrow tools, start read-only, and put a human between the agent and anything that changes state. n8n's docs frame the same trade-off for MCP: a built-in tool gives you tighter control, while an MCP server gives the agent more room at the cost of control and more context per call. Pick control first, flexibility later. If this sounds familiar, it is the same discipline we covered in Automated Tool Access.

7 n8n Agent Workflows Worth Building

1. Alert triage in Slack

Point your monitoring webhook at a Webhook trigger, pass the payload to the agent, and post a severity plus likely cause to a channel. Prompt:

Classify this alert as low, medium, or high. Give the likely cause in two sentences and list three read-only checks. Alert: {{ $json.body }}

2. Log explainer chat

Use the Chat Trigger as an internal "paste an error here" page. The agent returns the probable cause and the next three commands to run. Keep tools off. Pure reasoning over pasted text is safe and surprisingly useful.

3. Infrastructure PR notes

Trigger on a GitHub pull request webhook, fetch the diff, and ask the agent to flag risky changes such as wide-open network rules or removed encryption settings. It writes a short review comment. A human still merges.

4. Approval-gated restarts

Give the agent a restart tool, then attach it to a human review step in the Tools panel. The reviewer sees the tool name and the inputs the AI chose, then approves or denies. The agent is told the decision either way. Supported channels in the docs include Chat, Slack, Discord, Telegram, Microsoft Teams, Gmail, WhatsApp Business Cloud, Google Chat, and Microsoft Outlook.

Mockup of a Slack style approval request for an AI agent tool call using example data+THA-SHED.COMApproval request (mockup)#ops-demo | agent-botAgent wants to run a toolTool: restart_serviceParameters: service = web-demo-01, reason = health check failingApproveDeny(Illustration with example data)

5. Phishing report triage

Watch a shared mailbox with a Gmail trigger. The agent extracts links, sender domains, and urgency cues, scores the message, and opens a ticket with the indicators pre-filled. Treat the email body as hostile text. It is data, not instructions.

6. Human fallback

n8n documents a pattern where the agent tries to answer, and when it lacks confidence it notifies a Slack channel for human help. Build this into any support-style agent so "I do not know" has a route instead of a hallucination.

7. An error workflow for your agents

Create one workflow that starts with an Error Trigger node, then assign it in Workflow Settings for every agent workflow. It receives the error message, the failed node, and the execution details, so you can page yourself when an agent breaks quietly. One caveat from the docs: if the trigger node itself fails, execution IDs and URLs are not available.

Mockup of an n8n style executions list with example workflow names and statuses+THA-SHED.COMExecutions view (mockup)IDWORKFLOWSTATUSTIME#1042alert-triageSuccess4.1s#1043pr-review-notesSuccess9.8s#1044restart-gateWaiting...#1045phish-triageError2.2s(Illustration with example data)

Safety and Gotchas

First, prompt injection. Anything an agent reads, whether alert text, logs, or email bodies, can contain instructions aimed at your agent. Keep write tools behind a review step and never let untrusted text decide which credentials get used. Second, n8n's docs say to include the tool setup and human review steps in your system prompt, so the model understands approvals and reacts sensibly to a denial. Third, scope credentials tightly: a read-only API token for triage, a separate narrow one for the gated write tool. Fourth, remember that execution history stores the data that flowed through, so mask secrets and sensitive fields before they reach the agent.

Cost and Usage Tips

Your biggest bill is model tokens, not n8n itself. Use a small, cheap model for classification and save the stronger one for reasoning-heavy steps. Trim what you send: pass the relevant log lines, not the whole file. Keep memory windows short, since every remembered turn is re-sent. For hosting and plan details, check the current n8n pricing page rather than trusting a blog post, including this one.

FAQ

Is the n8n AI Agent node good for DevOps work?

Yes, for triage, summarizing, and drafting. It is best when the agent reads and recommends, and a human approves anything that changes state.

How do I stop an n8n agent from running dangerous actions?

Use human-in-the-loop on the tool. The workflow pauses, the reviewer sees the tool name and parameters, and only an approval lets the tool run.

Can n8n agents connect to MCP servers?

Yes. You can attach servers from the agent's tools panel or use the MCP Client Tool node with a connection URL. Expose only the tools you need.

Build This With Us

Want a guided path from "cool demo" to "safe in production"? Browse the hands-on tracks on our courses page, and see how another visual builder handles agents in our Flowise AgentFlow V2 guide. Build one workflow this week, put a human gate on it, and iterate from there.

Tha-Shed

Type a brief, get a finished film. Characters, voices and music included.

Start creating