Build your first AI data analyst chatbot
Enhance your data analysis by connecting an AI Agent to your dataset, using n8n tools.
This template teaches you how to build an AI Data Analyst Chatbot that is capable of pulling data from your sources, using tools like Google Sheets or databases. It's designed to be easy and efficient, making it a good starting point for AI-driven data analysis.
You can easily replace the current Google Sheets tools for databases like Postgres or MySQL.
How It Works
The core of the workflow is the AI Agent. It's connected to different data retrieval tools, to get data from Google Sheets (or your preferred database) in many different ways.
Once the data is retrieved, the Calculator tool allows the AI to perform mathematical operations, making your data analysis precise.
Who is this template for
- Data Analysts & Researchers: Pull data from different sources and perform quick calculations.
- Developers & AI Enthusiasts: Learn to build your first AI Agent with easy dataset access.
- Business Owners: Streamline your data analysis with AI insights and automate repetitive tasks.
- Automation Experts: Enhance your automation skills by integrating AI with your existing databases.
How to Set Up
You can find detailed instructions in the workflow itself.
Check out my other templates
n8n AI Data Analyst Chatbot Workflow
This n8n workflow demonstrates how to build a basic AI data analyst chatbot. It leverages LangChain nodes to create a conversational agent capable of using a calculator and calling other n8n workflows as tools to answer user queries.
What it does
This workflow simplifies the creation of an AI-powered chatbot that can respond to user messages by:
- Listening for Chat Messages: It triggers when a new chat message is received.
- Initializing AI Agent: Sets up an AI agent with a conversational chat model (OpenAI) and a simple memory to maintain context.
- Providing Tools: Equips the AI agent with two key tools:
- Calculator: Allows the AI to perform mathematical calculations.
- Call n8n Workflow Tool: Enables the AI to execute other n8n workflows, extending its capabilities to interact with various services and data sources.
- Processing User Input: The AI agent processes the incoming chat message, determining whether to use its tools or directly respond based on the query.
- Aggregating Responses: Collects the AI agent's response.
- Filtering Responses: Checks if the AI agent provided a response.
- Sending HTTP Request: If a response is available, it sends an HTTP request (presumably to send the response back to the chat platform).
Prerequisites/Requirements
To use this workflow, you will need:
- n8n Instance: A running n8n instance (cloud or self-hosted).
- OpenAI API Key: For the
OpenAI Chat Modelnode to function. This should be configured as an n8n credential. - LangChain Nodes: Ensure you have the LangChain nodes installed in your n8n instance.
- Additional n8n Workflows (Optional): If you intend for the
Call n8n Workflow Toolto be useful, you will need other n8n workflows configured to be called as tools.
Setup/Usage
- Import the Workflow: Download the provided JSON and import it into your n8n instance.
- Configure Credentials:
- Set up an OpenAI API Key credential in n8n.
- Ensure any credentials required by the
Call n8n Workflow Tool(for the workflows it might call) are also configured.
- Configure OpenAI Chat Model: In the
OpenAI Chat Modelnode, select your OpenAI API Key credential. - Configure Call n8n Workflow Tool:
- In the
Call n8n Workflow Toolnode, specify the IDs of the n8n workflows you want the AI to be able to call. These workflows should be designed to take input and return output in a way the AI can understand.
- In the
- Activate the Workflow: Enable the workflow in your n8n instance.
- Send Chat Messages: The workflow will now listen for incoming chat messages via the
When chat message receivedtrigger. You can test it by sending messages to the configured chat platform.
Related Templates
Transcribe audio files with Google Gemini and Telegram
Transcribe audio messages from Telegram using Google Gemini for free. Send an audio file to your Telegram bot and get a full transcription using Gemini’s free model. Who is this template for? Anyone who needs quick and accurate transcriptions of audio messages. Perfect for: Creators and podcasters Coaches or educators People who receive a lot of audio on Telegram You can also adapt this workflow to transcribe audio from other sources, like WhatsApp, Google Drive, or direct uploads. How it works You send an audio file to your Telegram bot n8n downloads the file and converts it to text using Google Gemini The transcript is sent back to you on Telegram How to set up You’ll just need: A Telegram bot token A Google Gemini API key (free tier supported) The rest works out by itself. Check out my other templates 👉 https://n8n.io/creators/solomon/
Preconfigured nodes for Systeme.io API requests
Using the Systeme API can be challenging due to its pagination settings and low rate limit. This requires a bit more knowledge about API requests than a beginner might have. This template provides preconfigured HTTP Request nodes to help you work more efficiently. Pagination settings, item limits, and rate limits are all configured for you, making it easier to get started. How to configure Systeme.io credentials The Systeme API uses the Header Auth method. So create a Header Auth credential in your n8n with the name "X-API-Key". . Check out my other templates 👉 https://n8n.io/creators/solomon/
2-way sync Notion and Google Calendar
This workflow syncs multiple Notion databases to your Google Calendar. And it works both ways. What events are supported? Everything except recurring events. All day events, multiple day events, start and end date… these are all supported. You set them in Notion and they stay in sync with Google. And vice versa. Why doesn’t it support recurring events? Notion doesn’t support recurring events yet. So when you create a recurring event in Google, it will only consider the first date, ignoring future occurrences of the event. Can I connect more than one Notion database? Yes. You can have many Notion databases synced to one Google Calendar account. You can see how to do it in the workflow instructions. It is recommended that you create more calendars in your account, so that you can link each calendar to a different database in Notion. But that’s a choice. What happens if I delete an event or page? Notion page deleted → Deletes event in Google Notion date property cleared → Deletes event in Google Google event deleted → Clears the date property in Notion, but keeps the page, so you don’t lose your work. Does it update the events? Yes. When you update the event in Google or in Notion it syncs both ways. How can I know what Notion item was linked to an event? Either by the name or by clicking the hyperlink in the event description that says: 👉 View in Notion. When I create a new event in Google, does it add an item to Notion? Yes. When you create an event inside one of your calendars, the item is synced to the corresponding Notion database. Does it sync event descriptions? No. The event description will always be “View in Notion”. Even if you change it in Google Calendar it will be overwritten when you make a change to the Notion page. 🎉 When you buy this template you receive step-by-step instructions on how to set it up. Check out my other templates 👉 https://n8n.io/creators/solomon/