Back to Catalog

LINE BOT - Google Sheets file lookup with AI agent

Jaruphat J.Jaruphat J.
941 views
2/3/2026
Official Page

This workflow integrates LINE BOT, AI Agent (GPT), Google Sheets, and Google Drive to enable users to search for file URLs using natural language. The AI Agent extracts the filename from the message, searches for the file in Google Sheets, and returns the corresponding Google Drive URL via LINE BOT.

  • Supports natural language queries (e.g., "Find file 1.pdf for me")
  • AI-powered filename extraction
  • Google Sheets Lookup for file URLs
  • Auto-response via LINE BOT

image.png

How to Use This Template

1. Download & Import

  • Copy and save the Template Code as a .json file.
  • Go to n8n Editor → Click Import → Upload the file.

2. Update Required Fields

  • Replace YOUR_GOOGLE_SHEET_ID with your actual Google Sheet ID.
  • Replace YOUR_LINE_ACCESS_TOKEN with your LINE BOT Channel Access Token.

3. Activate & Test

  • Click Execute Workflow to test manually.
  • Set Webhook URL in LINE Developer Console.

Features of This Template

  • Supports Natural Language Queries (e.g., “Find file 1.pdf for me”)
  • AI-powered filename extraction using OpenAI (GPT-4/3.5)
  • Real-time file lookup in Google Sheets
  • Automatic LINE BOT Response
  • Fully Automated Workflow

n8n Workflow: Google Sheets File Lookup with AI Agent

This n8n workflow demonstrates how to use an AI agent to perform a lookup in a Google Sheet based on a user's query, and then respond with the relevant information. It combines a webhook trigger, Google Sheets integration, and an AI agent for intelligent data retrieval.

What it does

This workflow automates the following steps:

  1. Receives a query: It listens for incoming HTTP requests (e.g., from a chat bot or another application) containing a user's query.
  2. Initializes AI Agent: Sets up an AI Agent using an OpenAI Chat Model.
  3. Provides Google Sheets Tool: The AI Agent is equipped with a "Google Sheets" tool, allowing it to interact with a specified Google Sheet.
  4. Processes Query with AI: The AI Agent receives the user's query and, using its Google Sheets tool, determines if a lookup in the Google Sheet is required to answer the query.
  5. Performs Google Sheets Lookup: If the AI determines a Google Sheets lookup is necessary, it performs the lookup using the configured Google Sheets node.
  6. Formats Response: The AI Agent processes the results from the Google Sheets lookup and formulates a coherent, human-readable response.
  7. Sends HTTP Response: The workflow sends an HTTP response back to the original caller, containing the AI agent's answer.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running n8n instance.
  • Google Sheets Account: Access to a Google Sheets document with the data you want to query.
  • OpenAI API Key: An API key for OpenAI to use their chat models (e.g., GPT-3.5, GPT-4).
  • n8n Credentials:
    • Google Sheets credentials configured in n8n.
    • OpenAI API credentials configured in n8n.

Setup/Usage

  1. Import the workflow: Import the provided JSON into your n8n instance.
  2. Configure Webhook:
    • The "Webhook" node will automatically generate a unique URL. This is the endpoint you will call to trigger the workflow.
  3. Configure Google Sheets:
    • Select your Google Sheets credential.
    • Specify the Spreadsheet ID and Sheet Name that the AI Agent should query. Ensure the data is structured logically for the AI to understand.
  4. Configure OpenAI Chat Model:
    • Select your OpenAI API credential.
    • Choose the desired OpenAI model (e.g., gpt-3.5-turbo).
  5. Activate the workflow: Ensure the workflow is activated in n8n.
  6. Trigger the workflow: Send an HTTP POST request to the Webhook URL with a JSON body containing your query (e.g., {"query": "What is the price of product X?"}).

The workflow will then process your query, consult the Google Sheet via the AI agent, and return a response.

Related Templates

AI-powered code review with linting, red-marked corrections in Google Sheets & Slack

Advanced Code Review Automation (AI + Lint + Slack) Who’s it for For software engineers, QA teams, and tech leads who want to automate intelligent code reviews with both AI-driven suggestions and rule-based linting — all managed in Google Sheets with instant Slack summaries. How it works This workflow performs a two-layer review system: Lint Check: Runs a lightweight static analysis to find common issues (e.g., use of var, console.log, unbalanced braces). AI Review: Sends valid code to Gemini AI, which provides human-like review feedback with severity classification (Critical, Major, Minor) and visual highlights (red/orange tags). Formatter: Combines lint and AI results, calculating an overall score (0–10). Aggregator: Summarizes results for quick comparison. Google Sheets Writer: Appends results to your review log. Slack Notification: Posts a concise summary (e.g., number of issues and average score) to your team’s channel. How to set up Connect Google Sheets and Slack credentials in n8n. Replace placeholders (<YOURSPREADSHEETID>, <YOURSHEETGIDORNAME>, <YOURSLACKCHANNEL_ID>). Adjust the AI review prompt or lint rules as needed. Activate the workflow — reviews will start automatically whenever new code is added to the sheet. Requirements Google Sheets and Slack integrations enabled A configured AI node (Gemini, OpenAI, or compatible) Proper permissions to write to your target Google Sheet How to customize Add more linting rules (naming conventions, spacing, forbidden APIs) Extend the AI prompt for project-specific guidelines Customize the Slack message formatting Export analytics to a dashboard (e.g., Notion or Data Studio) Why it’s valuable This workflow brings realistic, team-oriented AI-assisted code review to n8n — combining the speed of automated linting with the nuance of human-style feedback. It saves time, improves code quality, and keeps your team’s review history transparent and centralized.

