8
n8n 中文网amn8n.com

基于Baserow和WasenderAPI的WhatsApp外发消息

中级

这是一个Lead Nurturing领域的自动化工作流,包含 6 个节点。主要使用 Switch, Baserow, Webhook, HttpRequest 等节点。 基于Baserow和WasenderAPI的WhatsApp外发消息

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "834bc6c387a1c56d0622a24b912577f9e6d66c5873f4e6426166054eb488d8fc",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "7edf6b1a-ff2f-44c3-95d7-efc72e675630",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        -260
      ],
      "parameters": {
        "width": 400,
        "height": 1040,
        "content": "## 掌握您的出站WhatsApp:Baserow & n8n自动化"
      },
      "typeVersion": 1
    },
    {
      "id": "d3510dc5-4126-4c08-92f0-0c63deaa85e6",
      "name": "回退",
      "type": "n8n-nodes-base.noOp",
      "position": [
        780,
        320
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c1912c6e-07d6-4101-8eba-e8709507b71c",
      "name": "Webhook:Baserow出站触发器",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -20,
        180
      ],
      "webhookId": "f2fabcfc-b8a2-4662-ac03-bca53f223015",
      "parameters": {
        "path": "anything you like",
        "options": {},
        "httpMethod": "POST",
        "authentication": "headerAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "sFH79l1dvIvxEu2W",
          "name": "whatsapp_hook"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "b97c5c82-b2cc-4694-b8ee-4640bf838ae4",
      "name": "WasenderAPI:发送出站消息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        780,
        80
      ],
      "parameters": {
        "url": "https://wasenderapi.com/api/send-message",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "to",
              "value": "={{ $json.body.items[0]['WhatsApp Number (Linked Contact)'][0].value }}"
            },
            {
              "name": "text",
              "value": "={{ $json.body.items[0]['Message Content'] }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <Your Token>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e41a8798-1709-4fac-a645-0e9017562d60",
      "name": "过滤器:消息状态\"已发送\"",
      "type": "n8n-nodes-base.switch",
      "position": [
        240,
        180
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "SENT",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "69bf58bd-3365-4260-97c4-be4bed1cb35b",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.items[0].Status.value }}",
                    "rightValue": "Sent"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        },
        "looseTypeValidation": true
      },
      "typeVersion": 3.2
    },
    {
      "id": "ee16b330-b65d-4103-bfd6-bba1254e180a",
      "name": "Baserow:确认出站日志",
      "type": "n8n-nodes-base.baserow",
      "position": [
        1020,
        80
      ],
      "parameters": {
        "rowId": "={{ $('Webhook: Baserow Outbound Trigger').item.json.body.items[0].id }}",
        "tableId": 622533,
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": 5064441,
              "fieldValue": "Outbound"
            },
            {
              "fieldId": 5064443,
              "fieldValue": "={{$now.setLocale(nl-NL).toLocal()}}"
            },
            {
              "fieldId": 5064439,
              "fieldValue": "={{ $json.data.msgId }}"
            }
          ]
        },
        "operation": "update",
        "databaseId": 264981
      },
      "credentials": {
        "baserowApi": {
          "id": "HadM27Hzjj2CaqeH",
          "name": "Baserow account"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Filter: Message Status 'Sent'": {
      "main": [
        [
          {
            "node": "WasenderAPI: Send Outbound Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "fallback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook: Baserow Outbound Trigger": {
      "main": [
        [
          {
            "node": "Filter: Message Status 'Sent'",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WasenderAPI: Send Outbound Message": {
      "main": [
        [
          {
            "node": "Baserow: Confirm Outbound Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 客户培育

需要付费吗?

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

工作流信息
难度等级
中级
节点数量6
分类1
节点类型6
难度说明

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

作者
Stephan Koning

Stephan Koning

@reklaim

Account Executive by day , Noco builder for fun at night and always a proud dad of Togo the Samoyed.

外部链接
在 n8n.io 查看

分享此工作流