Agents & Automations

Get started building AI agents and automations to streamline your workflows!

πŸ“ˆ Automated Stock Analysis Reports with Technical & News Sentiment
Stock Analysis Agent (Hebrew, RTL, GPT-4o)Overview Get comprehensive stock analysis with this AI-powered workflow that provides actionable insights for your investment decisions. On a weekly basis, this workflow: - Analyzes stock data from multiple sources (Chart-img, Twelve Data API, Alphavantage) - Performs technical analysis using advanced indicators (RSI, MACD, Bollinger Bands, Resistance and Support Levels) - Scans financial news from Alpha Vantage to capture market sentiment - Uses OpenAI's GPT-4o to identify patterns, trends, and trading opportunities - Generates a fully styled, responsive HTML email (with proper RTL layout) in Hebrew - Sends detailed recommendations directly to your inbox Perfect for investors, traders, and financial analysts who want data-driven stock insights - combining technical indicators with news sentiment for more informed decisions. Setup InstructionsEstimated setup time: 15 minutesRequired credentials: - OpenAI API Key - Chart-img API Key (free tier) - Twelve Data API Key (free tier) - Alpha Vantage API Key (free tier) - SMTP credentials (for email delivery)Steps: 1. Import this template into your n8n instance. 2. Add your API keys under credentials. 3. Configure the SMTP Email node with: Host (e.g., smtp.gmail.com), Port (465 or 587), Username (your email), Password (app-specific password or login). 4. Activate the workflow. 5. Fill in the Form. 6. Enjoy! (Check your Spam mailbox)Customization Tips - Modify the analysis timeframe (daily, weekly, monthly) - Add integrations with trading platforms or portfolio management tools - Adjust the recommendation criteria based on your risk toleranceWhy Use This? This is more than just stock data. It's an intelligent financial assistant that combines technical analysis with market sentiment to provide actionable recommendations - automatically. Important Note: This report is being generated automatically and does not constitute an investment recommendation. Please consult a licensed investment advisor before making any investment decisions.

Platform: n8n

Tools Used: OpenAI ChatGPT, Twelve Data API, SMTP Email

Categories: Finance, Analytics, AI

πŸ€– Hacker News Job Listing Scraper & Parser
This automated workflow scrapes and processes the monthly "Who is Hiring" thread from Hacker News, transforming raw job listings into structured data for analysis or integration with other systems. Perfect for job seekers, recruiters, or anyone looking to monitor tech job market trends. How it works: - Automatically fetches the latest "Who is Hiring" thread from Hacker News - Extracts and cleans relevant job posting data using the HN API - Splits and processes individual job listings into structured format - Parses key information like location, role, requirements, and company details - Outputs clean, structured data ready for analysis or export Set up steps: 1. Configure API access to Hacker News (no authentication required) 2. Follow the steps to get your cURL command from https://hn.algolia.com/ 3. Set up desired output format (JSON structured data or custom format) 4. Optional: Configure additional parsing rules for specific job listing information 5. Optional: Set up integration with preferred storage or analysis tools The workflow transforms unstructured job listings into clean, structured data following this pattern: - Input: Raw HN thread comments - Process: Extract, clean, and parse text - Output: Structured job listing data This template saves hours of manual work collecting and organizing job listings, making it easier to track and analyze tech job opportunities from Hacker News's popular monthly hiring threads.

Platform: n8n

Tools Used: OpenAI

Categories: Data Extraction, Recruiting, Analytics

✨ Generate Custom AI Images with OpenAI GPT-Image-1 Model
How it works Trigger the workflow manually via the n8n UI. Define key parameters like the image prompt, number of images, size, quality, and model. Send a POST request to OpenAI’s image generation API using those inputs. Split the API response to handle multiple images. Convert the base64 image data into downloadable binary files.Set up steps Initial setup takes around 5–10 minutes. You’ll need an OpenAI API key, a configured HTTP Request node with credentials, and to customize the prompt/parameter fields in the β€œSet Variables” node. No advanced config or external services needed.Important Note You have to make sure to complete OpenAI's new verification requirements to use their new image API. It only takes a few minutes and does not cost any money.

