Architecture
n8n's AI capabilities are built on LangChain integration, exposed through ~70 AI specific nodes. The architecture follows a modular pattern: you compose agents by connecting a root AI Agent node with sub nodes for the LLM, memory, and tools.
Building an AI Agent Workflow
- Choose a trigger: Chat trigger (conversational), webhook (API calls), schedule (periodic), or manual (testing)
- Add an AI Agent node: The root node that orchestrates the agent's behavior
- Configure the LLM: Attach a language model sub node. Supported providers: OpenAI, Anthropic Claude, Google Gemini, AWS Bedrock, Azure OpenAI, Mistral, Ollama (local models), and more
- Add memory: Attach memory sub nodes for conversation persistence (window memory, buffer memory, summary memory, or external via Zep)
- Add tools: Attach tool sub nodes that the agent can call during execution
- Connect to data: Vector store nodes for RAG (Pinecone, Qdrant, Supabase, Zep), or any n8n integration as a data source
- Output: Send results via chat response, webhook, email, Slack, or any connected service
The Workflow Tool: n8n's Unique Advantage
The most powerful AI feature in n8n is the Workflow Tool. Any n8n workflow can be used as a custom tool for an AI agent. This means your agent can trigger complex multi step automations (send emails, update databases, call APIs, process files) as part of its reasoning. No other visual automation platform offers this level of integration between AI agents and workflow automation.
RAG (Retrieval Augmented Generation)
n8n supports full RAG pipelines visually: ingest documents using document loaders and text splitters, create embeddings (OpenAI, Cohere, HuggingFace), store in vector databases (Pinecone, Qdrant, Supabase), and retrieve relevant context when answering questions. The entire pipeline can be built and tested visually with step by step debugging.
Local LLM Support
For teams requiring full data privacy, n8n supports running local models via Ollama. Combined with self hosting, this enables a fully air gapped AI automation setup where no data leaves your infrastructure.