AI員工具を使ってWhatsAppにチャットGPTを構築する方法

中級

これはSupport Chatbot, AI Chatbot分野の自動化ワークフローで、12個のノードを含みます。主にSet, Switch, WhatsApp, Agent, WhatsAppTriggerなどのノードを使用。 WhatsApp AIアシスタントを作成(LLaMA 4 と Google 検索インサイトを使用)

前提条件
  • 特別な前提条件なし、インポートしてすぐに使用可能
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "qnJHaFyEszx8iwZH",
  "meta": {
    "instanceId": "9c8f658dbece48b519a8ad7757c7d7db7a30c5f3fd29c9dc8afae32fe0c7711a",
    "templateCredsSetupCompleted": true
  },
  "name": "Create a WhatsApp AI Assistant with Llama-4 and Google Search Insights",
  "tags": [],
  "nodes": [
    {
      "id": "9e6a8db0-cc1f-44b9-871e-f5f1e1929368",
      "name": "AI エージェント",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        640,
        0
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=You are Seventeen, a friendly and helpful AI assistant created by Manav.  \nYou speak in casual AAVE (American tone) with a light sarcastic vibe.  \n\nAlternate your greetings (e.g., “yo, what’s poppin’?”, “hey, what’s goin’ on?”) so replies don’t feel repetitive.  \nYou are currently talking to {{ $('WhatsApp Trigger').item.json.contacts[0].profile.name }}.  \nThe current date and time is {{ $now.toISO() }}.  \n\nAvoid writing “G’” at the start of sentences. Keep responses casual but clear.\n"
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "7f6ef649-57e5-43ae-bf8f-1646a0663089",
      "name": "Groq Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        576,
        240
      ],
      "parameters": {
        "model": "meta-llama/llama-4-scout-17b-16e-instruct",
        "options": {}
      },
      "credentials": {
        "groqApi": {
          "id": "3Evg0USLHEyRNZzx",
          "name": "Groq account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "71626a55-43af-4846-b401-d6ce65d9193c",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -512
      ],
      "parameters": {
        "color": 5,
        "width": 192,
        "height": 656,
        "content": "## Node Guide: Input Switch\n\nThis node detects the **type of message** coming from WhatsApp (text or image) and sends it to the correct processing path in the workflow.\n\n- **Text messages** → Sent directly to the AI Agent.  \n- **Image messages** → (Future use) Can be extended as per your requirements.\n\nThis helps ensure the workflow handles different input types smoothly.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c83eb856-3032-436f-9460-4a3540464a01",
      "name": "付箋2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -288
      ],
      "parameters": {
        "height": 448,
        "content": "## Execution Logic\n\nThis part of the workflow activates **when a text message is detected**.  \nIt prepares the message and sends it to the AI Agent node, which generates the reply.  \n\nUse this node to **process text inputs only** (images or audio can be added later if needed).\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d26f1349-7997-4454-8a1f-2067ebc33570",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -368
      ],
      "parameters": {
        "color": 5,
        "width": 432,
        "height": 528,
        "content": "## Meet Your AI Agent\n\nThis chatbot runs on **Groq’s lightning-fast LLaMA 4 model** and delivers **real-time answers** through Google Search (SerpAPI).\n\n### How it works\n- Responds to **text messages** (images or audio can be added later).  \n- Remembers your last **20 messages** for continuous context.  \n- Searches Google when it needs fresh info (no outdated responses).  \n- Designed to feel like you’re talking to a **real person** — fast, smart, and helpful.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "171ab986-4378-4975-bbee-255bde19c84b",
      "name": "Main Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -576
      ],
      "parameters": {
        "width": 656,
        "height": 1168,
        "content": "## WhatsApp AI Assistant with LLaMA 4 and Google Search\n\n#### This workflow creates a **real-time AI chatbot on WhatsApp** powered by Groq’s **LLaMA 4 model** with **Google Search (SerpAPI)** for fresh insights.\n\n---\n\n### Who’s it for\n- Users who want an AI assistant directly on WhatsApp.  \n- Businesses needing real-time FAQ and support automation.  \n- Anyone wanting a chatbot that remembers past messages and uses live search.\n\n---\n\n### What it does\n- Connects WhatsApp to **Groq’s LLaMA 4** model for AI responses.  \n- Uses **SerpAPI** to fetch **real-time search results** from Google.  \n- Maintains **context of the last 20 messages** for continuous conversations(you can increase in the AI agent). \n\n---\n\n### How it works\n1. A user sends a message to your WhatsApp number.  \n2. The workflow checks if it’s **text** (images can be added later).  \n3. Text is sent to the AI Agent, which uses Groq’s LLaMA 4 for responses.  \n4. If real-time info is needed, SerpAPI fetches results from Google.  \n5. The reply is composed and sent back to the user via WhatsApp.\n\n---\n\n### Requirements\n- **n8n** (cloud or self-hosted)  \n- **WhatsApp Business API** or **Twilio sandbox**  \n- **Groq API key**  \n- **SerpAPI key**  \n\n---\n\n### How to set up\n1. Import this workflow into your n8n instance.  \n2. Configure **Groq**, **SerpAPI**, and **WhatsApp** credentials.  \n3. Link your WhatsApp webhook to trigger this workflow.  \n4. Activate and test by sending a WhatsApp message.  \n\n---\n\n### How to customize\n- Change AI personality in the **AI Agent** node’s `systemMessage`.  \n- Add extra features like **summarization, translation, or voice handling**.  \n- Integrate logging or analytics for chatbot usage tracking.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5d89108e-adb6-4b05-80dc-4aeedcd64639",
      "name": "Route Based on Input",
      "type": "n8n-nodes-base.switch",
      "position": [
        32,
        -16
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Image",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "57d9036d-3a48-4c8a-b556-98a588d67842",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].image }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "fc815250-4b24-4554-8f03-3221eed44682",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "60cf0325-bb4b-4e6a-9caa-21dd9c05fb51",
      "name": "Google Search",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        912,
        240
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "serpApi": {
          "id": "lJEWi2JA3u32XIG6",
          "name": "SerpAPI account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b585b12d-3c7b-4ed5-abb4-ba9ed14f45df",
      "name": "Prepare Text Prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        304,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "707e792c-1a14-4291-b9bc-e37a740eb5b7",
              "name": "text",
              "type": "string",
              "value": "={{ $json.messages[0].text.body }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1a3a3c4d-a403-44b6-bb84-d62ddb4d1208",
      "name": "Conversation メモリ",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        752,
        240
      ],
      "parameters": {
        "sessionKey": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "0c9fbba5-ef00-449c-baae-57a9a7628c3b",
      "name": "Send WhatsApp Reply",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1072,
        0
      ],
      "webhookId": "53c1a722-1692-4bbd-983c-4dd884153d68",
      "parameters": {
        "textBody": "={{ $json.output }}",
        "operation": "send",
        "phoneNumberId": "768049963047541",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "LV22R0NzX9vZLEp9",
          "name": "whatsapp_reply"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "49c92b8b-fd42-4119-97c5-68a424acc72d",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -176,
        -16
      ],
      "webhookId": "ec046705-b8f2-4b88-9b98-4fd99975f432",
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "yVPQQ9GPjNKE9nkZ",
          "name": "whatsApp_OAuth_api"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1da5761e-3847-4206-a0dd-bfb831bc00ec",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "0c9fbba5-ef00-449c-baae-57a9a7628c3b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "60cf0325-bb4b-4e6a-9caa-21dd9c05fb51": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "7f6ef649-57e5-43ae-bf8f-1646a0663089": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "49c92b8b-fd42-4119-97c5-68a424acc72d": {
      "main": [
        [
          {
            "node": "5d89108e-adb6-4b05-80dc-4aeedcd64639",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "b585b12d-3c7b-4ed5-abb4-ba9ed14f45df": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5d89108e-adb6-4b05-80dc-4aeedcd64639": {
      "main": [
        [],
        [
          {
            "node": "b585b12d-3c7b-4ed5-abb4-ba9ed14f45df",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

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

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

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

中級 - サポートチャットボット, AIチャットボット

有料ですか?

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

関連ワークフロー

メモリ、Google Suite、複数のAIリサーチ画像を備えたWhatsAppアシスタントの構築
メモリ、Google Suite、そして複数のAIによる研究イメージングを備えたWhatsAppアシスタントを構築
If
Set
Code
+
If
Set
Code
71 ノードIniyavan JC
AIチャットボット
AI ソーシャルメディア自動返信プラグイン(Instagram、Facebook、WhatsApp)
Instagram、Facebook、WhatsApp をサポートする Llama 3.2 ベースの AI によるソーシャルメディアメッセージ自動返信システム
Code
Switch
Webhook
+
Code
Switch
Webhook
12 ノードOneclick AI Squad
サポートチャットボット
J.A.R.V.I.S.
Telegram上でOpenAI、SERP、ベクターストアを使った包括のなマルチモーダルアシスタントの構築
If
Set
Code
+
If
Set
Code
48 ノードFabioInTech
サポートチャットボット
AI とインテントルーティングを使用して WhatsApp 顧客問い合わせを処理
AIと意図ルーティングを使用したWhatsApp顧客問い合わせ処理
Code
Switch
Whats App
+
Code
Switch
Whats App
20 ノードHemanth Arety
サポートチャットボット
🚀 Shopifyブランドを対象としたAI駆動型WhatsAppカスタマーサポート
Shopify向けのAI駆動WhatsAppカスタマーサポート(LLMエージェント)
Set
Slack
Switch
+
Set
Slack
Switch
30 ノードRuthwik
その他
高度なマルチエージェントAIパーソナルアシスタント(250+タスク対応、WhatsApp + GPT)
高度なマルチエージェントAIパーソナルアシスタント(250以上のタスク対応、WhatsApp + GPT)
Set
Switch
Whats App
+
Set
Switch
Whats App
213 ノードElectrabot
個人の生産性
ワークフロー情報
難易度
中級
ノード数12
カテゴリー2
ノードタイプ9
難易度説明

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

作成者
Manav Desai

Manav Desai

@manavdesai17

Exploring AI and automation with n8n. Here to share builds, learn from the community, and create useful workflows together.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34