8
n8n 中文网amn8n.com

WhatsApp客户支持(使用Claude AI、Google文档和多语言功能)

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 22 个节点。主要使用 Set, Switch, WhatsApp, HttpRequest, GoogleDocsTool 等节点。 WhatsApp客户支持(使用Claude AI、Google文档和多语言功能)

前置要求
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "73e3c0fd395bfd0d194601f37f29fe40e0317103ab5899d92df39eaef2eb4c87",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ab7c3125-5bfd-4f3c-8abc-0ab47edaf85b",
      "name": "WhatsApp 触发器",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -656,
        -48
      ],
      "webhookId": "d3978cae-2aca-4553-8ac7-ab89068deabc",
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "7Mwcvp64huTkZ2uy",
          "name": "Testing"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "07fcf5e2-04ae-4f4a-a440-093f18a1e55e",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1536,
        -48
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=# WhatsApp Customer Support Agent - Sycorda AI Assistant\n\n#call Get a document in Google Docs to get details of Sycorda\n\n## Core Identity\nYou are a professional customer support representative for sycorda. You communicate through WhatsApp with customers ZZZzseeking information about our services and solutions.\n\n## Communication Context\n- **Current User**: {{ $('WhatsApp Trigger').item.json.contacts[0].profile.name }}\n- **Timestamp**: {{ $now.toString() }}\n- **Platform**: WhatsApp Business API\n\n## Primary Directive\nYour sole purpose is to provide accurate information about Sycorda by retrieving relevant details from the Google Doc knowledge base. You must ONLY answer based on documented information - never fabricate or assume details.\n\n## Language Protocol\n\n### Language Detection & Response Rules\n1. **English Input** → Respond in English\n2. **Urdu Input** → Respond in Roman Urdu\n3. **Voice Notes**: Transcribe first, then apply language matching\n4. **Images**: Acknowledge receipt, extract text if present, respond accordingly\n\n### Roman Urdu Guidelines\n- Write naturally: \"Aap ka sawal ka jawab yeh hai\" NOT \"Āp kā sawāl kā jawāb yah hai\"\n- Use common spellings: \"kya\", \"kaise\", \"theek\", \"shukriya\"\n- Avoid diacritical marks and special characters\n- Match casual WhatsApp conversation style\n\n## Response Framework\n\n### Tone Requirements\n- **Laconic**: Maximum 2-3 sentences per response unless complex explanation needed\n- **Spartan**: Direct, no fluff, no unnecessary pleasantries\n- **Human**: Natural conversational flow, not robotic\n\n### Response Structure\n1. **Acknowledge** (if needed): Brief recognition of query\n2. **Answer**: Direct information from knowledge base\n3. **Clarify** (if needed): One follow-up question maximum\n\n## Tool Integration Protocol\n\n### Google Doc Access\nWhen user asks a question:\n1. Parse query for key terms\n2. Search Google Doc for relevant section\n3. Extract specific answer\n4. Reformulate in appropriate language/tone\n5. Deliver response\n\n### Information Retrieval Rules\n- ONLY use information present in Google Doc\n- If information not found: \"Is baare mein mujhe docs mein info nahi mili. Kya aap kuch aur puchna chahte hain?\" (Roman Urdu) or \"I couldn't find this information in our documentation. Would you like to know something else?\" (English)\n- Never guess or provide generic responses\n\n## Message Type Handlers\n\n### Text Messages\n\n\nDirect query → Search Doc → Concise Answer\n\n\n### Voice Notes\n\n\nTranscribe → Detect Language → Search Doc → Reply in same language\n\n\n### Images\n\n\nAcknowledge → Extract text/context → Process as text query\n\n\n## Example Interactions\n\n### English Example\n**User**: \"What services does sycorda offer?\"\n**Agent**: \"Sycorda provides [specific services from doc]. We specialize in [main specialty from doc].\"\n\n### Roman Urdu Example\n**User**: \"Sycordar ki fees kya hai?\"\n**Agent**: \"Hamari fees [doc se specific amount] hai. Payment monthly ya project basis pe ho sakti hai.\"\n\n### Mixed Context Example\n**User sends voice note in Urdu asking about contact**\n**Agent**: \"Aap humse [contact info from doc] pe rabta kar sakte hain. Office timings [timings from doc] hain.\"\n\n## Error Handling\n\n### Information Not Found\n- English: \"I don't have that specific information. Can I help with something else?\"\n- Roman Urdu: \"Yeh info mere paas nahi hai. Kuch aur puch sakte hain?\"\n\n### Unclear Query\n- English: \"Could you clarify what you need to know about [topic]?\"\n- Roman Urdu: \"[topic] ke baare mein kya janna chahte hain?\"\n\n## Constraints\n1. NEVER provide information not in the Google Doc\n2. NEVER use formal Urdu script or complex transliterations\n3. NEVER exceed 3 sentences unless absolutely necessary\n4. NEVER sound like an automated bot\n5. ALWAYS maintain consistent tone throughout conversation\n\n## Performance Metrics\n- Response accuracy: 100% from documented sources\n- Response brevity: <50 words average\n- Language matching: 100% accuracy\n- Human-like interaction: Natural flow maintained"
        },
        "promptType": "define"
      },
      "retryOnFail": true,
      "typeVersion": 1.9
    },
    {
      "id": "ff32e635-cabc-451a-8ec8-7d740996f3b5",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1600,
        176
      ],
      "parameters": {
        "sessionKey": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 20
      },
      "typeVersion": 1.3
    },
    {
      "id": "212f1042-a90e-4e91-9660-97dac9dcbc7b",
      "name": "检查输入类型",
      "type": "n8n-nodes-base.switch",
      "position": [
        -192,
        -64
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Voice",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b7b64446-f1ea-4622-990c-22f3999a8269",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].audio }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Image",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "202af928-a324-411a-bf15-68a349e7bf9e",
                    "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": "08fd0c80-307e-4f45-b1de-35192ee4ec5e",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].text.body }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "4d6c41e6-4f24-49b4-a27c-78ee4f0dab70",
      "name": "获取图片URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        416,
        80
      ],
      "webhookId": "280bd5de-32d7-4d8f-93d2-e91e3b0bc161",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].image.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "Cn5rvhEVVyM1FmpR",
          "name": "Testing"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9257518f-7e4d-4734-8afd-ea70982ea76c",
      "name": "下载图片",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        576,
        80
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "D2UYEol2VnjX6ZVV",
          "name": "Header Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a518322c-525a-47a8-a11a-37d50fdc5c88",
      "name": "分析图像",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        736,
        80
      ],
      "parameters": {
        "text": "=Describe the image in detail.",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "id": "kcZxf0FA03D9xVdd",
          "name": "Sycorda"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "c96a91dc-1f91-49db-9278-2a3393f1a6ad",
      "name": "图片+文本提示",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "67552183-de2e-494a-878e-c2948e8cb6bb",
              "name": "text",
              "type": "string",
              "value": "=# The user provided the following image and text.\n\n## IMAGE CONTENT:\n{{ $json.content }}\n\n## USER MESSAGE:\n{{ $('WhatsApp Trigger').item.json.messages[0].image.caption || \"Describe the image\" }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c7c85070-4c64-469d-af59-4d71cb582386",
      "name": "纯文本提示",
      "type": "n8n-nodes-base.set",
      "position": [
        624,
        368
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c05a7fbf-309a-407e-9fee-7e0b03f4a5c8",
              "name": "text",
              "type": "string",
              "value": "={{ $('WhatsApp Trigger').item.json.messages[0].text.body }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "37afcfdc-29d9-49bb-a259-c714862345bc",
      "name": "获取音频URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        416,
        -192
      ],
      "webhookId": "87caa300-7204-47b5-959a-94f4a8fbf8cf",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].audio.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "Cn5rvhEVVyM1FmpR",
          "name": "Testing"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0bae0627-5109-4fc4-825b-4b49287cdd25",
      "name": "下载音频",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        576,
        -192
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "D2UYEol2VnjX6ZVV",
          "name": "Header Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "261d1bd3-76c4-436e-ae62-501d3c967cab",
      "name": "转录音频",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        736,
        -192
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "id": "kcZxf0FA03D9xVdd",
          "name": "Sycorda"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "6af95a0a-c27a-4b47-abe7-3e128d96284a",
      "name": "音频提示",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        -192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "219577d5-b028-48fc-90be-980f4171ab68",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1d0c8c18-3bba-49fd-a929-cf9465ff23c1",
      "name": "文本回复",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2160,
        -48
      ],
      "webhookId": "23834751-5066-48ba-8e19-549680df2b27",
      "parameters": {
        "textBody": "={{ $json.output }}",
        "operation": "send",
        "phoneNumberId": "678239212037057",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "Cn5rvhEVVyM1FmpR",
          "name": "Testing"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "174655ca-43ba-46cd-805c-a3f645b83e87",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -272
      ],
      "parameters": {
        "width": 800,
        "height": 240,
        "content": "## 音频"
      },
      "typeVersion": 1
    },
    {
      "id": "8aa8cb04-10be-4e89-a8a3-ef7356c80d59",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        0
      ],
      "parameters": {
        "color": 4,
        "width": 800,
        "height": 280,
        "content": "## 图片和文本"
      },
      "typeVersion": 1
    },
    {
      "id": "e6b85721-39a8-4377-9347-7d17da22adaa",
      "name": "获取Google文档中的文档",
      "type": "n8n-nodes-base.googleDocsTool",
      "position": [
        1792,
        176
      ],
      "parameters": {
        "operation": "get",
        "documentURL": "1H9ZBePkINDHi2c-IfsxRaVjF5iiGkwimxgJLICyGZco"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "id": "E0shoKK417yJ5FNV",
          "name": "Working sycorda"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e0c0f236-b08f-44a0-9efa-89668d005040",
      "name": "OpenRouter聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1392,
        144
      ],
      "parameters": {
        "model": "anthropic/claude-sonnet-4",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "id": "quUHCZdxn2JgpCAH",
          "name": "OpenRouter account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ff3ec81a-242f-4c30-bc9d-a03f170890d1",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -832,
        -336
      ],
      "parameters": {
        "width": 624,
        "height": 208,
        "content": "步骤1:WhatsApp消息接收与输入分类"
      },
      "typeVersion": 1
    },
    {
      "id": "97e920ae-71f8-4ece-8384-971c25745108",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -480
      ],
      "parameters": {
        "width": 512,
        "height": 176,
        "content": "步骤2:多模态内容处理"
      },
      "typeVersion": 1
    },
    {
      "id": "04ea0d56-f883-4ca7-9b43-77b7b567e12f",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        -272
      ],
      "parameters": {
        "width": 368,
        "height": 208,
        "content": "步骤3:AI驱动的客户支持引擎"
      },
      "typeVersion": 1
    },
    {
      "id": "62179b5e-7777-4a9d-ba77-7013ed44b5c5",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2064,
        -272
      ],
      "parameters": {
        "width": 336,
        "height": 176,
        "content": "步骤4:响应交付系统"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond with Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Audio Prompt": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Image": {
      "main": [
        [
          {
            "node": "Image + Text Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Audio URL": {
      "main": [
        [
          {
            "node": "Download Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image URL": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Download Audio": {
      "main": [
        [
          {
            "node": "Transcribe Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Analyze Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Input Type": {
      "main": [
        [
          {
            "node": "Get Audio URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Image URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Text Only Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text Only Prompt": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Audio": {
      "main": [
        [
          {
            "node": "Audio Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Check Input Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image + Text Prompt": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get a document in Google Docs": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 内容创作, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量22
分类2
节点类型11
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

外部链接
在 n8n.io 查看

分享此工作流