Platform: n8n

Tools Used: OpenAI

Categories: AI, Content Creation, Engineering

πŸ„ Generate WordPress Blog Posts from Google Sheets & ChatGPT
Automatically generate engaging WordPress blog posts using content from Google Sheets and ChatGPT, complete with AI-generated images, and publish effortlessly.

Platform: Make

Tools Used: WordPress, Google Sheets, ChatGPT

Categories: Blog, Content Creation, AI

πŸ” Local Ollama Self-Hosted AI Assistant
Transform your local N8N instance into a powerful chat interface using any local & private Ollama model, with zero cloud dependencies ☁️. This workflow creates a structured chat experience that processes messages locally through a language model chain and returns formatted responses πŸ’¬. How it works πŸ”„ πŸ’­ Chat messages trigger the workflow 🧠 Messages are processed through Llama 3.2 via Ollama (or any other Ollama compatible model) πŸ“Š Responses are formatted as structured JSON ⚑ Error handling ensures robust operation Set up steps πŸ› οΈ πŸ“₯ Install N8N and Ollama βš™οΈ Download Ollama 3.2 model (or other model) πŸ”‘ Configure Ollama API credentials ✨ Import and activate workflow This template provides a foundation for building AI-powered chat applications while maintaining full control over your data and infrastructure πŸš€.

Platform: n8n

Tools Used: Ollama

Categories: AI, Dev Ops, Productivity

πŸš€ Create and Send Messages with Anthropic Claude & Eleven Labs Text-to-Speech
Automatically generate and send personalized messages using 2 Anthropic Claude prompts and Eleven Labs text-to-speech. Enhance communication by integrating AI-driven messaging and voice technology.

Platform: Make

Tools Used: Anthropic, ElevenLabs

Categories: AI, Messaging, Content Creation

πŸ€– Beginner n8n AI Agent Workflow
This workflow creates a personal assistant that can manage communications, schedule meetings, and handle email correspondence through simple Telegram messages. This makes it particularly useful for basic administrative tasks that would otherwise require manual attention.

Platform: n8n

Tools Used: Telegram, Google Gmail, Google Calendar

Categories: Productivity, Calendar, Email

πŸ€– Email Assistant: Convert Natural Language to SQL Queries
Who is this for? πŸ§‘πŸ»πŸ«±πŸ»β€πŸ«²πŸ»πŸ€– Humans and Robots alike. This workflow can be used as a Chat Trigger, as well as a Workflow Trigger. It will take a natural language request, and then generate a SQL query. The resulting query parameter will contain the query, and a sqloutput parameter will contain the results of executing such query. What's the use case? This template is most useful paired with other workflows that extract e-mail information and store it in a structured Postgres table, and use LLMs to understand inquiries about information contained in an e-mail inbox and formulate questions that need answering. Plus, the prompt can be easily adapted to formulate SQL queries over any kind of structured database. Privacy and Economics As LLM provider, I'm using Ollama locally, as I consider my e-mail extremely sensitive information. As a model, phi4-mini does an excellent job balancing quality and efficiency. Setup Upon running for the first time, this workflow will automatically trigger a sub-section to read all tables and extract their schema into a local file. Then, either by chatting with the workflow in n8n's interface or by using it as a sub-workflow, you will get a query and a sqloutput response. Customizations If you want to work with just one particular table yet keep edits at bay, append a condition to the List all tables in a database step, like so: WHERE table_schema='public' AND table_name='my_emails_table_name' To repurpose this workflow to work with any other data corpus in a structured database, inspect the AI Agent user and system prompts and edit them accordingly.

Platform: n8n

Tools Used: OpenAI, AI Agent

Categories: AI, Data Management, Productivity

