Belgacem Dhiflaoui
Workflows by Belgacem Dhiflaoui
Automated lead capture & business Q&A with GPT-4o, Pinecone, and Google Sheets
## What Problem Does This Solve? This workflow automates the end-to-end process of capturing company information from Google Drive, storing it semantically in Pinecone, and interacting with users via an intelligent AI chatbot. It eliminates the need for manual customer service, lead tracking, and company information retrieval—offering a fully automated, intelligent engagement system. #### Perfect for teams that need to: * Maintain accurate, AI-readable company knowledge bases * Answer customer inquiries 24/7 using AI * Automatically collect and log lead information * Embed a chatbot into their website to assist potential customers --- #### Target Audience: Sales teams, business owners, marketing departments, customer support reps, startup founders, or anyone looking to automate AI-powered lead generation and customer engagement. --- ### What Does It Do? #### Part One – Knowledge Ingestion * **Monitors** a Google Drive folder for new .txt or document uploads. * **Downloads** the document and splits the content into manageable chunks using a recursive character splitter. * **Generates** embeddings via OpenAI. * **Stores** the embeddings in a Pinecone vector database under the Q&A namespace. * **Purpose:** This knowledge base is later used to answer business-related questions through AI. #### Part Two – AI Chatbot Engagement * **Listens** for incoming chat messages using n8n’s `chatTrigger` node. * **Activates an AI agent** (powered by GPT-4o) to respond to inquiries regarding business hours, services, products, or general company info. * **Retrieves knowledge** using a vector search tool connected to Pinecone (newCompany_q). * **Captures leads:** If a user shows interest, the AI collects and stores: * Name * Email * Phone number * Specific interest into a connected Google Sheet automatically. --- ### Key Features 🔄 Google Drive integration for real-time file processing * 🧠 OpenAI embedding + Pinecone vector store for semantic memory * 🤖 LangChain agent with tool-based reasoning * 🗃️ Google Sheets integration for dynamic lead storage * 💬 GPT-4o model for accurate, human-like conversation * ⚙️ Modular design to expand into CRM, Notion, or email workflows * 🌐 Website-ready chatbot endpoint --- ### 🧰 Setup Instructions **Prerequisites:** * n8n instance (cloud or self-hosted) * Google Drive account (for uploading company data) * Pinecone account (for vector storage) * OpenAI API key * Google Sheets access with OAuth2 credentials --- ### 📦 Installation Steps **1. Import the Workflow** Upload the JSON files into your n8n instance. **2. Configure Credentials** In n8n > Credentials, connect: * Google Drive * OpenAI * Pinecone * Google Sheets **3. Set Pinecone Index & Namespace Example:** * Index: `comanyName` * Namespace: `Q&A` **4. Test the Flow** * Upload a sample `.txt` or `pdf` file to the monitored Drive folder. * Send a message to the chatbot (e.g., "What are your opening hours?"). * Check the Google Sheet for collected user info. --- ### How It Works (Behind the Scenes) **Part 1 – Data Preparation:** 1. Company files are uploaded to Google Drive. 2. File is detected, downloaded, and chunked. 3. Embeddings are created using OpenAI. 4. Data is stored in Pinecone for semantic retrieval. **Part 2 – Chat Interaction:** 1. A chat message triggers the workflow via webhook. 2. The AI agent interprets the intent and accesses company data via `newCompany_q`. 3. If lead data is gathered, it is appended to a Google Sheet using the AI-parsed values. --- ### Need help customizing? [Contact me](mailto:[email protected]) for consulting and support or add me on [Linkedin.](https://www.linkedin.com/in/belgacem-dhiflaoui/)
Personalized email automation using Google Docs, Pinecone, GPT-4o and Gmail
**What Problem Does This Solve?** 🛠️ This workflow automates the process of extracting information from a Google Doc, storing it in a Pinecone vector database, and using it to personalize and send emails based on user input via chat. It eliminates the manual steps of gathering recipient data, writing messages, and dispatching emails providing a fully automated, intelligent communication system. Perfect for teams that need to: * Maintain dynamic contact lists * Personalize bulk or contextual email outreach * Use chat interfaces to trigger intelligent email actions --- **Target Audience:** Sales teams, marketing departments, HR staff, startup founders, or anyone looking to automate AI-powered communication workflows. --- **What Does It Do?** 🌟 * Extracts content from a Google Docs document (e.g., a list of contacts or structured notes) * Splits, embeds, and stores that content in Pinecone for semantic search * Listens for incoming chat messages using n8n's chatTrigger * Uses LangChain agents with OpenAI to: * Search Pinecone for contextually relevant information (e.g., email addresses) * Compose personalized emails based on instructions * Sends emails using the Gmail API, triggered dynamically from the AI output --- **Key Features** 📋 * Google Docs integration for live document data * Embedding & vector search with Pinecone for AI lookups * Custom LangChain agents with tool calling logic (search + send) * Full support for OpenAI models (GPT-4o) * Personalized email generation with dynamic name and message filling * Modular design: plug-and-play with other tools like CRMs, Notion, etc. --- **Setup Instructions** **Prerequisites** * **n8n Instance:** Self-hosted or cloud instance * **Google Docs Account:** For reading input content * **Pinecone Account:** For storing document data semantically * **OpenAI Account:** For generating embeddings and messages * **Gmail Account:** With Gmail OAuth2 credentials for sending emails --- **Installation Steps** 📦 **1. Import the Workflow** Import the provided JSON files into your n8n instance. **2.Configure Credentials** Go to **n8n > Credentials**, and set up: * **Google Docs API** * **OpenAI API** * **Pinecone API** * **Gmail OAuth2** **3. Set Your Pinecone Index & Namespace** Ensure you have a working Pinecone index (e.g., n8ndocs) and namespace (e.g., docsmail). **4. Test the Full Flow** * Run the Google Docs → Pinecone embedding workflow to prepare data. * Send a message to the chatTrigger endpoint (e.g., "Send an offer to User"). * Check the execution log to verify correct tool usage and Gmail delivery. --- **How It Works** 🔍 **1. Data Preparation:** * Google Doc content is fetched and chunked. * OpenAI embeddings are created. * Data is stored in Pinecone under a specific namespace. **2. Chat Trigger:** * A webhook captures chat input. * The LangChain agent interprets the user request. * The agent uses two tools: * Vectorstore_mails: Retrieves relevant emails via Pinecone vector search * send_mail: Uses an internal n8n sub-workflow to send Gmail messages **3. Mail Generation & Delivery:** * Email is personalized using recipient info (name/email from Pinecone) * Message follows a clean, friendly format with clear subject and closing * Delivered via Gmail integration
Resume data extraction and storage in Supabase from email attachments
### Description **What Problem Does This Solve? 🛠️** This workflow automates the process of extracting key information from resumes received as email attachments and storing that data in a structured format within a Supabase database. It eliminates the manual effort of reviewing each resume, identifying relevant details, and entering them into a database. This streamlines the hiring process, making it faster and more efficient for recruiters and HR professionals. **Target audience**: Recruiters, HR departments, and talent acquisition teams. **What Does It Do? 🌟** * Monitors a designated email inbox for new messages with resume attachments. * Extracts key information such as name, contact details, education, work experience, and skills from the attached resumes. * Cleans and formats the extracted data. * Stores the processed data securely in a Supabase database. ### Key Features 📋 * Automatic email monitoring for resume attachments. * Intelligent data extraction from various resume formats (e.g., PDF, DOC, DOCX). * Customizable data fields to capture specific information. * Seamless integration with Supabase for data storage. * Uses **OpenRouter** to streamline API key management for services such as AI-powered parsing. ### Setup Instructions **Prerequisites ⚙️** * **n8n Instance**: Self-hosted or cloud instance of n8n. * **Email Account**: Gmail account with Gmail API access for receiving resumes. * **Supabase Account**: A Supabase project with a database/table ready to store extracted resume data. You'll need the Supabase URL and API key. * **OpenRouter Account**: For managing AI model API keys centrally when using LLM-based resume parsing. ### **Installation Steps 📦** **1. Import the Workflow**: * Copy the exported workflow JSON. * Import it into your n8n instance via **“Import from File”** or **“Import from URL”**. **2. Configure Credentials**: * In **n8n > Credentials**, add credentials for: - **Email account (Gmail API)**: Provide Client ID and Client Secret from the Google Cloud Platform. - **Supabase**: Provide the Supabase URL and the anon public API key. - **OpenRouter (Optional)**: Add your OpenRouter API key for use with any AI-powered resume parsing nodes. * Assign these credentials to their respective nodes: - **Gmail Trigger** → Email credentials. - **Supabase Insert** → Supabase credentials. - **AI Parsing Node** → OpenRouter credentials. **3. Set Up Supabase Table**: Create a table in Supabase with columns such as: `name`, `email`, `phone`, `education`, `experience`, `skills`, `received_date`, etc. Make sure the field names align with the structure used in your workflow. **4. Customize Nodes:** * **Parsing Node(s):** Modify the workflow to use an **OpenAI model** directly for field extraction, replacing the **Basic LLM Chain** node that utilizes OpenRouter. **5. Test the Workflow:** * Send a test email with a resume attachment. * Check n8n's execution log to confirm the workflow triggered, parsed the data, and inserted it into Supabase. * Verify data integrity in your Supabase table. ### **How It Works** **High-Level Workflow 🔍** 1. **Email Monitoring:** Triggered when a new email with an attachment is received (via Gmail API). 2. **Attachment Check:** Verifies the email contains at least one attachment. 3. **Prepare Data:** Extracts the attachment and prepares it for analysis. 4. **Data Extraction:** Uses OpenRouter-powered LLM (if configured) to extract structured information from the resume. 5. **Data Storage:** The structured information is saved into the Supabase database. ### **Node Names and Actions (Example)** * **Gmail Trigger:** Triggers when a new email is received. * **IF**: Checks whether the received email includes any attachments. * **Get Attachments:** Retrieves attachments from the triggering email. * **Prepare Data:** Prepares the attachment content for processing. * **Basic LLM Chain:** Uses an AI model via OpenRouter to extract relevant resume data and returns it as structured fields. * **Supabase-Insert:** Inserts the structured resume data into your Supabase database.