Skip to main content

n8n on a VDS: No-Code Automation with AI Agents

AI Agents on VPS · 19.04.2026 · 4 min read
Illustration for “n8n on a VDS: No-Code Automation with AI Agents”

What is n8n?

n8n is a self-hosted automation platform with support for AI agents, vector databases, and LangChain chains right in the visual editor.

Installing via Docker Compose

version: "3"
services:
  n8n:
    image: n8nio/n8n
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=securepassword
      - WEBHOOK_URL=https://n8n.yourdomain.com
    volumes:
      - n8n_data:/home/node/.n8n
    restart: always
volumes:
  n8n_data:

Creating an AI agent in n8n

  1. Create a new Workflow
  2. Add an AI Agent node
  3. Select Chat Model → Ollama
  4. Enter the URL: http://host.docker.internal:11434
  5. Add tools: Wikipedia, Calculator, HTTP Request
  6. Connect a trigger (Webhook, Schedule, Chat)
host.docker.internal lets a Docker container reach services on the host machine where Ollama is running.

AI workflow examples

  • Telegram chatbot with memory and search
  • Automatic processing of incoming email with AI replies
  • Website monitoring and AI analysis of changes
  • Generating reports from databases

Common setup errors

ECONNREFUSED when calling Ollama

The AI Agent node fails with a connection error:

ECONNREFUSED 127.0.0.1:11434

This happens when the URL field is set to localhost while n8n runs in a Docker container: inside a container, localhost points to the container itself, not to the host machine where Ollama listens. The fix is the address http://host.docker.internal:11434, or running both services on the same Docker network and calling by container name.

The production webhook returns 404 even though the test works

In the editor the test webhook fires fine, but the same address in production returns an error:

404 - The requested webhook is not registered

The production webhook path is only registered for an active workflow. After any change to the nodes you need to toggle Active again, and the WEBHOOK_URL environment value must match the real public address behind the reverse proxy, including the https protocol.

The AI Agent hangs in the "Running" state for a long time

On a VDS without a GPU a large local model responds slowly, and execution is cut off by the node's internal timeout:

Problem in node 'AI Agent'
Workflow did not finish, possible timeout

The timeout is set in the node's own parameters (Options → Timeout) and defaults to values tuned for cloud APIs, not CPU inference. Increase the timeout or switch to a lighter quantized model.

«Unrecognized node type: n8n-nodes-langchain.agent»

Unrecognized node type: n8n-nodes-langchain.agent

AI nodes were added to n8n relatively recently and are not present in every image tag. Update the Docker image to a current version and recreate the container — workflow data survives as long as the n8n_data volume is mounted separately from the container itself.

n8n, Flowise, and hand-written LangChain code: which to choose

All three options solve the same problem — wiring an LLM to tools and triggers — but they trade setup effort for flexibility differently.

Criterionn8nFlowiseCustom LangChain code
Learning curveLowLowHigh
Business logic flexibilityMediumLowHigh
Git diff and code reviewHard to readHard to readFull support
Ready-made external integrationsHundreds of nodesDozens of nodesWritten by hand

When n8n is not a good fit

The no-code layer saves time at the start, but it has a complexity ceiling beyond which the visual editor starts getting in the way instead of helping.

  • Branching logic with dozens of conditions — the node graph turns into an unreadable canvas
  • You need git diffs and code review of business logic — a workflow's JSON export reads poorly line by line
  • The task needs high concurrency and minimal latency — the Node.js worker becomes a bottleneck
  • The team already writes Python or TypeScript, and the no-code layer only adds an extra abstraction layer
  • You need unit tests for individual logic steps — the visual editor has no built-in tooling for that

Verifying the result

Before handing a workflow off to production, walk it through from a manual run to a real external call.

  1. Open the workflow and click Execute Workflow — check the output of each node in turn
  2. Check the Executions tab for errors and the runtime of each node
  3. Send a test request to the production webhook address and compare the response
  4. Run 3–5 questions typical of your domain and judge the agent's answer quality
  5. Make sure the workflow is marked Active — otherwise the production webhook will not accept requests
curl -X POST https://n8n.yourdomain.com/webhook/test-agent \
  -H "Content-Type: application/json" \
  -d '{"message":"test question"}'

Related: a visual no-code builder — Flowise on a VDS, a local model for the agent — installing Ollama, answers over your own documents — RAG on a VDS.

Was this article helpful?
← Back to Knowledge Base Ask Support