✨ 5 Ways to Process Images & PDFs with Gemini AI in n8n
Many users have asked in the support forum about different methods to analyze images and PDF documents with Google Gemini AI in n8n. This workflow answers that question by demonstrating five different approaches: 1. Single image with auto binary passthrough - The simplest approach using AI Agent's automatic binary handling. 2. Multiple images with predefined prompts - For customized analysis with different instructions per image. 3. Native n8n item-by-item processing - For handling multiple items using n8n's standard workflow paradigm. 4. PDF analysis via direct API - For document analysis and text extraction. 5. Image analysis via direct API - For direct control over API parameters. Each method has advantages depending on your specific use case, data volume, and customization needs. Set up steps Setup time: ~5-10 minutes. You'll need: - A Google Gemini API key - n8n with HTTP Request and AI Agent nodes Important: For the HTTP Request nodes making direct API calls to Gemini (Methods 3, 4, and 5), you'll need to set up Query Authentication with your Gemini API key. Add a parameter named "key" with your API key value in the Query Auth section of these nodes. I'll update this if I find better ways. Also, let me know if you know other ways. Eager to learn :)

Platform: n8n

Tools Used: Google Gemini, AI Agent

Categories: Images, AI, Data Management

✨ Generate Images with GPT-Image-1 and Store in Google Drive
How it works Receive a chat input as an image prompt. Call OpenAI's gpt-image-1 API to generate an image. Split the returned images and process them one by one. Upload each generated image to Google Drive. Save image links and thumbnails to a Google Sheets document. Record token usage and estimated cost into a separate sheet. --- Set up steps Connect your OpenAI API credentials for image generation. Connect your Google Drive and Google Sheets accounts. Set the destination folder in Google Drive. Set the target Google Sheet and specify the correct sheet tabs. The setup usually takes around 5-10 minutes. Detailed field mappings are already pre-configured inside the workflow. Additional tips and instructions are included as sticky notes inside the workflow.

Platform: n8n

Tools Used: OpenAI, Google Drive, Google Sheets

Categories: Images, Data Management, AI

πŸ„ Generate High-Converting Shopify Product Descriptions with AI
Boost your Shopify store's sales with AI-powered high-converting product descriptions. Crafted to attract more customers and improve online visibility, while saving time.

Platform: Make

Tools Used: OpenAI

Categories: Content Creation, Marketing, Ecommerce

✨ Social Media Analysis & Automated Email Generation
Social Media Analysis and Automated Email Generation by Thomas Vie ([email protected])Who is this for? This template is ideal for marketers, lead generation specialists, and business professionals seeking to analyze social media profiles of potential leads and automate personalized email outreach efficiently.What problem is this workflow solving? Manually analyzing social media profiles and crafting personalized emails can be time-consuming and prone to errors. This workflow streamlines the process by integrating social media APIs with AI to generate tailored communication, saving time and increasing outreach effectiveness.What this workflow does: - Google Sheets Integration: Start with a Google Sheet containing lead information such as LinkedIn URL, Twitter handle, name, and email. - Social Media Data Extraction: Automatically fetch profile and activity data from Twitter and LinkedIn using RapidAPI integrations. - AI-Powered Content Generation: Use OpenAI's Chat Model to analyze the extracted data and generate personalized email subject lines and cover letters. - Automated Email Dispatch: Send the generated email directly to the lead, with a copy sent to yourself for tracking purposes. - Progress Tracking: Update the Google Sheet to indicate completed actions.Setup: - Google Sheets: Create a sheet with the columns: LinkedIn URL, name, Twitter handle, email, and a "done" column for tracking. Populate the sheet with your leads. - RapidAPI Accounts: Sign up for RapidAPI and subscribe to the Twitter and LinkedIn API plans. Configure API authentication keys in the workflow. - AI Configuration: Connect OpenAI Chat Model with your API key for text generation. - Email Integration: Add your email credentials or service (SMTP or third-party service like Gmail) for sending automated emails.How to customize this workflow to your needs: - Modify the AI Prompt: Adapt the prompt in the AI node to better align with your tone, style, or specific messaging framework. - Expand Data Fields: Add additional data fields in Google Sheets if you require further personalization. - API Limits: Adjust API configurations to fit your usage limits or upgrade to higher tiers for increased data scraping capabilities. - Personalize Email Templates: Tweak email formats to suit different audiences or use cases. - Extend Functionality: Integrate additional social media platforms or CRM tools as needed. By implementing this workflow, you’ll save time on repetitive tasks and create more effective lead generation strategies.

