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 SpaGreen Creative
WhatsApp Number Verify & Confirmation System with Rapiwa API and Google Sheets Who is this for? This n8n workflow makes it easy to verify WhatsApp numbers submitted through a form. When someone fills out the form, the automation kicks in—capturing the data via a webhook, checking the WhatsApp number using the Rapiwa API, and sending a confirmation message if the number is valid. All submissions, whether verified or not, are logged into a Google Sheet with a clear status. It’s a great solution for businesses, marketers, or developers who need a reliable way to verify leads, manage event signups, or onboard customers using WhatsApp. How it works? This n8n automation listens for form submissions via a webhook, validates the provided WhatsApp number using the Rapiwa API, sends a confirmation message if the number is verified, and then appends the submission data to a Google Sheet, marking each entry as verified or unverified. Features Webhook Trigger**: Captures form submissions via HTTP POST Data Cleaning**: Formats and sanitizes the WhatsApp number Rapiwa API Integration**: Checks if the number is registered on WhatsApp Conditional Messaging**: Sends confirmation messages only to verified WhatsApp users Google Sheets Integration**: Appends all submissions with a validity status Auto Timestamping**: Adds the submission date in YYYY-MM-DD format Throttling Support**: Built-in delay to avoid hitting API or sheet rate limits Separation of Verified/Unverified**: Distinct handling for both types of entries Nodes Used in the Workflow Webhook** Format Webhook Response Data** (Code) Loop Over Items** (Split In Batches) Cleane Number** (Code) check valid whatsapp number** (HTTP Request) If** (Conditional) Send Message Using Rapiwa** verified append row in sheet** (Google Sheets) unverified append row in sheet** (Google Sheets) Wait1** How to set up? Webhook Add a Webhook node to the canvas. Set HTTP Method to POST. Copy the Webhook URL path (/a9b6a936-e5f2-4xxxxxxxxxe0a970d5). In your frontend form or app, make a POST request to: The request body should include: { "business_name": "ABC Corp", "location": "New York", "whatsapp": "+1 234-567-8901", "email": "user@example.com", "name": "John Doe" } Format Webhook Response Data Add a Code node after the Webhook node. Use this JavaScript code: const result = $input.all().map(item => { const body = item.json.body || {}; const submitted_date = new Date().toISOString().split('T')[0]; return { business_name: body.business_name, location: body.location, whatsapp: body.whatsapp, email: body.email, name: body.name, submitted_date: submitted_date }; }); return result; Loop Over Items Insert a SplitInBatches node after the data formatting. Set the Batch Size to a reasonable number (e.g. 1 or 10). This is useful for processing multiple submissions at once, especially if your webhook receives arrays of entries. Note: If you expect only one submission at a time, it still helps future-proof your workflow. Cleane Number Add a Code node named Cleane Number. Paste the following JavaScript: const items = $input.all(); const updatedItems = items.map((item) => { const waNo = item?.json["whatsapp"]; const waNoStr = typeof waNo === 'string' ? waNo : (waNo !== undefined && waNo !== null ? String(waNo) : ""); const cleanedNumber = waNoStr.replace(/\D/g, ""); item.json["whatsapp"] = cleanedNumber; return item; }); return updatedItems; Check WhatsApp Number using Rapiwa Add an HTTP Request node. Set: Method: POST URL: https://app.rapiwa.com/api/verify-whatsapp Add authentication: Type: HTTP Bearer Credentials: Select or create Rapiwa token In Body Parameters, add: number: ={{ $json.whatsapp }} This API call checks if the WhatsApp number exists and is valid. Expected Output: { "success": true, "data": { "number": "+88017XXXXXXXX", "exists": true, "jid": "88017XXXXXXXXXXXXX", "message": "✅ Number is on WhatsApp" } } Conditional If Check Add an If node after the Rapiwa validation. Configure the condition: Left Value: ={{ $json.data.exists }} Operation: true If true → valid number → go to messaging and append as "verified". If false → go to unverified sheet directly. Note: This step branches the flow based on the WhatsApp verification result. Send WhatsApp Message (Rapiwa) Add an HTTP Request node under the TRUE branch of the If node. Set: Method: POST URL: https://app.rapiwa.com/api/send-message Authentication: Type: HTTP Bearer Use same Rapiwa token Body Parameters: number: ={{ $json.data.phone }} message_type: text message: Hi {{ $('Cleane Number').item.json.name }}, Thanks! Your form has been submitted successfully. This sends a confirmation message via WhatsApp to the verified number. Google Sheets – Verified Data Add a Google Sheets node under the TRUE branch (after the message is sent). Set: Operation: Append Document ID: Choose your connected Google Sheet Sheet Name: Set to your active sheet (e.g., Sheet1) Column Mapping: Business Name: ={{ $('Cleane Number').item.json.business_name }} Location: ={{ $('Cleane Number').item.json.location }} WhatsApp Number: ={{ $('Cleane Number').item.json.whatsapp }} Email : ={{ $('Cleane Number').item.json.email }} Name: ={{ $('Cleane Number').item.json.name }} Date: ={{ $('Cleane Number').item.json.submitted_date }} validity: verified Use OAuth2 Google Sheets credentials for access. Note: Make sure the sheet has matching column headers. Google Sheets – Unverified Data Add a Google Sheets node under the FALSE branch of the If node. Use the same settings as the verified node, but set: validity: unverified This stores entries with unverified WhatsApp numbers in the same Google Sheet. Wait Node Add a Wait node after both Google Sheets nodes. Set Wait Time: Value: 2 seconds This delay prevents API throttling and adds buffer time before processing the next item in the batch. Google Sheet Column Reference A Google Sheet formatted like this ➤ Sample Sheet | Business Name | Location | WhatsApp Number | Email | Name | validity | Date | |---------------------|--------------------|------------------|----------------------|------------------|------------|------------| | SpaGreen Creative | Dhaka, Bangladesh | 8801322827799| contact@spagreen.net | Abdul Mannan | unverified | 2025-09-14 | | SpaGreen Creative | Bagladesh | 8801322827799| contact@spagreen.net| Abdul Mannan | verified | 2025-09-14 | > Note: The Email column includes a trailing space. Ensure your column headers match exactly to prevent data misalignment. How to customize the workflow Modify confirmation message with your brand tone Add input validation for missing or malformed fields Route unverified submissions to a separate spreadsheet or alert channel Add Slack or email notifications on new verified entries Notes & Warnings Ensure your Google Sheets credential has access to the target sheet Rapiwa requires an active subscription for API access Monitor Rapiwa API limits and adjust wait time as needed Keep your webhook URL protected to avoid misuse Support & Community WhatsApp Support: Chat Now Discord: Join SpaGreen Community Facebook Group: SpaGreen Support Website: spagreen.net Developer Portfolio: Codecanyon SpaGreen
by Zain Khan
Categories: Business Automation, Customer Support, AI, Knowledge Management This comprehensive workflow enables businesses to build and deploy a custom-trained AI Chatbot in minutes. By combining a sophisticated data scraping engine with a RAG-based (Retrieval-Augmented Generation) chat interface, it allows you to transform website content into a high-performance support agent. Powered by Google Gemini and Pinecone, this system ensures your chatbot provides accurate, real-time answers based exclusively on your business data. Benefits Instant Knowledge Sync** - Automatically crawls sitemaps and URLs to keep your AI up-to-date with your latest website content. Embeddable Anywhere** - Features a ready-to-use chat trigger that can be integrated into the bottom-right of any website via a simple script. High-Fidelity Retrieval** - Uses vector embeddings to ensure the AI "searches" your documentation before answering, reducing hallucinations. Smart Conversational Memory** - Equipped with a 10-message window buffer, allowing the bot to handle complex follow-up questions naturally. Cost-Efficient Scaling** - Leverages Gemini’s efficient API and Pinecone’s high-speed indexing to manage thousands of customer queries at a low cost. How It Works Dual-Path Ingestion: The process begins with an n8n Form where you provide a sitemap or individual URLs. The workflow automatically handles XML parsing and URL cleaning to prepare a list of pages for processing. Clean Content Extraction: Using Decodo, the workflow fetches the HTML of each page and uses a specialized extraction node to strip away code, ads, and navigation, leaving only the high-value text content. SignUp using: dashboard.decodo.com/register?referral_code=55543bbdb96ffd8cf45c2605147641ee017e7900. Vectorization & Storage: The cleaned text is passed to the Gemini Embedding model, which converts the information into 3076-dimensional vectors. These are stored in a Pinecone "supportbot" index for instant retrieval. RAG-Powered Chat Agent: When a user sends a message through the chat widget, an AI Agent takes over. It uses the user's query to search the Pinecone database for relevant business facts. Intelligent Response Generation: The AI Agent passes the retrieved facts and the current chat history to Google Gemini, which generates a polite, accurate, and contextually relevant response for the user. Requirements n8n Instance:** A self-hosted or cloud instance of n8n. Google Gemini API Key:** For text embeddings and chat generation. Pinecone Account:** An API key and a "supportbot" index to store your knowledge base. Decodo Access:** For high-quality website content extraction. How to Use Initialize the Knowledge Base: Use the Form Trigger to input your website URL or Sitemap. Run the ingestion flow to populate your Pinecone index. Configure Credentials: Authenticate your Google Gemini and Pinecone accounts within n8n. Deploy the Chatbot: Enable the Chat Trigger node. Use the provided webhook URL to connect the backend to your website's frontend chat widget. Test & Refine: Interact with the bot to ensure it retrieves the correct data, and update your knowledge base by re-running the ingestion flow whenever your website content changes. Business Use Cases Customer Support Teams** - Automate answers to 80% of common FAQs using your existing documentation. E-commerce Sites** - Help customers find product details, shipping policies, and return information instantly. SaaS Providers** - Build an interactive technical documentation assistant to help users navigate your software. Marketing Agencies** - Offer "AI-powered site search" as an add-on service for client websites. Efficiency Gains Reduce Ticket Volume** by providing instant self-service options. Eliminate Manual Data Entry** by scraping content directly from the live website. Improve UX** with 24/7 availability and zero wait times for customers. Difficulty Level: Intermediate Estimated Setup Time: 30 min Monthly Operating Cost: Low (variable based on AI usage and Pinecone tier)
by Dean Pike
Transcript → AI Analysis → Formatted Doc This workflow automatically converts Fathom meeting transcripts into beautifully formatted Google Docs with AI-generated summaries, key points, decisions, and action items. Good to know Works fully with Fathom free account Webhook responds immediately to prevent Fathom timeout and duplicate triggers Validates transcript quality (3+ conversation turns) before AI processing to save costs Uses Google Gemini API (generous free tier and rate limits, typically enough to avoid paying for API requests, but check latest pricing at Google AI Pricing) Creates temporary HTML file that's auto-deleted after conversion Who's it for Individuals or teams using Fathom for meetings who want more control and flexibility with their AI meeting analysis and storage independently of Fathom, as well as automatic, formatted documentation without manual note-taking. Perfect for recurring syncs, client meetings, or interview debriefs. How it works Fathom webhook triggers when meeting ends and sends transcript data Validates transcript has meaningful conversation (3+ turns) Google Gemini AI analyzes transcript and generates structured summary (key points, decisions, actions, next steps) Creates formatted HTML with proper styling Uploads to Google Drive and converts to native Google Doc Reduces page margins for readability and deletes temporary HTML file Requirements Fathom account with API webhook access (available on free tier) Google Drive account (OAuth2) Google Docs account (OAuth2) Google Gemini API key (Get free key here) How to set up Add credentials: Google Drive OAuth2, Google Docs OAuth2, Google Gemini API Copy the webhook URL from the Get Fathom Meeting webhook node (Test URL first, change to Production URL when ready) In Fathom: Settings → API Access → Add → Add webhook URL and select all events including "Transcript" Test with a short meeting, verify Google Doc appears in Drive Activate workflow Customizing this workflow Change save location: Edit "Upload File as HTML" node → update "Parent Folder" Modify AI output: Edit "AI Meeting Analysis" node → customize the prompt to add/remove sections (e.g., risks, follow-ups, sentiment, etc) Adjust document margins: Edit "Reduce Page Margins" node → change margin pixel values Add notifications: E.g. add Slack/Email node after "Convert to Google Doc" to notify team when summary is ready Quick Troubleshooting "Transcript Present?" fails: Fathom must send transcript_merged with 3+ conversation turns (i.e. only send to Gemini for analysis if there's a genuine transcript) HTML as plain text: Check "Convert to Google Doc" uses POST to /copy endpoint 401/403 errors: Re-authorize Google credentials Inadequate meeting notes: Edit prompts in "AI Meeting Analysis" node Sample File and Storage Output Google Doc meeting notes - sample Google Drive sample folder output:
by Hemanth Arety
Handle WhatsApp customer inquiries with AI and intent routing (Whatsapp Chatbot) An intelligent, fully customizable WhatsApp customer support chatbot template that works for ANY business - whether you sell fashion, electronics, food, furniture, cosmetics, or anything else. This workflow combines pre-built responses for common queries with AI for complex questions, creating a cost-effective 24/7 customer support solution that adapts to your specific products and services. Who it's for This universal template works for ANY business type: E-commerce stores** (fashion, electronics, home goods, beauty, etc.) Local retail shops** (boutiques, grocery stores, bookshops, etc.) Service businesses** (salons, repair services, consultancies, etc.) Restaurants & cafes** (food delivery, reservations, menu inquiries) Any business** using WhatsApp Business API for customer communication What it does This is a UNIVERSAL template - it works for ANY business by simply updating the product categories, company information, and response templates. No coding knowledge required for basic customization! The workflow automates WhatsApp customer support through intelligent routing and AI assistance: Receives WhatsApp messages via WhatsApp Business API webhook trigger Parses message data extracting user info, chat ID, and message text Classifies intent using pattern matching to determine what the customer wants (product inquiry, contact info, support, greeting, etc.) Routes intelligently to the most appropriate response handler: Product inquiries → Pre-built catalog responses with pricing and links Contact information → Static company details (address, phone, hours) Complex queries → AI agent with full company context Maintains conversation context using memory to remember previous messages Sends formatted responses back to the customer via WhatsApp with markdown formatting The hybrid approach (pre-built responses + AI) balances speed, cost, and intelligence - common questions get instant answers while complex queries receive personalized AI assistance. How to set up Requirements You'll need: WhatsApp Business API** access (via Twilio, 360Dialog, Meta Cloud API, or other providers) Google Gemini API key** (for AI responses) - Get API key Google Docs** (optional - for product catalog reference) n8n instance** with WhatsApp nodes installed Setup Steps Configure WhatsApp Business API Sign up with a WhatsApp Business API provider (Twilio, 360Dialog, or Meta) Get your API credentials (phone number ID, access token, webhook verify token) Add credentials to n8n's WhatsApp node Copy the webhook URL from n8n and configure it in your provider's dashboard Customize Company Information Open the "Build AI System Prompt" node Replace all placeholder text with your actual company details: Company name Address and phone numbers Email and website Product categories and brands Policies (COD, warranty, returns, delivery) Store hours Configure Product Responses Edit the "Generate Product Response" node Replace the sample products with your actual catalog: Product names and specifications Prices (update currency if not using INR) Product URLs from your website Add/remove product categories as needed Update Contact Details Edit the "Generate Contact Info Response" node Add your complete contact information Update store hours and addresses Set Up AI Credentials Add your Google Gemini API key to the credential manager (Optional) Connect Google Docs if you want to use a product catalog document Activate and Test Activate the workflow in n8n Send test messages to your WhatsApp Business number Test different intents: greetings, product questions, contact requests Verify responses are accurate and timely WhatsApp Business API Providers Option 1: Meta Cloud API (Official, free for moderate usage) Sign up at: https://developers.facebook.com/ Requires Facebook Business account Best for: Small to medium businesses Option 2: Twilio (Reliable, paid service) Sign up at: https://www.twilio.com/whatsapp Pay-per-message pricing Best for: Businesses needing high reliability Option 3: 360Dialog (WhatsApp-focused) Sign up at: https://www.360dialog.com/ Competitive pricing Best for: WhatsApp-heavy businesses Option 4: MessageBird, Vonage, others Various pricing and features Research and compare based on your needs How it works Intent Classification System The workflow uses keyword pattern matching to classify user intent into these categories: Priority 1: Contact Information (highest priority) Triggers: "where is store", "address", "contact", "phone number" Response: Static contact details Why first: Users asking for contact info need immediate, accurate answers Priority 2: Greetings Triggers: "hi", "hello", "hey", "good morning" Response: Friendly welcome with menu options Helps: Sets a positive tone for the conversation Priority 3: Product Inquiries Triggers: Category keywords (monitor, processor, GPU, RAM, etc.) Response: Pre-built catalog with products, prices, and links Categories: Customizable based on your products Priority 4: AI Fallback Triggers: Everything else (comparisons, complex questions, multi-step queries) Response: Google Gemini AI with company knowledge Features: Conversation memory, personalized recommendations Response Architecture Pre-Built Responses (Fast & Cost-Effective) Instant answers (no API calls) Handles 70-80% of queries Consistent, accurate information No ongoing costs Used for: Product lists, contact info, FAQs AI Agent (Intelligent & Flexible) Handles complex questions Maintains conversation context Provides personalized recommendations Adapts to different query styles Used for: Comparisons, custom builds, technical questions Conversation Memory The workflow uses buffer window memory to remember recent conversation: Stores last 10 messages per user Enables multi-turn conversations AI can reference previous questions Creates more natural interactions Memory is user-specific (isolated by user ID) Message Flow Example User: "Hi" → Intent: greeting → Response: Welcome message with menu User: "Show me monitors" → Intent: product_inquiry (monitors) → Response: Pre-built list of monitors with prices User: "Which one is best for gaming?" → Intent: general_inquiry (complex) → Response: AI analyzes previous context (monitors) and recommends gaming-focused option User: "What's your address?" → Intent: contact_info → Response: Complete contact details How to customize the workflow STEP 1: Customize Product Categories The workflow comes with example categories for multiple business types. Replace them with YOUR categories: For a Fashion Store: const categories = [ { pattern: /(shirt|tshirt|top)/i, category: 'tops' }, { pattern: /(jeans|pants|trousers)/i, category: 'bottoms' }, { pattern: /(dress|gown|kurti)/i, category: 'dresses' }, { pattern: /(shoe|footwear|heels)/i, category: 'shoes' }, ]; For a Grocery Store: const categories = [ { pattern: /(vegetable|veggies)/i, category: 'vegetables' }, { pattern: /(fruit|fruits)/i, category: 'fruits' }, { pattern: /(dairy|milk|cheese)/i, category: 'dairy' }, { pattern: /(snack|chips|biscuit)/i, category: 'snacks' }, ]; For a Beauty/Cosmetics Store: const categories = [ { pattern: /(skincare|cream|serum)/i, category: 'skincare' }, { pattern: /(makeup|lipstick|foundation)/i, category: 'makeup' }, { pattern: /(perfume|fragrance)/i, category: 'perfumes' }, { pattern: /(hair|shampoo|conditioner)/i, category: 'haircare' }, ]; For a Home Furniture Store: const categories = [ { pattern: /(sofa|couch)/i, category: 'sofas' }, { pattern: /(bed|mattress)/i, category: 'bedroom' }, { pattern: /(table|desk|dining)/i, category: 'tables' }, { pattern: /(chair|seating)/i, category: 'chairs' }, ]; For a Restaurant: const categories = [ { pattern: /(pizza|italian)/i, category: 'italian' }, { pattern: /(burger|sandwich)/i, category: 'fast_food' }, { pattern: /(biryani|curry|indian)/i, category: 'indian' }, { pattern: /(dessert|sweet|ice cream)/i, category: 'desserts' }, ]; STEP 2: Customize Product Responses Update the "Generate Product Response" node with YOUR actual products: Example for Fashion Store: if (category === 'tops') { response = Hi ${userName}! Check out our TOPS collection:\\n\\n; response += 👕 Cotton Casual T-Shirt\\n 💰 ₹499\\n 🎨 5 colors available\\n 🔗 yourstore.com/tshirts\\n\\n; response += 👚 Formal Shirt\\n 💰 ₹899\\n 🎉 Buy 2 Get 20% OFF\\n 🔗 yourstore.com/shirts\\n\\n; } Example for Grocery Store: if (category === 'vegetables') { response = Fresh VEGETABLES available, ${userName}:\\n\\n; response += 🥕 Fresh Carrots (1kg)\\n 💰 ₹40\\n 🌱 Organic\\n\\n; response += 🍅 Tomatoes (1kg)\\n 💰 ₹30\\n ✅ Farm Fresh\\n\\n; } Example for Restaurant: if (category === 'italian') { response = Delicious ITALIAN dishes, ${userName}:\\n\\n; response += 🍕 Margherita Pizza\\n 💰 ₹299\\n 👨🍳 Chef's Special\\n\\n; response += 🍝 Creamy Alfredo Pasta\\n 💰 ₹349\\n 🔥 Bestseller\\n\\n; } STEP 3: Update Company Information Edit the "Build AI System Prompt" node: For a Boutique: const systemPrompt = `You are a customer service assistant for Elegant Threads Boutique. COMPANY INFORMATION: Business: Women's Designer Clothing Boutique Products: Ethnic wear, western wear, accessories Price Range: ₹1,500 - ₹15,000 Speciality: Custom tailoring available Store Address: Shop 12, Fashion Street, Mumbai Phone: +91 98XXXXXXXX Delivery: Pan-Mumbai, 2-3 days Returns: 7-day no-questions-asked return policy `; For a Tech Store: const systemPrompt = `You are customer support for TechHub Electronics. COMPANY INFORMATION: Business: Consumer Electronics Retailer Products: Smartphones, laptops, accessories, home appliances Price Range: ₹500 - ₹2,00,000 Speciality: Same-day delivery in Delhi NCR Warranty: Extended warranty on all electronics Store: Connaught Place, New Delhi Phone: +91 11-XXXXXXXX `; For a Bakery: const systemPrompt = `You are the assistant for Sweet Delights Bakery. COMPANY INFORMATION: Business: Fresh Baked Goods & Custom Cakes Products: Cakes, pastries, cookies, bread Price Range: ₹50 - ₹3,000 Speciality: Custom cakes for all occasions (24hrs notice) Store: Baker Street, Bangalore Phone: +91 80-XXXXXXXX Delivery: Free above ₹500 within 5km `; Additional Customization Options Change AI Model Replace Google Gemini with other LLM providers: OpenAI GPT-4**: Best for nuanced understanding Anthropic Claude**: Strong at following instructions Llama** (self-hosted): Cost-effective for high volume Simply swap the "Google Gemini Chat Model" node with your preferred model. Add More Intents Extend the intent classification in the "Classify User Intent" node: // Add order tracking if (/track.order|order.status|where.*order/i.test(text)) { intent = 'order_tracking'; } // Add complaint handling if (/complaint|unhappy|problem|issue|refund/i.test(text)) { intent = 'complaint'; } // Add shipping questions if (/shipping|delivery|courier|when.*arrive/i.test(text)) { intent = 'shipping_inquiry'; } Then add corresponding response nodes in the routing switch. Integrate with CRM Connect to HubSpot: Add HubSpot node after intent classification Log every conversation as a ticket Create contacts automatically Track customer journey Connect to Salesforce: Use Salesforce node to create leads Update opportunity stages based on intent Log interactions in Activity History Connect to Airtable: Store conversations in Airtable database Analyze common questions Build knowledge base from real conversations Add Multi-Language Support Method 1: Google Translate API Detect message language Translate to English for processing Translate response back to user's language Method 2: Multilingual AI Add language preference to AI prompt Train AI on multilingual responses Support major languages natively Rich Media Responses Send images: return [{ chatId: chatId, image: 'https://yoursite.com/product.jpg', caption: 'Check out this product!' }]; Send documents: Product catalogs (PDF) Warranty cards Invoice copies Installation guides Send location pins: Store locations Delivery tracking Service centers Human Handoff Logic Add escalation for complex issues: // Check if AI can't help if (complexityScore > 8 || sentiment === 'angry') { // Notify human agent // Transfer conversation // Set status: 'awaiting_agent' } Integrate with: Intercom for live chat handoff Slack for agent notifications Zendesk for ticket creation Connect to Inventory Real-time stock checking: Query your database for availability Show "In Stock" / "Out of Stock" status Suggest alternatives for unavailable products Notify customers when items are restocked Dynamic pricing: Pull current prices from database Apply promotional discounts automatically Show time-sensitive offers Add Analytics Track metrics: Messages per day/week/month Most common intents AI usage vs. pre-built responses Average response time Customer satisfaction scores Integration options: Google Analytics for website tracking Mixpanel for event tracking Custom dashboard in Grafana Google Sheets for simple logging Business Hours Management Add business hours logic: const now = new Date(); const hour = now.getHours(); const isBusinessHours = (hour >= 10 && hour < 20); // 10 AM - 8 PM if (!isBusinessHours) { return [{ response: "We're currently closed. Our hours are 10 AM - 8 PM. We'll respond when we open!" }]; } A/B Testing Responses Test different response styles: Formal vs. casual tone With/without emojis Short vs. detailed answers Different CTAs Track which versions lead to more sales/conversions. Tips for best results 1. Start Simple Begin with 3-5 main intents Add more as you see common patterns Don't over-complicate the initial setup 2. Monitor and Iterate Review conversations weekly Identify missed intents Refine pattern matching Update product information regularly 3. Balance Pre-Built vs. AI Use pre-built for: FAQs, product lists, contact info (fast, cheap) Use AI for: Comparisons, complex queries, personalization (slower, costs money) Aim for 70-80% pre-built, 20-30% AI 4. Optimize Response Times Pre-built responses are instant AI responses take 2-5 seconds Set user expectations ("Let me check that for you...") 5. Test Different Scenarios Happy path (normal inquiries) Edge cases (misspellings, slang) Multi-turn conversations Multiple topics in one message 6. Keep Responses Concise WhatsApp users prefer short messages Use formatting (bold, bullets) for readability Break long responses into multiple messages 7. Maintain Brand Voice Customize AI system prompt with your brand personality Use consistent tone across all responses Include brand-appropriate emojis 8. Handle Failures Gracefully Add error handling for API failures Have fallback responses ready Always offer human contact option 9. Respect Privacy Don't store sensitive information Comply with GDPR/local privacy laws Allow users to delete their data 10. Monitor Costs Track Gemini API usage Set spending alerts Optimize prompt length to reduce token usage Common use cases across industries Fashion & Apparel Store Answer size and fit questions Share new collection arrivals Check stock availability by size/color Process exchange requests Share styling tips Electronics & Tech Store Provide product specifications Compare different models Check warranty information Share installation guides Handle technical support queries Grocery & Food Store Check product availability Share daily fresh stock updates Take bulk orders Provide recipe suggestions Handle delivery slot bookings Beauty & Cosmetics Recommend products for skin types Share ingredient information Explain usage instructions Handle shade/color queries Process return for wrong products Home Furniture Store Share dimensions and specifications Check delivery timelines Provide assembly instructions Schedule store visits Custom furniture inquiries Restaurant & Cafe Share menu and prices Take table reservations Handle takeaway orders Answer dietary restriction questions Share daily specials Jewelry Store Share designs and prices Book appointments for trials Check customization options Verify metal purity/certifications Handle repair inquiries Bookstore Check book availability Take pre-orders for new releases Recommend books by genre Share reading lists Handle exchange requests Important Notes: This workflow requires WhatsApp Business API (not regular WhatsApp Business app) WhatsApp Business API typically requires business verification Message rates and limits vary by provider Test thoroughly before deploying to customers Always provide a way to reach human support Getting Started Tip: Start with just contact info and product inquiries. Once that works smoothly, add AI responses for complex queries. Gradually expand based on actual customer needs you observe in conversations.
by Avkash Kakdiya
How it works This workflow enriches and personalizes your lead profiles by integrating HubSpot contact data, scraping social media information, and using AI to generate tailored outreach emails. It streamlines the process from contact capture to sending a personalized email — all automatically. The system fetches new or updated HubSpot contacts, verifies and enriches their Twitter/LinkedIn data via Phantombuster, merges the profile and engagement insights, and finally generates a customized email ready for outreach. Step-by-step 1. Trigger & Input HubSpot Contact Webhook: Fires when a contact is created or updated in HubSpot. Fetch Contact: Pulls the full contact details (email, name, company, and social profiles). Update Google Sheet: Logs Twitter/LinkedIn usernames and marks their tracking status. 2. Validation Validate Twitter/LinkedIn Exists: Checks if the contact has a valid social profile before proceeding to scraping. 3. Social Media Scraping (via Phantombuster) Launch Profile Scraper & 🎯 Launch Tweet Scraper: Triggers Phantombuster agents to fetch profile details and recent tweets. Wait Nodes: Ensures scraping completes (30–60 seconds). Fetch Profile/Tweet Results: Retrieves output files from Phantombuster. Extract URL: Parses the job output to extract the downloadable .json or .csv data file link. 4. Data Download & Parsing Download Profile/Tweet Data: Downloads scraped JSON files. Parse JSON: Converts the raw file into structured data for processing. 5. Data Structuring & Merging Format Profile Fields: Maps stats like bio, followers, verified status, likes, etc. Format Tweet Fields: Captures tweet data and associates it with the lead’s email. Merge Data Streams: Combines tweet and profile datasets. Combine All Data: Produces a single, clean object containing all relevant lead details. 6. AI Email Generation & Delivery Generate Personalized Email: Feeds the merged data into OpenAI GPT (via LangChain) to craft a custom HTML email using your brand details. Parse Email Content: Cleans AI output into structured subject and body fields. Sends Email: Automatically delivers the personalized email to the lead via Gmail. Benefits Automated Lead Enrichment — Combines CRM and real-time social media data with zero manual research. Personalized Outreach at Scale — AI crafts unique, relevant emails for each contact. Improved Engagement Rates — Targeted messages based on actual social activity and profile details. Seamless Integration — Works directly with HubSpot, Google Sheets, Gmail, and Phantombuster. Time & Effort Savings — Replaces hours of manual lookup and email drafting with an end-to-end automated flow.
by WeblineIndia
Automated Social Media Lead Processing with AI Summaries, Slack Alerts & Jira Ticketing This workflow automatically collects new lead messages from social media platforms, LinkedIn or web forms, filters relevant marketing inquiries using keywords, classifies and summarizes the lead with AI, logs it to Google Sheets, creates a Jira task and sends Slack notifications. Additionally, it generates weekly lead reports for team insights. It reduces manual triage, ensures no valid inquiry is missed and keeps your team updated with both immediate notifications and summary reports. Quick Start – Implementation Steps Connect your webhook to your social media inbox, LinkedIn, Twitter or web form. Add your OpenAI, Google Sheets, Jira and Slack credentials. Enable the workflow. Send a test message to confirm Google Sheets logging, Slack notification and Jira task creation. Activate the scheduler for weekly reports to track lead performance. What It Does This workflow performs the following key tasks: Filters incoming messages for marketing-related keywords like ad request, promo request, collaboration, partnership or social media inquiry. Uses OpenAI GPT to classify the lead into categories such as Sales, Support, Partnership, Influencer Inquiry or General Lead. Generates a short AI summary of the message. Logs structured lead data to Google Sheets, including username, source, category, summary and timestamp. Creates a Jira task automatically with summary, description, category and received time. Sends a Slack notification to alert the team instantly. Runs a scheduled workflow that aggregates weekly leads and sends a weekly report to Slack. This ensures a structured, automated pipeline for capturing, summarizing and assigning leads efficiently. Who’s It For Marketing and sales teams managing leads from social media and web forms. Agencies handling client campaigns and inquiries. Businesses that want automated notifications and ticketing. Teams using Slack and Jira for daily operations. Requirements to Use This Workflow n8n account or self-hosted instance. Webhook-enabled social media inbox or lead form. OpenAI API Key. Slack Bot Token with channel posting permission. Jira Software Cloud API credentials. Google Sheets credentials. Predefined keyword list for filtering messages. How It Works & Setup Steps 1. Get DM (Webhook Trigger) Receives new messages from social media or web forms and starts the workflow. 2. Lead Keyword Filter (Code Node) Filters incoming messages for predefined marketing keywords and removes irrelevant or spam messages. 3. AI Lead Classifier (OpenAI Node) Classifies the lead into categories (Sales, Support, Partnership, Influencer Inquiry, General Lead) and generates a one-line summary using GPT-4.1. 4. AI Output Parser (Code Node) Parses AI JSON output and merges it with original message data, adding timestamp and structured fields. 5. Store Lead (Google Sheets Node) Logs structured lead data to Google Sheets including username, source, category, summary and timestamp. 6. Create Task (Jira Node) Automatically creates a Jira story or task in your selected project with the AI summary, category and timestamp. 7. Send a Summary (Slack Node) Sends a formatted message to your selected Slack channel, alerting your team of the new lead. 8. Weekly Reporting Schedule Trigger** – triggers the weekly reporting workflow. Extract Lead Data** – fetches all logged leads from Google Sheets. Weekly Lead Filter** – filters data to include leads from the last week. Report Data Formatter** – calculates total leads, category counts, source counts and example leads. Weekly Report Slack** – sends a formatted weekly lead summary to Slack. How to Customize Nodes Keyword Filter Add or remove keywords in the JavaScript code to match your specific lead types or campaigns. AI Classification Update the OpenAI prompt for different summary lengths, tones, or lead categories. Google Sheets Logging Map additional columns like email, phone or campaign source as needed. Jira Fields Customize summary, description, labels, priority or assignees based on your project requirements. Slack Message Format Modify emojis, line breaks and formatting to suit your team’s Slack notifications. Add-Ons (Extend the Workflow) Send email alerts for high-priority leads. Trigger WhatsApp replies using an API provider. Integrate with CRMs like HubSpot, Zoho or Salesforce. Add sentiment analysis to detect frustrated or VIP users. Automate daily or weekly analytics reports to Slack. Use Case Examples Collecting Instagram, LinkedIn and Twitter DMs and logging them to Google Sheets. Creating automated Jira tickets for marketing inquiries. Sending instant Slack notifications for new leads. Filtering out irrelevant messages and only processing valid marketing leads. Generating weekly lead summary reports for team review. Troubleshooting Guide | Issue | Possible Cause | Solution | |-------|----------------|----------| | No leads appearing | Webhook not receiving messages | Check webhook URL and ensure messages are sent correctly | | AI summary empty | OpenAI API key invalid or model limit reached | Regenerate API key / check usage | | Jira task not created | Missing required Jira fields or incorrect project ID | Add required fields or update Jira project settings | | Slack message not sent | Wrong channel ID or missing permissions | Reconnect Slack credentials | | Filter passes 0 items | Keywords do not match | Update or expand keyword list in filter node | Need Help? If you need assistance setting up this workflow, customizing nodes, building add-ons or automating more processes, our n8n workflow development team at WeblineIndia is happy to help. We can guide you through integrations, scaling or building end-to-end automation systems tailored to your business.
by explorium
Inbound Agent - AI-Powered Lead Qualification with Product Usage Intelligence This n8n workflow automatically qualifies and scores inbound leads by combining their product usage patterns with deep company intelligence. The workflow pulls new leads from your CRM, analyzes which API endpoints they've been testing, enriches them with firmographic data, and generates comprehensive qualification reports with personalized talking points—giving your sales team everything they need to prioritize and convert high-quality leads. DEMO Template Demo Credentials Required To use this workflow, set up the following credentials in your n8n environment: Salesforce Type:** OAuth2 or Username/Password Used for:** Pulling lead reports and creating follow-up tasks Alternative CRM options: HubSpot, Zoho, Pipedrive Get credentials at Salesforce Setup Databricks (or Analytics Platform) Type:** HTTP Request with Bearer Token Header:** Authorization Value:** Bearer YOUR_DATABRICKS_TOKEN Used for:** Querying product usage and API endpoint data Alternative options: Datadog, Mixpanel, Amplitude, custom data warehouse Explorium API Type:** Generic Header Auth Header:** Authorization Value:** Bearer YOUR_API_KEY Used for:** Business matching and firmographic enrichment Get your API key at Explorium Dashboard Explorium MCP Type:** HTTP Header Auth Used for:** Real-time company intelligence and supplemental research Connect to: https://mcp.explorium.ai/mcp Anthropic API Type:** API Key Used for:** AI-powered lead qualification and analysis Get your API key at Anthropic Console Go to Settings → Credentials, create these credentials, and assign them in the respective nodes before running the workflow. Workflow Overview Node 1: When clicking 'Execute workflow' Manual trigger that initiates the lead qualification process. Type:** Manual Trigger Purpose:** On-demand execution for testing or manual runs Alternative Trigger Options: Schedule Trigger:** Run automatically (hourly, daily, weekly) Webhook:** Trigger on CRM updates or new lead events CRM Trigger:** Real-time activation when leads are created Node 2: GET SF Report Pulls lead data from a pre-configured Salesforce report. Method:** GET Endpoint:** Salesforce Analytics Reports API Authentication:** Salesforce OAuth2 Returns: Raw Salesforce report data including: Lead contact information Company names Lead source and status Created dates Custom fields CRM Alternatives: This node can be replaced with HubSpot, Zoho, or any CRM's reporting API. Node 3: Extract Records Parses the Salesforce report structure and extracts individual lead records. Extraction Logic: Navigates report's factMap['T!T'].rows structure Maps data cells to named fields Node 4: Extract Tenant Names Prepares tenant identifiers for usage data queries. Purpose: Formats tenant names as SQL-compatible strings for the Databricks query Output: Comma-separated, quoted list: 'tenant1', 'tenant2', 'tenant3' Node 5: Query Databricks Queries your analytics platform to retrieve API usage data for each lead. Method:** POST Endpoint:** /api/2.0/sql/statements Authentication:** Bearer token in headers Warehouse ID:** Your Databricks cluster ID Platform Alternatives: Datadog:** Query logs via Logs API Mixpanel:** Event segmentation API Amplitude:** Behavioral cohorts API Custom Warehouse:** PostgreSQL, Snowflake, BigQuery queries Node 6: Split Out Splits the Databricks result array into individual items for processing. Field:** result.data_array Purpose:** Transform single response with multiple rows into separate items Node 7: Rename Keys Normalizes column names from database query to readable field names. Mapping: 0 → TenantNames 1 → endpoints 2 → endpointsNum Node 8: Extract Business Names Prepares company names for Explorium enrichment. Node 9: Loop Over Items Iterates through each company for individual enrichment. Node 10: Explorium API: Match Businesses Matches company names to Explorium's business entity database. Method:** POST Endpoint:** /v1/businesses/match Authentication:** Header Auth (Bearer token) Returns: business_id: Unique Explorium identifier matched_businesses: Array of potential matches Match confidence scores Node 11: Explorium API: Firmographics Enriches matched businesses with comprehensive company data. Method:** POST Endpoint:** /v1/businesses/firmographics/bulk_enrich Authentication:** Header Auth (Bearer token) Returns: Company name, website, description Industry categories (NAICS, SIC, LinkedIn) Size: employee count range, revenue range Location: headquarters address, city, region, country Company age and founding information Social profiles: LinkedIn, Twitter Logo and branding assets Node 12: Merge Combines API usage data with firmographic enrichment data. Node 13: Organize Data as Items Structures merged data into clean, standardized lead objects. Data Organization: Maps API usage by tenant name Maps enrichment data by company name Combines with original lead information Creates complete lead profile for analysis Node 14: Loop Over Items1 Iterates through each qualified lead for AI analysis. Batch Size:** 1 (analyzes leads individually) Purpose:** Generate personalized qualification reports Node 15: Get many accounts1 Fetches the associated Salesforce account for context. Resource:** Account Operation:** Get All Filter:** Match by company name Limit:** 1 record Purpose: Link lead qualification back to Salesforce account for task creation Node 16: AI Agent Analyzes each lead to generate comprehensive qualification reports. Input Data: Lead contact information API usage patterns (which endpoints tested) Firmographic data (company profile) Lead source and status Analysis Process: Evaluates lead quality based on usage, company fit, and signals Identifies which Explorium APIs the lead explored Assesses company size, industry, and potential value Detects quality signals (legitimate company email, active usage) and red flags Determines optimal sales approach and timing Connected to Explorium MCP for supplemental company research if needed Output: Structured qualification report with: Lead Score:** High Priority, Medium Priority, Low Priority, or Nurture Quick Summary:** Executive overview of lead potential API Usage Analysis:** Endpoints used, usage insights, potential use case Company Profile:** Overview, fit assessment, potential value Quality Signals:** Positive indicators and concerns Recommended Actions:** Next steps, timing, and approach Talking Points:** Personalized conversation starters based on actual API usage Node 18: Clean Outputs Formats the AI qualification report for Salesforce task creation. Node 19: Update Salesforce Records Creates follow-up tasks in Salesforce with qualification intelligence. Resource:** Task Operation:** Create Authentication:** Salesforce OAuth2 Alternative Output Options: HubSpot:** Create tasks or update deal stages Outreach/SalesLoft:** Add to sequences with custom messaging Slack:** Send qualification reports to sales channels Email:** Send reports to account owners Google Sheets:** Log qualified leads for tracking Workflow Flow Summary Trigger: Manual execution or scheduled run Pull Leads: Fetch new/updated leads from Salesforce report Extract: Parse lead records and tenant identifiers Query Usage: Retrieve API endpoint usage data from analytics platform Prepare: Format data for enrichment Match: Identify companies in Explorium database Enrich: Pull comprehensive firmographic data Merge: Combine usage patterns with company intelligence Organize: Structure complete lead profiles Analyze: AI evaluates each lead with quality scoring Format: Structure qualification reports for CRM Create Tasks: Automatically populate Salesforce with actionable intelligence This workflow eliminates manual lead research and qualification, automatically analyzing product engagement patterns alongside company fit to help sales teams prioritize and personalize their outreach to the highest-value inbound leads. Customization Options Flexible Triggers Replace the manual trigger with: Schedule:** Run hourly/daily to continuously qualify new leads Webhook:** Real-time qualification when leads are created CRM Trigger:** Activate on specific lead status changes Analytics Platform Integration The Databricks query can be adapted for: Datadog:** Query application logs and events Mixpanel:** Analyze user behavior and feature adoption Amplitude:** Track product engagement metrics Custom Databases:** PostgreSQL, MySQL, Snowflake, BigQuery CRM Flexibility Works with multiple CRMs: Salesforce:** Full integration (pull reports, create tasks) HubSpot:** Contact properties and deal updates Zoho:** Lead enrichment and task creation Pipedrive:** Deal qualification and activity creation Enrichment Depth Add more Explorium endpoints: Technographics:** Tech stack and product usage News & Events:** Recent company announcements Funding Data:** Investment rounds and financial events Hiring Signals:** Job postings and growth indicators Output Destinations Route qualification reports to: CRM Updates:** Salesforce, HubSpot (update lead scores/fields) Task Creation:** Any CRM task/activity system Team Notifications:** Slack, Microsoft Teams, Email Sales Tools:** Outreach, SalesLoft, Salesloft sequences Reporting:** Google Sheets, Data Studio dashboards AI Model Options Swap AI providers: Default: Anthropic Claude (Sonnet 4) Alternatives: OpenAI GPT-4, Google Gemini Setup Notes Salesforce Report Configuration: Create a report with required fields (name, email, company, tenant ID) and use its API endpoint Tenant Identification: Ensure your product usage data includes identifiers that link to CRM leads Usage Data Query: Customize the SQL query to match your database schema and table structure MCP Configuration: Explorium MCP requires Header Auth—configure credentials properly Lead Scoring Logic: Adjust AI system prompts to match your ideal customer profile and qualification criteria Task Assignment: Configure Salesforce task assignment rules or add logic to route to specific sales reps This workflow acts as an intelligent lead qualification system that combines behavioral signals (what they're testing) with firmographic fit (who they are) to give sales teams actionable intelligence for every inbound lead.
by Zain Ali
🧠 RAG with Full Gmail history + Real time email updates in RAG using OpenAI & Qdrant > Summary: > This workflow listens for new Gmail messages, extracts and cleans email content, generates embeddings via OpenAI, stores them in a Qdrant vector database, and then enables a Retrieval‑Augmented‑Generation (RAG) agent to answer user queries against those stored emails. It’s designed for teams or bots that need conversational access to past emails. 🧑🤝🧑 Who’s it for Support teams** who want to surface past customer emails in chatbots or help‑desk portals Sales ops** that need AI‑powered summaries and quick lookup of email histories Developers** building RAG agents over email archives ⚙️ How it works / What it does Trigger Gmail Trigger polls every minute for new messages. Fetch & Clean Get Mail Data pulls full message metadata and body. Code node normalizes the body (removes line breaks, collapses spaces). Embed & Store Embeddings OpenAI node computes vector embeddings. Qdrant Vector Store inserts embeddings + metadata into the emails_history collection. Batch Processing SplitInBatches handles large inbox loads in chunks of 50. RAG Interaction When chat message received → RAG Agent → uses Qdrant Email Vector Store as a tool to retrieve relevant email snippets before responding. Memory Simple Memory buffer ensures the agent retains recent context. 🛠️ How to set up n8n Instance Deploy n8n (self‑hosted or via Coolify/Docker). Credentials Create an OAuth2 credential in n8n for Gmail (with Gmail API scopes). Add your OpenAI API key in n8n credentials. Qdrant Stand up a Qdrant instance (self‑hosted or Qdrant Cloud). Note your host, port, and API key (if any). Import Workflow In n8n, go to Workflows → Import → paste the JSON you provided. Ensure each credential reference (Gmail & OpenAI) matches your n8n credential IDs. Test Click Execute Workflow or send a test email to your Gmail. Monitor n8n logs: you should see new points in Qdrant and RAG responses. 📋 Requirements n8n** (Self-hosted or Cloud) Gmail API** enabled on a Google Cloud project OpenAI API** access (with Embedding & Chat endpoints) Qdrant** (hosted or cloud) with a collection named emails_history 🎨 How to customize the workflow Change Collection Name** Update the qdrantCollection.value in all Qdrant nodes if you prefer a different collection. Adjust Polling Frequency** In the Gmail Trigger node, switch from everyMinute to everyFiveMinutes or a webhook‑style trigger. Metadata Tags** In Enhanced Default Data Loader, tweak the metadataValues to tag by folder, label, or sender domain. Batch Size** In SplitInBatches, change batchSize to suit your inbox volume. RAG Agent Prompt** Customize the systemMessage in the RAG Agent node to set the assistant’s tone, instruct on date handling, or add additional tools. Additional Tools** Chain other n8n nodes (e.g., Slack, Discord) after the RAG Agent to broadcast AI answers to team channels.
by phil
This workflow is designed for B2B professionals to automatically identify and summarize business opportunities from a company's website. By leveraging Bright Data's Web Unblocker and advanced AI models from OpenRouter, it scrapes relevant company pages ("About Us", "Team", "Contact"), analyzes the content for potential pain points and needs, and synthesizes a concise, actionable report. The final output is formatted for direct use in documents, making it an ideal tool for sales, marketing, and business development teams to prepare for prospecting calls or personalize outreach. Who's it for This template is ideal for: B2B Sales Teams:** Quickly find and qualify leads by identifying specific business needs before a cold call. Marketing Agencies:** Develop personalized content and value propositions based on a prospect's public website information. Business Development Professionals:** Efficiently research potential partners or clients and discover collaboration opportunities. Entrepreneurs:** Gain a competitive edge by understanding a competitor's strategy or a potential client's operations. How it works The workflow is triggered by a chat message, typically a URL from an n8n chat application. It uses Bright Data to scrape the website's sitemap and extract all anchor links from the homepage. An AI agent analyzes the extracted URLs to filter for pages relevant to company information (e.g., "about-us," "team," "contact"). The workflow then scrapes the content of these specific pages. A second AI agent summarizes the content of each page, looking for business opportunities related to AI-powered automation. The summaries are merged and a final AI agent synthesizes them into a single, cohesive report, formatted for easy reading in a Google Doc. How to set up Bright Data Credentials: Sign up for a Bright Data account and create a Web Unblocker zone. In n8n, create new Bright Data API credentials and copy your API key. OpenRouter Credentials: Create an account on OpenRouter and get your API key. In n8n, create new OpenRouter API credentials and paste your key. Chat Trigger Node: Configure the "When chat message received" node. Copy the production webhook URL to integrate with your preferred chat platform. Requirements An active n8n instance. A Bright Data account with a Web Unblocker zone. An OpenRouter account with API access. How to customize this workflow AI Prompting:** Edit the "systemMessage" parameters in the "AI Agent", "AI Agent1", and "AI Agent2" nodes to change the focus of the opportunity analysis. For example, modify the prompts to search for specific technologies, industry jargon, or different types of business challenges. Model Selection:** The workflow uses openai/o4-mini and openai/gpt-5. You can change these to other models available on OpenRouter by editing the model parameter in the OpenRouter Chat Model nodes. Scraping Logic:** The extract url node uses a regular expression to find `` tags. This can be modified or replaced with an HTML Extraction node to target different elements or content on a website. Output Format:** The final output is designed for Google Docs. You can modify the last "AI Agent2" node's prompt to generate the output in a different format, such as a simple JSON object or a markdown list. Phil | Inforeole 🇫🇷 Contactez nous pour automatiser vos processus
by Emir Belkahia
This workflow helps Customer Success Managers and customer success professionals quickly gather intelligence on clients or prospects by analyzing their recent LinkedIn activity via a simple Slack command. Who's it for CSMs, Account Managers, and Sales professionals who need fast, structured insights about a person's LinkedIn presence before a call, meeting, or outreach. What it does (and doesn't do) ✅ It DOES: Fetch recent LinkedIn posts from any profile Analyze posting frequency and cadence patterns Identify top themes and focus areas Extract recent highlights with context Generate a clean HTML report sent via email ❌ It DOESN'T: Access private/non-public LinkedIn content Provide real-time updates (it's a snapshot) Replace actual researches when needed Think of it as: Your personal LinkedIn research assistant that turns a name into actionable intelligence in under a minute. How it works Slack command - Type /check-linkedin [Full Name] in Slack Name validation - AI verifies you provided a full name (not just "John") Profile discovery - Finds the correct LinkedIn profile via Apify Content scraping - Pulls their recent posts (last 20) AI analysis - GPT-4.1 analyzes posting patterns, topics, and highlights Report generation - Creates a formatted HTML email report Email delivery - Sends the intelligence brief to your inbox Set up steps Setup time: ~15 minutes Create or use your existing Slack app and add a Slash Command (it can be done here https://api.slack.com/apps) Configure the webhook URL in your Slack app Connect credentials: Slack OAuth Apify API OpenAI API Gmail OAuth Update the email recipient in "Send report via Email" node Test with a known LinkedIn profile Requirements Slack workspace (with app installation permissions) Apify account with credits OpenAI API key (GPT-4.1 access) Gmail account Apify actors: LinkedIn Profile Finder LinkedIn Post Scraper Cost estimation ~$0.05-0.09 per profile check. You could research 11-20 people for $1. ⚠️ Cost Disclaimer: The costs displayed above are indicative only and may vary significantly depending on which n8n actors you select. Some actors incur monthly charges—for example, one of the two actors used in this workflow costs $35/month. So, I recommend using this actor only when there's a clear business need for it. For cost optimization, consider switching to alternative actors that can deliver similar / simpler functionality at a lower cost. If you plan to use this workflow extensively, I strongly suggest performing a budget assessment and evaluating other actor options to maximize cost efficiency. The workflow uses GPT-4.1-mini for lightweight classification and GPT-4.1 for the heavy analysis to balance quality and cost. Known Limitations Common names have limited accuracy: Very common names (e.g., "John Smith") often fail to identify the correct person accurately. An improved version could support company name in the slash command as an additional input to help narrow down results and improve first-try matching accuracy. 💡 Pro tips Check before important meetings: Run this 15-30 minutes before a call. The email report gives you conversation starters and context about what they care about. Batch your research: If you have multiple clients or prospects, queue them up. Just remember each lookup costs ~$0.05-0.09. Watch your Apify credits: The LinkedIn scrapers are the main cost driver. Monitor your Apify usage if you're doing high volume. Don't spam the same profile: LinkedIn may rate-limit. Space out repeat checks on the same person by at least a few hours. Review the "Quick Scan" section first: The email report starts with key stats and top focus areas. Perfect for a 30-second pre-call prep. What to do after the workflow runs Check your email - Report arrives in 30-90 seconds Review the report - Latest post date, cadence, and top themes Read Recent Activity Summary - High-level overview of their content Dive into Detailed Analysis - Two main topics with keywords and rationale Use it strategically: Reference their recent posts in your outreach Ask about topics they're clearly passionate about Tailor your pitch to their demonstrated interests Avoid generic "saw you on LinkedIn" messages Questions or Feedback? 📧 emir.belkahia@gmail.com 💼 linkedin.com/in/emirbelkahia
by TOMOMITSU ASANO
Intelligent Invoice Processing with AI Classification and XML Export Summary Automated invoice processing pipeline that extracts data from PDF invoices, uses AI Agent for intelligent expense categorization, generates XML for accounting systems, and routes high-value invoices for approval. Detailed Description A comprehensive accounts payable automation workflow that monitors for new PDF invoices, extracts text content, uses AI to classify expenses and detect anomalies, converts to XML format for accounting system integration, and implements approval workflows for high-value or unusual invoices. Key Features PDF Text Extraction**: Extract from File node parses invoice PDFs automatically AI-Powered Classification**: AI Agent categorizes expenses, suggests GL codes, detects anomalies XML Export**: Convert structured data to accounting-compatible XML format Approval Workflow**: Route invoices over $5,000 or low confidence for human review Multi-Trigger Support**: Google Drive monitoring or manual webhook upload Comprehensive Logging**: Archive all processed invoices to Google Sheets Use Cases Accounts payable automation Expense report processing Vendor invoice management Financial document digitization Audit trail generation Required Credentials Google Drive OAuth (for PDF source folder) OpenAI API key Slack Bot Token Gmail OAuth Google Sheets OAuth Node Count: 24 (19 functional + 5 sticky notes) Unique Aspects Uses Extract from File node for PDF text extraction (rarely used) Uses XML node for JSON to XML conversion (very rare) Uses AI Agent node for intelligent classification Uses Google Drive Trigger for file monitoring Implements approval workflow with conditional routing Webhook response** mode for API integration Workflow Architecture [Google Drive Trigger] [Manual Webhook] | | +----------+-----------+ | v [Filter PDF Files] | v [Download Invoice PDF] | v [Extract PDF Text] | v [Parse Invoice Data] (Code) | v [AI Invoice Classifier] <-- [OpenAI Chat Model] | v [Parse AI Classification] | v [Convert to XML] | v [Format XML Output] | v [Needs Approval?] (If) / \ Yes (>$5000) No (Auto) | | [Email Approval] [Slack Notify] | | +------+-------+ | v [Archive to Google Sheets] | v [Respond to Webhook] Configuration Guide Google Drive: Set folder ID to monitor in Drive Trigger node Approval Threshold: Default $5,000, adjust in "Needs Approval?" node Email Recipients: Configure finance-approvers@example.com Slack Channel: Set #finance-notifications for updates GL Codes: AI suggests codes; customize in AI prompt if needed Google Sheets: Configure document for invoice archive