by Encoresky
This workflow automates the process of handling conversation transcriptions and distributing key information across your organization. Here's what it does: Trigger: The workflow is initiated via a webhook that receives a transcription (e.g., from a call or meeting). Summarization & Extraction: Using AI, the transcription is summarized, and key information is extracted — such as action items, departments involved, and client details. Department Notifications: The relevant summarized information is automatically routed to specific departments via email based on content classification. CRM Sync: The summarized version is saved to the associated contact or deal in HubSpot for future reference and visibility. *Multi-Channel Alerts: *The summary is also sent via WhatsApp and Slack to keep internal teams instantly informed, regardless of platform. Use Case: Ideal for sales, customer service, or operations teams who manage client conversations and want to ensure seamless cross-departmental communication, documentation, and follow-up. Apps Used: Webhook (Trigger) OpenAI (or other AI/NLP for summarization) HubSpot Email Slack WhatsApp (via Twilio or third-party provider)
by Arlin Perez
Make your n8n instance faster, cleaner, and more efficient by deleting old workflow executions — while keeping only the most recent ones you actually need. Whether you're using n8n Cloud or self-hosted, this lightweight workflow helps reduce database/storage usage and improves UI responsiveness, using only official n8n nodes. 🔍 Description Automatically clean up old executions in your n8n instance using only official nodes — no external database queries required. Whether you're on the Cloud version or running self-hosted, this workflow helps you optimize performance and keep your instance tidy by maintaining only the most recent executions per workflow. Ideal for users managing dozens or hundreds of workflows, this solution reduces storage usage and improves the responsiveness of the n8n UI, especially in environments where execution logs can accumulate quickly. ✅ What It Does Retrieves up to 250 recent executions across all workflows Groups executions by workflow Keeps only the most recent N executions per workflow (value is configurable) Deletes all older executions (regardless of their status: success, error, etc.) Works entirely with native n8n nodes — no external database access required Optionally: set the number of executions to keep as 0 to delete all past executions from your instance in a single run 🛠️ How to Set Up 🔑 Create a Personal API Key in your n8n instance: Go to Settings → API Keys → Create a new key 🔧 Create a new n8n API Credential (used by both nodes): In your n8n credentials panel: Name: anything you like (e.g., “Internal API Access”) API Key: paste the Personal API Key you just created Base URL: your full n8n instance URL with the /api/v1 path, e.g. https://your-n8n-instance.com/api/v1 ✅ Use this credential in both: The Get Many Executions node (to fetch recent executions) The Delete Many Executions node (to remove outdated executions) 🧩 In the “Set Executions to Keep” node: Edit the variable executionsToKeep and set the number of most recent executions to retain per workflow (e.g. 10) Tip: Set it to 0 to delete all executions 📦 Note: The “Get Many Executions” node will retrieve up to 250 executions per run — this is the maximum allowed by the n8n API. 🧠 No further setup is required — the filtering and grouping logic is handled inside the Code Node automatically. 🧪 Included Nodes Overview 🕒 Schedule Trigger → Set to run daily, weekly, etc. 📥 Get Many Executions → Fetches past executions via n8n API 🛠️ Set Executions to Keep → Set how many recent ones to keep 🧠 Code Node → Filters out executions to delete per workflow 🗑️ Delete Executions → Deletes outdated executions 💡 Why Use This? Reduce clutter and improve performance in your n8n instance Maintain execution logs only when they’re useful Avoid bloating your storage or database with obsolete data Compatible with both n8n Cloud and self-hosted setups Uses only official, supported n8n nodes — no SQL, no extra setup 🔒 This workflow modifies and deletes execution data. Always review and test it first on a staging instance or on a limited set of workflows before using it in production.
by Melbin Francis
Quick overview This workflow runs nightly to read unindexed knowledge base records from Postgres, checks each record against a Postgres consent register, and only embeds eligible text with OpenAI into a pgvector index while logging decisions to a manifest and notifying a Slack channel when anything is refused or held. How it works Runs every night on a schedule. Reads unindexed documents from Postgres and separately reads the consent register from Postgres. Matches each document to its subject’s consent entry and evaluates eligibility for the required purpose, retention window, withdrawal status, profiling objections, and special category flags. Splits eligible documents into chunks, generates embeddings with OpenAI, and inserts vectors plus metadata into a Postgres pgvector table. Marks embedded documents as indexed in Postgres and writes an inclusion manifest entry recording the decision and lawful ground. Writes refused and held decisions to the same manifest table with the specific refusal/hold ground. Aggregates outcomes into a single run report and posts it to Slack if any records are refused or held. Setup Add Postgres credentials, ensure the pgvector extension is enabled, and create the required tables/columns (kb_documents with indexed_at, consent_register, the pgvector index table, and index_manifest). Add an OpenAI API credential for the embeddings model and confirm the model name matches your account access. Add Slack OAuth2 credentials and select the channel where the data protection owner should receive refusal/hold reports. Update the SQL queries, required_purpose value, and target index table name in the workflow’s configuration to match your schema and consent purpose strings. Requirements PostgreSQL with the pgvector extension enabled. Neon, Supabase, RDS or self-hosted all work. An embeddings credential. The shipped version uses OpenAI text-embedding-3-small, and any embeddings node can replace it. A Slack workspace, and a channel for the refusal report. The template ships with the channel empty, so pick yours before the first run. A consent register that already exists as data. This workflow reads consent, it does not collect it. Four tables: your documents table with an indexed_at column, plus consent_register, index_manifest and the pgvector index table. Customization The grounds are data, not code. required_purpose lives in the Consent Rules node, and the register column names the decision reads can be changed in one place. Add a refusal ground by adding one block to the decision node. Each ground is independent, so a record can fail one while passing the rest, and the manifest still names which one stopped it. Swap the vector store. Pinecone, Qdrant or Supabase drop in where the pgvector node sits, and the gate in front of it does not change. Swap Slack for email or Teams. The report node reads one field, report_text. Change the batch size on Embed In Batches if your embedding provider rate-limits you. Keep refused records in the queue, as shipped, so they are re-checked every night and stay on the report until someone resolves them. Only embedded records are marked as indexed. Additional info In plain language, with a worked example The problem. Teams put documents into a vector index so an AI assistant can search them: support notes, emails, CRM records. The usual pipeline reads everything, turns it into vectors and stores it. It never asks whether it was allowed to use any particular record. Most of the time nobody notices, until somebody does. What this adds. A gate in front of the index. Before anything is turned into vectors, each record is looked up in a consent register, which is the list your privacy team already keeps of who agreed to what, and for which purpose. One night's run, with nine documents waiting: Refund policy note, customer S-OK. Consented to AI training, still in date. EMBEDDED. Published price list. No person involved at all. EMBEDDED, on the ground not_personal. Newsletter signup note, S-PURPOSE. Consented to support and marketing, not to AI training. REFUSED, purpose limitation. Accessibility request, S-SPECIAL. Special category data. REFUSED, because it needs its own Article 9 condition rather than ordinary consent. Old support thread, S-EXPIRED. Consent expired. REFUSED, retention ran out. Churn risk comment, S-OBJECTED. Objected to profiling. REFUSED, even though consent exists. Unknown contact note, S-NOROW. Not in the register at all. REFUSED, no consent record. Historic chat log, S-WITHDRAWN. Consent withdrawn. REFUSED. Partial record, S-INCOMPLETE. The register entry is missing fields. HELD for a person to decide. Two documents go into the index. Seven do not. The data protection owner gets one Slack message: 2 of 9 record(s) were embedded. 6 refused, 1 held for a human. Why: consent withdrawn: 1 incomplete record: 1 no consent record: 1 objection to profiling: 1 purpose limitation: 1 retention expired: 1 special category: 1 Why the grouping matters. A bare count of 6 refused tells nobody anything. Purpose limitation: 1 tells them their consent wording does not cover AI training, and that is a fix they can actually make. Why held is a separate answer from refused. If the register entry is incomplete, the honest answer is that nobody knows, and both guesses are bad. Embed it and you may have used data you should not have. Refuse it and you quietly lose a record that was probably fine. So it is parked for a person instead of guessed at. What you can prove afterwards. All nine records get a row in the inclusion manifest saying what was decided and why. Six months later, when someone asks what was in the index on a given night and on what basis, the answer is a query rather than a reconstruction. Scope, stated plainly. This stops new records being indexed without a lawful basis. It does not delete vectors that are already in the index, so if consent is withdrawn after a record was embedded, removing it is a separate erasure job. Refused records deliberately stay in the queue and are re-checked every night, because consent can be granted tomorrow. It is a workflow, not legal advice: the point is that a refusal is recorded with its reason instead of happening silently or not at all.
by Hemanth Arety
Automatically fetch, curate, and distribute Reddit content digests using AI-powered filtering. This workflow monitors multiple subreddits, ranks posts by relevance, removes spam and duplicates, then delivers beautifully formatted digests to Telegram, Discord, or Slack. Who's it for Perfect for content creators tracking trends, marketers monitoring discussions, researchers following specific topics, and community managers staying informed. Anyone who wants high-quality Reddit updates without manually browsing multiple subreddits. How it works The workflow fetches top posts from your chosen subreddits using Reddit's JSON API (no authentication required). Posts are cleaned, deduplicated, and filtered by upvote threshold and custom keywords. An AI model (Google Gemini, OpenAI, or Claude) then ranks remaining posts by relevance, filters out low-quality content, and generates a formatted digest. The final output is delivered to your preferred messaging platform on a schedule or on-demand. Setup requirements n8n version 1.0+ AI provider API key (Google Gemini recommended - has free tier) At least one messaging platform configured: Telegram bot token + chat ID Discord webhook URL Slack OAuth token + channel access How to set up Open the Configuration node and edit subreddit list, post counts, and keywords Configure the Schedule Trigger or use manual execution Add your AI provider credentials in the AI Content Curator node Enable and configure your preferred delivery platform (Telegram/Discord/Slack) Test with manual execution, then activate the workflow Customization options Subreddits**: Add unlimited subreddits to monitor (comma-separated) Time filters**: Choose from hour, day, week, month, year, or all-time top posts Keywords**: Set focus keywords to prioritize and exclude keywords to filter out Post count**: Adjust how many posts to fetch vs. how many appear in final digest AI prompt**: Customize ranking criteria and output format in the AI node Schedule**: Use cron expressions for hourly, daily, or weekly digests Output format**: Modify the formatting code to match your brand style Add email notifications, database storage, or RSS feed generation by extending the workflow with additional nodes.
by Ranjan Dailata
This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger — Manually start the workflow or schedule it to run periodically. Input Setup — Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) — Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring — Clean and convert GPT output into JSON format. Data Storage (Google Sheets) — Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites If you are new to Decode, please signup on this link visit.decodo.com n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primary_keywords, seo_strength_score, keyword_density_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the “Set Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors** → Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection** → Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report** → Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization** → Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs** → Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo** for intelligent web scraping OpenAI GPT-4.1-mini** for keyword and SEO analysis Google Sheets** for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.
by Jimmy Gay
🔧 AI-Powered Auto-Maintenance System for n8n Transform your n8n instance management with this advanced automation system featuring artificial intelligence-driven workflow selection. This template provides comprehensive maintenance operations with smart filtering capabilities. ✨ Key Features 🤖 Artificial Intelligence Engine Multi-criteria scoring system for intelligent workflow selection Semantic analysis for business-critical pattern recognition Automated decision-making with configurable thresholds 🎯 Core Maintenance Operations Security Audits**: Automated vulnerability scanning with Google Sheets reporting Smart Pause/Resume**: Intelligent workflow suspension during maintenance windows AI Backup Creation**: Selective duplication of high-value workflows Intelligent Export**: Comprehensive system backups with metadata 🔐 Enterprise Security Token-based authentication with request validation Protected workflow safeguards (never modifies critical systems) Comprehensive error handling and logging ⚡ Automation & Scheduling Configurable maintenance schedules (daily, weekly, monthly) Webhook-driven operations for external integration Real-time monitoring and statistics 🎯 Perfect For DevOps Teams**: Streamline n8n maintenance operations Enterprise Users**: Manage large-scale workflow environments System Administrators**: Automated security and backup management Advanced Users**: Leverage AI for intelligent workflow management 🚀 Quick Setup Import the template Configure 4 credentials (n8n API, Google Sheets, Google Drive, Webhook Auth) Set your security token and Google Sheet ID Activate and enjoy automated maintenance! 🧠 AI Intelligence Highlights The system evaluates workflows using 6+ criteria including activity status, complexity, priority tags, business criticality, and recent updates. Workflows are automatically scored and selected based on intelligent thresholds. Selection Logic: Duplicate threshold: ≥3 points (smart backup selection) Export threshold: ≥5 points (comprehensive backup) System workflows always protected 📊 Includes 25+ configured nodes with emoji naming 4 detailed markdown documentation cards Pre-configured schedules and examples Comprehensive error handling Statistical reporting and monitoring Perfect for organizations looking to implement intelligent, automated n8n maintenance with minimal manual intervention.
by Sankalp Dev
This automation workflow transforms Meta advertising data into executive ready presentation decks, eliminating manual report creation while ensuring stakeholders receive consistent performance insights. It generates professional Google Slides presentations from your ad campaigns and delivers them automatically via email to designated recipients. By combining scheduled data extraction with AI-powered analysis and automated presentation building, you'll receive polished, actionable reports that facilitate strategic advertising decisions and client communication Key Features: Scheduled automated summary deck generation (daily, weekly, or monthly) AI powered data analysis using advanced language models Intelligent presentation generation with actionable recommendations Direct email delivery of formatted summary decks Prerequisites: GoMarble MCP account and API access Anthropic account Google Slides, Google Drive & Gmail accounts n8n instance (cloud or self-hosted) Configuration Time: ~15-20 minutes Step By Step Setup: 1. Connect GoMarble MCP to n8n Follow the integration guide: GoMarble MCP Setup Configure your Meta Ads account credentials in GoMarble platform 2. Configure the Schedule Trigger 3.Customize the Ad Account Settings. Update the account name to match your ad account name. 4. Customise the Report Prompt (Although the workflow includes a pre configured template report prompt) Define specific metrics and KPIs to track Set analysis parameters and report format preferences 5. Set up AI Agent Configuration Configure Anthropic Claude model with your API credentials Connect the GoMarble MCP tools for Meta advertising data 6. Configure Google Services Integration Set up Google Slides OAuth2 API for presentation creation Configure Google Drive OAuth2 API for file management Link Gmail OAuth2 for automated email delivery 7. Customize Email Delivery Set recipient email addresses for stakeholders Customize email subject line and message content Advanced Configuration Modify report prompt to include specific metrics and KPIs Adjust slide content structure (5-slide format: Executive Snapshot, Channel KPIs, Top Campaigns, Under-performers, Action Recommendations) What You'll Get Automated Presentation Creation: Weekly Google Slides decks generated without manual intervention Professional Ads Analysis: Executive-ready performance summaries with key metrics and insights Structured Intelligence: Consistent 5-slide format covering spend, ROAS, campaign performance, and strategic recommendations Direct Stakeholder Delivery: Presentations automatically emailed as attachments to specified recipients Data-Driven Insights: AI-powered analysis of campaign performance with actionable next steps Scalable Reporting: Easy to modify timing, recipients, or content structure as business needs evolve Perfect for marketing teams, agencies, and business owners who need regular Meta advertising performance updates delivered professionally without manual report creation.
by oka hironobu
Forecast sales trends and generate reports with Stripe, Sheets, and Gemini AI Who is this for Revenue operations teams, SaaS growth managers, and sales directors who need automated weekly insights from their Stripe payment data. Perfect for small to medium businesses tracking subscription revenue, one-time charges, and refund patterns without manual spreadsheet work. How it works Every Monday morning, the workflow pulls the previous week's charges, subscriptions, and refunds from Stripe's API. It merges this fresh data with historical sales records stored in Google Sheets, then calculates key metrics like week-over-week growth, moving averages, and MRR estimates. Google Gemini AI analyzes the compiled data to identify trends, predict next week's performance, and flag unusual revenue patterns. When significant changes are detected (20%+ variance), the system triggers targeted alerts through a separate Slack channel. All insights get logged to a Google Sheets history for tracking, while a comprehensive dashboard page updates automatically in Notion. The weekly summary posts to your main sales Slack channel, and executives receive detailed email reports with strategic recommendations. How to set up Configure Stripe API credentials with read access to charges, subscriptions, and refunds. Set up Google Sheets OAuth for both reading historical data and writing analysis logs. Create a Notion integration with page update permissions for your sales dashboard. Add Slack OAuth credentials for posting to your chosen sales and alerts channels. Configure Gmail SMTP for executive email delivery. Update the Configuration Settings node with your specific IDs, channels, and email addresses. Requirements Stripe account with API access Google Sheets with historical sales data Notion workspace for dashboard Slack workspace with posting permissions Gmail account for executive reports Google Gemini API access How to customize Adjust the anomaly detection threshold in the Calculate Trends code node (currently 50% variance triggers alerts). Modify the Slack message templates, email formatting, or add additional metrics to the Notion dashboard. Change the schedule trigger from weekly to daily or monthly based on your reporting needs.
by Takumi Oku
Who is this for Entrepreneurs looking for verified technology to license. R&D Teams tracking aerospace innovation. Content Creators covering tech trends. How it works Fetch: Gets the latest patents from NASA's Tech Transfer API. Filter & Loop: Removes empty entries and processes each patent individually. Analyze: Translates the abstract (DeepL) and uses OpenAI to brainstorm practical business applications. Archive: Saves the details to Google Sheets. Notify: Compiles a summary and sends it to Slack. How to set up Prepare Google Sheet: Create a new sheet with these exact headers in Row 1: Date Title Abstract_Translated Business_Idea Link Edit Settings: Double-click the Edit Settings node to add your Google Sheet ID, Sheet Name, and Slack Channel ID. Credentials: Configure credentials for OpenAI, DeepL, Google Sheets, and Slack. Activate: Run a test execution, then switch the workflow to Active. Requirements OpenAI: API Key (gpt-4o or gpt-3.5-turbo) DeepL: API Key (Free or Pro) Google Sheets: OAuth2 credentials with Drive/Sheets scopes. Slack: Bot User OAuth Token with chat:write scope. How to customize Change the Prompt: Edit the Generate Business Ideas node to tailor ideas for a specific niche (e.g., "Applications for medical devices"). Adjust Schedule: Change the trigger in the Weekly Schedule node to run daily or monthly. Different Output: Swap Slack for Microsoft Teams or Email nodes if preferred.
by Felix Kemeth
Overview Staying up to date with fast-moving topics like AI, machine learning, or your specific industry can be overwhelming. You either drown in daily noise or miss important developments between weekly digests. This AI News Agent workflow delivers a curated newsletter only when there's genuinely relevant news. I use it myself for AI and n8n topics. Key features: AI-driven send decision**: An AI agent evaluates whether today's news is worth sending. Deduplication**: Compares candidate articles against past newsletters to avoid repetition. Real-time news**: Uses SerpAPI's DuckDuckGo News engine for fresh results. Frequency guardrails**: Configure minimum and maximum days between newsletters. In this post, I'll walk you through the complete workflow, explain each component, and show you how to set it up yourself. What this workflow does At a high level, the AI News Agent: Fetches fresh news twice daily via SerpAPI's DuckDuckGo News engine. Stores articles in a persistent data table with automatic deduplication. Filters for freshness - only considers articles newer than your last newsletter. Applies frequency guardrails - respects your min/max sending preferences. Makes an editorial decision - AI evaluates if the news is worth sending. Enriches selected articles - uses Tavily web search for fact-checking and depth. Delivers via Telegram - sends a clean, formatted newsletter. Remembers what it sent - stores each edition to prevent future repetition. This allows you to get newsletters only when there's genuinely relevant news - in contrast to a fixed schedule. Requirements To run this workflow, you need: SerpAPI key** Create an account at serpapi.com and generate an API key. They offer 250 free searches/month. Tavily API key** Sign up at app.tavily.com and create an API key. Generous free tier available. OpenAI API key** Get one from OpenAI - required for AI agent calls. Telegram bot + chat ID** A free Telegram bot (via BotFather) and the chat/channel ID where you want the newsletter. See Telegram's bot tutorial for setup. How it works The workflow is organized into five logical stages. Stage 1: Schedule & Configuration Schedule Trigger** Runs the workflow on a cron schedule. Default: 0 0 9,17 * * * (twice daily at 9:00 and 17:00). These frequent checks enable the AI to send newsletters at these times when it observes actually relevant news, not only once a week. I picked 09:00 and 17:00 as natural check‑in points at the start and end of a typical workday, so you see updates when you’re most likely to read them without being interrupted in the middle of deep work. With SerpAPI’s 250 free searches/month, running twice per day with a small set of topics (e.g. 2–3) keeps you comfortably below the limit; if you add more topics or increase the schedule frequency, either tighten the cron window or move to a paid SerpAPI plan to avoid hitting the cap. Set topics and language** A Set node that defines your configuration: topics: comma-separated list (e.g., AI, n8n) language: output language (e.g., English) minDaysBetween: minimum days to wait (0 = no minimum) maxDaysBetween: maximum days without sending (triggers a "must-send" fallback) Stage 2: Fetch & Store News Build topic queries** Splits your comma-separated topics into individual search queries: In DuckDuckGo News via SerpAPI, a query like AI,n8n looks for news where both “AI” and “n8n” appear. For a niche tool like n8n, this is often almost identical to just searching for n8n (docs). It’s therefore better to split the topics, search for each of them separately, and let the AI later decide which news articles to select. return $input.first().json.topics.split(',').map(topic => ({ json: { topic: topic.trim() } })); Fetch news from SerpAPI (DuckDuckGo News)** HTTP Request node calling SerpAPI with: engine: duckduckgo_news q: your topic df: d (last day) Auth is handled via httpQueryAuth credentials with your SerpAPI key. SerpAPI also offers other news engines such as the Google News API (see here). DuckDuckGo News is used here because, unlike Google News, it returns an excerpt/snippet in addition to the title, source, and URL (see here)—giving the AI more context to work with. _Another option is NewsAPI, but its free tier delays articles by 24 hours, so you miss the freshness window that makes these twice-daily checks valuable. DuckDuckGo News through SerpAPI keeps the workflow real-time without that lag._ n8n has official SerpAPI nodes, but as of writing there is no dedicated node for the DuckDuckGo News API. That’s why this workflow uses a custom HTTP Request node instead, which works the same under the hood while giving you full control over the DuckDuckGo News parameters. Split SerpAPI results into articles** Expands the results array so each article becomes its own item. Upsert articles into News table** Stores each article in an n8n data table with fields: title, source, url, excerpt, date. Uses upsert on title + URL to avoid duplicates. Date is normalized to ISO UTC: DateTime.fromSeconds(Number($json.date), {zone: 'utc'}).toISO() Stage 3: Filtering & Frequency Guardrails This is where the workflow gets smart about what to consider and when to send. Get previous newsletters → Sort → Get most recent** Pulls all editions from the Newsletters table and isolates the latest one with its createdAt timestamp. Combine articles with last newsletter metadata** Attaches the last newsletter timestamp to each candidate article. Filter articles newer than last newsletter** Keeps only articles published after the last edition. Uses a safe default date (2024-01-01) if no previous newsletter exists: $json.date_2 > ($json.createdAt_1 || DateTime.fromISO('2024-01-01T00:00:00.000Z')) Stop if last newsletter is too recent** Compares createdAt against your minDaysBetween setting. If you're still in the "too soon to send" window, the workflow short-circuits here. Stage 4: AI Editorial Decision This is the core intelligence of the workflow - an AI that decides whether to send and what to include. This stage is also the actual agentic part of the workflow, where the system makes its own decisions instead of just following a fixed schedule. Aggregate candidate articles for AI** Bundles today's filtered articles into a compact list with title, excerpt, source, and url. Limit previous newsletters to last 5 → Aggregate** Prepares the last 5 newsletter contents for the AI to check against for repetition. Combine candidate articles with past newsletters** Merges both lists so the AI sees "today's candidates" + "recent history" side by side. AI: decide send + select articles** The heart of the workflow. A GPT-5.1 call with a comprehensive editorial prompt: You are an AI Newsletter Editor. Your job is to decide whether today’s newsletter edition should be sent, and to select the best articles. You will receive a list of articles with: 'title', 'excerpt', source, url. You will also receive content of previously sent newsletters (markdown). Your Tasks 1. Decide whether to send the newsletter Output "YES" only if all of the following are satisfied OR the fallback rule applies: Base Criteria There are at least 3 meaningful articles. Meaningful = not trivial, not purely promotional, not clickbait, contains actual informational value. Articles must be non-duplicate and non-overlapping: Not the same topic/headline rephrased Not reporting identical events with minor variations Not the same news covered by multiple sources without distinct insights Articles must be relevant to the user's topics: {{ $('Set topics and language').item.json.topics }} Articles must be novel relative to the topics in previous newsletters: Compare against all previous newsletters below Exclude articles that discuss topics already substantially covered Articles must offer clear value: New information Impact that matters to the user Insight, analysis, or meaningful expansion Fallback rule: Newsletter frequency requirement If at least 1 relevant article exists and the last newsletter was sent more than {{ $('Set topics and language').item.json.maxDaysBetween }} days ago, then you MUST return "YES" as a decision even if the other criteria are not completely met. Last newsletter was sent {{ $('Get most recent newsletter').item.json.createdAt ? Math.floor($now.diff(DateTime.fromISO($('Get most recent newsletter').item.json.createdAt), 'days').days) : 999 }} days ago. Otherwise → "NO" 2. If "YES": Select Articles Select the top 3–5 articles that best fulfill the criteria above. For each selected article, output: title** (rewrite for clarity, conciseness, and impact) summary** (1–2 sentences; written in the output language) source** url** All summaries must be written in: {{ $('Set topics and language').item.json.language }} Output Format (JSON) { "decision": "YES or NO", "articles": [ { "title": "...", "summary": "...", "source": "...", "url": "..." } ] } When "decision": "NO", return an empty array for "articles". Article Input Use these articles: {{ $json.results.map( article => `Title: ${article.title_2} Excerpt: ${article.excerpt_2} Source: ${article.source_2} URL: ${article.url_2}` ).join('\n---\n') }} You must also consider the topics already covered in previous newsletters to avoid repetition: {{ $json.newsletters.map(x => Newsletter: ${x.content}).join('\n---\n') }} The AI outputs structured JSON: { "decision": "YES", "articles": [ { "title": "...", "summary": "...", "source": "...", "url": "..." } ] } If AI decided to send newsletter** Routes based on decision === "YES". If NO, the workflow ends gracefully. Stage 5: Content Enrichment & Delivery Split selected articles for enrichment** Each selected article becomes its own item for individual processing. AI: enrich & write article** An AI Agent node with GPT-5.1 + Tavily web search tool. For each article: You are a research writer that updates short news summaries into concise, factual articles. Input: Title: {{ $json["title"] }} Summary: {{ $json["summary"] }} Source: {{ $json["source"] }} Original URL: {{ $json["url"] }} Language: {{ $('Set topics and language').item.json.language }} Instructions: Use Tavily Search to gather 2–3 reliable, recent, and relevant sources on this topic. Update the title if a more accurate or engaging one exists. Write 1–2 sentences summarizing the topic, combining the original summary and information from the new sources. Return the original source name and url as well. Output (JSON): { "title": "final article title", "content": "concise 1–2 sentence article content", "source": "the name of the original source", "url": "the url of the original source" } Rules: Ensure the topic is relevant, informative, and timely. Translate the article if necessary to comply with the desired language {{ $('Set topics and language').item.json.language }}. The Output Parser enforces the JSON schema with title, content, source, and url fields. Aggregate enriched articles** Collects all enriched articles back into a single array. Insert newsletter content into Newsletters table** Stores the final markdown content for future deduplication: $json.output.map(article => { const title = JSON.stringify(article.title).slice(1, -1); const content = JSON.stringify(article.content).slice(1, -1); const source = JSON.stringify(article.source).slice(1, -1); const url = JSON.stringify(article.url).slice(1, -1); return ${title}\n${content}\nSource: ${source}; }).join('\n\n') Send newsletter to Telegram** Sends the formatted newsletter to your Telegram chat/channel. Why this workflow is powerful Intelligent send decisions** The AI evaluates news quality before sending, leading to a less noisy and more relevant news digest. Memory across editions** By persisting newsletters and comparing against history, the workflow avoids repetition. Frequency guardrails with flexibility** Set boundaries (e.g., "at least 1 day between sends" and "must send within 5 days"), but let the AI decide the optimal moment within those bounds. Source-level deduplication** The news table with upsert prevents the same article from being considered multiple times across runs. Grounded in facts** SerpAPI provides real news sources; Tavily enriches with additional verification. The newsletter stays factual. Configurable and extensible** Change topics, language, frequency - all in one Set node. In addition, the workflow is modular, allowing to add new news sources or new delivery channels without touching the core logic. Configuration guide To customize this workflow for your needs: Topics and language Open Set topics and language and modify: topics: your interests (e.g., machine learning, startups, TypeScript) language: your preferred output language Frequency settings minDaysBetween: minimum days between newsletters (0 = no limit) maxDaysBetween: maximum gap before forcing a send For very high-volume topics (such as "AI"), expect the workflow to send almost every time once minDaysBetween has passed, because the content-quality criteria are usually met. Schedule Modify the Schedule Trigger cron expression. Default runs twice daily at 9:00 am and 5:00 pm; adjust to your preference. Telegram Update the chatId in the Telegram node to your chat/channel. Credentials Set up credentials for: SerpAPI (httpQueryAuth), Tavily, OpenAI, Telegram. Next steps and improvements Here are concrete directions to take this workflow further: Multi-agent architecture** Split the current AI calls into specialized agents: signal detection, relevance scoring, editorial decision, content enhancement, and formatting - each with a single responsibility. 1:1 personalization** Move from static topics to weighted preferences. Learn from click behavior and feedback. Telegram feedback buttons** Add inline buttons (👍 Useful / 👎 Not relevant / 🔎 More like this) and feed signals back into ranking. Email with HTML template** For more flexibility, send the newsletter via email. Incorporating other news APIs or RSS feeds** Add more sources such as other news APIs and RSS feeds from blogs, newsletters, or communities. Adjust for arxiv paper search and research news** Swap SerpAPI for arxiv search or other academic sources to obtain a personal research digest newsletter. Images and thumbnails** Fetch representative images for each article and include them in the newsletter. Web archive** Auto-publish each edition as a web page with permalinks. Retry logic and error handling** Add exponential backoff for external APIs and route failures to an error workflow. Prompt versioning** Move prompts to a data table with versioning for A/B testing and rollback. Audio and video news** Use audio or video models for better news communication. Wrap-up This AI News Agent workflow represents a significant evolution from simple scheduled newsletters. By adding intelligent send decisions, historical deduplication, and frequency guardrails, you get a newsletter that respects the quality of available news. I use this workflow myself to stay informed on AI and automation topics without the overload of daily news or the delayed delivery caused by a fixed newsletter schedule. Need help with your automations? Contact me here.
by Kumar SmartFlow Craft
🚀 How it works Fully automates your service order pipeline from incoming booking to supplier confirmation — with built-in SLA enforcement and automatic escalation if a supplier goes silent. 📥 Receives orders via webhook from your booking form or website 💳 Verifies payment against Stripe before processing anything 🤖 Extracts and structures order details (service type, address, date, priority) using Claude AI 👤 Upserts the customer contact and creates a deal in Freshworks CRM automatically 📧 Sends branded confirmation emails to the customer and assigned supplier via Postmark ⏱️ Enforces a 4-hour supplier acceptance SLA — escalates automatically if no response 🔁 Reassigns to a backup supplier and retries for 2 hours before flagging for manual review 🚨 Alerts your team on Slack if manual intervention is required 📊 Logs every outcome (confirmed, reassigned, escalated) to Google Sheets for full audit trail 🛠️ Set up steps Estimated setup time: ~30 minutes Webhook — copy the webhook URL and point it from your booking form or website checkout Stripe — add your Stripe secret key to the HTTP Request node; set the correct payment_intent field name from your payload Claude (Anthropic) — connect your Anthropic API credential; claude-sonnet-4-6 or higher recommended Freshworks CRM — connect your Freshworks credential; set your domain in the HTTP Request upsert node (e.g. yourcompany.freshsales.io) Postmark — add your Postmark Server Token to the HTTP Request nodes; update the sender email address Slack — connect Slack OAuth2; set your ops/dispatch channel in the alert nodes (e.g. #dispatch-alerts) Google Sheets — connect Google Sheets OAuth2; set your spreadsheet ID and sheet name in the log nodes Follow the sticky notes inside the workflow — each section has a one-liner setup guide 📋 Prerequisites Stripe account with payment intents enabled Anthropic API key (Claude API access) Freshworks CRM account (Growth plan or higher for API access) Postmark account with a verified sender domain Slack workspace with a bot or OAuth2 app Google Sheets spreadsheet set up as your audit log --- Custom Workflow Request with Personal Dashboard kumar@smartflowcraft.com https://www.smartflowcraft.com/contact More free templates https://www.smartflowcraft.com/n8n-templates
by iamvaar
Quick overview Youtube Video Explanation: https://youtu.be/GNAplBWdCDE?si=fX31M-nu3sP2b276 This workflow receives an authenticated webhook with an audio file and mobile number, looks up the matching contact and recent notes in GoHighLevel, transcribes the audio with Deepgram, generates a structured CRM call note using Gemini, and logs the results to Google Sheets before responding. How it works Receives an authenticated POST webhook request containing a contact mobile number and an uploaded audio file. Looks up the contact in GoHighLevel (LeadConnector) by the provided mobile number and continues only if a matching contact ID is found. Extracts the uploaded audio from the webhook payload and sends it to Deepgram’s transcription API to produce a call transcript. Retrieves the contact’s notes from GoHighLevel and uses only notes from the last 30 days as context. Sends the recent notes and transcript to Google Gemini to generate a structured CRM interaction note. Appends or updates a row in Google Sheets with the contact details, recent notes, execution link, and the AI-generated note. Returns the workflow result back to the original webhook request. Setup Configure the Webhook trigger URL in your calling app and include the required header authentication plus a POST body field named mobile_number and a binary audio upload. Add GoHighLevel (HighLevel OAuth2) credentials with access to contacts and notes for your location/account. Add a Deepgram API key (HTTP Header Auth) and ensure the webhook uploads an audio format supported by Deepgram. Add Google Gemini (Google PaLM) credentials for the Gemini chat model used to generate the CRM note. Add Google Sheets service account credentials, select the target spreadsheet and sheet, and replace https://enter-your-n8n-instance-url-here with your n8n base URL for the execution link.