AI-Powered Email Automation with Multilingual Metadata Generation
detail.loadingPreview
Automates email sending with AI, utilizing Pinecone for contact management and generating multilingual metadata for structured data.
About This Workflow
This workflow orchestrates an AI-powered email automation system. It leverages Langchain nodes within n8n to interact with OpenAI for natural language processing and Pinecone for vector-based storage and retrieval of contact information. The system can be triggered manually, via chat, or by another workflow. It aims to generate structured metadata for emails in both English and Chinese.
Key Features
- AI-Driven Email Composition: Utilizes OpenAI models (GPT-4o, GPT-4o-mini) to generate email content, subjects, and recipient details.
- Contact Management via Pinecone: Stores and retrieves email addresses and associated metadata using Pinecone vector database.
- Multilingual Metadata Generation: Designed to produce structured metadata in both English (en) and Chinese (zh).
- Tool-Based AI Agent: Employs Langchain AI Agents that utilize predefined tools for interacting with vector stores and sending emails.
- Workflow Orchestration: Integrates multiple n8n nodes for data loading, text splitting, embedding generation, and vector storage.
- Multiple Trigger Options: Supports manual testing, chat message reception, and execution by other workflows.
- Gmail Integration: Facilitates sending emails through Gmail.
How To Use
-
Initial Setup (Step 1 - Sticky Note):
- Read Google Docs Data: Use the
Get a document(n8n-nodes-base.googleDocs) node to fetch a list of contact emails from a specified Google Document. Ensure thedocumentURLis correctly configured. - Prepare Data: The
Default Data Loader(@n8n/n8n-nodes-langchain.documentDefaultDataLoader) processes the document content. - Split Text: The
Recursive Character Text Splitter(@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter) breaks down the document content into manageable chunks. - Generate Embeddings: The
Embeddings OpenAI(@n8n/n8n-nodes-langchain.embeddingsOpenAi) node converts these text chunks into vector embeddings. - Upsert to Pinecone: The
Pinecone Vector Store(@n8n/n8n-nodes-langchain.vectorStorePinecone) node uploads these embeddings to the specified Pinecone index (n8ndocs) and namespace (docsmail).
- Read Google Docs Data: Use the
-
AI Email Agent and Tooling (Step 2 - Sticky Note):
- Chat Trigger: The
When chat message received(@n8n/n8n-nodes-langchain.chatTrigger) node initiates this part of the workflow. - AI Agent Configuration: The
AI Agent1(@n8n/n8n-nodes-langchain.agent) is configured with a detailed system message guiding its behavior. It's instructed to use theVectorstore_mailsandsend_mailtools. - Vectorstore Mails Tool: The
Vectorstore Mails(@n8n/n8n-nodes-langchain.toolVectorStore) node is configured to interact with the Pinecone Vector Store, allowing the AI Agent to retrieve email addresses. - Send Mail Tool: The
send_mail(@n8n/n8n-nodes-langchain.toolWorkflow) node is a reference to another workflow (GLkrSkyYtlep3P6e- "Send Mails Pinecone") responsible for the actual email sending. The AI Agent will dynamically pass the necessary email details to this tool. - Model: An
OpenAI Chat Model(@n8n/n8n-nodes-langchain.lmChatOpenAi) (e.g.,gpt-4o) is used by the AI Agent.
- Chat Trigger: The
-
Email Sending and Metadata Generation (Step 3 - Sticky Note):
- Workflow Execution Trigger: The
When Executed by Another Workflow(@n8n/n8n-nodes-langchain.executeWorkflowTrigger) node allows this part of the workflow to be called by another n8n workflow. - AI Agent for Composition: The
AI Agent(@n8n/n8n-nodes-langchain.agent) (usinggpt-4o-mini) processes incoming data to determine theTo,Subject, andMessagefor the email. The input is expected to be in$json.query. - Gmail Sending: The
Gmail(n8n-nodes-base.gmailTool) node sends the email using the parameters dynamically populated by the AI Agent, leveraging$fromAIto extract recipient, subject, and message content. The system is designed to generate metadata in bothenandzhfor these fields, although specific nodes for this generation are not explicitly shown in this snippet but implied by the target goal.
- Workflow Execution Trigger: The
Apps Used
Workflow JSON
{
"id": "b3bd1946-75a0-4e11-a5f7-f5e6ecdf2579",
"name": "AI-Powered Email Automation with Multilingual Metadata Generation",
"nodes": 7,
"category": "AI & Automation",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: b3bd1946-75a0...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Discord Agent for Structured Metadata Generation
An n8n workflow that uses an AI agent to generate structured metadata in both English and Chinese for Discord.
AI Supervisor Ava for Multi-Language Workflow Orchestration
An AI supervisor workflow that orchestrates various tools and generates structured metadata in multiple languages.
AI Agent for Top n8n Creators Leaderboard Reporting
This workflow automates the generation of a comprehensive report on top n8n creators and their popular workflows, leveraging AI for analysis and LLMs for content creation.