Integration guide

AutomationSource-available / fair-codeUpdated 2026

n8n Integration

Workflow automation platform often used to connect AI models, APIs, webhooks, databases, and business tools.

IntermediateSetup
PartialLocal runtime
3Related paths

Recommended path

n8n local AI quick start

  1. 1. Start Ollama and load a chat modelRun Ollama, pull the model you plan to use, and confirm it answers before opening n8n. The n8n credential expects a running Ollama instance.
  2. 2. Create an Ollama credential in n8nSet the Base URL to http://localhost:11434 when n8n can reach Ollama directly. If n8n runs in Docker, use a host or container address that is reachable from that container.
  3. 3. Connect the model to the right nodeAttach Ollama Chat Model to a Basic LLM Chain for one prompt-to-response step, or to an AI Agent with at least one tool for tool-using work. Select the credential and model, then run a test execution.

Best for

Teams wiring AI steps into repeatable automations and internal workflows.

Model support

The Ollama Chat Model sub-node connects a workflow to your own Ollama server through an Ollama credential that takes a base URL and an optional API key. Any other local runtime with an HTTP API can be reached with a plain HTTP Request node.

Choose models by role

Single model call

Instruction-following Ollama chat model

Use this with a Basic LLM Chain when the workflow supplies one prompt and receives one response. Tool calling is unnecessary when n8n already controls every downstream step.

Tool-using agent

Tool-capable Ollama chat model

Use this with an AI Agent when the model must choose and call connected tools. Test tool support first, connect at least one tool, and require human approval for consequential actions.

How to use this integration

  • Run an AI step inside a scheduled or webhook-triggered workflow with no per-token cost
  • Give a workflow tool-calling behaviour that reads from and writes to your own systems
  • Classify or route incoming documents and messages using a model on your own hardware
  • Draft notifications and summaries locally, keeping the source data inside your network

Connecting a local model

Add the Ollama Chat Model sub-node and set the credential base URL, which defaults to http://localhost:11434 or the value of OLLAMA_HOST. If n8n runs in Docker and Ollama runs on the host, localhost points at the container, not the host: use host.docker.internal, or the container name such as http://my-ollama:11434 when both run in Compose.

Tradeoffs

Container networking is the first setup trap: localhost inside n8n's container does not mean the Ollama host, and IPv6 resolution can require 127.0.0.1. In AI Agent workflows, connected tools can send messages or modify records, so keep consequential actions behind human approval until the workflow is proven. n8n is fair-code under the Sustainable Use License, not OSI open source.

Source

n8n Ollama credentials documentation