by Servify
This n8n template demonstrates how to build an autonomous AI assistant that handles real business tasks through natural conversation on Telegram. The example shows meeting scheduling with CRM lookup and calendar management, but the architecture supports any business automation you can imagine - simply add tools and the AI learns to use them automatically. Use cases are many: Try automating appointment scheduling, customer support tickets, invoice generation, lead qualification, email management, report generation, data entry, or task coordination! Good to know OpenAI API costs are minimal at ~$0.001 per conversation with GPT-4o-mini The AI agent makes autonomous decisions and can chain multiple tool calls to complete complex tasks Conversation context is not persisted between sessions (can be extended with a memory database) Calendar availability is checked for business hours (9 AM - 4 PM) by default The workflow assumes contacts are stored in Google Sheets with Name and Email columns This is production-ready code that can be deployed immediately for real business use How it works User sends a natural language message to the Telegram bot requesting a meeting The workflow extracts message content, chat ID, and user information CRM database is loaded from Google Sheets containing contact information The AI agent analyzes the request and autonomously decides which tools to use AI searches CRM for contacts, checks Google Calendar availability, and proposes 3 available time slots User confirms their preferred time through conversational reply Upon confirmation, the workflow creates a Google Calendar event with both parties invited A professional confirmation email is automatically sent via Gmail to the meeting attendee The entire multi-step process executes autonomously through simple conversation How to use Set up a Google Sheet as your CRM with columns: Name, Email, Phone Create a Telegram bot via BotFather and get your bot token Import this workflow and connect your credentials (Telegram, OpenAI, Google Sheets, Calendar, Gmail) Replace placeholder IDs with your actual Google Sheet ID and Calendar ID in the workflow nodes Activate the workflow to start listening for Telegram messages Test with: "Schedule a meeting with [contact name] tomorrow at 2 PM" Customize the AI Agent system prompt to match your scheduling preferences and timezone Requirements Telegram Bot Token (free from BotFather) OpenAI API account with GPT-4o-mini access Google Sheets OAuth2 credentials for CRM database access Google Calendar OAuth2 credentials for availability checking and event creation Gmail OAuth2 credentials for sending confirmation emails Customising this workflow Add new tools (APIs, databases, services) and the AI automatically learns to use them - no code changes needed Replace Telegram with Slack, WhatsApp, or SMS for different communication channels Extend capabilities beyond scheduling: invoice generation, customer support, lead qualification, report generation Connect external systems like HubSpot, Salesforce, QuickBooks, Asana, or custom APIs Add conversation memory by integrating a vector database for context-aware multi-turn conversations Implement approval workflows where AI drafts actions for human review before execution Build multiple specialized assistants with different tools and expertise for various business functions
by explorium
Inbound Agent - AI-Powered Lead Qualification with Product Usage Intelligence This n8n workflow automatically qualifies and scores inbound leads by combining their product usage patterns with deep company intelligence. The workflow pulls new leads from your CRM, analyzes which API endpoints they've been testing, enriches them with firmographic data, and generates comprehensive qualification reports with personalized talking points—giving your sales team everything they need to prioritize and convert high-quality leads. DEMO Template Demo Credentials Required To use this workflow, set up the following credentials in your n8n environment: Salesforce Type:** OAuth2 or Username/Password Used for:** Pulling lead reports and creating follow-up tasks Alternative CRM options: HubSpot, Zoho, Pipedrive Get credentials at Salesforce Setup Databricks (or Analytics Platform) Type:** HTTP Request with Bearer Token Header:** Authorization Value:** Bearer YOUR_DATABRICKS_TOKEN Used for:** Querying product usage and API endpoint data Alternative options: Datadog, Mixpanel, Amplitude, custom data warehouse Explorium API Type:** Generic Header Auth Header:** Authorization Value:** Bearer YOUR_API_KEY Used for:** Business matching and firmographic enrichment Get your API key at Explorium Dashboard Explorium MCP Type:** HTTP Header Auth Used for:** Real-time company intelligence and supplemental research Connect to: https://mcp.explorium.ai/mcp Anthropic API Type:** API Key Used for:** AI-powered lead qualification and analysis Get your API key at Anthropic Console Go to Settings → Credentials, create these credentials, and assign them in the respective nodes before running the workflow. Workflow Overview Node 1: When clicking 'Execute workflow' Manual trigger that initiates the lead qualification process. Type:** Manual Trigger Purpose:** On-demand execution for testing or manual runs Alternative Trigger Options: Schedule Trigger:** Run automatically (hourly, daily, weekly) Webhook:** Trigger on CRM updates or new lead events CRM Trigger:** Real-time activation when leads are created Node 2: GET SF Report Pulls lead data from a pre-configured Salesforce report. Method:** GET Endpoint:** Salesforce Analytics Reports API Authentication:** Salesforce OAuth2 Returns: Raw Salesforce report data including: Lead contact information Company names Lead source and status Created dates Custom fields CRM Alternatives: This node can be replaced with HubSpot, Zoho, or any CRM's reporting API. Node 3: Extract Records Parses the Salesforce report structure and extracts individual lead records. Extraction Logic: Navigates report's factMap['T!T'].rows structure Maps data cells to named fields Node 4: Extract Tenant Names Prepares tenant identifiers for usage data queries. Purpose: Formats tenant names as SQL-compatible strings for the Databricks query Output: Comma-separated, quoted list: 'tenant1', 'tenant2', 'tenant3' Node 5: Query Databricks Queries your analytics platform to retrieve API usage data for each lead. Method:** POST Endpoint:** /api/2.0/sql/statements Authentication:** Bearer token in headers Warehouse ID:** Your Databricks cluster ID Platform Alternatives: Datadog:** Query logs via Logs API Mixpanel:** Event segmentation API Amplitude:** Behavioral cohorts API Custom Warehouse:** PostgreSQL, Snowflake, BigQuery queries Node 6: Split Out Splits the Databricks result array into individual items for processing. Field:** result.data_array Purpose:** Transform single response with multiple rows into separate items Node 7: Rename Keys Normalizes column names from database query to readable field names. Mapping: 0 → TenantNames 1 → endpoints 2 → endpointsNum Node 8: Extract Business Names Prepares company names for Explorium enrichment. Node 9: Loop Over Items Iterates through each company for individual enrichment. Node 10: Explorium API: Match Businesses Matches company names to Explorium's business entity database. Method:** POST Endpoint:** /v1/businesses/match Authentication:** Header Auth (Bearer token) Returns: business_id: Unique Explorium identifier matched_businesses: Array of potential matches Match confidence scores Node 11: Explorium API: Firmographics Enriches matched businesses with comprehensive company data. Method:** POST Endpoint:** /v1/businesses/firmographics/bulk_enrich Authentication:** Header Auth (Bearer token) Returns: Company name, website, description Industry categories (NAICS, SIC, LinkedIn) Size: employee count range, revenue range Location: headquarters address, city, region, country Company age and founding information Social profiles: LinkedIn, Twitter Logo and branding assets Node 12: Merge Combines API usage data with firmographic enrichment data. Node 13: Organize Data as Items Structures merged data into clean, standardized lead objects. Data Organization: Maps API usage by tenant name Maps enrichment data by company name Combines with original lead information Creates complete lead profile for analysis Node 14: Loop Over Items1 Iterates through each qualified lead for AI analysis. Batch Size:** 1 (analyzes leads individually) Purpose:** Generate personalized qualification reports Node 15: Get many accounts1 Fetches the associated Salesforce account for context. Resource:** Account Operation:** Get All Filter:** Match by company name Limit:** 1 record Purpose: Link lead qualification back to Salesforce account for task creation Node 16: AI Agent Analyzes each lead to generate comprehensive qualification reports. Input Data: Lead contact information API usage patterns (which endpoints tested) Firmographic data (company profile) Lead source and status Analysis Process: Evaluates lead quality based on usage, company fit, and signals Identifies which Explorium APIs the lead explored Assesses company size, industry, and potential value Detects quality signals (legitimate company email, active usage) and red flags Determines optimal sales approach and timing Connected to Explorium MCP for supplemental company research if needed Output: Structured qualification report with: Lead Score:** High Priority, Medium Priority, Low Priority, or Nurture Quick Summary:** Executive overview of lead potential API Usage Analysis:** Endpoints used, usage insights, potential use case Company Profile:** Overview, fit assessment, potential value Quality Signals:** Positive indicators and concerns Recommended Actions:** Next steps, timing, and approach Talking Points:** Personalized conversation starters based on actual API usage Node 18: Clean Outputs Formats the AI qualification report for Salesforce task creation. Node 19: Update Salesforce Records Creates follow-up tasks in Salesforce with qualification intelligence. Resource:** Task Operation:** Create Authentication:** Salesforce OAuth2 Alternative Output Options: HubSpot:** Create tasks or update deal stages Outreach/SalesLoft:** Add to sequences with custom messaging Slack:** Send qualification reports to sales channels Email:** Send reports to account owners Google Sheets:** Log qualified leads for tracking Workflow Flow Summary Trigger: Manual execution or scheduled run Pull Leads: Fetch new/updated leads from Salesforce report Extract: Parse lead records and tenant identifiers Query Usage: Retrieve API endpoint usage data from analytics platform Prepare: Format data for enrichment Match: Identify companies in Explorium database Enrich: Pull comprehensive firmographic data Merge: Combine usage patterns with company intelligence Organize: Structure complete lead profiles Analyze: AI evaluates each lead with quality scoring Format: Structure qualification reports for CRM Create Tasks: Automatically populate Salesforce with actionable intelligence This workflow eliminates manual lead research and qualification, automatically analyzing product engagement patterns alongside company fit to help sales teams prioritize and personalize their outreach to the highest-value inbound leads. Customization Options Flexible Triggers Replace the manual trigger with: Schedule:** Run hourly/daily to continuously qualify new leads Webhook:** Real-time qualification when leads are created CRM Trigger:** Activate on specific lead status changes Analytics Platform Integration The Databricks query can be adapted for: Datadog:** Query application logs and events Mixpanel:** Analyze user behavior and feature adoption Amplitude:** Track product engagement metrics Custom Databases:** PostgreSQL, MySQL, Snowflake, BigQuery CRM Flexibility Works with multiple CRMs: Salesforce:** Full integration (pull reports, create tasks) HubSpot:** Contact properties and deal updates Zoho:** Lead enrichment and task creation Pipedrive:** Deal qualification and activity creation Enrichment Depth Add more Explorium endpoints: Technographics:** Tech stack and product usage News & Events:** Recent company announcements Funding Data:** Investment rounds and financial events Hiring Signals:** Job postings and growth indicators Output Destinations Route qualification reports to: CRM Updates:** Salesforce, HubSpot (update lead scores/fields) Task Creation:** Any CRM task/activity system Team Notifications:** Slack, Microsoft Teams, Email Sales Tools:** Outreach, SalesLoft, Salesloft sequences Reporting:** Google Sheets, Data Studio dashboards AI Model Options Swap AI providers: Default: Anthropic Claude (Sonnet 4) Alternatives: OpenAI GPT-4, Google Gemini Setup Notes Salesforce Report Configuration: Create a report with required fields (name, email, company, tenant ID) and use its API endpoint Tenant Identification: Ensure your product usage data includes identifiers that link to CRM leads Usage Data Query: Customize the SQL query to match your database schema and table structure MCP Configuration: Explorium MCP requires Header Auth—configure credentials properly Lead Scoring Logic: Adjust AI system prompts to match your ideal customer profile and qualification criteria Task Assignment: Configure Salesforce task assignment rules or add logic to route to specific sales reps This workflow acts as an intelligent lead qualification system that combines behavioral signals (what they're testing) with firmographic fit (who they are) to give sales teams actionable intelligence for every inbound lead.
by Oneclick AI Squad
AI Customer Call Analyzer — Voice → Insights → CRM with GPT-4 Converts raw sales call recordings into structured CRM intelligence. Uploads audio → transcribes via Whisper → GPT-4 extracts intent, sentiment, objections, next steps → updates CRM and sends a structured summary to the sales team. How it works Upload Call Recording - Webhook receives audio file upload (mp3, wav, m4a) from sales rep portal Validate & Prepare Audio - Checks file type, size limits, extracts call metadata Transcribe via Whisper - Sends audio to OpenAI Whisper API for high-accuracy transcription Wait — Transcription Buffer - Holds until transcription is confirmed complete GPT-4 Call Intelligence - Extracts intent, sentiment, objections, buying signals, action items MCP Context Enrichment - Pulls CRM history and enriches analysis with account context Update CRM Record - Writes structured insights back to CRM (HubSpot / Salesforce) Send Sales Summary - Emails rep and manager with call scorecard and next steps Audit Log - Records all processing steps for compliance and coaching Setup Steps Import this workflow into n8n Configure credentials: OpenAI API - For Whisper transcription and GPT-4 analysis HubSpot / Salesforce - CRM update target Google Sheets - Audit log and call registry SMTP / Gmail - Sales summary delivery Set your CRM API endpoint and field mapping in the update node Configure your sales team email list in the notify node Activate the workflow Sample Upload Payload { "callId": "CALL-20250222-0042", "repEmail": "jane.smith@company.com", "repName": "Jane Smith", "contactEmail": "buyer@prospect.com", "contactName": "Bob Johnson", "companyName": "Acme Corp", "dealStage": "negotiation", "callDurationSecs": 1847, "audioUrl": "https://storage.company.com/calls/call-0042.mp3" } Features Whisper-powered transcription** with speaker diarization hints GPT-4 intent and sentiment** extraction with confidence scores Objection and buying signal** detection Auto CRM field mapping** — no manual data entry Sales scorecard** with talk ratio, next step clarity, deal risk Full audit trail** for call coaching and compliance Explore More LinkedIn & Social Automation: Contact us to design AI-powered lead nurturing, content engagement, and multi-platform reply workflows tailored to your growth strategy.
by Bastien Laval
Description Boost your productivity and keep your Asana workspace clutter-free with this n8n workflow. It automatically scans for tasks whose due dates have passed and reschedules them to the current date, ensuring no important to-dos slip through the cracks. Additionally, any completed tasks in Asana with an overdue date are removed, maintaining a clear, organized task list. Key Benefits Streamline Task Management**: No more manual updates—let the workflow reschedule overdue tasks for you. Optimize Workspace Organization**: Eliminate finished tasks to focus on active priorities and reduce clutter. Save Time and Effort**: Automate repetitive maintenance, freeing you to concentrate on what truly matters. Configuration Steps Add your Asana credentials Schedule the workflow to run at desired intervals (e.g., daily or weekly). Select your Workspace Name and your Assignee Name (user) in the Get user tasks node (Optional) Tailor filtering conditions to match your preferred due-date rules and removal criteria. Activate the workflow and watch your Asana workspace stay up to date and clutter-free.
by Jonathan
This workflow takes Dialpad call information after a call is disconnected and pushes it into Syncro as a ticket timer update, matching the start time and end time provided by Dialpad and a note that containing the contact or customer name and number. > This workflow is part of an MSP collection, The original can be found here: https://github.com/bionemesis/n8nsyncro
by WeblineIndia
This smart automation workflow created by the AI development team at WeblineIndia, helps with the daily collection and storage of weather data. Using the OpenWeatherMap API and Airtable, this solution gathers vital weather details such as temperature, humidity, and wind speed. The automation ensures daily updates, creating a dependable historical record of weather patterns for future reference and analysis. Steps: Set Schedule Trigger Configure a Cron node to trigger the workflow daily, for example, at 7 AM. Fetch Weather Data (HTTP Request) Use the HTTP Request node to retrieve weather data from the OpenWeatherMap API. Include your API key and query parameters (e.g., q=London, unit=metric) to specify the city and desired units. Parse Weather Data Utilize a JSON Parse node to extract key weather details, such as temperature, humidity, and wind speed, from the API response. Store Data in Airtable Use the Airtable node to insert the parsed data into the designated Airtable table. Ensure proper mapping of fields like temperature, humidity, and wind speed. Save and Execute Save the workflow and activate it to ensure weather data is fetched and stored automatically every day. Outcome This robust solution, developed by WeblineIndia, reliably collects and archives daily weather data, providing businesses and individuals with an accessible record of weather trends for analysis and decision-making. About WeblineIndia We specialize in creating custom automation solutions and innovative software workflows to help businesses streamline operations and achieve efficiency. This weather data fetcher is just one example of our expertise in delivering value through technology.
by Airtop
About The LinkedIn Profile Discovery Automation Are you tired of manually searching for LinkedIn profiles or paying expensive data providers for often outdated information? If you spend countless hours trying to find accurate LinkedIn URLs for your prospects or candidates, this automation will change your workflow forever. Just give this workflow the information you have about a contact, and it will automatically augment it with a LinkedIn profile. How to find a LinkedIn Profile Link In this guide, you'll learn how to automate LinkedIn profile link discovery using Airtop's built-in node in n8n. Using this automation, you'll have a fully automated workflow that saves you hours of manual searching while providing accurate, validated LinkedIn URLs. What You'll Need A free Airtop API key A Google Workspace account. If you have a Gmail account, you’re all set Estimated setup time: 10 minutes Understanding the Process This automation leverages the power of intelligent search algorithms combined with LinkedIn validation to ensure accuracy. Here's how it works: Takes your input data (name, company, etc.) and constructs intelligent search queries Utilizes Google search to identify potential LinkedIn profile URLs Validates the discovered URLs directly against LinkedIn to ensure accuracy Returns confirmed, accurate LinkedIn profile URLs Setting Up Your Automation Getting started with this automation is straightforward: Prepare Your Google Sheet Create a new Google Sheet with columns for input data (name, company, domain, etc.) Add columns for the output LinkedIn URL and validation status (see this example) Configure the Automation Connect your Google Workspace account to n8n if you haven't already Add your Airtop API credentials (Optionally) Configure your Airtop Profile and sign-in to LinkedIn in order to validate profile URL's Run Your First Test Add a few test entries to your Google Sheet Run the workflow Check the results in your output columns Customization Options While the default setup uses Google Sheets, this automation is highly flexible: Webhook Integration**: Perfect for integrating with tools like Clay, Instantly, or your custom applications Alternatives**: Replace Google Sheets with Airtable, Notion, or any other tools you already use for more robust database capabilities Custom Output Formatting**: Modify the output structure to match your existing systems Batch Processing**: Configure for bulk processing of multiple profiles Real-World Applications This automation has the potential to transform how we organizations handle profile enrichment. Recruiting Firm Success Story With this automation, a recruiting firm could save hundreds of dollars a month in data enrichment fees, achieve better accuracy, and eliminate subscription costs. They would also be able to process thousands of profiles weekly with near-perfect accuracy. Sales Team Integration A B2B sales team could integrate this automation with their CRM, automatically enriching new leads with validated LinkedIn profiles and saving their SDRs hours per week on manual research. Best Practices To maximize the accuracy of your results: Always include company information (domain or company name) with your search queries Use full names rather than nicknames or initials when possible Consider including location data for more accurate results with common names Implement rate limiting to respect LinkedIn's usage guidelines Keep your input data clean and standardized for best results Use the integrated proxy to navigate more effectively through Google and LinkedIn What's Next? Now that you've automated LinkedIn profile discovery, consider exploring related automations: Automated lead scoring based on LinkedIn profile data Email finder automation using validated LinkedIn profiles Integration with your CRM for automated contact enrichment
by Preston Zeller
How It Works This workflow automates the real estate lead qualification process by leveraging property data from BatchData. The automation follows these steps: When a new lead is received through your CRM webhook, the workflow captures their address information It then makes an API call to BatchData to retrieve comprehensive property details A sophisticated scoring algorithm evaluates the lead based on property characteristics like: Property value (higher values earn more points) Square footage (larger properties score higher) Property age (newer constructions score higher) Investment status (non-owner occupied properties earn bonus points) Lot size (larger lots receive additional score) Leads are automatically classified into categories (high-value, qualified, potential, or unqualified) The workflow updates your CRM with enriched property data and qualification scores High-value leads trigger immediate follow-up tasks for your team Notifications are sent to your preferred channel (Slack in this example) The entire process happens within seconds of receiving a new lead, ensuring your sales team can prioritize the most valuable opportunities immediately.. Who It's For This workflow is perfect for: Real estate agents and brokers looking to prioritize high-value property leads Mortgage lenders who need to qualify borrowers based on property assets Home service providers (renovators, contractors, solar installers) targeting specific property types Property investors seeking specific investment opportunities Real estate marketers who want to segment audiences by property value Home insurance agents qualifying leads based on property characteristics Any business that bases lead qualification on property details will benefit from this automated qualification system. About BatchData BatchData is a comprehensive property data provider that offers detailed information about residential and commercial properties across the United States. Their API provides: Property valuation and estimates Ownership information Property characteristics (size, age, bedrooms, bathrooms) Tax assessment data Transaction history Occupancy status (owner-occupied vs. investment) Lot details and dimensions By integrating BatchData with your lead management process, you can automatically verify and enrich leads with accurate property information, enabling more intelligent lead scoring and routing based on actual property characteristics rather than just contact information. This workflow demonstrates how to leverage BatchData's property API to transform your lead qualification process from manual research into an automated, data-driven system that ensures high-value leads receive immediate attention.
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 JYLN
This updated workflow will automatically archive your Spotify Discover Weekly tracks to another manually created playlist, without the nuisance of duplicate tracks. It utilizes the latest verisons of n8n's Schedule trigger, Spotify, Switch, Merge, and IF nodes. Special thanks to trey for their original version of the workflow, as well as ihortom for their help with navigating the Switch node's outputs. To use this workflow, you'll need to: Create a playlist for use as the archive playlist within your Spotify account Create and select your Spotify credentials within each Spotify node within the workflow See workflow README for additional information and optional setup steps.
by Robert Breen
🚫 Email Unsubscribe Handler for Outlook Description This n8n workflow automatically scans recent email replies from your Outlook inbox and identifies unsubscribe requests. If a contact replies with any variation of "unsubscribe" within the past 7 days, the system performs two key actions: Saves the contact’s email address in a BigQuery unsubscribes table (for compliance and tracking). Deletes that contact from the active leads table in BigQuery (to stop future outreach). This flow can be triggered on a schedule (e.g. every 4 hours) or run manually as needed. Key Features 📥 Email Parsing from Outlook: Automatically monitors for replies that contain unsubscribe language. 🧠 Smart Filtering: Captures unsubscribes based on message content, not just subject lines. 🔄 BigQuery Integration: Logs unsubscribed emails and removes them from your leads dataset. 🤝 Connect with Me Description I’m Robert Breen, founder of Ynteractive — a consulting firm that helps businesses automate operations using n8n, AI agents, and custom workflows. I’ve helped clients build everything from intelligent chatbots to complex sales automations, and I’m always excited to collaborate or support new projects. If you found this workflow helpful or want to talk through an idea, I’d love to hear from you. Links 🌐 Website: https://www.ynteractive.com 📺 YouTube: @ynteractivetraining 💼 LinkedIn: https://www.linkedin.com/in/robert-breen 📬 Email: rbreen@ynteractive.com
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.