Telegram、Tavily、そしてGPT-5を使って事実確認のWeb検索で回答を行う

中級

これはPersonal Productivity, AI RAG分野の自動化ワークフローで、15個のノードを含みます。主にTelegram, AimlApi, TelegramTrigger, Tavilyなどのノードを使用。 Telegram、Tavily、GPT-5を使って事実確認のウェブ検索で質問に回答する

前提条件
  • Telegram Bot Token
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "e95138f4feafe21ee6a9aac976bfd8e9187993130e7b713ed219f955c1b8837d",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "84253a28-e14b-462a-969c-f1e296f1eb40",
      "name": "付箋 — 概要",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -928
      ],
      "parameters": {
        "color": 5,
        "width": 384,
        "height": 360,
        "content": "# 🔍 Telegram Search Assistant\n\nMinimal bot that:\n1) Receives a question in Telegram\n2) Searches the web (Tavily)\n3) Summarizes facts with AIMLAPI (`openai/gpt-5-chat-latest`)\n4) Replies concisely (3–4 sentences), grounded in sources\n\n**Goal:** fast, factual answers without hallucinations."
      },
      "typeVersion": 1
    },
    {
      "id": "0aaea504-3ed8-48b3-aa38-61963de91735",
      "name": "付箋 — LLMプロンプト",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -736
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 240,
        "content": "## 🧠 LLM Prompt (Guardrails)\n* Extract only facts that answer the question\n* 3–4 sentences max\n* If data is thin → say so clearly\n* **No fabrication** — use provided results only\n\n**Inputs:**\n- `query = user message`\n- `results = full Tavily JSON`"
      },
      "typeVersion": 1
    },
    {
      "id": "0b337423-00e8-4236-b8ef-293641dd387a",
      "name": "付箋 — テスト",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -496
      ],
      "parameters": {
        "width": 384,
        "height": 192,
        "content": "## 🧪 Testing & Fallbacks\n* Test from Telegram (not only “Execute Node”)\n* Add `Switch` for commands and empty text\n* If no results → reply: “I couldn’t find enough reliable info.”\n* Catch errors: send friendly message, log details"
      },
      "typeVersion": 1
    },
    {
      "id": "4c772d35-25cc-4cf9-bfe8-58bf23d7c6eb",
      "name": "付箋 — カスタマイズ",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -576
      ],
      "parameters": {
        "color": 5,
        "width": 384,
        "height": 232,
        "content": "## 🛠 Customization\n* `/help` → usage & examples\n* `/sources` → list top URLs from results\n* `/news` or `/wiki` routing via keywords\n* Add NSFW/profanity filter pre-search\n* Rate-limit per user (Set → Wait → Redis/DB)\n* Optional: cache recent answers (key = normalized query)"
      },
      "typeVersion": 1
    },
    {
      "id": "9778f214-dabf-48db-9f70-6c62e8747fc6",
      "name": "付箋 — 返信",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -192
      ],
      "parameters": {
        "color": 4,
        "height": 304,
        "content": "## 📤 Reply to Telegram\nReply to same chat, referencing original message."
      },
      "typeVersion": 1
    },
    {
      "id": "e948ce86-f169-47a8-99c8-582bcc5e7d1b",
      "name": "付箋 — LLM",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        -192
      ],
      "parameters": {
        "color": 6,
        "height": 304,
        "content": "## 🧠 LLM Summarize\nInput: full search JSON.\nOutput: concise factual answer."
      },
      "typeVersion": 1
    },
    {
      "id": "a7430bc0-6057-4648-82ed-f90ccaf6fe76",
      "name": "付箋 — 検索",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -192
      ],
      "parameters": {
        "color": 5,
        "height": 304,
        "content": "## 🔎 Web Search\nQuery = user message. Pass raw JSON downstream."
      },
      "typeVersion": 1
    },
    {
      "id": "3c805f46-b470-4016-afe6-89641b180a86",
      "name": "付箋 — タイピング",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -192
      ],
      "parameters": {
        "color": 2,
        "height": 304,
        "content": "## ⌨️ Typing Indicator\nSend \"typing\" to show progress."
      },
      "typeVersion": 1
    },
    {
      "id": "3cca7a73-c37a-4e59-a994-a24d81e98c83",
      "name": "付箋 — 受信",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -192
      ],
      "parameters": {
        "color": 4,
        "height": 304,
        "content": "## 📩 Receive Telegram Message\nHandle incoming text. Use chat.id + message_id for reply."
      },
      "typeVersion": 1
    },
    {
      "id": "0ccc7f9f-bc6d-4e44-881d-7b9e1af4f622",
      "name": "テキストメッセージ送信",
      "type": "n8n-nodes-base.telegram",
      "position": [
        832,
        -48
      ],
      "webhookId": "01689fcb-171a-4338-bdc5-10447d604caa",
      "parameters": {
        "text": "={{ $json.content }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false,
          "reply_to_message_id": "={{ $('Telegram Trigger').item.json.message.message_id }}"
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "wh7cybWjl2Zw0MEh",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "eeb18791-a210-4614-9b65-7ec3c7edba37",
      "name": "チャットアクション送信",
      "type": "n8n-nodes-base.telegram",
      "position": [
        48,
        -48
      ],
      "webhookId": "bf4cf2c0-6013-4ebf-be08-3519823031c1",
      "parameters": {
        "chatId": "={{ $json.message.chat.id }}",
        "operation": "sendChatAction"
      },
      "credentials": {
        "telegramApi": {
          "id": "wh7cybWjl2Zw0MEh",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "239a5aad-bd01-4895-9551-2606aaa9444a",
      "name": "Telegramトリガー",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -208,
        -48
      ],
      "webhookId": "5ff309b0-9d51-4953-b9ae-616e4c17322b",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "wh7cybWjl2Zw0MEh",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "abdc849f-ed58-40c8-a34b-2d547f5d9212",
      "name": "検索",
      "type": "@tavily/n8n-nodes-tavily.tavily",
      "position": [
        304,
        -48
      ],
      "parameters": {
        "query": "={{ $('Telegram Trigger').item.json.message.text }}",
        "options": {}
      },
      "credentials": {
        "tavilyApi": {
          "id": "8wWN6c3Z8RZux0RW",
          "name": "Tavily account 2"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "17336e52-7ab1-4087-9358-97e04f129d63",
      "name": "AI/MLチャット補完",
      "type": "n8n-nodes-aimlapi.aimlApi",
      "position": [
        560,
        -48
      ],
      "parameters": {
        "model": "openai/gpt-5-chat-latest",
        "prompt": "=You are an AI assistant.  \nYou have search results from Google in JSON or text format.  \nYour task is to:  \n1. Extract only the facts that directly answer the user’s question.  \n2. Provide a clear, concise answer in 3–4 sentences maximum.  \n3. If the information is limited, state that clearly.  \n4. Never make things up — base your answer only on the provided results.  \n\nUser question: \"{{ $json.query }}\"  \nSearch results:  \n{{ JSON.stringify($json.results) }}\n\nGenerate the final answer in plain, simple English.\n",
        "options": {
          "responseFormat": "text"
        },
        "requestOptions": {}
      },
      "credentials": {
        "aimlApi": {
          "id": "QLCphbfkAMZbZesE",
          "name": "AI/ML account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "eb8e941d-3b34-45b1-86da-f051b13a7f08",
      "name": "付箋 — LLMプロンプト1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -976
      ],
      "parameters": {
        "color": 4,
        "width": 384,
        "height": 240,
        "content": "## ⚙️ Setup\n1. **Telegram**: create bot via @BotFather → add token in *Credentials → Telegram API*.\n2. **Tavily**: create API key → add *Tavily account* credentials.\n3. **AIMLAPI**: add *AI/ML API* credentials (base URL `https://api.aimlapi.com/v1`).\n4. **Environment**: set `TELEGRAM_BOT_TOKEN`, `TAVILY_API_KEY`, `AIML_API_KEY` in n8n (if using env)."
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "abdc849f-ed58-40c8-a34b-2d547f5d9212": {
      "main": [
        [
          {
            "node": "17336e52-7ab1-4087-9358-97e04f129d63",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "239a5aad-bd01-4895-9551-2606aaa9444a": {
      "main": [
        [
          {
            "node": "eeb18791-a210-4614-9b65-7ec3c7edba37",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "eeb18791-a210-4614-9b65-7ec3c7edba37": {
      "main": [
        [
          {
            "node": "abdc849f-ed58-40c8-a34b-2d547f5d9212",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "17336e52-7ab1-4087-9358-97e04f129d63": {
      "main": [
        [
          {
            "node": "0ccc7f9f-bc6d-4e44-881d-7b9e1af4f622",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - 個人の生産性, AI RAG検索拡張

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

関連ワークフロー

Telegram、AIMLAPI、Google Sheetsを使用してマルチモデルAIチャットボットを作成
Telegram、AIMLAPI、Google スプレッドシートを使って多模型AIチャットボットを作成
If
Set
Code
+
If
Set
Code
25 ノードAI/ML API | D1m7asis
個人の生産性
GPT-4oを使用したTelegramメンタルヘルスサポートボットの構築
GPT-4oをベースとしたTelegramメンタルヘルスサポートボットを構築
Set
Switch
Telegram
+
Set
Switch
Telegram
15 ノードAI/ML API | D1m7asis
サポートチャットボット
TelegramでGPT-5とチャットする:AI駆動の会話ボット
TelegramでGPT-5とチャット:AI駆動の会話ボット
Telegram
Aiml Api
Google Sheets
+
Telegram
Aiml Api
Google Sheets
14 ノードAI/ML API | D1m7asis
AIチャットボット
TelegramボットとGPT-4oを使ってパーソナライズされた都道府県別旅行プランを作成
Telegram ボットと GPT-4o を使用してパーソナライズされた都市旅行の旅程を作成
Set
Switch
Telegram
+
Set
Switch
Telegram
21 ノードAI/ML API | D1m7asis
Telegram で GPT-4o を使って Flux Pro と合わせて AI 画像を生成
Telegram 内で GPT-4o と Flux Pro を使って AI 画像を生成
If
Set
Telegram
+
If
Set
Telegram
22 ノードAI/ML API | D1m7asis
コンテンツ作成
GPT-4oとTelegramを活用した対話式ロシア語学習チャットボット
GPT-4oとTelegramを基盤としたインタラクティブなロシア語チューターボット
Set
Switch
Telegram
+
Set
Switch
Telegram
16 ノードAI/ML API | D1m7asis
コンテンツ作成
ワークフロー情報
難易度
中級
ノード数15
カテゴリー2
ノードタイプ5
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34