Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

n8n - Telegram node - Send message fails inconsistently #13815

Open
AshaffHussain opened this issue Mar 11, 2025 · 5 comments
Open

n8n - Telegram node - Send message fails inconsistently #13815

AshaffHussain opened this issue Mar 11, 2025 · 5 comments
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@AshaffHussain
Copy link

Describe the problem/error/question

The Telegram Node works inconsistently. There're failures that cause an error but there's no meaningful error messaging to help with debugging the issue. The issue is a new one. The node used to work perfectly well prior to the 10th March 2025 where multiple successful runs were made.

What is the error message (if any)?

{
"errorMessage": "Node has thrown an error",
"errorDetails": {},
"n8nDetails": {
"n8nVersion": "1.81.0 (Self Hosted)",
"binaryDataMode": "default",
"stackTrace": [
"Error: Node has thrown an error",
" at ExecuteContext.execute (/opt/render/project/src/packages/nodes-base/nodes/DebugHelper/DebugHelper.node.ts:281:15)",
" at WorkflowExecute.runNode (/opt/render/project/src/packages/core/src/execution-engine/workflow-execute.ts:1153:32)",
" at /opt/render/project/src/packages/core/src/execution-engine/workflow-execute.ts:1503:38",
" at processTicksAndRejections (node:internal/process/task_queues:105:5)",
" at /opt/render/project/src/packages/core/src/execution-engine/workflow-execute.ts:2062:11"
]
}
}

Please share your workflow/screenshots/recording

`{
  "nodes": [
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "o3-mini",
          "mode": "list",
          "cachedResultName": "o3-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        48,
        1220
      ],
      "id": "347411cb-410d-4124-91ef-867cc9c54500",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "REMOVED",
          "name": "OpenAI - Personal"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -200,
        1000
      ],
      "id": "34cad32b-c18f-46f8-8aaa-d19c6c725740",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "=Get a\nget table row level data where the Created_date field is either the (current date) or (current date -1)",
        "operation": "getAll",
        "tableId": "Promotions_Gmail",
        "filters": {
          "conditions": [
            {
              "keyName": "Created_date",
              "condition": "gte",
              "keyValue": "={{ \n  new Date(Date.now() - 86400000).toISOString().slice(0, 10)\n}}\n"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        168,
        1220
      ],
      "id": "dc2e092c-f9e5-48e3-88bb-a3070a4b8eec",
      "name": "fetchRecords",
      "credentials": {
        "supabaseApi": {
          "id": "REMOVED",
          "name": "Supabase Personal - Cloud"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=you are a personal assistant. Your job is to fetch information from a table in Supabase . These records are promotions or discount related records that an individual receives. Based on the records \n group them by product/service category, nested below should be the product/service provider, what the promotion/discount is about, link to avail the promotion/discount. Something similar to what's below\n\n* (Emoji)Grocery items\n* Swiggy\n- 10% (Emoji) discount on all vegetables on the 14th of February valid till 15th February (Emoji)\n- Link to avail\n\n\n# DO NOT USE THE EXAMPLE PROVIDED UP IN ANY OUTPUT MESSAGING\n# Add emojis in the output messaging that are relevant to the promo/discount\n# Follow the structure of the above example and formatting specified\n# Only include the promo/discount information in the output messaging. Do not include an intro or outro messaging",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        20,
        1000
      ],
      "id": "3af33074-2ed2-4da0-bd04-ebfd87704bae",
      "name": "draftDailyPromosSummary"
    },
    {
      "parameters": {
        "chatId": "REMOVED",
        "text": "={{ $json.chunk }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        616,
        1000
      ],
      "id": "821c1b53-f134-4364-88ca-d43e52383ea4",
      "name": "send2Telegram",
      "webhookId": "REMOVED",
      "retryOnFail": true,
      "waitBetweenTries": 500,
      "credentials": {
        "telegramApi": {
          "id": "REMOVED",
          "name": "Telegram account - Personal"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "content": "## Generate Summary and Send to Telegram\n",
        "height": 600,
        "width": 1380,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -292,
        760
      ],
      "id": "e1644237-b20c-4926-be60-6523303c8fa6",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "jsCode": "// Get the input string\nconst inputString =$input.first().json.output\nconst MAX_LENGTH = 3000;\n\n// Split the input into sections (categories)\nconst sections = inputString.split('\\n\\n* ');\n\n// Re-add the \"* \" prefix to sections after the first one\nconst formattedSections = sections.map((section, index) => {\n  return index === 0 ? section : `* ${section}`;\n});\n\n// Initialize variables\nconst chunks = [];\nlet currentChunk = '';\n\nfor (const section of formattedSections) {\n  // Calculate potential new length if we add this section\n  const separator = currentChunk ? '\\n\\n' : '';\n  const newLength = currentChunk.length + separator.length + section.length;\n\n  if (newLength > MAX_LENGTH) {\n    // Finalize the current chunk if it's not empty\n    if (currentChunk) {\n      chunks.push(currentChunk);\n      currentChunk = '';\n    }\n\n    // Handle oversized sections (split into 4000-character chunks)\n    if (section.length > MAX_LENGTH) {\n      for (let i = 0; i < section.length; i += MAX_LENGTH) {\n        chunks.push(section.slice(i, i + MAX_LENGTH));\n      }\n    } else {\n      currentChunk = section; // Start new chunk\n    }\n  } else {\n    // Append the section to the current chunk\n    currentChunk += separator + section;\n  }\n}\n\n// Add the final chunk if it exists\nif (currentChunk) chunks.push(currentChunk);\n\n// Return the chunks for Telegram\nreturn chunks.map(chunk => ({ chunk }));"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        396,
        1000
      ],
      "id": "2deb3e28-8579-44d6-bfc8-faf859cbcb1b",
      "name": "Code"
    },
    {
      "parameters": {
        "chatId": "REMOVED",
        "text": "There was an error on the daily Promo scanner. Please check logs for analysis",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        836,
        1000
      ],
      "id": "bfa4ff05-8028-4ee9-bbbe-94cb81671b76",
      "name": "Telegram",
      "webhookId": "REMOVED",
      "credentials": {
        "telegramApi": {
          "id": "REMOVED",
          "name": "Telegram account - Personal"
        }
      }
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        836,
        800
      ],
      "id": "0b9dc649-0979-4d7b-a8a8-f6367c47d886",
      "name": "No Operation, do nothing"
    },
    {
      "parameters": {
        "throwErrorType": "Error"
      },
      "type": "n8n-nodes-base.debugHelper",
      "typeVersion": 1,
      "position": [
        836,
        1200
      ],
      "id": "d7944077-4943-4c48-80b6-6d647460290a",
      "name": "DebugHelper"
    }
  ],
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "draftDailyPromosSummary",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "draftDailyPromosSummary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fetchRecords": {
      "ai_tool": [
        [
          {
            "node": "draftDailyPromosSummary",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "draftDailyPromosSummary": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "send2Telegram": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          },
          {
            "node": "DebugHelper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "send2Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {
    "Schedule Trigger": [
      {
        "timestamp": "2025-03-11T00:00:15.006-04:00",
        "Readable date": "March 11th 2025, 12:00:15 am",
        "Readable time": "12:00:15 am",
        "Day of week": "Tuesday",
        "Year": "2025",
        "Month": "March",
        "Day of month": "11",
        "Hour": "00",
        "Minute": "00",
        "Second": "15",
        "Timezone": "America/New_York (UTC-04:00)"
      }
    ]
  },
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "REMOVED"
  }
}`

