RTX 3050 - Order Now
Home / Blog / Tutorials / Connect n8n to Self-Hosted AI on GPU Server
Tutorials

Connect n8n to Self-Hosted AI on GPU Server

Connect your self-hosted n8n workflow engine to a GPU-hosted LLM for fully private AI automations. This tutorial covers the HTTP Request node setup, credential management, and building production workflows that call your own inference endpoint.

What You’ll Connect

After this guide, your n8n instance will route AI requests to a model running on your own GPU server — no API costs, no rate limits. Since n8n itself is self-hosted, pairing it with a self-hosted LLM on dedicated GPU hardware gives you a completely private automation stack where no data leaves your infrastructure.

The integration uses n8n’s HTTP Request node to call your vLLM or Ollama endpoint. You can also use n8n’s built-in OpenAI-compatible node by pointing it at your custom base URL. Either approach lets you embed AI into any workflow — from document processing to customer support triage.

HTTP Request Node –> GPU Server (vLLM) –> LLM Inference (webhook, cron, POST /v1/chat/ Nginx reverse dedicated GPU email, app) completions proxy + TLS | | Downstream <-- Set/Function Node <-- JSON response <-- Completion returned nodes parse output from GPU server -->

Prerequisites

  • A GigaGPU server with a running LLM exposed via OpenAI-compatible API (vLLM production guide)
  • A self-hosted n8n instance (Docker or npm install) — or n8n Cloud
  • Network connectivity between n8n and your GPU server over HTTPS (proxy setup)
  • An API key configured for your inference endpoint (security guide)

Integration Steps

In n8n, create a new credential of type Header Auth. Set the header name to Authorization and the value to Bearer YOUR_GPU_API_KEY. This credential will be reused across every workflow that calls your AI endpoint.

Create a new workflow and add your trigger node. After the trigger, add an HTTP Request node. Set the method to POST and the URL to https://your-gpu-server.gigagpu.com/v1/chat/completions. Attach your Header Auth credential. Set the body content type to JSON and configure the payload with your model name, messages array, and generation parameters.

Use n8n’s expression syntax ({{ $json.fieldName }}) to inject dynamic data from upstream nodes into the prompt. After the HTTP Request node, add a Set node to extract choices[0].message.content from the response, making the AI output available as a clean field for downstream nodes.

Code Example

Configure the HTTP Request node body using n8n’s JSON editor. This payload calls your FastAPI inference server with data mapped from a trigger:

// n8n HTTP Request Node - Body (JSON)
{
  "model": "meta-llama/Llama-3-70b-chat-hf",
  "messages": [
    {
      "role": "system",
      "content": "You are a workflow automation assistant. Output structured JSON when asked."
    },
    {
      "role": "user",
      "content": "Extract key entities from this text: {{ $json.input_text }}"
    }
  ],
  "max_tokens": 600,
  "temperature": 0.1
}

// Set Node - Extract completion:
// Field: ai_response
// Value: {{ $json.choices[0].message.content }}

Testing Your Integration

Execute the workflow manually using n8n’s “Test workflow” button. Click into each node’s output to trace data flow. The HTTP Request node should show a 200 response with the full completions JSON, and the Set node should contain just the extracted text.

Test with edge cases: empty inputs, very long text, and special characters. Confirm n8n’s timeout settings accommodate your model’s inference time — adjust the HTTP Request node’s timeout under Settings if needed (default is 300 seconds, which is generous).

Production Tips

n8n supports both parallel and sequential execution. For workflows processing batches of items — like classifying 100 support tickets — use the Split In Batches node to send requests in groups rather than flooding your GPU with simultaneous inference calls.

Since both n8n and your LLM are self-hosted, the entire pipeline can run within a private network. Place n8n and your GPU inference server on the same VLAN or VPC to eliminate public internet exposure entirely. Use n8n’s error workflow feature to catch and alert on failed AI calls.

Alternatively, use n8n’s OpenAI Chat node with a custom base URL pointed at your GPU server. This gives you a native chat interface within n8n’s node library using the OpenAI API compatibility of vLLM. For teams wanting a fully sovereign AI automation stack with open-source models, this combination is hard to beat. Browse more tutorials or provision your GigaGPU server to start building.

Need a Dedicated GPU Server?

Deploy from RTX 3050 to RTX 5090. Full root access, NVMe storage, 1Gbps — UK datacenter.

Browse GPU Servers

gigagpu

We benchmark, deploy, and optimise GPU infrastructure for AI workloads. All data in our guides comes from real-world testing on our UK-based dedicated GPU servers.

Ready to deploy your AI workload?

Dedicated GPU servers from our UK datacenter. NVMe storage, 1Gbps networking, full root access.

Browse GPU Servers Contact Sales

Have a question? Need help?