# Delete Slack messages by command with confirmation and cleanup of status messages
This workflow enables automated deletion of Slack messages via a command sent through an HTTP webhook. It parses the command, validates syntax, retrieves and filters messages in a channel, requests confirmation, and deletes matches in batches with delays to avoid API rate limits. After completion, it cleans up its own status messages for a tidy audit trail.
## Who it´s for
- Slack channel administrators who need to mass-delete messages
- Teams using Slack for internal communication and requiring regular data cleanup
- Developers automating content moderation in Slack via API
## What the automation does
- Triggered by a POST request to a webhook with a text command
- Parses and validates the command (e.g., `delete from #logs where contains "error"`)
- Retrieves and filters messages in the specified channel based on criteria
- Sends interactive confirmation or notifies if no matches found
- On confirmation, deletes messages in batches with delays between requests
- Sends progress and completion messages, which are later auto-deleted
## What´s included
- Ready-to-use n8n workflow
- Logic for webhook handling, command parsing, and conditional routing
- Integrations with Slack and HTTP Webhook
- Basic textual instructions for setup and adaptation
## Requirements for setup
- n8n account (cloud or self-hosted)
- Slack token with permissions to read and delete messages
- Ability to receive external webhook calls (firewall/network access)
## Benefits and outcomes
- Reduced manual effort in channel moderation
- Lower risk of accidental deletions due to confirmation step
- Clean audit trail — system messages are automatically removed
- Flexibility — supports various filtering conditions via command syntax
- Safety — batch processing with delays prevents API overuse
- Compatibility with Slack’s API standards and best practices
## Important: template only
Important: you are purchasing a ready-made automation workflow template only. Rollout into your infrastructure, connecting specific accounts and services, 1:1 setup help, custom adjustments for non-standard stacks and any consulting support are provided as a separate paid service at an individual rate. To discuss custom work or 1:1 help, contact via chat
No feedback yet