Share the output returned by the last node

<[
{
"chunk": "* ⚡ Energy Plans \n * Compare The Market \n - Compare energy plans with up to $200 in bill credits for new customers. Switch providers quickly and easily without disrupting your energy supply. Explore trusted Aussie providers and find the best deal for your needs. \n - Link to avail: https://www.comparethemarket.com.au/energy/\n\n* ✈️ Travel Awards \n * Tripadvisor \n - Tripadvisor announces the 2025 Travellers’ Choice Awards Best of the Best winners, revealing the top destinations worldwide. Discover romantic seaside villages, ancient citadels, and buzzing food cities that travelers raved about this year. \n - Link to avail: https://www.tripadvisor.com/TravelersChoice-Destinations\n\n* 🏖️ Travel & Lifestyle \n * SpiceJet \n - Explore the March edition of SpiceRoute, SpiceJet's inflight magazine, featuring inspiring stories of women, travel destinations like Shivamogga, and exclusive interviews. Celebrate International Women's Day and Holi with unique insights and adventures. \n - Link to avail: https://corporate.spicejet.com/SpiceRoute.aspx?utm_source=CT&utm_medium=Email&utm_campaign=MarchMagazine25\n\n* 💻 Technology \n * Naya \n - Discover essential technology products from Naya. Explore Naya Create 3.0 and Naya Touch, designed to reshape how you interact with technology. Don't miss out on exclusive discounts! \n - Link to avail: https://naya.tech/products/naya-create-3-0?discount=WELCOMENAYA\n\n* 🤖 AI and Innovation \n * You Exec \n - Do you feel unsure about how to cross the critical innovation barrier with AI? Our AI Strategic Plan guides you through frameworks and tools that form a well-considered blueprint for future innovation. Download the template now to get started! \n - Link to avail: https://youexec.com/login-auto?uh=04465dc500afb65bd52cc523aa89a4f1dd7a8745e144c74b5e77b250b7b2eece&w=strategic2&sr=strategic2&ut=8W35L1558141980\n\n* 👥 Team Meetup and Careers \n * n8n Community \n - The n8n team recently held a meetup in Berlin, featuring workshops, discussions, and fun activities like lasertag and go-karting. The team has grown significantly, and they are now hiring. Check out their careers page for more info. \n - Link to avail: https://n8n.io/careers\n\n* 🏡 Community Engagement \n * ADDA \n - Welcome to the March Edition of ADDA Community Connect 2025! Celebrate the place you call home by nominating your community for the Rise High Awards 2025. Discover exciting new features coming to the ADDA App, and learn how to make your community audit-ready with ADDA's seamless financial tools. \n - Link to avail: https://adda.io/blog/2024/12/mastering-book-closure-and-auditing/"
},
{
"chunk": "* 🚀 AI Tools and Productivity \n * Product Hunt \n - Explore the latest in AI and productivity tools with Product Hunt's daily digest. This edition features Google's new AI search mode, a tool for painless email testing, and a platform that turns text into videos. Stay ahead with insights and innovations! \n - Link to avail: https://www.producthunt.com/\n\n* 📈 Professional Development \n * LinkedIn \n - As a LinkedIn Premium subscriber, you’re invited to a live conversation with Ashton Applewhite, a leading advocate against ageism. This event explores how to break stereotypes, shift workplace norms, and make age work in your favor—whether you’re job searching or aiming for a promotion. \n - Link to avail: https://www.linkedin.com/events/overcomingageismatwork7302825370712477696/theater/?campaignId=396d2f59-83b2-4e1d-bcbc-9be40dfa2feb&emailKey=email_editorial_premium_communities_featured_content_01&uuid=2999dfde-169f-4f8a-ba87-b991886d1207\n\n* 🎓 Education & Certification \n * DataCamp \n - DataCamp introduces a new certification: AI Engineer for Data Scientists Associate. Designed for data science learners preparing for an AI role, this certification showcases your understanding of data management, exploratory analysis, governance, and modern application development for AI. Get certified and save $75 on Learn Premium! \n - Link to avail: https://www.datacamp.com/certification/ai-engineer-for-data-scientists-associate\n\n* 📚 Online Learning \n * Coursera \n - Coursera recommends courses and specializations tailored to your interests, including Supervised Machine Learning: Regression and Classification, Machine Learning, Generative AI for Everyone, Python for Everybody, AI For Everyone, Deep Learning, and Generative AI with Large Language Models. Start learning something new today! \n - Link to avail: https://www.coursera.org/\n\n* ✍️ Writing Improvement Tools \n * Grammarly \n - Grammarly's Weekly Writing Update provides insights into your writing productivity, mastery, and vocabulary usage, offering advanced suggestions to enhance your writing skills. \n - Link to avail: https://www.grammarly.com\n\n* 🎥 Live Streaming \n * Substack \n - Mercedes O’Brien is live on Substack now with 'Mary Trump Live'. Watch the live video and join the discussion. \n - Link to avail: https://open.substack.com/live-stream/14865?utm_source=email&utm_campaign=new-live-stream-email"
}
] >