higashiyama By higashiyama
90

Daily cash flow reports with Google Sheets, Slack & Email for finance teams

Simplify financial oversight with this automated n8n workflow. Triggered daily, it fetches cash flow and expense data from a Google Sheet, analyzes inflows and outflows, validates records, and generates a comprehensive daily report. The workflow sends multi-channel notifications via email and Slack, ensuring finance professionals stay updated with real-time financial insights. 💸📧 Key Features Daily automation keeps cash flow tracking current. Analyzes inflows and outflows for actionable insights. Multi-channel alerts enhance team visibility. Logs maintain a detailed record in Google Sheets. Workflow Process The Every Day node triggers a daily check at a set time. Get Cash Flow Data retrieves financial data from a Google Sheet. Analyze Inflows & Outflows processes the data to identify trends and totals. Validate Records ensures all entries are complete and accurate. If records are valid, it branches to: Sends Email Daily Report to finance team members. Send Slack Alert to notify the team instantly. Logs to Sheet appends the summary data to a Google Sheet for tracking. Setup Instructions Import the workflow into n8n and configure Google Sheets OAuth2 for data access. Set the daily trigger time (e.g., 9:00 AM IST) in the "Every Day" node. Test the workflow by adding sample cash flow data and verifying reports. Adjust analysis parameters as needed for specific financial metrics. Prerequisites Google Sheets OAuth2 credentials Gmail API Key for email reports Slack Bot Token (with chat:write permissions) Structured financial data in a Google Sheet Google Sheet Structure: Create a sheet with columns: Date Cash Inflow Cash Outflow Category Notes Updated At Modification Options Customize the "Analyze Inflows & Outflows" node to include custom financial ratios. Adjust the "Validate Records" filter to flag anomalies or missing data. Modify email and Slack templates with branded formatting. Integrate with accounting tools (e.g., Xero) for live data feeds. Set different trigger times to align with your financial review schedule. Discover more workflows – Get in touch with us

Oneclick AI SquadBy Oneclick AI Squad
619

Create personalized email outreach with AI, Telegram bot & website scraping

Demo Personalized Email This n8n workflow is built for AI and automation agencies to promote their workflows through an interactive demo that prospects can try themselves. The featured system is a deep personalized email demo. --- 🔄 How It Works Prospect Interaction A prospect starts the demo via Telegram. The Telegram bot (created with BotFather) connects directly to your n8n instance. Demo Guidance The RAG agent and instructor guide the user step-by-step through the demo. Instructions and responses are dynamically generated based on user input. Workflow Execution When the user triggers an action (e.g., testing the email demo), n8n runs the workflow. The workflow collects website data using Crawl4AI or standard HTTP requests. Email Demo The system personalizes and sends a demo email through SparkPost, showing the automation’s capability. Logging and Control Each user interaction is logged in your database using their name and id. The workflow checks limits to prevent misuse or spam. Error Handling If a low-CPU scraping method fails, the workflow automatically escalates to a higher-CPU method. ⚙️ Requirements Before setting up, make sure you have the following: n8n — Automation platform to run the workflow Docker — Required to run Crawl4AI Crawl4AI — For intelligent website crawling Telegram Account — To create your Telegram bot via BotFather SparkPost Account — To send personalized demo emails A database (e.g., PostgreSQL, MySQL, or SQLite) — To store log data such as user name and ID 🚀 Features Telegram interface using the BotFather API Instructor and RAG agent to guide prospects through the demo Flow generation limits per user ID to prevent abuse Low-cost yet powerful web scraping, escalating from low- to high-CPU flows if earlier ones fail --- 💡 Development Ideas Replace the RAG logic with your own query-answering and guidance method Remove the flow limit if you’re confident the demo can’t be misused Swap the personalized email demo with any other workflow you want to showcase --- 🧠 Technical Notes Telegram bot created with BotFather Website crawl process: Extract sub-links via /sitemap.xml, sitemap_index.xml, or standard HTTP requests Fall back to Crawl4AI if normal requests fail Fetch sub-link content via HTTPS or Crawl4AI as backup SparkPost used for sending demo emails --- ⚙️ Setup Instructions Create a Telegram Bot Use BotFather on Telegram to create your bot and get the API token. This token will be used to connect your n8n workflow to Telegram. Create a Log Data Table In your database, create a table to store user logs. The table must include at least the following columns: name — to store the user’s name or Telegram username. id — to store the user’s unique identifier. Install Crawl4AI with Docker Follow the installation guide from the official repository: 👉 https://github.com/unclecode/crawl4ai Crawl4AI will handle website crawling and content extraction in your workflow. --- 📦 Notes This setup is optimized for low cost, easy scalability, and real-time interaction with prospects. You can customize each component — Telegram bot behavior, RAG logic, scraping strategy, and email workflow — to fit your agency’s demo needs. 👉 You can try the live demo here: @emaildemobot ---

Michael A PutraBy Michael A Putra
474