AutomationFlowsSlack & Telegram › Error Bot via Telegram

Error Bot via Telegram

Error Bot via Telegram. Uses errorTrigger, telegram, executeWorkflowTrigger. Event-driven trigger; 4 nodes.

Event trigger★★★★☆ complexity4 nodesError TriggerTelegramExecute Workflow Trigger
Slack & Telegram Trigger: Event Nodes: 4 Complexity: ★★★★☆ Added:

This workflow follows the Error Trigger → Telegram recipe pattern — see all workflows that pair these two integrations.

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 →

Download .json
{
  "name": "Error Bot via Telegram",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.errorTrigger",
      "typeVersion": 1,
      "position": [
        -336,
        -96
      ],
      "id": "22d4da90-b555-44cd-9552-c6417ec07f82",
      "name": "Error Trigger"
    },
    {
      "parameters": {
        "chatId": "YOUR_TELEGRAM_CHAT_ID_HERE",
        "text": "={{ $json.telegram_message }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        80,
        -96
      ],
      "id": "f0c1be53-f12e-4351-8e54-3a225a5aedbd",
      "name": "Send a error message",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// N8N Function Node \u2014 Formatar erro p/ Telegram com timezone correto\nconst data = $input.all();\n\nconst TZ = 'America/Sao_Paulo';\nconst TELEGRAM_LIMIT = 4096;\nconst SAFE_LIMIT = 3500; // margem de seguran\u00e7a\nconst ERROR_LIMIT = 150; // limite s\u00f3 para o bloco do erro\n\nconst fmt = (iso) =>\n  new Intl.DateTimeFormat('pt-BR', {\n    timeZone: TZ,\n    dateStyle: 'short',\n    timeStyle: 'medium',\n  }).format(new Date(iso));\n\nfunction truncateText(text, maxLen, suffix = '[...\" (truncated)]') {\n  if (!text) return '';\n  const str = String(text);\n  if (str.length <= maxLen) return str;\n  return str.slice(0, maxLen - suffix.length) + suffix;\n}\n\nfunction formatErrorForTelegram(item) {\n  const e = item.json?.execution || {};\n  const w = item.json?.workflow || {};\n\n  const occurredAtISO =\n    e.stoppedAt || e.finishedAt || e.startedAt || new Date().toISOString();\n\n  const rawError =\n    e.error?.message ||\n    e.error?.description ||\n    JSON.stringify(e.error || {}, null, 2) ||\n    'Unknown error';\n\n  const errMsg = truncateText(rawError, ERROR_LIMIT);\n\n  let msg = '';\n  msg += `\ud83d\udea8 *ERROR IN AUTOMATION* \ud83d\udea8 `;\n  msg += `${fmt(occurredAtISO)}\\n\\n`;\n\n  msg += `\ud83d\udccb *Workflow:* ${w.name || 'N/A'}\\n`;\n  msg += `\ud83c\udd94 *ID:* ${w.id || 'N/A'}\\n\\n`;\n  msg += `\u26a1 *Execution:* #${e.id || 'N/A'}\\n`;\n  msg += `\ud83d\udd04 *Mode:* ${e.mode || 'N/A'}\\n`;\n  if (e.retryOf) msg += `\ud83d\udd01 *Retry of:* #${e.retryOf}\\n`;\n  if (e.lastNodeExecuted) msg += `\ud83d\udccd *Last node:* ${e.lastNodeExecuted}\\n`;\n  msg += `\\n`;\n\n  msg += `\u274c *Error:*\\n${errMsg}\\n\\n`;\n\n  if (e.url) msg += `\ud83d\udd17 *See details:*\\n${e.url}\\n\\n`;\n\n  // trava final de seguran\u00e7a no texto inteiro\n  msg = truncateText(msg, SAFE_LIMIT);\n\n  return {\n    json: {\n      telegram_message: msg,\n      error_summary: {\n        workflow_name: w.name,\n        execution_id: e.id,\n        error_message: errMsg,\n        failed_node: e.lastNodeExecuted || null,\n        occurred_at_iso: occurredAtISO,\n        occurred_at_br: fmt(occurredAtISO),\n        was_truncated: rawError.length > ERROR_LIMIT,\n        original_error_length: String(rawError).length,\n        final_message_length: msg.length,\n      },\n    },\n  };\n}\n\nreturn data.map(formatErrorForTelegram);"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -128,
        -96
      ],
      "id": "09cf2de8-58da-4ba0-a9ad-ab9a548b7e04",
      "name": "treatErrorMsg"
    },
    {
      "parameters": {
        "inputSource": "passthrough"
      },
      "id": "ebbc7e03-6dd6-4645-9c89-aba6a5050a6d",
      "typeVersion": 1.1,
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -336,
        -288
      ]
    }
  ],
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "treatErrorMsg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "treatErrorMsg": {
      "main": [
        [
          {
            "node": "Send a error message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "treatErrorMsg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "America/Sao_Paulo",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": true,
    "binaryMode": "separate"
  }
}

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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Error Bot via Telegram. Uses errorTrigger, telegram, executeWorkflowTrigger. Event-driven trigger; 4 nodes.

Source: https://github.com/dasgltd/n8n-workflows/blob/main/error-bot/ErrorBot.json — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Slack & Telegram

03 - Command Handler. Uses executeWorkflowTrigger, telegram, executeCommand, postgres. Event-driven trigger; 53 nodes.

Execute Workflow Trigger, Telegram, Execute Command +2
Slack & Telegram

Deal-Finder. Uses executeWorkflowTrigger, googleSheets, perplexity, httpRequest. Event-driven trigger; 49 nodes.

Execute Workflow Trigger, Google Sheets, Perplexity +2
Slack & Telegram

This workflow provides a complete solution for handling Telegram Stars payments, invoicing and refunds using n8n. It automates the process of sending invoices, managing pre-checkout approvals, recordi

HTTP Request, Execute Workflow Trigger, Google Sheets +2
Slack & Telegram

clients kept booking meetings during my prayer times. i'd either miss a prayer or scramble to reschedule. the problem wasn't the clients — it was that my calendar had no blocked windows for salah. i n

Telegram Trigger, HTTP Request, Google Calendar +3
Slack & Telegram

This workflow manages clinic appointments across Google Sheets and Google Calendar, using webhooks and Telegram to book and confirm visits, Gmail and Telegram to deliver prescriptions, scheduled Teleg

Google Calendar, Telegram, Google Sheets +4