Platform: n8n

Tools Used: Google Sheets, OpenAI, RapidAPI

Categories: Social Media Management, Lead Generation, Email Marketing

⚑ AI-Powered YouTube Video Summarization & Analysis
Disclaimer: This workflow uses a community node and therefore only works for self-hosted n8n users. Transform YouTube videos into comprehensive summaries and structured analysis instantly. This n8n workflow automatically extracts, processes, and analyzes video transcripts to deliver clear, organized insights without watching the entire video. Time-Saving Features πŸš€ Instant Processing Simply provide a YouTube URL and receive a structured summary within seconds, eliminating the need to watch lengthy videos. Perfect for research, learning, or content analysis. πŸ€– AI-Powered Analysis Leverages GPT-4o-mini to analyze video transcripts, organizing key concepts and insights into a clear, hierarchical structure with main topics and essential points. Smart Processing Pipeline πŸ“ Automated Transcript Extraction - Supports public YouTube videos - Handles multiple URL formats - Extracts complete video transcripts automatically 🧠 Intelligent Content Organization - Breaks down content into main topics - Highlights key concepts and terminology - Maintains technical accuracy while improving clarity - Structures information logically with markdown formattingPerfect For πŸ“š Researchers & Students Quick comprehension of educational content and lectures without watching entire videos. πŸ’Ό Business Professionals Efficient analysis of industry talks, presentations, and training materials. 🎯 Content Creators Rapid research and competitive analysis of video content in your niche. Technical Implementation πŸ”„ Workflow Components - Webhook endpoint for URL submission - YouTube API integration for video details - Transcript extraction system - GPT-4 powered analysis engine - Telegram notification system (optional) Transform your video content consumption with an intelligent system that delivers structured, comprehensive summaries while saving hours of viewing time.

Platform: n8n

Tools Used: OpenAI ChatGPT, YouTube, Google Drive

Categories: AI, Content Creation, Research

✨ Automate Blog Creation with AI in Brand Voice
This n8n template demonstrates a simple approach to using AI to automate the generation of blog content that aligns with your organisation's brand voice and style by using examples of previously published articles. In a way, it's quick and dirty "training" which can get your automated content generation strategy up and running for very little effort and cost whilst you evaluate our AI content pipeline. How it works In this demonstration, the n8n.io blog is used as the source of existing published content, and 5 of the latest articles are imported via the HTTP node. The HTML node extracts the article bodies, which are then converted to markdown for our LLMs. We use LLM nodes to (1) understand the article structure and writing style and (2) identify the brand voice characteristics used in the posts. These are then used as guidelines in our final LLM node when generating new articles. Finally, a draft is saved to WordPress for human editors to review or use as a starting point for their own articles. How to use Update Step 1 to fetch data from your desired blog or change it to fetch existing content in a different way. Update Step 5 to provide your new article instruction. For optimal output, theme topics relevant to your brand. Requirements A source of text-heavy content is required to accurately break down the brand voice and article style. Don't have your own? Maybe try your competitors? OpenAI for LLM - though I recommend exploring other models which may give subjectively better results. WordPress for blog, but feel free to use other preferred publishing platforms. Customising this workflow Ideally, you'd want to "train" your agent on material that is similar to your output; i.e., your social media posts may not get the best results from your blog content due to differing formats. Typically, this brand voice extraction exercise should run once and then be cached somewhere for reuse later. This would save on generation time and overall cost of the workflow.

Platform: n8n

Tools Used: OpenAI, WordPress, HTML

Categories: Content Creation, AI, Blog

