n8n + Ertas
Use n8n's self-hosted automation platform with Ertas-trained models for privacy-first AI workflows where both the orchestration layer and the inference engine run on infrastructure you control.
Overview
n8n is the open-source, self-hosted workflow automation platform that has become the go-to choice for teams who need full control over their data and infrastructure. Unlike cloud-only alternatives, n8n runs on your own servers, which means every piece of data flowing through your automations stays within your network boundary. This architecture has made n8n especially popular with AI agencies serving clients in regulated industries — healthcare providers, financial institutions, and legal firms that cannot route sensitive data through third-party cloud services.
The platform's node-based visual editor supports over 400 integrations out of the box, and its dedicated AI nodes — including the AI Agent node, LLM Chain node, and various memory and tool nodes — make it straightforward to build sophisticated AI-powered workflows. However, most n8n AI tutorials and templates default to cloud API providers for the language model backend, which introduces the same cost and privacy concerns that led teams to choose n8n's self-hosted architecture in the first place.
How Ertas Integrates
n8n's AI Agent node and LLM Chain nodes support custom OpenAI-compatible endpoints through their credential system. This means you can train a purpose-built model in Ertas Studio, deploy it locally via Ollama, and point n8n directly at that local endpoint without installing any additional plugins or custom nodes. The credential configuration accepts a custom base URL, so you simply enter your Ollama server address and the model name — n8n handles the rest using the standard OpenAI chat completions protocol.
This creates a fully self-hosted AI stack where both the automation engine and the language model run on your infrastructure. Fine-tuning with Ertas lets you optimize model performance for your specific tasks — whether that is extracting structured data from invoices, classifying support tickets by urgency, or generating personalized email responses. The result is an AI workflow that is faster (no network round-trips to cloud APIs), cheaper (no per-token billing), and more private (no data leaves your servers at any point in the pipeline).
Getting Started
- 1
Fine-tune a task-specific model in Ertas Studio
Prepare your training dataset with examples relevant to your workflow — classified emails, extracted invoice fields, or generated responses — and run a fine-tuning job in Ertas Studio targeting your chosen base model.
- 2
Deploy the model with Ollama
Export the fine-tuned model as GGUF, register it with Ollama using the Ertas-generated Modelfile, and start the server. Confirm the model is reachable at the expected endpoint.
- 3
Configure n8n credentials for the local endpoint
In n8n, create a new OpenAI-compatible credential. Set the base URL to your Ollama server address (e.g., http://localhost:11434/v1) and enter any string as the API key since Ollama does not require authentication by default.
- 4
Build your workflow with AI Agent nodes
Add an AI Agent node or LLM Chain node to your workflow and select the credential you just created. Specify your model name, configure the system prompt for your task, and wire the node into your existing workflow logic.
- 5
Monitor and iterate
Run test executions to validate output quality. Use n8n's execution log to inspect prompts and responses, and feed edge cases back into your Ertas training dataset for the next fine-tuning iteration.
{
"n8n_credential_type": "OpenAI Compatible",
"settings": {
"baseUrl": "http://localhost:11434/v1",
"apiKey": "not-required",
"modelName": "my-ertas-model"
},
"ai_agent_node": {
"systemPrompt": "You are a support ticket classifier. Respond with exactly one label: billing, technical, account, or general.",
"temperature": 0.1,
"maxTokens": 32
}
}Benefits
- Fully self-hosted AI pipeline — both automation and inference run on your infrastructure
- Native support through n8n's OpenAI-compatible credential system with no custom plugins required
- Zero per-token costs regardless of how many AI nodes execute per workflow
- Complete data privacy — sensitive documents and customer data never leave your network
- Fine-tuned models outperform generic APIs on domain-specific tasks like classification and extraction
- Eliminate cloud API rate limits that cause workflow failures during peak processing hours
Related Resources
Fine-Tuning
GGUF
Inference
LoRA
How to Cut Your AI Agency Costs by 90% with Fine-Tuned Local Models
Privacy-Conscious AI Development: Fine-Tune in the Cloud, Run on Your Terms
Make.com
Ollama
Ertas for Customer Support
Ertas for AI Automation Agencies
Ship AI that runs on your users' devices.
Early bird pricing starts at $14.50/mo — locked in for life. Plans for builders and agencies.