Bright Data、OpenAI、Redisを基盤とした高度なマルチソースAIリサーチ
上級
これはMarket Research, AI RAG分野の自動化ワークフローで、43個のノードを含みます。主にIf, Set, Code, Redis, Slackなどのノードを使用。 高度なマルチソースAIリサーチの実装(Bright Data、OpenAI、Redis使用)
前提条件
- •Redisサーバー接続情報
- •Slack Bot Token または Webhook URL
- •HTTP Webhookエンドポイント(n8nが自動生成)
- •ターゲットAPIの認証情報が必要な場合あり
- •OpenAI API Key
使用ノード (43)
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"meta": {
"instanceId": "db30e8ae4100235addbd4638770997b7ef11878d049073c888ba440ca84c55fc"
},
"nodes": [
{
"id": "846f1917-cd8b-47fb-85cb-633f6ff19888",
"name": "Webhook エントリー",
"type": "n8n-nodes-base.webhook",
"position": [
-480,
-48
],
"webhookId": "a163f70d-4812-4100-8ce7-2c9b21ea5fee",
"parameters": {
"path": "advanced-brightdata-search",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode",
"authentication": "headerAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "juW019hiKxiES5uR",
"name": "Header Auth account"
}
},
"typeVersion": 2.1
},
{
"id": "421128ee-be55-44a3-b7fa-f876e2da962a",
"name": "変数設定",
"type": "n8n-nodes-base.set",
"position": [
-256,
-48
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "user-prompt",
"name": "userPrompt",
"type": "string",
"value": "={{ $json.body.source }}"
},
{
"id": "cell-ref",
"name": "cellReference",
"type": "string",
"value": "={{ $json.body.prompt }}"
},
{
"id": "output-lang",
"name": "outputLanguage",
"type": "string",
"value": "={{ $json.body.language || 'English' }}"
},
{
"id": "cache-key",
"name": "cacheKey",
"type": "string",
"value": "={{ $crypto.createHash('md5').update($json.body.prompt + $json.body.source).digest('hex') }}"
},
{
"id": "request-id",
"name": "requestId",
"type": "string",
"value": "={{ $now.format('yyyyMMddHHmmss') }}-{{ $crypto.randomBytes(4).toString('hex') }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "45905849-b08a-471b-8b9c-b6f7e70d478e",
"name": "キャッシュチェック",
"type": "n8n-nodes-base.redis",
"onError": "continueRegularOutput",
"position": [
-48,
-48
],
"parameters": {
"key": "={{ $json.cacheKey }}",
"options": {},
"operation": "get"
},
"typeVersion": 1
},
{
"id": "f3874e1f-190a-4fe4-9dd8-ed53307436e1",
"name": "キャッシュヒット確認",
"type": "n8n-nodes-base.if",
"position": [
176,
-48
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2
},
"combinator": "and",
"conditions": [
{
"id": "cache-exists",
"operator": {
"type": "string",
"operation": "exists"
},
"leftValue": "={{ $('Cache Check').item.json.value }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "d24a360c-7785-402c-bdfa-8bf39d7f7321",
"name": "レート制限チェック",
"type": "n8n-nodes-base.code",
"position": [
-320,
320
],
"parameters": {
"jsCode": "// Rate limiting: max 60 requests per minute\nconst Redis = require('ioredis');\nconst redis = new Redis($credentials.redis);\n\nconst key = `rate_limit:${new Date().toISOString().slice(0, 16)}`; // per minute\nconst count = await redis.incr(key);\nawait redis.expire(key, 60);\n\nif (count > 60) {\n throw new Error('Rate limit exceeded. Max 60 requests per minute.');\n}\n\nreturn [{ \n json: { \n ...items[0].json,\n rateLimit: { current: count, max: 60 }\n }\n}];"
},
"typeVersion": 2
},
{
"id": "4cf998be-1901-420e-9a76-60d2a796bf34",
"name": "マルチステップ推論エージェント",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-144,
320
],
"parameters": {
"text": "=Analyze this query and determine if it needs to be broken into sub-queries:\n\nQuery: {{ $json.userPrompt }}\nContext: {{ $json.cellReference }}\n\nIf the query is complex (e.g., \"compare X and Y\", \"analyze trends\", \"multiple data points\"), break it into 2-5 focused sub-queries.\nIf the query is simple (e.g., \"what is X\", \"who is the CEO\"), return it as-is.\n\nReturn JSON format:\n{\n \"isComplex\": boolean,\n \"subQueries\": [\"query1\", \"query2\", ...] or [original_query],\n \"reasoning\": \"explanation\"\n}",
"options": {
"systemMessage": "You are an expert at breaking down complex information requests into logical sub-queries. Each sub-query should be independently searchable and answerable."
},
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "ce0a3979-bbcf-49a8-a438-e95b3eff820a",
"name": "推論出力パーサー",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
0,
528
],
"parameters": {
"jsonSchemaExample": "{\n \"isComplex\": false,\n \"subQueries\": [\"query\"],\n \"reasoning\": \"\"\n}"
},
"typeVersion": 1.3
},
{
"id": "e55d6a52-d91f-4ad3-aef8-652ebfc1e009",
"name": "GPT-4o (推論)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-144,
528
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o"
},
"options": {
"temperature": 0.3
}
},
"typeVersion": 1.2
},
{
"id": "84d9ece9-9b1f-49f3-a2e7-6d5b62181a67",
"name": "サブクエリ分割",
"type": "n8n-nodes-base.splitOut",
"position": [
144,
320
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "163afc77-961a-4cca-adaa-0c638f9962f3",
"name": "クエリ最適化エージェント",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
320,
320
],
"parameters": {
"text": "=Optimize this search query for maximum relevance:\n\nQuery: {{ $json.subQuery }}\nOriginal context: {{ $('Set Variables').item.json.cellReference }}\nTarget language: {{ $('Set Variables').item.json.outputLanguage }}\nCurrent date: {{ $now.format('yyyy-MM-dd') }}\n\nCreate an optimized search query in English that will:\n1. Include relevant keywords and synonyms\n2. Add temporal context if needed (e.g., \"2025\", \"latest\")\n3. Prioritize authoritative sources\n4. Use proper quotation marks for exact phrases\n\nReturn JSON:\n{\n \"optimizedQuery\": \"the optimized query\",\n \"suggestedCountry\": \"us\" or \"il\",\n \"expectedSources\": [\"type of sources like news, official, financial\"]\n}",
"options": {
"systemMessage": "You are a search query optimization expert. Transform user queries into optimal search engine queries."
},
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "8f5eecc0-f32a-4641-993c-3afd00973524",
"name": "最適化出力パーサー",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
464,
528
],
"parameters": {
"jsonSchemaExample": "{\n \"optimizedQuery\": \"\",\n \"suggestedCountry\": \"us\",\n \"expectedSources\": []\n}"
},
"typeVersion": 1.3
},
{
"id": "7d46d961-ebcd-4298-a6f3-a37bc02ede22",
"name": "GPT-4o Mini (最適化)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
320,
528
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {
"temperature": 0.1
}
},
"typeVersion": 1.2
},
{
"id": "e21dd153-dd0b-4552-9c86-909a6bed554c",
"name": "マルチソース検索エージェント",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
672,
320
],
"parameters": {
"text": "=Search for the top 5 most relevant links:\n\nQuery: {{ $json.output.optimizedQuery }}\nCountry: {{ $json.output.suggestedCountry }}\nExpected sources: {{ $json.output.expectedSources.join(', ') }}\n\nUse search_engine to find the best results. Return EXACTLY 5 URLs.\n\nPriority sources:\n- Official websites (company, government)\n- Major news outlets (Reuters, Bloomberg, WSJ)\n- Financial reports (SEC filings, investor relations)\n- Wikipedia, Crunchbase for entity info\n- Academic or research sources\n\nAvoid:\n- Social media posts\n- Forums and discussion boards\n- Ads and promotional content\n- Low-quality or clickbait sites\n\nReturn JSON format:\n{\n \"links\": [\n {\n \"url\": \"https://...\",\n \"title\": \"page title\",\n \"snippet\": \"description\",\n \"sourceType\": \"news|official|financial|reference\",\n \"credibilityScore\": 1-10\n }\n ]\n}",
"options": {
"systemMessage": "You are an expert at finding the most credible and relevant sources. Always return exactly 5 links ranked by relevance and credibility."
},
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "acdaf58b-e349-40fa-9e4a-537ad1208053",
"name": "Bright Data MCPツール",
"type": "@n8n/n8n-nodes-langchain.mcpClientTool",
"position": [
768,
528
],
"parameters": {
"include": "selected",
"options": {
"timeout": 120000
},
"endpointUrl": "https://mcp.brightdata.com/mcp?token=YOUR_TOKEN_HERE&pro=1",
"includeTools": [
"search_engine"
],
"serverTransport": "httpStreamable"
},
"typeVersion": 1.1
},
{
"id": "bf992e5e-cece-4203-888c-96dfabe54571",
"name": "検索出力パーサー",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
896,
528
],
"parameters": {
"jsonSchemaExample": "{\n \"links\": [\n {\n \"url\": \"\",\n \"title\": \"\",\n \"snippet\": \"\",\n \"sourceType\": \"news\",\n \"credibilityScore\": 8\n }\n ]\n}"
},
"typeVersion": 1.3
},
{
"id": "f7cc2f0d-16f6-4fcf-aa5e-29b644328e2e",
"name": "GPT-4o (検索)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
624,
528
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "ce606d56-37bb-484d-b0d5-5008968c38cb",
"name": "並列スクレイピング用URL分割",
"type": "n8n-nodes-base.splitOut",
"position": [
1008,
320
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "4384e82b-12b8-4f41-858b-af2efd67c965",
"name": "並列ウェブスクレイピング",
"type": "n8n-nodes-base.httpRequest",
"position": [
1232,
320
],
"parameters": {
"url": "https://api.brightdata.com/request",
"method": "POST",
"options": {
"timeout": 30000,
"batching": {
"batch": {
"batchSize": 5
}
}
},
"sendBody": true,
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "zone",
"value": "mcp_unlocker"
},
{
"name": "url",
"value": "={{ $json.url }}"
},
{
"name": "format",
"value": "json"
},
{
"name": "method",
"value": "GET"
},
{
"name": "country",
"value": "={{ $('Query Optimizer Agent').item.json.output.suggestedCountry }}"
},
{
"name": "data_format",
"value": "markdown"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_TOKEN_HERE"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "d784c590-720b-429c-b580-dea0ae7b80be",
"name": "高度なデータ抽出・分析",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"onError": "continueRegularOutput",
"position": [
1408,
320
],
"parameters": {
"text": "=## Input Data\n\n### Original Query:\n{{ $('Set Variables').item.json.cellReference }} - {{ $('Set Variables').item.json.userPrompt }}\n\n### Source Information:\n- URL: {{ $('Split URLs for Parallel Scraping').item.json.url }}\n- Title: {{ $('Split URLs for Parallel Scraping').item.json.title }}\n- Source Type: {{ $('Split URLs for Parallel Scraping').item.json.sourceType }}\n- Credibility Score: {{ $('Split URLs for Parallel Scraping').item.json.credibilityScore }}/10\n\n### Scraped Content:\n{{ $json.body }}\n\n---\n\n## Your Task\n\nExtract and analyze the following from the content:\n\n1. **Answer to Query**: Direct answer to the user's question\n2. **Key Facts**: Important facts, numbers, dates\n3. **Entities**: People, organizations, locations, products mentioned\n4. **Sentiment**: Overall tone (positive/neutral/negative) and confidence\n5. **Data Tables**: Any structured data (format as markdown tables)\n6. **Quotes**: Important quotes with attribution\n7. **Dates**: Relevant dates and temporal information\n\n## Output Format (JSON)\n\nReturn ONLY valid JSON:\n\n{\n \"answer\": \"Direct answer to the query\",\n \"summary\": \"Concise summary (max 300 chars)\",\n \"keyFacts\": [\"fact1\", \"fact2\", ...],\n \"entities\": {\n \"people\": [\"name1\", \"name2\"],\n \"organizations\": [\"org1\", \"org2\"],\n \"locations\": [\"loc1\"],\n \"products\": [\"product1\"]\n },\n \"sentiment\": {\n \"overall\": \"positive|neutral|negative\",\n \"confidence\": 0.0-1.0,\n \"reasoning\": \"brief explanation\"\n },\n \"dataTables\": [\n {\n \"title\": \"table name\",\n \"markdown\": \"| Col1 | Col2 |\\n|------|------|\\n| val1 | val2 |\"\n }\n ],\n \"quotes\": [\n {\n \"text\": \"quote text\",\n \"attribution\": \"person or source\"\n }\n ],\n \"dates\": [\"2025-01-15\", \"Q4 2024\"],\n \"relevanceScore\": 1-10\n}",
"batching": {},
"messages": {
"messageValues": [
{
"message": "=You are an advanced data extraction AI specialized in:\n- Extracting structured data from unstructured text\n- Named entity recognition (NER)\n- Sentiment analysis\n- Information synthesis\n- Fact verification\n\n**Critical Rules:**\n1. Extract ONLY information present in the source\n2. Do NOT hallucinate or infer information\n3. Translate to {{ $('Set Variables').item.json.outputLanguage }} if needed\n4. Be precise with numbers, dates, and facts\n5. Always return valid JSON\n6. If data is not found, use empty arrays or null\n\n**Quality Standards:**\n- Accuracy > Completeness\n- Cite facts directly from source\n- Flag uncertainties in reasoning fields"
}
]
},
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "edf8b49b-8732-4361-9e9b-82c9460c9e1b",
"name": "抽出出力パーサー",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1552,
512
],
"parameters": {
"jsonSchemaExample": "{\n \"answer\": \"\",\n \"summary\": \"\",\n \"keyFacts\": [],\n \"entities\": {\n \"people\": [],\n \"organizations\": [],\n \"locations\": [],\n \"products\": []\n },\n \"sentiment\": {\n \"overall\": \"neutral\",\n \"confidence\": 0.5,\n \"reasoning\": \"\"\n },\n \"dataTables\": [],\n \"quotes\": [],\n \"dates\": [],\n \"relevanceScore\": 5\n}"
},
"typeVersion": 1.3
},
{
"id": "be3ff2d2-2ed9-42fc-8f50-3665eee61c97",
"name": "GPT-4o (抽出)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1408,
512
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "1d1b3367-ff6b-4d93-9ef6-a380e074eb29",
"name": "ソース検証エージェント",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1664,
320
],
"parameters": {
"text": "=Validate this source and extracted information:\n\n**Source Details:**\n- URL: {{ $('Split URLs for Parallel Scraping').item.json.url }}\n- Claimed Type: {{ $('Split URLs for Parallel Scraping').item.json.sourceType }}\n- Initial Credibility: {{ $('Split URLs for Parallel Scraping').item.json.credibilityScore }}/10\n\n**Extracted Data:**\n{{ JSON.stringify($json.output, null, 2) }}\n\n**Validation Criteria:**\n1. Is the domain trustworthy? (check TLD, known sources)\n2. Does the content match the expected source type?\n3. Are facts verifiable and internally consistent?\n4. Any red flags? (clickbait, bias, outdated info)\n5. Does the relevance score make sense?\n\nReturn JSON:\n{\n \"isValid\": boolean,\n \"validationScore\": 1-10,\n \"trustLevel\": \"high|medium|low\",\n \"redFlags\": [\"flag1\", \"flag2\"],\n \"recommendations\": \"how to use this source\",\n \"shouldInclude\": boolean\n}",
"options": {
"systemMessage": "You are a source validation expert. Assess credibility, detect bias, and flag unreliable information."
},
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "c48f6265-c2ba-4b61-a64c-e7f490aec495",
"name": "検証出力パーサー",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1808,
512
],
"parameters": {
"jsonSchemaExample": "{\n \"isValid\": true,\n \"validationScore\": 8,\n \"trustLevel\": \"high\",\n \"redFlags\": [],\n \"recommendations\": \"\",\n \"shouldInclude\": true\n}"
},
"typeVersion": 1.3
},
{
"id": "84ab425a-8e7b-417c-a2cc-e36be2518699",
"name": "GPT-4o Mini (検証)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1664,
512
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {
"temperature": 0.2
}
},
"typeVersion": 1.2
},
{
"id": "0e5049ce-8def-4366-b25a-f7d85b0cdf43",
"name": "有効ソースフィルタリング",
"type": "n8n-nodes-base.if",
"position": [
1936,
320
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2
},
"combinator": "and",
"conditions": [
{
"id": "should-include",
"operator": {
"type": "boolean",
"operation": "true"
},
"leftValue": "={{ $json.output.shouldInclude }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "35d175db-b777-474a-b91d-144e9843adc7",
"name": "全結果集約",
"type": "n8n-nodes-base.aggregate",
"position": [
2112,
192
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1
},
{
"id": "e0fc624c-e72a-438f-9c1b-414fe2ed4d1a",
"name": "コンテキスト対応スマート要約",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2256,
192
],
"parameters": {
"text": "=## Input: Multi-Source Analysis\n\n**Original Query:**\n{{ $('Set Variables').item.json.cellReference }} - {{ $('Set Variables').item.json.userPrompt }}\n\n**Output Language:** {{ $('Set Variables').item.json.outputLanguage }}\n\n**Extracted Data from {{ $json.extractedData.length }} Sources:**\n{{ JSON.stringify($json.extractedData, null, 2) }}\n\n---\n\n## Task: Create Comprehensive Summary\n\nAnalyze all sources and create a final answer that:\n\n1. **Directly answers the user's question**\n2. **Synthesizes information from multiple sources**\n3. **Prioritizes high-credibility sources**\n4. **Includes key facts, entities, and sentiment**\n5. **Notes any conflicting information**\n6. **Stays within 400 characters for main answer**\n7. **Provides extended details separately**\n\n## Output Format (JSON)\n\n{\n \"mainAnswer\": \"400 char summary in {{ $('Set Variables').item.json.outputLanguage }}\",\n \"confidence\": 0.0-1.0,\n \"keyInsights\": [\"insight1\", \"insight2\", \"insight3\"],\n \"consensus\": \"areas where sources agree\",\n \"conflicts\": \"areas where sources disagree (if any)\",\n \"entities\": {\n \"people\": [],\n \"organizations\": [],\n \"locations\": [],\n \"products\": []\n },\n \"overallSentiment\": \"positive|neutral|negative\",\n \"importantDates\": [],\n \"dataHighlights\": [\n {\n \"metric\": \"name\",\n \"value\": \"value\",\n \"source\": \"which source\"\n }\n ],\n \"sourcesUsed\": 5,\n \"extendedSummary\": \"Detailed summary with all key information\"\n}",
"options": {
"systemMessage": "=You are an expert analyst who synthesizes information from multiple sources into clear, accurate summaries in {{ $('Set Variables').item.json.outputLanguage }}.\n\n**Principles:**\n- Accuracy first: Never fabricate information\n- Source ranking: Weight by credibility scores\n- Conflict resolution: Note disagreements, don't hide them\n- Completeness: Include all relevant entities and facts\n- Clarity: Write for non-experts\n- Brevity: Main answer ≤ 400 chars"
},
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "c07929b4-9180-4f69-922d-11435dbcc9d3",
"name": "要約出力パーサー",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
2400,
400
],
"parameters": {
"jsonSchemaExample": "{\n \"mainAnswer\": \"\",\n \"confidence\": 0.8,\n \"keyInsights\": [],\n \"consensus\": \"\",\n \"conflicts\": \"\",\n \"entities\": {\n \"people\": [],\n \"organizations\": [],\n \"locations\": [],\n \"products\": []\n },\n \"overallSentiment\": \"neutral\",\n \"importantDates\": [],\n \"dataHighlights\": [],\n \"sourcesUsed\": 0,\n \"extendedSummary\": \"\"\n}"
},
"typeVersion": 1.3
},
{
"id": "be44751d-d33b-46d6-ada9-e0ab4ae118ac",
"name": "GPT-4o (要約)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2256,
400
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o"
},
"options": {
"temperature": 0.3
}
},
"typeVersion": 1.2
},
{
"id": "8bb399be-0edd-4ed2-b491-876b9024c3bc",
"name": "キャッシュ保存",
"type": "n8n-nodes-base.redis",
"onError": "continueRegularOutput",
"position": [
2544,
192
],
"parameters": {
"key": "={{ $('Set Variables').item.json.cacheKey }}",
"ttl": 3600,
"value": "={{ JSON.stringify($json.output) }}",
"expire": true,
"operation": "set"
},
"typeVersion": 1
},
{
"id": "dea2d0ed-b5f2-4140-98eb-f6ba2fb5d0be",
"name": "出力準備",
"type": "n8n-nodes-base.set",
"position": [
2768,
192
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "webhook-response",
"name": "webhookResponse",
"type": "string",
"value": "={{ $json.output.mainAnswer }}"
},
{
"id": "slack-message",
"name": "slackMessage",
"type": "string",
"value": "=✅ *Search Complete*\\n\\n*Query:* {{ $('Set Variables').item.json.cellReference }} - {{ $('Set Variables').item.json.userPrompt }}\\n\\n*Answer:* {{ $json.output.mainAnswer }}\\n\\n*Confidence:* {{ Math.round($json.output.confidence * 100) }}%\\n*Sources Used:* {{ $json.output.sourcesUsed }}\\n*Sentiment:* {{ $json.output.overallSentiment }}\\n\\n_Request ID: {{ $('Set Variables').item.json.requestId }}_"
},
{
"id": "email-subject",
"name": "emailSubject",
"type": "string",
"value": "=Search Results: {{ $('Set Variables').item.json.cellReference }}"
},
{
"id": "email-body",
"name": "emailBody",
"type": "string",
"value": "=<h2>Advanced Web Research Results</h2>\\n\\n<p><strong>Query:</strong> {{ $('Set Variables').item.json.userPrompt }}</p>\\n<p><strong>Context:</strong> {{ $('Set Variables').item.json.cellReference }}</p>\\n\\n<h3>Main Answer</h3>\\n<p>{{ $json.output.mainAnswer }}</p>\\n\\n<h3>Key Insights</h3>\\n<ul>\\n{{ $json.output.keyInsights.map(i => '<li>' + i + '</li>').join('\\n') }}\\n</ul>\\n\\n<h3>Extended Summary</h3>\\n<p>{{ $json.output.extendedSummary }}</p>\\n\\n<h3>Data Highlights</h3>\\n<ul>\\n{{ $json.output.dataHighlights.map(d => '<li><strong>' + d.metric + ':</strong> ' + d.value + ' <em>(from ' + d.source + ')</em></li>').join('\\n') }}\\n</ul>\\n\\n<h3>Entities Mentioned</h3>\\n<ul>\\n<li><strong>People:</strong> {{ $json.output.entities.people.join(', ') }}</li>\\n<li><strong>Organizations:</strong> {{ $json.output.entities.organizations.join(', ') }}</li>\\n<li><strong>Locations:</strong> {{ $json.output.entities.locations.join(', ') }}</li>\\n</ul>\\n\\n<hr>\\n<p><em>Generated: {{ $now.format('yyyy-MM-dd HH:mm:ss') }}</em></p>\\n<p><em>Confidence: {{ Math.round($json.output.confidence * 100) }}%</em></p>\\n<p><em>Sources Analyzed: {{ $json.output.sourcesUsed }}</em></p>"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "92028c09-3097-4046-ac6e-d843d313336f",
"name": "Webhook への応答",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
2992,
80
],
"parameters": {
"options": {
"responseHeaders": {
"entries": [
{
"name": "Content-Type",
"value": "text/plain; charset=utf-8"
}
]
}
},
"respondWith": "text",
"responseBody": "={{ $json.webhookResponse }}"
},
"typeVersion": 1.4
},
{
"id": "35e531fe-47a8-43dc-8ac8-e08b7c9cdf82",
"name": "Slack 通知送信",
"type": "n8n-nodes-base.slack",
"onError": "continueRegularOutput",
"position": [
2992,
208
],
"webhookId": "7fd47177-bd3f-4f02-ab6c-6c50d80898e3",
"parameters": {
"text": "={{ $json.slackMessage }}",
"otherOptions": {}
},
"typeVersion": 2.3
},
{
"id": "edbf4987-666e-437d-878f-213a3207bf42",
"name": "メールレポート送信",
"type": "n8n-nodes-base.emailSend",
"onError": "continueRegularOutput",
"position": [
2992,
352
],
"webhookId": "60d3ca6e-fb55-4b24-9b92-f32236ad401f",
"parameters": {
"options": {},
"subject": "={{ $json.emailSubject }}",
"toEmail": "={{ $('Webhook Entry').item.json.body.notifyEmail || 'team@yourdomain.com' }}",
"fromEmail": "noreply@yourdomain.com"
},
"typeVersion": 2.1
},
{
"id": "f78d7f9a-5de3-4721-bd06-cfd34a542c93",
"name": "データテーブル記録",
"type": "n8n-nodes-base.dataTable",
"onError": "continueRegularOutput",
"position": [
2992,
496
],
"parameters": {
"operation": "append",
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "YOUR_DATATABLE_ID"
}
},
"typeVersion": 1
},
{
"id": "0824c24a-81b3-40b6-a2f7-0595a1e7cf84",
"name": "キャッシュ結果返却",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
400,
-96
],
"parameters": {
"options": {
"responseHeaders": {
"entries": [
{
"name": "X-Cache",
"value": "HIT"
}
]
}
},
"respondWith": "json",
"responseBody": "={{ JSON.parse($('Cache Check').item.json.value) }}"
},
"typeVersion": 1.4
},
{
"id": "b846aa93-0079-46d4-bb52-345ffca70784",
"name": "キャッシュヒット記録",
"type": "n8n-nodes-base.dataTable",
"onError": "continueRegularOutput",
"position": [
400,
-240
],
"parameters": {
"operation": "append",
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "YOUR_DATATABLE_ID"
}
},
"typeVersion": 1
},
{
"id": "00f81dfd-a518-45c4-acc6-a49483e4f357",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-704,
-368
],
"parameters": {
"color": 5,
"width": 1296,
"height": 512,
"content": "# Input Handling and Caching\n\n## Receives webhook request, sets variables like prompt and cache key, checks Redis cache for existing results, and returns cached response if hit, ensuring efficient reuse of prior computations.\n\n"
},
"typeVersion": 1
},
{
"id": "67c24041-ed99-4b3e-aee4-9344509089f2",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-704,
144
],
"parameters": {
"width": 1296,
"height": 704,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Query Decomposition and Optimization\n\n## Applies rate limiting, uses AI to break complex queries into sub-queries, optimizes each for search relevance with keywords and context, preparing targeted English queries for authoritative sources. \n\n"
},
"typeVersion": 1
},
{
"id": "d295efd7-0d94-4312-a07d-0f2583217d90",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
592,
-368
],
"parameters": {
"color": 4,
"width": 768,
"height": 1216,
"content": "# Multi-Source Search and Scraping\n\n\n## Performs AI-driven search via Bright Data for top 5 credible URLs, splits for parallel scraping to extract markdown content from official, news, and financial sites, avoiding low-quality sources. \n\n"
},
"typeVersion": 1
},
{
"id": "fe362a54-d47a-48f8-b921-071dda8af5f9",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1360,
-368
],
"parameters": {
"color": 6,
"width": 1152,
"height": 1216,
"content": "# Data Extraction, Validation, and Synthesis\n\n## Extracts structured data (facts, entities, sentiment) from scraped content using AI, validates source credibility and filters valid ones, aggregates results, and generates a comprehensive summary with confidence scores. "
},
"typeVersion": 1
},
{
"id": "10e799b2-2920-4d4b-8701-386bbb7f91e8",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
2512,
-368
],
"parameters": {
"color": 2,
"width": 848,
"height": 1216,
"content": "# Output and Notifications\n## Caches final summary, prepares responses for webhook, sends Slack notifications and email reports with insights, and logs to data table for tracking, completing the research workflow. \n\n"
},
"typeVersion": 1
},
{
"id": "7dc6b369-e35f-4d8c-a6ed-1631ccca185d",
"name": "付箋5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1728,
-368
],
"parameters": {
"color": 4,
"width": 1024,
"height": 1216,
"content": "# 🔍 Advanced AI-Powered Web Research System\n\n**Created by [Daniel Shashko](https://linkedin.com/in/daniel-shashko)**\n\nThis enterprise-grade workflow transforms natural language queries into comprehensive, multi-source research reports using AI agents, parallel web scraping, and intelligent data synthesis.\n\n## Key Features\n✅ **Smart Query Processing** - AI breaks complex questions into optimized sub-queries \n✅ **Multi-Source Intelligence** - Searches and scrapes 5 credible sources in parallel \n✅ **Intelligent Extraction** - Extracts facts, entities, sentiment, and structured data \n✅ **Source Validation** - AI validates credibility and filters unreliable content \n✅ **Redis Caching** - 1-hour cache for instant responses to duplicate queries \n✅ **Rate Limiting** - 60 requests/minute protection \n✅ **Multi-Channel Output** - Webhook response, Slack, email reports, and data logging\n\n## Tech Stack\n- **AI Models**: GPT-4o (reasoning, search, extraction) + GPT-4o-mini (optimization, validation)\n- **Search**: Bright Data MCP Tool + Web Scraping API\n- **Cache**: Redis with 1-hour TTL\n- **Output**: Webhook, Slack, Email, n8n DataTable\n\n## 📦 Companion Files\n**Note**: This workflow works with an accompanying [**`google-apps-script.js`**](https://gist.github.com/danishashko/fb509b733aebf5538676ca80b19fa28b) file for Google Sheets integration.\n\n## Workflow Stages\n1. **Input & Cache** → Webhook → Variables → Cache Check → Return if hit\n2. **Query Processing** → Rate limit → AI reasoning → Query optimization \n3. **Search & Scrape** → Multi-source search → Parallel scraping (5 URLs)\n4. **Analysis** → Data extraction → Source validation → Filter & aggregate\n5. **Synthesis** → AI summarizer → Cache storage → Multi-channel output\n\n## API Input Format\n```json\n{\n \"prompt\": \"Your question here\",\n \"source\": \"Context or cell reference\", \n \"language\": \"English\",\n \"notifyEmail\": \"user@domain.com\"\n}\n```\n\n## Response Format\n- **Main Answer**: ≤400 chars in requested language\n- **Confidence Score**: 0.0-1.0\n- **Key Insights**: Top 3-5 findings\n- **Entities**: People, orgs, locations, products\n- **Extended Summary**: Full detailed analysis\n- **Data Highlights**: Key metrics with sources"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"45905849-b08a-471b-8b9c-b6f7e70d478e": {
"main": [
[
{
"node": "f3874e1f-190a-4fe4-9dd8-ed53307436e1",
"type": "main",
"index": 0
}
]
]
},
"421128ee-be55-44a3-b7fa-f876e2da962a": {
"main": [
[
{
"node": "45905849-b08a-471b-8b9c-b6f7e70d478e",
"type": "main",
"index": 0
}
]
]
},
"846f1917-cd8b-47fb-85cb-633f6ff19888": {
"main": [
[
{
"node": "421128ee-be55-44a3-b7fa-f876e2da962a",
"type": "main",
"index": 0
}
]
]
},
"8bb399be-0edd-4ed2-b491-876b9024c3bc": {
"main": [
[
{
"node": "dea2d0ed-b5f2-4140-98eb-f6ba2fb5d0be",
"type": "main",
"index": 0
}
]
]
},
"f3874e1f-190a-4fe4-9dd8-ed53307436e1": {
"main": [
[
{
"node": "0824c24a-81b3-40b6-a2f7-0595a1e7cf84",
"type": "main",
"index": 0
},
{
"node": "b846aa93-0079-46d4-bb52-345ffca70784",
"type": "main",
"index": 0
}
],
[
{
"node": "d24a360c-7785-402c-bdfa-8bf39d7f7321",
"type": "main",
"index": 0
}
]
]
},
"f7cc2f0d-16f6-4fcf-aa5e-29b644328e2e": {
"ai_languageModel": [
[
{
"node": "e21dd153-dd0b-4552-9c86-909a6bed554c",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"dea2d0ed-b5f2-4140-98eb-f6ba2fb5d0be": {
"main": [
[
{
"node": "92028c09-3097-4046-ac6e-d843d313336f",
"type": "main",
"index": 0
},
{
"node": "35e531fe-47a8-43dc-8ac8-e08b7c9cdf82",
"type": "main",
"index": 0
},
{
"node": "edbf4987-666e-437d-878f-213a3207bf42",
"type": "main",
"index": 0
},
{
"node": "f78d7f9a-5de3-4721-bd06-cfd34a542c93",
"type": "main",
"index": 0
}
]
]
},
"d24a360c-7785-402c-bdfa-8bf39d7f7321": {
"main": [
[
{
"node": "4cf998be-1901-420e-9a76-60d2a796bf34",
"type": "main",
"index": 0
}
]
]
},
"84d9ece9-9b1f-49f3-a2e7-6d5b62181a67": {
"main": [
[
{
"node": "163afc77-961a-4cca-adaa-0c638f9962f3",
"type": "main",
"index": 0
}
]
]
},
"e55d6a52-d91f-4ad3-aef8-652ebfc1e009": {
"ai_languageModel": [
[
{
"node": "4cf998be-1901-420e-9a76-60d2a796bf34",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"be3ff2d2-2ed9-42fc-8f50-3665eee61c97": {
"ai_languageModel": [
[
{
"node": "d784c590-720b-429c-b580-dea0ae7b80be",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"be44751d-d33b-46d6-ada9-e0ab4ae118ac": {
"ai_languageModel": [
[
{
"node": "e0fc624c-e72a-438f-9c1b-414fe2ed4d1a",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"acdaf58b-e349-40fa-9e4a-537ad1208053": {
"ai_tool": [
[
{
"node": "e21dd153-dd0b-4552-9c86-909a6bed554c",
"type": "ai_tool",
"index": 0
}
]
]
},
"0e5049ce-8def-4366-b25a-f7d85b0cdf43": {
"main": [
[
{
"node": "35d175db-b777-474a-b91d-144e9843adc7",
"type": "main",
"index": 0
}
]
]
},
"bf992e5e-cece-4203-888c-96dfabe54571": {
"ai_outputParser": [
[
{
"node": "e21dd153-dd0b-4552-9c86-909a6bed554c",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"35d175db-b777-474a-b91d-144e9843adc7": {
"main": [
[
{
"node": "e0fc624c-e72a-438f-9c1b-414fe2ed4d1a",
"type": "main",
"index": 0
}
]
]
},
"4384e82b-12b8-4f41-858b-af2efd67c965": {
"main": [
[
{
"node": "d784c590-720b-429c-b580-dea0ae7b80be",
"type": "main",
"index": 0
}
]
]
},
"163afc77-961a-4cca-adaa-0c638f9962f3": {
"main": [
[
{
"node": "e21dd153-dd0b-4552-9c86-909a6bed554c",
"type": "main",
"index": 0
}
]
]
},
"c07929b4-9180-4f69-922d-11435dbcc9d3": {
"ai_outputParser": [
[
{
"node": "e0fc624c-e72a-438f-9c1b-414fe2ed4d1a",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"7d46d961-ebcd-4298-a6f3-a37bc02ede22": {
"ai_languageModel": [
[
{
"node": "163afc77-961a-4cca-adaa-0c638f9962f3",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"8f5eecc0-f32a-4641-993c-3afd00973524": {
"ai_outputParser": [
[
{
"node": "163afc77-961a-4cca-adaa-0c638f9962f3",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"ce0a3979-bbcf-49a8-a438-e95b3eff820a": {
"ai_outputParser": [
[
{
"node": "4cf998be-1901-420e-9a76-60d2a796bf34",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"1d1b3367-ff6b-4d93-9ef6-a380e074eb29": {
"main": [
[
{
"node": "0e5049ce-8def-4366-b25a-f7d85b0cdf43",
"type": "main",
"index": 0
}
]
]
},
"edf8b49b-8732-4361-9e9b-82c9460c9e1b": {
"ai_outputParser": [
[
{
"node": "d784c590-720b-429c-b580-dea0ae7b80be",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"84ab425a-8e7b-417c-a2cc-e36be2518699": {
"ai_languageModel": [
[
{
"node": "1d1b3367-ff6b-4d93-9ef6-a380e074eb29",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"c48f6265-c2ba-4b61-a64c-e7f490aec495": {
"ai_outputParser": [
[
{
"node": "1d1b3367-ff6b-4d93-9ef6-a380e074eb29",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"e21dd153-dd0b-4552-9c86-909a6bed554c": {
"main": [
[
{
"node": "ce606d56-37bb-484d-b0d5-5008968c38cb",
"type": "main",
"index": 0
}
]
]
},
"4cf998be-1901-420e-9a76-60d2a796bf34": {
"main": [
[
{
"node": "84d9ece9-9b1f-49f3-a2e7-6d5b62181a67",
"type": "main",
"index": 0
}
]
]
},
"e0fc624c-e72a-438f-9c1b-414fe2ed4d1a": {
"main": [
[
{
"node": "8bb399be-0edd-4ed2-b491-876b9024c3bc",
"type": "main",
"index": 0
}
]
]
},
"ce606d56-37bb-484d-b0d5-5008968c38cb": {
"main": [
[
{
"node": "4384e82b-12b8-4f41-858b-af2efd67c965",
"type": "main",
"index": 0
}
]
]
},
"d784c590-720b-429c-b580-dea0ae7b80be": {
"main": [
[
{
"node": "1d1b3367-ff6b-4d93-9ef6-a380e074eb29",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級 - 市場調査, AI RAG検索拡張
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
AI による Google Sheets ウェブリサーチ(GPT と Bright Data)
AI ベースの Google スプレッドシート Web ページ調査 (GPT および Bright Data)
Set
Webhook
Data Table
+
Set
Webhook
Data Table
22 ノードElay Guez
市場調査
n8nノードの探索(可視化リファレンスライブラリ内)
n8nノードを可視化リファレンスライブラリで探索
If
Ftp
Set
+
If
Ftp
Set
113 ノードI versus AI
その他
ペットショップ 4
ペットショップ予約AIエージェント
If
Set
Code
+
If
Set
Code
187 ノードBruno Dias
人工知能
[テンプレート] AIペットショップ v8
AIペットショップアシスタント - GPT-4o、Googleカレンダー、WhatsApp/Instagram/Facebookを統合
If
N8n
Set
+
If
N8n
Set
244 ノードAmanda Benks
営業
AI エージェント レストラン [テンプレート]
🤖 WhatsApp、Instagram、MessengerのAIレストランアシスタント
If
N8n
Set
+
If
N8n
Set
239 ノードAmanda Benks
その他
デリバリー ハンバーガーショップ MVP
🤖 レストランと配送の自動化を支援するAI駆動型WhatsAppアシスタント
If
Set
Code
+
If
Set
Code
152 ノードBruno Dias
ワークフロー情報
難易度
上級
ノード数43
カテゴリー2
ノードタイプ18
作成者
Daniel Shashko
@tomaxAI automation specialist and a marketing enthusiast. More than 6 years of experience in SEO/GEO. Senior SEO at Bright Data.
外部リンク
n8n.ioで表示 →
このワークフローを共有