πŸ” Generate SEO-Optimized WordPress Content with AI
Generate SEO-Optimized WordPress Content with Perplexity Research. Who is This For? This workflow is ideal for content creators, marketers, and businesses looking to streamline the creation of SEO-optimized blog posts for WordPress. It is particularly suited for professionals in the AI consulting and workflow automation industries. What Problem Does This Workflow Solve? Creating high-quality, SEO-friendly blog posts can be time-consuming and challenging, especially when trying to balance research, formatting, and publishing. This workflow automates the process by integrating research capabilities, AI-driven content creation, and seamless WordPress publishing. It reduces manual effort while ensuring professional-grade output. What This Workflow Does - Research: Gathers detailed insights from Perplexity AI based on user-provided queries. - Content Generation: Uses OpenAI models to create structured blog posts, including titles, slugs, meta descriptions, and HTML content optimized for WordPress. - Image Handling: Automatically fetches and uploads featured images to WordPress posts. - Publishing: Drafts the blog post directly in WordPress with all necessary formatting and metadata. - Notification: Sends a success message via Telegram upon completion. Setup GuidePrerequisites: - A WordPress account with API access. - OpenAI API credentials. - Perplexity AI API credentials. - Telegram bot credentials for notifications. Steps: 1. Import the workflow into your n8n instance. 2. Configure API credentials for WordPress, OpenAI, Perplexity AI, and Telegram. 3. Customize the form trigger to define your research query. 4. Test the workflow using sample queries to ensure smooth execution. How to Customize This Workflow to Your Needs - Modify the research query prompt in the "Form Trigger" node to suit your industry or niche. - Adjust content generation guidelines in the "Copywriter AI Agent" node for specific formatting preferences. - Replace the image URL in the "Set Image URL" node with your own source or dynamic image selection logic.

Platform: n8n

Tools Used: OpenAI, WordPress, Perplexity AI

Categories: Content Creation, Marketing, SEO

πŸ„ Automate YouTube Video Uploads & Generate Content with ChatGPT
Automate video uploads to YouTube by generating engaging content with ChatGPT. Retrieve files from Dropbox and repeat tasks effortlessly.

Platform: Make

Tools Used: ChatGPT, Dropbox, YouTube

Categories: Content Creation, AI, Product

πŸ”§ Build MCP Server with Google Calendar & Custom Functions
Learn how to build an MCP Server and Client in n8n with official nodes. ⚠ Requires n8n version 1.88.0 or higher. In this example, we use Google Calendar and custom functions as two separate MCP Servers, demonstrating how to integrate both native and custom tools. ### How it works The AI Agent connects to two MCP Servers. Each MCP Trigger (Server) generates a URL exposing its tools. This URL is used by an MCP Client linked to the AI Agent. Whenever you make changes to the tools, there’s no need to modify the MCP Client. It automatically keeps the AI Agent informed on how to use each tool, even if you change them over time. That’s the power of MCP πŸ™Œ ### Who is this template for Anyone looking to use MCP with their AI Agents. ### How to set up Instructions are included within the workflow itself. Check out my other templates.

Platform: n8n

Tools Used: Google Calendar, AI Agent, CustomJS

Categories: AI, Engineering, Productivity

πŸ“„ Transform Press Releases into Polished Articles with Gmail & OpenAI
This n8n workflow automates the transformation of press releases into polished articles. It converts the content of an email and its attachments (PDF or Word documents) into an AI-written article/blog post. What does it do? This workflow assists editors and journalists in managing incoming press releases from governments, companies, NGOs, or individuals. The result is a draft article that can easily be reviewed by the editor, who receives it in a reply email containing both the original input and the output, plus an AI-generated self-assessment. This self-assessment represents an additional feedback loop where the AI compares the input with the output to evaluate the quality and accuracy of its transformation. How does it work? Triggered by incoming emails in Google, it first filters attachments, retaining only Word and PDF files while removing other formats like JPGs. The workflow then follows one of three paths: - If no attachments remain, it processes the inline email message directly. - For PDF attachments, it uses an extractor to obtain the document content. - For Word attachments, it extracts the text content by an HTTP request. In each case, the extracted content is then passed to an AI agent that converts the press release into a well-structured article according to predefined prompts. A separate AI evaluation step provides a self-assessment by comparing the output with the original input to ensure quality and accuracy. Finally, the workflow generates a reply email to the sender containing three components: the original input, the AI-generated article, and the self-assessment. This streamlined process helps editors and journalists efficiently manage incoming press releases, delivering draft articles that require minimal additional editing.

