n8n Workflows

Building AI Agent Workflows with n8n’s Self‑Hosted AI Starter Kit: A Practical Guide

October 14, 2026
Building AI Agent Workflows with n8n’s Self‑Hosted AI Starter Kit: A Practical Guide

Learn how to set up n8n’s Self‑Hosted AI Starter Kit to create secure, private AI agent workflows that connect LLMs, vector stores, and your CRM without relying on external APIs.

Agency owners and technical leads often face a choice between buying ready‑made automation templates or building custom workflows that keep data inside their own infrastructure. When the goal is to orchestrate AI agents that interact with LLMs, internal documents, and CRM systems, a self‑hosted approach can reduce reliance on third‑party APIs and improve data security. This guide shows how to use n8n’s Self‑Hosted AI Starter Kit to create such workflows, covering installation, core components, and a simple example that ties an LLM to a vector store and a CRM action.

Why a Self‑Hosted AI Kit Matters

The starter kit is described as an open‑source Docker Compose template that "quickly sets up a local AI environment" and "provides essential tools for creating secure, self‑hosted AI workflows"【https://github.com/n8n-io/self-hosted-ai-starter-kit】. By combining a self‑hosted n8n instance with Ollama, Qdrant and PostgreSQL, the kit gives you three capabilities that are otherwise scattered across separate services:

  • Local LLMs, Ollama lets you install and run the latest language models on your own hardware【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

  • Vector storage, Qdrant offers a high‑performance, open‑source vector store with a comprehensive API for retrieval‑augmented generation【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

  • Reliable metadata, PostgreSQL handles the workflow execution data and any relational data you need to persist【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

Together these pieces let you build AI agents that read files, embed content, query a vector store, and call LLMs without sending data to an external provider. The kit also inherits n8n’s library of over 400 integrations, so you can connect the AI output to GoHighLevel, HubSpot, Salesforce or any other CRM that appears in the n8n node catalog【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

What’s Inside the Starter Kit

The repository contains a single docker-compose.yml that defines four services:

  • n8n, the low‑code platform with advanced AI components【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

  • Ollama, supplies the LLM runtime; you can pull models such as llama3 or mistral【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

  • Qdrant, stores vector embeddings for semantic search【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

  • PostgreSQL, holds n8n’s execution logs, credentials and any custom tables you add【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

The kit also ships with an .env.example file. After cloning the repository you copy it to .env and adjust passwords, API keys and any model‑specific settings【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

Installation Steps

  1. Clone the repository: git clone https://github.com/n8n-io/self-hosted-ai-starter-kit.git

  2. Enter the directory and copy the example environment file: cp .env.example .env

  3. Edit .env to set:

    • Passwords for PostgreSQL and n8n.

    • Optional: GPU profile flags if you have an Nvidia or AMD GPU (see the kit’s README for --profile gpu-nvidia or --profile gpu-amd)【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

  4. Start the stack with Docker Compose: docker compose up -d

  5. Once the containers are healthy, open http://localhost:5678 to access the n8n editor.

The setup does not require cloning the n8n repository itself; the compose file pulls the official n8n image and the other services from Docker Hub【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

Creating a Simple AI Agent Workflow

Below is a step‑by‑step example that shows how to:

  1. Ingest a PDF file.

  2. Extract its text and generate embeddings with a local LLM.

  3. Store the embeddings in Qdrant.

  4. Answer a user question by retrieving relevant chunks and completing with the LLM.

  5. Send the answer as a Slack message (or update a CRM record).

All of these steps can be built with native n8n nodes; no custom code is required.

1. File Trigger and Text Extraction

Start with a “Local File” trigger that watches a folder for new PDFs. Follow it with a “PDF Extract” node to pull raw text. Then add a “Function” node that splits the text into chunks of roughly 500 characters.

2. Embedding Generation

Use the “Ollama” node (available through the community n8n‑ollama integration or via an HTTP request to the Ollama API) to send each chunk and receive an embedding vector. The Ollama service is already running locally, so the request goes to http://ollama:11434/api/embeddings【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

3. Upsert to Qdrant

Add a “Qdrant” node configured to upsert the vector together with metadata such as the source filename and chunk index. Qdrant’s API is exposed at http://qdrant:6333【https://github.com/n8n-io/self-hosted-ai-starter-kit】.

4. Question Answering

When a user posts a question in Slack (caught by a Slack trigger), embed the question with the same Ollama endpoint, query Qdrant for the nearest vectors, retrieve the corresponding text chunks, and pass them to an Ollama completion node to generate a grounded answer.

5. Output

Finally, route the answer to a Slack message node or, if you prefer CRM automation, to a “GoHighLevel” or “HubSpot” node that updates a contact or creates a task.

Because every component runs inside your Docker network, no PDF text or question ever leaves your machine unless you explicitly forward it to an external service.

Comparing Self‑Hosted Options for AI Workflows

Two prominent self‑hosted approaches for AI‑enabled automation are the n8n‑based starter kit and the Sim open‑source platform. Both can be run with Docker and give you control over data, but they differ in the services they bundle.

Feature n8n Self‑Hosted AI Starter Kit Sim (Apache‑2.0) License Apache‑2.0 (via n8n and component licenses) Apache‑2.0 Core Platform Self‑hosted n8n (low‑code with >400 integrations) Sim workspace (visual editor for agents and workflows) Local LLM Support Includes Ollama for running LLMs on‑prem No built‑in LLM runtime; you bring your own via HTTP nodes Vector Store Includes Qdrant out‑of‑the‑box No native vector store; must add external service Relational Metadata Includes PostgreSQL for n8n logs and custom data Uses SQLite/PostgreSQL you configure yourself Setup Method docker compose with optional GPU profiles npx sim‑setup wizard or bun run sim‑setup Target Audience Teams wanting a ready‑made AI‑enabled n8n environment Users seeking a granular, code‑friendly workflow engine

The table shows that the n8n kit delivers a more opinionated stack, pre‑bundled LLM, vector store and database, while Sim offers a lower‑level engine that you can extend with whichever services you prefer. If your priority is to get an AI agent up and running quickly with minimal configuration, the starter kit is the faster path. If you need fine‑grained control over the execution engine or want to experiment with alternative runtimes, Sim may be a better fit.

Where to Find Ready‑Made Templates

Once you have the starter kit running, you can explore the AutoStack marketplace for n8n workflow templates that are designed to work with a self‑hosted instance. Templates listed on AutoStack include installation instructions, required credentials and optional support plans. Because the marketplace handles escrow‑protected payments and monthly payouts to creators, you can purchase a template with confidence that the seller will provide updates and maintenance as part of the annual fee【/how-it-works】【/creator-signup】.

If you prefer to build your own, the starter kit gives you a solid foundation. You can version‑control the .env file, export your workflow as JSON and share it with teammates or import it into another self‑hosted n8n environment. This approach mirrors the “buy vs. build” decision that many agencies face when evaluating automation platforms.

Final Thoughts

Self‑hosting AI workflows removes a major source of uncertainty: data leaving your premises. By using n8n’s Self‑Hosted AI Starter Kit you gain a pre‑configured environment that combines a powerful low‑code orchestrator with local LLMs, vector storage and reliable persistence. The steps outlined above get you from a fresh Docker host to a working agent that can read documents, answer questions and act on CRM data, all without exposing sensitive information to external APIs. Whether you choose to buy a template from AutoStack or build from scratch, the kit provides a repeatable, secure starting point for AI‑driven automation.