AIウェブサイトチャットボット - GPTとGoogleスプレッドシートによるCRMリード収集

中級

これはLead Generation, Multimodal AI分野の自動化ワークフローで、14個のノードを含みます。主にCode, GoogleSheets, Agent, ChatTrigger, LmChatOpenAiなどのノードを使用。 GPTとGoogleスプレッドシートを統合したAIウェブサイトチャットボット - CRMリード収集システム

前提条件
  • Google Sheets API認証情報
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "a917cc6d-ac5b-425b-877f-e40347b49c4c",
      "name": "チャットメッセージ受信時",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        1360,
        2016
      ],
      "webhookId": "3768e882-2c41-4d64-a68a-5bdfb4adab43",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "71c6b7dc-23fd-4a5f-a4f2-58cde14f2f9f",
      "name": "別のワークフローから実行された場合",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        208,
        1872
      ],
      "parameters": {
        "inputSource": "passthrough"
      },
      "typeVersion": 1.1
    },
    {
      "id": "df400ef3-17dd-48f0-9f19-d3d43e3f1eb9",
      "name": "OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1520,
        2176
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "59356e4b-8b1f-4187-b727-17a792392bb6",
      "name": "シンプルメモリ3",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1680,
        2176
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "c96fcd55-592a-461b-991f-8f403f3a472d",
      "name": "OpenAI Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        448,
        2176
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
      "name": "ウェブサイトチャットボット",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1632,
        1984
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are the first point of contact for visitors on our website. We are a consulting firm that helps companies automate their internal processes using n8n, an open-source workflow automation platform.\n\nKeep answers brief. \n\nOur services include:\n\nDesigning and implementing automations using n8n\n\nReplacing manual work with fully automated workflows\n\nTraining teams to manage and scale automations in-house\n\nYour primary goals are:\n\nBriefly explain what we do in a helpful, conversational tone.\n\nAsk the visitor what kinds of processes they’re hoping to automate or what challenges they’re facing.\n\nCollect their name and email address so someone from our team can follow up.\n\nBe friendly, curious, and professional. If the visitor shares their contact information, confirm it and thank them — and pass the details to our CRM workflow.\n\n\nAfter you have the email address, and what the user needs. send all the info all together to the crm tool. "
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "bc45a7ff-b74f-4901-96f0-2a818358ffaf",
      "name": "会話の変換",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        464,
        1936
      ],
      "parameters": {
        "text": "=query {{ $json.query }}",
        "options": {
          "systemMessage": "You are a formatting assistant. Format the incoming query. Your only job is to extract and convert the input into clean, valid JSON.\n\nOnly return a JSON object like this:\n\noutput email in json like this. \n\n{\n  \"email\": \"jane.doe@example.com\",\n  \"description\": \"Wants help automating lead intake and sending Slack notifications.\"\n}\n\n\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "81a753e0-4198-4841-ac41-e9efb4b69ad9",
      "name": "構造化出力パーサー",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        640,
        2176
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"email\": \"jane.doe@example.com\",\n  \"description\": \"Wants help automating lead intake and sending Slack notifications.\"\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "7ef56380-f69f-4e48-8c42-bc5706fdcfe1",
      "name": "シートに行を追加",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        816,
        1952
      ],
      "parameters": {
        "columns": {
          "value": {
            "email": "={{ $json.output.email }}",
            "description": "={{ $json.output.description }}"
          },
          "schema": [
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit?usp=drivesdk",
          "cachedResultName": "Sample Leads"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "a1b29f7c-efd0-46cc-989a-b72c01adb970",
      "name": "コード",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        1936
      ],
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      text: \"Thanks for the info, we will be in touch soon\"\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "e5a327d0-cfae-484e-8468-ef92d161b3b8",
      "name": "crmツール",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1840,
        2176
      ],
      "parameters": {
        "source": "parameter",
        "description": "crm tool to store lead information",
        "workflowJson": "{\n  \"nodes\": [\n    {\n      \"parameters\": {\n        \"inputSource\": \"passthrough\"\n      },\n      \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n      \"typeVersion\": 1.1,\n      \"position\": [\n        176,\n        1248\n      ],\n      \"id\": \"71c6b7dc-23fd-4a5f-a4f2-58cde14f2f9f\",\n      \"name\": \"When Executed by Another Workflow\"\n    },\n    {\n      \"parameters\": {\n        \"model\": {\n          \"__rl\": true,\n          \"value\": \"gpt-4o-mini\",\n          \"mode\": \"list\",\n          \"cachedResultName\": \"gpt-4o-mini\"\n        },\n        \"options\": {}\n      },\n      \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n      \"typeVersion\": 1.2,\n      \"position\": [\n        400,\n        1472\n      ],\n      \"id\": \"c96fcd55-592a-461b-991f-8f403f3a472d\",\n      \"name\": \"OpenAI Chat Model4\",\n      \"credentials\": {\n        \"openAiApi\": {\n          \"id\": \"4l6TDfLZVFS24g3X\",\n          \"name\": \"OpenAi account 4\"\n        }\n      }\n    },\n    {\n      \"parameters\": {\n        \"promptType\": \"define\",\n        \"text\": \"=query {{ $json.query }}\",\n        \"hasOutputParser\": true,\n        \"options\": {\n          \"systemMessage\": \"You are a formatting assistant. Format the incoming query. Your only job is to extract and convert the input into clean, valid JSON.\\n\\nOnly return a JSON object like this:\\n\\noutput email in json like this. \\n\\n{\\n  \\\"email\\\": \\\"jane.doe@example.com\\\",\\n  \\\"description\\\": \\\"Wants help automating lead intake and sending Slack notifications.\\\"\\n}\\n\\n\\n\"\n        }\n      },\n      \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n      \"typeVersion\": 2.2,\n      \"position\": [\n        400,\n        1248\n      ],\n      \"id\": \"bc45a7ff-b74f-4901-96f0-2a818358ffaf\",\n      \"name\": \"Convert Conversation\"\n    },\n    {\n      \"parameters\": {\n        \"jsonSchemaExample\": \"{\\n  \\\"email\\\": \\\"jane.doe@example.com\\\",\\n  \\\"description\\\": \\\"Wants help automating lead intake and sending Slack notifications.\\\"\\n}\\n\"\n      },\n      \"type\": \"@n8n/n8n-nodes-langchain.outputParserStructured\",\n      \"typeVersion\": 1.3,\n      \"position\": [\n        576,\n        1456\n      ],\n      \"id\": \"81a753e0-4198-4841-ac41-e9efb4b69ad9\",\n      \"name\": \"Structured Output Parser\"\n    },\n    {\n      \"parameters\": {\n        \"operation\": \"append\",\n        \"documentId\": {\n          \"__rl\": true,\n          \"value\": \"1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk\",\n          \"mode\": \"list\",\n          \"cachedResultName\": \"Sample Leads\",\n          \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit?usp=drivesdk\"\n        },\n        \"sheetName\": {\n          \"__rl\": true,\n          \"value\": \"gid=0\",\n          \"mode\": \"list\",\n          \"cachedResultName\": \"Sheet1\",\n          \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit#gid=0\"\n        },\n        \"columns\": {\n          \"mappingMode\": \"defineBelow\",\n          \"value\": {\n            \"email\": \"={{ $json.output.email }}\",\n            \"description\": \"={{ $json.output.description }}\"\n          },\n          \"matchingColumns\": [],\n          \"schema\": [\n            {\n              \"id\": \"email\",\n              \"displayName\": \"email\",\n              \"required\": false,\n              \"defaultMatch\": false,\n              \"display\": true,\n              \"type\": \"string\",\n              \"canBeUsedToMatch\": true,\n              \"removed\": false\n            },\n            {\n              \"id\": \"description\",\n              \"displayName\": \"description\",\n              \"required\": false,\n              \"defaultMatch\": false,\n              \"display\": true,\n              \"type\": \"string\",\n              \"canBeUsedToMatch\": true,\n              \"removed\": false\n            }\n          ],\n          \"attemptToConvertTypes\": false,\n          \"convertFieldsToString\": false\n        },\n        \"options\": {}\n      },\n      \"type\": \"n8n-nodes-base.googleSheets\",\n      \"typeVersion\": 4.6,\n      \"position\": [\n        752,\n        1248\n      ],\n      \"id\": \"7ef56380-f69f-4e48-8c42-bc5706fdcfe1\",\n      \"name\": \"Append row in sheet\",\n      \"credentials\": {\n        \"googleSheetsOAuth2Api\": {\n          \"id\": \"HlBW2puZbuCCq8jJ\",\n          \"name\": \"Google Sheets account 3\"\n        }\n      }\n    },\n    {\n      \"parameters\": {\n        \"jsCode\": \"return [\\n  {\\n    json: {\\n      text: \\\"Thanks for the info, we will be in touch soon\\\"\\n    }\\n  }\\n];\\n\"\n      },\n      \"type\": \"n8n-nodes-base.code\",\n      \"typeVersion\": 2,\n      \"position\": [\n        960,\n        1248\n      ],\n      \"id\": \"a1b29f7c-efd0-46cc-989a-b72c01adb970\",\n      \"name\": \"Code\"\n    }\n  ],\n  \"connections\": {\n    \"When Executed by Another Workflow\": {\n      \"main\": [\n        [\n          {\n            \"node\": \"Convert Conversation\",\n            \"type\": \"main\",\n            \"index\": 0\n          }\n        ]\n      ]\n    },\n    \"OpenAI Chat Model4\": {\n      \"ai_languageModel\": [\n        [\n          {\n            \"node\": \"Convert Conversation\",\n            \"type\": \"ai_languageModel\",\n            \"index\": 0\n          }\n        ]\n      ]\n    },\n    \"Convert Conversation\": {\n      \"main\": [\n        [\n          {\n            \"node\": \"Append row in sheet\",\n            \"type\": \"main\",\n            \"index\": 0\n          }\n        ]\n      ]\n    },\n    \"Structured Output Parser\": {\n      \"ai_outputParser\": [\n        [\n          {\n            \"node\": \"Convert Conversation\",\n            \"type\": \"ai_outputParser\",\n            \"index\": 0\n          }\n        ]\n      ]\n    },\n    \"Append row in sheet\": {\n      \"main\": [\n        [\n          {\n            \"node\": \"Code\",\n            \"type\": \"main\",\n            \"index\": 0\n          }\n        ]\n      ]\n    }\n  },\n  \"pinData\": {\n    \"When Executed by Another Workflow\": [\n      {\n        \"query\": \"New inquiry for n8n training from rbreen@ynteractive.com\"\n      }\n    ]\n  },\n  \"meta\": {\n    \"templateCredsSetupCompleted\": true,\n    \"instanceId\": \"ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9\"\n  }\n}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "d0ad32e5-013c-4da4-b0a0-f2884873157f",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        1312
      ],
      "parameters": {
        "color": 5,
        "width": 744,
        "height": 1036,
        "content": "## 2. Create the Main Workflow (Website Chatbot)\nThis workflow acts as the main AI Agent handling incoming chat messages.\n\n### Steps in the main workflow:\n1. **When chat message received** – Starts the workflow whenever a visitor sends a message via your chatbot integration.\n2. **Website Chatbot (Agent Node)** – Configured with a **System Message** that:\n   - Briefly explains your services.\n   - Asks the visitor what processes they want to automate.\n   - Requests their name and email.\n   - Sends collected data to the CRM tool once email and description are available.\n3. **OpenAI Chat Model** – Connects to the AI agent as its language model.\n4. **Simple Memory** – Stores short-term context for the ongoing chat.\n5. **CRM Tool (Tool Workflow Node)** – Points to the sub-workflow created in Step 1, allowing the chatbot to trigger it directly.\n\n---\n\n## 3. Connecting the Sub-Workflow to the AI Agent\n1. Add a **Tool Workflow** node to the main workflow.\n2. Select `\"Parameter\"` as the source.\n3. Paste in your sub-workflow JSON or select it from your n8n workflows.\n4. Connect the **Tool Workflow** node to your AI Agent using the `ai_tool` connection.\n5. Give the tool a clear description (e.g., `crm tool to store lead information`) so the agent knows when to use it.\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7d06b640-726e-4cdf-80f1-a10c80675c10",
      "name": "付箋5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        1312
      ],
      "parameters": {
        "color": 6,
        "width": 1080,
        "height": 1036,
        "content": "## Step-by-Step Setup Instructions\n\n### 1. Create the Sub-Workflow (CRM Tool)\nThis sub-workflow will be triggered by the AI agent to process collected information.  \nIt will:\n1. Receive inputs (email, description) from the main chatbot workflow.\n2. Format the data into a structured JSON format.\n3. Append the data to a Google Sheet (acting as the CRM database).\n4. Send a confirmation message back to the main workflow.\n\n**Steps inside the sub-workflow:**\n- **When Executed by Another Workflow** – Triggered by the main workflow’s tool node.\n- **Convert Conversation (Agent)** – Uses OpenAI to extract and format the input into a JSON structure\n\n**Append row in sheet (Google Sheets)** – Adds the new lead data to your CRM sheet.\n\n**Code Node** – Returns a simple text confirmation like `\"Thanks for the info, we will be in touch soon\"`.\n\n### Required setup for Google Sheets:\n- Copy this goole sheet. https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit?usp=drivesdk\n- Enable the Google Sheets API and connect your Google account in n8n.\n- Create a sheet with at least the columns `email` and `description`.\n- Use the sheet's Document ID and tab name in the Google Sheets node.\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e08ba3af-eafd-43be-b23b-86baef135272",
      "name": "付箋17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        1152
      ],
      "parameters": {
        "width": 1840,
        "height": 128,
        "content": "## 📬 Need Help or Want to Customize This?\n📧 [robert@ynteractive.com](mailto:robert@ynteractive.com)  \n🔗 [LinkedIn](https://www.linkedin.com/in/robert-breen-29429625/)"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "When Executed by Another Workflow": [
      {
        "query": "New inquiry for n8n training from rbreen@ynteractive.com"
      }
    ]
  },
  "connections": {
    "e5a327d0-cfae-484e-8468-ef92d161b3b8": {
      "ai_tool": [
        [
          {
            "node": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "59356e4b-8b1f-4187-b727-17a792392bb6": {
      "ai_memory": [
        [
          {
            "node": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "df400ef3-17dd-48f0-9f19-d3d43e3f1eb9": {
      "ai_languageModel": [
        [
          {
            "node": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "c96fcd55-592a-461b-991f-8f403f3a472d": {
      "ai_languageModel": [
        [
          {
            "node": "bc45a7ff-b74f-4901-96f0-2a818358ffaf",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "7ef56380-f69f-4e48-8c42-bc5706fdcfe1": {
      "main": [
        [
          {
            "node": "a1b29f7c-efd0-46cc-989a-b72c01adb970",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bc45a7ff-b74f-4901-96f0-2a818358ffaf": {
      "main": [
        [
          {
            "node": "7ef56380-f69f-4e48-8c42-bc5706fdcfe1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "81a753e0-4198-4841-ac41-e9efb4b69ad9": {
      "ai_outputParser": [
        [
          {
            "node": "bc45a7ff-b74f-4901-96f0-2a818358ffaf",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "a917cc6d-ac5b-425b-877f-e40347b49c4c": {
      "main": [
        [
          {
            "node": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "71c6b7dc-23fd-4a5f-a4f2-58cde14f2f9f": {
      "main": [
        [
          {
            "node": "bc45a7ff-b74f-4901-96f0-2a818358ffaf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

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

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

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

中級 - リード獲得, マルチモーダルAI

有料ですか?

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

ワークフロー情報
難易度
中級
ノード数14
カテゴリー2
ノードタイプ10
難易度説明

経験者向け、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