Google Gemini と Supabase を使用して IntelliFAQ Telegram ボットを作成する
中級
これはSupport Chatbot, AI Chatbot分野の自動化ワークフローで、15個のノードを含みます。主にIf, Set, Supabase, Telegram, Agentなどのノードを使用。 Google Gemini と Supabase を使用してインテリジェントな FAQ Telegram ボットを作成
前提条件
- •Supabase URL と API Key
- •Telegram Bot Token
- •Google Gemini API Key
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"meta": {
"instanceId": "7dc12cc14b4f095cedd2e9549d98eb1aca95241b7bf74a764272500de1b801ec"
},
"nodes": [
{
"id": "588b691b-8305-4761-89b2-e5e1d2d0699e",
"name": "Telegram トリガー",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-752,
656
],
"webhookId": "43dc004e-cda7-4eb6-95b5-61486b0bdf6d",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"typeVersion": 1.2
},
{
"id": "2a241435-d6d1-41ba-8432-d44f4d837ef3",
"name": "Google Gemini チャットモデル",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
224,
1184
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "802a6326-3858-4d8f-9d85-d2e7dc78e80c",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-816,
496
],
"parameters": {
"color": 4,
"height": 288,
"content": "## STEP 1: RECEIVE USER MESSAGE\nThis workflow starts when a user sends a message to the Telegram bot."
},
"typeVersion": 1
},
{
"id": "ab604f07-25fc-4580-af0d-07f26dd120eb",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
80,
304
],
"parameters": {
"color": 5,
"width": 272,
"height": 176,
"content": "## PATH FOR NEW USERS\nIf the user is not found in the database, this path runs. It creates a new user record and sends a one-time welcome message."
},
"typeVersion": 1
},
{
"id": "08891444-00d4-46f0-b539-7aa3298b84ce",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-384,
496
],
"parameters": {
"color": 4,
"width": 336,
"height": 288,
"content": "## STEP 2: CHECK IF USER IS NEW\nLooks up the user's Telegram ID in the database (Supabase). The 'If' node then checks if the user was found."
},
"typeVersion": 1
},
{
"id": "2ec0132b-6c2f-444c-834c-219ccd785996",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
432,
1152
],
"parameters": {
"color": 3,
"height": 208,
"content": "## PATH FOR EXISTING USERS\nIf the user already exists, their question is processed by the AI to find an answer."
},
"typeVersion": 1
},
{
"id": "d03a256a-7bbf-493c-83bd-4e2fa5738e23",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
48,
736
],
"parameters": {
"color": 4,
"width": 432,
"height": 336,
"content": "## STEP 3: GENERATE AI ANSWER\nThe user's question is sent to the Google Gemini model. The AI Agent uses its knowledge base to generate a relevant answer for the FAQ."
},
"typeVersion": 1
},
{
"id": "76eaef61-75d6-4ce3-8d11-436fe4e75665",
"name": "付箋5",
"type": "n8n-nodes-base.stickyNote",
"position": [
528,
768
],
"parameters": {
"color": 4,
"width": 368,
"height": 272,
"content": "## STEP 4: SEND AI RESPONSE\nThe final answer generated by the AI is sent back to the user via Telegram."
},
"typeVersion": 1
},
{
"id": "e3c8e646-890d-45db-b3ef-6e9689352c15",
"name": "Supabase 内のユーザー存在確認",
"type": "n8n-nodes-base.supabase",
"position": [
-528,
656
],
"parameters": {
"filters": {
"conditions": [
{
"keyName": "chat_id",
"keyValue": "={{ $json.message.chat.id }}"
}
]
},
"tableId": "telegram_users",
"operation": "get"
},
"credentials": {
"supabaseApi": {
"id": "1pgFwqTKn45GzSXW",
"name": "Supabase account"
}
},
"typeVersion": 1
},
{
"id": "601fc8b2-886b-436a-a337-3f47e3ba52e5",
"name": "ルート: 新規または既存ユーザー?",
"type": "n8n-nodes-base.if",
"position": [
-304,
656
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f4e144b5-d1b4-4752-9ad3-4c85d9e246cb",
"operator": {
"type": "number",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "ff0ec30f-d2df-402a-a442-cd548102c1dc",
"name": "新規ユーザーを Supabase に保存",
"type": "n8n-nodes-base.supabase",
"position": [
144,
512
],
"parameters": {
"tableId": "telegram_users",
"fieldsUi": {
"fieldValues": [
{
"fieldId": "chat_id",
"fieldValue": "={{ $('Telegram Trigger').item.json.message.chat.id }}"
}
]
}
},
"credentials": {
"supabaseApi": {
"id": "1pgFwqTKn45GzSXW",
"name": "Supabase account"
}
},
"typeVersion": 1
},
{
"id": "8314f5f5-f8a4-412e-93f7-571ca2efebb5",
"name": "ウェルカムメッセージ送信(新規ユーザー)",
"type": "n8n-nodes-base.telegram",
"position": [
368,
512
],
"webhookId": "cf7e2a9e-221f-4e34-a6a7-54d8548d4e61",
"parameters": {
"text": "Thank you for trying my project. You can also check out the FAQ or ask any questions you may have. If you want to see the FAQ here, just click this link |/Who_are_you?/What_can_you_do?/Who_created_you?/Are_you_free?",
"chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "9GazysyOQ96DLdaD",
"name": "Telegram account"
}
},
"typeVersion": 1.2
},
{
"id": "bdffd8ec-9f55-435a-8063-c683ad45ac68",
"name": "AI向けFAQコンテキストの読み込み",
"type": "n8n-nodes-base.set",
"position": [
-80,
896
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "994d25f7-381c-4bb2-94c1-cd99e72948dd",
"name": "faq_context",
"type": "string",
"value": "Q: Who are you? A: I am an automated assistant bot created to learn n8n and AI. Q: What can you do? A: Currently, I can answer basic questions about myself. In the future, I will be developed to do other things. Q: Who created you? A: I was created by the owner of this n8n server using Google Gemini and n8n. Q: Are you free? A: Yes, I am a learning project and free to use."
}
]
}
},
"typeVersion": 3.4
},
{
"id": "0f6a6366-543d-4e74-86e1-07c856bd2249",
"name": "Gemini での質問処理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
144,
896
],
"parameters": {
"text": "=Anda adalah asisten bot yang ramah dan membantu. Tugas Anda adalah menjawab pertanyaan pengguna berdasarkan Konteks FAQ yang diberikan. Jika pertanyaan pengguna tidak bisa dijawab dari konteks, jawab dengan benar pertanyaan tersebut\nJika pengguna bertanya terkait \"apa saja faq nya\" kamu bisa memberi semua pertanyaan yang tertera di faq dengan mengawali pertanyaan dengan / dan hilangkan spasi yang terkandung dalam pertanyaan ganti lah dengan underscore\"_\" \n--- KONTEKS FAQ ---\n{{ $json.faq_context }}\n--- AKHIR KONTEKS ---\n\nPertanyaan Pengguna: {{ $('Telegram Trigger').item.json.message.text }}",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "5cd2bd5b-fcff-4be9-9341-16e52e65cdc1",
"name": "AI回答をユーザーに送信",
"type": "n8n-nodes-base.telegram",
"position": [
640,
896
],
"webhookId": "b73acbf7-3457-47f2-9ee3-499301eb820e",
"parameters": {
"text": "={{ $json.output.replace(/[*_`[\\]()]/g, \"\") }}",
"chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "9GazysyOQ96DLdaD",
"name": "Telegram account"
}
},
"typeVersion": 1.2
}
],
"pinData": {},
"connections": {
"588b691b-8305-4761-89b2-e5e1d2d0699e": {
"main": [
[
{
"node": "e3c8e646-890d-45db-b3ef-6e9689352c15",
"type": "main",
"index": 0
}
]
]
},
"bdffd8ec-9f55-435a-8063-c683ad45ac68": {
"main": [
[
{
"node": "0f6a6366-543d-4e74-86e1-07c856bd2249",
"type": "main",
"index": 0
}
]
]
},
"2a241435-d6d1-41ba-8432-d44f4d837ef3": {
"ai_languageModel": [
[
{
"node": "0f6a6366-543d-4e74-86e1-07c856bd2249",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"ff0ec30f-d2df-402a-a442-cd548102c1dc": {
"main": [
[
{
"node": "8314f5f5-f8a4-412e-93f7-571ca2efebb5",
"type": "main",
"index": 0
}
]
]
},
"0f6a6366-543d-4e74-86e1-07c856bd2249": {
"main": [
[
{
"node": "5cd2bd5b-fcff-4be9-9341-16e52e65cdc1",
"type": "main",
"index": 0
}
]
]
},
"601fc8b2-886b-436a-a337-3f47e3ba52e5": {
"main": [
[
{
"node": "ff0ec30f-d2df-402a-a442-cd548102c1dc",
"type": "main",
"index": 0
}
],
[
{
"node": "bdffd8ec-9f55-435a-8063-c683ad45ac68",
"type": "main",
"index": 0
}
]
]
},
"e3c8e646-890d-45db-b3ef-6e9689352c15": {
"main": [
[
{
"node": "601fc8b2-886b-436a-a337-3f47e3ba52e5",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - サポートチャットボット, AIチャットボット
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
Telegramサポート取り扱いの自動化
GPT-4とメール通知を使用して、TelegramサポートからAIから人間への段階の移行を自動化
If
Set
Switch
+
If
Set
Switch
40 ノードMeelioo
サポートチャットボット
WhatsApp / Telegram WooCommerce注文サポート
Telegram と Gmail を使用したGemini と GPT を使用した WooCommerce カスタマーサポートの自動化
Set
Gmail
Merge
+
Set
Gmail
Merge
25 ノードAppStoneLab Technologies LLP
サポートチャットボット
J.A.R.V.I.S.
Telegram上でOpenAI、SERP、ベクターストアを使った包括のなマルチモーダルアシスタントの構築
If
Set
Code
+
If
Set
Code
48 ノードFabioInTech
サポートチャットボット
Telegram で医師を予約する
Telegram、Gemini AI、Google Sheetsを基にした医師予約スケジュールシステム
Set
Switch
Telegram
+
Set
Switch
Telegram
18 ノードAbdul Matheen
サポートチャットボット
ペットビューティー公開と予約の自動化
AI、Facebook、Telegram ボットを使ったペットコーディネーションの掲載と予約の自動化
If
Set
Switch
+
If
Set
Switch
36 ノードChristian Moises
AIチャットボット
Gemini、音声・画像生成を使ってマルチモーダルTelegram AIアシスタントを構築
Gemini、音声・画像生成を使ってマルチモーダルTelegramAIアシスタントを構築
If
Set
Code
+
If
Set
Code
95 ノードIniyavan JC
個人の生産性