Build an AI Chatbot with n8n: Step-by-Step Guide
Follow this step-by-step guide to build an AI Chatbot using n8n, based on the webinar.
✅ Prerequisites
- An n8n account (cloud or self-hosted)
- An OpenAI API key
- Basic familiarity with drag-and-drop interfaces
🔧 Step 1: Create a New Workflow
- Log in to your n8n dashboard.
- Click “New Workflow”.
- Name your workflow (e.g., AI Chatbot).
🧲 Step 2: Add a Trigger Node
- Add a Trigger Node:
- Choose “On Chat Message” if using n8n.cloud.
- Alternatively, use Webhook or Manual Trigger for testing.
🤖 Step 3: Add the AI Agent Node
- Click “+” and search for “AI Agent”.
- Select “Chat Model”.
- Choose OpenAI as the provider.
- Click “Create New Credential” and enter:
- API Key (from your OpenAI account)
- Leave Organization ID and Base URL blank unless using a custom model.
🧠 Step 4: Configure the Chat Model
-
- Choose a model (e.g., gpt-4-1106-preview or gpt-4.0-mini).
- Optional: Set a System Message to define the chatbot’s personality or scope. Example:
You are a helpful assistant that only answers questions about tech entrepreneurship.
- Leave other parameters (temperature, max tokens) at default for now.
🔗 Step 5: Connect the Nodes
- Connect the Trigger Node to the AI Agent Node.
- Ensure the flow is linked properly (you should see arrows between nodes).
🧪 Step 6: Test the Chatbot
- Click “Execute Workflow” or “Test Step”.
- Type a message in the chat interface (e.g., “How do I start a tech business?”).
- The AI should respond based on your system prompt.
🌐 Step 7: Make It Public (Optional)
- Double-click the Chat Node.
- Enable “Make Chat Publicly Available”.
- Copy the public URL and share it with others.
🛠️ Troubleshooting Tips
- If you get “No response,” ensure:
- The nodes are connected.
- The workflow is active.
- The API key is valid.
- Use the Execution Logs tab to debug.
@lerlerchan by LerLer Chan

Ler Travel Diary is using
Web Hosting and n8n on Hostinger
To be a smart saver, check out
ShopBack for more information.
Enjoy SGD5 discount voucher on
Klook with code 53E7UD
Need discount for your travels? Check out our travel deals page.