GPT-4o を使用して自動応答を実現する Slack チャットボットの作成

中級

これはAI Chatbot, Multimodal AI分野の自動化ワークフローで、9個のノードを含みます。主にCode, Slack, Agent, ChatTrigger, LmChatOpenAiなどのノードを使用。 GPT-4oを使用したSlackチャットボットの自動返信機能を実現する

前提条件
  • Slack Bot Token または Webhook URL
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e1ed7ed9-efff-4003-933d-7bf9d0b8949b",
      "name": "OpenAI チャットモデル8",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1168,
        11920
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "62d0e051-8bb1-4206-8fa7-19f93a7e30ea",
      "name": "付箋61",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1904,
        11344
      ],
      "parameters": {
        "color": 7,
        "width": 1488,
        "height": 928,
        "content": "# 💬 OpenAI Chat Agent with Slack Listening\n\nThis workflow connects a chatbot to **Slack**.  \nIt listens to user messages, sends them to an **OpenAI agent**, and replies back in the same Slack channel.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c65f1027-8100-4b78-af28-c99bccb903bb",
      "name": "付箋20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2352,
        11344
      ],
      "parameters": {
        "width": 400,
        "height": 928,
        "content": "\n## ⚙️ Setup Instructions\n\n### 2️⃣ Connect Slack API\n1. Create an app → <https://api.slack.com/apps>  \n2. **OAuth & Permissions** → add scopes you need to read channel history (typical:  \n   `channels:history`, `groups:history`, `im:history`, `mpim:history`, plus `channels:read`, `groups:read`, `users:read`. Add `chat:write` if you want the bot to reply in Slack.)  \n3. **Install** the app to your workspace → copy the **Bot User OAuth Token**  \n4. In n8n → **Credentials → New → Slack OAuth2 API** → paste token and save  \n5. In the **Slack History** node, select your Slack credential and the **Channel ID** to read\n\n\n\n\n## 📬 Contact\nNeed help customizing this (e.g., filtering by list, or sending reports by email/Slack)?  \n\n📧 **robert@ynteractive.com**  \n🔗 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)**  \n🌐 **[ynteractive.com](https://ynteractive.com)**\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1a88867a-350a-42cf-872e-ce2c9074d6c5",
      "name": "Send User Message in Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1504,
        12080
      ],
      "webhookId": "9369d3e1-26af-4e9f-ba26-e2de061a9aa7",
      "parameters": {
        "text": "=*User:* {{ $json.chatInput }}",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": "U09ADJPB7QA",
          "cachedResultName": "rbreen672"
        },
        "select": "user",
        "otherOptions": {
          "includeLinkToWorkflow": false
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "kJLcFGEETWlwowIc",
          "name": "Slack account 9"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "434201a3-a5d9-434c-b8c0-f7a13e0dcb41",
      "name": "Sample Chat エージェント",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1136,
        11680
      ],
      "parameters": {
        "text": "={{ $('Sample Chatbot').item.json.chatInput }}",
        "options": {
          "systemMessage": "=you are an ecommerce bot. help the user as if you were working for a mock store. "
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "d0effa88-1f30-4e6a-a5b3-3edc90d726d2",
      "name": "Send Agents Response in Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -784,
        11856
      ],
      "webhookId": "9369d3e1-26af-4e9f-ba26-e2de061a9aa7",
      "parameters": {
        "text": "=*Chatbot:* {{ $json.output }}",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": "U09ADJPB7QA",
          "cachedResultName": "rbreen672"
        },
        "select": "user",
        "otherOptions": {
          "includeLinkToWorkflow": false
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "kJLcFGEETWlwowIc",
          "name": "Slack account 9"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "f9e1139f-2868-467c-aa21-fdd4920d0bd0",
      "name": "Format Response",
      "type": "n8n-nodes-base.code",
      "position": [
        -640,
        11632
      ],
      "parameters": {
        "jsCode": "return [{ json: { text:$('Sample Chat Agent').first().json.output } }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "309558fd-dea7-4634-a5b7-a02b0df2bbcf",
      "name": "付箋66",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        11552
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 640,
        "content": "### 2️⃣ Connect Slack API\n1. Create an app → <https://api.slack.com/apps>  \n2. **OAuth & Permissions** → add scopes you need to read channel history (typical:  \n   `channels:history`, `groups:history`, `im:history`, `mpim:history`, plus `channels:read`, `groups:read`, `users:read`. Add `chat:write` if you want the bot to reply in Slack.)  \n3. **Install** the app to your workspace → copy the **Bot User OAuth Token**  \n4. In n8n → **Credentials → New → Slack OAuth2 API** → paste token and save  \n5. In the **Slack History** node, select your Slack credential and the **Channel ID** to read\n"
      },
      "typeVersion": 1
    },
    {
      "id": "bbb5baca-6411-4d41-8530-3aff0a228513",
      "name": "Sample Chatbot",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1792,
        11696
      ],
      "webhookId": "d38a0072-420b-4de8-86b6-03a8f9a6e254",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    }
  ],
  "pinData": {},
  "connections": {
    "bbb5baca-6411-4d41-8530-3aff0a228513": {
      "main": [
        [
          {
            "node": "1a88867a-350a-42cf-872e-ce2c9074d6c5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sample Chat Agent": {
      "main": [
        [
          {
            "node": "d0effa88-1f30-4e6a-a5b3-3edc90d726d2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model8": {
      "ai_languageModel": [
        [
          {
            "node": "Sample Chat Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "1a88867a-350a-42cf-872e-ce2c9074d6c5": {
      "main": [
        [
          {
            "node": "Sample Chat Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d0effa88-1f30-4e6a-a5b3-3edc90d726d2": {
      "main": [
        [
          {
            "node": "f9e1139f-2868-467c-aa21-fdd4920d0bd0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

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

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

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

中級 - AIチャットボット, マルチモーダルAI

有料ですか?

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

関連ワークフロー

GPT-5 Nano を使った多言語チャットボットによる EC 顧客サポートの自動化
GPT-5 Nano多言語チャットボットを使ってEC向け顧客サポートを自動化
Set
Merge
Split Out
+
Set
Merge
Split Out
13 ノードRobert Breen
AIチャットボット
AIウェブサイトチャットボット - GPTとGoogleスプレッドシートによるCRMリード収集
GPTとGoogleスプレッドシートを統合したAIウェブサイトチャットボット - CRMリード収集システム
Code
Google Sheets
Agent
+
Code
Google Sheets
Agent
14 ノードRobert Breen
リード獲得
GPT-4o-mini エージェントを使用したリーダーポテンシャルの資格設定とカスタマー支持の自動化
GPT-4o-mini アジェントを使用したリードの自動クオリフィケーションとカスタマーサポート
If
Set
Code
+
If
Set
Code
16 ノードRobert Breen
リードナーチャリング
ブログ作成・エディタ
Google Sheetsに基づくブログライティング&エディタ(GPT-4)
If
Code
Filter
+
If
Code
Filter
18 ノードRobert Breen
コンテンツ作成
GPT-4o チャットで自然言語クエリから BigQuery SQL を生成
GPT-4o チャットを使って自然言語クエリから BigQuery SQL を生成する
Code
Merge
Aggregate
+
Code
Merge
Aggregate
13 ノードRobert Breen
内部Wiki
Google Finance、SerpAPI、OpenAIを基にした財務データに関するQ&Aチャットボット
Google Finance、SerpAPI、OpenAIとの統合を備えた財務データQ&Aチャットボット
Set
Http Request
Agent
+
Set
Http Request
Agent
9 ノードRobert Breen
AIチャットボット
ワークフロー情報
難易度
中級
ノード数9
カテゴリー2
ノードタイプ6
難易度説明

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

作成者
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34