業界を問わずAI駆動のインタラクティブな相談&予約アシスタント

中級

これはSupport Chatbot, AI Chatbot分野の自動化ワークフローで、12個のノードを含みます。主にIf, Code, Wait, Gmail, GmailTriggerなどのノードを使用。 GmailおよびGemini AIを使用した自動メール相談処理とルーティング

前提条件
  • Googleアカウント + Gmail API認証情報
  • ターゲットAPIの認証情報が必要な場合あり
  • Google Gemini API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "Jvq4AmoNIbbAwo5x",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "AI-Powered Smart Inquiry & Booking Assistant for Any Industry",
  "tags": [],
  "nodes": [
    {
      "id": "e39522a9-4024-4b8e-84c0-4d77cd49e266",
      "name": "Gmail トリガー",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -500,
        120
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "sender": "acdert@gmail.com"
        },
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyX",
              "unit": "minutes"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PcTqvGU9uCunfltE",
          "name": "Gmail account - test"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "92249d18-6db6-4e2b-a8c6-7cdaabf68360",
      "name": "AI エージェント",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -280,
        120
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "You are a smart AI assistant for [Business Name] (e.g., Cool Realty, AutoDeals, HealthPlus).\n\nBased on the customer’s message, decide the intent:\n\n\"check_info\" → if they request product/service availability, pricing, or details\n\n\"forward_action\" → if they want to book, buy, confirm, schedule, or take the next step\n\nReturn only one JSON including:\n\naction: either \"check_info\" or \"forward_action\"\n\nreasoning: brief summary of how you inferred the action\n\ndata_extracted: structured info from the email (e.g., name, date, service, etc.)\n\nreply: full, professional, human-like response to the user’s message\n\nBehavior logic:\n\nAssume 70% availability for requested service/product\n\nRandomly generate sample details (features, price, timelines, etc.)\n\nIf not available, suggest alternatives\n\nUse a warm, helpful, professional tone. Output only the JSON. No extra text.\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "1e6c541e-30c6-4a4b-86fd-8bc31ca4c798",
      "name": "Google Gemini チャットモデル",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -280,
        340
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-pro"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "RvSkIBjP48ORJKhU",
          "name": "Google Gemini(PaLM) Api account - test"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d98d2938-f78e-4d0d-a89f-a2629f58c1a9",
      "name": "HTTP リクエスト",
      "type": "n8n-nodes-base.httpRequestTool",
      "disabled": true,
      "position": [
        -60,
        320
      ],
      "parameters": {
        "url": "=https://google.serper.dev/search",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "=q",
              "value": "={{ $fromAI('parameters0_Value', ``, 'string') }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-KEY",
              "value": "b05bf2fc7c01a8a70ecac675eafeb00777c8db22"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5755463a-5ef3-409b-9c06-e1acb85e14e1",
      "name": "コード",
      "type": "n8n-nodes-base.code",
      "position": [
        60,
        120
      ],
      "parameters": {
        "jsCode": "const output = [];\n\nfor (const item of $input.all()) {\n  // 1. Grab the raw string from the 'output' field\n  let raw = item.json.output;\n  if (typeof raw !== 'string') {\n    // nothing to do\n    output.push({ json: {} });\n    continue;\n  }\n\n  // 2. Remove `````` fences\n  raw = raw.replace(/``````/g, '').trim();\n\n  // 3. Extract the JSON payload between the first { and last }\n  const start = raw.indexOf('{');\n  const end = raw.lastIndexOf('}');\n  const jsonString = (start !== -1 && end !== -1)\n    ? raw.substring(start, end + 1)\n    : raw;\n\n  // 4. Attempt to parse\n  try {\n    const parsed = JSON.parse(jsonString);\n    output.push({ json: parsed });\n  } catch (e) {\n    // on error, output the raw string and error\n    output.push({\n      json: {\n        error: e.message,\n        raw: jsonString\n      }\n    });\n  }\n}\n\nreturn output;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ba012b2b-8207-4639-b57b-79956c5bdba8",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        460,
        120
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e4cc28d0-bee8-475a-b0fb-fa446fbfb954",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.action }}",
              "rightValue": "check_availability"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cbae6b70-6d91-4973-b149-6a960515f06b",
      "name": "Forward booking email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        720,
        200
      ],
      "webhookId": "482cede1-d0e5-4556-a1f7-e5c836dc8ae7",
      "parameters": {
        "sendTo": "abc@gmail.com",
        "message": "=Name : {{ $json.customer_data.name }}\nEmail : {{ $json.customer_data.email }}\nPhone: {{ $json.customer_data.phone }}\nOriginal Message: {{ $json.customer_data.message }}\n\nInternal Note: {{ $json.internal_note }}\n\nSummary : {{ $json.booking_summary }}",
        "options": {},
        "subject": "Inquiry Details",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PcTqvGU9uCunfltE",
          "name": "Gmail account - test"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "7f784192-0b32-437c-bd2a-6ecb4b51f2c8",
      "name": "availability check email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        720,
        20
      ],
      "webhookId": "482cede1-d0e5-4556-a1f7-e5c836dc8ae7",
      "parameters": {
        "sendTo": "={{ $json.customer_data.email }}",
        "message": "={{ $('Code').item.json.email_response }}",
        "options": {},
        "subject": "Inquiry Details",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PcTqvGU9uCunfltE",
          "name": "Gmail account - test"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "99fc6c79-6888-4093-968b-668f8cec525b",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        -160
      ],
      "parameters": {
        "width": 780,
        "height": 240,
        "content": "## Workflow Overview 📧\n\nThis workflow automates the processing of any inquiry emails:\n\n1.  **Gmail Trigger**: Initiates the workflow upon receiving a new email.\n2.  **AI Agent**: Analyzes the email content to determine the customer's intent (availability check or direct booking).\n3.  **Code**: Parses the JSON output from the AI Agent.\n4.  **If**: Routes the workflow based on the detected intent.\n5.  **Gmail Nodes**: Sends appropriate responses or forwards booking details."
      },
      "typeVersion": 1
    },
    {
      "id": "0333faf4-3690-487a-a151-ac329c1eacd8",
      "name": "AI エージェント and Code Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        400
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 320,
        "content": "## AI Agent and Code Node Explained 🤖\n\n-   **AI Agent**: This node acts as an intelligent assistant, powered by the Google Gemini Chat Model (although the Google Gemini Chat Model node currently has execution issues). It processes incoming emails and classifies them as either an \"availability check\" or a \"direct booking request\" based on the prompt instructions. It also attempts to extract relevant customer data and generate appropriate responses or internal notes.\n-   **HTTP Request (Disabled)**: This node is currently disabled and not used by the AI Agent, but it is set up to make a search request to Serper.\n-   **Code**: This node is crucial for parsing the raw string output from the AI Agent into a usable JSON format. It handles potential formatting inconsistencies by removing markdown fences and extracting the valid JSON payload, making the data accessible for subsequent nodes."
      },
      "typeVersion": 1
    },
    {
      "id": "1772a67e-ac94-45f5-b37d-1ef3084b9891",
      "name": "Conditional Routing and メール Responses",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        -280
      ],
      "parameters": {
        "color": 4,
        "width": 600,
        "height": 280,
        "content": "## Conditional Routing & Email Responses 🚦\n\n-   **Wait**: This node is used for wait for data.\n-   **If**: This node acts as a decision point, checking the `action` field from the AI Agent's parsed output. If the `action` is `check_availability`, the workflow proceeds to the \"availability check email\" node.\n-   **availability check email**: This Gmail node sends an email directly to the customer with availability details, as provided by the AI Agent's `email_response`.\n-   **Forward booking email**: If the `If` node's condition is not met (meaning the action is `forward_booking`), this Gmail node is triggered. It forwards the customer's booking request details and internal notes to a predefined internal email address (`@gmail.com`) for manual processing."
      },
      "typeVersion": 1
    },
    {
      "id": "3cfad505-0925-4b8d-b275-c7e319764925",
      "name": "待機 for Data",
      "type": "n8n-nodes-base.wait",
      "position": [
        280,
        120
      ],
      "webhookId": "4e0cbcd3-6378-4ff8-bda1-cd43550f3088",
      "parameters": {},
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1dd6ab03-d62a-4ed1-b2da-1f254160ff20",
  "connections": {
    "ba012b2b-8207-4639-b57b-79956c5bdba8": {
      "main": [
        [
          {
            "node": "7f784192-0b32-437c-bd2a-6ecb4b51f2c8",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "cbae6b70-6d91-4973-b149-6a960515f06b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Wait for Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Data": {
      "main": [
        [
          {
            "node": "ba012b2b-8207-4639-b57b-79956c5bdba8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

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

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

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

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

有料ですか?

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

関連ワークフロー

WhatsAppチャットボット - レストラン案内アシスタント(予約・メニュー・営業時間)
レストラン カスタマーサービスの自動化をWhatsAppとLlama AIチャットボットで実現
If
Wait
Postgres
+
If
Wait
Postgres
9 ノードOneclick AI Squad
サポートチャットボット
AIを活用した書籍おすすめエンジン
メールベースの書籍推薦システム(Ollama LLM と OpenLibrary API 使用)
If
Set
Code
+
If
Set
Code
21 ノードOneclick AI Squad
サポートチャットボット
メールからJiraへの自動チケット作成(AI駆動)とn8n
Llama 3.2を使用したAI駆動のメールからJiraチケット作成システム
Code
Jira
Wait
+
Code
Jira
Wait
11 ノードOneclick AI Squad
プロジェクト管理
AI ソーシャルメディア自動返信プラグイン(Instagram、Facebook、WhatsApp)
Instagram、Facebook、WhatsApp をサポートする Llama 3.2 ベースの AI によるソーシャルメディアメッセージ自動返信システム
Code
Switch
Webhook
+
Code
Switch
Webhook
12 ノードOneclick AI Squad
サポートチャットボット
WhatsApp 旅行計画ツール - リアルタイム旅行アシスタント
Llama 3.2を基盤としたWhatsApp AI旅行アシスタント
Wait
Whats App
Agent
+
Wait
Whats App
Agent
7 ノードOneclick AI Squad
サポートチャットボット
航空公司のFAQボット
GPT-4と質問分類を使った航空会社カスタマーサポートの自動化
If
Code
Merge
+
If
Code
Merge
27 ノードOneclick AI Squad
サポートチャットボット
ワークフロー情報
難易度
中級
ノード数12
カテゴリー2
ノードタイプ9
難易度説明

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

作成者
Oneclick AI Squad

Oneclick AI Squad

@oneclick-ai

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34