Templates / Bulk delete Slack messages with smart filtering and confirmations

Bulk delete Slack messages with smart filtering and confirmations

Ready for 3.0

by Elie Kattar Β· 121 views Β· created 2025-06-15 Β· Miscellaneous

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (8)

Slack

What it does

🧹 Jedi Cleaner for Slack ❌ Slack's Limitation Slack lacks a native bulk delete feature. Users must delete messages manually, which is time-consuming and inefficient for large volumes. βœ… Our Solution Jedi Cleaner automates Slack message deletion using smart filters, safety confirmations, and enterprise-grade reliability. --- πŸš€ Key Features & Capabilities ⚑ Lightning-Fast Bulk Operations Delete hundreds of messages in minutes Intelligent rate limiting prevents API throttling Auto-retry on failure ensures reliable operation 🎯 Smart Message Filtering Keyword match – Find messages with specific terms User mentions – Target messages that mention specific users Exact phrases – Use quotes for precision Bot/User content – Handle mixed sources seamlessly --- πŸ›‘οΈ Enterprise-Grade Safety Confirmation workflow – No accidental deletions Timeout – Requests expire after 5 minutes Preview-first – Review messages before deletion Granular control – Choose exactly what to delete --- πŸ” Intelligent Search & Preview Flexible filters (words, phrases, patterns) Preview + count before deletion Multi-channel support with context isolation πŸ“Š Complete Workflow Management Auto-cleanup of bot messages after execution Real-time progress tracking Debug logs and audit trail Static data persistence and cleanup --- πŸ§ͺ How It Works Phase 1: Search Request plaintext User: /cleanup "error messages" Bot Response: πŸ” Found 15 messages containing "error messages" πŸ“Š Breakdown: β€’ Will be permanently deleted β€’ Cannot be undone β€’ Respond within 5 minutes βœ… Type: @cleanerjedi yes ❌ Type: @cleanerjedi cancel Phase 2: User Confirmation plaintext User: @cleanerjedi yes Bot: πŸ—‘οΈ Deleting 15 messages containing "error messages" Phase 3: Completion plaintext βœ… Cleanup Complete β€’ 15 messages deleted β€’ Channel cleaned β€’ Auto-deletes this message in 5 seconds --- πŸ› οΈ Technical Architecture Core Components Unified Webhook Handler Handles slash commands & mentions, deduplicates events Search Engine Integrates Slack API, parses & filters search terms Safety & Confirmation System Temporary storage, expiration logic, user auth Bulk Operations Engine Message deletion, progress tracking, error handling Cleanup & Memory Management Deletes bot messages, static data cleanup --- πŸ“± User Commands | Command | Description | Example | | ---------------------- | ----------------------------------- | -------------------------- | | /cleanup term | Search messages containing term | /cleanup "webhook error" | | @cleanerjedi yes | Confirm deletion | After preview | | @cleanerjedi cancel | Cancel pending deletion | Cancels active request | 🧩 Edge Cases | Scenario | Bot Response | | -------------------- | ---------------------------------------------- | | No messages found | "No messages found containing '\term'" | | Expired confirmation | "Request expired. Please run /cleanup again" | | No pending request | "No pending cleanup found. Run /cleanup first" | | Invalid search term | "Please provide a valid search term" | --- βš™οΈ Setup Requirements Slack App Configuration OAuth Scopes: plaintext βœ… chat:write βœ… chat:write.public βœ… channels:history βœ… groups:history βœ… appmentions:read βœ… commands Event Subscriptions: plaintext βœ… appmention βœ… message.channels Slash Command: plaintext Command: /cleanup URL: https://your-n8n.app.cloud/webhook/cleanerjedi Hint: search term n8n Workflow Setup Required Nodes: Webhook Trigger – Captures Slack events Respond to Webhook – Handles routing Switch Node – Event type routing Slack API Nodes – Search, delete, notify JavaScript Nodes – Logic & validation --- ⚑ Advanced Features 🧠 Intelligent Deduplication javascript eventId = cmd${body.command}${body.userid}${body.triggerid}; if (staticData.recentEvents.includes(eventId)) { return ; // Skip duplicate } πŸ” Flexible Search Terms Single words: test Phrases: "error message" Special characters: webhook-failed Case-insensitive by default ♻️ Auto-Cleanup javascript setTimeout(() => { deleteMessage(completionMessage.ts); dele

View the original on n8n.io β†’ Check your own copy

Get the weekly β€œwhat broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.