AI-powered web research in Google Sheets with GPT and Bright Data
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (10)
- Respond to Webhook
n8n-nodes-base.respondToWebhook - AI Agent
@n8n/n8n-nodes-langchain.agent - MCP Client Tool
@n8n/n8n-nodes-langchain.mcpClientTool - Webhook
n8n-nodes-base.webhook - HTTP Request
n8n-nodes-base.httpRequest - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Data table
n8n-nodes-base.dataTable - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Edit Fields (Set)
n8n-nodes-base.set
What it does
π AI-Powered Web Research in Google Sheets with Bright Data π Overview Transform any Google Sheets cell into an intelligent web scraper! Type =BRIGHTDATA("cell", "search prompt") and get AI-filtered result from every website in ~20 seconds. What happens automatically: - AI optimizes your search query - Bright Data scrapes the web (bypasses bot detection) - AI analyzes and filters result - Returns clean data directly to your cell - Completes in <25 seconds Cost: ~$0.02-0.05 per search | Time saved: 3-5 minutes per search --- π₯ Who's it for - Market researchers needing competitive intelligence - E-commerce teams tracking prices - Sales teams doing lead prospecting - SEO specialists gathering content research - Real estate agents monitoring listings - Anyone tired of manual copy-paste --- βοΈ How it works 1. Webhook Call - Google Sheets function sends POST request 2. Data Preparation - Organizes input structure 3. AI Query Optimization - GPT-4.1 Mini refines search query 4. Web Scraping - Bright Data fetches data while bypassing blocks 5. AI Analysis - GPT-4o Mini filters and summarizes result 6. Response - Returns plain text to your cell 8. Logging - Updates logs for monitoring --- π οΈ Setup Instructions Time to deploy: 20 minutes Requirements - n8n instance with public URL - Bright Data account + API key - OpenAI API key - Google account for Apps Script Part 1: n8n Workflow Setup 1. Import this template into your n8n instance 2. Configure Webhook node: - Copy your webhook URL: https://n8n.yourdomain.com/webhook/brightdata-search - Set authentication: Header Auth - Set API key: 12312346 (or create your own) 3. Add OpenAI credentials to AI nodes. 4. Configure Bright Data: Add API credentials 5. Configure Output Language: Manually edit the "Set Variables" Node. 6. Test workflow with manual execution 7. Activate the workflow Part 2: Google Sheets Function 1. Open Google Sheet β Extensions β Apps Script 2. Paste this code: javascript function BRIGHTDATA(prompt, source) { if (!prompt || prompt === "") { return "β Must enter prompt"; } source = source || "google"; // Update with YOUR webhook URL const N8NWEBHOOKURL = "https://your-n8n-domain.com/webhook/brightdata-search"; // Update with YOUR password const APIKEY = "12312346"; let spreadsheetId, sheetName, cellAddress; try { const sheet = SpreadsheetApp.getActiveSheet(); const activeCell = sheet.getActiveCell(); spreadsheetId = SpreadsheetApp.getActiveSpreadsheet().getId(); sheetName = sheet.getName(); cellAddress = activeCell.getA1Notation(); } catch (e) { return "β Cannot identify cell"; } const payload = { prompt: prompt, source: source.toLowerCase(), context: { spreadsheetId: spreadsheetId, sheetName: sheetName, cellAddress: cellAddress, timestamp: new Date().toISOString() } }; const options = { method: "post", contentType: "application/json", payload: JSON.stringify(payload), muteHttpExceptions: true, headers: { "Accept": "text/plain", "key": APIKEY } }; try { const response = UrlFetchApp.fetch(N8NWEBHOOKURL, options); const responseCode = response.getResponseCode(); if (responseCode !== 200) { Logger.log("Error response: " + response.getContentText()); return "β Error " + responseCode; } return response.getContentText(); } catch (error) { Logger.log("Exception: " + error.toString()); return "β Connection error: " + error.toString(); } } function doGet(e) { return ContentService.createTextOutput(JSON.stringify({ status: "alive", message: "Apps Script is running", timestamp: new Date().toISOString() })).setMimeType(ContentService.MimeType.JSON); } 3. Update N8NWEBHOOKURL with your webhook 4. Update APIKEY with your password 5. Save (Ctrl+S / Cmd+S) - Important! 6. Close Apps Script editor --- π‘ Usage Examples =BRIGHTDATA("C3", "What is the current price of the product?") =BRIGHTDATA("D30", "What is the size of this company?") =BRIGHTDATA("A4", "Do this comapny is hiring Developers?") --- π¨ Customization Easy Tweaks - AI Models - Switch to GPT-4o for better optimization - R