8
n8n 中文网amn8n.com

抓取竞品评论并使用 Bright Data 和 OpenAI 生成广告创意

高级

这是一个Product, AI, Marketing领域的自动化工作流,包含 17 个节点。主要使用 If, Wait, Gmail, Aggregate, FormTrigger 等节点,结合人工智能技术实现智能自动化。 抓取竞品评论并使用 Bright Data 和 OpenAI 生成广告创意

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "1eadd5bc7c3d70c587c28f782511fd898c6bf6d97963d92e836019d2039d1c79"
  },
  "nodes": [
    {
      "id": "58da2884-6dd9-446e-beca-cacae1e8df7c",
      "name": "## 1. 创建新的自定义 OpenAI 凭据",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4940,
        340
      ],
      "parameters": {
        "color": 4,
        "width": 1280,
        "height": 320,
        "content": "======================================="
      },
      "typeVersion": 1
    },
    {
      "id": "d2aa5abc-6a8b-4ad3-9b87-1349f3dd80b9",
      "name": "快照进度",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        7540,
        760
      ],
      "parameters": {
        "url": "=https://api.brightdata.com/datasets/v3/progress/{{ $('HTTP Request- Post API call to Bright Data').item.json.snapshot_id }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <YOUR_BRIGHT_DATA_API_KEY>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "fba84a88-1775-4bc9-85cb-1bda621b4c2c",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8600,
        540
      ],
      "parameters": {
        "width": 195,
        "height": 646,
        "content": "在此工作流中,我使用Google Sheets存储结果"
      },
      "typeVersion": 1
    },
    {
      "id": "4b235825-1445-42d1-a9fa-d017974819fe",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6560,
        840
      ],
      "parameters": {
        "width": 220,
        "height": 440,
        "content": "在此添加您竞争对手的Amazon链接"
      },
      "typeVersion": 1
    },
    {
      "id": "d6a75b46-e968-4dab-962d-1f81b643b768",
      "name": "HTTP请求- 向Bright Data发送API调用",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6920,
        840
      ],
      "parameters": {
        "url": "https://api.brightdata.com/datasets/v3/trigger",
        "method": "POST",
        "options": {},
        "jsonBody": "=[\n  {\n    \"url\": \"{{ $json['Amazon Product URL'] }}\"\n  }\n]",
        "sendBody": true,
        "sendQuery": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "queryParameters": {
          "parameters": [
            {
              "name": "dataset_id",
              "value": "gd_le8e811kzy4ggddlq"
            },
            {
              "name": "include_errors",
              "value": "true"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <YOUR_BRIGHT_DATA_API_KEY>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "50a6c73a-dd82-40af-ad5a-88ef4fd5fc7c",
      "name": "等待 - 轮询Bright Data",
      "type": "n8n-nodes-base.wait",
      "position": [
        7300,
        760
      ],
      "webhookId": "8005a2b3-2195-479e-badb-d90e4240e699",
      "parameters": {
        "unit": "minutes",
        "amount": 1
      },
      "executeOnce": false,
      "typeVersion": 1.1
    },
    {
      "id": "8af8f713-6d5d-4113-ad5e-86b29fc8f441",
      "name": "如果 - 检查快照状态 - 数据是否就绪",
      "type": "n8n-nodes-base.if",
      "position": [
        7740,
        760
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7932282b-71bb-4bbb-ab73-4978e554de7e",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "running"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "98166378-3766-4c69-b891-48891a18e175",
      "name": "HTTP请求 - 从Bright Data获取数据",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        8020,
        780
      ],
      "parameters": {
        "url": "=https://api.brightdata.com/datasets/v3/snapshot/{{ $('HTTP Request- Post API call to Bright Data').item.json.snapshot_id }}",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "format",
              "value": "json"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <YOUR_BRIGHT_DATA_API_KEY>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "217cc982-0550-4e27-afd5-12b46eafcd04",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7240,
        620
      ],
      "parameters": {
        "color": 4,
        "width": 940,
        "height": 400,
        "content": "Bright Data获取评论"
      },
      "typeVersion": 1
    },
    {
      "id": "5fd57531-25f4-4b10-9d95-bbeda1b336cf",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        9620,
        1060
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "MX2lQOZcGpmRvdVD",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d79c7504-0ccc-4491-bf7a-3697b31fa71a",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        9480,
        600
      ],
      "parameters": {
        "width": 360,
        "height": 820,
        "content": "调整此提示:"
      },
      "typeVersion": 1
    },
    {
      "id": "413669e5-2b75-499d-ba00-766b3cce0d69",
      "name": "Google Sheets - 添加所有评论",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        8640,
        840
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "product_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product_rating",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "product_rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product_rating_object",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "product_rating_object",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product_rating_max",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "product_rating_max",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "rating",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "author_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "author_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "asin",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "asin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product_rating_count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "product_rating_count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_header",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "review_header",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "review_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_text",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "review_text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "author_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "author_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "author_link",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "author_link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "badge",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "badge",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "brand",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "brand",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_posted_date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "review_posted_date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_country",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "review_country",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "review_images",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "review_images",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "helpful_count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "helpful_count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "is_amazon_vine",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "is_amazon_vine",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "is_verified",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "is_verified",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "variant_asin",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "variant_asin",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "variant_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "variant_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "videos",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "videos",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "input",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "input",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IR-yMQwEFTjbTCSPvVlQ54zQsnG0IRauTjPGoBWmR8U/edit#gid=0",
          "cachedResultName": "input"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1IR-yMQwEFTjbTCSPvVlQ54zQsnG0IRauTjPGoBWmR8U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IR-yMQwEFTjbTCSPvVlQ54zQsnG0IRauTjPGoBWmR8U/edit?usp=drivesdk",
          "cachedResultName": "NoFluff-N8N-Sheet-Template- AMAZON Reviews Scraping WIth Bright Data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "4RJOMlGAcB9ZoYfm",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.3,
      "alwaysOutputData": true
    },
    {
      "id": "e1d58479-4008-4801-8523-fa2304ea9ef0",
      "name": "表单提交时 - Amazon评论",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        6620,
        980
      ],
      "webhookId": "8d0269c7-d1fc-45a1-a411-19634a1e0b82",
      "parameters": {
        "options": {},
        "formTitle": "Please Paste The URL of the Amazon Product",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Amazon Product URL",
              "placeholder": "https://www.amazon.com/Quencher-Cupholder-Compatible-Insulated-Stainless/dp/B0DCDQ1RFV",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2d79e9d2-a867-447e-91f9-b90c2e56427a",
      "name": "聚合所有评论",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        9140,
        840
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "renameField": true,
              "outputFieldName": "Aggregated_reviews",
              "fieldToAggregate": "review_text"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "937ef1c4-32b3-4966-abb4-f4ae09aa12a7",
      "name": "基础LLM链 - 近期评论摘要",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        9520,
        840
      ],
      "parameters": {
        "text": "=Read the following reviews, these are reviews of our competitors:\n{{ $json.Aggregated_reviews }}\n\n---\nAfter reading them, summarize their weakest points.\nDon't mention the competitor name.\n\n",
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "2ccf1e0f-a738-44ee-bd8f-65a02a92ca91",
      "name": "OpenAI- 生成图片",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        10160,
        840
      ],
      "parameters": {
        "prompt": "={\n  \"ad_dimensions\": {\n    \"width\": 1080,\n    \"height\": 1080\n  },\n  \"target_audience\": \"B2C customer\",\n  \"pain_points_source\": \"choose one pain point based on this {{ $json.text }}\",\n  \"ad_requirements\": {\n    \"image_style\": \"weird-and-fun\",\n    \"weird_objects\": [\n      \"Fruit with Faces\",\n      \"Realistic People\"\n    ],\n    \"focus\": \"address the biggest pain point of competitors\",\n    \"avoid_naming_competitors\": true,\n    \"headline\": {\n      \"position\": \"No\",\n      \"text_only\": \"No\",\n      \"other_text\": \"No\"\n    },\n    \"background\": [\n      \"bold red\",\n      \"black\"\n    ]\n  }\n}",
        "options": {},
        "resource": "image"
      },
      "credentials": {
        "openAiApi": {
          "id": "MX2lQOZcGpmRvdVD",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "ebb11f25-66f5-495e-a7bc-4212c6db10d5",
      "name": "Gmail - 向媒体购买者发送创意",
      "type": "n8n-nodes-base.gmail",
      "position": [
        10580,
        840
      ],
      "webhookId": "41184a90-65fd-49a8-b0de-d838b94c790c",
      "parameters": {
        "sendTo": "yaron.been@gmail.com",
        "message": "=Hey, \n\nWe have analyzed our competitors recent reviews.\nAnalysis data:\n{{ $today }}\n\nHere's a summary:\n{{ $('Basic LLM Chain - Summary of Recent reviews').item.json.text }}\n\nPlease see attached an AI generated 1080x1080 image which you can use in Meta ads.\n\n",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {}
            ]
          }
        },
        "subject": "=Static Creatives Based on Our competitor {{ $now }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "TLJ5oxgGtoxdGOTZ",
          "name": "Gmail account 2"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "pinData": {
    "Basic LLM Chain - Summary of Recent reviews": [
      {
        "text": "The reviews highlight several common weaknesses among the products:\n\n1. **Quality Control Issues**: Some customers reported receiving cups with dents or damages upon arrival, raising concerns about packaging and quality assurance during shipping.\n\n2. **Durability Concerns**: While many praised the durability, a few mentioned that the cups could spill if tipped over, indicating that they might not be fully leak-proof.\n\n3. **Ease of Use**: Several users experienced difficulties with lids getting stuck or indicated that the tumblers are not spill-proof, particularly when used for non-water beverages.\n\n4. **Size and Weight**: A few reviewers commented on the heaviness of larger sizes, suggesting they may not be convenient for frequent carrying, especially for those with smaller bags or during outings.\n\n5. **Cleaning Issues**: Some users noted that certain models could be challenging to clean, particularly if not hand-washed to maintain appearance.\n\n6. **Authenticity Doubts**: There were instances where customers questioned the authenticity of the product based on packaging or markings, which could affect their overall satisfaction.\n\n7. **Price**: A few reviewers mentioned that while the products are of good quality, they are considered pricey, leading to questions about whether the value matches the cost. \n\nOverall, despite many positive comments, issues related to packaging, spillability, and price emerged as notable weaknesses."
      }
    ]
  },
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain - Summary of Recent reviews",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Snapshot Progress": {
      "main": [
        [
          {
            "node": "If - Checking status of Snapshot - if data is ready or not",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregating all reviews": {
      "main": [
        [
          {
            "node": "Basic LLM Chain - Summary of Recent reviews",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI- Generating image": {
      "main": [
        [
          {
            "node": "Gmail - Sending creative to Media Buyers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait - Polling Bright Data": {
      "main": [
        [
          {
            "node": "Snapshot Progress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Adding All Reviews": {
      "main": [
        [
          {
            "node": "Aggregating all reviews",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission - Amazon Reviews": {
      "main": [
        [
          {
            "node": "HTTP Request- Post API call to Bright Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request- Post API call to Bright Data": {
      "main": [
        [
          {
            "node": "Wait - Polling Bright Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain - Summary of Recent reviews": {
      "main": [
        [
          {
            "node": "OpenAI- Generating image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request - Getting data from Bright Data": {
      "main": [
        [
          {
            "node": "Google Sheets - Adding All Reviews",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If - Checking status of Snapshot - if data is ready or not": {
      "main": [
        [
          {
            "node": "Wait - Polling Bright Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request - Getting data from Bright Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 产品, 人工智能, 营销

需要付费吗?

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

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

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

作者
Yaron Been

Yaron Been

@yaron-nofluff

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host

外部链接
在 n8n.io 查看

分享此工作流