by PiAPI
What does the workflow do? This workflow is primarily designed to generate animated illustrations for content creators and social media professionals with Midjourney (unoffcial) and Kling (unofficial) API served by PiAPI. PiAPI is an API platform which provides professional API service. With service provided by PiAPI, users could generate a fantastic animated artwork simply using workflow on n8n without complex settings among various AI models. What is animated illustration? An animated illustration is a digitally enhanced artwork that combines traditional illustration styles with subtle, purposeful motion to enrich storytelling while preserving its original artistic essence. Who is this workflow for? Social Media Content Creators: Produces animated illustrations for social media posts. Digital Marketers: Generates marketing materials with motion graphics. Independent Content Producers: Creates animated content without specialized animation skills. Step-by-step Setting Instructions To simplify workflow settings, usually users just need to change basic prompt of the image and the motion of the final video following the instrution below: Sign in your PiAPI account and get your X-API-Key. Fill in your X-API-Key of PiAPI account in Midjourney and Kling nodes. Enter your desired image prompt in the Prompt node. Enter the motion prompt in Kling Video Generator node. For more complex or customization settings, users could also add more nodes to get more output images and generate more videos. Also, they could change the target image to gain a better result. As for recommendation, users could change the video models for which we would recommend live-wallpaper LoRA of Wanx. Users could check API doc to see more use cases of video models and image models for best practice. Use Case Input Prompt A gentle girl and a fluffy rabbit explore a sunlit forest together, playing by a sparkling stream. Butterflies flutter around them as golden sunlight filters through green leaves. Warm and peaceful atmosphere, 4K nature documentary style. --s 500 --sref 4028286908 --niji 6 Output Video When there is troubleshooting Check if the X-API-Key has been filled in nodes needed. Check your task status in Task History in PiAPI to get more details about task status. More Generation Case for Reference
by darrell_tw
Water Reminder Workflow This workflow demonstrates how to use n8n and Slack to build an intelligent water drinking reminder system, combined with Google Sheets for data recording and OpenAI for generating personalized reminder messages. Google Sheet Template The iOS shortcut template: The result in iOS health: The template demo in Youtube Key Features Scheduled Reminders: Automatically sends water reminders at random times every hour. Intelligent Scheduling: Delays the next reminder if you've recently had water. AI-Generated Messages: Uses OpenAI to generate friendly and non-repetitive reminder messages. Data Tracking: Records daily water intake and calculates percentage of goal achievement. Quick Response: Easily record water intake through Slack buttons. iOS Integration: Provides iOS shortcut links to sync data with the Health app. Pre-Configuration Requirements To use this workflow, you need to set up the following: Google Sheets: Create a Google spreadsheet with log and setting sheets The log sheet should include date, time, and value columns The setting sheet is used to store daily water intake goals Slack: Create a Slack app and obtain an API token Configure permissions for interactive buttons OpenAI: Obtain an OpenAI API key iOS Shortcut (optional): Create an iOS shortcut named darrell_water for recording health data Node Configurations 1. Scheduled Triggers and Data Collection 1.1. Schedule Trigger Purpose**: Triggers water reminders on schedule Configuration**: Cron Expression: 0 {{ Math.floor(Math.random() * 11) }} 8-23 * * * Triggers at a random minute every hour, only between 8 AM and 11 PM 1.2. Google Sheets - Get Target Purpose**: Retrieves daily water intake goal Configuration**: Document ID: Your Google spreadsheet ID Sheet Name: setting 1.3. Google Sheets - Get Log Purpose**: Retrieves today's water intake records Configuration**: Document ID: Your Google spreadsheet ID Sheet Name: log Filter Condition: date equals today's date {{ $now.format('yyyy-MM-dd') }} 1.4. Summarize Purpose**: Calculates total water intake for today Configuration**: Fields to Summarize: value (sum) 1.5. Limit Purpose**: Gets the most recent water intake record Configuration**: Keep: Last items 2. Intelligent Reminder Logic 2.1. Combine Data Purpose**: Merges target and actual water intake data Configuration**: Combine By: Combine by position Number of Inputs: 3 2.2. If Purpose**: Checks if water was consumed recently Configuration**: Condition: {{ DateTime.fromISO($json.date+"T"+$json.time).format('yyyy-MM-dd HH:mm:ss') }} is after {{ $now.minus(30, "minutes") }} 2.3. Wait Purpose**: Randomly delays the reminder if water was consumed recently Configuration**: Wait Time: {{ Math.floor(Math.random() * 1) + 1 }} minutes 3. AI Message Generation and Sending 3.1. OpenAI Purpose**: Generates personalized water reminder messages Configuration**: Model: gpt-4o-mini Messages: System prompt: Requests responses in Traditional Chinese and in JSON format User prompt: Includes information about last water time, current time, goal, and progress Temperature: 1 3.2. Slack Send Drink Notification Purpose**: Sends water reminders to Slack channel Configuration**: Channel: Your Slack channel ID Message Type: Block Block UI: Contains AI-generated reminder message and water amount buttons (100ml, 150ml, 200ml, 250ml, 300ml) 4. User Interaction and Data Recording 4.1. Slack Drink Webhook Purpose**: Receives user interactions when water buttons are clicked Configuration**: HTTP Method: POST Path: slack-water-webhook 4.2. Slack Action Payload Purpose**: Parses Slack interaction data Configuration**: Mode: Raw JSON Output: {{ $json.body.payload }} 4.3. Slack Action Drink Data Purpose**: Extracts water amount and message information Configuration**: Assignments: value: {{ $json.actions[0].value }} message_text: {{ $json.message.text }} shortcut_url: shortcuts://run-shortcut?name=darrell_water&input= shortcut_url_data: JSON containing water amount and time message_ts: {{ $json.container.message_ts }} 4.4. Google Sheets Purpose**: Records water intake data to spreadsheet Configuration**: Operation: Append Document ID: Your Google spreadsheet ID Sheet Name: log Column Mapping: date: {{ $now.format('yyyy-MM-dd') }} time: {{ $now.format('HH:mm:ss') }} value: {{ $json.value }} 4.5. Send to Slack with Confirm Purpose**: Sends confirmation message and provides iOS shortcut link Configuration**: Channel: Your Slack channel ID Message Type: Block Block UI: Contains confirmation message and iOS Health app button Reply Settings: Reply to the thread of the original message Author Information This workflow was created by darrell_tw_, an engineer focused on AI and Automation. Contact: X Threads Instagram Website
by vinci-king-01
Product Price Monitor with Pushover and Baserow ⚠️ 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 for selected products, analyzes weekly pricing trends, stores historical data in Baserow, and sends an instant Pushover notification when significant price changes occur. It is ideal for retailers who need to track seasonal fluctuations and optimize inventory or pricing strategies. Pre-conditions/Requirements Prerequisites An active n8n instance (self-hosted or n8n.cloud) ScrapeGraphAI community node installed At least one publicly accessible webhook URL (for on-demand runs) A Baserow database with a table prepared for product data Pushover account and registered application Required Credentials ScrapeGraphAI API Key** – Enables web-scraping capabilities Baserow: Personal API Token** – Allows read/write access to your table Pushover: User Key & API Token** – Sends mobile/desktop push notifications (Optional) HTTP Basic Token or API Keys for any private e-commerce endpoints you plan to monitor Baserow Table Specification | Field Name | Type | Description | |------------|-----------|--------------------------| | Product ID | Number | Internal or SKU | | Name | Text | Product title | | URL | URL | Product page | | Price | Number | Current price (float) | | Currency | Single select (USD, EUR, etc.) | | Last Seen | Date/Time | Last price check | | Trend | Number | 7-day % change | How it works This workflow automatically scrapes multiple e-commerce sites for selected products, analyzes weekly pricing trends, stores historical data in Baserow, and sends an instant Pushover notification when significant price changes occur. It is ideal for retailers who need to track seasonal fluctuations and optimize inventory or pricing strategies. Key Steps: Webhook Trigger**: Manually or externally trigger the weekly price-check run. Set Node**: Define an array of product URLs and metadata. Split In Batches**: Process products one at a time to avoid rate limits. ScrapeGraphAI Node**: Extract current price, title, and availability from each URL. If Node**: Determine if price has changed > ±5 % since last entry. HTTP Request (Trend API)**: Retrieve seasonal trend scores (optional). Merge Node**: Combine scrape data with trend analysis. Baserow Nodes**: Upsert latest record and fetch historical data for comparison. Pushover Node**: Send alert when significant price movement detected. Sticky Notes**: Documentation and inline comments for maintainability. Set up steps Setup Time: 15-25 minutes Install Community Node: In n8n, go to “Settings → Community Nodes” and install ScrapeGraphAI. Create Baserow Table: Match the field structure shown above. Obtain Credentials: ScrapeGraphAI API key from your dashboard Baserow personal token (/account/settings) Pushover user key & API token Clone Workflow: Import this template into n8n. Configure Credentials in Nodes: Open each ScrapeGraphAI, Baserow, and Pushover node and select/enter the appropriate credential. Add Product URLs: Open the first Set node and replace the example array with your actual product list. Adjust Thresholds: In the If node, change the 5 value if you want a higher/lower alert threshold. Test Run: Execute the workflow manually; verify Baserow rows and the Pushover notification. Schedule: Add a Cron trigger or external scheduler to run weekly. Node Descriptions Core Workflow Nodes: Webhook** – Entry point for manual or API-based triggers. Set** – Holds the array of product URLs and meta fields. SplitInBatches** – Iterates through each product to prevent request spikes. ScrapeGraphAI** – Scrapes price, title, and currency from product pages. If** – Compares new price vs. previous price in Baserow. HTTP Request** – Calls a trend API (e.g., Google Trends) to get seasonal score. Merge** – Combines scraping results with trend data. Baserow (Upsert & Read)** – Writes fresh data and fetches historical price for comparison. Pushover** – Sends formatted push notification with price delta. StickyNote** – Documents purpose and hints within the workflow. Data Flow: Webhook → Set → SplitInBatches → ScrapeGraphAI ScrapeGraphAI → If True branch → HTTP Request → Merge → Baserow Upsert → Pushover False branch → Baserow Upsert Customization Examples Change Notification Channel to Slack // Replace the Pushover node with Slack { "channel": "#pricing-alerts", "text": 🚨 ${$json["Name"]} changed by ${$json["delta"]}% – now ${$json["Price"]} ${$json["Currency"]} } Additional Data Enrichment (Stock Status) // Add to ScrapeGraphAI's selector map { "stock": { "selector": ".availability span", "type": "text" } } Data Output Format The workflow outputs structured JSON data: { "ProductID": 12345, "Name": "Winter Jacket", "URL": "https://shop.example.com/winter-jacket", "Price": 79.99, "Currency": "USD", "LastSeen": "2024-11-20T10:34:18.000Z", "Trend": 12, "delta": -7.5 } Troubleshooting Common Issues Empty scrape result – Check if the product page changed its HTML structure; update CSS selectors in ScrapeGraphAI. Baserow “Row not found” errors – Ensure Product ID or another unique field is set as the primary key for upsert. Performance Tips Limit batch size to 5-10 URLs to avoid IP blocking. Use n8n’s built-in proxy settings if scraping sites with geo-restrictions. Pro Tips: Store historical JSON responses in a separate Baserow table for deeper analytics. Standardize currency symbols to avoid false change detections. Couple this workflow with an n8n Dashboard to visualize price trends in real-time.
by Garri
Description This workflow is an n8n-based automation that allows users to download TikTok/Reels videos without watermarks simply by sending the video link through a Telegram Bot. It uses a Telegram Trigger to receive the link from the user, then makes an HTTP request to a third-party API (tiktokio.com) to process and retrieve the download link. The workflow filters the results to find the Download without watermark link, downloads the video in MP4 format, and sends it back to the user directly in their Telegram chat. Key features: Supports the best available video quality (bestvideo+bestaudio). Automatically removes watermarks. Instant response directly in Telegram chat. Fully automated — no manual downloads required. How It Works Telegram Trigger The user sends a TikTok or Reels link to the Telegram bot. The workflow captures and stores the link for processing. HTTP Request – MediaDL API The link is sent via POST method to https://mediadl.app/api/download. The API processes the link and returns video file data. Wait Delay The workflow waits a few seconds to ensure the API response is fully ready. Edit Fields Extracts the video file URL from the API response. Additional Wait Delay Adds a short pause to avoid connection errors during the download process. HTTP Request – Proxy Download Downloads the MP4 video file directly from the filtered URL. Send Video via Telegram The downloaded video is sent back to the user in their Telegram chat. How to Set Up Create & Configure a Telegram Bot Open Telegram and search for BotFather. Send /newbot → choose a name & username for your bot. Copy the Bot Token provided — you’ll need it in n8n. Prepare Your n8n Environment Log in to your n8n instance (self-hosted or n8n Cloud). Go to Credentials → create new Telegram API credentials using your Bot Token. Import the Workflow In n8n, click Import and select the PROJECT_DOWNLOAD_TIKTOK_REELS.json file. Configure the Telegram Nodes In the Telegram Trigger and Send Video nodes, connect your Telegram API credentials. Configure the HTTP Request Nodes Ensure the Download2 and HTTP Request nodes have the correct URL and headers (pre-configured for mediadl.app). Make sure the responseFormat is set to file in the final download node. Activate the Workflow Toggle Activate in the top right corner of n8n. Test by sending a TikTok or Reels link to your bot — you should receive the no-watermark video in return.
by vinci-king-01
Lead Scoring Pipeline with Mattermost and Trello This workflow automatically enriches incoming form-based leads, calculates a lead-score from multiple data points, and then routes high-value prospects to a Mattermost alert channel while adding all leads to Trello for further handling. It centralizes lead intelligence and streamlines sales team triage—no manual spreadsheet work required. Pre-conditions/Requirements Prerequisites n8n instance (self-hosted or n8n cloud) ScrapeGraphAI community node installed Active Trello and Mattermost workspaces Lead-capture form or webhook that delivers JSON payloads Required Credentials Trello API Key & Token** – Access to the board/list where cards will be created Mattermost Access Token** – Permission to post messages in the target channel (Optional) Clearbit / Apollo / 3rd-party enrichment keys** – If you replace the sample enrichment HTTP requests Specific Setup Requirements | Variable | Purpose | Example Value | |-------------------------|-------------------------------------------|------------------------| | MM_CHANNEL_ID | Mattermost channel to post high-score leads | leads-alerts | | TRELLO_BOARD_ID | Board where new cards are added | 62f1d… | | TRELLO_LIST_ID_HOT | Trello list for hot leads | Hot Deals | | TRELLO_LIST_ID_BACKLOG| Trello list for all other leads | New Leads | | LEAD_SCORE_THRESHOLD | Score above which a lead is considered hot| 70 | How it works This workflow grabs new leads at a defined interval, enriches each lead with external data, computes a custom score, and routes the lead: high-scorers trigger a Mattermost alert and are placed in a “Hot Deals” list, while the rest are stored in a “Backlog” list on Trello. All actions are fully automated and run unattended once configured. Key Steps: Schedule Trigger**: Runs every 15 minutes to poll for new form submissions. HTTP Request – Fetch Leads**: Retrieves the latest unprocessed leads from your form backend or CRM API. Split In Batches**: Processes leads 20 at a time to respect API rate limits. HTTP Request – Enrich Lead**: Calls external enrichment (e.g., Clearbit) to append company and person data. Code – Calculate Score**: JavaScript that applies weightings to enriched attributes and outputs a numeric score. IF – Score Threshold**: Branches flow based on LEAD_SCORE_THRESHOLD. Mattermost Node**: Sends a rich-text message with lead details for high-score prospects. Trello Node (Hot List)**: Creates a Trello card in the “Hot Deals” list for high-value leads. Trello Node (Backlog)**: Creates a Trello card in the “New Leads” list for everyone else. Merge & Flag Processed**: Marks leads as processed to avoid re-processing in future runs. Set up steps Setup Time: 10–15 minutes Import the Workflow: Download the JSON template and import it into n8n. Create / Select Credentials: Add your Trello API key & token under Trello API credentials. Add your Mattermost personal access token under Mattermost API credentials. Configure Environment Variables: Set MM_CHANNEL_ID, TRELLO_BOARD_ID, TRELLO_LIST_ID_HOT, TRELLO_LIST_ID_BACKLOG, and LEAD_SCORE_THRESHOLD in n8n → Settings → Environment. Form Backend Endpoint: Update the first HTTP Request node with the correct URL and authentication for your form or CRM. (Optional) Enrichment Provider: Replace the sample enrichment HTTP Request with your chosen provider’s endpoint and credentials. Test Run: Execute the workflow manually with a sample payload to ensure Trello cards and Mattermost messages are produced. Activate: Enable the workflow; it will now run on the defined schedule. Node Descriptions Core Workflow Nodes: Schedule Trigger** – Triggers workflow every 15 minutes. HTTP Request (Fetch Leads)** – Pulls unprocessed leads. SplitInBatches** – Limits processing to 20 leads per batch. HTTP Request (Enrich Lead)** – Adds firmographic & technographic data. Code (Calculate Score)** – JavaScript scoring algorithm; outputs score field. IF (Score ≥ Threshold)** – Determines routing path. Mattermost** – Sends formatted message with lead summary & score. Trello (Create Card)** – Adds lead as a card to the appropriate list. Merge (Flag Processed)** – Updates source system to mark lead as processed. Data Flow: Schedule Trigger → HTTP Request (Fetch Leads) → SplitInBatches → HTTP Request (Enrich Lead) → Code (Calculate Score) → IF IF (Yes) → Mattermost → Trello (Hot List) IF (No) → Trello (Backlog) Both branches → Merge (Flag Processed) Customization Examples Adjust Scoring Weights // Code node: adjust weights to change scoring logic const weights = { industry: 15, companySize: 25, jobTitle: 20, intentSignals: 40 }; Dynamic Trello List Mapping // Use a Lookup table instead of IF node const mapping = { hot: 'TRELLO_LIST_ID_HOT', cold: 'TRELLO_LIST_ID_BACKLOG' }; items[0].json.listId = mapping[items[0].json.segment]; return items; Data Output Format The workflow outputs structured JSON data: { "leadId": "12345", "email": "jane.doe@example.com", "score": 82, "priority": "hot", "trelloCardUrl": "https://trello.com/c/abc123", "mattermostPostId": "78yzk9n8ppgkkp" } Troubleshooting Common Issues Trello authentication fails – Ensure the token has write access and that the API key & token pair belong to the same Trello account. Mattermost message not sent – Confirm the token can post in the target channel and that MM_CHANNEL_ID is correct. Performance Tips Batch leads in groups of 20–50 to avoid enrichment API rate-limit errors. Cache enrichment responses for repeat domains to reduce API calls. Pro Tips: Add a second IF node to send ultra-high (>90) scores directly to an account executive via email. Store raw enrichment responses in a database for future analytics. Use n8n’s built-in Execution Data Save to debug edge-cases without rerunning external API calls.
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 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 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.
by Davide
This workflow automates the creation of long AI-generated videos from prompts, merges the generated clips into a single video, and automatically distributes the final content across multiple platforms. The process starts with a Google Sheet that acts as the control panel for the workflow. Each row in the sheet contains a prompt, the duration of the clip, and a starting frame. The workflow reads this data and generates video clips sequentially. Using the RunPod WAN 2.5 video generation API, the workflow creates individual video segments based on the prompt and input image. Each segment is then stored and tracked in the spreadsheet. Once all clips are generated, the workflow uses the Fal.run FFmpeg API to merge them into a single long video. After merging, the final video is retrieved automatically. The workflow also extracts the last frame of each generated clip to use as the starting frame for the next clip, ensuring smooth visual continuity between scenes. Finally, the completed video is automatically: Uploaded to Google Drive for storage Published to YouTube Uploaded to Postiz, which distributes it to social platforms such as TikTok, Instagram, Facebook, X, and YouTube This creates a fully automated pipeline that transforms prompts in a spreadsheet into a finished long-form video distributed across multiple platforms. Key Advantages 1. ✅ Fully Automated Video Production The workflow automates the entire process of generating, assembling, and publishing videos, eliminating manual editing and upload steps. 2. ✅ Spreadsheet-Based Control Using Google Sheets as the input system makes the workflow easy to manage and scalable. Users can create or modify video scenes simply by editing rows in the sheet. 3. ✅ Scalable AI Video Generation The workflow can generate multiple clips and combine them into longer videos, enabling the creation of long-form content from short AI-generated segments. 4. ✅ Seamless Scene Continuity By extracting the last frame of each clip and using it as the starting frame for the next scene, the workflow maintains visual continuity between segments. 5. ✅ Automatic Video Merging The Fal.run FFmpeg API merges all generated clips into a single final video without requiring external editing tools. 6. ✅ Multi-Platform Distribution Once the video is completed, it is automatically uploaded and published to multiple platforms, significantly reducing the time needed for content distribution. 7. ✅ Centralized Storage The final video is saved to Google Drive, providing organized and secure storage for the generated content. 8. ✅ Error Handling and Status Monitoring The workflow continuously checks the status of generation and processing tasks, waiting and retrying until the job is completed. How it works This workflow automates the creation of long videos by generating multiple clips from a Google Sheet and merging them together. Here's the process: Trigger & Data Loading: When manually executed, the workflow reads a Google Sheet containing video generation parameters (prompts, durations, and starting images). Video Generation Loop: For each row marked for processing, it: Sends the prompt and parameters to RunPod's WAN 2.5 video generation API Waits for completion (with status checking every 60 seconds) Retrieves the generated video URL and updates the Google Sheet Frame Extraction: After each video is generated, it extracts the last frame using Fal.ai's FFmpeg API and updates the next row's starting image (creating visual continuity). Video Merging: Once all individual clips are generated (marked with "x" in the MERGE column), the workflow: Collects all video URLs Sends them to Fal.ai's FFmpeg merge API Polls for completion every 60 seconds Retrieves the final merged video Distribution: The final long video is: Uploaded to Google Drive Posted to YouTube via Upload-Post API Posted to multiple social platforms (TikTok, Instagram, Facebook, X) via Postiz Setup steps Google Sheet Setup: Clone this template sheet Update the sheet ID in all Google Sheets nodes Fill in columns: START (initial image URL), PROMPT, DURATION (4, 6, or 8 seconds) Mark rows to merge with "x" in the MERGE column API Credentials Required: Google Sheets OAuth2: For reading/writing spreadsheet data Google Drive OAuth2: For uploading final videos Fal.ai API Key: For frame extraction and video merging RunPod API Key: For WAN 2.5 video generation Upload-Post API Key: For YouTube uploads Postiz API Key: For social media posting Configure Nodes: Update YOUR_USERNAME in the "Upload to Youtube" node Set channel IDs and titles in the "Upload to Social" node (integrationId, content) Verify folder IDs in Google Drive nodes Test: Run the workflow manually to generate your first long video sequence 👉 Subscribe to my new YouTube channel. Here I’ll share videos and Shorts with practical tutorials and FREE templates for n8n. Need help customizing? Contact me for consulting and support or add me on Linkedin.