Platform: n8n

Tools Used: OpenAI, Gmail, Google Drive

Categories: Content Creation, AI, Email

πŸš€ Real-time Crypto Insights via Telegram with DexScreener & GPT-4o
Instantly access real-time decentralized exchange (DEX) insights directly in Telegram! This workflow integrates the DexScreener API with GPT-4o-powered AI and Telegram, allowing users to fetch the latest blockchain token analytics, liquidity pools, and trending tokens effortlessly. Ideal for crypto traders, DeFi analysts, and investors who need actionable market data at their fingertips. How It Works A Telegram bot listens for user queries about tokens or trading pairs. The workflow interacts with the DexScreener API (no API key required) to fetch real-time data, including: - Token fundamentals (profiles, images, descriptions, and links) - Trending and boosted tokens (hyped projects, potential market movers) - Trading pair analytics (liquidity, price action, volumes, volatility) - Order and payment activity (transaction insights, investor movements) - Liquidity pool depth (market stability, capital flows) - Multi-chain pair comparisons (performance tracking across networks) An AI-powered language model (GPT-4o-mini) enhances responses for better insights. The workflow logs session data to improve user interaction tracking. The requested DEX insights are sent back via Telegram in an easy-to-read format. What You Can Do with This Agent This AI-driven Telegram bot enables you to: βœ… Track trending and boosted tokens before they gain mainstream traction. βœ… Monitor real-time liquidity pools to assess token stability. βœ… Analyze active trading pairs across different blockchains. βœ… Identify transaction trends by checking paid orders for tokens. βœ… Compare market activity with detailed trading pair analysis. βœ… Receive instant insights with AI-enhanced responses for deeper understanding. Set Up Steps 1. Create a Telegram Bot Use @BotFather on Telegram to create a bot and obtain an API token. 2. Configure Telegram API Credentials in n8n Add your Telegram bot token under Telegram API credentials. 3. Deploy and Test Send a query (e.g., "SOL/USDC") to your Telegram bot and receive real-time insights instantly! πŸš€ Unlock powerful, real-time DEX insights directly in Telegramβ€”no API key required!

Platform: n8n

Tools Used: DexScreener, Telegram

Categories: AI, Business Intelligence, Data Management

