{
  "id": "DySX4VwXkFHS2hBu",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Product Review Analysis with BrowserAct & Gemini-Powered Recommendations.",
  "tags": [],
  "nodes": [
    {
      "id": "470cda20-f5d6-42cf-9c7b-c177fc1b668e",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        768,
        16
      ],
      "parameters": {
        "url": "https://api.browseract.com/v2/workflow/run-task",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "workflow_id",
              "value": "53146166844202600"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "dded721b-a8c2-45c8-945f-4d3b3c075590",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1104,
        0
      ],
      "parameters": {
        "url": "https://api.browseract.com/v2/workflow/get-task",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "=task_id",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "53cb4d92-892c-4129-af82-92518437f1ff",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1232,
        224
      ],
      "parameters": {
        "unit": "minutes",
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "9448871f-3035-4ef4-8650-b1b5067cb6a5",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        896,
        224
      ],
      "parameters": {
        "unit": "minutes",
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "49194dea-48db-4279-b8d1-6894423cf13e",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        896,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d48ae258-78a0-4b26-923d-2643b6b774c6",
              "operator": {
                "type": "object",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            },
            {
              "id": "3967a169-8432-45bd-8f89-08795fd12679",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": "null"
            }
          ]
        }
      },
      "retryOnFail": false,
      "typeVersion": 2.2
    },
    {
      "id": "72bc73be-c64b-4a41-a94a-6d86e3f9424d",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        1232,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0347a2a2-eb32-414d-9494-4e648078cf40",
              "operator": {
                "type": "object",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            },
            {
              "id": "99f31959-6f27-40dd-97c3-6ff611da1e0b",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "finished"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c2e08eb7-7d25-45c5-a9dc-a023de9df292",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1520,
        -16
      ],
      "parameters": {
        "text": "=from the \n\n{{ $json.output.string }} \n\nyou can see teh reviews it contains list of map like this \n\n[\n{\n\"Name\":\n\"Rating\":\n\"Summary\":\n}\n]\n\nread every single item \"Summary\" Analyze them and after you finished generate improvement recommendations and send them into the output in text \n\ntry to send these recommendations to Telegram and email with further details.",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "7dbc8ef3-42f1-4567-8882-e9ad930e90a5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -16
      ],
      "parameters": {
        "color": 5,
        "width": 688,
        "height": 432,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "cb55770c-e747-415a-86b1-7245ec2b3f89",
      "name": "Send email in Send Email",
      "type": "n8n-nodes-base.emailSendTool",
      "position": [
        1728,
        272
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text', ``, 'string') }}",
        "options": {},
        "subject": "Recomendation",
        "toEmail": "user@example.com",
        "fromEmail": "=test@Test",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "476f23b0-a51d-4cb9-9d4f-b0d832dfdd89",
      "name": "Send a text message in Telegram",
      "type": "n8n-nodes-base.telegramTool",
      "position": [
        1584,
        272
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text', ``, 'string') }}",
        "chatId": "@shoaywbs",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "24c3f5f6-6222-4fba-949a-bbd5f5b8cb86",
      "name": "Send email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2096,
        -16
      ],
      "parameters": {
        "text": "={{ $('AI Agent').item.json.output }}",
        "options": {},
        "subject": "Recomendation",
        "toEmail": "user@example.com",
        "fromEmail": "test@test",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "8fc634eb-c46e-44d7-bc81-88987496988e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1408,
        -16
      ],
      "parameters": {
        "color": 4,
        "width": 464,
        "height": 432,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "80e09f34-6ea7-40ed-9b92-22e73f05df5b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1888,
        -16
      ],
      "parameters": {
        "color": 3,
        "width": 384,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "26ded3f0-8262-47f8-9fe4-4f9074d9ca8e",
      "name": "Send a text message1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1936,
        -16
      ],
      "parameters": {
        "text": "=Recomendation : \n{{ $json.output }}",
        "chatId": "@test",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ad8560fd-df86-4443-bd7a-05969a63f2a0",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        496,
        16
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0184aa9b-e017-47eb-9043-97715c77de4c",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1440,
        240
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "daf91d3f-e648-4ab1-a557-99503c134bd9",
      "name": "Sticky Note-Start",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -208
      ],
      "parameters": {
        "width": 492,
        "height": 456,
        "content": "## Try It Out!\n### This n8n template demonstrates how to perform product review sentiment analysis and generate improvement recommendations using an AI Agent.\n\n\n### How it works\n* The workflow is triggered manually.\n* An **HTTP Request** node initiates a web scraping task with the BrowserAct API to collect product reviews.\n* A series of **If** and **Wait** nodes are used to check the status of the scraping task. If the task is not yet complete, the workflow pauses and retries until it receives the full dataset.\n* An **AI Agent** node, powered by **Google Gemini**, then processes the scraped review summaries. It analyzes the sentiment of each review and generates actionable improvement recommendations.\n* Finally, the workflow sends these detailed recommendations via a **Telegram** message and an **Email** to the relevant stakeholders.\n\n---\n### Requirements\n* **BrowserAct** API account for web scraping\n* **BrowserAct** \"**Product Review Sentiment Analysis**\" Template\n* **Gemini** account for the AI Agent\n* **Telegram** and **SMTP** credentials for sending messages\n\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/UpnCKd7GaU) or Visit Our [Blog](https://www.browseract.com/blog)!\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3e5f6cdb-9721-43e8-88a8-bbd9d43577fa",
      "name": "Sticky Note-Scraping",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -224
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 200,
        "content": "## 1. Trigger the Product Review Scraper\n\nThis workflow uses an HTTP Request to start a scraping task via the BrowserAct API. The task will scrape product reviews from a specified website. We're using a separate node for this to make it clean."
      },
      "typeVersion": 1
    },
    {
      "id": "d718f4b5-ae07-4216-99a4-9436e6502ef8",
      "name": "Sticky Note-Wait",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        -224
      ],
      "parameters": {
        "color": 5,
        "width": 320,
        "height": 200,
        "content": "## 2. Wait for Scraping to Finish\n\nThese nodes check the status of the scraping task. The `If` node determines if the task is complete. If it's still running, the `Wait` node pauses the workflow for a set period before retrying to check the status."
      },
      "typeVersion": 1
    },
    {
      "id": "dd2a6ca3-e361-4597-83b3-1da40e7313a5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1408,
        -224
      ],
      "parameters": {
        "color": 4,
        "width": 464,
        "height": 192,
        "content": "## 3. Use an AI Agent to Analyze Reviews and Generate Recommendations\n[Read more about the AI Agent node](https://docs.n8n.io/integrations/builtin/ai/agent-nodes/n8n-nodes-langchain.agent/)\n\nThis node uses an AI Agent to perform a complex task: analyzing the sentiment of each product review summary and then generating actionable recommendations for improvement. It leverages a connected language model (Google Gemini) and can use other tools in the workflow to complete its task, such as sending emails and Telegram messages."
      },
      "typeVersion": 1
    },
    {
      "id": "b311da33-c74e-4111-925a-c75220bba628",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1888,
        -224
      ],
      "parameters": {
        "color": 3,
        "width": 384,
        "height": 192,
        "content": "## 4. Send the Recommendations via Email and Telegram\n[Read more about the Email Send node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.emailSend/)\n[Read more about the Telegram node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.telegram/)\n\nThe final output from the AI Agent is sent to the specified email and Telegram accounts, delivering the improvement recommendations directly to the relevant stakeholders."
      },
      "typeVersion": 1
    },
    {
      "id": "ec9507c6-6b60-4167-a0a2-338a82ec0133",
      "name": "Sticky Note-Help",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        272
      ],
      "parameters": {
        "width": 496,
        "height": 96,
        "content": "## Need Help ?\n* [How to Find Your BrowserAct API Key & Workflow ID](https://www.youtube.com/watch?v=pDjoZWEsZlE)\n* [How to Connect n8n to Browseract](https://www.youtube.com/watch?v=RoYMdJaRdcQ)\n* [How to Use & Customize BrowserAct Templates](https://www.youtube.com/watch?v=CPZHFUASncY)"
      },
      "typeVersion": 1
    },
    {
      "id": "1f0ab2d4-ff88-43f0-b22d-d03eb5d7f106",
      "name": "Sticky Note-Video",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        400
      ],
      "parameters": {
        "width": 496,
        "height": 96,
        "content": "## Watch Workflow Guidance and Showcase\n* #### [How to INSTANTLY Get Product Improvement Ideas from Amazon Reviews | BrowserAct + n8n + Gemini](https://www.youtube.com/watch?v=YRhXjILRZH0)"
      },
      "typeVersion": 1
    },
    {
      "id": "d92eae16-6755-4eed-82ff-b9382f26e055",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        -320
      ],
      "parameters": {
        "color": 5,
        "width": 182,
        "height": 80,
        "content": "## \n# Get Node"
      },
      "typeVersion": 1
    },
    {
      "id": "e8d656a3-59c9-4c28-a5b1-80e16c62a5ff",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        -320
      ],
      "parameters": {
        "color": 4,
        "width": 230,
        "height": 80,
        "content": "## \n# Agent Node"
      },
      "typeVersion": 1
    },
    {
      "id": "121cebb8-9ada-4376-8b9d-88626c048328",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1968,
        -320
      ],
      "parameters": {
        "color": 3,
        "width": 214,
        "height": 80,
        "content": "## \n# Send Node"
      },
      "typeVersion": 1
    },
    {
      "id": "6825197c-df9e-46c4-9ed2-04ea243a1457",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        -320
      ],
      "parameters": {
        "color": 5,
        "width": 182,
        "height": 80,
        "content": "## \n# Run Node"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3fe6a97e-f30d-4256-95e3-4a1aed9e4689",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message1": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Send email in Send Email": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Send a text message in Telegram": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}