Skip to main content

(De)activate n8n workflows using Telegram commands

Workflow preview

Workflow preview
100%
(De)activate n8n workflows using Telegram commands preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Telegram N8N workflow (de)activator What does it do? This workflow helps you to quickly activate or deactivate a workflow through Telegram. Sometimes we are not able to access a PC to resolve an is...

Best for

  • DevOps automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.filter, n8n-nodes-base.n8n, n8n-nodes-base.switch, n8n-nodes-base.telegramtrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by MilanWR.

Original n8n.io source

1.1 Workflow description

Title
(De)activate n8n workflows using Telegram commands
Workflow name
(De)activate n8n workflows using Telegram commands

Telegram N8N workflow (de)activator

What does it do?

This workflow helps you to quickly activate or deactivate a workflow through Telegram. Sometimes we are not able to access a PC to resolve an issue if something goes wrong with a workflow. If you, like me, use Telegram to send yourself error reports, you can quickly react in case of urgency. Just by sending '/stop' combined with the name you use for a workflow, you can deactivate a workflow, or reactivate it with '/start'. For example '/stop marketing'.

Walkthrough: https://watch.screencastify.com/v/uWQ88gZKj57WTGOOqSW2 (6min)

Instructions

  1. Create a Telegram API key through botfather (https://t.me/botfather). Add it to the telegram credentials.
  2. For the N8N nodes, go to settings in your n8n instance. Then 'n8n API' and 'create an API key'.
  3. To ensure that only we can send commands to the bot, we need the chat ID of our DM with our newly created bot. Open the the Telegram trigger and click on 'listen to events'.
  4. Go to Telegram and send a direct message to the bot, this will trigger the Telegram node.
  5. Go to the filter node and fill in the chat id you want to filter for with the data you got from the test event in the Telegram node.
  6. In the first Switch node you can find the commands, in this case it is '/start' and '/stop'. When you send a message to your bot starting with either of those, it will go to the next switch nodes.
  7. Next it will check what other word it contains. As an example I have used the words 'marketing' and 'sales', both corresponding to a marketing and sales workflow.
  8. The last nodes will either activate or deactivate a workflow.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Keep only messages from a specific chat id

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 1

Block 3 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Deactivate the marketing workflow

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 5 - Deactivate the sales workflow

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 6 - Activate the marketing workflow

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 7 - Switch depending on content (activate)

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 2

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Receive commands from Telegram

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1

Block 10 - Activate the sales workflow

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 11 - Switch depending on command

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 2

Block 12 - Switch depending on content (deactivate)

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 2

3. Summary Table

Workflow (De)activate n8n workflows using Telegram commands
Complexity intermediate
Nodes 12
Categories DevOps
Author MilanWR
Published 02 Dec 2023

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/1999/1999.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does (De)activate n8n workflows using Telegram commands do?

Telegram N8N workflow (de)activator What does it do? This workflow helps you to quickly activate or deactivate a workflow through Telegram. Sometimes we are not able to access a PC to resolve an is...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.