AutomationFlowsAI & RAG › Smartagent Telegram

Smartagent Telegram

SmartAgent_Telegram. Uses telegramTrigger, telegram, httpRequest, openAi. Event-driven trigger; 10 nodes.

Event trigger★★★★☆ complexityAI-powered10 nodesTelegram TriggerTelegramHTTP RequestOpenAIGoogle CalendarAirtable
AI & RAG Trigger: Event Nodes: 10 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Airtable → HTTP Request 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": "SmartAgent_Telegram",
  "nodes": [
    {
      "id": "1",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "parameters": {
        "updates": [
          "message"
        ],
        "token": "{{ $env.TELEGRAM_TOKEN }}"
      }
    },
    {
      "id": "2",
      "name": "Check Voice or Text",
      "type": "n8n-nodes-base.if",
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{$json[\"message\"][\"voice\"]}}",
              "operation": "isNotEmpty"
            }
          ]
        }
      }
    },
    {
      "id": "3",
      "name": "Telegram Get File",
      "type": "n8n-nodes-base.telegram",
      "parameters": {
        "operation": "getFile",
        "fileId": "={{$json[\"message\"][\"voice\"][\"file_id\"]}}",
        "token": "{{ $env.TELEGRAM_TOKEN }}"
      }
    },
    {
      "id": "4",
      "name": "Whisper Speech to Text",
      "type": "n8n-nodes-base.httpRequest",
      "parameters": {
        "url": "https://api.openai.com/v1/audio/transcriptions",
        "method": "POST",
        "authentication": "predefinedCredentialType",
        "sendBinaryData": true,
        "binaryPropertyName": "data",
        "options": {
          "bodyContentType": "multipart/form-data"
        },
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "model",
              "value": "whisper-1"
            }
          ]
        },
        "headerParametersUi": {
          "parameter": [
            {
              "name": "Authorization",
              "value": "Bearer {{ $env.OPENAI_API_KEY }}"
            }
          ]
        }
      }
    },
    {
      "id": "5",
      "name": "Combine Text Input",
      "type": "n8n-nodes-base.function",
      "parameters": {
        "functionCode": "return [{ data: $json.message.text || $json.text }];"
      }
    },
    {
      "id": "6",
      "name": "OpenAI Chat Intent",
      "type": "n8n-nodes-base.openAi",
      "parameters": {
        "resource": "chatCompletion",
        "model": "gpt-4o-mini",
        "options": {},
        "prompt": "You are a smart multilingual assistant managing calendar and financial tasks. Return a JSON object like {intent: '...', details: '...'} based on user input: {{$json.data}}"
      },
      "credentials": {
        "openAiApi": "<your credential>"
      }
    },
    {
      "id": "7",
      "name": "Switch Intent",
      "type": "n8n-nodes-base.switch",
      "parameters": {
        "property": "={{$json.intent}}",
        "rules": [
          {
            "value": "add_calendar_event",
            "operation": "equal"
          },
          {
            "value": "add_transaction",
            "operation": "equal"
          },
          {
            "value": "conversation",
            "operation": "equal"
          }
        ]
      }
    },
    {
      "id": "8",
      "name": "Google Calendar Create Event",
      "type": "n8n-nodes-base.googleCalendar",
      "parameters": {
        "operation": "create",
        "calendar": "primary",
        "title": "={{$json.details}}",
        "start": "={{$json.start || new Date().toISOString()}}",
        "end": "={{$json.end || new Date(Date.now()+3600000).toISOString()}}"
      },
      "credentials": {
        "googleCalendarOAuth2Api": "<your credential>"
      }
    },
    {
      "id": "9",
      "name": "Airtable Add Record",
      "type": "n8n-nodes-base.airtable",
      "parameters": {
        "operation": "create",
        "baseId": "={{$env.AIRTABLE_BASE_ID}}",
        "tableId": "={{$env.AIRTABLE_TABLE_ID}}",
        "fields": {
          "Name": "={{$json.details}}",
          "Amount": "={{$json.amount || 0}}",
          "Date": "={{new Date().toISOString()}}"
        }
      },
      "credentials": {
        "airtableApi": "<your credential>"
      }
    },
    {
      "id": "10",
      "name": "Telegram Send Message",
      "type": "n8n-nodes-base.telegram",
      "parameters": {
        "operation": "sendMessage",
        "chatId": "={{$json.message.chat.id}}",
        "text": "\u2705 \u062a\u0645 \u062a\u0646\u0641\u064a\u0630 \u0627\u0644\u0639\u0645\u0644\u064a\u0629 \u0628\u0646\u062c\u0627\u062d: {{$json.intent}}"
      }
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Check Voice or Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Voice or Text": {
      "main": [
        [
          {
            "node": "Combine Text Input",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram Get File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Get File": {
      "main": [
        [
          {
            "node": "Whisper Speech to Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Whisper Speech to Text": {
      "main": [
        [
          {
            "node": "Combine Text Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Text Input": {
      "main": [
        [
          {
            "node": "OpenAI Chat Intent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Intent": {
      "main": [
        [
          {
            "node": "Switch Intent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch Intent": {
      "main": [
        [
          {
            "node": "Google Calendar Create Event",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Airtable Add Record",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram Send Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar Create Event": {
      "main": [
        [
          {
            "node": "Telegram Send Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Airtable Add Record": {
      "main": [
        [
          {
            "node": "Telegram Send Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

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

SmartAgent_Telegram. Uses telegramTrigger, telegram, httpRequest, openAi. Event-driven trigger; 10 nodes.

Source: https://gist.github.com/haiderrafathr-cpu/20dee77d470682d198190eb26d78febb — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

AI Agent Workflow. Uses telegramTrigger, chatTrigger, telegram, openAi. Event-driven trigger; 82 nodes.

Telegram Trigger, Chat Trigger, Telegram +7
AI & RAG

Transform your salon/service business with this streamlined Telegram automation system featuring Claude integration, zero-setup database management, and intelligent conversation handling. Claude MCP I

Redis, Agent Tool, Google Calendar +10
AI & RAG

Template Carnaval - time instagram. Uses toolWorkflow, lmChatOpenAi, memoryBufferWindow, agent. Event-driven trigger; 56 nodes.

Tool Workflow, OpenAI Chat, Memory Buffer Window +10
AI & RAG

Telegram. Uses memoryBufferWindow, toolWorkflow, agent, telegramTrigger. Event-driven trigger; 35 nodes.

Memory Buffer Window, Tool Workflow, Agent +8
AI & RAG

Trading Agent - Agent Flow. Uses memoryBufferWindow, toolWorkflow, agent, telegramTrigger. Event-driven trigger; 35 nodes.

Memory Buffer Window, Tool Workflow, Agent +8