8
n8n 中文网amn8n.com

通过KlickTipp触发发送个性化WhatsApp模板及自动回复

中级

这是一个Support, AI领域的自动化工作流,包含 12 个节点。主要使用 Klicktipp, Filter, Switch, KlicktippTrigger, WhatsApp 等节点,结合人工智能技术实现智能自动化。 通过KlickTipp触发发送个性化WhatsApp模板及自动回复

前置要求
  • AI 服务 API Key(如 OpenAI、Anthropic 等)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "95b3ab5a70ab1c8c1906357a367f1b236ef12a1409406fd992f60255f0f95f85",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "aec24e02-fc90-482f-98b0-ba1fe8e069ef",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        -240
      ],
      "parameters": {
        "color": 4,
        "width": 380,
        "height": 880,
        "content": "## 通过 Webhook 调用或消息接收数据"
      },
      "typeVersion": 1
    },
    {
      "id": "16d48a81-06cf-4c58-8769-8e8fd90ed735",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        540,
        40
      ],
      "parameters": {
        "color": 5,
        "width": 380,
        "height": 600,
        "content": "## 数据过滤和消息检查"
      },
      "typeVersion": 1
    },
    {
      "id": "b137f46c-2e00-42be-a708-b6d9e803cde7",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        -240
      ],
      "parameters": {
        "width": 380,
        "height": 560,
        "content": "## 发送 WhatsApp 消息模板"
      },
      "typeVersion": 1
    },
    {
      "id": "661df01d-7f5c-429f-a1ea-c29278e76f29",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        340
      ],
      "parameters": {
        "color": 3,
        "width": 380,
        "height": 300,
        "content": "## 联系人订阅和标记"
      },
      "typeVersion": 1
    },
    {
      "id": "b44aba0c-1ecc-44f2-bd6c-66e903a0b5e7",
      "name": "WhatsApp 中的新消息",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "notes": "Listens for incoming WhatsApp messages. This serves as the entry point of the workflow, capturing the message content and sender details for routing decisions.",
      "position": [
        320,
        140
      ],
      "webhookId": "e2861f19-0da7-4320-878c-6ec0e138a7d4",
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "hGrWILflNJ7mqZq6",
          "name": "Ricardo'S WhatsApp OAuth account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "018da945-7aca-45ca-a1dc-a25d6ed1eeb7",
      "name": "取消检查",
      "type": "n8n-nodes-base.switch",
      "notes": "Evaluates incoming WhatsApp message content to determine if it begins with the keyword 'STOP' (ignoring whitespace and case). This allows routing messages either towards support or subscription logic.",
      "position": [
        780,
        140
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "fb517cd9-362b-4ea2-b9c0-7aaad80255b4",
                    "operator": {
                      "type": "string",
                      "operation": "notStartsWith"
                    },
                    "leftValue": "={{ \n// Normalize the message content to lowercase and remove all spaces\n$json.messages[0].text.body.toLowerCase().replace(/\\s+/g, '') }}",
                    "rightValue": "stop"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "55d55779-eb4d-4562-a462-8dbcfc85852d",
                    "operator": {
                      "type": "string",
                      "operation": "startsWith"
                    },
                    "leftValue": "={{ \n// Normalize the message content to lowercase and remove all spaces\n$json.messages[0].text.body.toLowerCase().replace(/\\s+/g, '') }}",
                    "rightValue": "stop"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "notesInFlow": true,
      "typeVersion": 3.2
    },
    {
      "id": "7d13f787-95f7-4c13-8674-ef20c82e6fa1",
      "name": "KlickTipp Outbound 已触发",
      "type": "CUSTOM.klicktippTrigger",
      "notes": "Triggers this workflow when a relevant event occurs in KlickTipp. Used to initiate notifications via WhatsApp message templates when subscriber data changes or a specific event is captured.",
      "position": [
        320,
        -140
      ],
      "webhookId": "ede76771-57d8-440e-8daf-73cc4c27b7cb",
      "parameters": {},
      "credentials": {
        "klickTippApi": {
          "id": "K9JyBdCM4SZc1cXl",
          "name": "DEMO KlickTipp account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "964324f7-a818-46e6-b51f-181837479172",
      "name": "发送 WhatsApp 优惠模板",
      "type": "n8n-nodes-base.whatsApp",
      "notes": "Sends a WhatsApp message template when the KlickTipp trigger is activated. This is typically used to confirm an action, notify about updates, or alert based on subscriber activity.",
      "position": [
        1060,
        -140
      ],
      "webhookId": "fd384a0a-0356-490c-bc7c-9be38ef7754f",
      "parameters": {
        "template": "offer_for_manual|de",
        "components": {
          "component": [
            {
              "bodyParameters": {
                "parameter": [
                  {
                    "text": "={{ $json.CustomFieldFirstName }}"
                  },
                  {
                    "text": "={{ $json.CustomField217373 }}"
                  },
                  {
                    "text": "={{ $json.CustomField217511 }}"
                  }
                ]
              }
            },
            {
              "type": "button",
              "sub_type": "url",
              "buttonParameters": {
                "parameter": {
                  "text": "={{ $json.CustomField218042 }}",
                  "type": "text"
                }
              }
            }
          ]
        },
        "phoneNumberId": "114317595015150",
        "recipientPhoneNumber": "={{ //Formats phone numbers by replacing the international dialing prefix eg. (0049) with the plus format (+49)\n$json.PhoneNumber.replace(/^00/, '+') }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "HqfpRQa1HyDz8IQI",
          "name": "Ricardo's WhatsApp account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "629c4059-c03e-4b66-841e-674f03519a3f",
      "name": "发送 WhatsApp 自动回复模板",
      "type": "n8n-nodes-base.whatsApp",
      "notes": "Sends a WhatsApp template message to the sender when their message begins with 'STOP', signaling intent to reach support. Personalizes the message using the sender’s name.",
      "position": [
        1060,
        140
      ],
      "webhookId": "632b8645-0d1c-479c-875b-b04e01dcff34",
      "parameters": {
        "template": "auto_forward_to_support|de",
        "components": {
          "component": [
            {
              "bodyParameters": {
                "parameter": [
                  {
                    "text": "={{ \n// Insert the profile name of the contact to personalize the message\n$json.contacts[0].profile.name }}"
                  }
                ]
              }
            }
          ]
        },
        "phoneNumberId": "114317595015150",
        "recipientPhoneNumber": "={{ \n// Extract the phone number of the sender from the message\n$json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "HqfpRQa1HyDz8IQI",
          "name": "Ricardo's WhatsApp account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "a5142a5b-d0cc-4965-8462-588477641d3f",
      "name": "订阅号码以选择退出 WA 消息",
      "type": "CUSTOM.klicktipp",
      "notes": "Subscribes the WhatsApp sender to the KlickTipp list using their phone number. Formats the number with a '+' prefix for compatibility with KlickTipp.",
      "position": [
        1060,
        460
      ],
      "parameters": {
        "listId": "358895",
        "resource": "subscriber",
        "operation": "subscribe",
        "smsNumber": "={{\n// Add a \"+\" prefix to the WhatsApp ID to align with expected format in KlickTipp\n'+' + $json.contacts[0].wa_id }}"
      },
      "credentials": {
        "klickTippApi": {
          "id": "K9JyBdCM4SZc1cXl",
          "name": "DEMO KlickTipp account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "3593831c-4c99-441b-9424-c59440feba3b",
      "name": "过滤用户消息",
      "type": "n8n-nodes-base.filter",
      "notes": "This node filters out the messages that come from users responding to automated messages. Otherwise automated messages would trigger the flow.",
      "position": [
        580,
        140
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c3399312-f3df-4a89-9ce4-3e7773b025fb",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.messages[0] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "96d54af1-44c1-48c0-9bf3-269e2d084a5c",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        660
      ],
      "parameters": {
        "color": 7,
        "width": 988,
        "height": 1109,
        "content": "### 简介"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Cancellation check": {
      "main": [
        [
          {
            "node": "Sending WhatsApp auto-responder template",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Subscribe number to opt-out from WA messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter user messages": {
      "main": [
        [
          {
            "node": "Cancellation check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New message in WhatsApp": {
      "main": [
        [
          {
            "node": "Filter user messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "KlickTipp Outbound triggered": {
      "main": [
        [
          {
            "node": "Sending WhatsApp offer template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 客户支持, 人工智能

需要付费吗?

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

工作流信息
难度等级
中级
节点数量12
分类2
节点类型7
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
KlickTipp

KlickTipp

@KlickTipp

Reach more people. 100% GDPR compliant. Quickly create automated email campaigns, SMS and marketing automations. Market your knowledge independently of Google & Co., sell lucrative products and activate your customers.

外部链接
在 n8n.io 查看

分享此工作流