AutomationFlowsSlack & Telegram › Telegram Bot Commands to Supabase

Telegram Bot Commands to Supabase

Original n8n title: [hub] Жора Commands

[HUB] Жора Commands. Uses executeWorkflowTrigger, telegram, supabase. Event-driven trigger; 7 nodes.

Event trigger★★★★☆ complexity7 nodesExecute Workflow TriggerTelegramSupabase
Slack & Telegram Trigger: Event Nodes: 7 Complexity: ★★★★☆ Added:

This workflow follows the Execute Workflow Trigger → Telegram recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "[HUB] \u0416\u043e\u0440\u0430 Commands",
  "description": null,
  "nodes": [
    {
      "id": "exec-trigger-001",
      "name": "When Called by \u0416\u043e\u0440\u0430",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "parameters": {
        "inputSource": "passthrough"
      }
    },
    {
      "id": "<uuid>",
      "name": "Command Handler",
      "type": "n8n-nodes-base.code",
      "position": [
        220,
        0
      ],
      "parameters": {
        "jsCode": "const command = $json.text?.toLowerCase().trim() || '';\nconst chatId = $json.chat_id;\nconst messageId = $json.message_id;\n\nlet commandType = 'unknown';\n\nif (command === '/stop') {\n  commandType = 'stop';\n} else if (command === '/start') {\n  commandType = 'start';\n}\n\nreturn {\n  json: {\n    chat_id: chatId,\n    message_id: messageId,\n    command: commandType,\n    original_command: command\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "<uuid>",
      "name": "Switch Command Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        440,
        0
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "stop",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "<uuid>",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.command }}",
                    "rightValue": "stop"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "start",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "<uuid>",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.command }}",
                    "rightValue": "start"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.3
    },
    {
      "id": "8d554fca-36d7-47ae-b07d-ae<TG_USER_ID>b",
      "name": "Send Stop Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        660,
        -80
      ],
      "parameters": {
        "text": "\u041f\u043e\u043d\u044f\u043b. \u041e\u0447\u0438\u0441\u0442\u0438\u043b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. \u0416\u0434\u0443 \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443.",
        "chatId": "={{ $json.chat_id }}",
        "resource": "message",
        "operation": "sendMessage",
        "additionalFields": {
          "parse_mode": "Markdown",
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "<uuid>",
      "name": "Save Stop Command",
      "type": "n8n-nodes-base.supabase",
      "position": [
        880,
        -80
      ],
      "parameters": {
        "schema": "smm_army",
        "tableId": "sent_messages",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "telegram_message_id",
              "fieldValue": "={{ $json.result.message_id }}"
            },
            {
              "fieldId": "telegram_chat_id",
              "fieldValue": "={{ $('Command Handler').first().json.chat_id }}"
            },
            {
              "fieldId": "message_type",
              "fieldValue": "command"
            },
            {
              "fieldId": "content_data",
              "fieldValue": "={{ JSON.stringify({command: 'stop', original_message_id: $('Command Handler').first().json.message_id}) }}"
            }
          ]
        },
        "useCustomSchema": true
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "<uuid>",
      "name": "Send Start Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        660,
        80
      ],
      "parameters": {
        "text": "=*\u0417\u0434\u0430\u0440\u043e\u0432\u0430\\! \u042f SMM Agent System \\- \u043c\u0443\u043b\u044c\u0442\u0438\u0430\u0433\u0435\u043d\u0442\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u0430\u0440\u043a\u0435\u0442\u043e\u043b\u043e\u0433\u043e\u0432 \\(\u0432\u0435\u0440\u0441\u0438\u044f 0\\.9\\)*\n\n/stop \u2014 \u043e\u0447\u0438\u0441\u0442\u0438\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\\.\n\n\ud83d\ude80 \u041f\u043e\u0433\u043d\u0430\u043b\u0438\\! \u0416\u0434\u0443 \u0437\u0430\u0434\u0430\u0447\u0438\\.",
        "chatId": "={{ $json.chat_id }}",
        "resource": "message",
        "operation": "sendMessage",
        "additionalFields": {
          "parse_mode": "MarkdownV2",
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "<uuid>",
      "name": "Save Start Command",
      "type": "n8n-nodes-base.supabase",
      "position": [
        880,
        80
      ],
      "parameters": {
        "schema": "smm_army",
        "tableId": "sent_messages",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "telegram_message_id",
              "fieldValue": "={{ $json.result.message_id }}"
            },
            {
              "fieldId": "telegram_chat_id",
              "fieldValue": "={{ $('Command Handler').first().json.chat_id }}"
            },
            {
              "fieldId": "message_type",
              "fieldValue": "command"
            },
            {
              "fieldId": "content_data",
              "fieldValue": "={{ JSON.stringify({command: 'start', original_message_id: $('Command Handler').first().json.message_id}) }}"
            }
          ]
        },
        "useCustomSchema": true
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "When Called by \u0416\u043e\u0440\u0430": {
      "main": [
        [
          {
            "node": "Command Handler",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Command Handler": {
      "main": [
        [
          {
            "node": "Switch Command Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch Command Type": {
      "main": [
        [
          {
            "node": "Send Stop Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Start Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Stop Response": {
      "main": [
        [
          {
            "node": "Save Stop Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Start Response": {
      "main": [
        [
          {
            "node": "Save Start Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "Asia/Ho_Chi_Minh",
    "errorWorkflow": "O6BjG1ublqWZ1KWk",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false
  },
  "staticData": null
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

[HUB] Жора Commands. Uses executeWorkflowTrigger, telegram, supabase. Event-driven trigger; 7 nodes.

Source: https://github.com/mike-prokhorov/n8n-automation-templates/blob/main/n8n-multi-agent-orchestrator/workflows/05_commands.json — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Slack & Telegram

[HUB] Жора Action. Uses executeWorkflowTrigger, supabase, telegram, httpRequest. Event-driven trigger; 19 nodes.

Execute Workflow Trigger, Supabase, Telegram +1
Slack & Telegram

[HUB] Жора Media. Uses executeWorkflowTrigger, supabase, telegram. Event-driven trigger; 9 nodes.

Execute Workflow Trigger, Supabase, Telegram
Slack & Telegram

[HUB] Жора Capture. Uses executeWorkflowTrigger, httpRequest, supabase, telegram. Event-driven trigger; 8 nodes.

Execute Workflow Trigger, HTTP Request, Supabase +1
Slack & Telegram

This workflow provides a complete solution for handling Telegram Stars payments, invoicing and refunds using n8n. It automates the process of sending invoices, managing pre-checkout approvals, recordi

HTTP Request, Execute Workflow Trigger, Google Sheets +2
Slack & Telegram

This n8n workflow automates task management by integrating Trello, Supabase, and Telegram to streamline card creation, user assignment, and due date notifications. It ensures seamless synchronization

Trello Trigger, Telegram, Supabase +1