The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"id": "wf-ttl-monitor",
"name": "TTL Monitor - Stale Task Watchdog",
"active": true,
"settings": {
"executionOrder": "v1",
"saveManualExecutions": true,
"callerPolicy": "workflowsFromSameOwner"
},
"tags": [
{
"id": "4",
"name": "monitoring"
}
],
"nodes": [
{
"id": "node-schedule-trigger",
"name": "Schedule: Every 60 Seconds",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
240,
300
],
"parameters": {
"rule": {
"interval": [
{
"field": "seconds",
"secondsInterval": 60
}
]
}
}
},
{
"id": "node-select-stale",
"name": "MySQL: SELECT Stale Tasks",
"type": "n8n-nodes-base.mySql",
"typeVersion": 2.4,
"position": [
480,
300
],
"parameters": {
"operation": "executeQuery",
"query": "SELECT * FROM stale_tasks;",
"options": {}
},
"credentials": {
"mySql": {
"name": "<your credential>"
}
}
},
{
"id": "node-if-has-stale",
"name": "IF: Has Stale Tasks?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
720,
300
],
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict"
},
"conditions": [
{
"id": "condition-count",
"leftValue": "={{ $input.all().length }}",
"rightValue": 0,
"operator": {
"type": "number",
"operation": "gt"
}
}
],
"combinator": "and"
},
"options": {}
}
},
{
"id": "node-loop-items",
"name": "Loop Over Stale Tasks",
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
960,
200
],
"parameters": {
"batchSize": 1,
"options": {}
}
},
{
"id": "node-update-blocked",
"name": "MySQL: UPDATE Status Blocked",
"type": "n8n-nodes-base.mySql",
"typeVersion": 2.4,
"position": [
1200,
200
],
"parameters": {
"operation": "executeQuery",
"query": "UPDATE tasks SET status = 'blocked', last_heartbeat = NOW() WHERE id = '{{ $json.id }}';",
"options": {}
},
"credentials": {
"mySql": {
"name": "<your credential>"
}
}
},
{
"id": "node-telegram-alert",
"name": "Telegram: Alert Stale Task",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
1440,
200
],
"parameters": {
"operation": "sendMessage",
"chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
"text": "=ALERTA: Tarea estancada detectada\n\nTask ID: {{ $('Loop Over Stale Tasks').item.json.id }}\nAgente: {{ $('Loop Over Stale Tasks').item.json.agent_id }}\nEstado anterior: {{ $('Loop Over Stale Tasks').item.json.status }}\nCreada: {{ $('Loop Over Stale Tasks').item.json.created_at }}\nUltimo heartbeat: {{ $('Loop Over Stale Tasks').item.json.last_heartbeat }}\n\nLa tarea ha sido marcada como BLOCKED automaticamente.",
"additionalFields": {
"parse_mode": "Markdown"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"id": "node-no-stale",
"name": "No Stale Tasks",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
960,
420
]
}
],
"connections": {
"Schedule: Every 60 Seconds": {
"main": [
[
{
"node": "MySQL: SELECT Stale Tasks",
"type": "main",
"index": 0
}
]
]
},
"MySQL: SELECT Stale Tasks": {
"main": [
[
{
"node": "IF: Has Stale Tasks?",
"type": "main",
"index": 0
}
]
]
},
"IF: Has Stale Tasks?": {
"main": [
[
{
"node": "Loop Over Stale Tasks",
"type": "main",
"index": 0
}
],
[
{
"node": "No Stale Tasks",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Stale Tasks": {
"main": [
[
{
"node": "MySQL: UPDATE Status Blocked",
"type": "main",
"index": 0
}
],
[
{
"node": "MySQL: UPDATE Status Blocked",
"type": "main",
"index": 0
}
]
]
},
"MySQL: UPDATE Status Blocked": {
"main": [
[
{
"node": "Telegram: Alert Stale Task",
"type": "main",
"index": 0
}
]
]
},
"Telegram: Alert Stale Task": {
"main": [
[
{
"node": "Loop Over Stale Tasks",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
mySqltelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
TTL Monitor - Stale Task Watchdog. Uses mySql, telegram. Scheduled trigger; 7 nodes.
Source: https://github.com/ceshorma/IA-Orchestator/blob/1281ff80a7fece1544815e63620ffef0d4c4e88a/workflows/ttl-monitor.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Auto Hunt. Uses httpRequest, googleSheets, rssFeedRead, telegram. Scheduled trigger; 78 nodes.
Auto-Hunt. Uses httpRequest, googleSheets, rssFeedRead, telegram. Scheduled trigger; 78 nodes.
Solo founders and spreadsheet gremlins who track everything in Notion and want crisp Telegram pings without opening a single page.
wf_main. Uses telegramTrigger, mySql, telegram, httpRequest. Event-driven trigger; 42 nodes.
This workflow runs daily at 9 AM, uses Perplexity to compile vaping industry news, optionally captures article screenshots via Browserless, and generates a HeyGen avatar video from a template. It then