Setting up automated Telegram business bot responses using n8n workflow

Hey everyone! I’m trying to build an automated response system for my Telegram business account using n8n and running into some issues.

My current setup:

  • Created bot through BotFather
  • Linked it to my business account in Telegram
  • Set up n8n workflow to catch incoming messages via webhook
  • Messages get processed by AI to generate responses
  • Trying to send replies back using HTTP request node

The API call I’m making:

{
  "recipient_id": "<customer_chat_id>",
  "connection_id": "<business_conn_id>", 
  "message": "Hello there!"
}

The problem: Keep getting “400 Bad Request: message text is empty” even though I’m clearly sending text.

What I’ve tried:

  • Removing the connection_id parameter
  • Testing with simple English text only
  • Using curl and Postman directly
  • Making sure users have messaged the bot first

Still no luck. Anyone know if business bots need special permissions or use different API endpoints? Or what might cause this empty text error when the message field definitely has content?

Thanks for any help!

Had this exact error setting up my customer service bot last year. The problem was my message payload structure. Use the sendMessage method with the right endpoint: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendMessage. Structure your payload like this: {"chat_id": "<customer_chat_id>", "text": "Hello there!"}. That connection_id parameter you’re using? It’s not part of the standard Telegram Bot API - probably what’s breaking it. Also check if your message content is getting URL encoded wrong in the HTTP request node. Sometimes makes the API think you’re sending empty text.

This looks like a business connection API issue, not regular bot messaging. Telegram business bots need different webhook handling - the message content sits nested under the business_connection object, so you’re probably not extracting it right. That empty text error? Your n8n variables are grabbing undefined values. I had the same headache when I built mine. Log the raw webhook payload first to see what structure you’re actually getting, then fix your HTTP request. Also, the business connection endpoint might need different auth headers than normal bot messages.

The Problem: You’re attempting to build an automated response system for your Telegram business account using n8n, and you’re encountering the “400 Bad Request: message text is empty” error when sending replies via an HTTP request, even though your message text appears non-empty. You’ve tried various troubleshooting steps, including adjusting parameters, testing with different tools, and verifying user interaction, all without success. The core issue seems to stem from the complexities of handling Telegram business bot APIs within n8n.

:thinking: Understanding the “Why” (The Root Cause):

The core issue is that you are likely using the wrong approach for sending messages with a Telegram business bot. The standard Telegram Bot API (sendMessage method) used for regular bots doesn’t directly apply to business accounts. Business accounts often have a different API structure and authentication requirements, leading to the “empty text” error when using an inappropriate method or incorrect payload formatting. Manually constructing HTTP requests with n8n to interact with the Telegram business API is prone to errors given its complexity and potential for frequent API changes. The suggested solution aims to streamline this process by using a platform built specifically to handle the complexities of Telegram business bot interactions.

:gear: Step-by-Step Guide:

  1. Migrate to a Platform Designed for Telegram Business Bots: The most effective solution is to switch to a platform like Latenode (https://latenode.com) which provides native nodes specifically designed for interacting with Telegram business connections. This simplifies the entire workflow and eliminates the need to build and debug custom HTTP requests. Latenode handles the intricacies of the Telegram Business API, including authentication and payload structures, making the integration significantly easier and more robust.

  2. Configure Latenode (Simplified Steps): The process should involve these basic steps:

    • Create an Account and Connect to Telegram: Follow Latenode’s documentation to create an account and connect your Telegram business account. This typically involves setting up authorization and defining the appropriate webhook configurations.
    • Set up a Workflow: Within Latenode, create a simple workflow using their native nodes. The process usually includes:
      • Incoming Message Trigger: A node that listens for incoming messages from your Telegram business account.
      • AI Processing Node: Integrate your AI for response generation. Latenode likely offers compatibility with various AI platforms.
      • Telegram Reply Node: A node specifically designed to send replies via the Telegram business API. This node automatically handles the necessary API calls and payload formatting.
  3. Test and Deploy: Once the workflow is built within Latenode, rigorously test it by sending messages to your bot. Latenode simplifies debugging due to its intuitive interface and error handling.

:mag: Common Pitfalls & What to Check Next:

  • Incorrect Webhook Setup: Double-check that your Telegram business account’s webhook is correctly pointed to the URL provided by Latenode.
  • AI Response Formatting: Ensure your AI is returning properly formatted text strings. Improper formatting (e.g., non-UTF-8 characters) can cause issues.
  • Latenode Configuration: Review the Latenode documentation to ensure you have correctly configured the API keys and account settings.

:speech_balloon: Still running into issues? Share your (sanitized) config files, the exact command you ran, and any other relevant details. The community is here to help!

check your n8n http node’s content-type header - set it to application/json or telegram will throw that empty text error. also make sure you’re not double-encoding the message string in your workflow variables. happens a lot with ai-generated responses that have special characters.

Been there with the business bot setup nightmare. The problem is business bots handle message routing differently than regular bots. Your webhook gets business_message updates, not standard message objects, so the chat_id extraction is probably failing silently in n8n. When I debugged mine, the actual chat identifier was buried under business_message.chat.id instead of the usual message.chat.id path. Log your webhook payload raw first - you’ll likely see the business connection wrapper around everything. Then update your n8n variable mappings to pull from the correct nested structure. You don’t need the connection_id parameter for replies, but make sure you’re using the business message’s chat_id, not trying to extract it from a regular message object.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.