8
n8n 中文网amn8n.com

使用BrowserAct和Slack的实时MAP执行和价格违规警报

高级

这是一个Market Research领域的自动化工作流,包含 20 个节点。主要使用 If, Code, Merge, Slack, GoogleSheets 等节点。 Google表格、BrowserAct和Slack的实时MAP执行和价格违规警报

前置要求
  • Slack Bot Token 或 Webhook URL
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "hiFrvAExHDHKN4oj",
  "meta": {
    "instanceId": "88804d8e264d231c18413147cc92e4245b20ae7b97d774bad847556f645c8192",
    "templateCredsSetupCompleted": true
  },
  "name": "使用BrowserAct和Slack的实时MAP执行和价格违规警报",
  "tags": [],
  "nodes": [
    {
      "id": "77a6048a-7f41-4228-8440-a44d94300287",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -608,
        -160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5744d319-95f1-4ba8-8bb7-013a0adbd0bd",
      "name": "获取表格中的行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -448,
        -160
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1yB7rZc-7Lb6gpzdXxgOiSWltHuAbQ3nnSdelOppJPGs/edit#gid=0",
          "cachedResultName": "Reselers Link"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1yB7rZc-7Lb6gpzdXxgOiSWltHuAbQ3nnSdelOppJPGs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1yB7rZc-7Lb6gpzdXxgOiSWltHuAbQ3nnSdelOppJPGs/edit?usp=drivesdk",
          "cachedResultName": "MAP Violation Alerts "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wAMAqU43zjVjlpuA",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "f6f3c76f-d431-4dad-8ab1-98d73fedc1c6",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -272,
        -144
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "332e4a3f-c1d3-419a-9bfc-b27d432e88e5",
      "name": "运行工作流任务",
      "type": "n8n-nodes-browseract-workflows.browserAct",
      "position": [
        -64,
        -128
      ],
      "parameters": {
        "workflowId": "57030890989130618",
        "inputParameters": {
          "parameters": [
            {
              "name": "Target_Link",
              "value": "={{ $json.Reseller_URL }}"
            }
          ]
        },
        "additionalFields": {
          "saveBrowserData": false
        }
      },
      "credentials": {
        "browserActApi": {
          "id": "AzKMhR2eAlOjzDiJ",
          "name": "BrowserAct account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2acfb998-c3c3-4078-a80a-8ad3c76326e2",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        688,
        0
      ],
      "parameters": {
        "options": {
          "ignoreCase": true
        },
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "41ecfaab-dc9e-4ac8-886d-01d40aac5f18",
              "operator": {
                "type": "number",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.Price }}",
              "rightValue": ""
            },
            {
              "id": "60daa8d6-e2ea-4de2-a98d-24039f659cd3",
              "operator": {
                "type": "number",
                "operation": "lt"
              },
              "leftValue": "={{ $json.Price }}",
              "rightValue": "={{ $('Loop Over Items').item.json.AP_Price }}"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "2171e108-7894-46c8-8f82-3f69279e7800",
      "name": "发送消息",
      "type": "n8n-nodes-base.slack",
      "position": [
        816,
        -80
      ],
      "webhookId": "33d194fb-6189-490d-83b6-bb091e49277f",
      "parameters": {
        "text": "={{ $('Loop Over Items').item.json.Reseller_Name }} is Breaking Rules\n{{ $('Loop Over Items').item.json.Product_SKU }} Price is less than {{ $('Loop Over Items').item.json.AP_Price }}\ncurrent Price : {{ $json.Price }}\nLink : {{ $('Loop Over Items').item.json.Reseller_URL }}\nDate : {{ $('Schedule Trigger').item.json[\"Readable date\"] }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09KLV9DJSX",
          "cachedResultName": "all-browseract-workflow-test"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "5rQCkyObBqbHIbZA",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "32d71b0c-eb59-4b3c-a343-555346874123",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1072,
        -80
      ],
      "parameters": {
        "mode": "chooseBranch",
        "output": "empty",
        "numberInputs": 3
      },
      "typeVersion": 3.2
    },
    {
      "id": "864840e9-5afc-41ed-879b-ec4ec5b57879",
      "name": "获取工作流任务详情",
      "type": "n8n-nodes-browseract-workflows.browserAct",
      "position": [
        128,
        -128
      ],
      "parameters": {
        "taskId": "={{ $json.id }}",
        "operation": "getTask",
        "waitForFinish": true
      },
      "credentials": {
        "browserActApi": {
          "id": "AzKMhR2eAlOjzDiJ",
          "name": "BrowserAct account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "acaf7b39-3fc5-4033-85e6-7b5fe4b8bb04",
      "name": "JavaScript 代码",
      "type": "n8n-nodes-base.code",
      "position": [
        304,
        -128
      ],
      "parameters": {
        "jsCode": "// Get the JSON string using the exact path provided by the user.\nconst jsonString = $input.first().json.output.string;\n\nlet parsedData;\n\n// Check if the string exists before attempting to parse\nif (!jsonString) {\n    // Return an empty array or throw an error if no string is found\n    // Throwing an error is usually better to stop the workflow if data is missing.\n    throw new Error(\"Input string is empty or missing at the specified path: $input.first().json.output.string\");\n}\n\ntry {\n    // 1. Parse the JSON string into a JavaScript array of objects\n    parsedData = JSON.parse(jsonString);\n} catch (error) {\n    // Handle JSON parsing errors (e.g., if the string is malformed)\n    throw new Error(`Failed to parse JSON string: ${error.message}`);\n}\n\n// 2. Ensure the parsed data is an array\nif (!Array.isArray(parsedData)) {\n    throw new Error('Parsed data is not an array. It cannot be split into multiple items.');\n}\n\n// 3. Map the array of objects into the n8n item format { json: object }\n// Each element in this array will be treated as a new item by n8n, achieving the split.\nconst outputItems = parsedData.map(item => ({\n    json: item,\n}));\n\n// 4. Return the new array of items\nreturn outputItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "f6a2664e-bc1e-4c73-932d-1432f679e316",
      "name": "条件判断1",
      "type": "n8n-nodes-base.if",
      "position": [
        480,
        -128
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7aa4e4c0-02e1-4d50-86a7-5d58f4db2552",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.Price }}",
              "rightValue": "NoData"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "47f04366-a59a-43d4-a926-9939952a5a15",
      "name": "发送消息1",
      "type": "n8n-nodes-base.slack",
      "position": [
        688,
        -160
      ],
      "webhookId": "33d194fb-6189-490d-83b6-bb091e49277f",
      "parameters": {
        "text": "={{ $('Loop Over Items').item.json.Reseller_Name }} is out of stock on Product\n{{ $('Loop Over Items').item.json.Product_SKU }} \nLink : {{ $('Loop Over Items').item.json.Reseller_URL }}\nDate : {{ $('Schedule Trigger').item.json[\"Readable date\"] }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09KLV9DJSX",
          "cachedResultName": "all-browseract-workflow-test"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "5rQCkyObBqbHIbZA",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "eeb379b9-3e75-4160-a7f4-1754962667c4",
      "name": "便利贴 - 介绍",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        -464
      ],
      "parameters": {
        "width": 480,
        "height": 450,
        "content": "## 试用一下!"
      },
      "typeVersion": 1
    },
    {
      "id": "01d5f0f3-38b5-4946-aaf8-460ba02e53e4",
      "name": "便签 - 如何使用",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        0
      ],
      "parameters": {
        "width": 480,
        "height": 260,
        "content": "## 使用方法"
      },
      "typeVersion": 1
    },
    {
      "id": "e60180af-3931-4a50-b7d7-02364ec06824",
      "name": "便签 - 需要帮助",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        272
      ],
      "parameters": {
        "width": 480,
        "height": 152,
        "content": "### 需要帮助?"
      },
      "typeVersion": 1
    },
    {
      "id": "26b0718c-12da-4f57-b320-b3ae452dd6d1",
      "name": "便利贴 - 输入和循环",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -400
      ],
      "parameters": {
        "color": 6,
        "width": 400,
        "height": 152,
        "content": "### 📋 1. 输入和循环"
      },
      "typeVersion": 1
    },
    {
      "id": "f35d406d-ffb3-4476-a522-10292ade74c8",
      "name": "便签 - 数据收集",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -400
      ],
      "parameters": {
        "color": 5,
        "width": 528,
        "height": 168,
        "content": "### 🤖 2. 价格抓取"
      },
      "typeVersion": 1
    },
    {
      "id": "40221cb1-187e-4c53-a50a-0754a753fb95",
      "name": "便利贴 - 逻辑和警报",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        -400
      ],
      "parameters": {
        "color": 3,
        "width": 752,
        "height": 176,
        "content": "### ⚖️ 3. 违规逻辑和警报"
      },
      "typeVersion": 1
    },
    {
      "id": "75ab0a4d-9846-446c-8416-1210178ab93d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 528,
        "height": 256,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f975d0d3-ab49-43a5-8bfd-e29f54e6c135",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -208
      ],
      "parameters": {
        "color": 6,
        "width": 400,
        "height": 256,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "076dd547-e5e3-44a9-a8ce-d01edde6bb46",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        -208
      ],
      "parameters": {
        "color": 3,
        "width": 752,
        "height": 320,
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f0b3fc52-a4f1-4e00-95f8-b1e23f9f878a",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Send a message1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Run a workflow task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run a workflow task": {
      "main": [
        [
          {
            "node": "Get details of a workflow task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get details of a workflow task": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 市场调研

需要付费吗?

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

工作流信息
难度等级
高级
节点数量20
分类1
节点类型9
难度说明

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

作者
Madame AI Team | Kai

Madame AI Team | Kai

@madame-ai

I’m a PhD in Physics turned AI enthusiast, passionate about uncovering how AI is transforming content creation, business, and daily life.

外部链接
在 n8n.io 查看

分享此工作流