For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to using n8n Automation guide

Build automated workflows that use your self-hosted vLLM endpoint. Examples: document summarization, chatbots, scheduled AI tasks, webhook-triggered processing. Prerequisite: A running vLLM endpoint (see the vLLM Docker Deployment Guide).

1. What is n8n?

n8n is a workflow automation tool (like Zapier/Make, but self-hosted). It connects apps, APIs, and AI models into automated pipelines via a visual editor.

Common LLM use cases:

  • Summarize incoming emails/documents automatically

  • Build a chatbot triggered by webhook

  • Scheduled content generation

  • Extract structured data from text

  • Multi-step AI pipelines (classify → route → respond)

2. Deployment

Standalone docker-compose.yml

services:
  n8n:
    image: n8nio/n8n:latest
    container_name: n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=0.0.0.0
      - N8N_PORT=5678
      - N8N_PROTOCOL=http
      - NODE_ENV=production
      - GENERIC_TIMEZONE=Asia/Bangkok
      # Basic auth (recommended)
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=change-me-strong-password
    volumes:
      - ./n8n-data:/home/node/.n8n

volumes:
  n8n-data:

Add to Existing vLLM Stack

If you want n8n in the same compose file as vLLM (so they share a Docker network), add the n8n service block above into your existing docker-compose.yml. This lets n8n reach vLLM via the service name http://vllm:8000.

Launch

Access: http://<your-server-ip>:5678

On first launch, create your owner account.

3. Connecting n8n to vLLM

n8n has a built-in OpenAI node that works with any OpenAI-compatible API — including vLLM.

Create OpenAI Credentials in n8n

  1. In n8n: Credentials → New → OpenAI API

  2. Set:

    • API Key: your vLLM --api-key value (e.g. sk-llm-key)

    • Base URL: your vLLM endpoint

      • Same compose stack: http://vllm:8000/v1

      • Separate host: http://<server-ip>:8000/v1

  3. Save

Network Note

n8n location
Base URL

Same compose file as vLLM

http://vllm:8000/v1

Different host/server

http://<vllm-server-ip>:8000/v1

Behind reverse proxy

https://api.yourdomain.com/v1

4. Example Workflows

Example A: Webhook Chatbot

Receives a message via webhook, sends to vLLM, returns the answer.

Nodes: WebhookOpenAIRespond to Webhook

  1. Webhook node

    • Method: POST

    • Path: /chat

  2. OpenAI node

    • Resource: Chat

    • Model: Qwen/Qwen2.5-7B-Instruct-AWQ

    • Messages: ={{ $json.body.message }}

  3. Respond to Webhook node

    • Body: ={{ $json.choices[0].message.content }}

Test:

Example B: Scheduled Document Summarizer

Runs daily, fetches documents, summarizes with the LLM.

Nodes: Schedule TriggerHTTP Request (fetch docs)OpenAI (summarize)Send Email / Save

  1. Schedule Trigger — daily at 09:00

  2. HTTP Request — fetch your data source

  3. OpenAI node

    • System prompt: "Summarize the following in 3 bullet points"

    • User: ={{ $json.content }}

  4. Output — email, Slack, database, etc.

Example C: Text Classification & Routing

Classify incoming text, then route to different actions.

Nodes: WebhookOpenAI (classify)Switch → (multiple branches)

  1. OpenAI node

    • Prompt: "Classify this message as: support / sales / spam. Reply with one word only."

  2. Switch node — route based on classification

  3. Branch actions per category

Tips for LLM Nodes

  • Set temperature low (0.1-0.3) for consistent/structured output

  • Use system prompts to control format

  • For JSON output, instruct the model explicitly and parse with a Code node

  • Set reasonable max tokens to control response length

5. Troubleshooting

n8n can't reach vLLM

  • Same compose file → use http://vllm:8000/v1 (service name, not localhost)

  • Different host → use the server IP and ensure port 8000 is reachable

  • Test from n8n container:

"Unauthorized" / 401

  • API key in n8n credentials must match vLLM --api-key

  • If vLLM has no --api-key, you can put any placeholder in n8n

Model not found

  • Use the exact model name from curl http://<vllm>:8000/v1/models

  • Must match the --model value in your vLLM config

Workflow times out on long generations

  • Increase n8n node timeout in workflow settings

  • Reduce max tokens, or use a smaller/faster model

Data not persisting after restart

  • Ensure the ./n8n-data:/home/node/.n8n volume is mounted

  • Without it, workflows are lost on container recreation

Was this helpful?