Remote Administration via Telegram Bot Commander - n8n Workflow

Use this comprehensive n8n workflow to remotely manage your n8n instance. Execute, activate, deactivate, backup, and monitor any n8n workflow directly through simple Telegram bot commands.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • n8n users running self-hosted instances who require remote control capabilities.

  • DevOps teams needing quick access to activate or debug an n8n workflow.

  • Anyone seeking proactive monitoring, including alerts when an n8n workflow fails.

Overview

This powerful n8n template transforms a simple Telegram chat into a command-line interface for your entire automation platform. By leveraging the n8n API through dedicated n8n nodes, you gain the ability to execute, activate, and deactivate any n8n workflow instantly. The automation also includes critical administrative functions like deleting archived workflows and generating full backups of your workflows and credentials (ideal for self-hosted n8n setups).

Furthermore, this n8n workflow doubles as a centralized monitoring system. When configured as the Error Workflow in your n8n settings, it sends immediate alerts to your Telegram chat whenever another n8n workflow encounters a failure, ensuring you never miss a critical error. This centralized control system makes managing multiple complex n8n workflows seamless and efficient.

How it Works

This comprehensive n8n workflow begins with the Telegram Trigger node, waiting for a secure command from the authorized user's Chat ID.


  1. Command Intake: The dedicated n8n trigger captures the incoming message.

  2. Parsing & Routing: The 'Cmd Parse' Set node extracts the command (e.g., 'execute', 'backup') and any argument (the target n8n workflow name). The 'Cmd Switch' node then routes the flow to the appropriate branch.

  3. Workflow Management (Execute/Activate/Deactivate): For argument-required commands (like execute or activate), the flow first checks if the workflow name exists using the n8n node to list workflows and a Filter node to match the name. If the n8n workflow is found, another n8n node or Execute Workflow node performs the requested operation (execution, activation, or deactivation). Status updates are sent via a Telegram node.

  4. Admin Operations (Cleanup/Backup):

The cleanup command uses the n8n node to fetch archived workflows, filters them, and then iteratively uses the n8n node (Delete operation) to permanently remove them, confirming the action via Telegram.
The backup command uses Execute Command nodes to run n8n CLI exports for workflows and credentials, bundles them into a secure tarball, reads the file, sends the backup document via a Telegram node, and then cleans up the temporary files.

  1. Monitoring & Alerts: Separate branches handle two monitoring functions: The Error Trigger node catches failures from other n8n workflows, formats the error details, and sends an immediate Telegram alert. The n8n Started Trigger sends a simple notification every time the n8n instance initializes, confirming uptime.

Installation Guide

To deploy this powerful n8n workflow template, follow these setup steps:


  1. Import the n8n Workflow: Copy the provided JSON and import it into your n8n instance via the 'Workflows' section.

  2. Set up Credentials: You will need two types of credentials:

Telegram API: Obtain your bot token from BotFather and your personal ChatID (use @userinfobot). Create a Telegram API credential in n8n.
n8n API: In your n8n settings, create a new API key. Create an n8n API credential using this key and your n8n server address.

  1. Configure Telegram Nodes: Edit every Telegram node in this n8n workflow (e.g., 'Telegram Trigger', 'Executed', 'Help', 'Cmd Error', etc.). Select your newly created Telegram credential and input your specific Chat ID/User ID in the relevant restriction fields. This secures the n8n trigger to only respond to you.

  2. Configure n8n Nodes: Edit every n8n node (e.g., 'List Workflows', 'Activate Workflow', 'Execute Workflow', etc.) and select your configured n8n API credential.

  3. Enable Error Monitoring: To utilize the error alerting functionality, go to your n8n instance settings, locate the 'Error Workflow' option, and select this Telegram-n8n-Commander n8n workflow from the list.

  4. Activate: Activate the main n8n workflow. You can now send commands to your Telegram bot.

Node Details

Telegram Trigger: The starting n8n trigger point. It listens for incoming messages, restricted by specific Chat IDs to maintain security.
Set (Cmd Parse): Crucial core logic node. It uses JavaScript expressions to extract the command keyword and the argument from the Telegram message text for proper routing.
Switch (Cmd Switch): The primary flow control mechanism. It checks the parsed command and directs the execution path to the relevant administrative function (e.g., backup, workflows, execute).
n8n Node: Used extensively for administrative tasks. Operations include get (to list workflows or executions), activate, and deactivate—directly manipulating the state of other n8n templates.
Execute Workflow Node: Specifically used by the execute command path to manually trigger another n8n workflow, often one that uses the 'When Executed by Another Workflow' n8n trigger type.
Filter Node (Find Workflow X): Used to search the list of all n8n workflows fetched via the n8n API, matching the user-supplied workflow name (the command argument) to find its internal ID.
Execute Command Node: Used exclusively in the backup branch to execute system CLI commands for generating the backup files (n8n export:workflow, tar).
Error Trigger / n8n Started Trigger: These dedicated n8n trigger nodes enable passive monitoring, notifying the user about instance health and workflow failures.

Related n8n Workflows

Free

Nodes: 14 Nodes
Updated: December 26 2025
View all
Created by

Engineer, Coder, Maker, Curious...

Featured*