Automate Telegram Bot Interactions with n8n Workflow

Struggling to manage multiple Telegram message types, commands, and payments manually? This n8n workflow automates Telegram bot interactions—handling texts, photos, files, voice notes, payments, and user registration seamlessly.
telegramTrigger
telegram
switch
+5
Workflow Identifier: 2082
NODES in Use: telegramTrigger, set, telegram, stickyNote, switch, if, googleSheets, executeWorkflow

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This workflow listens to all kinds of messages and actions sent to a Telegram bot.
It sorts them by type, such as texts, photos, voice notes, files, commands, payments, and group joins.
The main problem solved is saving time and preventing mistakes by processing everything automatically.
The result is faster replies and accurate status tracking for users and payments.


How the Workflow Works: Input → Process → Output

Inputs

  • Telegram updates: Messages, files, callback queries, payments, and membership events.

Processing Steps

  • A Telegram Trigger node receives all updates.
  • A Set node prepares data.
  • A main Switch node sorts input into categories: Message, Callback, System, Payment.
  • Within Message, another Switch finds if it is text, photo, file, or voice.
  • An IF node checks if text is a command starting with a slash.
  • A command Switch directs known commands to workflows; unknown commands get a fallback reply.
  • System inputs check for new member events; if found, an Execute Workflow updates Google Sheets to register the user.
  • Payment data triggers payment-related workflows after tagging action identifiers.

Outputs

  • Replies sent back to Telegram chats confirming message types.
  • Google Sheets updated with user status.
  • Triggered workflows handle payments and invoices.

Tools and Services Used

  • n8n platform: For building and running automation workflows.
  • Telegram Bot API: Receives user messages and sends responses.
  • Google Sheets API: Stores and updates user info and payment status.

Who Should Use This Workflow

This workflow fits community managers handling large Telegram groups.
It helps with automatic message sorting, fast replies, user membership tracking, and payment processing.
Anyone needing to reduce manual tasks and improve Telegram chat management will find it useful.


Beginner Step-by-Step: How to Use This Workflow in Production

Import Workflow

  1. Download the workflow file using the Download button on this page.
  2. In the n8n editor, click the top-left menu and choose “Import from File”.
  3. Select the downloaded workflow file to load it.

Configure Credentials

  1. Add Telegram Bot API credentials in n8n’s credentials manager.
  2. Set up Google Sheets OAuth credentials with write permissions.

Update IDs & Parameters

  1. Edit any IDs, emails, Google Sheet names, or folder references in nodes if required.
  2. Make sure the Telegram webhook URL is properly set in the Telegram Bot settings.

Test Workflow

  1. Send test messages to the Telegram bot: texts, photos, or commands like /pay.
  2. Check if replies come back correctly.
  3. Verify Google Sheets update on membership changes.

Activate Workflow

  1. Turn the workflow on by toggling it in n8n editor to run live.
  2. Monitor executions in the n8n UI for any errors.
  3. Optionally consider self-host n8n for better control and privacy.

Customizations

  • Add new command words in the existing command Switch node for more bot features.
  • Change texts sent back in Telegram send nodes to match preferred wording.
  • Extend the Google Sheets schema to track more user fields like subscription or last active date.
  • Add new message types like video in the message type Switch for broader media support.
  • Connect more sub-workflows for registrations, payments, or special events.

Troubleshooting

  • Webhook not triggering: Check correct webhook URL and Telegram permissions.
  • Google Sheets update issues: Confirm sheet name, ID, and OAuth access rights.
  • Commands ignored: Ensure commands start with slash and IF node conditions are right.

Pre-Production Checklist

  • Verify Telegram API credentials and webhook setup.
  • Confirm Google Sheets OAuth is authorized.
  • Test each message type and feedback response.
  • Simulate members joining/leaving to check sheet updates.
  • Try payment commands and verify workflows trigger.

Deployment Guide

Activate the workflow on the n8n editor to start.

Use execution logs to watch for errors.

Monitor Telegram bot dashboard for webhook hits.

Regularly check Google Sheets for correct user data.

Summary

✓ Automates sorting of Telegram messages by type and command.

✓ Tracks user memberships and payment events in Google Sheets.

✓ Saves hours by removing manual message handling.

✓ Sends quick, clear replies to users based on their input.

→ You get a more responsive Telegram bot and cleaner community management.

→ Payment processing and user registration happen without delay.


Frequently Asked Questions

The Telegram Trigger node listens to all incoming Telegram updates including messages, payments, and member status changes to start the workflow.
After import, add Telegram API credentials, configure Google Sheets API credentials, update any IDs or sheet names, then test the workflow before activating.
Payment commands such as /pay are detected in the command Switch node and trigger dedicated payment workflows automatically.
System nodes detect member status changes and invoke a registration workflow that updates the Google Sheets with the new user’s status.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free