2 templates found
Category:
Author:
Sort:

Gmail email classifier with GPT-4 auto-generated draft replies

How It Works This workflow automatically classifies incoming Gmail messages into categories such as High Priority, Inquiry, and Finance/Billing, and then generates professional draft replies using GPT-4. By combining Gmail integration with AI-powered text generation, the workflow helps business owners and freelancers reduce the time spent managing emails while ensuring that important messages are handled quickly and consistently. When a new email arrives, the workflow: Triggers via Gmail. Uses an AI classifier to categorize the message. Applies the appropriate Gmail label. Passes the email body to GPT-4 to generate a tailored draft reply. Saves the draft in Gmail, ready for review and sending. Requirements A Gmail account with API access enabled. An OpenAI API key with GPT-4 access. n8n account or self-hosted instance. Setup Instructions Import this workflow into your n8n instance. Under Credentials, connect your Gmail account and OpenAI API key. Replace placeholder YOURLABELID_XXX values with your Gmail label IDs (obtainable via Gmail → List Labels). Execute the workflow and check that draft replies are generated in your Gmail account. Customization Add or edit categories to fit your business needs (e.g., “Sales Leads” or “Support”). Adjust the GPT-4 prompts inside each “Generate Draft” node to match your preferred tone and style. Combine with other workflows (e.g., CRM integration, Slack alerts) for a complete email automation system. This template is especially useful for small businesses and freelancers who want to save time, improve response speed, and maintain professional communication without manually writing every reply.

Supira Inc.By Supira Inc.
740

Create an AI Telegram bot using Google Drive, Qdrant, and OpenAI GPT-4.1

How it works This workflow creates an intelligent Telegram bot with a knowledge base powered by Qdrant vector database. The bot automatically processes documents uploaded to Google Drive, stores them as embeddings, and uses this knowledge to answer questions in Telegram. It consists of two independent flows: document processing (Google Drive → Qdrant) and chat interaction (Telegram → AI Agent → Telegram). Step-by-step Document Processing Flow: New File Trigger: The workflow starts when the New File Trigger node detects a new file created in the specified Google Drive folder (polling every 15 minutes). Download File: The Download File (Google Drive) node downloads the detected file from Google Drive. Text Splitting: The Split Text into Chunks node splits the document text into chunks of 3000 characters with 300 character overlap for optimal embedding. Load Document Data: The Load Document Data node processes the binary file data and prepares it for vectorization. OpenAI Embeddings: The OpenAI Embeddings node generates vector embeddings for each text chunk. Insert into Qdrant: The Insert into Qdrant node stores the embeddings in the Qdrant vector database collection. Move to Processed Folder: After successful processing, the Move to Processed Folder (Google Drive) node moves the file to a "Qdrant Ready" folder to keep files organized. Telegram Chat Flow: Telegram Message Trigger: The Telegram Message Trigger node receives new messages from the Telegram bot. Filter Authorized User: The Filter Authorized User node checks if the message is from an authorized chat ID (26899549) to restrict bot access. AI Agent Processing: The AI Agent receives the user's message text and processes it using the fine-tuned GPT-4.1 model with access to the Qdrant knowledge base tool. Qdrant Knowledge Base: The Qdrant Knowledge Base node retrieves relevant information from the vector database to provide context for the AI agent's responses. Conversation Memory: The Conversation Memory node maintains conversation history per chat ID, allowing the bot to remember context. Send Response to Telegram: The Send Response to Telegram node sends the AI-generated response back to the user in Telegram. Set up steps Estimated set up time: 15 minutes Google Drive Setup: Add your Google Drive OAuth2 credentials to the New File Trigger, Download File, and Move to Processed Folder nodes. Create two folders in your Google Drive: one for incoming files and one for processed files. Copy the folder IDs from the URLs and update them in the New File Trigger (folderToWatch) and Move to Processed Folder (folderId) nodes. Qdrant Setup: Add your Qdrant API credentials to the Insert into Qdrant and Qdrant Knowledge Base nodes. Create a collection in your Qdrant instance (e.g., "Test-youtube-adept-ecom"). Update the collection name in both Qdrant nodes. OpenAI Setup: Add your OpenAI API credentials to the OpenAI Chat Model and OpenAI Embeddings nodes. (Optional) Replace the fine-tuned model ID in OpenAI Chat Model with your own model or use a standard model like gpt-4-turbo. Telegram Setup: Create a Telegram bot via @BotFather and obtain the bot token. Add your Telegram bot credentials to the Telegram Message Trigger and Send Response to Telegram nodes. Update the authorized chat ID in the Filter Authorized User node (replace 26899549 with your Telegram user ID). Customize System Prompt (Optional): Modify the system message in the AI Agent node to customize your bot's personality and behavior. The current prompt is configured for an n8n automation expert creating social media content. Activate the Workflow: Toggle "Active" in the top-right to enable both the Google Drive trigger and Telegram trigger. Upload a document to your Google Drive folder to test the document processing flow. Send a message to your Telegram bot to test the chat interaction flow.

KonstantinBy Konstantin
167
All templates loaded