n8n
Workflow
Cron Routines With Telegram
This n8n workflow automates tasks using Other Tools. Cron Routines With Telegram - ready to import and run in your n8n instance.
n8n
workflow.json
About This Script
This n8n workflow automates tasks using Other Tools. Cron Routines With Telegram - ready to import and run in your n8n instance.
Features:
- Scheduled automation with cron triggers
- Receives webhook events
- Integrates with Other Tools
Source Code
{
"nodes": [
{
"name": "On clicking 'execute'",
"type": "n8n-nodes-base.manualTrigger",
"disabled": true,
"position": [
70,
140
],
"parameters": [],
"typeVersion": 1,
"id": "670b270a-8284-4b7d-8b2f-9aac0d787398"
},
{
"name": "Cron",
"type": "n8n-nodes-base.cron",
"position": [
70,
320
],
"parameters": {
"triggerTimes": {
"item": [
{
"hour": 8
}
]
}
},
"typeVersion": 1,
"id": "02e1314a-1ad4-4d9f-8bf8-5589d1b14c91"
},
{
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
620,
210
],
"parameters": {
"text": "LIMPOU PACOTES TRANSPORTE-RECEBIDO PONTO MIX",
"chatId": "-657820242",
"additionalFields": []
},
"credentials": {
"telegramApi": {
"id": "5",
"name": "Telegram account"
}
},
"typeVersion": 1,
"id": "5c132fe0-8c33-45f5-9e7b-6010e45c36f4"
},
{
"name": "Telegram1",
"type": "n8n-nodes-base.telegram",
"position": [
620,
460
],
"parameters": {
"text": "LIMPOU PACOTES TRANSPORTE-RECEBIDO OBJETIVA",
"chatId": "-657820242",
"additionalFields": []
},
"credentials": {
"telegramApi": {
"id": "5",
"name": "Telegram account"
}
},
"typeVersion": 1,
"id": "29dbf284-7276-4ac6-8090-fa18571e7dab"
},
{
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
70,
480
],
"webhookId": "7ecb2d2f-5a09-44a5-a7bc-27f188c74e0b",
"parameters": {
"path": "limparPacotes",
"options": []
},
"typeVersion": 1,
"id": "7d578e41-24f6-44f3-81f0-8eba3c50a698"
},
{
"name": "limparPacoteCliente1",
"type": "n8n-nodes-base.mySql",
"position": [
380,
470
],
"parameters": {
"query": "-- LIMPAR ETIQUETAS ANTIGAS \nwith t as (\nselect token from i_objeto where modulo = 'pacoteProduto' and situacao = 'TRANSPORTE-RECEBIDO' and data <= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)\n)\nupdate i_objeto \nset modulo = 'DELETE'\nwhere modulo = 'pacoteProduto' and token in (select token from t)",
"operation": "executeQuery"
},
"credentials": {
"mySql": {
"id": "4",
"name": "OBJ"
}
},
"typeVersion": 1,
"id": "844bef5d-6d09-4745-ba97-34ee1da638d0"
},
{
"name": "limpaPacoteCliente0",
"type": "n8n-nodes-base.mySql",
"position": [
380,
210
],
"parameters": {
"query": "-- LIMPAR ETIQUETAS ANTIGAS \nwith t as (\nselect token from i_objeto where modulo = 'pacoteProduto' and situacao = 'TRANSPORTE-RECEBIDO' and data <= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)\n)\nupdate i_objeto \nset modulo = 'DELETE'\nwhere modulo = 'pacoteProduto' and token in (select token from t)",
"operation": "executeQuery"
},
"credentials": {
"mySql": {
"id": "3",
"name": "PPM"
}
},
"typeVersion": 1,
"id": "d5b2ad00-34e2-4fbe-aa97-1fdb1f9fa8a0"
}
],
"connections": {
"Cron": {
"main": [
[
{
"node": "limpaPacoteCliente0",
"type": "main",
"index": 0
},
{
"node": "limparPacoteCliente1",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "limpaPacoteCliente0",
"type": "main",
"index": 0
},
{
"node": "limparPacoteCliente1",
"type": "main",
"index": 0
}
]
]
},
"limpaPacoteCliente0": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"limparPacoteCliente1": {
"main": [
[
{
"node": "Telegram1",
"type": "main",
"index": 0
}
]
]
},
"On clicking 'execute'": {
"main": [
[
{
"node": "limpaPacoteCliente0",
"type": "main",
"index": 0
},
{
"node": "limparPacoteCliente1",
"type": "main",
"index": 0
}
]
]
}
},
"n8n_version": "1.5.0"
}
Requirements
n8n instance, Telegram API credentials
Tags
#n8n
#automation
#workflow