Automated Package Cleanup and Notification Workflow
detail.loadingPreview
This n8n workflow automates the cleanup of old 'TRANSPORTE-RECEBIDO' packages from your database, specifically targeting Ponto Mix and Objetiva systems. It then sends timely notifications via Telegram to keep relevant teams informed.
About This Workflow
This robust n8n workflow is designed to streamline your package management processes by automatically identifying and purging outdated 'TRANSPORTE-RECEBIDO' package entries from your MySQL databases. It performs this cleanup on a scheduled basis or can be triggered manually. The workflow differentiates cleanup operations for 'Ponto Mix' and 'Objetiva' systems, ensuring data integrity across different business units. Upon successful cleanup for each system, automated notifications are sent via Telegram, providing immediate confirmation and visibility to the operational teams. This ensures that your database remains clean and that your teams are always up-to-date on critical inventory statuses.
Key Features
- Automated Database Cleanup: Regularly removes old 'TRANSPORTE-RECEBIDO' package records based on a one-month interval.
- Multi-Database Support: Integrates with distinct MySQL credentials for 'Ponto Mix' and 'Objetiva' systems.
- Real-time Telegram Notifications: Sends immediate alerts to a specific Telegram chat upon completion of each cleanup task.
- Flexible Triggering: Can be scheduled to run automatically (e.g., daily at 8 AM) or initiated manually.
- Customizable SQL Queries: Utilizes
UPDATEstatements withWITHclauses for efficient and targeted data modification.
How To Use
- Configure MySQL Credentials: Ensure you have added and configured your 'PPM' (for Ponto Mix) and 'OBJ' (for Objetiva) MySQL credentials within n8n.
- Set Up Telegram Credentials: Add and configure your Telegram API credentials in n8n.
- Adjust SQL Queries (if necessary): Review the
queryparameter in thelimpaPacoteCliente0andlimparPacoteCliente1nodes. The provided queries are set to clean records older than one month. Modify theINTERVAL 1 MONTHif a different retention period is required. - Configure Cron Trigger: In the 'Cron' node, set the
triggerTimes.item.hourparameter to your desired execution time (e.g.,8for 8 AM daily). - Set Telegram Chat ID: In both 'Telegram' and 'Telegram1' nodes, update the
chatIdparameter with the correct Telegram group or user ID where you want to receive notifications. - Activate the Workflow: Enable the 'Cron' node for automated execution or use the 'On clicking 'execute'' manual trigger for on-demand runs. The 'Webhook' node can also be configured for external triggers if needed, though it's not directly connected to the cleanup logic in this snippet.
Apps Used
Workflow JSON
{
"id": "cf6e8623-86f6-4351-8865-0fb4e9a184f5",
"name": "Automated Package Cleanup and Notification Workflow",
"nodes": 9,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: cf6e8623-86f6...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.