8
n8n 中文网amn8n.com

WhatsApp 商务消息自动媒体下载(HTTP 存储)

中级

这是一个Building Blocks, Marketing领域的自动化工作流,包含 6 个节点。主要使用 WhatsApp, HttpRequest, WhatsAppTrigger 等节点。 从 WhatsApp 商务消息自动下载媒体文件到 HTTP 存储

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "4e229722e6c43a4914d2d66178b48335adf795d73afbee5b0ea0c52938ef4d8e",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "a24e0949-dcf6-48d4-8b9e-ce201e8b87d8",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2380,
        -400
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "此注释表示当收到带有媒体的新 WhatsApp 消息时触发工作流。"
      },
      "typeVersion": 1
    },
    {
      "id": "f513cc8b-89d3-4481-b7fa-ac9d33ba8562",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1980,
        -400
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "此注释说明媒体 ID 用于获取下载媒体的私有 URL。"
      },
      "typeVersion": 1
    },
    {
      "id": "3bae6af6-8858-4da4-ab2c-846a2c3e0ffe",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        -400
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "此注释强调使用获取的私有 URL 下载媒体文件。"
      },
      "typeVersion": 1
    },
    {
      "id": "f694abd7-dacf-41a7-82aa-157bfcf54f83",
      "name": "触发 WhatsApp 媒体",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -2280,
        -320
      ],
      "webhookId": "864469fd-2008-445c-83fe-852dac2b236a",
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "a41n62XWot5Pm1XE",
          "name": "WhatsApp OAuth account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "33e74a92-4475-470d-8003-7631ea0b706f",
      "name": "获取媒体下载 URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -1880,
        -320
      ],
      "webhookId": "b052dd6a-55b8-4195-a64e-c0088b7419cc",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $json.messages[0].image.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "yVJyvYLlRszyE5sV",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5e9b09e8-b9d2-4571-a897-d49d32a68c3c",
      "name": "下载媒体文件",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1500,
        -320
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "response": {
            "response": {}
          }
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "Ihwbk0P1mYkOZZlr",
          "name": "Whatsapp APi Token"
        },
        "httpHeaderAuth": {
          "id": "Rymur2oAzX9lewU9",
          "name": "Whatsapp API Token"
        }
      },
      "typeVersion": 4.2
    }
  ],
  "pinData": {},
  "connections": {
    "Trigger WhatsApp Media": {
      "main": [
        [
          {
            "node": "Fetch Media Download URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Media Download URL": {
      "main": [
        [
          {
            "node": "Download Media File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 构建模块, 营销

需要付费吗?

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

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

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

作者
Usman Liaqat

Usman Liaqat

@usmanliaqat

Full Stack Website Developer & Automation Expert

外部链接
在 n8n.io 查看

分享此工作流