N
n8n Store
Workflow Market
Personal Telegram AI Assistant bot

Personal Telegram AI Assistant bot

by hellopaul0 views

説明

Categories

📊 Productivity🤖 AI & Machine Learning

Nodes Used

n8n-nodes-base.ifn8n-nodes-base.switchn8n-nodes-base.telegramn8n-nodes-base.telegramn8n-nodes-base.gmailTooln8n-nodes-base.notionTooln8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNote
Price無料
Views0
最終更新11/28/2025
workflow.json
{
  "id": "63Dw6h0zoqobTINZ",
  "meta": {
    "instanceId": "0c8ccd6e2b94aafad23c580930e4e83dbe91d3bb2fa78619864f045d32095a87",
    "templateCredsSetupCompleted": true
  },
  "name": "Personal Telegram AI Assistant bot",
  "tags": [],
  "nodes": [
    {
      "id": "79c2aa38-769d-4dd5-bb4a-cf675ea22e2d",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "notes": "Enter your Telegram bot token from BotFather after creating the bot.\n",
      "position": [
        -640,
        0
      ],
      "webhookId": "05154c83-094f-4401-b647-7df5b41d1a04",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "hbvE8OBwHFyOHQY3",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "66a44dc8-8914-4555-9c38-1436ad19307a",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        384,
        16
      ],
      "parameters": {
        "text": "={{ $json.message.text }}{{ $json.content.parts[0].text }}",
        "options": {
          "systemMessage": "=You are a useful assistant to {{ $json.message.from.first_name }}. You can send emails, View and edit Calendar events, created notes in notion and also try to do tasks as assigned by them. "
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "736b9880-a4c8-471d-a0e0-58a8b51c6cb5",
      "name": "Send a message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "notes": "Connect a Gmail account by opening console.cloud.google.com, enabling the Gmail API for the project, and completing Google account authorization.",
      "position": [
        1040,
        384
      ],
      "webhookId": "399c3a8e-3282-4ff6-8866-4ba568db1441",
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "bx2nv5qBrnceBEgb",
          "name": "Gmail account 2"
        }
      },
      "notesInFlow": true,
      "typeVersion": 2.1
    },
    {
      "id": "4cff267f-45dc-466e-869b-e4b4e08dfd91",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        560,
        -176
      ],
      "parameters": {
        "sessionKey": "={{ $json.message.text }}{{ $json.content.parts[0].text }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "89e93f91-c0aa-438d-87bd-5a1f525c36f5",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "notes": "Enter the Google Gemini API key to enable Gemini model.",
      "position": [
        400,
        -176
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "qLwVRPuYTlFlr43H",
          "name": "Google Gemini(PaLM) API"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "ecb246b8-653d-46fb-817c-f123e22f871f",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "notes": "Sends the bot’s response after the workflow finishes executing.",
      "position": [
        1072,
        16
      ],
      "webhookId": "6bdcb401-3021-45ef-81c7-b716b2fd04b7",
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "hbvE8OBwHFyOHQY3",
          "name": "Telegram account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "4948f012-fb76-49d0-85fd-0327d398b45f",
      "name": "Check If Audio file",
      "type": "n8n-nodes-base.if",
      "notes": "Determines if the incoming message is an audio file or a text message, then routes it accordingly.",
      "position": [
        -208,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "281d35b3-486b-41e2-9b29-8b51de139dd6",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.message.voice.file_id }}",
              "rightValue": "={{ $json.message.chat.id }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3461eb67-c0b2-4173-8b2e-de919b14f8c4",
      "name": "Transcribe a recording",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "notes": "This node transcribes audio to text via Google Gemini; provide the Gemini credentials to establish the connection.",
      "position": [
        144,
        -160
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "options": {},
        "resource": "audio",
        "inputType": "binary"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "qLwVRPuYTlFlr43H",
          "name": "Google Gemini(PaLM) API"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "189f07e3-6d2f-4b33-bd69-ee8c2c9d9916",
      "name": "Get a file",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -16,
        -160
      ],
      "webhookId": "7e103121-9656-4fc1-8c03-7cbe42ef7583",
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "hbvE8OBwHFyOHQY3",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3bb3d890-849d-4c42-8b84-636971098567",
      "name": "Create an event in Google Calendar",
      "type": "n8n-nodes-base.googleCalendarTool",
      "notes": "Connect Google Calendar to this node. This node enables the Create Event action in Google Calendar.",
      "position": [
        720,
        384
      ],
      "parameters": {
        "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', `start time and end time for google calendar event.`, 'string') }}",
        "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', ``, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "[email protected]",
          "cachedResultName": "[email protected]"
        },
        "descriptionType": "manual",
        "toolDescription": "Create an event in Google Calendar",
        "additionalFields": {}
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "gzXfrCKDpiANbSpl",
          "name": "Google Calendar account 2"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.3
    },
    {
      "id": "fd1c0213-c0b1-41c4-9274-43cd63cb1193",
      "name": "Read event in Google Calendar",
      "type": "n8n-nodes-base.googleCalendarTool",
      "notes": "Connect Google Calendar to this node. This node enables the Read Event action in Google Calendar.",
      "position": [
        560,
        384
      ],
      "parameters": {
        "options": {},
        "timeMax": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Before', ``, 'string') }}",
        "timeMin": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('After', ``, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "[email protected]",
          "cachedResultName": "[email protected]"
        },
        "operation": "getAll",
        "descriptionType": "manual",
        "toolDescription": "Get events from google calendar when request. Consider sending all the events for the specific day stated by user."
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "gzXfrCKDpiANbSpl",
          "name": "Google Calendar account 2"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "214c9e52-968a-4933-839e-946cbfcd5f6f",
      "name": "Create notes in Notion",
      "type": "n8n-nodes-base.notionTool",
      "notes": "Create a Notion integration and paste its API key into the Notion credentials, then provide the public page URL where the bot should post messages.",
      "position": [
        880,
        384
      ],
      "parameters": {
        "title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Title', `Notes by Paul Created by Liz AI`, 'string') }}",
        "pageId": {
          "__rl": true,
          "mode": "url",
          "value": "https://www.notion.so/N8N-AI-Agent-Notes-26f11b7ddc0680ae8913d9c1ea7faff4?source=copy_link"
        },
        "blockUi": {
          "blockValues": [
            {
              "type": "bulleted_list_item",
              "textContent": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('blockValues0_Text', ``, 'string') }}"
            },
            {
              "url": "={{ $fromAI('blockValues1_Image_URL', ``, 'string') }}",
              "type": "image"
            }
          ]
        },
        "options": {}
      },
      "credentials": {
        "notionApi": {
          "id": "HcojMo7PRRvD68sw",
          "name": "Notion account 2"
        }
      },
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "cb8c4cbf-d6df-4e03-b84a-a3fea6331f39",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -672,
        -192
      ],
      "parameters": {
        "color": 2,
        "width": 592,
        "height": 368,
        "content": "## Telegram Trigger & Checks\n- Starts the workflow when a message is received on Telegram.  \n- Verifies the account to ensure only authorized users can access the bot.  \n- Checks if the incoming message contains an audio file or just text.  "
      },
      "typeVersion": 1
    },
    {
      "id": "bf1fe6ec-79a3-4e94-862c-3c5427f86014",
      "name": "Account Check",
      "type": "n8n-nodes-base.switch",
      "notes": "Provide the message ID from your Telegram account in the parameter value field to authenticate your chat.\n",
      "position": [
        -416,
        0
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "773564ea-faf4-4a3a-982c-7c3ee092547c",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.message.chat.id }}",
                    "rightValue": null
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "0b38ba6b-85ec-4de1-bacb-9d7381fc5398",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        -288
      ],
      "parameters": {
        "color": 3,
        "width": 384,
        "height": 304,
        "content": "## Audio Handling\n- Retrieves the audio file if the input is a voice note.  \n- Transcribes the recording into text so it can be processed by the AI.  "
      },
      "typeVersion": 1
    },
    {
      "id": "b30e6ccd-eebe-4972-9105-f61ce4f64a78",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -352
      ],
      "parameters": {
        "width": 368,
        "height": 336,
        "content": "\n## AI Setup\n- Defines the AI model (Google Gemini Chat Model).  \n- Adds Simple Memory to maintain conversation context.  "
      },
      "typeVersion": 1
    },
    {
      "id": "eb6027ec-0990-433e-aff6-2cfd184e9f6c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        256
      ],
      "parameters": {
        "color": 4,
        "width": 896,
        "height": 288,
        "content": "\n## AI Setup\n- Defines the AI model (Google Gemini Chat Model).  \n- Adds Simple Memory to maintain conversation context.  "
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "timezone": "Asia/Kolkata",
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "Q3zRHMkTDIS89L8B",
    "executionOrder": "v1"
  },
  "versionId": "61be5764-628d-4b58-bbd8-783962aece29",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a file": {
      "main": [
        [
          {
            "node": "Transcribe a recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Account Check": {
      "main": [
        [
          {
            "node": "Check If Audio file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Account Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Audio file": {
      "main": [
        [
          {
            "node": "Get a file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create notes in Notion": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe a recording": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Read event in Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create an event in Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流