by Jitesh Dugar
Automatically qualify inbound demo requests, scrape prospect websites, and send AI-personalized outreach emails—all on autopilot. What This Workflow Does This end-to-end lead automation workflow helps SaaS companies qualify and nurture inbound leads with zero manual work until human approval. Key Features ✅ Smart Email Filtering - Automatically flags personal emails (Gmail, Yahoo, etc.) and routes them to a polite regret message ✅ Website Intelligence - Scrapes prospect websites and extracts business context ✅ AI Analysis - Uses OpenAI to score ICP fit, identify pain points, and find personalization opportunities ✅ Personalized Outreach - AI drafts custom emails referencing specific details from their website ✅ Human-in-the-Loop - Approval gate before sending to ensure quality control ✅ Professional Branding - Even rejected leads get a thoughtful response Perfect For B2B SaaS companies with inbound lead forms Sales teams drowning in demo requests Businesses wanting to personalize at scale Anyone needing intelligent lead qualification What You'll Need Jotform account (or any form tool with webhooks) Create your form for free on Jotform using this link OpenAI API key Gmail account (or any email service) n8n instance (cloud or self-hosted) Workflow Sections 📧 Lead Intake & Qualification - Capture form submissions and filter personal emails 🕷️ Website Scraping - Extract company information from their domain ❌ Regret Flow - Send polite rejection to unqualified leads 🤖 AI Analysis - Analyze prospects and draft personalized emails 📨 Approved Outreach - Human review + send welcome email Customization Tips: Update the AI prompt with your company's ICP and value proposition Modify the personal email provider list based on your market Adjust the regret email template to match your brand voice Add Slack notifications for high-value leads Connect your CRM to log all activities Time Saved: ~15-20 minutes per lead Lead Response: Under 5 minutes (vs hours/days manually)
by DevCode Journey
Who is this for? This workflow is designed for business founders, CMOs, marketing teams, and landing page designers who want to automatically analyze their landing pages and get personalized, unconventional, high-impact conversion rate optimization (CRO) recommendations. It works by scraping the landing page content, then leveraging multiple AI models to roast the page and generate creative CRO ideas tailored specifically for that page. What this Workflow Does / Key Features Captures a landing page URL through a user-friendly form trigger. Scrapes the landing page HTML content using an HTTP request node. Sends the scraped content to a LangChain AI Agent, which orchestrates various AI models (OpenAI, Google Gemini, Mistral, etc.) for deep analysis. The AI Agent produces a friendly, fun, and unconventional “roast” of the landing page, explaining what’s wrong in human tone. Generates 10 detailed, personalized, easy-to-implement, and 2024-relevant CRO recommendations with a “wow” factor. Delivers the analysis and recommendations via Telegram message, Gmail email, and WhatsApp (via Rapiwa). Utilizes multiple AI tools and search APIs to enhance the quality and creativity of the output. Requirements OpenAI API credentials configured in n8n. Google Gemini (PaLM) API credentials for LangChain integration. Mistral Cloud API credentials for text extraction. Telegram bot credentials for sending messages. Gmail OAuth2 credentials for email delivery. Rapiwa API credentials for WhatsApp notifications. Running n8n instance with nodes: Form Trigger, HTTP Request, LangChain AI Agent, Telegram, Gmail, and custom Rapiwa node. How to Use — step-by-step Setup 1) Credentials Add your OpenAI API key under n8n credentials (OpenAi account 2). Add Google Gemini API key (Google Gemini (PaLM) Api account). Add Mistral Cloud API key (Mistral Cloud account). Set up Telegram Bot credentials (Telegram account). Set up Gmail OAuth2 credentials (Gmail account). Add Rapiwa API key for WhatsApp messages (Rapiwa). 2) Configure the Form Trigger Customize the form title, description, and landing page URL input placeholder if desired. 3) Customize Delivery Nodes Modify the Telegram, Gmail, and Rapiwa nodes with your desired recipient info and messaging preferences. 4) Run the Workflow Open the form URL webhook and submit the landing page URL to get a detailed AI-powered CRO roast and recommendations sent directly to your communication channels. Important Notes The AI Agent prompt is designed to create a fun and unconventional roast to engage users emotionally. Avoid generic advice. All CRO recommendations are personalized and contextual based on the scraped content of the provided landing page. Ensure all API credentials are kept secure and not hard-coded. Use n8n credentials management. Adjust the delivery nodes to match your preferred communication channels and recipients. The workflow supports expansion with additional AI models or messaging platforms as needed. 🙋 For Help & Community 👾 Discord: n8n channel 🌐 Website: devcodejourney.com 🔗 LinkedIn: Connect with Shakil 📱 WhatsApp Channel: Join Now 💬 Direct Chat: Message Now
by Oneclick AI Squad
Monitor Indian (NSE/BSE) and US stock markets with intelligent price alerts, cooldown periods, and multi-channel notifications (Email + Telegram). Automatically tracks price movements and sends alerts when stocks cross predefined upper/lower limits. Perfect for day traders, investors, and portfolio managers who need instant notifications for price breakouts and breakdowns. How It Works Market Hours Trigger - Runs every 2 minutes during market hours Read Stock Watchlist - Fetches your stock list from Google Sheets Parse Watchlist Data - Processes stock symbols and alert parameters Fetch Live Stock Price - Gets real-time prices from Twelve Data API Smart Alert Logic - Intelligent price checking with cooldown periods Check Alert Conditions - Validates if alerts should be triggered Send Email Alert - Sends detailed email notifications Send Telegram Alert - Instant mobile notifications Update Alert History - Records alert timestamps in Google Sheets Alert Status Check - Monitors workflow success/failure Success/Error Notifications - Admin notifications for monitoring Key Features: Smart Cooldown**: Prevents alert spam Multi-Market**: Supports Indian & US stocks Dual Alerts**: Email + Telegram notifications Auto-Update**: Tracks last alert times Error Handling**: Built-in failure notifications Setup Requirements: 1. Google Sheets Setup: Create a Google Sheet with these columns (in exact order): A**: symbol (e.g., TCS, AAPL, RELIANCE.BSE) B**: upper_limit (e.g., 4000) C**: lower_limit (e.g., 3600) D**: direction (both/above/below) E**: cooldown_minutes (e.g., 15) F**: last_alert_price (auto-updated) G**: last_alert_time (auto-updated) 2. API Keys & IDs to Replace: YOUR_GOOGLE_SHEET_ID_HERE - Replace with your Google Sheet ID YOUR_TWELVE_DATA_API_KEY - Get free API key from twelvedata.com YOUR_TELEGRAM_CHAT_ID - Your Telegram chat ID (optional) your-email@gmail.com - Your sender email alert-recipient@gmail.com - Alert recipient email 3. Stock Symbol Format: US Stocks**: Use simple symbols like AAPL, TSLA, MSFT Indian Stocks**: Use .BSE or .NSE suffix like TCS.NSE, RELIANCE.BSE 4. Credentials Setup in n8n: Google Sheets**: Service Account credentials Email**: SMTP credentials Telegram**: Bot token (optional) Example Google Sheet Data: symbol upper_limit lower_limit direction cooldown_minutes TCS.NSE 4000 3600 both 15 AAPL 180 160 both 10 RELIANCE.BSE 2800 2600 above 20 Output Example: Alert: TCS crossed the upper limit. Current Price: ₹4100, Upper Limit: ₹4000.
by Kristian Ekachandra
🎬 AI-Powered UGC Video Generator Automatically create consistent, professional UGC (User-Generated Content) videos at scale using cutting-edge AI models. This workflow combines three reference images into hyper-realistic selfie-style photos, then transforms them into engaging 8-second videos perfect for TikTok, Instagram Reels, and social media ads. ✨ What This Workflow Does Part 1: Image Generation Combines 3 reference images (product + character + background) using NanoBanana Pro AI agent generates optimized prompts for realistic UGC selfie photos Analyzes output quality before proceeding to video generation Part 2: Video Creation Transforms static images into dynamic 8-second videos using Google Veo 3.1 AI agent creates natural dialogue and scene descriptions Batch processes multiple tasks automatically via Google Sheets 🎯 Perfect For E-commerce brands** creating product demonstration videos Marketing agencies** producing social media ad content at scale Content creators** generating consistent UGC-style videos A/B testing** multiple video variations quickly Dropshippers** needing authentic product videos without filming 🚀 Key Features ✅ Consistent Characters - Same person, style, and aesthetic across all videos ✅ Batch Processing - Manage multiple tasks via Google Sheets ✅ Multi-Model Support - Primary + fallback AI models for reliability ✅ Smart Error Handling - Automatic retries and status tracking ✅ Dual Workflow - Separate pipelines for image and video generation ✅ Quality Analysis - AI checks image quality before video creation 🛠️ Required APIs Essential: Google Sheets API (free) Atlas Cloud API (for NanoBanana Pro & Veo 3.1) Choose at least ONE: OpenAI API (GPT-5-Mini recommended) Groq API (fast & free tier available) Google Gemini API (alternative) 📋 How It Works Image Generation Pipeline: Reads tasks from Google Sheets (Status: "Ready") AI agent generates optimized image prompt Downloads and uploads 3 reference images to temp storage NanoBanana Pro combines images into realistic UGC selfie Analyzes output image quality Updates sheet with results (Status: "Edited") Video Generation Pipeline: Reads edited tasks from Google Sheets (Status: "Edited") AI agent generates video prompt with natural dialogue Veo 3.1 transforms image into 8-second video Polls generation status every 10 seconds Updates sheet with final video (Status: "Finished") 💡 Pro Tips Use high-quality reference images** (minimum 1024x1024px) Keep character photos consistent** (same person, similar lighting) Write clear scene descriptions** for better results Test with 1 task first** before running large batches Monitor API quotas** to avoid rate limits 📺 Full Tutorial Complete setup walkthrough available on YouTube: Watch Tutorial 🎓 What You'll Learn Setting up multi-step AI automation workflows Integrating multiple AI models (OpenAI, Groq, Gemini) Using NanoBanana Pro for advanced image editing Generating videos with Google Veo 3.1 Managing batch processes via Google Sheets Implementing fallback models for reliability Handling errors and status tracking 📊 Google Sheets Template Structure The workflow includes a pre-built template with these columns: Task ID** - Unique identifier Product Photo** - Product image URL Character** - Person reference image URL Background** - Scene background URL Product Name** - Name of the product Product Description** - Details about the product Target Market** - Audience for the video Video Scene** - Scene description for video Status** - Workflow status (Ready → Edited → Finished) Image Prompt** - Generated prompt for image Image Result** - Output image URL Analyze Image** - Quality analysis results Video Prompt** - Generated prompt for video Video Result** - Final video URL Error Message** - Error details if failed 🔄 Status Flow Ready → Edited → Finished ↓ ↓ ↓ Error Error Error ⚙️ Customization Options Adjust Image Style: Modify the Image Prompt Agent system message Change composition (close-up, medium shot, wide) Adjust lighting (natural, studio, dramatic) Modify Video Output: Edit Video Prompt Agent for different styles Change duration (default: 8 seconds) Customize dialogue language (default: Indonesian) Adjust camera angles and movements Add More AI Models: Connect additional providers as fallbacks Models are tried in order until success Supports OpenAI, Anthropic, Groq, Gemini 🔐 Security Notes Never commit API keys to version control Use environment variables in production Don't share your Google Sheets publicly Rotate API keys regularly Set billing alerts on all platforms 📞 Support & Updates Created by: Kristian Ekachandra Follow for more AI automation workflows: 🎥 YouTube: @aichandre 📸 Instagram: @aichandre 🎵 TikTok: @aichandre 🏷️ Tags ai-video ugc content-creation video-generation batch-processing google-sheets openai groq nanobanana-pro veo-3.1 marketing social-media tiktok instagram-reels automation
by Davide
This workflow automates the full process of generating, creating, and assigning optimized WordPress tags to a specific blog post. It uses a combination of WordPress API actions, AI analysis (Claude Opus 4.5), and internal data cleaning to ensure SEO-friendly, consistent, and properly structured tags. Key Features ✅ 1. Full Tag Automation The workflow removes the need for manual tag selection or creation. It automatically: Reads the article content Chooses relevant existing tags Creates new SEO-optimized ones Assigns them to the article This eliminates human error and saves significant editorial time. ✅ 2. AI-Optimized SEO Thanks to the integrated Claude analysis, tags are: Semantically relevant Optimized for search intent Designed to improve discoverability and CTR Adapted to the specific content structure This allows for a much higher SEO quality compared to manual tagging. ✅ 3. Intelligent Tag Management The system ensures: A maximum of 4 total tags No irrelevant or duplicate tags Tags follow naming conventions (e.g., multi-word or acronyms) This creates a clean, consistent tag taxonomy across the WordPress site. ✅ 4. Automated Tag Creation in WordPress New tags are automatically created directly in WordPress via API, ensuring: Perfect synchronization with your CMS No need to manually add new tags from the WordPress backend Immediate availability for future posts ✅ 5. Clean and Reliable Data Handling Custom code nodes and aggregation steps: Merge tag arrays safely Remove duplicates Produce clean, valid JSON outputs This makes the workflow stable even with large or complex tag lists. ✅ 6. Modular and Scalable Architecture Every step (fetching, AI analysis, creation, merge, update) is separated into independent nodes, making it easy to: Extend the workflow (e.g., add categories, multilingual tags, taxonomy validation) Plug in different AI models Reuse the structure for other WordPress automations ✅ 7. Consistent Output Validation The Structured Output Parser ensures: Correct JSON schema Safe handling of AI output No malformed data sent to WordPress This makes the automation robust and production-ready. How it works This workflow is an intelligent, AI-powered tag suggestion and assignment system for WordPress. It automates the process of analyzing a blog post's content and assigning the most relevant tags, creating new ones if necessary. Data Retrieval & Preparation: The workflow starts by fetching a specific WordPress article using a provided post_id. Simultaneously, it retrieves all existing tags from the WordPress site via the REST API. These two data streams are then merged into a single data structure. AI-Powered Tag Analysis: The merged data (article content and existing tag list) is sent to an LLM (Claude Opus 4.5). The AI acts as an "SEO expert," analyzing the article's title, content, and excerpt. It follows a strict set of instructions to select up to 4 relevant tags from the existing list and, if needed, suggests new tag names to reach a total of 4 tags. Tag Processing & Creation: The workflow splits the AI's output into two paths: Existing Tags: The list of selected tag IDs is prepared for the final update. New Tags: The list of new tag names is processed in a loop. For each new tag, the workflow sends a POST request to the WordPress API to create it. The newly created tag IDs are collected. Final Assignment: The existing tag IDs and the newly created tag IDs are merged into a single list. This final list of tag IDs is then sent back to the original WordPress article via an "Update" operation, effectively tagging the post. Set up steps To configure and run this workflow, follow these steps: Provide Input Data: In the "Set data" node, you must configure the two required assignment fields: post_id: Set this to the numerical ID of the WordPress post you want to analyze and tag. url: Set this to the base URL of your WordPress site (e.g., https://yourwebsite.com/). Configure WordPress Credentials: Ensure that the "Wordpress" and "HTTP Request" nodes are correctly linked to a valid set of WordPress credentials within n8n. These credentials must have the necessary permissions to read and update posts, as well as create new tags. Configure Claude Opus 4.5 Credentials: Verify that the "Claude Chat Model" nodes are linked to a valid Claude API key credential in n8n. Execute: Once the credentials and input data are set, click "Execute Workflow" on the manual trigger node to run the process. The workflow will fetch the article, analyze it with AI, create any new tags, and update the post with the final selection of tags. Need help customizing? Contact me for consulting and support or add me on Linkedin.
by masaya kawabe
Who’s it for Marketers, creators, and social managers who want hands-off reposting of a specific X (Twitter) user’s videos — with on-brand AI captions and clean, deduplicated logs. What it does / How it works On a schedule, the workflow resolves a target user, fetches recent tweets with media, filters to video posts, and writes them to Google Sheets for tracking and dedupe. It then builds a shareable video URL, generates a short caption via an AI model (OpenRouter), posts to your X account, and updates the sheet with completion status. Sticky notes inside the workflow explain each step, setup tasks, and best practices. How to set up Add credentials: Twitter (X) OAuth2, Google Sheets OAuth2, OpenRouter. Replace the demo Google Sheet with your own (document ID & sheet name). Set the target X username (or parameterize it). Adjust the schedule (interval/cron) and run a test execution. Verify logs and posting format, then enable. Requirements Twitter (X) OAuth2 credential Google Sheets OAuth2 credential OpenRouter credential (choose an affordable model) How to customize Edit the caption prompt (tone, hashtags count, CTAs, compliance lines). Add filters (language, min/max tweet age, exclude replies/retweets, since_id). Extend logging (timestamps, posted text, account, errors). Introduce a dry-run boolean to skip posting while testing. Swap the caption model or add retry rules for robustness. Security: Don’t hardcode tokens in HTTP nodes. Use n8n Credentials only and remove personal IDs before publishing.
by George Zargaryan
Multichannel AI Assistant Demo for Chatwoot This simple n8n template demonstrates a Chatwoot integration that can: Receive new messages via a webhook. Retrieve conversation history. Process the message history into a format suitable for an LLM. Demonstrate an AI Assistant processing a user's query. Send the AI Assistant's response back to Chatwoot. Use Case: If you have multiple communication channels with your clients (e.g., Telegram, Instagram, WhatsApp, Facebook) integrated with Chatwoot, you can use this template as a starting point to build more sophisticated and tailored AI solutions that cover all channels at once. How it works A webhook receives the message created event from Chatwoot. The webhook data is then filtered to keep only the necessary information for a cleaner workflow. The workflow checks if the message is "incoming." This is crucial to prevent the assistant from replying to its own messages and creating endless loops. The conversation history is retrieved from Chatwoot via an API call using the HTTP Request node. This allows the assistant's interaction to be more natural and continuous without needing to store conversation history locally. A simple AI Assistant processes the conversation history and generates a response to the user based on its built-in knowledge base (see the prompt in the assistant node). The final HTTP Request node sends the AI-generated response back to the appropriate Chatwoot conversation. How to Use In Chatwoot, go to Settings → Integrations → Webhooks and add your n8n webhook URL. Be sure to select the message created event. In the HTTP Request nodes, replace the placeholder values: https://yourchatwooturl.com api_access_token You can find these values on your Chatwoot super admin page. The LLM node is configured to use OpenRouter. Add your OpenRouter credentials, or replace the node with your preferred LLM provider. Requirements An API key for OpenRouter or credentials for your preferred LLM provider. A Chatwoot account with at least one integrated channel and super admin access to obtain the api_access_token. Need Help Building Something More? Contact me on: Telegram:** @ninesfork LinkedIn:** George Zargaryan Happy Hacking! 🚀
by Muhammad Farooq Iqbal
🔄 How It Works - LinkedIn Post with Image Automation Overview This n8n automation creates and publishes LinkedIn posts with AI-generated images automatically. It's a complete end-to-end solution that transforms simple post titles into engaging social media content. Step-by-Step Process 1. Content Trigger & Management Google Sheets Trigger** monitors a spreadsheet for new post titles Only processes posts with "pending" status Limits to one post at a time for controlled execution 2. AI Content Generation AI Agent** uses Google Gemini to create engaging LinkedIn posts Takes the post title and generates: Compelling opening hooks 3-4 informative paragraphs Engagement questions Relevant hashtags (4-6) Appropriate emojis Output is structured and formatted for LinkedIn 3. AI Image Creation Google Gemini Image Generation** creates custom visuals Uses the AI-generated post content as context Generates professional images featuring: Modern workspace with coding elements Flutter development themes Professional, LinkedIn-appropriate aesthetics 16:9 aspect ratio, high resolution No text or captions** in the generated image 4. Image Processing & Storage Generated images are uploaded to Google Drive Files are shared with public access permissions Image URLs are stored back in the spreadsheet for tracking 5. LinkedIn Publishing LinkedIn API integration** handles the posting process: Registers image uploads Uploads images to LinkedIn's servers Creates posts with text + image Publishes to your LinkedIn profile Updates spreadsheet status to "posted" Technical Architecture Google Sheets → AI Content → AI Image → Google Drive → LinkedIn API → Status Update ↓ ↓ ↓ ↓ ↓ ↓ Trigger Gemini LLM Gemini File Upload Posting Tracking Content Gen Image Gen Key Features ✅ Fully Automated - Runs continuously without manual intervention ✅ AI-Powered - Both content and images generated by AI ✅ Professional Quality - LinkedIn-optimized formatting and visuals ✅ Real-time Tracking - Monitor status and performance ✅ Scalable - Handle multiple posts and campaigns How to Use Setup Requirements Google Gemini API for content and image generation LinkedIn API credentials for posting Google Sheets for content management Google Drive for image storage n8n instance for workflow execution Content Management Add new post titles to your Google Sheet Set status to "pending" Automation automatically processes and publishes Status updates to "posted" upon completion Customization Options Modify AI prompts for different content styles Adjust image generation parameters Change posting frequency and timing Add multiple LinkedIn accounts Integrate with other content sources Use Cases �� Perfect for: Startups** wanting consistent LinkedIn presence Marketing teams** overwhelmed with content creation HR departments** building employer branding Agencies** managing multiple client accounts Solo entrepreneurs** needing professional social media presence Benefits ⏰ Time Savings: 20+ hours per week for content teams 📈 Consistency: Daily, professional posts without gaps 🎨 Quality: AI-optimized content and visuals 📊 Scalability: Handle unlimited content volume 💰 Cost Effective: Reduce manual content creation costs 🔄 The automation runs continuously, ensuring your LinkedIn presence stays active and engaging 24/7! For inquiries: mfarooqiqbal143@gmail.com
by Wan Dinie
Generate Social Hub (link-in-bio) page with FireCrawl AI and Apify This n8n template demonstrates how to create a link-in-bio style landing page (similar to Linktree or Beacons.ai) that automatically aggregates all social media links from any website. Author's Note: I built this because I was tired of manually inserting my social media links and copying business descriptions from my website one by one into the link-in-bio platform. What used to take me 10-15 minutes now happens automatically in under a minute. Hope it saves you time too. Use cases are many: Try creating instant social hubs for sales leads or generating quick bio pages for directory listings. Good to know At time of writing, FireCrawl offers free tier with 500 credits per month. See FireCrawl pricing for updated info. Apify offers a free tier with enough credits for testing and small projects. Actor usage costs vary based on compute time. The generated HTML is fully responsive and can be embedded directly or saved as a standalone page. Average processing time is 30-45 seconds per website depending on the size and complexity. How it works We'll collect a website URL via a form trigger (accessible through webhook). Apify's Contact Details Scraper Actor extracts emails, phone numbers, and social media links from the submitted website. FireCrawl AI analyzes the website content and generates a short, compelling business description (1-2 sentences, under 150 characters). Both results are merged and processed to identify specific social platforms (Facebook, Instagram, Twitter/X, LinkedIn, YouTube, TikTok, WhatsApp). The system generates a HTML page with link-in-bio style layout, featuring brand colors, social icons, and the business description. The result is displayed as a formatted HTML response directly in the form - ready to share, embed, or save. How to use The form trigger is used as the entry point, but you can replace this with other triggers such as a webhook, schedule, or manual trigger for batch processing. You can process multiple websites by looping through a list, though processing will take longer (approximately 30-45 seconds per site). The debug node at the bottom lets you preview and edit the HTML styling before deployment. Requirements Apify API key (get one at https://apify.com) Enable the Contact Details Scraper Actor at https://console.apify.com/actors/WYyiMAvNXhfc2Rthx/input FireCrawl API key (get free access at https://www.firecrawl.dev) Valid website URLs to analyze (must be publicly accessible) Customizing this workflow Adjust wait time: The default wait time is 30 seconds in the "Wait for the Apify Scraper Process" node. Increase this if your scraper needs more time for larger websites. Modify description extraction: Edit the extraction prompt in the "Scrape website description" node to change the description length or style. FireCrawl's /extract endpoint supports natural language prompts for structured data extraction. Change HTML styling: Edit the CSS in the "Create html format" node to customize colors, fonts, layout, or add animations. The current design uses a purple gradient background with white cards. Debug HTML output: Use the "View HTML for redesign or debug" node at the bottom to preview the generated HTML without submitting through the webhook.
by Jitesh Dugar
Automated Customer Statement Generator with Risk Analysis & Credit Monitoring Transform account statement management from hours to minutes - automatically compile transaction histories, calculate aging analysis, monitor credit limits, assess payment risk, and deliver professional PDF statements while syncing with accounting systems and alerting your team about high-risk accounts. What This Workflow Does Revolutionizes customer account management with intelligent statement generation, credit monitoring, and risk assessment: Webhook-Triggered Generation** - Automatically creates statements from accounting systems, CRM updates, or scheduled monthly triggers Smart Data Validation** - Verifies transaction data, validates account information, and ensures statement accuracy before generation Running Balance Calculation** - Automatically computes running balances through all transactions with opening and closing balance tracking Comprehensive Aging Analysis** - Calculates outstanding balances by age buckets (Current, 31-60 days, 61-90 days, 90+ days) Overdue Detection & Highlighting** - Automatically identifies overdue amounts with visual color-coded alerts on statements Professional HTML Design** - Creates beautifully branded statements with modern layouts, aging breakdowns, and payment information PDF Conversion** - Transforms HTML into print-ready, professional-quality PDF statements with preserved formatting Automated Email Delivery** - Sends branded emails to customers with PDF attachments and account summary details Google Drive Archival** - Automatically saves statements to organized folders with searchable filenames by account Credit Limit Monitoring** - Tracks credit utilization, detects over-limit accounts, and generates alerts at 75%, 90%, and 100%+ thresholds Risk Scoring System** - Calculates 0-100 risk scores based on payment behavior, aging, credit utilization, and overdue patterns Payment Behavior Analysis** - Tracks days since last payment, average payment time, and payment reliability trends Automated Recommendations** - Generates prioritized action items like "escalate to collections" or "suspend new credit" Accounting System Integration** - Syncs statement delivery, balance updates, and risk assessments to QuickBooks, Xero, or FreshBooks Conditional Team Notifications** - Different Slack alerts for overdue accounts (urgent) vs current accounts (standard) with risk metrics Transaction History Table** - Detailed itemization of all charges, payments, and running balances throughout statement period Multiple Payment Options** - Includes bank details, online payment links, and account manager contact information Key Features Automatic Statement Numbering**: Generates unique sequential statement numbers with format STMT-YYYYMM-AccountNumber for easy tracking and reference Aging Bucket Analysis**: Breaks down outstanding balances into current (0-30 days), 31-60 days, 61-90 days, and 90+ days overdue categories Credit Health Dashboard**: Visual indicators show credit utilization percentage, available credit, and over-limit warnings in statement Risk Assessment Engine**: Analyzes multiple factors including overdue amounts, credit utilization, payment frequency to calculate comprehensive risk score Payment Behavior Tracking**: Monitors days since last payment, identifies patterns like "Excellent - Pays on Time" or "Poor - Chronic Late Payment" Intelligent Recommendations**: Automatically generates prioritized action items based on account status, risk level, and payment history Transaction Running Balance**: Shows balance after each transaction so customers can verify accuracy and reconcile their records Over-Limit Detection**: Immediate alerts when accounts exceed credit limits with escalation recommendations to suspend new charges Good Standing Indicators**: Visual green checkmarks and positive messaging for accounts with no overdue balances Account Manager Details**: Includes dedicated contact person for questions, disputes, and payment arrangements Dispute Process Documentation**: Clear instructions on how customers can dispute transactions within required timeframe Multi-Currency Support**: Handles USD, EUR, GBP, INR with proper currency symbols and formatting throughout statement Accounting System Sync**: Logs statement delivery, balance updates, and risk assessments in QuickBooks, Xero, FreshBooks, or Wave Conditional Workflow Routing**: Different automation paths for high-risk overdue accounts vs healthy current accounts Activity Notes Generation**: Creates detailed CRM notes with account summary, recommendations, and delivery confirmation Print-Optimized PDFs**: A4 format with proper margins and color preservation for professional printing and digital distribution Perfect For B2B Companies with Trade Credit** - Manufacturing, wholesale, distribution businesses offering net-30 or net-60 payment terms Professional Services Firms** - Consulting, legal, accounting firms with monthly retainer clients and time-based billing Subscription Services (B2B)** - SaaS platforms, software companies, membership organizations with recurring monthly charges Equipment Rental Companies** - Construction equipment, party rentals, medical equipment with ongoing rental agreements Import/Export Businesses** - International traders managing accounts receivable across multiple customers and currencies Healthcare Billing Departments** - Medical practices, clinics, hospitals tracking patient account balances and payment plans Educational Institutions** - Private schools, universities, training centers with tuition payment plans and installments Telecommunications Providers** - Phone, internet, cable companies sending monthly account statements to business customers Utilities & Energy Companies** - Electric, gas, water utilities managing commercial account statements and collections Property Management Companies** - Real estate firms tracking tenant charges, rent payments, and maintenance fees Credit Card Companies & Lenders** - Financial institutions providing detailed account activity and payment due notifications Wholesale Suppliers** - Distributors supplying restaurants, retailers, contractors on credit terms with monthly settlements Commercial Insurance Agencies** - Agencies tracking premium payments, policy charges, and outstanding balances Construction Contractors** - General contractors billing for progress payments, change orders, and retention releases What You Will Need Required Integrations HTML to PDF API - PDF conversion service (API key required) - supports HTML/CSS to PDF API, PDFShift, or similar providers (approximately 1-5 cents per statement) Gmail or SMTP - Email delivery service for sending statements to customers (OAuth2 or SMTP credentials) Google Drive - Cloud storage for statement archival and compliance record-keeping (OAuth2 credentials required) Optional Integrations Slack Webhook** - Team notifications for overdue and high-risk accounts (free incoming webhook) Accounting Software Integration** - QuickBooks, Xero, FreshBooks, Zoho Books API for automatic statement logging and balance sync CRM Integration** - HubSpot, Salesforce, Pipedrive for customer activity tracking and collections workflow triggers Payment Gateway** - Stripe, PayPal, Square payment links for one-click online payment from statements Collections Software** - Integrate with collections management platforms for automatic escalation of high-risk accounts SMS Notifications** - Twilio integration for payment due reminders and overdue alerts via text message Quick Start Import Template - Copy JSON workflow and import into your n8n instance Configure PDF Service - Add HTML to PDF API credentials in the "HTML to PDF" node Setup Gmail - Connect Gmail OAuth2 credentials in "Send Email to Customer" node and update sender email Connect Google Drive - Add Google Drive OAuth2 credentials and set folder ID for statement archival Customize Company Info - Edit "Enrich with Company Data" node to add company name, address, contact details, bank information Configure Credit Limits - Set default credit limits and payment terms for your customer base Adjust Risk Thresholds - Modify risk scoring logic in "Credit Limit & Risk Analysis" node based on your policies Update Email Template - Customize email message in Gmail node with your branding and messaging Configure Slack - Add Slack webhook URLs in both notification nodes (overdue and current accounts) Connect Accounting System - Replace code in "Update Accounting System" node with actual API call to QuickBooks/Xero/FreshBooks Test Workflow - Submit sample transaction data via webhook to verify PDF generation, email delivery, and notifications Schedule Monthly Run - Set up scheduled trigger for automatic end-of-month statement generation for all customers Customization Options Custom Aging Buckets** - Modify aging periods to match your business (e.g., 0-15, 16-30, 31-45, 46-60, 60+ days) Industry-Specific Templates** - Create different statement designs for different customer segments or business units Multi-Language Support** - Translate statement templates for international customers (Spanish, French, German, Mandarin) Dynamic Credit Terms** - Configure different payment terms by customer type (VIP net-45, standard net-30, new customers due on receipt) Late Fee Calculation** - Add automatic late fee calculation and inclusion for overdue balances Payment Plan Tracking** - Track installment payment plans with remaining balance and next payment due Interest Charges** - Calculate and add interest charges on overdue balances based on configurable rates Partial Payment Allocation** - Show how partial payments were applied across multiple invoices Customer Portal Integration** - Generate secure links for customers to view statements and make payments online Batch Processing** - Process statements for hundreds of customers simultaneously with bulk email delivery White-Label Branding** - Create different branded templates for multiple companies or subsidiaries Custom Risk Models** - Adjust risk scoring weights based on your industry and historical payment patterns Collections Workflow Integration** - Automatically create tasks in collections software for high-risk accounts Early Payment Incentives** - Highlight early payment discounts or prompt payment benefits on statements Dispute Management** - Track disputed transactions and adjust balances accordingly with audit trail Expected Results 90% time savings** - Reduce statement creation from 2-3 hours to 5 minutes per customer 100% accuracy** - Eliminate calculation errors and missing transactions through automated processing 50% faster payment collection** - Professional statements with clear aging drive faster customer payments Zero filing time** - Automatic Google Drive organization with searchable filenames by account 30% reduction in overdue accounts** - Proactive credit monitoring and risk alerts prevent bad debt Real-time risk visibility** - Instant identification of high-risk accounts before they become uncollectible Automated compliance** - Complete audit trail with timestamped statement delivery and accounting sync Better customer communication** - Professional statements improve customer satisfaction and reduce disputes Reduced bad debt write-offs** - Early warning system catches payment issues before they escalate Improved cash flow** - Faster statement delivery and payment reminders accelerate cash collection Pro Tips Schedule Monthly Batch Generation** - Run workflow automatically on last day of month to generate statements for all customers simultaneously Customize Aging Thresholds** - Adjust credit alert levels (75%, 90%, 100%) based on your risk tolerance and industry norms Segment Customer Communications** - Use different email templates for VIP customers vs standard customers vs delinquent accounts Track Payment Patterns** - Monitor days-to-pay metrics by customer to identify chronic late payers proactively Integrate with Collections** - Connect workflow to collections software to automatically escalate 90+ day accounts Include Payment Portal Links** - Add unique payment links to each statement for one-click online payment Automate Follow-Up Reminders** - Build workflow extension to send payment reminders 7 days before due date Create Executive Dashboards** - Export risk scores and aging data to business intelligence tools for trend analysis Document Dispute Resolutions** - Log all disputed transactions in accounting system with resolution notes Test with Sample Data First** - Validate aging calculations with known test data before processing real customer accounts Archive Statements for Compliance** - Maintain 7-year archive in Google Drive organized by year and customer Monitor Credit Utilization Trends** - Track credit utilization changes month-over-month to predict cash flow needs Benchmark Against Industry** - Compare your DSO and bad debt ratios to industry averages to identify improvement areas Personalize Account Manager Info** - Assign dedicated contacts to customers and include their direct phone and email Use Descriptive Transaction Details** - Ensure transaction descriptions clearly explain charges to reduce disputes Business Impact Metrics Track these key metrics to measure workflow success: Statement Generation Time** - Measure average minutes from trigger to delivered statement (target: under 5 minutes) Statement Volume Capacity** - Count monthly statements generated through automation (expect 10-20x increase in capacity) Aging Calculation Accuracy** - Track statements with aging errors (target: 0% error rate) Days Sales Outstanding (DSO)** - Monitor average days to collect payment (expect 15-30% reduction) Bad Debt Write-Offs** - Track uncollectible accounts as percentage of revenue (expect 30-50% reduction) Collection Rate** - Monitor percentage of invoices collected within terms (expect 10-20% improvement) Customer Disputes** - Count statement disputes and billing inquiries (expect 50-70% reduction) Over-Limit Accounts** - Track number of accounts exceeding credit limits (early detection prevents losses) High-Risk Account Identification** - Measure days between risk detection and collection action (target: within 48 hours) Cash Flow Improvement** - Calculate working capital improvement from faster collections (typical: 20-35% improvement) Template Compatibility Compatible with n8n version 1.0 and above Works with n8n Cloud and Self-Hosted instances Requires HTML to PDF API service subscription (1-5 cents per statement) No coding required for basic setup Fully customizable for industry-specific requirements Integrates with major accounting platforms via API Multi-currency and multi-language ready Supports batch processing for large customer bases Compliant with financial record-keeping regulations Ready to transform your account receivables management? Import this template and start generating professional statements with credit monitoring, risk assessment, and automated collections alerts - improving your cash flow, reducing bad debt, and freeing your accounting team to focus on strategic financial management!
by Vigh Sandor
Workflow Overview This advanced n8n workflow provides intelligent email automation with AI-generated responses. It combines four core functions: Monitors incoming emails via IMAP (e.g., SOGo) Sends instant Telegram notifications for all new emails Uses AI (Ollama LLM) to generate contextual, personalized auto-replies Sends confirmation notifications when auto-replies are sent Unlike traditional auto-responders, this workflow analyzes email content and creates unique, relevant responses for each message. Setup Instructions Prerequisites Before setting up this workflow, ensure you have: An n8n instance (self-hosted or cloud) with AI/LangChain nodes enabled IMAP email account credentials (e.g., SOGo, Gmail, Outlook) SMTP server access for sending emails Telegram Bot API credentials Telegram Chat ID where notifications will be sent Ollama installed locally or accessible via network (for AI model) The llama3.1 model downloaded in Ollama Step 1: Install and Configure Ollama Local Installation Install Ollama on your system: Visit https://ollama.ai and download the installer for your OS Follow installation instructions for your platform Download the llama3.1 model: ollama pull llama3.1 Verify the model is available: ollama list Start Ollama service (if not already running): ollama serve Test the model: ollama run llama3.1 "Hello, world!" Remote Ollama Instance If using a remote Ollama server: Note the server URL (e.g., http://192.168.1.100:11434) Ensure network connectivity between n8n and Ollama server Verify firewall allows connections on port 11434 Step 2: Configure IMAP Credentials Navigate to n8n Credentials section Create a new IMAP credential with the following information: Host: Your IMAP server address Port: Usually 993 for SSL/TLS Username: Your email address Password: Your email password or app-specific password Enable SSL/TLS: Yes (recommended) Security: Use STARTTLS or SSL/TLS Step 3: Configure SMTP Credentials Create a new SMTP credential in n8n Enter the following details: Host: Your SMTP server address (e.g., Postfix server) Port: Usually 587 (STARTTLS) or 465 (SSL) Username: Your email address Password: Your email password or app-specific password Secure connection: Enable based on your server configuration Allow unauthorized certificates: Enable if using self-signed certificates Step 4: Configure Telegram Bot Create a Telegram bot via BotFather: Open Telegram and search for @BotFather Send /newbot command Follow instructions to create your bot Save the API token provided by BotFather Obtain your Chat ID: Method 1: Send a message to your bot, then visit: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates Method 2: Use a Telegram Chat ID bot like @userinfobot Method 3: For group chats, add the bot to the group and check the updates Note: Group chat IDs are negative numbers (e.g., -1234567890123) Add Telegram API credential in n8n: Credential Type: Telegram API Access Token: Your bot token from BotFather Step 5: Configure Ollama API Credential In n8n Credentials section, create a new Ollama API credential Configure based on your setup: For local Ollama: Base URL is usually http://localhost:11434 For remote Ollama: Enter the server URL (e.g., http://192.168.1.100:11434) Test the connection to ensure n8n can reach Ollama Step 6: Import and Configure Workflow Import the workflow JSON into your n8n instance Update the following nodes with your specific information: Check Incoming Emails Node Verify IMAP credentials are connected Configure polling interval (optional): Default behavior checks on workflow trigger schedule Can be set to check every N minutes Set mailbox folder if needed (default is INBOX) Send Notification from Incoming Email Node Update chatId parameter with your Telegram Chat ID Replace -1234567890123 with your actual chat ID Customize notification message template if desired Current format includes: Sender, Subject, Date-Time Dedicate Filtering As No-Response Node Review spam filter conditions: Blocks emails from addresses containing "noreply" or "no-reply" Blocks emails with "newsletter" in subject line (case-insensitive) Add additional filtering rules as needed: Block specific domains Filter by keywords Whitelist/blacklist specific senders Ollama Model Node Verify Ollama API credential is connected Confirm model name: llama3.1:bf230501 (or adjust to your installed version) Context window set to 4096 tokens (sufficient for most emails) Can be adjusted based on your needs and hardware capabilities Basic LLM Chain Node Review the AI prompt engineering (pre-configured but customizable) Current prompt instructs the AI to: Read the email content Identify main topic in 2-4 words Generate a professional acknowledgment response Keep responses consistent and concise Modify prompt if you want different response styles Send Auto-Response in SMTP Node Verify SMTP credentials are connected Check fromEmail uses correct email address: Currently set to {{ $('Check Incoming Emails - IMAP (example: SOGo)').item.json.to }} This automatically uses the recipient address (your mailbox) Subject automatically includes "Re: " prefix with original subject Message text comes from AI-generated content Send Notification from Response Node Update chatId parameter (same as first notification node) This sends confirmation that auto-reply was sent Includes original email details and the AI-generated response text Step 7: Test the Workflow Perform initial configuration test: Test Ollama connectivity: curl http://localhost:11434/api/tags Verify all credentials are properly configured Check n8n has access to required network endpoints Execute a test run: Click "Execute Workflow" button in n8n Send a test email to your monitored inbox Use a clear subject and body for better AI response Verify workflow execution: First Telegram notification received (incoming email alert) AI processes the email content Auto-reply is sent to the original sender Second Telegram notification received (confirmation with AI response) Check n8n execution log for any errors Verify email delivery: Check if auto-reply arrived at sender's inbox Verify it's not marked as spam Review AI-generated content for appropriateness Step 8: Fine-Tune AI Responses Send various types of test emails: Different topics (inquiry, complaint, information request) Various email lengths (short, medium, long) Different languages if applicable Review AI-generated responses: Check if topic identification is accurate Verify response appropriateness Ensure tone is professional Adjust the prompt if needed: Modify topic word count (currently 2-4 words) Change response template Add language-specific instructions Include custom sign-offs or branding Step 9: Activate the Workflow Once testing is successful and AI responses are satisfactory: Toggle the workflow to "Active" state The workflow will now run automatically on the configured schedule Monitor initial production runs: Review first few auto-replies carefully Check Telegram notifications for any issues Verify SMTP delivery rates Set up monitoring: Enable n8n workflow error notifications Monitor Ollama resource usage Check email server logs periodically How to Use Normal Operation Once activated, the workflow operates fully automatically: Email Monitoring: The workflow continuously checks your IMAP inbox for new messages based on the configured polling interval or trigger schedule. Immediate Incoming Notification: When a new email arrives, you receive an instant Telegram notification containing: Sender's email address Email subject line Date and time received Note indicating it's from IMAP mailbox Intelligent Filtering: The workflow evaluates each email against spam filter criteria: Emails from "noreply" or "no-reply" addresses are filtered out Emails with "newsletter" in the subject line are filtered out Filtered emails receive notification but no auto-reply Legitimate emails proceed to AI response generation AI Response Generation: For emails that pass the filter: The AI reads the full email content Analyzes the main topic or purpose Generates a personalized acknowledgment Creates a professional response that: Thanks the sender References the specific topic Promises a personal follow-up Maintains professional tone Automatic Reply Delivery: The AI-generated response is sent via SMTP to the original sender with: Subject line: "Re: [Original Subject]" From address: Your monitored mailbox Body: AI-generated contextual message Response Confirmation: After the auto-reply is sent, you receive a second Telegram notification showing: Original email details (sender, subject, date) The complete AI-generated response text Confirmation of successful delivery Understanding AI Response Generation The AI analyzes emails intelligently: Example 1: Business Inquiry Incoming Email: "I'm interested in your consulting services for our Q4 project..." AI Topic Identification: "consulting services" Generated Response: "Dear Correspondent! Thank you for your message regarding consulting services. I will respond with a personal message as soon as possible. Have a nice day!" Example 2: Technical Support Incoming Email: "We're experiencing issues with the API integration..." AI Topic Identification: "API integration issues" Generated Response: "Dear Correspondent! Thank you for your message regarding API integration issues. I will respond with a personal message as soon as possible. Have a nice day!" Example 3: General Question Incoming Email: "Could you provide more information about pricing?" AI Topic Identification: "pricing information" Generated Response: "Dear Correspondent! Thank you for your message regarding pricing information. I will respond with a personal message as soon as possible. Have a nice day!" Customizing Filter Rules To modify which emails receive AI-generated auto-replies: Open the "Dedicate Filtering As No-Response" node Modify existing conditions or add new ones: Block specific domains: {{ $json.from.value[0].address }} Operation: does not contain Value: @spam-domain.com Whitelist VIP senders (only respond to specific people): {{ $json.from.value[0].address }} Operation: contains Value: @important-client.com Filter by subject keywords: {{ $json.subject.toLowerCase() }} Operation: does not contain Value: unsubscribe Combine multiple conditions: Use AND logic (all must be true) for stricter filtering Use OR logic (any can be true) for more permissive filtering Customizing AI Prompt To change how the AI generates responses: Open the "Basic LLM Chain" node Modify the prompt text in the "text" parameter Current structure: Context setting (read email, identify topic) Output format specification Rules for AI behavior Example modifications: Add company branding: Return only this response, filling in the [TOPIC]: Dear Correspondent! Thank you for reaching out to [Your Company Name] regarding [TOPIC]. I will respond with a personal message as soon as possible. Best regards, [Your Name] [Your Company Name] Make it more casual: Return only this response, filling in the [TOPIC]: Hi there! Thanks for your email about [TOPIC]. I'll get back to you personally soon. Cheers! Add urgency classification: Read the email and classify urgency (Low/Medium/High). Identify the main topic. Return: Dear Correspondent! Thank you for your message regarding [TOPIC]. Priority: [URGENCY] I will respond with a personal message as soon as possible. Customizing Telegram Notifications Incoming Email Notification: Open "Send Notification from Incoming Email" node Modify the "text" parameter Available variables: {{ $json.from }} - Full sender info {{ $json.from.value[0].address }} - Sender email only {{ $json.from.value[0].name }} - Sender name (if available) {{ $json.subject }} - Email subject {{ $json.date }} - Date received {{ $json.textPlain }} - Email body (use cautiously for privacy) {{ $json.to }} - Recipient address Response Confirmation Notification: Open "Send Notification from Response" node Modify to include additional information Reference AI response: {{ $('Basic LLM Chain').item.json.text }} Monitoring and Maintenance Daily Monitoring Check Telegram Notifications**: Review incoming email alerts and response confirmations Verify AI Quality**: Spot-check AI-generated responses for appropriateness Email Delivery**: Confirm auto-replies are being delivered (not caught in spam) Weekly Maintenance Review Execution Logs**: Check n8n execution history for errors or warnings Ollama Performance**: Monitor resource usage (CPU, RAM, disk space) Filter Effectiveness**: Assess if spam filters are working correctly Response Quality**: Review multiple AI responses for consistency Monthly Maintenance Update Ollama Model**: Check for new llama3.1 versions or alternative models Prompt Optimization**: Refine AI prompt based on response quality observations Credential Rotation**: Update passwords and API tokens for security Backup Configuration**: Export workflow and credentials (securely) Advanced Usage Multi-Language Support If you receive emails in multiple languages: Modify the AI prompt to detect language: Detect the email language. Generate response in the SAME language as the email. If English: [English template] If Hungarian: [Hungarian template] If German: [German template] Or use language-specific conditions in the filtering node Priority-Based Responses Generate different responses based on sender importance: Add an IF node after filtering to check sender domain Route VIP emails to a different LLM chain with priority messaging Standard emails use the normal AI chain Response Logging To maintain a record of all AI interactions: Add a database node (PostgreSQL, MySQL, etc.) after the auto-reply node Store: timestamp, sender, subject, AI response, delivery status Use for compliance, analytics, or training data A/B Testing AI Prompts Test different prompt variations: Create multiple LLM Chain nodes with different prompts Use a randomizer or round-robin approach Compare response quality and user feedback Optimize based on results Troubleshooting Notifications Not Received Problem: Telegram notifications not appearing Solutions: Verify Chat ID is correct (positive for personal chats, negative for groups) Check if bot has permissions to send messages Ensure bot wasn't blocked or removed from group Test Telegram API credential independently Review n8n execution logs for Telegram API errors AI Responses Not Generated Problem: Auto-replies sent but content is empty or error messages Solutions: Check Ollama service is running: ollama list Verify llama3.1 model is downloaded: ollama list Test Ollama directly: ollama run llama3.1 "Test message" Review Ollama API credential URL in n8n Check network connectivity between n8n and Ollama Increase context window if emails are very long Monitor Ollama logs for errors Poor Quality AI Responses Problem: AI generates irrelevant or inappropriate responses Solutions: Review and refine the prompt engineering Add more specific rules and constraints Provide examples in the prompt of good vs bad responses Adjust topic word count (increase from 2-4 to 3-6 words) Test with different Ollama models (e.g., llama3.1:70b for better quality) Ensure email content is being passed correctly to AI Auto-Replies Not Sent Problem: Workflow executes but emails not delivered Solutions: Verify SMTP credentials and server connectivity Check fromEmail address is correct Review SMTP server logs for errors Test SMTP sending independently Ensure "Allow unauthorized certificates" is enabled if needed Check if emails are being filtered by spam filters Verify SPF/DKIM records for your domain High Resource Usage Problem: Ollama consuming excessive CPU/RAM Solutions: Reduce context window size (from 4096 to 2048) Use a smaller model variant (llama3.1:8b instead of default) Limit concurrent workflow executions in n8n Add delay/throttling between email processing Consider using a remote Ollama instance with better hardware Monitor email volume and processing time IMAP Connection Failures Problem: Workflow can't connect to email server Solutions: Verify IMAP credentials are correct Check if IMAP is enabled on email account Ensure SSL/TLS settings match server requirements For Gmail: enable "Less secure app access" or use App Passwords Check firewall allows outbound connections on IMAP port (993) Test IMAP connection using email client (Thunderbird, Outlook) Workflow Not Triggering Problem: Workflow doesn't execute automatically Solutions: Verify workflow is in "Active" state Check trigger node configuration and schedule Review n8n system logs for scheduler issues Ensure n8n instance has sufficient resources Test manual execution to isolate trigger issues Check if n8n workflow execution queue is backed up Workflow Architecture Node Descriptions Check Incoming Emails - IMAP: Polls email server at regular intervals to retrieve new messages from the configured mailbox. Send Notification from Incoming Email: Immediately sends formatted notification to Telegram for every new email detected, regardless of spam status. Dedicate Filtering As No-Response: Evaluates emails against spam filter criteria to determine if AI processing should occur. No Operation: Placeholder node for filtered emails that should not receive an auto-reply (spam, newsletters, automated messages). Ollama Model: Provides the AI language model (llama3.1) used for natural language processing and response generation. Basic LLM Chain: Executes the AI prompt against the email content to generate contextual auto-reply text. Send Auto-Response in SMTP: Sends the AI-generated acknowledgment email back to the original sender via SMTP server. Send Notification from Response: Sends confirmation to Telegram showing the auto-reply was successfully sent, including the AI-generated content. AI Processing Pipeline Email Content Extraction: Email body text is extracted from IMAP data Context Loading: Email content is passed to LLM with prompt instructions Topic Analysis: AI identifies main subject or purpose in 2-4 words Template Population: AI fills response template with identified topic Output Formatting: Response is formatted and cleaned for email delivery Quality Assurance: n8n validates response before sending
by vinci-king-01
Product Price Monitor with Slack and Jira ⚠️ COMMUNITY TEMPLATE DISCLAIMER: This is a community-contributed template that uses ScrapeGraphAI (a community node). Please ensure you have the ScrapeGraphAI community node installed in your n8n instance before using this template. This workflow automatically scrapes multiple e-commerce sites, analyses weekly seasonal price trends, and notifies your team in Slack while opening Jira tickets for items that require price adjustments. It helps retailers plan inventory and pricing by surfacing actionable insights every week. Pre-conditions/Requirements Prerequisites n8n instance (self-hosted or n8n cloud) ScrapeGraphAI community node installed Slack workspace & channel for notifications Jira Software project (cloud or server) Basic JavaScript knowledge for optional custom code edits Required Credentials ScrapeGraphAI API Key** – Enables web scraping Slack OAuth Access Token** – Required by the Slack node Jira Credentials** – Email & API token (cloud) or username & password (server) (Optional) Proxy credentials – If target websites block direct scraping Specific Setup Requirements | Resource | Purpose | Example | |----------|---------|---------| | Product URL list | Seed URLs to monitor | https://example.com/products-winter-sale | | Slack Channel | Receives trend alerts | #pricing-alerts | | Jira Project Key | Tickets are created here | ECOM | How it works This workflow automatically scrapes multiple e-commerce sites, analyses weekly seasonal price trends, and notifies your team in Slack while opening Jira tickets for items that require price adjustments. It helps retailers plan inventory and pricing by surfacing actionable insights every week. Key Steps: Webhook Trigger**: Kicks off the workflow via a weekly schedule or manual call. Set Product URLs**: Prepares the list of product pages to analyse. SplitInBatches**: Processes URLs in manageable batches to avoid rate limits. ScrapeGraphAI**: Extracts current prices, stock, and seasonality hints from each URL. Code (Trend Logic)**: Compares scraped prices against historical averages. If (Threshold Check)**: Determines if price deviations exceed ±10%. Slack Node**: Sends a formatted message to the pricing channel for each deviation. Jira Node**: Creates/updates a ticket linking to the product for further action. Merge**: Collects all batch results for summary reporting. Set up steps Setup Time: 15-20 minutes Install Community Nodes: In n8n, go to Settings → Community Nodes, search for “ScrapeGraphAI”, and install. Add Credentials: a. Slack → Credentials → New, paste your Bot/User OAuth token. b. Jira → Credentials → New, enter your domain, email/username, API token/password. c. ScrapeGraphAI → Credentials → New, paste your API key. Import Workflow: Upload or paste the JSON template into n8n. Edit the “Set Product URLs” Node: Replace placeholder URLs with your real product pages. Configure Schedule: Replace the Webhook Trigger with a Cron node (e.g., every Monday 09:00) or keep as webhook for manual runs. Map Jira Fields: In the Jira node, ensure Project Key, Issue Type (e.g., Task), and Summary fields match your instance. Test Run: Execute the workflow. Confirm Slack message appears and a Jira issue is created. Activate: Toggle the workflow to Active so it runs automatically. Node Descriptions Core Workflow Nodes: Webhook** – Default trigger, can be swapped with Cron for weekly automation. Set (Product URLs)** – Stores an array of product links for scraping. SplitInBatches** – Limits each ScrapeGraphAI call to five URLs to reduce load. ScrapeGraphAI** – Crawls and parses HTML, returning JSON with title, price, availability. Code (Trend Logic)** – Calculates percentage change vs. historical data (stored externally or hard-coded for demo). If (Threshold Check)** – Routes items above/below the set variance. Slack** – Posts a rich-format message containing product title, old vs. new price, and link. Jira* – Creates or updates a ticket with priority set to *Medium and assigns to the Pricing team lead. Merge** – Recombines batch streams for optional reporting or storage. Data Flow: Webhook → Set (Product URLs) → SplitInBatches → ScrapeGraphAI → Code (Trend Logic) → If → Slack / Jira → Merge Customization Examples Change Price Deviation Threshold // Code (Trend Logic) node const threshold = 0.05; // 5% instead of default 10% Alter Slack Message Template { "text": ${item.name} price changed from $${item.old} to $${item.new} (${item.diff}%)., "attachments": [ { "title": "Product Link", "title_link": item.url, "color": "#4E79A7" } ] } Data Output Format The workflow outputs structured JSON data: { "product": "Winter Jacket", "url": "https://example.com/winter-jacket", "oldPrice": 129.99, "newPrice": 99.99, "change": -23.06, "scrapedAt": "2023-11-04T09:00:00Z", "status": "Below Threshold", "slackMsgId": "A1B2C3", "jiraIssueKey": "ECOM-101" } Troubleshooting Common Issues ScrapeGraphAI returns empty data – Verify selectors; many sites use dynamic rendering, require a headless browser flag. Slack message not delivered – Check that the OAuth token scopes include chat:write; also confirm channel ID. Jira ticket creation fails – Field mapping mismatch; ensure Issue Type is valid and required custom fields are supplied. Performance Tips Batch fewer URLs (e.g., 3 instead of 5) to reduce timeout risk. Cache historical prices in an external DB (Postgres, Airtable) instead of reading large CSVs in the Code node. Pro Tips: Rotate proxies/IPs within ScrapeGraphAI to bypass aggressive e-commerce anti-bot measures. Add a Notion or Sheets node after Merge for historical logging. Use the Error Trigger workflow in n8n to alert when ScrapeGraphAI fails more than X times per run.