Package Cleaning and Notification Workflow
detail.loadingPreview
Automates cleaning of old 'TRANSPORTE-RECEBIDO' package records in MySQL databases and sends notifications via Telegram.
About This Workflow
This workflow is designed to maintain data integrity by periodically cleaning outdated package records from two separate MySQL databases. It utilizes a cron job for scheduled execution and a webhook for manual triggering. Upon successful cleaning, it sends confirmation messages to a specific Telegram chat. This ensures that only relevant package data remains and provides real-time operational awareness.
Key Features
- Scheduled Execution: Triggered daily at 8 AM via a cron job.
- Manual Trigger: Can be executed on demand by clicking the 'execute' button.
- Webhook Endpoint: Accepts incoming requests to trigger the cleaning process.
- Dual MySQL Database Cleaning: Cleans records from two distinct MySQL databases (PPM and OBJ).
- Data Cleaning Logic: Removes records where the
modulois 'pacoteProduto' andsituacaois 'TRANSPORTE-RECEBIDO', and thedatais older than one month. - Telegram Notifications: Sends status updates to a designated Telegram chat after each database cleaning operation.
How To Use
- Triggering:
- Scheduled: The workflow will automatically run daily at 8 AM.
- Manual: Click the 'execute' button on the 'On clicking 'execute'' node.
- Webhook: Send a POST request to the
/limparPacotesendpoint of your n8n instance.
- Execution Flow:
- The Cron or Webhook or On clicking 'execute' nodes initiate the process.
- The limpaPacoteCliente0 (using PPM credentials) and limparPacoteCliente1 (using OBJ credentials) nodes execute the MySQL queries to clean the respective databases.
- Upon successful execution of each MySQL node, the Telegram and Telegram1 nodes send notifications to the specified chat ID (
-657820242).
- Configuration:
- Ensure your MySQL credentials (
PPMandOBJ) and Telegram credentials (Telegram account) are correctly configured in n8n. - The
chatIdin the Telegram nodes is set to-657820242and can be modified as needed.
- Ensure your MySQL credentials (
Apps Used
Workflow JSON
{
"id": "fee348d3-bb83-469d-b092-97e7b5805a76",
"name": "Package Cleaning and Notification Workflow",
"nodes": 25,
"category": "Data Management",
"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: fee348d3-bb83...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Workflows
Discover more workflows you might like
CSV to MySQL Data Ingestion
Reads a CSV file and inserts its data into a MySQL database.
FileMaker Data Entry and Update
Workflow to create a record in FileMaker, then edit it with additional data.
Dynamically Create Airtable Tables for Webflow Form Submissions
Automatically create dedicated Airtable tables for each Webflow form and log submissions.