by Nikan Noorafkan
🤖 AI-Powered Content Marketing Research Tool > Transform your content strategy with automated competitor intelligence ⚡ What It Does Never miss a competitor move again. This workflow automatically: 🔍 Monitors competitor content across multiple domains 📊 Tracks trending keywords by region 💬 Extracts audience pain points from Reddit & forums 🤖 Generates AI strategy recommendations via OpenAI 📋 Outputs to Airtable, Notion & Slack for instant action 🎯 Perfect For Growth marketers** tracking competitor strategies Content teams** discovering trending topics SEO specialists** finding keyword opportunities Marketing agencies** managing multiple clients 🛠️ Technical Setup Required APIs & Credentials | Service | Credential Type | Monthly Cost | Purpose | |---------|----------------|--------------|---------| | Ahrefs | Header Auth | $99+ | Backlink & traffic analysis | | SEMrush | Query Auth | $119+ | Keyword research | | BuzzSumo | Header Auth | $199+ | Content performance | | OpenAI | Header Auth | ~$50 | AI recommendations | | Reddit | OAuth2 | Free | Audience insights | | Google Trends | Public API | Free | Trending topics | 📊 Database Schema Airtable Base: content-research-base Table 1: competitor-intelligence timestamp (Date) domain (Single line text) traffic_estimate (Number) backlinks (Number) content_gaps (Long text) publishing_frequency (Single line text) Table 2: keyword-opportunities timestamp (Date) trending_keywords (Long text) top_questions (Long text) content_opportunities (Long text) 🚀 Quick Start Guide Step 1: Import & Configure Import the workflow JSON Update competitor domains in 📋 Configuration Settings Map all API credentials Step 2: Setup Storage Airtable:** Create base with exact schema above Notion:** Create database with properties listed Slack:** Create #content-research-alerts channel Step 3: Test & Deploy First run populates: ✅ Airtable tables with competitor data ✅ Notion database with AI insights ✅ Slack channel with formatted alerts 💡 Example Output AI Recommendations Format { "action_items": [ { "topic": "Copy trading explainer", "format": "Video", "region": "UK", "priority": "High" } ], "publishing_calendar": [ {"week": "W34", "posts": 3} ], "alerts": [ "eToro gained 8 .edu backlinks this week" ] } Slack Alert Preview 🚨 Content Research Alert 📊 Top Findings: Sustainable packaging solutions Circular economy trends Eco-friendly manufacturing 📈 Trending Keywords: forex trading basics (+45%) social trading platforms (+32%) copy trading strategies (+28%) 💡 AI Recommendations: Focus on educational content in UK market... 🔧 Advanced Features ✅ Data Quality Validation Automatic retry** for failed API calls Data validation** before storage Error notifications** via Slack ⚙️ Scalability Options Multi-region support** (US, UK, DE, FR, JP) Batch processing** for large competitor lists Rate limiting** to respect API quotas 🎨 Customization Ready Modular design** - disable unused APIs Industry templates** - forex, ecommerce, SaaS Custom scoring** algorithms 📈 ROI & Performance Cost Analysis Setup time:** ~2 hours Monthly API costs:** $400-500 Time saved:** 15+ hours/week ROI:** 300%+ within first month Success Metrics Competitor insights:** 50+ data points daily Keyword opportunities:** 100+ suggestions/week Content ideas:** 20+ AI-generated topics Trend alerts:** Real-time notifications 🛡️ Troubleshooting Common Issues & Solutions | Symptom | Cause | Fix | |-------------|-----------|---------| | OpenAI timeout | Large data payload | Reduce batch size → Split processing | | Airtable 422 error | Field mismatch | Copy schema exactly | | Reddit 401 | OAuth expired | Re-authorize application | Rate Limiting Best Practices Ahrefs:** Max 1000 requests/day SEMrush:** 3000 requests/day OpenAI:** Monitor token usage 🌟 Why Choose This Template? > "From manual research to automated intelligence in 15 minutes" ✅ Production-ready - No additional coding required ✅ Cost-optimized - Uses free tiers where possible ✅ Scalable - Add competitors with one click ✅ Actionable - AI outputs ready for immediate use ✅ Community-tested - 500+ successful deployments Start your competitive intelligence today 🚀 Built with ❤️ for the n8n community
by Jason Krol
Notion Weekly Journal AI Summary This workflow will run on a weekly schedule and retrieve your Notion Daily Journal pages for the past week and aggregate them into a ChatGPT generated concise summary. It will save that weekly summary back to your Notion as a new Note in addition to posting to a personal Discord channel. Additionally it will also retrieve all of the Tasks you've completed in the past week and provide a quick total with a congratulatory message to a Discord channel as well. Requirements/Setup: You need Notion setup w/ a Notes database If you want the Discord messages, setup a Discord webhook for your channel as well, or simply delete the Discord nodes. One of the properties for the Notes db should be Type with a value of Journal The contents of your daily Journal pages can be whatever you want I've found what works best for me is the format of "What was a highlight of the day?", "What was a low point of the day?", and "What decisions did I delegate, delay, or dodge?" You should also create an additional Type for your Weekly summary page that gets created - in this case I used simply Weekly Automate this to run weekly on your day of choice. I tend to only journal on weekdays so I've set mine up to run every Friday retrieving the past week's Journal entries. Options: You don't have to use Discord, feel free to swap out with Slack or remove altogether. You also don't need to use the Tasks summary bottom half, simply remove that if you don't want it or need it. You can easily reuse this workflow to aggregate your Weekly Summary notes (that this workflow auto generates/saves) to generate a Quarterly or even Yearly summary!
by Oneclick AI Squad
In this guide, we’ll walk you through setting up a smart workflow that triggers on new restaurant orders, extracts and formats customer and dish details from Google Sheets, uses Gemini AI to recommend dishes or offers, and sends suggestions via Telegram. Ready to automate your order processing and enhance customer experience? Let’s dive in! What’s the Goal? Automatically trigger the workflow when a new order is placed. Extract and format customer information and order details from Google Sheets. Use Gemini AI to analyze orders and recommend dishes or offers. Send personalized suggestions to customers via Telegram. Enable real-time order processing and customer engagement. By the end, you’ll have a smart system that processes orders and suggests items effortlessly. Why Does It Matter? Manual order processing and suggestion generation are inefficient and miss opportunities. Here’s why this workflow is a game changer: Real-Time Efficiency**: Instantly process orders and suggest items. Personalized Engagement**: AI-driven suggestions enhance customer satisfaction. Time-Saving Automation**: Reduce manual effort in order management. Improved Sales**: Targeted recommendations can boost order value. Think of it as your intelligent assistant for orders and customer delight. How It Works Here’s the step-by-step magic behind the automation: Step 1: New Order Trigger Trigger the workflow when a new order is detected (e.g., via a form submission). Step 2: Extract & Format Order Extract and format dish ordering details from the customer order details sheet for further processing. Step 3: Save Customer Info Save customer information (e.g., ID, name, mobile number) from the customer details sheet. Step 4: Save Dish Info Save dish details (e.g., name, quantity, price) from the customer order details sheet. Step 5: Prepare Dish Details for AI Prepare the dish details for AI analysis to generate recommendations. Step 6: Clean Data for Input to Improve AI Understanding Clean and structure the data to enhance AI comprehension. Step 7: Use Gemini AI to Recommend Dishes or Offers Utilize Gemini AI (via Google Chat Model and Think Tool) to recommend dishes or offers based on order data. Step 8: Format AI Suggestions Format the AI-generated suggestions into a Telegram-friendly message. Step 9: Send Suggestions via Telegram Send the formatted suggestions directly to the customer via Telegram. How to Use the Workflow? Importing a workflow in n8n is a straightforward process that allows you to use pre-built workflows to save time. Below is a step-by-step guide to importing the Smart Restaurant Order & Suggestion System workflow in n8n. Steps to Import a Workflow in n8n Obtain the Workflow JSON Source the Workflow: Workflows are shared as JSON files or code snippets, e.g., from the n8n community, a colleague, or exported from another n8n instance. Format: Ensure you have the workflow in JSON format, either as a file (e.g., workflow.json) or copied text. Access the n8n Workflow Editor Log in to n8n (via n8n Cloud or self-hosted instance). Navigate to the Workflows tab in the n8n dashboard. Click Add Workflow to create a blank workflow. Import the Workflow Option 1: Import via JSON Code (Clipboard): Click the three dots (⋯) in the top-right corner to open the menu. Select Import from Clipboard. Paste the JSON code into the text box. Click Import to load the workflow. Option 2: Import via JSON File: Click the three dots (⋯) in the top-right corner. Select Import from File. Choose the .json file from your computer. Click Open to import. Setup Notes Google Sheet Columns**: Customer Details Sheet: Customer id, Customer name, Customer mobile number (e.g., CUST-JW4Z8Y, ajay, 9898989898; CUST-VEITPW, akash, 9898976898). Customer Order Details Sheet: Customer id, Dish name, Dish quantity, Per unit price, Actual price (e.g., CUST-JW4Z8Y, Tandoori Chicken, 1, 250, 250; CUST-VEITPW, Masala Dosa, 1, 150, 150). Google Sheets Credentials**: Configure OAuth2 settings in the extract and save nodes with your Google Sheet ID and credentials. Gemini AI**: Set up the Gemini AI node with Google Chat Model and Think Tool credentials. Telegram Integration**: Authorize the Send Suggestions node with Telegram API credentials and the customer’s chat ID or mobile number. Trigger Setup**: Configure the New Order Trigger node to detect new orders (e.g., via form or webhook).
by MattF
This workflow tracks week-over-week changes in Google Search Console performance and highlights the top movers across keyword segments like brand, nonbrand, and content categories. Instead of providing a routine check, it focuses on significant movements by: Sending a Slack alert only if a query crosses a defined movement threshold. Emailing a structured report with the Top 25 increases and Top 25 decreases for clicks, including % changes and linked URLs It’s designed to surface the most important shifts, helping SEO teams catch big wins, losses, or anomalies early. How it works Runs weekly (e.g. every Monday) to compare last week’s GSC data to the week prior. Segments traffic based on query and page (e.g. brand terms, category page URLs, etc.). Calculates delta and % change for clicks, CTR, impressions, and position. Filters and flags top movers with large shifts (default: ±200 clicks and ±30%). Sends Slack alerts only if meaningful changes are detected. Emails a full HTML table report showing the Top 25 up/down queries per segment. Setup steps Requires a connected Google Search Console account. Slack alert is included by default (can be replaced with email, webhook, or other tools). Customize your brand terms and URL filters to match your segments (e.g. recipes, blog, category pages). Typical setup time: 15–25 minutes depending on the number of segments and filters you want. Note: “Recipes” is used in the example to show how to segment by content type. You can update this to reflect your own site’s structure.
by Billy Christi
Who is this for? This workflow is perfect for: Digital marketers who need to scale SEO-optimized content production Bloggers and content creators who want to maintain consistent publishing schedules Small business owners who need regular blog content but lack writing resources What problem is this workflow solving? Creating high-quality, SEO-optimized blog content consistently is time-consuming and resource-intensive. This workflow solves that by: Automating the content generation process from topic to final draft Ensuring quality control through human-in-the-loop approval Managing topic queues and preventing duplicate content creation Streamlining the revision process based on human feedback Organizing and archiving all generated content for future reference What this workflow does From topics stored in Google Sheets, this workflow: Automatically retrieves pending topics from your Google Sheets tracking document Generates SEO-optimized blog posts (800-1200 words) using OpenAI GPT-4 with structured prompts Sends content for human approval via email with custom approval forms Handles revision requests by incorporating feedback while maintaining SEO best practices Updates topic status to prevent duplicate processing Add approved generated content in Google Sheets for easy access and management Routes workflow based on approval decisions (approve, revise, or cancel) Setup Copy the Google Sheet template here: 👉 Automate Blog Content Creation – Google Sheet Template Connect Google Sheets with your topic tracking document (requires "Topic List" and "Generated Content" sheets) Add your OpenAI API key to the AI agent nodes for content generation Configure Gmail for the approval notification system Set up your topic list in Google Sheets with "Topic" and "Status" columns Customize the schedule trigger to run at your preferred intervals Update email recipient in the approval node to your email address Test with a sample topic marked as "Pending" in your Google Sheet How to customize this workflow to your needs Adjust content length**: modify the word count requirements in the AI agent prompts Change writing style**: customize the copywriter prompts for different tones (formal, casual, technical) Add multiple reviewers**: extend the approval system to include additional stakeholders Integrate with CMS**: add nodes to automatically publish approved content to WordPress, Webflow, or other platforms Include keyword research**: add Ahrefs or SEMrush nodes to incorporate keyword data Add image generation**: integrate DALL-E or Midjourney for automatic featured image creation Customize approval criteria**: modify the approval form to include specific feedback categories Add content scoring**: integrate readability checkers or SEO analysis tools before approval
by Alex Huang
Use case Manually monitoring Reddit for viable business ideas is time-consuming and inconsistent. This workflow automatically analyzes trending Reddit discussions using AI to surface high-potential opportunities, filter irrelevant content, and generate actionable insights - saving entrepreneurs 10+ hours weekly in market research. What this workflow does This AI-powered workflow automatically collects trending Reddit discussions, analyzes posts for viable business opportunities using GPT-4, applies smart filters to exclude low-value content, and generates scored opportunity reports with market insights. It identifies unmet customer needs through sentiment analysis, prioritizes high-potential ideas using custom criteria, and outputs structured data to Google Sheets for actionable decision-making. Setup Add Reddit,Google and OpenAI credentials Configure target subreddits in Subreddit node Test workflow by testing workflow Review generated opportunity report in Google Sheets How to adjust this template Change data sources**: Replace Reddit trigger with Twitter/X or Hacker News API Modify criteria**: Adjust scoring thresholds in Opportunity Calculator node Add integrations**: Create automatic Slack alerts for urgent opportunities Generate draft business plans using AI Document Writer
by Gain FLow AI
AI Latest News Content Script Writer Overview This workflow automates the daily generation of viral short-form video content ideas tailored for founders and business leaders. It scrapes fresh AI-related news and trends from various topics, synthesizes the information, and then uses AI to craft complete content packages—including video scripts, captivating captions, and punchy text overlays. All generated content is saved to a Google Sheet, ready for your review and use. Use Case This workflow is perfect for: Founders & Entrepreneurs**: Consistently produce engaging content to build authority and attract inbound leads without a dedicated content team. AI Thought Leaders**: Stay on top of the latest AI news and effortlessly create shareable insights. Content Marketing Teams**: Automate the ideation and initial drafting phases for short-form video strategies. Agencies**: Offer a unique AI-powered content generation service to your clients. How It Works Scheduled Daily Trigger: The workflow runs automatically every day at 6 AM IST, ensuring you always have fresh content ideas to start your day. AI-Powered News Gathering: It uses Perplexity AI to fetch the latest, most interesting, and relevant stories across three key AI topics: Topic 1: General AI News Topic 2: AI Market and Industry Trends Topic 3: AI Business Automation Organize and Combine Content: The information from each topic is organized, and then all content and their respective citations are combined into a single, comprehensive input. Personalize "About Me": Crucially, a configurable "About me" node allows you to define the personal brand of the founder (e.g., Name, Niche, Business Name, Business Type). This context is fed to the AI to ensure generated content aligns perfectly with your persona and business objectives. Generate Content Packages: Leveraging OpenAI (acting as "CreatorAI"), the workflow takes the combined news and your "About me" information to: Identify a Unique Angle: Finds a distinct, engaging angle from the input that aligns with key content pillars (e.g., AI solving business pain points, future of work with AI). Craft Video Scripts: Generates concise video scripts (under 700 characters) with powerful hooks, mini-narratives (problem → AI solution → impact), and a focus on tangible business benefits. It subtly references your business as a thought leader, not a direct pitch. Write Captions: Creates friendly, expert-toned captions with engaging hooks, more context, a clear call to action (e.g., "Comment 'Workflow' for more"), and relevant hashtags. Design Text Overlays: Produces short, punchy text overlays (3-7 words, ALL CAPS or Title Case) perfect for video thumbnails or initial screens. Save to Google Sheet: Each generated content package (Text Overlay, Video Script, Caption) is appended as a new row in your designated Google Sheet ("Content Idea" sheet within "Video Automation (Vansh)"). Notify User: Finally, you'll receive an email notification confirming that new content ideas have been generated and saved to your Google Sheet. How to Set It Up To set up this AI Viral Content Generator, follow these steps: API Keys & Credentials: Perplexity AI API Key: Obtain your API key from Perplexity AI and replace the Bearer token in the "Topic 1", "Topic 2", and "Topic 3" HTTP Request nodes. OpenAI API Key: Connect your OpenAI API key in n8n and link it to the "Content Generation" node. Google Sheets Account: Ensure your Google Sheets OAuth2 API credentials are set up and connected to the "Save Data" node. Gmail Account: Connect your Gmail OAuth2 credentials to the "Notify user" node. Google Sheet Setup: Copy the Google Sheet Template provided. This template has predefined columns for "Text Overlay", "Video Script", "Caption", "Approval", and "Published". Update the documentId in the "Save Data" Google Sheets node with the ID of your copied template. Personalize "About me": Open the "About me" node. Fill in your Name, Niche, Business Name, Business Type, Website, and detailed Key Services & Products. This is crucial for the AI to generate relevant and personalized content. Configure Notification Email: In the "Notify user" node, update the sendTo field with your email address where you want to receive notifications. Set Schedule: The "Schedule Trigger" is set to run daily at 6 AM IST. You can adjust the time to your preference. Activate and Monitor: Activate the workflow. It will now automatically generate content ideas daily. Check your Google Sheet regularly to review the new content, mark it for approval, and track its publication status. This workflow is your secret weapon for consistently creating engaging, AI-driven short-form video content!
by Kumar Shivam
This workflow automates the restaurant POS (Point of Sale) data management process, facilitating seamless order handling, customer tracking, inventory management, and sales reporting. It retrieves order details, processes payment information, updates inventory, and generates real-time sales reports, all integrated into a centralized system that improves restaurant operations. The workflow integrates various systems, including a POS terminal to gather order data, payment gateways to process transactions, inventory management tools to update stock, and reporting tools like Google Sheets or an internal database for generating sales and performance reports. Who Needs Restaurant POS Automation? This POS automation workflow is ideal for restaurant owners, managers, and staff looking to streamline their operations: Restaurant Owners – Automate order processing, track sales, and monitor inventory to ensure smooth operations. Managers – Access real-time sales data and performance reports to make informed decisions. Staff – Reduce manual work, focusing on providing better customer service while the system handles orders and payments. Inventory Teams – Automatically update inventory levels based on orders and ingredient usage. If you need a reliable and automated POS solution to manage restaurant orders, payments, inventory, and reporting, this workflow minimizes human error, boosts efficiency, and saves valuable time. Why Use This Workflow? End-to-End Automation – Automates everything from order input to inventory updates and sales reporting. Seamless Integration – Connects POS, payment systems, inventory management, and reporting tools for smooth data flow.(if needed) Real-Time Data – Provides up-to-the-minute reports on sales, stock levels, and order statuses. Scalable & Efficient – Supports multiple locations, multiple users, and high order volumes. Step-by-Step: How This Workflow Manages POS Data Collect Orders – Retrieves order details from the POS system, including customer information, ordered items, and payment details. Update Inventory – Decreases inventory levels based on sold items, ensuring stock counts are always accurate. Generate Reports – Compiles sales, revenue, and inventory data into real-time reports and stores them in Google Sheets or an internal database. Track Customer Data – Keeps a log of customer details and order history for better service and marketing insights. Customization: Tailor to Your Needs Multiple POS Systems – Adapt the workflow to work with different POS systems or terminals based on your restaurant setup. Custom Reporting – Modify the reporting format or include specific sales metrics (e.g., daily totals, best-selling items, employee performance). Inventory Management – Adjust inventory updates to include alerts when stock reaches critical levels or needs reordering. Integration with Accounting Software – Connect with platforms like QuickBooks for automated financial tracking. 🔑 Prerequisites POS System Integration – Ensure the POS system can export order data in a compatible format. Payment Gateway API – Set up the necessary API keys for payment processing (e.g., Stripe, PayPal). Inventory Management Tools – Use inventory software or databases that can automatically update stock levels. Reporting Tools – Use Google Sheets or an internal database to store and generate sales and inventory reports. 🚀 Installation & Setup Configure Credentials Set up API credentials for payment gateways and inventory management tools. Import Workflow Import the workflow into your automation platform (e.g., n8n, Zapier). Link POS system, payment gateway, and inventory management systems. Test & Run Process a test order to ensure that data flows correctly through each step. Verify that inventory updates and reports are generated as expected. ⚠ Important Data Privacy – Ensure compliance with data protection regulations (e.g., GDPR, PCI DSS) when handling customer payment and order data. System Downtime – Monitor system performance to ensure that the workflow runs without disruptions during peak hours. Summary This restaurant POS automation workflow integrates order management, payment processing, inventory updates, and real-time reporting, enabling efficient restaurant operations. Whether you are running a single location or a chain of restaurants, this solution streamlines daily tasks, reduces errors, and provides valuable insights, saving time and improving customer satisfaction. 🚀
by Davide
This workflow allows users to generate AI videos using the cheaper model Google Veo3 Fast, save them to Google Drive, generate optimized titles with GPT-4o, and automatically upload them to YouTube and TikTok with Upload-Post. The entire process is triggered from a Google Sheet that acts as the central interface for input and output. IT automates video creation, uploading, and tracking, ensuring seamless integration between Google Sheets, Google Drive, Google Veo3 Fast, TikTok and YouTube. Benefits of this Workflow 💡 No Code Interface**: Trigger and control the video production pipeline from a simple Google Sheet. ⚙️ Full Automation**: Once set up, the entire video generation and publishing process runs hands-free. 🧠 AI-Powered Creativity**: Generates engaging YouTube and TikTok titles using GPT-4o. Leverages advanced generative video AI from Google Veo3. 📁 Cloud Storage & Backup**: Stores all generated videos on Google Drive for safekeeping. 📈 YouTube Ready**: Automatically uploads to YouTube with correct metadata, saving time and boosting visibility. 📈 TikTok Ready**: Automatically uploads to TikTok with correct metadata, saving time and boosting visibility. 🧪 Scalable**: Designed to process multiple video prompts by looping through new entries in Google Sheets. 🔒 API-First**: Utilizes secure API-based communication for all services. How It Works Trigger: The workflow can be started manually ("When clicking ‘Test workflow’") or scheduled ("Schedule Trigger") to run at regular intervals (e.g., every 5 minutes). Fetch Data: The "Get new video" node retrieves unfilled video requests from a Google Sheet (rows where the "VIDEO" column is empty). Video Creation: The "Set data" node formats the prompt and duration from the Google Sheet. The "Create Video" node sends a request to the Fal.run API (Google Veo3 Fast) to generate a video based on the prompt. Status Check: The "Wait 60 sec." node pauses execution for 60 seconds. The "Get status" node checks the video generation status. If the status is "COMPLETED," the workflow proceeds; otherwise, it waits again. Video Processing: The "Get Url Video" node fetches the video URL. The "Generate title" node uses OpenAI (GPT-4.1) to create an SEO-optimized YouTube and TikTok title. The "Get File Video" node downloads the video file. Upload & Update: The "Upload Video" node saves the video to Google Drive. The "HTTP Request" node uploads the video to YouTube via the Upload-Post API. The "HTTP Request" node uploads the video to TikTok via the Upload-Post API. The "Update Youtube URL" and "Update result" nodes update the Google Sheet with the video URL and YouTube link. Set Up Steps Google Sheet Setup: Create a Google Sheet with columns: PROMPT, DURATION, VIDEO, and YOUTUBE_URL. Share the Sheet link in the "Get new video" node. API Keys: Obtain a Fal.run API key (for Veo3) and set it in the "Create Video" node (Header: Authorization: Key YOURAPIKEY). Get an Upload-Post API key (for YouTube uploads) and configure the "HTTP Request" node (Header: Authorization: Apikey YOUR_API_KEY). Get an Upload-Post API key (for TikTok uploads) and configure the "HTTP Request" node (Header: Authorization: Apikey YOUR_API_KEY). YouTube Upload Configuration: Replace YOUR_USERNAME in the "HTTP Request" node with your Upload-Post profile name. Schedule Trigger: Configure the "Schedule Trigger" node to run periodically (e.g., every 5 minutes). Need help customizing? Contact me for consulting and support or add me on Linkedin.
by Greg Evseev
This workflow template provides a robust solution for efficiently sending multiple prompts to Anthropic's Claude models in a single batch request and retrieving the results. It leverages the Anthropic Batch API endpoint (/v1/messages/batches) for optimized processing and outputs each result as a separate item. Core Functionality & Example Usage Included This template includes: The Core Batch Processing Workflow: Designed to be called by another n8n workflow. An Example Usage Workflow: A separate branch demonstrating how to prepare data and trigger the core workflow, including examples using simple strings and n8n's Langchain Chat Memory nodes. Who is this for? This template is designed for: Developers, data scientists, and researchers** who need to process large volumes of text prompts using Claude models via n8n. Content creators** looking to generate multiple pieces of content (e.g., summaries, Q&As, creative text) based on different inputs simultaneously. n8n users** who want to automate interactions with the Anthropic API beyond single requests, improve efficiency, and integrate batch processing into larger automation sequences. Anyone needing to perform bulk text generation or analysis tasks with Claude programmatically. What problem does this workflow solve? Sending prompts to language models one by one can be slow and inefficient, especially when dealing with hundreds or thousands of requests. This workflow addresses that by: Batching:** Grouping multiple prompts into a single API call to Anthropic's dedicated batch endpoint (/v1/messages/batches). Efficiency:** Significantly reducing the time required compared to sequential processing. Scalability:** Handling large numbers of prompts (up to API limits) systematically. Automation:** Providing a ready-to-use, callable n8n structure for batch interactions with Claude. Structured Output:** Parsing the results and outputting each individual prompt's result as a separate n8n item. Use Cases: Bulk content generation (e.g., product descriptions, summaries). Large-scale question answering based on different contexts. Sentiment analysis or data extraction across multiple text snippets. Running the same prompt against many different inputs for research or testing. What the Core Workflow does (Triggered by the 'When Executed by Another Workflow' node) Receive Input: The workflow starts when called by another workflow (e.g., using the 'Execute Workflow' node). It expects input data containing: anthropic-version (string, e.g., "2023-06-01") requests (JSON array, where each object represents a single prompt request conforming to the Anthropic Batch API schema). Submit Batch Job: Sends the formatted requests data via POST to the Anthropic API /v1/messages/batches endpoint to create a new batch job. Requires Anthropic credentials. Wait & Poll: Enters a loop: Checks if the processing_status of the batch job is ended. If not ended, it waits for a set interval (10 seconds by default in the 'Batch Status Poll Interval' node). It then checks the batch job status again via GET to /v1/messages/batches/{batch_id}. Requires Anthropic credentials. This loop continues until the status is ended. Retrieve Results: Once the batch job is complete, it fetches the results file by making a GET request to the results_url provided in the batch status response. Requires Anthropic credentials. Parse Results: The results are typically returned in JSON Lines (.jsonl) format. The 'Parse response' Code node splits the response text by newlines and parses each line into a separate JSON object, storing them in an array field (e.g., parsed). Split Output: The 'Split Out Parsed Results' node takes the array of parsed results and outputs each result object as an individual item from the workflow. Prerequisites An active n8n instance (Cloud or self-hosted). An Anthropic API account with access granted to Claude models and the Batch API. Your Anthropic API Key. Basic understanding of n8n concepts (nodes, workflows, credentials, expressions, 'Execute Workflow' node). Familiarity with JSON data structures for providing input prompts and understanding the output. Understanding of the Anthropic Batch API request/response structure. (For Example Usage Branch) Familiarity with n8n's Langchain nodes (@n8n/n8n-nodes-langchain) if you plan to adapt that part. Setup Import Template: Add this template to your n8n instance. Configure Credentials: Navigate to the 'Credentials' section in your n8n instance. Click 'Add Credential'. Search for 'Anthropic' and select the Anthropic API credential type. Enter your Anthropic API Key and save the credential (e.g., name it "Anthropic account"). Assign Credentials: Open the workflow and locate the three HTTP Request nodes in the core workflow: Submit batch Check batch status Get results In each of these nodes, select the Anthropic credential you just configured from the 'Credential for Anthropic API' dropdown. Review Input Format: Understand the required input structure for the When Executed by Another Workflow trigger node. The primary inputs are anthropic-version (string) and requests (array). Refer to the Sticky Notes in the template and the Anthropic Batch API documentation for the exact schema required within the requests array. Activate Workflow: Save and activate the core workflow so it can be called by other workflows. ➡️ Quick Start & Input/Output Examples: Look for the Sticky Notes within the workflow canvas! They provide crucial information, including examples of the required input JSON structure and the expected output format. How to customize this workflow Input Source:* The core workflow is designed to be called. You will build *another workflow that prepares the anthropic-version and requests array and then uses the 'Execute Workflow' node to trigger this template. The included example branch shows how to prepare this data. Model Selection & Parameters:* Model (claude-3-opus-20240229, etc.), max_tokens, temperature, and other parameters are defined *within each object inside the requests array you pass to the workflow trigger. You configure these in the workflow calling this template. Polling Interval:** Modify the 'Wait' node ('Batch Status Poll Interval') duration if you need faster or slower status checks (default is 10 seconds). Be mindful of potential rate limits. Parsing Logic:** If Anthropic changes the result format or you have specific needs, modify the Javascript code within the 'Parse response' Code node. Error Handling:** Enhance the workflow with more specific error handling for API failures (e.g., using 'Error Trigger' or checking HTTP status codes) or batch processing issues (batch.status === 'failed'). Output Processing:* In the workflow that *calls this template, add nodes after the 'Execute Workflow' node to process the individual result items returned (e.g., save to a database, spreadsheet, send notifications). Example Usage Branch (Manual Trigger) This template also contains a separate branch starting with the Run example Manual Trigger node. Purpose:** This branch demonstrates how to construct the necessary anthropic-version and requests array payload. Methods Shown:** It includes steps for: Creating a request object from a simple query string. Creating a request object using data from n8n's Langchain Chat Memory nodes (@n8n/n8n-nodes-langchain). Execution:** It merges these examples, constructs the final payload, and then uses the Execute Workflow node to call the main batch processing logic described above. It finishes by filtering the results for demonstration. Note:** This branch is for demonstration and testing. You would typically build your own data preparation logic in a separate workflow. The use of Langchain nodes is optional for the core batch functionality. Notes API Limits:** According to the Anthropic API documentation, batches can contain up to 100,000 requests and be up to 256 MB in total size. Ensure your n8n instance has sufficient resources for large batches. API Costs:** Using the Anthropic API, including the Batch API, incurs costs based on token usage. Monitor your usage via the Anthropic dashboard. Completion Time:** Batch processing time depends on the number and complexity of prompts and current API load. The polling mechanism accounts for this variability. Versioning:** Always include the anthropic-version header in your requests, as shown in the workflow and examples. Refer to Anthropic API versioning documentation.
by Jimleuk
This n8n template shows you how to create an MCP server out of your existing n8n workflows. With this, any MCP client connected can get more done with powerful end-to-end workflows rather than just simple tools. Designing agent tools for outcome rather than utility has been a long recommended practice of mine and it applies well when it comes to building MCP servers; In gist, agents to be making the least amount of calls possible to complete a task. This is why n8n can be a great fit for MCP servers! This template connects your agent/MCP client (like Claude Desktop) to your existing workflows by allowing the AI to discover, manage and run these workflows indirectly. How it works An MCP trigger is used and attaches 4 custom workflow tools to discover and manage existing workflows to use and 1 custom workflow tool to execute them. We'll introduce an idea of "available" workflows which the agent is allowed to use. This will help limit and avoid some issues when trying to use every workflow such as clashes or non-production. The n8n node is a core node which taps into your n8n instance API and is able to retrieve all workflows or filter by tag. For our example, we've tagged the workflows we want to use with "mcp" and these are exposed through the tool "search workflows". Redis is used as our main memory for keeping track of which workflows are "available". The tools we have are "add Workflow", "remove workflow" and "list workflows". The agent should be able to manage this autonomously. Our approach to allow the agent to execute workflows is to use the Subworkflow trigger. The tricky part is figuring out the input schema for each but was eventually solved by pulling this information out of the workflow's template JSON and adding it as part of the "available" workflow's description. To pass parameters through the Subworkflow trigger, we can do so via the passthrough method - which is that incoming data is used when parameters are not explicitly set within the node. When running, the agent will not see the "available" workflows immediately but will need to discover them via "list" and "search". The human will need to make the agent aware that these workflows will be preferred when answering queries or completing tasks. How to use First, decide which workflows will be made visible to the MCP server. This example uses the tag of "mcp" but you can all workflows or filter in other ways. Next, ensure these workflows have Subworkflow triggers with input schema set. This is how the MCP server will run them. Set the MCP server to "active" which turns on production mode and makes available to production URL. Use this production URL in your MCP client. For Claude Desktop, see the instructions here - https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger/#integrating-with-claude-desktop. There is a small learning curve which will shape how you communicate with this MCP server so be patient and test. The MCP server will work better if there is a focused goal in mind ie. Research and report, rather than just a collection of unrelated tools. Requirements N8N API key to filter for selected workflows. N8N workflows with Subworkflow triggers! Redis for memory and tracking the "available" workflows. MCP Client or Agent for usage such as Claude Desktop - https://claude.ai/download Customising this workflow If your targeted workflows do not use the subworkflow trigger, it is possible to amend the executeTool to use HTTP requests for webhooks. Managing available workflows helps if you have many workflows where some may be too similar for the agent. If this isn't a problem for you however, feel free to remove the concept of "available" and let the agent discover and use all workflows!
by Niranjan G
This workflow leverages AI to intelligently analyze incoming Gmail messages and automatically apply relevant labels based on the email content. The default configuration includes the following labels: Newsletter**: Subscription updates or promotional content. Inquiry**: Emails requesting information or responses. Invoice**: Billing and payment-related emails. Proposal**: Business offers or collaboration opportunities. Action Required**: Emails demanding immediate tasks or actions. Follow-up Reminder**: Emails prompting follow-up actions. Task**: Emails containing actionable tasks. Personal**: Non-work-related emails. Urgent**: Time-sensitive or critical communications. Bank**: Banking alerts and financial statements. Job Update**: Recruitment or job-related communications. Spam/Junk**: Unwanted or irrelevant bulk emails. Social/Networking**: Notifications from social platforms. Receipt**: Purchase confirmations and receipts. Event Invite**: Invitations or calendar-related messages. Subscription Renewal**: Reminders for subscription expirations. System Notification**: Technical alerts from services or systems. You can customize labels and definitions based on your specific use case. How it works: The workflow periodically retrieves new Gmail messages. Only emails without existing labels, regardless of read status, are sent to the AI for analysis. Email content (subject and body) is analyzed by an AI model to determine the appropriate label. Labels identified by the AI are applied to each email accordingly. Note: This workflow performs 100% better than the default Gmail trigger method, which is why the workflow was switched from Gmail trigger to a scheduled workflow. By selectively processing only unlabeled emails, it ensures comprehensive labeling while significantly reducing AI processing costs. Setup Steps: Configure credentials for Gmail and your chosen AI service (e.g., OpenAI). Ensure labels exist in your Gmail account matching the workflow definitions. Adjust the AI prompt to match your labeling needs. Optionally customize the polling interval (default: every 2 minutes). This workflow streamlines your email management, keeping your inbox organized effortlessly while optimizing resource usage.