Activate/Deactivate n8n Workflows via Telegram Commands

Struggling to manage n8n workflows when away from your computer? This Telegram N8N workflow lets you activate or deactivate workflows remotely via simple commands, saving time and avoiding urgent mishaps.
n8n
telegramTrigger
switch
+2
Workflow Identifier: 2434
NODES in Use: stickyNote, filter, n8n, switch, telegramTrigger

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

1. Opening Problem Statement

Meet Sarah, a digital marketing manager who relies heavily on automation workflows built with n8n to keep her team’s campaigns running smoothly. One evening, Sarah receives a notification via Telegram about an issue with the Marketing workflow. However, she’s away from her laptop, and the n8n dashboard is inaccessible. The clock is ticking, errors are accumulating, and the campaign’s time-sensitive tasks risk failing.

Sarah wastes precious minutes trying to access her computer remotely and repeatedly refreshes her browser, hoping to fix or pause the faulty workflow. Her delays cause financial costs and client dissatisfaction. What if she could simply send a quick Telegram message to instantly stop or start any n8n workflow? This exact problem is solved by the Telegram N8N workflow activator/deactivator we will explore.

2. What This Automation Does

This custom-built n8n workflow empowers users to control their n8n workflows remotely via Telegram commands. When it runs:

  • You can send a private Telegram message to your bot with commands like /stop marketing or /start sales.
  • The workflow filters messages strictly from your personal Telegram chat ID to enhance security.
  • It interprets the commands by splitting them logically: identifying start or stop actions and the target workflow keywords such as “marketing” or “sales”.
  • Based on the command, it activates or deactivates specific n8n workflows remotely via the n8n API node.
  • All actions happen automatically without the need to log into the n8n dashboard or your PC, saving critical time in emergencies.
  • This gives you control and peace of mind, anywhere and anytime, right from your mobile device.

By using this workflow, Sarah cuts down issue resolution time from possibly hours to just seconds, preventing errors from cascading and ultimately protecting her campaigns and client trust.

3. Prerequisites ⚙️

  • 📧 A Telegram bot and its API key generated via BotFather.
  • 🔑 An n8n account with API key enabled for safe workflow activation and deactivation.
  • 📱 Your personal Telegram chat ID where you will send commands to your bot.
  • ⏱️ Access to an n8n instance where you can build or import this workflow.
  • Optionally, if you self-host n8n, ensure your instance supports API key authentication (learn more at Hostinger n8n hosting guide).

4. Step-by-Step Guide

Step 1: Create and Configure Your Telegram Bot

Go to Telegram and search for BotFather. Click “Start” and use the command /newbot to create a new bot. Follow prompts to name the bot and get its API token. Copy this token for later.

After setting up, add your bot API token in n8n under credentials as Telegram API. This allows the workflow to listen for Telegram messages.

Common Mistake: Not copying the full API token or mixing up bots.

Step 2: Generate an n8n API Key

Log into your n8n instance settings. Navigate to the n8n API section and create a new API key. Save this key securely, as it will be used to authenticate n8n API calls within the workflow.

Step 3: Add the Telegram Trigger Node

In your workflow, add the Telegram Trigger node. Configure it to listen for message updates. This node waits for any new Telegram message sent to your bot.

Click “Listen to Events” and send a message to your Telegram bot from your personal chat. This triggers the node and captures the chat data.

Step 4: Filter Messages from Your Chat ID

Use the Filter node named “Keep only messages from a specific chat id.” Here, set a condition filtering messages where {{ $json.message.chat.id }} equals your personal Telegram chat ID captured in the previous step.

This ensures only authorized commands from your personal conversation with the bot proceed, improving security.

Step 5: Detect Command Type with Switch Node

Add a Switch node named “Switch depending on command.” Configure two rules: one where the message text starts with /stop and another with /start. This node routes the message differently depending on whether you are stopping or starting a workflow.

Step 6: Identify Target Workflow Keyword

Add two Switch nodes for each command type:

  • Switch depending on content (deactivate): Rules check if the message contains “marketing” or “sales” keywords.
  • Switch depending on content (activate): Similarly checks for “usdc” or “hsuite” keywords (can be adjusted to your actual workflow names).

These nodes determine exactly which workflow to act upon based on the command content.

Step 7: Activate or Deactivate Workflows Using n8n Node

Use the n8n node to call the n8n API with operations to activate or deactivate workflows. Each command/keyword maps to a specific workflow ID URL you input in the node settings.

For example, if you send “/stop marketing,” the node deactivates the marketing workflow remotely.

Step 8: Test the Workflow End-to-End

Send test commands to your Telegram bot from your personal chat:

  • /stop marketing should deactivate the marketing workflow.
  • /start sales should activate the sales workflow.

Watch the workflow execute each step, ensuring the correct workflows change state accordingly.

5. Customizations ✏️

  • Add More Workflows: Add more cases in the Switch depending on content nodes to handle more workflows like “finance” or “support.” Update node rules with new keywords and corresponding activate/deactivate n8n node calls.
  • Multi-User Access: Modify the Filter node to accept an array of allowed chat IDs, enabling commands from multiple Telegram users.
  • Command Aliases: Edit the command switch node to accept additional synonyms besides /start and /stop, such as /enable or /disable for richer control commands.
  • Custom Responses: Add Telegram Send Message nodes after activating or deactivating workflows to confirm the action back to the user.

6. Troubleshooting 🔧

Problem: “Workflow does not activate or deactivate upon sending command.”
Cause: Incorrect workflow IDs or missing API key in the n8n node.
Solution: Double-check that the workflow URL values in the n8n node exactly match the workflow you want to control. Verify your API key credentials are correct and properly assigned.

Problem: “Telegram trigger not firing.”
Cause: Bot token is wrong or the bot isn’t added in Telegram.
Solution: Make sure you use the correct bot API key created in BotFather. Also, send a direct message to your bot to trigger the initial event and capture chat ID.

7. Pre-Production Checklist ✅

  • Verify Telegram trigger captures messages from your designated chat ID.
  • Ensure the filter node correctly filters only your personal chat messages.
  • Test each switch node rule by sending different commands to verify routing.
  • Confirm all n8n API credentials are valid and workflow URLs are up to date.
  • Backup your current workflows before testing activation/deactivation.

8. Deployment Guide

Once fully tested, activate your Telegram N8N workflow activator/deactivator in your n8n instance. Keep the workflow running to listen for commands at any time. For monitoring, review the executions detailed logs in n8n workflow dashboard to catch any errors or unexpected behavior.

If you use self-hosted n8n, ensure your server is secure and has stable internet connection for uninterrupted bot interaction.

10. Conclusion

With this Telegram N8N workflow controller, Sarah—and you—can now remotely manage your critical automation workflows with ease and speed. No more scrambling for a laptop or dashboard access under pressure.

This automation saves time, reduces downtime, and empowers you with control anywhere via simple Telegram commands like /stop marketing and /start sales. It’s a practical tool that fits perfectly for anyone relying on n8n to keep important systems running.

Next steps could include expanding command options for more workflows, integrating status feedback messages, or automating error reporting for better proactive management. Happy automating!

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 in n8n

A complete beginner guide to building an AI-powered 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