How I Built My AI Chatbot Using n8n and Elementor

Bishwas JhaBishwas Jha
4 min read

Over the last few weeks, I’ve been building a custom AI chatbot from the ground up, not just a basic assistant, but one designed to provide high-quality, structured, and ethical responses in a very specific domain. It is developed for a non-profit as part of my voluntary effort, to give back.

This post is a behind-the-scenes look at how I built it: from automated data ingestion to AI reasoning and frontend integration. It’s powered entirely by n8n for the backend workflow logic and Elementor(WordPress website builder) for the frontend interface. While I’ll reveal more about the chatbot's identity and its unique purpose in a future article, this one focuses on the technical process.


Why Build a Custom AI Chatbot?

With tools like ChatGPT and Gemini already out there, why bother building your own? The answer lies in control and customisation. I needed a solution that:

  • Responds based only on approved content

  • Avoids hallucination and speculation

  • Includes multilingual disclaimers and reliability tags

  • Can integrate directly into my website with a tailored UI

That meant building from the ground up and n8n was the perfect tool for the job.

Architecture Overview

The system is composed of two main n8n workflows:

  1. Data ingestion pipeline: to process and embed source documents.

  2. Chatbot interaction engine: to manage real-time user queries.

Let’s break them down.


1) Workflow: Automated Data Ingestion

This workflow ensures the chatbot always has access to the latest, most reliable source material.

Step 1: Trigger on New Uploads

A Google Drive Trigger monitors a folder. When a new file (like a guideline or scientific document) is uploaded, the workflow begins.

Step 2: Download & Process

The file is downloaded and processed through OpenAI’s text-embedding-3-large model to generate vector embeddings.

Step 3: Store in Pinecone

The embeddings are stored in a Pinecone vector database, organised under a specific namespace for later retrieval.

Text is chunked and metadata-tagged to improve semantic search.


2) Workflow: AI-Powered Chatbot Interaction

This is what powers the chatbot users interact with.

Step 1: Message Trigger

A ChatTrigger node in n8n captures messages from the frontend interface.

Step 2: LangChain Agent

A LangChain Agent is set up with:

  • A clear scope of what it can and cannot answer

  • A non-technical, empathetic tone

  • Built-in multilingual disclaimers

  • Transparency levels (A, B, C) for content sources

Step 3: Memory, Retrieval, and Response

The agent uses short-term memory to maintain context.

If needed, it queries Pinecone using a vector store tool, retrieves the most relevant content, and passes it to OpenAI’s gpt-4o-mini to generate the final reply.

Frontend Integration with Elementor

To make the chatbot feel native to my website, I used HTML element. Here’s how I connected everything:

  • Created a custom floating chat window with HTML + JS

  • Connected it to the n8n webhook

  • Made it responsive and cleanly styled

  • Ensured every response includes a disclaimer

No third-party UI tools, no extra hosting, just pure control.

Names are hidden as the chatbot is not publicly live yet.


Built-In Safety and Guardrails

Accuracy and ethical design were top priorities. Here's how the chatbot stays safe:

  • No advice, no diagnosis, no speculation

  • Politely redirects questions that are out of scope

  • Every response includes a source reliability tag and a multilingual disclaimer

  • If a reliable answer isn’t possible, it clearly says so


What’s Next?

In my next article, I’ll reveal the identity and mission of this chatbot. who it’s designed to help, and the meaning behind its name.

Hint: it’s not just another assistant. It’s designed to help people make sense of something complex and important, but you’ll find out more soon.


Final Thoughts

This project has taught me how powerful it is to combine AI with low-code tools like n8n and Pinecone.With thoughtful design and the right architecture, you can build something:

  • Scalable

  • Safe

  • Purpose-driven

Thanks for reading. I hope this inspired you to experiment or at least left you curious about what’s coming next. 😉

1
Subscribe to my newsletter

Read articles from Bishwas Jha directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Bishwas Jha
Bishwas Jha

Hello, I am a Cloud Solutions Architect. I’ve worn many hats at work: DevOps Engineer, Cloud Engineer, Systems Engineer, and Cloud Solutions Architect. Before even starting with cloud, I was mostly writing code, and like any other dev, I’d blame the server for not keeping up with my code. Although, as an electronics engineer, I felt the real pain of keeping those servers up and running, but I was no different than any other dev. I started using cloud around a decade ago to host servers that were destined for physical data centers, and I was amazed at what the cloud could bring to the table. Fascinated with my exposure, I dived deep into the world of cloud, and now, after architecting, developing, and maintaining hundreds of AWS accounts, several applications, different stacks, and varied system designs, I still feel there’s so much more to get out of the cloud. Another field I believe can help devs keep up with multi-bug environments is using LLMs and machine learning, they truly have the capacity to automate mundane or boring tasks. When I’m not coding or "clouding" in the tech space, I love to write articles, try new tools, and simply let my thoughts float like a vibe coder sometimes. So far, I maintain the following on PyPI and VS Code Marketplace: python-maithili (PyPI) cdk-nag-extension (VS Code extension)