Maracade Technologies · AI Agent Course
Lesson 4 — Building Your First
Local AI Chatbot
Learn to build a fully local AI assistant using n8n, Ollama, and Mistral — running entirely on your own machine.
⚙️ n8n Workflows
🦙 Ollama
🤖 Mistral AI
💬 Chat Trigger
🔒 100% Local
Hands-on Visual Lab
Follow Each Step
01
Step 1 of 14
Search for Chat Trigger
+
Create a new workflow in n8n and use the trigger search panel to find the Chat node. This is where your chatbot will receive incoming messages.
+
Add first step...
What triggers this workflow?
💬 Chat
🤖 AI Agent
⚙️ OpenAI
📊 Chat Data
🧠 Chat Memory Manager
In the n8n editor, click "Add first step" then type "chat" in the trigger search box. The Chat trigger will appear at the top of the results list.
02
Step 2 of 14
Open Chat Trigger
+
Click the Chat item from the search results to open the trigger settings panel. You'll see the trigger options and actions available.
💬
Chat
⚡ Triggers (1)
💬 On new Chat event ⚡
Actions (2)
Select "On new Chat event" under Triggers. This will fire your workflow every time someone sends a message to your chatbot.
03
Step 3 of 14
Configure Chat Trigger
+
Open the Chat trigger settings tab. You'll see options like Make Chat Publicly Available and Make Available in n8n Chat Hub. Leave defaults for now and proceed.
Parameters
Settings
🔗 Open chat
Make Chat Publicly Available
Make Available in n8n Chat Hub
Options
No properties
⚡
No trigger output
Test this trigger
or set mock data
04
Step 4 of 14
Add Message a Model Node
+
Connect the Message a Model node to the Chat Trigger. This node handles the communication with the AI model. You'll see it appear in the workflow canvas connected to the trigger.
When chat message
received
──▶
Message a
model
message: text
Tools
──▶ +
Click the + connector dot on the right side of the Chat Trigger node, then search for "Message a Model" to add it to the canvas.
05
Step 5 of 14
Open Message a Model
+
Double-click the Message a Model node to open its configuration screen. You'll need to set credentials, choose a model, and configure messages.
Parameters
Settings
⚡ Execute step
Credential
No credentials yet
Set up credential
Resource
Text ▾
Operation
Message a Model ▾
Model
From list ▾
Choose... ▾
⚠️
Messages — Content
e.g. Hello, how can you help me?
06
Step 6 of 14
Create Ollama Credentials
+
Click "Set up credential" and configure the Ollama connection using the base URL
http://localhost:11434 — no API key is required for local Ollama installations.
🦙
Ollama account
Ollama
Save
Connection
Sharing
Details
Need help? Read our docs
Base URL *
http://localhost:11434
API Key
(not required for local)
Ollama runs locally, so no API key is needed. The default port is 11434. Make sure Ollama is running on your machine before saving.
07
Step 7 of 14
Save Ollama Account
+
Click Save to store the Ollama credentials. n8n will test the connection and confirm it's working. Your Ollama account will appear in the credentials dropdown.
🦙
Ollama Account Connected
✅ Connection verified
Credential Name
Ollama account
Base URL
http://localhost:11434
08
Step 8 of 14
Load AI Model
+
With Ollama credentials saved, click the Model dropdown. n8n will query your local Ollama installation and list all available models. Select mistral from the list.
Model
From list ▾
mistral ▾
If you don't see mistral in the list, you need to pull it first. Open a terminal and run:
ollama pull mistral09
Step 9 of 14
Run Mistral in PowerShell
+
Test that Mistral is working correctly by running it directly from the command line using Ollama. This confirms the model is installed and responding before connecting it to n8n.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features: https://aka.ms/PSWindows
C:\Users\HP> ollama run mistral
>>> hello
Hello! How can I help you today? Is there something specific you'd like to talk about or learn more about? I'm here to assist you with information, answer questions, or just have a conversation. Let me know!
Type
ollama run mistral in PowerShell to start an interactive session. Type /bye to exit when done testing.10
Step 10 of 14
Add Chat Response
+
Connect a Chat response node to the output of the Message a Model node. This node sends the AI's response back to the chat window so users see the reply.
What happens next?
🔗 Respond to Webhook Returns data for Webhook
✅ Respond.io Read, update, write...
💬 Chat →
More from the community
11
Step 11 of 14
Configure Chat Message
+
Open the Chat response node and configure it. Set the Operation to Send Message and map the Message field to the AI model's output. Make sure Response Mode is set to Using Response Nodes.
⚠️ Verify you're using a chat trigger with the 'Response Mode' option set to 'Using Response Nodes'
Operation
Send Message ▾
Message
{{ $json.content }}
Options
No properties
Map the Message field to
{{ $json.content }} to pass the AI's response back to the chat interface.12
Step 12 of 14
Open Chat Window
+
Click the orange "Open chat" button in n8n to launch the built-in chat interface at the bottom of the editor. This is where you'll test your chatbot.
When chat message
received
──▶
Message a model
message: text
──▶ +
🔗 Open chat
💬 Chat
Session: 0322a...
📋 Logs
13
Step 13 of 14
Execute Workflow
+
Type a test message in the chat window and press Enter. Watch the workflow execute in real-time — you'll see green checkmarks appear on each node as the message flows through and Mistral processes your request.
1 item ✅
When chat message
received
──▶
Message a model
⏳ Processing...
hi
Type message, or press 'up' for...
14
Step 14 of 14
✅ Success Result
+
Your chatbot successfully receives the message, sends it to Mistral via Ollama, and returns the AI-generated response. The execution log shows Success in 7.559s and the chat displays the AI's reply.
1 item ✅
When chat message
received
──▶
Message a model
1 item ✅
──▶ +
✅
Success in 7.559s
hi
{ "content": " Hello! How can I assist you today?" }
Congratulations! Your local AI chatbot is working. The response came entirely from your machine using Ollama + Mistral — no internet, no API costs, total privacy.
🏆
Lesson 4 Complete!
You've built a fully local AI chatbot from scratch. Here's what you mastered:
```n8n Workflows
Visual automation pipelines
Visual automation pipelines
Ollama Integration
Local AI model management
Local AI model management
Mistral AI Model
Open-source LLM running locally
Open-source LLM running locally
Chat Systems
Trigger → Process → Respond
Trigger → Process → Respond
Privacy-First AI
No data leaves your machine
No data leaves your machine