n8n-agents
Skill này làm gì
Skill này hướng dẫn agent AI xây dựng bước AI Agent và bước mô hình ngôn ngữ trong n8n, một công cụ tự động hóa quy trình. Skill dành cho người tạo trợ lý AI bên trong quy trình n8n.
Khi nào nên dùng
- ✓Khi bạn đang tạo một agent AI trong n8n cần dùng công cụ hoặc nhớ các tin nhắn trước đó.
- ✓Khi một bước AI đơn giản, chẳng hạn phân loại văn bản, sẽ phù hợp hơn một agent đầy đủ.
- ✓Khi bạn cần một trợ lý chat trong n8n trả lời dựa trên tài liệu đã lưu.
Liên kết skill
https://github.com/czlonkowski/n8n-mcp/blob/main/data/skills/n8n-agents/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo một agent AI trong n8n để trả lời câu hỏi của khách hàng dựa trên tài liệu trợ giúp của chúng tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill giúp bạn chọn đúng node AI của n8n trước, rồi thiết lập mô hình, công cụ, bộ nhớ và định dạng đầu ra để agent hoạt động có thể đoán trước.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
n8n Agents
The n8n AI Agent node (@n8n/n8n-nodes-langchain.agent) is a multi-turn LLM driver with sub-nodes for the model, memory, tools, and an optional output parser. This skill is the deep guide to designing agents and the LangChain family around them. For the high-level "where an agent fits in a workflow" picture, see n8n-workflow-patterns ai_agent_workflow.md — this skill goes one level down into how to build it well.
For node-type formats: in workflow JSON the LangChain nodes use the long @n8n/n8n-nodes-langchain.* form (.agent, .lmChatOpenAi, .memoryBufferWindow, .outputParserStructured, .toolWorkflow, .toolHttpRequest, .toolCode). When you call get_node / validate_node, use the short form (nodes-langchain.agent). See n8n-mcp-tools-expert for the format rules.
Pick the right node first
Reaching for an Agent when the task is one-shot classification or extraction is the most common over-build. Decide before you wire anything:
| You need to… | Use | Why |
|---|---|---|
| Call tools, reason over multiple turns, or hold memory | AI Agent (.agent) |
The full loop: model + tools + memory + optional parser. Also a fine default when you'd rather standardize. |
| One-shot text in → text out, no tools | Basic LLM Chain (.chainLlm) |
No agent loop, easier to debug. Still accepts an outputParserStructured sub-node. |
| Route a natural-language input to one of N branches | Text Classifier (.textClassifier) |
ONE node, N output handles, downstream wires directly into each. Not Agent + Switch. |
| Pull structured fields out of free text | Information Extractor (.informationExtractor) |
Purpose-built field extraction with a schema. |
| 3-way positive/neutral/negative split | Sentiment Analysis (.sentimentAnalysis) |
Built-in branch outputs. |
| Condense a long document | Summarization Chain (.chainSummarization) |
Map-reduce summarization built in. |
| Generate an image / audio / video | The provider's native single-call node (OpenAI, Gemini, ElevenLabs…) | NEVER wrap media generation in an Agent — see "Binary and the agent boundary". |
Text Classifier detail (the Agent + Switch anti-pattern): every category needs both a name AND a description. The model routes against the description, not the name — a category with no description gets picked by coin-flip. Set options.enableAutoFixing: true for robustness on edge inputs. One node, N branches, done. Reaching for an Agent that "decides" then a Switch that "routes" is two nodes plus prompt boilerplate for what Text Classifier does natively.
Chat-model nodes (.lmChatOpenAi, .lmChatAnthropic, .lmChatOpenRouter, …) are sub-nodes — they don't run standalone. They wire into a chain, agent, classifier, or extractor via the ai_languageModel connection.
The sub-node pattern
The Agent has a main input (the prompt / user message) and up to four sub-node slots, each wired by its own ai_* connection type:
| Slot | Connection type | Required? | Node example |
|---|---|---|---|
| model | ai_languageModel |
Yes | .lmChatOpenAi, .lmChatAnthropic, .lmChatOpenRouter |
| memory | ai_memory |
Optional | .memoryBufferWindow, .memoryPostgresChat |
| tools | ai_tool |
Optional (but the point of an agent) | slackTool, .toolWorkflow, .toolHttpRequest, .toolCode |
| outputParser | ai_outputParser |
Optional | .outputParserStructured |
A sub-node connects FROM itself TO the agent. In workflow JSON the connection lives on the sub-node, keyed by the ai_* type:
"Main LLM": {
"ai_languageModel": [[{ "node": "AI Agent", "type": "ai_languageModel", "index": 0 }]]
},
"Simple Memory": {
"ai_memory": [[{ "node": "AI Agent", "type": "ai_memory", "index": 0 }]]
},
"Search customer DB": {
"ai_tool": [[{ "node": "AI Agent", "type": "ai_tool", "index": 0 }]]
}
Multiple tools all connect into the same ai_tool index 0 — they stack, they don't fan into separate indices. With n8n_update_partial_workflow you wire each with an addConnection op using sourceOutput: "ai_tool". The agent puts its final answer in $json.output (not .text, not .response) — downstream nodes read {{ $json.output }}.
See EXAMPLES.md for a complete stateless agent-core node-object snippet.
Two non-negotiables
- Tool names and descriptions ARE part of the prompt. The model picks a tool by reading
Câu hỏi thường gặp
Khi nào tôi không nên dùng AI Agent trong n8n?
Với các tác vụ một lần như phân loại hoặc trích xuất đơn giản, skill gợi ý một node nhẹ hơn, vì agent đầy đủ thường là thừa.
Nó có nói về bộ nhớ không?
Có. Nó bao gồm bộ nhớ agent và session ID.
Nó có giúp về đầu ra có cấu trúc không?
Có. Nó bao gồm output parser và đầu ra có cấu trúc hoặc JSON.
Chi tiết
Mô tả gốc của tác giả
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topol
repo: czlonkowski/n8n-mcp
Độ phổ biến
- Sao GitHub
- 23k
- Vị trí xếp hạng
- #10125
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
n8n-binary-and-data
23kDạy agent của bạn xử lý các tệp như PDF và hình ảnh trong quy trình n8n mà không làm mất chúng giữa chừng.
n8n-code-tool
23kDạy agent của bạn viết JavaScript hoặc Python cho Custom Code Tool của n8n, để agent AI có thể gọi nó như một công cụ.
n8n-error-handling
23kDạy agent của bạn thiết lập quy trình n8n sao cho lỗi rõ ràng, có cấu trúc và có thể khôi phục, thay vì âm thầm bỏ qua.
n8n-multi-instance
23kGiúp agent của bạn làm việc an toàn trên nhiều instance n8n, như production và staging, mà không thay đổi nhầm instance.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.