Debug info

core

  • n8nVersion: 1.81.0
  • platform: docker (self-hosted)
  • nodeJsVersion: 22.13.1
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: memory

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/133.0.0.0 safari/537.36
  • isTouchDevice: false

Generated at: 2025-03-07T09:34:38.241Z}

@Joffcom
Copy link
Member

Joffcom commented Mar 11, 2025

Hey @AshaffHussain,

We have created an internal ticket to look into this which we will be tracking as "GHC-1140"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Mar 11, 2025
@Joffcom
Copy link
Member

Joffcom commented Mar 11, 2025

Hey @AshaffHussain

What makes you think it is the telegram node? The error you have shared is from the DebugHelper node.

@Joffcom Joffcom added the Needs Feedback Waiting for further input or clarification. label Mar 11, 2025
@AshaffHussain
Copy link
Author

@Joffcom, I threw in a DebugHelper node to understand the issue better since the Telegram Send node wasn't giving me an accurate output.

@Joffcom Joffcom removed the Needs Feedback Waiting for further input or clarification. label Mar 11, 2025
@Joffcom
Copy link
Member

Joffcom commented Mar 11, 2025

@AshaffHussain in that case do you have the error output from the Telegram node?

@Joffcom Joffcom added the Needs Feedback Waiting for further input or clarification. label Mar 11, 2025
@AshaffHussain
Copy link
Author

@Joffcom , the image below is what I get when the previous code node sends an output object array,

Image

While the Telegram node does show the content the output ends up being empty.

@Joffcom Joffcom removed the Needs Feedback Waiting for further input or clarification. label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants