n8n's AI Agent node connects a chat model, memory, and tool sub-nodes on a canvas, no code required. This guide builds a support agent that looks up orders through an HTTP Request Tool and only issues a refund after a human approves it in n8n's built-in Human review panel. You'll add a Chat Trigger, the Agent, an Anthropic Chat Model, Simple Memory, and two tools. Budget 30-45 minutes on n8n Cloud's Starter plan.
| Fact | Value |
|---|---|
| Tool | n8n |
| Difficulty | Beginner |
| Time required | 30-45 min |
| Compatibility | n8n Cloud or self-hosted n8n (Community Edition is free), Anthropic API key, any OS, browser only |
| Last updated | November 2026 |
What you'll build
You'll build the same support agent as the code-first version of this guide, just without writing any code. It looks up an order by ID through a live HTTP call, and when a refund is owed, it drafts one through a second tool that pauses the whole workflow and waits for a human to approve it before the request actually goes out to your payments API.
n8n's AI Agent node (internally called the Tools Agent; the older 'agent type' setting is deprecated as of n8n 1.82) sits in the middle of the canvas and takes three kinds of connections: a chat model (Anthropic, OpenAI, or others), an optional memory sub-node so it remembers earlier turns in the same session, and one or more tool sub-nodes it can call. Each tool gets a name and a description the agent reads to decide when to use it, and any parameter you mark with the $fromAI() expression gets filled in by the model at call time instead of by you at build time.
Choose n8n over Zapier or Make when you want tool-level control (exact HTTP requests, custom JSON bodies, self-hosting) without writing a Python or TypeScript process yourself. Choose it over Lindy or Copilot Studio when you want the workflow itself, not just the agent, to be fully inspectable and exportable as JSON. If you're comfortable writing Python, the Claude Agent SDK guide gives you tighter control over the same approval pattern.
Prerequisites
- An n8n Cloud account or a self-hosted n8n instance (Community Edition is free)
- An Anthropic API key to create the Anthropic credential
- A REST API for your orders and refunds (or a mock endpoint for testing)
- No coding experience required, just comfort clicking through a canvas UI
Step-by-step guide
Create the workflow and add a Chat Trigger
Open n8n and click Create Workflow. Click the + on the canvas, search for 'Chat Trigger', and add it. This node gives you a built-in chat panel to test the agent from inside n8n, and later a public chat URL if you toggle it on. Every incoming chat message runs the workflow once, and that counts as one execution against your plan's quota.
1System under test:2Chat Trigger -> (nothing yet)Expected result: A Chat Trigger node on the canvas with a chat icon you can click to open a live test panel.
Add the AI Agent node and write its system message
Click the + at the Chat Trigger's output and search for 'AI Agent'. Drop it on the canvas and connect it. Open the node, click 'Add Option' at the bottom, choose 'System Message', and paste the instructions below. This is the only place the agent's behavior is defined in prose; everything else (which tools exist, what they do) comes from the sub-nodes you'll attach next.
1You are a support agent for an e-commerce store. Always call look_up_order before making any claim about an order. Never tell a customer you refunded something without actually calling issue_refund.Expected result: An AI Agent node with a red warning badge, since it has no chat model or tools connected yet.
Connect an Anthropic Chat Model
Click the Chat Model connector dot under the Agent node, search for 'Anthropic Chat Model', and add it. Create a new credential with your Anthropic API key (get one from the Anthropic Console under Settings > API Keys), select it, then pick a current model from the dropdown. This sub-node does nothing on its own; it only exists to feed the Agent.
1Credential: Anthropic account (API key)2Model: claude-sonnet-5-5Expected result: The red warning badge on the Agent node disappears for the chat model requirement.
Add Simple Memory so the agent keeps order context
Click the Memory connector, search for 'Simple Memory' (the Window Buffer Memory node), and connect it. Set Context Window Length to around 10 so the agent remembers the last several messages, including the order it just looked up, without the memory persisting forever. Note that this memory lives only for the session; it resets if you start a new chat.
1Session Key: ={{ $json.sessionId }}2Context Window Length: 10Expected result: The agent now answers a follow-up like 'how much was that order again?' without you repeating the order ID.
Add the look_up_order tool
Click the Tool connector, search for 'HTTP Request' in the Tools panel, and add it. Rename it look_up_order and set a clear description, since that description is what the agent reads to decide when to call it. Point the URL at your orders endpoint and use $fromAI() in the URL so the agent fills in the order ID itself from the conversation instead of you hardcoding one.
1Name: look_up_order2Description for AI: Look up an order by ID. Returns status, total, and item.3Method: GET4URL: https://api.example-store.com/orders/{{ $fromAI("order_id", "The order ID, e.g. ORD-1042", "string") }}Expected result: Asking the chat 'what's the status of ORD-1042?' triggers a visible tool call and returns real order data.
Add issue_refund and gate it with Human review
Add a second HTTP Request Tool the same way, named issue_refund, pointing at your refunds endpoint with order_id, amount, and reason as body parameters, each filled with $fromAI(). Then, still in that tool's panel, open the Human review section and set an approval channel (Chat works for testing; Slack or email for production). Once set, every call to this tool pauses the workflow and waits for someone to approve or deny it before it runs.
1Name: issue_refund2Description for AI: Issue a refund for an order. Requires human approval.3Method: POST4Body: order_id, amount, reason (each via $fromAI())5Tools panel -> Human review: Chat (dev) / Slack (production)Expected result: Asking the chat to refund an order now pauses with an approval prompt instead of executing immediately.
Test end to end and harden before going live
Open the chat test panel and run the full flow: ask about an order, then ask for a refund, and approve or deny the prompt when it appears. Watch the execution log to confirm look_up_order ran without a pause and issue_refund did not. Before publishing, lower Max Iterations if you see loops, set the refunds endpoint's auth to a real credential instead of a placeholder, and point the approval channel at a real Slack channel or inbox, not the test chat.
1Agent options -> Max Iterations: 10 (default)2Test: look_up_order runs free; issue_refund pauses for approvalExpected result: A full conversation that looks up an order, proposes a refund, pauses for approval, and only completes the refund once approved.
Complete working example
1{2 "name": "Support Agent - Order Lookup + Refund Approval",3 "nodes": [4 {5 "parameters": { "public": true, "options": {} },6 "id": "chat-trigger-1",7 "name": "When chat message received",8 "type": "@n8n/n8n-nodes-langchain.chatTrigger",9 "typeVersion": 1.1,10 "position": [240, 300]11 },12 {13 "parameters": {14 "options": {15 "systemMessage": "You are a support agent for an e-commerce store. Always call look_up_order before making any claim about an order. Never tell a customer you refunded something without actually calling issue_refund.",16 "maxIterations": 1017 }18 },19 "id": "agent-1",20 "name": "Support Agent",21 "type": "@n8n/n8n-nodes-langchain.agent",22 "typeVersion": 1.9,23 "position": [520, 300]24 },25 {26 "parameters": {27 "model": { "value": "claude-sonnet-5-5" },28 "options": {}29 },30 "id": "lm-anthropic-1",31 "name": "Anthropic Chat Model",32 "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",33 "typeVersion": 1.3,34 "position": [440, 520],35 "credentials": { "anthropicApi": { "id": "1", "name": "Anthropic account" } }36 },37 {38 "parameters": {39 "sessionKey": "={{ $json.sessionId }}",40 "contextWindowLength": 1041 },42 "id": "memory-1",43 "name": "Simple Memory",44 "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",45 "typeVersion": 1.3,46 "position": [600, 520]47 },48 {49 "parameters": {50 "toolDescription": "Look up an order by ID. Returns its status, total, and item.",51 "url": "=https://api.example-store.com/orders/{{ $fromAI(\"order_id\", \"The order ID, e.g. ORD-1042\", \"string\") }}",52 "method": "GET",53 "authentication": "predefinedCredentialType"54 },55 "id": "tool-lookup-1",56 "name": "look_up_order",57 "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",58 "typeVersion": 1.1,59 "position": [760, 200]60 },61 {62 "parameters": {63 "toolDescription": "Issue a refund for an order. This call is gated by Human review - set that in this node's Tools panel before going live.",64 "url": "https://api.example-store.com/refunds",65 "method": "POST",66 "sendBody": true,67 "bodyParameters": {68 "parameters": [69 { "name": "order_id", "value": "={{ $fromAI(\"order_id\", \"The order ID\", \"string\") }}" },70 { "name": "amount", "value": "={{ $fromAI(\"amount\", \"Refund amount in dollars\", \"number\") }}" },71 { "name": "reason", "value": "={{ $fromAI(\"reason\", \"Why the refund is being issued\", \"string\") }}" }72 ]73 },74 "authentication": "predefinedCredentialType"75 },76 "id": "tool-refund-1",77 "name": "issue_refund",78 "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",79 "typeVersion": 1.1,80 "position": [760, 420]81 }82 ],83 "connections": {84 "When chat message received": { "main": [[{ "node": "Support Agent", "type": "main", "index": 0 }]] },85 "Anthropic Chat Model": { "ai_languageModel": [[{ "node": "Support Agent", "type": "ai_languageModel", "index": 0 }]] },86 "Simple Memory": { "ai_memory": [[{ "node": "Support Agent", "type": "ai_memory", "index": 0 }]] },87 "look_up_order": { "ai_tool": [[{ "node": "Support Agent", "type": "ai_tool", "index": 0 }]] },88 "issue_refund": { "ai_tool": [[{ "node": "Support Agent", "type": "ai_tool", "index": 0 }]] }89 },90 "pinData": {},91 "meta": { "instanceId": "replace-with-your-instance-id" }92}93Common mistakes
Why it's a problem: Forgetting to connect a tool sub-node at all
How to avoid: The Tools Agent requires at least one tool connection to run. If the Agent node shows a red badge, check the Tool connector first.
Why it's a problem: Setting Human review on look_up_order as well as issue_refund
How to avoid: Gating a read-only lookup behind approval just adds friction with no safety benefit. Reserve Human review for tools that write or spend money.
Why it's a problem: Hardcoding the order ID or refund amount in the tool's URL or body instead of using $fromAI()
How to avoid: A hardcoded value means the agent can only ever act on one order. Use $fromAI(key, description, type) for every parameter the model should decide.
Why it's a problem: Testing only in the built-in chat panel and assuming memory works the same once published
How to avoid: Simple Memory is scoped to a session key per conversation; published chats and API calls need a consistent sessionId passed in, or each message starts fresh.
Why it's a problem: Leaving 'Make Publicly Available' on with no Human review gate on write tools
How to avoid: A publicly reachable chat with an ungated refund tool is an open invitation. Gate first, publish second.
Best practices
- Write the tool's 'Description for AI' as if explaining it to a new hire: when to use it, when not to, what it returns.
- Gate every tool that writes data, sends money, or sends a message behind Human review; leave read-only tools ungated.
- Keep the system message explicit about sequencing: look up before claiming, never narrate an action the tool didn't actually take.
- Set a realistic Max Iterations (10 is a sane default) so a confused agent fails fast instead of looping through retries.
- Pass a stable sessionId into Simple Memory from whatever channel triggers the workflow, not just the test chat's default.
- Export the workflow JSON and commit it to version control once it's stable, the same way you would a script.
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I have an n8n AI Agent workflow with an Anthropic Chat Model, Simple Memory, and two HTTP Request Tools (look_up_order, issue_refund gated by Human review). Here's the exported JSON. Add a third tool, check_return_window, and make the system message require it to pass before issue_refund can run. [paste workflow JSON]
In n8n, open the AI Agent node, click the n8n AI assistant icon, and ask: 'Add a cancel_order HTTP Request Tool with the same body-parameter and $fromAI pattern as issue_refund, and gate it with Human review too.'
Frequently asked questions
Do I need to know how to code to build an ai agent with n8n?
No. Every step in this guide happens through the canvas: dragging nodes, filling in fields, and writing plain-language tool descriptions. The only text that resembles code is the $fromAI() expression, which you paste as-is and just change the key name.
What's the difference between the AI Agent node and the older Conversational Agent?
As of n8n 1.82, the Agent node's 'agent type' setting is deprecated and every AI Agent node runs as a Tools Agent, the pattern this guide uses. Older workflows built on the Conversational Agent type still run but should be migrated when you touch them.
How does n8n's Human review differ from building my own approval step with a Wait node?
Human review is a toggle inside a tool's own configuration panel, so n8n pauses that specific tool call and resumes the same workflow execution once someone approves or denies it, no separate Wait node, webhook, or sub-workflow required.
Which chat models can I connect to the AI Agent node?
The Tools Agent currently supports OpenAI, Anthropic, Groq, Mistral, and Microsoft Foundry chat model sub-nodes. This guide uses Anthropic Chat Model with a current Claude Sonnet model for the best balance of tool-calling reliability and cost.
What does this cost to run on n8n Cloud?
n8n bills per workflow execution, not per step. On the Starter plan ($20/mo, 2,500 executions), each chat message is one execution, so a support agent handling a few thousand conversations a month fits comfortably. Add the Anthropic API cost per message on top, typically a cent or two per turn on Sonnet.
Can someone set this up for me instead of building it myself?
Yes. RapidDev builds and hardens n8n agents (and the Claude Agent SDK equivalent) including the approval routing and error handling most tutorials skip. A free 30-minute consultation is the fastest way to scope your version.
Talk to an Expert
Our team has built 1,000+ apps. Get personalized help with your project.
Book a free consultation