Code Workflows
445 Ergebnisse — ausschließlich quellenverknüpfte n8n-Referenzen
Discover & Enrich Decision-Makers with Apollo and Human Verification
🧩 What This Workflow Does This workflow automates the process of identifying and enriching decision-maker contacts from a list of companies. By integrating with Apollo's APIs and Google Sheets, it streamlines lead generation, ensures data accuracy through human verification, and maintains an organized leads database. 📚 Use Case Ideal for sales and marketing teams aiming to: Automate the discovery of key decision-makers (e.g., CEOs, CTOs). Enrich contact information with LinkedIn profiles, emails, and phone numbers. Maintain an up-to-date leads database with minimal manual intervention. Receive weekly summaries of newly verified leads. 🧪 Setup 1. Google Sheets Preparation: Use the following pre-configured Google Sheet: Company Decision Maker Discovery Sheet. This spreadsheet includes the necessary tabs and columns: Companies, Contacts, and Contacts (Verified). It also contains a custom onEdit Apps Script function that automatically updates the Status column to Pending whenever the Domain field is modified. To review or modify the script, navigate to Extensions > Apps Script within the Google Sheet. 2. Credentials Setup: Configure the following credentials in your n8n instance:
Dynamically switch between LLMs for AI Agents using LangChain Code
Dynamically switch between LLMs for AI Agents using LangChain Code Purpose This example workflow demonstrates a way to connect multiple LLMs to a single AI Agent/LangChain Node and programmatically use one – or in this case loop through them. What it does This AI workflow takes in customer complaints and generates a response that is being validated before returned. If the answer was not satisfactory, the response will be generated again with a more capable model. How it works A LangChain Code Node allows multiple LLMs to be connected to a single Basic LLM Chain. On every call only one LLM is actually being connected to the Basic LLM Chain, which is determined by the index defined in a previous Node. The AI output is later validated by a Sentiment Analysis Node If the result was not satisfactory, it loops back to the beginning and executes the same query with the next available LLM The loop ends either when the result passed the requirements or when all LLMs have been used before. Setup Clone the workflow and select the belonging credentials. You'll need an OpenAI Account, alternatively you can swap the LLM nodes with ones from a different provider like Anthropic after the import. H
Multi-Platform Social Media Publisher with Blotato, GPT-4 Mini & Airtable
How it works • Automates multi-platform social media posting (Instagram, YouTube, TikTok, etc.) using AI-generated content • Integrates Airtable, n8n, and Blotato for full content scheduling and publishing • Supports both image and video uploads with dynamic text and account routing Set up steps • Takes ~15–30 minutes to set up depending on how many platforms you connect • Requires Airtable personal access token and Blotato API key • Uses sticky notes throughout the workflow to explain config, tokens, and troubleshooting clearly
Automated PR Code Reviews with GitHub, GPT-4, and Google Sheets Best Practices
AI-Agent Code Review for GitHub Pull Requests Description: This n8n workflow automates the process of reviewing code changes in GitHub pull requests using an OpenAI-powered agent. It connects your GitHub repo, extracts modified files, analyzes diffs, and uses an AI agent to generate a code review based on your internal code best practices (fed from a Google Sheet). It ends by posting the review as a comment on the PR and tagging it with a visual label like ✅ Reviewed by AI. 🔧 What It Does Triggered on PR creation Extracts code diffs from the PR Formats and feeds them into an OpenAI prompt Enriches the prompt using a Google Sheet of Swift best practices Posts an AI-generated review as a comment on the PR Applies a PR label to visually mark reviewed PRs ✅ Prerequisites Before deploying this workflow, ensure you have the following: n8n Instance (Self-hosted or Cloud) GitHub Repository with PR activity OpenAI API Key** for GPT-4o, GPT-4-turbo, or GPT-3.5 GitHub OAuth App** (or PAT) connected to n8n to post comments and access PR diffs (Optional) Google Sheets API credentials if using the code best practices lookup node. ⚙️ Setup Instructions 1. Import the Workflow in n8n, click on Wor
Create a Session-Based Telegram Chatbot with GPT-4o-mini and Google Sheets
How It Works This workflow creates an AI-powered Telegram chatbot with session management, allowing users to: Start new conversations** (/new). Check current sessions** (/current). Resume past sessions** (/resume). Get summaries** (/summary). Ask questions** (/question). Key Components: Session Management**: Uses Google Sheets to track active/expired sessions (storing SESSION IDs and STATE). /new creates a session; /resume reactivates past ones. AI Processing**: OpenAI GPT-4 generates responses with contextual memory (via Simple Memory node). Summarization: Condenses past conversations when requested. Data Logging**: All interactions (prompts/responses) are saved to Google Sheets for audit and retrieval. User Interaction**: Telegram commands trigger specific actions (e.g., /question [query] fetches answers from session history). Main Advantages 1. Multi-session Handling Each user can create, manage, and switch between multiple sessions independently, perfect for organizing different conversations without confusion. 2. Persistent Memory Conversations are stored in Google Sheets, ensuring that chat history and session states are preserved even if the server or n8n instance restarts.
Optimize Amazon Ads with GPT-4o for Bid, Budget & Keyword Recommendations
Overview This template is designed for Amazon sellers and advertisers who want to automate their campaign performance analysis and bidding strategy. It solves the common challenge of manually reviewing Sponsored Products reports and guessing how to adjust keywords, placements, and budgets. By combining Amazon Advertising reports with OpenAI's GPT-4o, this workflow delivers real-time, personalized optimization instructions — automatically. Features 📥 Automatically downloads Sponsored Products reports from Google Drive 🧠 Uses AI to analyze campaign, keyword, placement, targeting, and budget performance 📊 Supports both .csv and .xlsx report formats 🔁 Handles multiple ASINs and scales easily across ad accounts 📧 Sends structured optimization recommendations to your inbox via Gmail 🗂 Built-in logic to normalize filenames and correctly map reports 🧹 Includes error handling and formatting cleanup for AI-ready input Requirements To use this workflow, you’ll need: An Amazon Ads account with access to Sponsored Products reports A Google Drive folder where Amazon Ads reports are delivered (manually or via Gmail automation) A Gmail account (for sending summaries) An OpenAI API key with
Generate & Enrich LinkedIn Leads with Apollo.io, LinkedIn API, Mail.so & GPT-3.5
Note: Now includes an Apify alternative for Rapid API (Some users can't create new accounts on Rapid API, so I have added an alternative for you. But immediately you are able to get access to Rapid API, please use that option, it returns more detailed data). *Scroll to bottom for APify setup guide* This n8n workflow automates LinkedIn lead generation, enrichment, and activity analysis using Apollo.io, RapidAPI, Google Sheets and Mail.so. Perfect for sales teams, founders, B2B marketers, and cold outreach pros who want personalized lead insights to drive better conversion rates. ⚙️ How This Workflow Works The workflow is broken down into several key steps, each designed to help you build and enrich a valuable list of LinkedIn leads: 1. 🔑 Lead Discovery (Keyword Search via Apollo) Pulls leads using Apollo.io's API based on keywords, industries, or job titles. Saves lead name, title, company, and LinkedIn URL to your Google Sheet. You can replace the trigger node from the form node to a webhook, whatsapp, telegram, etc, any way for you to send over your query variables over to initiate the workflow. 2. 🧠 Username Extraction (from LinkedIn URL) Extracts the LinkedIn username from pro
Automated Stock Analysis Reports with Technical & News Sentiment using GPT-4o
Stock Analysis Agent (Hebrew, RTL, GPT-4o) Overview Get comprehensive stock analysis with this AI-powered workflow that provides actionable insights for your investment decisions. On a weekly basis, this workflow: Analyzes stock data from multiple sources (Chart-img, Twelve Data API, Alphavantage) Performs technical analysis using advanced indicators (RSI, MACD, Bollinger Bands, Resistance and Support Levels) Scans financial news from Alpha Vantage to capture market sentiment Uses OpenAI's GPT-4o to identify patterns, trends, and trading opportunities Generates a fully styled, responsive HTML email (with proper RTL layout) in Hebrew Sends detailed recommendations directly to your inbox Perfect for investors, traders, and financial analysts who want data-driven stock insights - combining technical indicators with news sentiment for more informed decisions. Setup Instructions Estimated setup time: 15 minutes Required credentials: OpenAI API Key Chart-img API Key (free tier) Twelve Data API Key (free tier) Alpha Vantage API Key (free tier) SMTP credentials (for email delivery) Steps: Import this template into your n8n instance. Add your API keys under credentials. Configure the SMTP E
Extract, Transform LinkedIn Data with Bright Data MCP Server & Google Gemini
Disclaimer This template is only available on n8n self-hosted as it's making use of the community node for MCP Client. Who this is for? The Extract, Transform LinkedIn Data with Bright Data MCP Server & Google Gemini workflow is an automated solution that scrapes LinkedIn content via Bright Data MCP Server then transforms the response using a Gemini LLM. The final output is sent via webhook notification and also persisted on disk. This workflow is tailored for: Data Analysts : Who require structured LinkedIn datasets for analytics and reporting. Marketing and Sales Teams : Looking to enrich lead databases, track company updates, and identify market trends. Recruiters and Talent Acquisition Specialists : Who want to automate candidate sourcing and company research. AI Developers : Integrating real-time professional data into intelligent applications. Business Intelligence Teams : Needing current and comprehensive LinkedIn data to drive strategic decisions. What problem is this workflow solving? Gathering structured and meaningful information from the web is traditionally slow, manual, and error-prone. This workflow solves: Reliable web scraping using Bright Data MCP Server LinkedIn
Perform SEO Keyword Research & Insights with Ahrefs API and Gemini 1.5 Flash
This n8n workflow automates SEO keyword research by querying the Ahrefs API for keyword data and related keyword insights. The enriched data is then processed by an AI agent to format a response and provide valuable SEO recommendations. Perfect for SEO specialists, content marketers, digital agencies, and anyone looking to gain valuable insights into keyword opportunities to boost their rankings. ⚙️ How This Workflow Works This workflow guides you through the entire SEO keyword research process, from entering the initial keyword to receiving detailed insights and related keyword suggestions. 1. 🗣️ User Input (Keyword Query) The user enters a keyword they want to research. This input is captured by the Chat Input Node, ready for analysis. 2. 🤖 AI Agent (Input Verification) The AI Agent reviews the keyword input for any grammatical errors or extra commentary. If necessary, it cleans the input to ensure a seamless query to the API. 3. 🔑 Ahrefs API (Keyword Data Retrieval) The cleaned keyword is sent to the Ahrefs Keyword Tool API. This retrieves a detailed report including metrics like search volume, keyword difficulty, and CPC. 4. 💡 Related Keywords Extraction (Using JavaScript F
Chat with Your Email History using Telegram, Mistral and Pgvector for RAG
Who is this for? Everyone! Did you dream of asking an AI "what hotel did I stay in for holidays last summer?" or "what were my marks last semester like?". Dream no more, as vector similarity searches and this workflow are the foundations to make it possible (as long as the information appears in your e-mails 😅). 100% Local and Open Source! This workflow is designed to use locally-hosted open source. Ollama as LLM provider, nomic-embed-text as the embeddings model, and pgvector as the vector database engine, on top of Postgres. Structured AND Vectorized This workflow combines structured and semantic search on your e-mail. No need for enterprise setups! Leverage the convenience of n8n and open source to get a bleeding edge solution. Setup You will need a PGVector database with embeddings for all your email. Use my other template Gmail to Vector Embeddings with PGVector and Ollama to set it up in a breeze! Make a copy of my Email Assistant: Convert Natural Language to SQL Queries with Phi4-mini and PostgreSQL, you will need it for structured searches. Install this template and modify the Call the SQL composer Workflow step, to point at your copy of the SQL workflow. Adjust the rest o
Gmail to Vector Embeddings with PGVector and Ollama
Gmail to Vector Embeddings with PGVector and Ollama Who is this for? Everyone! Did you dream of asking an AI "what hotel did I stay in for holidays last summer?" or "what were my marks last semester like?". Dream no more, as vector similarity searches and this workflow are the foundations to make it possible (as long as the information appears in your e-mails 😅). 100% local This workflow is designed to use locally-hosted open source. Ollama as LLM provider, nomic-embed-text as the embeddings model, and pgvector as the vector database engine, on top of Postgres. But.. how?! Firstly, specify the date you created your Gmail account on, then manually run the workflow in order to bulk read all your e-mail in monthly batches. Your database is now populated! Now it's the task for other workflows to query the vector database. Activate the workflow so that new e-mail is continuously added by the Gmail Trigger upon receiving it. Structured AND Vectorized This workflow stores your e-mail activity in two ways: In a structured table In a vector embeddings table And the information in both of them can be correlated by Gmail's messages id, which is stored in the vectors table as metadata propert
Real-time Crypto News & Sentiment Analysis via Telegram with GPT-4o
Stay on top of the latest crypto news and market sentiment instantly, all inside Telegram! This workflow aggregates articles from the top crypto news sources, filters for your topic of interest, and summarizes key news and market sentiment using GPT-4o AI. Ideal for crypto traders, investors, analysts, and market watchers needing fast, intelligent news briefings. > 💬 Just type a coin name (e.g., "Bitcoin", "Solana", "DeFi") into your Telegram AI Agent—and get a smart news digest. How It Works Telegram Bot Trigger User sends a keyword (e.g., "Ethereum") of questions to the Telegram AI Agent. Keyword Extraction (AI-Powered) An AI agent identifies the main topic for better targeting. News Aggregation Pulls articles from 9 major crypto news RSS feeds: Cointelegraph Bitcoin Magazine CoinDesk Bitcoinist NewsBTC CryptoPotato 99Bitcoins CryptoBriefing Crypto.news Filtering Finds and merges articles relevant to the user's keyword. AI Summarization GPT-4o generates a 3-part summary: News Summary Market Sentiment Analysis List of Article Links Telegram Response Sends a structured, easy-to-read digest back to the user. 🔍 What You Can Do with This Workflow 🔹 Summarize breaking news for an
Extract & Classify Invoices & Receipts with Gmail, OpenAI and Google Drive
Who is it for? Anyone who wants to automatically aggregate their invoices or receipts. Main beneficiaries: small business owners and freelancers. How it works Creates a folder in Google Drive for uploading invoices and receipts. Responds (Webhook response) with URL to the created folder. Gets all emails with attachments from a Gmail mailbox. (Optional) Filters emails, e.g. exclude emails sent to specific address. Filters only PDF attachments. Classifies all PDF attachment contents with an AI model (is it a receipt or an invoice?). Uploads receipts and invoices to the created Google Drive folder and optionally sends an email with the attachments to, e.g., your accountant. Pre-conditions/Requirements Gmail and Google Drive accounts A Google Cloud OAuth 2.0 Client ID or a service account with Google Drive and Gmail APIs enabled OpenAI API account and API key Set up steps Provide credentials for the nodes: Gmail, Google Drive, OpenAI. Configure parameters in the "Configure" node. Most importantly: "sendInvoicesTo" for the email address where invoices/receipts should be sent. It uses a Webhook node trigger. It expects a body with a schema such as: { "name": "getInvoicesAndReceiptsFromEm
🗞️ AI-powered sustainability newsletter for marketing with Gmail, GPT-4o
Tags: Sustainability, Web Scraping, OpenAI, Google Sheets, Newsletter, Marketing Context Hey! I’m Samir, a Supply Chain Engineer and Data Scientist from Paris, and the founder of LogiGreen Consulting. We use AI, automation, and data to support sustainable business practices for small, medium and large companies. I use this workflow to bring awareness about sustainability and promote my business by delivering automated daily news digests. > Promote your business with a fully automated newsletter powered by AI! This n8n workflow scrapes articles from the official EU news website and sends a daily curated digest, highlighting only the most relevant sustainability news. 📬 For business inquiries, feel free to connect with me on LinkedIn Who is this template for? This workflow is useful for: Business owners** who want to promote their service or products with a fully automated newsletter Sustainability professionals** staying informed on EU climate news Consultants and analysts** working on CSRD, Green Deal, or ESG initiatives Corporate communications teams** tracking relevant EU activity Media curators** building newsletters What does it do? This n8n workflow: ⏰ Triggers automatical
Business Model Canvas AI-Powered Generator (LLM Flexible)
👥 Who is this for? Startup founders validating or pitching new ideas Business consultants running strategy sessions Product teams defining business logic visually Agencies offering planning frameworks to clients ❓ What problem does this workflow solve? Creating a Business Model Canvas manually is time-consuming and often scattered across tools. This workflow solves that by allowing users to generate a fully populated, formatted, and printable Business Model Canvas in seconds using the power of AI, all structured in a professional A4 landscape layout. ⚙️ What this workflow does Starts with a chat input asking for your business idea Sends it to 9 separate AI agents, each focused on one section: Key Partners Key Activities Value Proposition Customer Relationships Customer Segments Key Resources Channels Cost Structure Revenue Streams Uses your preferred LLM (see below) to generate meaningful bullet points Converts output into a specific format Merges all sections into a clean, A4-styled HTML canvas Exports the result as a downloadable .html file 🛠️ Setup Import the workflow into your n8n instance Start the flow from the “When chat message received” node Describe your business idea w
Auto-create and publish AI social videos with Telegram, GPT-4 and Blotato
Auto-create and publish AI social videos with Telegram, GPT-4 and Blotato > ⚠️ Disclaimer: This workflow uses Community Nodes and must be run on a self-hosted instance of n8n. Who is this for? This template is perfect for social media managers, content creators, AI enthusiasts, and automation pros who want to generate short-form videos (Reels) from a simple Telegram message, then publish them across multiple platforms—all without video editing or manual uploads. What problem is this workflow solving? Creating content is only half the job. The real bottleneck comes in: Rendering the video, Adding voice or music, Writing captions and titles, Publishing to multiple platforms. This workflow automates all of that using AI. It saves hours every week and guarantees consistent output. What this workflow does This end-to-end automation handles everything from AI video generation to social publishing: Starts with a Telegram message (text or image prompt) Generates video using Kling or Blotato, based on the input Creates music with Piapi and merges it with the video Generates text overlays and captions with GPT-4 Builds a stylized video using JSON2Video Logs results to Google Sheets Sends
🧑🦯Improve your website accessibility with GPT-4o and Google Sheet
Tags: Accessibility, SEO, Blogging, Marketing, Automation, AI, Web Auditing Context Hey! I’m Samir, a Supply Chain Engineer and Data Scientist from Paris, and the founder of LogiGreen Consulting. In my personal blog, I share insights on how to use AI, automation, and data analytics to improve logistics, operations, and digital sustainability practices. > Have you heard about accessibility? In this workflow, I use n8n to improve the quality of alternative texts for images on my personal website. 📬 For business inquiries, you can connect with me on LinkedIn Who is this template for? This workflow is for: Bloggers* and *website owners* who want to *improve accessibility** SEO professionals** looking to boost page performance Web developers* and *product teams** automating web audits What does it do? This n8n workflow: 🔍 Downloads the HTML of a blog or web page 🖼️ Extracts all ` tags and their alt` attributes 📉 Detects missing or too-short alt texts 🤖 Sends those images to GPT-4o (with vision) to generate new alt descriptions 📄 Saves the results into a Google Sheet, updating the alt text when needed How it works Set a page URL using the Set node Download HTML content Extract i
Build your own Qdrant Vector Store MCP server
This n8n demonstrates how to build your own Qdrant MCP server to extend its functionality beyond that of the official implementation. This n8n implementation exposes other cool API features from Qdrant such as facet search, grouped search and recommendations APIs. With this, we can build an easily customisable and maintainable Qdrant MCP server for business intelligence. This MCP example is based off an official MCP reference implementation which can be found here - https://github.com/qdrant/mcp-server-qdrant How it works A MCP server trigger is used and connected to 5 custom workflow tools. We're using custom workflow tools as there is quite a few nodes required for each task. We use a mix of n8n supported Qdrant nodes for simple operations such as insert documents and similarity search, and HTTP node to hit the Qdrant API directly for Facet search, group search and recommendations. We use "Edit Field" and "Aggregate" nodes to return suitable responses to the MCP client. How to use This Qdrant MCP server allows any compatible MCP client to manage a Qdrant Collection by supporting select and create operations. You will need to have a collection available before you can use this ser
Build your own SQLite MCP server
This template is for Self-Hosted N8N Instances only. This n8n demonstrates how to build a simple SQLite MCP server to perform local database operations as well as use it for Business Intelligence. This MCP example is based off an official MCP reference implementation which can be found here -https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite How it works A MCP server trigger is used and connected to 5 tools: 2 Code Node and 3 Custom Workflow. The 2 Code Node tools use the SQLLite3 library and are simple read-only queries and as such, the Code Node tool can be simply used. The 3 custom workflow tools are used for select, insert and update queries as these are operations which require a bit more discretion. Whilst it may be easier to allow the agent to use raw SQL queries, we may find it a little safer to just allow for the parameters instead. The custom workflow tool allows us to define this restricted schema for tool input which we'll use to construct the SQL statement ourselves. All 3 custom workflow tools trigger the same "Execute workflow" trigger in this very template which has a switch to route the operation to the correct handler. Finally, we use our Code no
Generate Monthly Financial Reports with Gemini AI, SQL, and Outlook
🚀 AI-Powered Business Performance Reporting Automation Unlock executive-level insights with ZERO manual work! This n8n template empowers you to automate your entire monthly business performance reporting using dynamic SQL queries, AI-driven analysis, and beautiful HTML dashboards — all delivered directly to your inbox. 🎯 What This Automation Does 📆 Triggers automatically every month (5th of each month) 🧮 Fetches financial data from SQL (ERPNext or any database) 🔁 Loops over cost centers to analyze each business unit individually 📊 Generates Profit & Loss reports, WIP, Employee stats, and vertical breakdowns 🤖 Uses Google Gemini 2.5 AI to perform advanced financial analysis 💌 Delivers a polished HTML report to your email inbox 🔧 Fully modular – replace data source with Excel, Google Sheets, or APIs 🧑🏫 Step-by-Step Video Tutorial 🎥 Watch the full tutorial on YouTube: 📌 Learn how each node works and see the AI-generated report in action. 🌐 Useful Links 🔗 Sign up for n8n Cloud (recommended for non-tech users): 👉 https://n8n.syncbricks.com 📘 Download the step-by-step Guidebook (Free): 👉 https://lms.syncbricks.com/books/n8n 📚 Explore the full course on n8n (includes t
Summarize YouTube Videos into Structured Content Ideas with AI and Airtable
Extract the main idea and key takeaways from YouTube videos and turn them into Airtable content ideas 📝 Description Automatically turn YouTube videos into clear, structured content ideas stored in Airtable. This workflow pulls new video links from Airtable, extracts transcripts using a RapidAPI service, summarizes them with your favourite LLM, and logs the main idea and key takeaways—keeping your content pipeline fresh with minimal effort. ⚙️ What It Does Scans Airtable for new YouTube video links every 5 minutes. Extracts the transcript of the video using a third-party API via RapidAPI. Summarizes the content to generate a main idea and takeaways. Updates the original Airtable entry with the insights and marks it as completed. 🛠 Prerequisites Before using this template, make sure you have: ✅ A RapidAPI account with access to the youtube-video-summarizer-gpt-ai API. ✅ A valid RapidAPI key. ✅ An OpenAI, Claude or Gemini account connected to n8n. ✅ An Airtable account with a base and table ready. 🧰 Setup Instructions Clone this template into your n8n workspace. Open the Get YouTube Sources node and configure your Airtable credentials. In the Get video transcript node: Enter your X
Document Analysis & Chatbot Creation with Llama Parser, Gemini LLM & Pinecone DB
📄Description This automation workflow enables users to upload files via an N8N form, automatically analyzes the content using Google Gemini agents, and delivers the analyzed results via email along with a chatbot link. The system leverages Llama Cloud API, Google Gemini LLM, Pinecone vector database, and Gmail to provide a seamless, multilingual content analysis experience. ✅ Prerequisites Before setting up this workflow, ensure the following are in place: An active N8N instance. Access to Llama Cloud API. Google Gemini LLM API keys (for Translator & Analyzer agents). A Pinecone account with an active index. A Gmail account with API access configured. Basic knowledge of N8N workflow setup. ⚙️ Setup Instructions Deploy the N8N Form Create a public-facing form using N8N. Configure it to accept: File uploads. User email input. File Preprocessing Store the uploaded files temporarily. Organize and preprocess them as needed. Content Extraction using Llama Cloud API Feed the files into the Llama Cloud API. Extract and parse the content for further processing. Translation (if required) Use a Translator Agent (Google Gemini). Check if the content is in English. If not, translate it. Conten
LINE Chatbot with Google Sheets Memory and Gemini AI
Main Use Case This workflow enables automated, AI-assisted replies to users messaging a LINE Official Account, while storing and referencing chat history from Google Sheets to maintain context. Ideal for businesses or support teams that want to provide smart, personalized customer interactions using AI with memory. How It Works (Step-by-Step) Connect to LINE Official Account's API A Webhook listens for incoming messages from users on LINE. When a message is received, it triggers the workflow. Prepare the Data An Edit Fields module structures incoming data (e.g. extracts user ID, message content). This ensures data is clean and usable downstream. Retrieve Chat History The user’s previous conversations are fetched from a Google Sheet. This ensures the AI has memory and can continue conversations contextually. Prepare Prompt The retrieved chat history is combined with the new message to form a complete prompt for the AI. Example format: “User previously said X. Now they said Y. How should we respond?” AI Agent: Google Gemini The formatted prompt is passed to an AI Agent (Google Gemini Chat Model). The AI generates a response based on the message + history. Tools used: Chat ModeMemory,