8
n8n 中文网amn8n.com

Notion

高级

这是一个AI Chatbot, Multimodal AI领域的自动化工作流,包含 16 个节点。主要使用 If, Telegram, NotionTool, Agent, TelegramTrigger 等节点。 通过 Gemini AI 从 Telegram 到 Notion 自动化内容请求

前置要求
  • Telegram Bot Token
  • Notion API Key
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "M2al3wSlfXuUCOaj",
  "meta": {
    "instanceId": "a83f32fef25ff93a5a18e79703fd01015969cdf544bbeeff5c620f6cdf8301cb"
  },
  "name": "Notion",
  "tags": [],
  "nodes": [
    {
      "id": "3a72e740-f405-4a69-a491-37b0740d7485",
      "name": "Telegram 触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -896,
        48
      ],
      "webhookId": "1d124315-67c8-4026-9967-981de77cf6ca",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "",
          "name": ""
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3d72bea4-3dfe-4348-a894-8502908f519b",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        -880,
        288
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "f2d3e478-fd5e-4b27-a8fd-936c57eb8d0d",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $json.message.chat.id }}",
              "rightValue": "YOUR_TELEGRAM_GROUP_ID"
            },
            {
              "id": "265d2c82-81fb-4f39-8a77-9d18f3bd2b90",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $json.message.chat.id }}",
              "rightValue": "YOUR_TELEGRAM_CHAT_ID"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "86fcfcc8-e5c4-4ea9-b439-67a7d106ecce",
      "name": "发送文本消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -880,
        512
      ],
      "webhookId": "9264afa5-7821-438a-bb08-067cbc28e074",
      "parameters": {
        "text": "Maaf, siapa ya? aku gak kenal!",
        "chatId": "={{ $json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false,
          "reply_to_message_id": "={{ $json.message.message_id }}"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5d547b75-bf66-48ed-86fb-eb7261c23d61",
      "name": "发送聊天操作",
      "type": "n8n-nodes-base.telegram",
      "position": [
        192,
        -64
      ],
      "webhookId": "7225e56a-e6d6-4aab-859b-4e1cf26c256d",
      "parameters": {
        "chatId": "={{ $json.message.chat.id }}",
        "operation": "sendChatAction"
      },
      "typeVersion": 1.2
    },
    {
      "id": "f0b7818b-5651-4f7d-a1b6-dd191420d3f2",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        256,
        192
      ],
      "parameters": {
        "text": "={{ $('Telegram Trigger').item.json.message.text }}",
        "options": {
          "systemMessage": "=Kamu adalah Siti, wanita berusia 25 tahun yang selalu ceria, humble dan sangat pintar. \nTugas utamamu adalah menerima perintah dari pengguna melalui Telegram, berikut contoh tugasmu:\n1. Membuat request di Notion untuk kebutuhan pengguna.\n2. Membuat Copywriting\n- Kamu bisa membuat Copywriting teks, kutipan ayat al-quran, do'a, hadist, dll.\n- Kamu juga bisa menggabungkan antara kutipan ayat al-quran dan teks atau lainnya.\n3. Mengirimkan konfirmasi ke pengguna melalui Telegram.\n\n##Ketentuan operasional:\n- Format input perintah utama adalah:\n1. Person (Orang yang akan mengerjakan request pengguna di notion)\n2. link referensi konten (opsional)\n3. Jenis Konten ( Poster, Reels)\n4. Tanggal pembuatan request\n- Jika input tidak valid atau kurang data, beri respon ramah yang menjelaskan format yang benar.\n- Kamu bisa menggunakan memori percakapan untuk memahami konteks percakapan.\n\n##Cara Membuat Request di Notion:\n1. Title\n- Menggunakan format : <Jenis Konten> DRM\nContoh: Poster DRM\n2. Content Writting\n- Buat copywriting sesuai request dari pengguna\n- Copywriting harus berisi Headline dan Isi\n- Batasi panjang karakter Headline dan Isi agar ketika ditempatkan pada Poster/Reels bisa dibaca dengan nyaman.\n3. Channel\n- Isi dengan DRM\n4. Person\n- Diisi dengan nama orang yang akan mengerjakan konten\n5. Date\n- Ini diisi dengan tanggal request konten yang akan dikerjakan oleh Person\n6. Referensi Konten (optional)\n- Jika pengguna memberikan link referensi, maka isi dengan link tersebut\n7. Jenis Konten\n- Isi dengan Poster atau Reels, yang sesuai dengan request pengguna.\n\nWajib kirim preview ke pengguna, ketika pengguna setuju maka lanjutkan ke Notion.\n\n##Gaya komunikasi:\n- Ramah, jelas, santai dan seperti sahabat.\n- Sertakan detail penting seperti link Notion saat konfirmasi.\n\n##Hari ini:\n{{ $today }}\n\n##Sekarang:\n{{ $now }}\n\n##Nama Pengguna\n{{ $('Telegram Trigger').item.json.message.from.first_name }}\n\n##Tujuan akhir:\nMemastikan semua request pengguna tercatat dengan baik.\n\n##Format Output:\n- Gaya penulisan output telegram WAJIB menggunakan attribute HTML yang didikung Telegram Bot API\n- Selalu sertakan nama pengguna"
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "f28727af-d890-4292-8c00-a12f1ad813d0",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        256,
        400
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        }
      },
      "credentials": {
        "googlePalmApi": {
          "id": "",
          "name": ""
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bd3739e0-e670-49f3-bc5f-2dc4cda9f0c0",
      "name": "发送短信1",
      "type": "n8n-nodes-base.telegram",
      "onError": "continueErrorOutput",
      "position": [
        880,
        192
      ],
      "webhookId": "5925e482-cd50-46ad-a39c-701cd48369f5",
      "parameters": {
        "text": "={{ $('AI Agent').item.json.output }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "parse_mode": "HTML",
          "appendAttribution": false,
          "reply_to_message_id": "={{ $('Telegram Trigger').item.json.message.message_id }}"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b89afbb8-d7d1-4e16-a0a5-daf00d57641c",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        352,
        400
      ],
      "parameters": {
        "sessionKey": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "4301190e-0a32-4d14-b27f-4501472a1a79",
      "name": "如果2",
      "type": "n8n-nodes-base.if",
      "position": [
        -640,
        160
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "5a6c3965-cd5e-4ea6-846f-058716db3510",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.message.reply_to_message.from.username }}",
              "rightValue": "YOUR_TELEGRAM_NAME"
            },
            {
              "id": "8f983c12-18ac-4106-b3ab-dd5824820ad3",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.message.text }}",
              "rightValue": "YOUR_TELEGRAM_USERNAME"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4ac3f1d8-bb37-4eb5-9056-078825064050",
      "name": "发送聊天操作1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        576,
        192
      ],
      "webhookId": "7225e56a-e6d6-4aab-859b-4e1cf26c256d",
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "operation": "sendChatAction"
      },
      "typeVersion": 1.2
    },
    {
      "id": "f1b1880d-5147-43fd-b1be-a5be890a93f7",
      "name": "Notion",
      "type": "n8n-nodes-base.notionTool",
      "position": [
        400,
        608
      ],
      "parameters": {
        "title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Title', ``, 'string') }}",
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "a29bc195-96f4-4fd3-a857-d6f62b9241d8",
          "cachedResultUrl": "https://www.notion.so/a29bc19596f44fd3a857d6f62b9241d8",
          "cachedResultName": "Content Calendar"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Content Writting|rich_text",
              "textContent": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('propertyValues0_Text', ``, 'string') }}"
            },
            {
              "key": "Channel|multi_select",
              "multiSelectValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('propertyValues1_Option_Names_or_IDs', ``, 'string') }}"
            },
            {
              "key": "Person|multi_select",
              "multiSelectValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('propertyValues3_Option_Names_or_IDs', ``, 'string') }}"
            },
            {
              "key": "Date|date",
              "date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('propertyValues4_Date', ``, 'string') }}",
              "timezone": "Asia/Jakarta"
            },
            {
              "key": "Referensi Konten|rich_text",
              "textContent": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('propertyValues5_Text', ``, 'string') }}"
            },
            {
              "key": "Jenis Konten|multi_select",
              "multiSelectValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('propertyValues5_Option_Names_or_IDs', ``, 'string') }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c14519ba-b1e6-4532-85df-a0e64b989260",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -64
      ],
      "parameters": {
        "width": 528,
        "height": 736,
        "content": "## 群组和私聊规则"
      },
      "typeVersion": 1
    },
    {
      "id": "c5a7c92d-3a69-4618-a9e1-792a51d770bb",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -64
      ],
      "parameters": {
        "width": 528,
        "height": 736,
        "content": "## 私聊规则"
      },
      "typeVersion": 1
    },
    {
      "id": "b2390cb4-1540-4c1c-b191-0cc1ec405e4c",
      "name": "条件判断1",
      "type": "n8n-nodes-base.if",
      "position": [
        -288,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "265d2c82-81fb-4f39-8a77-9d18f3bd2b90",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $json.message.chat.id }}",
              "rightValue": "YOUR_TELEGRAM_CHAT_ID"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3627bea6-c3ef-4e5d-b821-d2a94d28cbc9",
      "name": "发送文本消息3",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -288,
        496
      ],
      "webhookId": "9264afa5-7821-438a-bb08-067cbc28e074",
      "parameters": {
        "text": "Maaf, siapa ya? aku gak kenal!",
        "chatId": "={{ $json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false,
          "reply_to_message_id": "={{ $json.message.message_id }}"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "240d7c56-fb5e-4783-b6b3-50e83558103d",
      "name": "Telegram 触发器1",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -288,
        32
      ],
      "webhookId": "1d124315-67c8-4026-9967-981de77cf6ca",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "",
          "name": ""
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "938067cf-bd7a-4e81-94e0-3802a67bb8e4",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Send a chat action",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a text message3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        []
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a chat action1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion DRM": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger1": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a chat action": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a chat action1": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message1": {
      "main": [
        [],
        []
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - AI 聊天机器人, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量16
分类2
节点类型8
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Miftah Rahmat

Miftah Rahmat

@miftahr

I’m an automation enthusiast specializing in n8n workflow design and integration.

外部链接
在 n8n.io 查看

分享此工作流