by Oneclick AI Squad
A hands-free travel planning assistant that accepts voice messages via WhatsApp and Telegram, understands natural language travel requests, searches across multiple providers, and automatically books to your calendar with smart recommendations. How it works Voice Message Reception - WhatsApp/Telegram webhooks capture incoming voice notes and calls Audio Transcription - Converts voice to text using OpenAI Whisper or Google Speech-to-Text Intent Classification - Claude AI analyzes the request to determine travel intent and parameters Context Enrichment - Pulls user preferences, past trips, and budget profiles from database Multi-Source Travel Search - Queries flights (Skyscanner), hotels (Booking.com), activities in parallel Smart Filtering & Ranking - AI applies user preferences, budget constraints, and optimal timing Natural Response Generation - Claude crafts conversational voice-friendly responses Calendar Auto-Add - Creates Google Calendar events with travel details and reminders Voice Response Delivery - Sends text + voice message back via original messaging platform Confirmation & Booking Links - Provides quick-action buttons for booking or modifying search Proactive Follow-ups - Sends price drop alerts and departure reminders Multi-Turn Conversation - Maintains context for refinement requests Setup Steps Import workflow into n8n Configure credentials: Anthropic API - Claude AI for NLP and response generation OpenAI API - Whisper for voice transcription WhatsApp Business API - Voice message reception and sending Telegram Bot API - Alternative messaging platform Google Calendar API - Automatic event creation Flight Search API - Skyscanner, Amadeus, or Kiwi.com Hotel API - Booking.com or Hotels.com partner API Google Sheets - User preferences and conversation history MongoDB or PostgreSQL - Conversation state management Set up WhatsApp Business account and webhook Create Telegram bot via @BotFather Configure Google Calendar shared calendar for travel Populate user preferences sheet with defaults Set API keys for travel search providers Activate workflow and test with sample voice message Sample Voice Requests Simple Flight Search: "Hey, find me cheap flights to Paris next month" Complex Multi-City: "I need to go to Tokyo in March for a week, then Bangkok for 3 days, budget is $2000 total" Hotel Only: "Book a hotel in Barcelona for May 15th to 20th, somewhere near the beach under $150 per night" Full Package: "Plan a romantic weekend in Santorini for our anniversary in June, nice hotel with sunset view, under $3000 for two people" Activity Search: "What are the best things to do in Amsterdam for 3 days, we like museums and food tours" Calendar Query: "When am I flying to London next month? And can you add a reminder 2 days before?" Voice Message Webhook Payload { "platform": "whatsapp", "messageId": "wamid.ABC123XYZ", "from": "+15551234567", "timestamp": 1735804800, "type": "audio", "audio": { "id": "audio_id_12345", "mimeType": "audio/ogg", "sha256": "abc123...", "duration": 15, "url": "https://media.whatsapp.com/audio/abc123" }, "context": { "conversationId": "conv-user-001", "previousMessageId": null } } Enterprise Features Voice Intelligence: Multi-language transcription (30+ languages) Accent-adaptive recognition Background noise filtering Speaker emotion detection for urgency Smart Travel Search: Multi-provider aggregation (flights, hotels, activities) Real-time price comparison Flexible date search (±3 days optimization) Budget-aware filtering Loyalty program integration AI-Powered Personalization: Learns from past bookings and preferences Remembers dietary restrictions, seating preferences Adapts to budget patterns Suggests destinations based on season and interests Proactive Assistance: Price drop alerts for saved searches Flight delay notifications Weather warnings before departure Packing list generation Travel insurance reminders Calendar Intelligence: Conflict detection with existing events Travel time buffer insertion Timezone-aware scheduling Shared calendar support for group trips Automatic itinerary attachment Security & Privacy: End-to-end encryption for voice messages PII redaction in logs Secure credential storage GDPR-compliant data handling User data deletion on request Multi-Platform Support: WhatsApp Business Telegram Facebook Messenger SMS fallback Web widget integration
by Bitclick Solutions | B2B Engineering & Autonomous AI
Quick overview This workflow receives lead data via a webhook, uses Google Gemini through an n8n AI Agent to score and classify the lead (hot/warm/cold) with structured output, then formats and sends the results to a Telegram chat and returns a JSON response to the caller. How it works Receives a POST request with a JSON payload through an n8n webhook endpoint. Validates the request body, extracts an optional Telegram chatId from common fields, and serializes the payload into an analysis prompt. Sends the prompt to a LangChain-based AI Agent backed by Google Gemini, which extracts lead fields, assigns a score, and classifies the lead using a structured schema. Formats the AI results into an HTML-rich message including summary, classification, score, key signals, and recommended next action. Sends the formatted lead report to Telegram and returns a 200 JSON response with the classification and score (or a 500 JSON response if processing fails). Setup Add a Google Gemini (PaLM) API credential and select it in the Google Gemini Chat Model node. Add a Telegram bot credential, then set the target Telegram chat ID in the Send to Telegram node (for example, a fixed group chat ID). Activate the workflow, copy the webhook URL from the Webhook node, and configure your form/CRM/app to POST lead JSON to that endpoint. Requirements Telegram bot token — create one via @BotFather (https://t.me/botfather) and add it as an n8n credential (Telegram account) Google Gemini API key — add it as an n8n credential (Google Gemini API) — or swap for any other Chat Model node (OpenAI, Groq, Anthropic, etc.) A Telegram group or chat ID (see "Additional info" below for how to get one) Customization Use any AI model — replace Google Gemini with OpenAI, Groq, Anthropic, Ollama, or Mistral. Just create the corresponding credential and swap the node. The Structured Output Parser works with any. Change the webhook path — edit the Webhook node's "path" field. Default is /lead-qualifier. Edit the lead scoring prompt — the system prompt is fully customizable. Tune the scoring rules, change the language, or add your own business logic. Route to any Telegram destination — hardcode a fixed chat ID, or keep it dynamic by passing chatId in the payload. Add auth to the webhook — enable header or basic auth on the Webhook node for production use. Connect the error output — wire the dotted error output of any node to "Respond Error" to return a clean 500 JSON on failures. Additional info • The workflow is stateless — it processes one payload at a time with no conversation memory. No session data is stored. • The webhook accepts any JSON payload — no specific fields are required beyond a valid JSON body. Missing fields are gracefully handled as "No especificado". • To get your Telegram group's chat ID: add @getidsbot to the group, send any message, and it will reply with the ID (a negative number starting with -100). Then remove the bot. Or visit https://api.telegram.org/bot/getUpdates after sending a message to the group. • Tested with Gemini 2.5 Flash but compatible with any LLM provider supported by n8n's Chat Model nodes.
by Ayaan Sheikh
Quick overview This workflow ingests FAQs from Google Sheets into a Supabase vector table using Google Gemini embeddings, then serves a webhook-based support chatbot that answers only from that FAQ knowledge base and escalates unanswered questions to a human via UltraMsg WhatsApp. How it works Runs manually to pull FAQ rows (Question/Answer) from a Google Sheets spreadsheet. Formats each row into a single text document (for example, Q: … A: …), generates embeddings with Google Gemini, and inserts the documents into a Supabase vector store table. Receives incoming chat messages via a POST webhook that includes message and sessionId. Uses a Google Gemini chat model with session-based memory to query the Supabase vector store for the most relevant FAQ matches and generates a reply strictly from the retrieved content. If the agent output indicates escalation to a human, sends the full message content to UltraMsg via an HTTP request to alert a WhatsApp number. Returns a JSON response to the webhook caller with either the FAQ-based answer or a confirmation that a human agent has been notified. Setup Add credentials for Google Gemini (PaLM) API, Supabase, and Google Sheets OAuth2. In Supabase, create or select the vector table used for the knowledge base (configured as “FAQs Data Table”). Update the Google Sheets document and sheet selection to point to your FAQ spreadsheet with Question and Answer columns. Configure the UltraMsg endpoint details (instance URL), token, destination WhatsApp number, and message body to match your WhatsApp routing. Copy the webhook URL from n8n and configure your chat frontend or integration to POST message and sessionId to it. Execute the manual FAQ ingestion flow at least once to populate Supabase before sending live chat traffic. Requirements ✅ n8n account (free) ✅ Google Sheets (free) ✅ Supabase account (free) ✅ UltraMsg WhatsApp API (free trial) ✅ Google Gemini AI (FREE from AI Studio!) ✅ Netlify for hosting widget (free) 💡 Google Gemini API is completely FREE from aistudio.google.com — no credit card needed to get started! For long term heavy usage, Gemini paid plans start from just $0.00015 per query — practically FREE!
by Tashfeen Ahmad
Quick Overview This workflow receives inbound lead messages from HighLevel (LeadConnector), pulls prior conversation history from Supabase/Postgres, uses OpenAI to generate a short reply, and updates HighLevel custom fields (qualification data, lead disposition, and appointments) including checking availability and booking or rescheduling. How it works Receives an inbound message event from HighLevel (LeadConnector) via a webhook. If the payload indicates an appointment was booked, it fetches the contact’s upcoming appointments from HighLevel and stores the matching appointment event ID back on the contact record. If no appointment is indicated, it loads the lead’s previous chat history from Supabase, formats it into a readable transcript, and provides it as context to an OpenAI-powered conversational agent with Postgres chat memory. The agent qualifies the lead and, when appropriate, updates HighLevel custom fields (business type, inquiry volume, response time, team size, bottleneck, monthly revenue, AI experience) and the lead disposition using HighLevel API calls. When scheduling is needed, the agent calls a separate availability webhook that queries HighLevel calendar free slots and returns available times (or a no-availability message). After the agent produces the final short response, the workflow sends the message back to the lead in HighLevel conversations (for example, via SMS). Setup Create and connect credentials for OpenAI, Supabase, and Postgres (for the agent’s chat memory). Provide a HighLevel (LeadConnector) API access token and ensure the incoming webhook payload supplies it (plus Contact ID, Calendar ID, Location ID, and response channel/type). In HighLevel, create the required custom fields and update the workflow to use their field IDs (lead disposition, qualification fields, and the Event ID field). Configure the HighLevel workflow/integration that posts messages to the n8n webhook URL and maps the required customData fields (for example, “Contact Message”, “Lead Dispostions”, and calendar details). Keep the internal “get_availability” webhook URL reachable (or replace it with your own endpoint) so the agent can retrieve calendar free slots.
by Mychel Garzon
Quick Overview This workflow receives GDPR data subject access requests via a webhook, searches Microsoft 365 for related emails and documents using Microsoft Graph eDiscovery and SharePoint search, drafts a DPO cover letter with a local Ollama model, archives a report to SharePoint, logs the request to Excel, and notifies the DPO. How it works Receives a DSAR request via a POST webhook and validates required fields like the data subject’s email address. Creates a Microsoft Graph eDiscovery case and a tenant-wide eDiscovery search across all Exchange Online mailboxes for messages involving the subject. Starts an asynchronous eDiscovery statistics estimate, waits, and then fetches the latest estimate results (mailbox and item counts). Searches SharePoint Online and OneDrive for Business for matching items in Microsoft 365. Aggregates and sanitizes the findings into counts and file links, then uses a local Ollama (via LangChain) model to draft a short cover letter using only the statistics. Builds a text report, uploads it to a restricted SharePoint library, appends/updates a compliance register in Microsoft Excel, emails the internal DPO team for review, and returns a 200 Accepted webhook response with request metadata. Setup Configure Microsoft Graph OAuth2 credentials with application permissions for the Security/eDiscovery endpoints (for example, eDiscovery.ReadWrite.All) and ensure admin consent is granted. Configure Microsoft SharePoint OAuth2 credentials with permissions to search and upload files (for example, Sites.Read.All and Files.Read.All) and select the target SharePoint site/library for archiving. Configure Microsoft Outlook and Microsoft Excel credentials, set the DPO/Legal recipient address, and point the Excel node at your compliance register workbook/table stored in SharePoint. Set up Ollama (pull the llama3 model and ensure the Ollama base URL is reachable from n8n) for the cover letter generation step. Copy the production webhook URL for the DSAR endpoint and configure your intake form or portal to POST the expected fields (subjectName, subjectEmail, requestType, requestDate, requestRef).
by Akshay
Overview This project is an AI-powered WhatsApp virtual receptionist built using n8n, designed to handle both text and voice-based customer messages automatically. The workflow integrates Google Gemini, Pinecone, and the WhatsApp Business API to provide intelligent, context-aware responses that feel natural and professional. How It Works Message Detection The workflow begins when a message arrives on WhatsApp. It identifies whether the message is text or voice and routes it accordingly. Voice Message Handling Audio messages are securely downloaded from WhatsApp. The files are converted to Base64 format and sent to the Gemini API for transcription. The transcribed text is then passed to the AI Agent for further processing. AI Agent Processing The LangChain AI Agent acts as the brain of the system. It uses: Google Gemini Chat Model** for natural language understanding and response generation. Pinecone Vector Store** to retrieve company-specific information and product data. Memory Buffer** to remember the last 20 user messages, ensuring context-aware responses. The agent also follows a set of custom communication rules — replying only in approved languages, skipping greetings, and focusing on direct, helpful, and professional responses (e.g., product recommendations, support, or guidance). Knowledge Retrieval The AI Agent connects to a Pinecone database containing detailed company data, such as product catalogs or service FAQs. Using Gemini-generated embeddings, it retrieves the most relevant information for each user query. Response Delivery Once the AI Agent prepares the response, it is instantly sent back to the user via WhatsApp, completing the conversational loop. Who It’s For This system is ideal for businesses seeking to automate their customer communication through WhatsApp. It’s especially valuable for: Product-based companies** with frequent customer inquiries. Service providers** offering 24/7 customer assistance or quote requests. SMBs** looking to scale their communication without hiring additional staff. Tech Stack & Requirements n8n** – Workflow automation and orchestration. WhatsApp Cloud API** – For sending and receiving messages. Google Gemini (PaLM)** – For LLM-based transcription and response generation. Pinecone** – Vector database for product and service knowledge retrieval. LangChain Integration** – For connecting memory, vector store, and reasoning tools. Custom Business Rules** – Configurable within the AI Agent node to manage tone, style, and workflow behavior. Key Features Handles both text and voice messages seamlessly. Responds in multiple languages, including English. Maintains conversation memory per user session. Retrieves accurate company-specific information using vector search. Fully automated, with customizable behavior for different industries or use cases. Setup Instructions 1. Prerequisites Before importing the workflow, ensure you have: An active n8n instance (self-hosted or n8n Cloud). WhatsApp Cloud API credentials** from Meta. Google Gemini API key** with model access (for chat and transcription). Pinecone API key** with a preconfigured vector index containing your company data. 2. Environment Setup Install all required credentials under Settings → Credentials in n8n. Add environment variables (if applicable) for keys like: GOOGLE_API_KEY=your_google_gemini_key PINECONE_API_KEY=your_pinecone_key WHATSAPP_ACCESS_TOKEN=your_whatsapp_token 3. Pinecone Configuration Create a Pinecone index named, for example, products-index. Upload company documents or product details as vector embeddings using Gemini or LangChain utilities. Adjust the retrieval limit in the Pinecone node settings for broader or narrower search responses. 4. WhatsApp API Configuration Set up a WhatsApp Business Account via Meta Developer Dashboard. Create a webhook endpoint URL (n8n’s public URL) to receive WhatsApp messages. Use the WhatsApp Trigger Node to capture messages in real time. 5. AI Agent Customization You can personalize how the AI behaves by editing the system prompt inside the AI Agent node: Modify tone, response length, or product focus. Add new “rules” for language preferences or conversation flow. Include links or custom text output (e.g., quotation formats, product catalog messages). 6. Handling Voice Messages Ensure your WhatsApp Business Account has media message permissions enabled. Verify the HTTP Request node that connects to the Gemini API for transcription is correctly authenticated. You can adjust the transcription model or prompt if you prefer shorter, keyword-based outputs. 7. Testing Send both text and voice messages from a test WhatsApp number. Check response time and message formatting. Use n8n’s execution logs to debug errors (especially for media downloads or API credentials). Customization Options 🧩 AI Behavior Modify the AI Agent’s system message to adapt tone and personality (e.g., sales-oriented, support-driven). Update memory length (default: last 20 messages) for longer or shorter conversations. 🌍 Multi-language Support Add or remove allowed languages in the rules section of the AI Agent node. For multilingual businesses, duplicate the AI Agent path and route messages by language detection. 📦 Industry Adaptation Swap the Pinecone dataset to suit different industries — retail, hospitality, logistics, etc. Replace product data with FAQs, customer records, or support documentation.
by Pinecone
Try it out This n8n workflow template lets you chat with your Google Drive documents (.docx, .json, .md, .txt, .pdf) using OpenAI and Pinecone vector database. It retrieves relevant context from your files in real time so you can get accurate, context-aware answers about your proprietary data—without the need to train your own LLM. Not interested in chunking and embedding your own data or figuring out which search method to use? Try our n8n quickstart for Pinecone Assistant here or check out the full workflow to chat with your Google Drive documents here. Prerequisites A Pinecone account A GCP project with Google Drive API enabled and configured An Open AI account and API key A Cohere account and API key Setup Create a Pinecone index in the Pinecone Console here Name your index n8n-dense-index Select OpenAI's text-embedding-3-small Set the Dimension to 1536 Leave everything else as default If you use a different index name, update the related nodes to reflect this change Use the Connect to Pinecone button to authenticate to Pinecone or if you self-host n8n, create a Pinecone credential and add your Pinecone API key directly Setup your Google Drive OAuth2 API, Open AI, and Cohere credentials in n8n Download these files and add them to a Drive folder named n8n-pinecone-demo in the root of your My Drive https://docs.pinecone.io/release-notes/2022.md https://docs.pinecone.io/release-notes/2023.md https://docs.pinecone.io/release-notes/2024.md https://docs.pinecone.io/release-notes/2025.md https://docs.pinecone.io/release-notes/2026.md Activate the workflow or test it with a manual execution to ingest the documents Enter the chat prompts to chat with the Pinecone release notes What support does Pinecone have for MCP? When was fetch by metadata released? Ideas for customizing this workflow Use your own data and adjust the chunking strategy Update the AI Agent System Message to reflect how the Pinecone Vector Store Tool will be used. Be sure to include info on what data can be retrieved using that tool. Update the Pinecone Vector Store Tool Description to reflect what data you are storing in the Pinecone index Need help? You can find help by asking in the Pinecone Discord community or filing an issue on this repo.
by Jonas Frewert
Blog Post Content Creation (Multi-Topic with Brand Research, Google Drive, and WordPress) Description This workflow automates the full lifecycle of generating and publishing SEO-optimized blog posts from a list of topics. It reads topics (and optionally brands) from Google Sheets, performs brand research, generates a structured HTML article via AI, converts it into an HTML file for Google Drive, publishes a draft post on WordPress, and repeats this for every row in the sheet. When the final topic has been processed, a single Slack message is sent to confirm completion and share links. How It Works 1. Input from Google Sheets A Google Sheets node reads rows containing at least: Brand (optional, can be defaulted) Blog Title or Topic A Split In Batches node iterates through the rows one by one so each topic is processed independently. 2. Configuration The Configuration node maps each row’s values into: Brand Blog Title These values are used consistently across brand research, content creation, file naming, and WordPress publishing. 3. Brand Research A Language Model Chain node calls an OpenRouter model to gather background information about the brand and its services. The brand context is used as input for better, on-brand content generation. 4. Content Creation A second Language Model Chain node uses the brand research and the blog title or topic to generate a full-length, SEO-friendly blog article. Output is clean HTML with: Exactly one `` at the top Structured ` and ` headings Semantic tags only No inline CSS No <html> or <body> wrappers No external resources 5. HTML Processing A Code node in JavaScript: Strips any markdown-style code fences around the HTML Normalizes paragraph breaks Builds a safe file name from the blog title Encodes the HTML as a binary file payload 6. Upload to Google Drive A Google Drive node uploads the generated HTML file to a specified folder. Each topic creates its own HTML file, named after the blog title. 7. Publish to WordPress An HTTP Request node calls the WordPress REST API to create a post. The post content is the generated HTML, and the title comes from the Configuration node. By default, the post is created with status draft (can be changed to publish if desired). 8. Loop Control and Slack Notification After each topic is processed (Drive upload and WordPress draft), the workflow loops back to Split In Batches to process the next row. When there are no rows left, an IF node detects that the loop has finished. Only then is a single Slack message sent to: Confirm that all posts have been processed Share links to the last generated Google Drive file and WordPress post Integrations Used OpenRouter - AI models for brand research and SEO content generation Google Sheets - Source of topics and (optionally) brands Google Drive - Storage for generated HTML files WordPress REST API - Blog post creation (drafts or published posts) Slack - Final summary notification when the entire batch is complete Ideal Use Case Content teams and agencies managing a queue of blog topics in a spreadsheet Marketers who want a hands-off pipeline from topic list to WordPress drafts Teams who need generated HTML files stored in Drive for backup, review, or reuse Any workflow where automation should handle the heavy lifting and humans only review the final drafts Setup Instructions Google Sheets Create a sheet with columns like Brand and Blog Title or Topic. In the Get Blog Topics node, set the sheet ID and range to match your sheet. Add your Google Sheets credentials in n8n. OpenRouter (LLM) Add your OpenRouter API key as credentials. In the OpenRouter Chat Model nodes, select your preferred models and options if you want to customize behavior. Google Drive Add Google Drive credentials. Update the folder ID in the Upload file node to your target directory. WordPress In the Publish to WordPress node, replace the example URL with your site’s REST API endpoint. Configure authentication (for example, Application Passwords or Basic Auth). Adjust the status field (draft or publish) to match your desired workflow. Slack Add Slack OAuth credentials. Set the channel ID in the Slack node where the final summary message should be posted. Run the Workflow Click Execute Workflow. The workflow will loop through every row in the sheet, generating content, saving HTML files to Drive, and creating WordPress posts. When all rows have been processed, a single Slack notification confirms completion.
by Thapani Sawaengsri
Description This workflow automates compliance validation between a policy/procedure and a corresponding uploaded document. It leverages an AI agent to determine whether the content of the document aligns with the expectations outlined in the provided procedure or policy. How It Works Document Upload A document (e.g., PDF) is uploaded via an HTTP Request Webhook. The content is processed into vector embeddings using a Qdrant vector store and an embedding model. Procedure Submission A policy/procedure text and description are submitted via a second HTTP Request Webhook. These serve as the basis for evaluating the uploaded document. AI-Based Validation The AI agent receives: The uploaded document (via vector embeddings) The submitted procedure/policy text The description/context It returns a structured compliance analysis including: Summary of Compliance (sections that align with policy) Summary of Non-Compliance (gaps or missing elements) Supporting Text Citations (document evidence) Confidence Level (0–100 score based on evidence quality) Setup Instructions Pre-Conditions / Requirements An n8n instance running with access to: Qdrant (for vector storage) An embedding model (e.g., OpenAI, HuggingFace, or local model) Optional: Microsoft Graph or another storage system for document retrieval. Workflow Setup HTTP Request Node 1: Document Upload Accepts binary document files (PDF, DOCX, etc.). Extracts text, generates embeddings, and stores them in Qdrant. Returns a spDocumentId for reference. HTTP Request Node 2: Procedure Submission Accepts a JSON payload with: { "procedure": "Policy or procedure text", "description": "Brief context or objective", "spDocumentId": "ID of the uploaded document" } Links the procedure to the previously uploaded document. Order of Operations Step 1: Upload the document. Step 2: Submit the procedure referencing the same spDocumentId. Step 3: AI agent evaluates compliance and returns results. Example Input & Output Example Input: Document Upload (Webhook 1) Request: Binary file upload (example_policy.pdf) Response: { "spDocumentId": "12345" } Example Input: Procedure Submission (Webhook 2) { "procedure": "All financial records must be retained for 7 years.", "description": "Retention policy compliance validation", "spDocumentId": "12345" } Example Output: AI Compliance Validation { "compliance_summary": "The document includes a 7-year retention requirement for invoices and payroll records.", "non_compliance_summary": "No reference to retention of vendor contracts.", "citations": [ { "text": "Invoices will be stored for 7 years.", "page": 4 } ], "confidence": 87 }
by Nguyen Thieu Toan
🤖 Build a customer service AI chatbot for Facebook Messenger with Google Gemini 📌 Overview A streamlined Facebook Messenger chatbot powered by AI with conversation memory. This is a simplified version designed for quick deployment, learning, and testing — not suitable for production environments. Base workflows: Smart message batching AI-powered Facebook Messenger chatbot use Data Table Smart human takeover & auto pause AI-powered Facebook Messenger chatbot 🎯 What This Workflow Does ✅ Core Features: Receives messages from Facebook Messenger via webhook Processes user messages with Google Gemini AI Maintains conversation context using Simple Memory node Automatically responds with AI-generated replies Handles webhook verification for Facebook setup Send image or video to customer through Facebook Messenger 🔹 Simplified Approach: Memory**: Simple Memory node (10-message window) Format**: Cleans text, strips markdown, truncates >1900 chars Response**: Single message delivery ⚠️ Limitations & Trade-offs: No Smart Batching → fragmented user messages cause spam-like replies No Human Takeover Detection → bot continues even when admin joins Basic Memory Management → no persistence, not reliable in production Basic Text Formatting → strips markdown, truncates brutally, no smart splitting 🚀 When to Upgrade Upgrade to full workflows when you need: Production deployment with reliability & persistence Analytics & tracking (query history, reports) Professional formatting (bold, italic, lists, code blocks) Handling long messages (>2000 chars) Smart batching for fragmented inputs Human handoff detection Full conversation persistence Key upgrades available: Smart message batching workflow Smart human takeover workflow ⚙️ Setup Requirements Facebook Setup Create Facebook App at developers.facebook.com Add Messenger product Configure webhook: URL: https://your-domain.com/webhook/your-path Verify token: secure string Subscribe to: messages, messaging_postbacks Generate Page Access Token Copy token to "Set Context" node n8n Setup Import workflow Edit "Set Context" node → update page_access_token Configure "Gemini Flash" node credentials Deploy workflow (must be publicly accessible) 🔄 How It Works User Message → Facebook Webhook → Validation ↓ Set Context (extract user_id, message, token) ↓ Mark Seen → Show Typing ↓ AI Agent (Gemini + 10-message memory) ↓ Format Output (remove markdown, truncate) ↓ Send Response via Facebook API 🏗️ Architecture Overview Section 1: Webhook & Initial Processing Facebook Webhook: handles GET (verification) & POST (messages) Confirm Webhook: returns challenge / acknowledges receipt Filters text messages only Blocks echo messages from bot itself Section 2: AI Processing with Memory Set Context: extracts user_id, message, token Seen & Typing: user feedback Conversation Memory: 10-message window, per-user isolation Process Merged Message: AI Agent with Jenix persona Gemini Flash: Google’s AI model for response generation Section 3: Format & Delivery Cuts replies >2000 chars, strips markdown Sends text via Facebook Graph API 🎨 Customisation Guide Bot Personality**: edit system prompt in "Process Merged Message" node Memory**: adjust contextWindowLength (default 10), change sessionKey if needed AI Model**: replace Gemini Flash with OpenAI, Anthropic Claude, or other LLMs 📌 Important Notes ⚠️ Production Warning: testing only, memory lost on n8n restart in queue mode 📊 No Analytics: no history storage, no reporting 🔧 Format Limitations: responses ≤1800 chars, markdown stripped, no complex formatting 🛠️ Troubleshooting Bot not responding** → check token, webhook accessibility, event subscriptions Memory not working** → verify session key, ensure not in queue mode, restart workflow Messages truncated** → adjust system prompt for conciseness, reduce response length 📜 License & Credits Created by: Nguyễn Thiệu Toàn (Jay Nguyen) Email: me@nguyenthieutoan.com Website: nguyenthieutoan.com n8n Creator: n8n.io/creators/nguyenthieutoan Company: GenStaff
by Davide
This workflow implements an AI-powered design and prototyping assistant that integrates Telegram, Google Gemini, and Google Stitch (MCP) to enable conversational UI generation and project management. Supported actions include: Creating new design projects Retrieving existing projects Listing projects and screens Fetching individual screens Generating new UI screens directly from text descriptions Key Advantages 1. ✅ Conversational Design Workflow Design and UI prototyping can be driven entirely through natural language. Users can create screens, explore layouts, or manage projects simply by chatting, without opening design tools. 2. ✅ Tight Integration with Google Stitch By leveraging the Stitch MCP API, the workflow provides direct access to structured design capabilities such as screen generation, project management, and UI exploration, avoiding manual API calls or custom scripting. 3. ✅ Intelligent Tool Selection The AI agent does not blindly call APIs. It first analyzes the user request, determines the required level of fidelity and intent, and then selects the most appropriate Stitch function or combination of functions. 4. ✅ Multi-Channel Support The workflow supports both generic chat triggers and Telegram, making it flexible for internal tools, demos, or production chatbots. 5. ✅ Security and Access Control Telegram access is restricted to a specific user ID, and execution only happens when a dedicated command is used. This prevents accidental or unauthorized usage. 6. ✅ Context Awareness with Memory The inclusion of conversational memory allows the agent to maintain context across interactions, enabling iterative design discussions rather than isolated commands. 7. ✅ Production-Ready Output Formatting Responses are automatically converted into Telegram-compatible HTML, ensuring clean, readable, and well-formatted messages without manual post-processing. 8. ✅ Extensible and Modular Architecture The workflow is highly modular: additional Stitch tools, AI models, or communication channels can be added with minimal changes, making it future-proof and easy to extend. How It Works This workflow functions as a Telegram-powered AI agent that leverages Google Stitch's MCP (Model Context Protocol) tools for design, UI generation, and product prototyping. It combines conversational AI, tool-based actions, and web search capabilities. Trigger & Authorization: The workflow is activated by an incoming message from a configured Telegram bot. A code node first checks the sender's Telegram User ID against a hardcoded value (xxx) to restrict access. Only authorized users can proceed. Command Parsing: An IF node filters messages, allowing the agent to proceed only if the message text starts with the command /stitch. This ensures the agent is only invoked intentionally. Query Preparation: The /stitch prefix is stripped from the message text, and the cleaned query, along with the user's ID (used as a session identifier), is passed to the main agent. AI Agent Execution: The core "Google Stitch Agent" node is an LLM-powered agent (using Google Gemini) equipped with: Tools: Access to several Google Stitch MCP functions (create_project, get_project, list_projects, list_screens, get_screen, generate_screen_from_text) and a Perplexity web search tool. Memory: A conversation buffer window to maintain context within a session. System Prompt: Instructs the agent to intelligently select and use the appropriate Stitch tools based on the user's design-related request (e.g., generating screens from text, managing projects). It is directed to use web search when necessary for additional context. Response Processing & Delivery: The agent's text output (in Markdown) is passed through another LLM chain ("From MD to HTML") that converts it to Telegram-friendly HTML. Finally, the formatted response is sent back to the user via the Telegram bot. Set Up Steps To make this workflow operational, you need to configure credentials and update specific nodes: Telegram Bot Configuration: In the "Code" node (id: 08bfae9e...), replace xxx in the condition $input.first().json.message.from.id !== xxx with your actual Telegram User ID. This ensures only you can trigger the agent. Ensure the "Telegram Trigger" and "Send a text message" nodes have valid Telegram Bot credentials configured. Google Stitch API Setup: Obtain an API key from Google Stitch. Configure the HTTP Header Auth credential named "Google Stitch" (referenced by all MCP tool nodes: Create Project, Get Project, etc.). Set the Header Auth with: Name: X-Goog-Api-Key Value: Your actual Google Stitch API Key (YOUR-API-KEY). AI Model & Tool Credentials: Verify the credentials for the Google Gemini Chat Model nodes are correctly set up for API access. Verify the credentials for the Perplexity API node ("Search on web") are configured if web search functionality is required. Activation: Once all credentials are configured, set the workflow to Active. The Telegram webhook will be registered, and the workflow will listen for authorized messages containing the /stitch command. 👉 Subscribe to my new YouTube channel. Here I’ll share videos and Shorts with practical tutorials and FREE templates for n8n. Need help customizing? Contact me for consulting and support or add me on Linkedin.
by DIGITAL BIZ TECH
Travel Reimbursement - OCR & Expense Extraction Workflow Overview This is a lightweight n8n workflow that accepts chat input and uploaded receipts, runs OCR, stores parsed results in Supabase, and uses an AI agent to extract structured travel expense data and compute totals. Designed for zero retention operation and fast integration. Workflow Structure Frontend:** Chat UI trigger that accepts text and file uploads. Preprocessing:** Binary normalization + per-file OCR request. Storage:** Store OCR-parsed blocks in Supabase temp_table. Core AI:** Travel reimbursement agent that extracts fields, infers missing values, and calculates totals using the Calculator tool. Output:** Agent responds to the chat with a concise expense summary and breakdowns. Chat Trigger (Frontend) Trigger node:** When chat message received public: true, allowFileUploads: true, sessionId used to tie uploads to the chat session. Custom CSS + initial messages configured for user experience. Binary Presence Check Node:** CHECK IF BINARY FILE IS PRESENT OR NOT (IF) Checks whether incoming payload contains files. If files present -> route to Split Out -> NORMALIZE binary file -> OCR (ANY OCR API) -> STORE OCR OUTPUT -> Merge. If no files -> route directly to Merge -> Travel reimbursement agent. Binary Normalization Node:** Split Out and NORMALIZE binary file (Code) Split Out extracts binary entries into a data field. NORMALIZE binary file picks the first binary key and rewrites payload to binary.data for consistent downstream shape. OCR Node:** OCR (ANY OCR API ) (HTTP Request) Sends multipart/form-data to OCR endpoint, expects JSONL or JSON with blocks. Body includes mode=single, output_type=jsonl, include_images=false. Store OCR Output Node:** STORE OCR OUTPUT (Supabase) Upserts into temp_table with session_id, parsed blocks, and file_name. Used by agent to fetch previously uploaded receipts for same session. Memory & Tooling Nodes:** Simple Memory and Simple Memory1 (memoryBufferWindow) Keep last 10 messages for session context. Node:** Calculator1 (toolCalculator) Used by agent to sum multiple charges, handle currency arithmetic and totals. Travel Reimbursement Agent (Core) Node:** Travel reimbursement agent (LangChain agent) Model: Mistral Cloud Chat Model (mistral-medium-latest) Behavior: Parse OCR blocks and non-file chat input. Extract required fields: vendor_name, category, invoice_date, checkin_date, checkout_date, time, currency, total_amount, notes, estimated. When fields are missing, infer logically and mark estimated: true. Use Calculator tool to sum totals across multiple receipts. Fetch stored OCR entries from Supabase when user asks for session summaries. Always attempt extraction; never reply with "unclear" or ask for a reupload unless user requests audit-grade precision. Final output: Clean expense table and Grand Total formatted for chat. Data Flow Summary User sends chat message plus or minus file. IF file present -> Split Out -> Normalize -> OCR -> Store OCR output -> Merge with chat payload. Travel reimbursement agent consumes merged item, extracts fields, uses Calculator tool for sums, and replies with a formatted expense summary. Integrations Used | Service | Purpose | Credential | |---------|---------|-----------| | Mistral Cloud | LLM for agent | Mistral account | | Supabase | Store parsed OCR blocks and session data | Supabase account | | OCR API | Text extraction from images/PDFs | Configurable HTTP endpoint | | n8n Core | Flow control, parsing, editing | Native | Agent System Prompt Summary > You are a Travel Expense Extraction and Calculation AI. Extract vendor, dates, currency, category, and total amounts from uploaded receipts, invoices, hotel bills, PDFs, and images. Infer values when necessary and mark them as estimated. When asked, fetch session entries from Supabase and compute totals using the Calculator tool. Respond in a concise business professional format with a category wise breakdown and a Grand Total. Never reply "unclear" or ask for a reupload unless explicitly asked. Required final response format example: Key Features Zero retention friendly design: OCR output stored only to temp_table per session. Robust extraction with inference when OCR quality is imperfect. Session aware: agent retrieves stored receipts for consolidated totals. Calculator integration for accurate numeric sums and currency handling. Configurable OCR endpoint so you can swap providers without changing logic. Setup Checklist Add Mistral Cloud and Supabase credentials. Configure OCR endpoint to accept multipart uploads and return blocks. Create temp_table schema with session_id, file, file_name. Test with single receipts, multipage PDFs, and mixed uploads. Validate agent responses and Calculator totals. Summary A practical n8n workflow for travel expense automation: accept receipts, run OCR, store parsed data per session, extract structured fields via an AI agent, compute totals, and return clean expense summaries in chat. Built for reliability and easy integration. Need Help or More Workflows? We can integrate this into your environment, tune the agent prompt, or adapt it for different OCR providers. We can help you set it up for free — from connecting credentials to deploying it live. Contact: shilpa.raju@digitalbiz.tech Website: https://www.digitalbiz.tech LinkedIn: https://www.linkedin.com/company/digital-biz-tech/ You can also DM us on LinkedIn for any help.