n8n AI Features Not Working? Fix AI Agent, LangChain & LLM Node Errors
Troubleshoot n8n AI features — AI Agent node not calling tools, OpenAI credential errors, LangChain memory not persisting, and choosing the right node for your use case.
Common errors and fixes
Setting up AI credentials in n8n
n8n stores AI provider credentials separately for security. Each AI node must have a credential assigned or it will fail with a 401 error. Setup steps:
- 1 Create a new credential: n8n menu → Credentials → New credential → search "OpenAI API" and select it.
- 2 Enter your API key: Paste your key from platform.openai.com/api-keys into the API Key field.
- 3 Test the credential: Click "Test credential" — green means working, red means the key is wrong or the model is unavailable on your account.
- 4 Assign to the node: In your AI node, select the saved credential from the dropdown. Each node using AI needs its own credential assignment.
For Anthropic: credential type "Anthropic", API key from console.anthropic.com/settings/keys
For Ollama (local): credential type "Ollama", Base URL http://localhost:11434 — no API key needed
For Azure OpenAI: select "OpenAI (Azure)" credential type — requires Resource Name and Deployment Name, not a standard OpenAI key
AI Agent node not calling tools
The AI Agent node calls tools when the LLM decides it needs to. The wiring must be correct and the system prompt must guide the model. Expected connection layout:
[Your Tool Nodes] → [AI Agent: Tools input]
[AI Agent: Memory input] ← [Memory Node]
[User Message] → [AI Agent: Chat Input] System prompt template that improves tool calling:
"You are a helpful assistant. You have access to the following tools: - Calculator: for math calculations - Web Search: to look up current information Use tools when needed to answer the user's question accurately."
- Model quality matters: switch to
gpt-4oorclaude-3-5-sonnet— smaller models are less reliable at tool calling. - Agent Type setting: check the AI Agent node's "Agent Type" — it must be set to "Tools Agent" (not "Conversational Agent") for tool use to work.
- Output format restriction: "Require Specific Output Format" can prevent the model from issuing tool calls — disable it when debugging.
Memory not persisting between turns
n8n memory nodes must be explicitly connected to work. Two main options:
Window Buffer Memory (in-memory, resets on restart)
- Best for: short demo conversations and testing
- Connect to: AI Agent "Memory" input
- Set "Context Window Length" to the number of messages to keep
- Resets every time the workflow or n8n instance restarts
Redis Chat Memory (persistent)
- Requires a running Redis instance (URL + optional password)
- Session ID must match between turns — use
{{ $json.sessionId }}or a fixed string - Each unique sessionId is a separate conversation
For multi-user workflows, generate session IDs per user:
"session_key": "{{ $json.userId }}_{{ $json.conversationId }}" OpenAI node vs AI nodes — which to use?
n8n has several AI-related nodes with distinct purposes. Pick the right one to avoid confusion:
| Node | Use case | Tools | Memory |
|---|---|---|---|
| OpenAI | Direct API access, images, audio | No | No |
| Basic LLM Chain | Single-turn text generation | No | Optional |
| AI Agent | Multi-turn with tools | Yes | Yes |
| Information Extractor | Extract structured data | No | No |
| Sentiment Analysis | Classify text | No | No |
The OpenAI node supports: chat, images (DALL-E), audio (Whisper), embeddings, and assistants. Use it when you need specific OpenAI features not available in the AI nodes — like image generation or speech transcription.
Self-hosted n8n — AI features not available
AI nodes require n8n v1.19.0 or later. If the AI Agent, Basic LLM Chain, or other AI nodes are missing from the node panel, your version may be outdated.
- 1 Check your n8n version: n8n Cloud is always the latest version. Self-hosted: check the version shown in the n8n UI footer, or run n8n --version in the terminal.
- 2 Update via npm: Run npm install -g n8n@latest to update the global install, then restart n8n.
- 3 Update via Docker: Run docker pull n8nio/n8n:latest then docker compose up -d to pull the latest image and recreate the container.
- 4 Install community AI nodes: Additional integrations (Pinecone, custom LangChain nodes) can be added via Settings → Community Nodes — search and install without restarting.
Note: N8N_AI_ENABLED=true is NOT required — AI nodes are enabled by default in v1.19+. You do not need to set any environment variable to unlock them.
Know when n8n AI's upstream providers have an outage
Free email alerts. Star n8n AI on Prismix — no credit card needed.
FAQ
n8n AI Agent vs Make/Zapier AI features?
n8n gives you full control over the AI agent logic, memory, and tool connections via a visual graph. Make and Zapier have AI modules but less flexibility for complex agentic workflows. n8n is better for developers who want fine-grained control; Make/Zapier for simpler automations.
Can n8n AI agents use my own data (RAG)?
Yes. Connect a vector store (Pinecone, Qdrant, Supabase pgvector) as a tool, then the agent retrieves relevant context before answering. n8n has built-in Vector Store nodes for Pinecone, Supabase, and an in-memory store. The "Vector Store Retriever" node wraps any vector store as an agent tool.
n8n AI vs n8n regular workflow — when to use agents?
Use n8n AI Agent when the task is dynamic and requires decision-making (search the web, analyze results, decide next step). Use regular n8n workflows for deterministic processes with known steps (webhook → transform → send email). Agents add cost and non-determinism — only use them when the task genuinely requires reasoning.