πŸš€ Monitor GitHub Releases with Gemini AI & Slack Notifications
Overview This n8n template monitors specified GitHub repositories. When a new release is published, it automatically fetches the information, uses AI (Google Gemini by default) to summarize and translate it into Chinese, and sends a formatted notification to a designated Slack channel. Core Features: - Automated Monitoring: Checks for updates on a predefined schedule. - Intelligent Processing: Uses AI to extract key information and translate. - Error Handling: Sends an error notification if fetching RSS for a single repository fails, without affecting others. - Duplicate Prevention: Remembers the last processed release ID using Redis to ensure only new content is pushed. Prerequisites - Slack: Configure your Slack app credentials in n8n. - Redis: Have an available Redis service and configure its credentials in n8n. - AI Provider (Gemini): Configure credentials for Google Gemini (or your chosen AI model) in n8n. Configuration Instructions After importing the template, you need to modify the following key nodes: - Cron Trigger: Adjust the Rule setting to change the update check frequency (default is 0 */10 9-23 * * *, checking every 10 minutes between 9 AM and 11 PM daily). - GitHub Config (Repository List - Code Node): Edit the JavaScript array within this node's code area. Modify or add the repositories you want to follow. Each repository object needs a name (custom display name) and github (format: owner/repo). Example: { "name": "n8n", // Custom display name "github": "n8n-io/n8n" // GitHub path }, { "name": "LobeChat", "github": "lobehub/lobe-chat" } // ... add more repositories - Redis and Redis2 (Redis Connection): Select your configured Redis credentials in both nodes. - Gemini (AI Model): Select your configured Google Gemini credentials. (Optional) Replace with a different supported AI model node and select its credentials. - Information Extractor (AI Processing & Translation): Review the System Prompt. By default, it asks the AI to extract information and translate it into Chinese. Modify this prompt if you need a different language or summary style. - Send Message and Send Error (Slack Notifications): Select your configured Slack credentials in both Slack nodes. Set the target Channel ID for notifications. Workflow Overview - Start: Cron Trigger initiates the workflow on schedule. - Load Config: GitHub Config provides the list of repositories to monitor. - Loop: The Loop node iterates through each repository. - Fetch & Check: The RSS node attempts to fetch the repository's releases feed. If No Error checks for success: - Failure: Send Error posts an error to Slack, skips this repository. - Success: Continues. - Check for New Release: The Redis node retrieves the last recorded Release ID for this repository. The If New node compares the latest Release ID with the recorded ID: - Different IDs (New Release): Proceeds to processing. - Same ID (Already Processed): Skips this repository. - Process & Notify (Only for New Releases): Information Extractor (with Gemini) extracts, summarizes, and translates the content. The Code node formats the information into Slack Block Kit. Send Message sends the formatted message to Slack. The Redis2 node stores the current Release ID in Redis. - End: The workflow finishes after processing all repositories. Conclusion Once configured, this template automates GitHub release monitoring, uses AI to distill key information, and delivers it efficiently to your Slack workspace.

Platform: n8n

Tools Used: Google Gemini, Slack, Redis

Categories: AI, Social Media Management, Data Management

πŸš€ RAG: Context-Aware Chunking - Google Drive to Pinecone via OpenRouter & Gemini
Workflow based on the following article:https://www.anthropic.com/news/contextual-retrieval This n8n automation is designed to extract, process, and store content from documents into a Pinecone vector store using context-based chunking. The workflow enhances retrieval accuracy in RAG (Retrieval-Augmented Generation) setups by ensuring each chunk retains meaningful context.Workflow Breakdown: πŸ”Ή Google Drive - Retrieve Document: The automation starts by fetching a source document from Google Drive. This document contains structured content, with predefined boundary markers for easy segmentation. πŸ”Ή Extract Text Content: Once retrieved, the document’s text is extracted for processing. Special section boundary markers are used to divide the text into logical sections. πŸ”Ή Code Node - Create Context-Based Chunks: A custom code node processes the extracted text, identifying section boundaries and splitting the document into meaningful chunks. Each chunk is structured to retain its context within the entire document. πŸ”Ή Loop Node - Process Each Chunk: The workflow loops through each chunk, ensuring they are processed individually while maintaining a connection to the overall document context. πŸ”Ή Agent Node - Generate Context for Each Chunk: We use an Agent node powered by OpenAI’s GPT-4.0-mini via OpenRouter to generate contextual metadata for each chunk, ensuring better retrieval accuracy. πŸ”Ή Prepend Context to Chunks & Create Embeddings: The generated context is prepended to the original chunk, creating context-rich embeddings that improve searchability. πŸ”Ή Google Gemini - Text Embeddings: The processed text is passed through Google Gemini text-embedding-004, which converts the text into semantic vector representations. πŸ”Ή Pinecone Vector Store - Store Embeddings: The final embeddings, along with the enriched chunk content and metadata, are stored in Pinecone, making them easily retrievable for RAG-based AI applications.Use Case: This automation enhances RAG retrieval by ensuring each chunk is contextually aware of the entire document, leading to more accurate AI responses. It’s perfect for applications that require semantic search, AI-powered knowledge management, or intelligent document retrieval. By implementing context-based chunking, this workflow ensures that LLMs retrieve the most relevant data, improving response quality and accuracy in AI-driven applications.

Platform: n8n

Tools Used: Google Drive, OpenAI ChatGPT, Google Gemini

Categories: AI, Data Management, Productivity