FM
FlowMarket
AI Agents Advanced ⚡ 20 n8n Nodes

Chat with a Google Sheet using AI

This workflow allows you to ask questions about the data in a Google Sheet over a chat interface. It uses n8n's built-in chat, but could be modified to work ...

🔌 Nodes & Integrations Used (7)

Chat Trigger Lm Chat Open Ai Memory Buffer Window Execute Workflow Trigger Agent Tool Workflow Google Sheets

📖 Implementation & Setup Guide

This workflow allows you to ask questions about the data in a Google Sheet over a chat interface. It uses n8n's built-in chat, but could be modified to work with Slack, Teams, WhatsApp, etc.

Behind the scenes, the workflow uses GPT4, so you'll need to have an OpenAI API key that supports it.

How it works The workflow uses an AI agent with custom tools that call a sub-workflow. That sub-workflow reads the Google Sheet and returns information from it.

Because models have a context window (and therefore a maximum number of characters they can accept), we can't pass the whole Google Sheet to GPT - at least not for big sheets. So we provide three ways of querying less data, that can be used in combination to answer questions. Those three functions are: 1. List all the columns in the sheet 2. Get all values of a single column 3. Get all values of a single row

Note that to use this template, you need to be on n8n version 1.19.4 or later.

⚡ How to import this workflow into n8n:

  1. Click the Direct Download JSON button above to save Chat with a Google Sheet using AI.json.
  2. Log in to your n8n Cloud or self-hosted n8n instance.
  3. In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
  4. Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
  5. Click Execute Workflow to test and switch to Active!

Related AI Agents Workflows

View All in AI Agents →