Access bot token for telegram trigger to connect

hi ive bad problem with this telegram trigger

i use npx and ngrok for n8n and my url on n8n server host is https but when the telegram trigger dosnt connect with token to my bot

telegram trigger dosnt connect to my bot with token it show me this error

pls help me idk that what should i do !!:folded_hands:

1 Like

Are there any details under “More details”?

Hi! I faced the exact same issue and managed to solve it completely. The problem is usually related to network connectivity between your n8n instance and Telegram’s API servers. Here’s a step-by-step solution:

Step 1: Test Your Bot Token Before anything else, verify your bot token works:

  • Create a simple HTTP Request node in n8n

  • Method: GET

  • URL: https://api.telegram.org/bot[YOUR_BOT_TOKEN]/getMe

  • Execute it

If it fails like this with ENOTFOUND api.telegram.org or connection timeout, the issue is network connectivity, not your bot token.

Common Cause: ISP Blocking Telegram (in my case too)

Many ISPs block Telegram services. Quick test:

Solution: Configure n8n to Work with VPN

Step 1: Set Up VPN

  • Install a reliable VPN (I recommend ProtonVPN - it’s secure and has a free tier)

  • Connect to VPN and verify Telegram web works

Step 2: Configure n8n Container for VPN If you’re using Docker (which works similarly to npx setup):

Stop your current n8n instance

Then restart with proper DNS configuration:

docker run -d
–name n8n-telegram-fix
-p 5678:5678
–dns 8.8.8.8
–dns 1.1.1.1
–add-host=host.docker.internal:host-gateway
-v n8n_data:/home/node/.n8n
-e N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true
-e N8N_EDITOR_BASE_URL=https://your-ngrok-url.ngrok-free.app
-e WEBHOOK_URL=https://your-ngrok-url.ngrok-free.app
–restart unless-stopped

docker.n8n.io/n8nio/n8n:latest

For npx users: The VPN should work automatically, but ensure you:

  1. Start VPN first

  2. Then start n8n: npx n8n

  3. Then start ngrok

Step 3: Test Telegram API Connection After restarting n8n with VPN:

  • Go back to your HTTP Request node

  • Execute the getMe API call again

  • You should now see your bot information

Step 4: Configure Telegram Trigger

Now your Telegram Trigger should work:

  1. Add Telegram Trigger node

  2. Create new credentials:

    • Access Token: Your full bot token (including the colon)

  1. Save and activate the workflow

Important Notes:

For VPN Users:

  • Keep VPN connected when working with Telegram workflows

  • VPN only needed for Telegram-related work, not general n8n usage

ngrok Configuration:

  • Make sure your ngrok URL matches your n8n environment variables

  • Use: ngrok http --url=your-url.ngrok-free.app 5678

Expected Result:

After following these steps, your Telegram Trigger should show:

  • :white_check_mark: Connected status

  • No error messages

  • Ready to receive webhook calls

2 Likes

I figured out the issue and posted the solution here: [SOLVED] Telegram API timeouts - IPv4/IPv6 DNS resolution issue