Twitterのプロフィール名からプロフィールを検索し、投稿をスクレイピングしてコンテンツをAIで分析し、Google Sheetsに保存
上級
これはAI, Marketing分野の自動化ワークフローで、22個のノードを含みます。主にIf, Set, Code, Form, Htmlなどのノードを使用、AI技術を活用したスマート自動化を実現。 Bright DataとGeminiを使って名称でTwitterの投稿を検索・スクレイピング・分析する
前提条件
- •Google Sheets API認証情報
- •Google Gemini API Key
使用ノード (22)
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "AbtPK2RrW116HBH3",
"meta": {
"instanceId": "71eb5622cf8abac565805540c0900dbae437dddbda45bf1b87bf3bfeea26393c",
"templateCredsSetupCompleted": true
},
"name": "Find Twitter Profile by Name, Scrape Posts & Analyze Content with AI, save in Google Sheets.",
"tags": [],
"nodes": [
{
"id": "3f37efb9-0ba6-474a-b5df-d453bb79d8e6",
"name": "ウェブサイトから本文とタイトルを抽出",
"type": "n8n-nodes-base.html",
"position": [
660,
0
],
"parameters": {
"options": {
"trimValues": true
},
"operation": "extractHtmlContent",
"dataPropertyName": "body",
"extractionValues": {
"values": [
{
"key": "title",
"cssSelector": "title"
},
{
"key": "body",
"cssSelector": "body"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "89d9a5af-f79a-44ad-87c3-99a410fe52eb",
"name": "ユーザーがフォームを完了したとき",
"type": "n8n-nodes-base.formTrigger",
"position": [
0,
0
],
"webhookId": "41d0bffa-f5ca-4df7-b757-ca5a1e472b8a",
"parameters": {
"options": {
"path": "search-user",
"ignoreBots": true,
"buttonLabel": "Get References"
},
"formTitle": "Twitter (X) posts analyzer",
"formFields": {
"values": [
{
"fieldLabel": "Person Fullname",
"placeholder": "Complete the fullname",
"requiredField": true
},
{
"fieldLabel": "Analyze Posts From Date",
"placeholder": "2025-05-01"
},
{
"fieldLabel": "Analyze Posts To Date",
"placeholder": "2025-05-20"
}
]
},
"responseMode": "lastNode",
"formDescription": "Complete the data of the person you want to analyze.\n\nA personalized follow-up email with insights and suggested outreach steps will be sent to you:"
},
"typeVersion": 2.2
},
{
"id": "9cc99302-3a97-471b-8260-b2d0dda37be5",
"name": "URLを編集 Google 検索",
"type": "n8n-nodes-base.set",
"position": [
220,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "6b95685b-3286-4643-bfa1-6335d3f8cb39",
"name": "google_search",
"type": "string",
"value": "=https://www.google.com/search?q=site%3Ax.com+{{ encodeURIComponent($json[\"Person Fullname\"].trim()) }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ae25a27d-4631-4131-ac42-ab39ba423806",
"name": "Google Gemini チャットモデル",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
900,
180
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.0-flash"
},
"typeVersion": 1
},
{
"id": "dca04cd0-4519-41ae-9b0f-3c202a72cac3",
"name": "構造化出力パーサー",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1040,
180
],
"parameters": {
"jsonSchemaExample": "[{\n \"username\": \"string\",\n \"name\": \"string\",\n \"url\": \"string\",\n \"description\": \"string\"\n}]\n"
},
"typeVersion": 1.2
},
{
"id": "d26a1cf1-c131-4a78-b968-4d2280c7dd7d",
"name": "フォームが見つかりません",
"type": "n8n-nodes-base.form",
"position": [
1260,
160
],
"webhookId": "a509f577-231f-435f-b3c2-0fed718f0cc8",
"parameters": {
"operation": "completion",
"respondWith": "showText",
"responseText": "=We didn't found X Profile for \"{{ $('When User Completes Form').item.json[\"Person Fullname\"] }} \""
},
"typeVersion": 1
},
{
"id": "d05c6134-02ba-4e75-b062-0994c1802ba1",
"name": "X プロフィールが見つかりましたか?",
"type": "n8n-nodes-base.if",
"position": [
1260,
0
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "645d85d3-c5cc-4e51-a989-075c0a851449",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.output[0]['url'] }}",
"rightValue": 1
},
{
"id": "b44e6a86-9a9b-4d3e-b9c8-cf75bba8ed03",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "d2f963d7-4bb9-41d6-b698-028d76e08bd5",
"name": "エラーを確認",
"type": "n8n-nodes-base.if",
"position": [
1320,
440
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "645d85d3-c5cc-4e51-a989-075c0a851449",
"operator": {
"type": "string",
"operation": "notExists",
"singleValue": true
},
"leftValue": "={{ $json.error }}",
"rightValue": 1
},
{
"id": "b44e6a86-9a9b-4d3e-b9c8-cf75bba8ed03",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "34dfe012-f2b0-4921-aff7-2c97eafc206e",
"name": "Google Gemini チャットモデル1",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
1780,
660
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.0-flash"
},
"typeVersion": 1
},
{
"id": "223f4ef1-2ed0-48e3-a7b6-e2ecb762756f",
"name": "フォームエラー",
"type": "n8n-nodes-base.form",
"position": [
1320,
680
],
"webhookId": "a509f577-231f-435f-b3c2-0fed718f0cc8",
"parameters": {
"operation": "completion",
"respondWith": "showText",
"responseText": "=Bright Data error for \"{{ $('When User Completes Form').item.json[\"Person Fullname\"] }} \""
},
"typeVersion": 1
},
{
"id": "28c124cd-dd4b-4a8d-888e-d39709425920",
"name": "Google スプレッドシート - 投稿と要約を追加",
"type": "n8n-nodes-base.googleSheets",
"position": [
2140,
440
],
"parameters": {
"columns": {
"value": {
"name": "={{ $('When User Completes Form').item.json['Person Fullname'] }}",
"posts": "={{ $('Code').item.json.posts }}",
"x_url": "={{ $('Parse X Url').item.json.output[0]['url'] }}",
"end_date": "={{ $('When User Completes Form').item.json['Analyze Posts To Date'] }}",
"ai_summary": "={{ $json.text }}",
"start_date": "={{ $('When User Completes Form').item.json['Analyze Posts From Date'] }}"
},
"schema": [
{
"id": "name",
"type": "string",
"display": true,
"required": false,
"displayName": "name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "start_date",
"type": "string",
"display": true,
"required": false,
"displayName": "start_date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "end_date",
"type": "string",
"display": true,
"required": false,
"displayName": "end_date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "x_url",
"type": "string",
"display": true,
"required": false,
"displayName": "x_url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "posts",
"type": "string",
"display": true,
"required": false,
"displayName": "posts",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ai_summary",
"type": "string",
"display": true,
"required": false,
"displayName": "ai_summary",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1V1J7E5EKofN9Uhjg_kItpK0Wjh3Ga_To2k_QYj7hcPA/edit#gid=0",
"cachedResultName": "results"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1V1J7E5EKofN9Uhjg_kItpK0Wjh3Ga_To2k_QYj7hcPA",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1V1J7E5EKofN9Uhjg_kItpK0Wjh3Ga_To2k_QYj7hcPA/edit?usp=drivesdk",
"cachedResultName": "X parsed posts"
}
},
"typeVersion": 4.3,
"alwaysOutputData": true
},
{
"id": "abc5d30c-2d5c-4186-ac62-32129f33618e",
"name": "投稿を分析",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
1760,
440
],
"parameters": {
"text": "={{$json}}",
"messages": {
"messageValues": [
{
"message": "=Analyze these twitter posts - Detect interests, tone, sentiments, common topics, popularity and return summary"
}
]
},
"promptType": "define"
},
"typeVersion": 1.6
},
{
"id": "daee9dbd-c65a-40cf-a84e-b8b9eec4e108",
"name": "X URLを解析",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
880,
0
],
"parameters": {
"text": "={{$('Extract Body and Title from Website').item.json[\"body\"]}}",
"messages": {
"messageValues": [
{
"message": "=Extract x.com (Twitter) profile from google results. Return a result property with unique parsed result in JSON including a property \"match\" if user matches the data entry values \"{{ $('When User Completes Form').item.json[\"Person Fullname\"].trim() }}\""
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.6
},
{
"id": "b0ae5f34-dcd3-424e-b85b-6a339f701857",
"name": "スナップショットコンテンツ",
"type": "n8n-nodes-brightdata.brightData",
"position": [
880,
440
],
"parameters": {
"resource": "marketplaceDataset",
"operation": "getSnapshotContent",
"snapshot_id": "={{ $('Snapshot Request').item.json.snapshot_id }}"
},
"typeVersion": 1
},
{
"id": "d697b7b2-3c50-414e-a4d4-8f5f6f582cf9",
"name": "コード",
"type": "n8n-nodes-base.code",
"position": [
1540,
440
],
"parameters": {
"jsCode": "const input = items[0].json;\nconst posts = input.items || [];\n\nconst extracted = posts.map(post => {\n const quoted = post.quoted_post || {};\n const taggedUsers = post.tagged_users || [];\n\n return {\n date_posted: post.date_posted || null,\n description: post.description || null,\n hashtags: post.hashtags || [],\n likes: post.likes || null,\n\n quoted_date_posted: quoted.date_posted || null,\n quoted_description: quoted.description || null,\n\n quotes: post.quotes || 0,\n replies: post.replies || 0,\n reposts: post.reposts || 0,\n\n profile_names: taggedUsers.map(user => user.profile_name || null),\n\n views: post.views || 0,\n };\n});\n\nreturn [\n {\n json: {\n posts: extracted\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "ba5770f0-db44-4032-bd45-1939b5f2740b",
"name": "30秒待機 - Bright Dataをポーリング",
"type": "n8n-nodes-base.wait",
"position": [
220,
440
],
"webhookId": "8005a2b3-2195-479e-badb-d90e4240e699",
"parameters": {
"amount": 30
},
"executeOnce": false,
"typeVersion": 1.1
},
{
"id": "fe2adace-a369-44ef-b048-eb90f309ee92",
"name": "条件分岐 - スナップショットのステータス確認(データ準備完了かどうか)",
"type": "n8n-nodes-base.if",
"position": [
660,
440
],
"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": "ready"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "72326f8d-d381-4620-a3a7-1bed7389a146",
"name": "スナップショットリクエスト",
"type": "n8n-nodes-brightdata.brightData",
"position": [
0,
440
],
"parameters": {
"resource": "marketplaceDataset",
"operation": "filterDataset",
"dataset_id": {
"__rl": true,
"mode": "list",
"value": "gd_lwxkxvnf1cynvib9co",
"cachedResultName": "X (formerly Twitter) - Posts"
},
"filter_type": "filters_group",
"filters_group": "={\"operator\":\"and\",\"filters\":[{\"name\":\"url\",\"operator\":\"includes\",\"value\":\"{{ $json[\"output\"][0]['url'] }}\"},\n{\"name\":\"date_posted\",\"operator\":\">=\",\"value\":\"{{ $('When User Completes Form').item.json[\"Analyze Posts From Date\"] }}\"},\n{\"name\":\"date_posted\",\"operator\":\"<=\",\"value\":\"{{ $('When User Completes Form').item.json[\"Analyze Posts To Date\"] }}\"}]}"
},
"typeVersion": 1
},
{
"id": "665656d5-78e4-480c-a472-ade64f43609c",
"name": "スナップショット進捗状況",
"type": "n8n-nodes-brightdata.brightData",
"position": [
440,
440
],
"parameters": {
"resource": "marketplaceDataset",
"operation": "getSnapshotMetadata",
"snapshot_id": "={{ $json.snapshot_id }}"
},
"typeVersion": 1
},
{
"id": "f346f9b0-f5f0-452e-932f-b27d956e3383",
"name": "BrightData",
"type": "n8n-nodes-brightdata.brightData",
"position": [
440,
0
],
"parameters": {
"url": "={{ $json.google_search }}",
"zone": {
"__rl": true,
"mode": "list",
"value": "web_unlocker1"
},
"format": "json",
"country": {
"__rl": true,
"mode": "list",
"value": "us"
}
},
"typeVersion": 1
},
{
"id": "3fe4b2e8-4cc6-4e23-a2da-c8c668537036",
"name": "エラーを確認1",
"type": "n8n-nodes-base.if",
"position": [
1100,
440
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "645d85d3-c5cc-4e51-a989-075c0a851449",
"operator": {
"type": "array",
"operation": "notExists",
"singleValue": true
},
"leftValue": "={{ $json.items}}",
"rightValue": "Snapshot is building."
},
{
"id": "b44e6a86-9a9b-4d3e-b9c8-cf75bba8ed03",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "4b5aa6d7-9328-46fa-b333-6b068c5ffa79",
"name": "30秒待機 - スナップショット準備完了を確認",
"type": "n8n-nodes-base.wait",
"position": [
880,
680
],
"webhookId": "8005a2b3-2195-479e-badb-d90e4240e699",
"parameters": {
"amount": 30
},
"executeOnce": false,
"typeVersion": 1.1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "a93d240e-59b4-49a9-84ce-60fdffc2b48f",
"connections": {
"d697b7b2-3c50-414e-a4d4-8f5f6f582cf9": {
"main": [
[
{
"node": "abc5d30c-2d5c-4186-ac62-32129f33618e",
"type": "main",
"index": 0
}
]
]
},
"f346f9b0-f5f0-452e-932f-b27d956e3383": {
"main": [
[
{
"node": "3f37efb9-0ba6-474a-b5df-d453bb79d8e6",
"type": "main",
"index": 0
}
]
]
},
"daee9dbd-c65a-40cf-a84e-b8b9eec4e108": {
"main": [
[
{
"node": "d05c6134-02ba-4e75-b062-0994c1802ba1",
"type": "main",
"index": 0
}
]
]
},
"abc5d30c-2d5c-4186-ac62-32129f33618e": {
"main": [
[
{
"node": "28c124cd-dd4b-4a8d-888e-d39709425920",
"type": "main",
"index": 0
}
]
]
},
"d26a1cf1-c131-4a78-b968-4d2280c7dd7d": {
"main": [
[]
]
},
"d2f963d7-4bb9-41d6-b698-028d76e08bd5": {
"main": [
[
{
"node": "d697b7b2-3c50-414e-a4d4-8f5f6f582cf9",
"type": "main",
"index": 0
}
],
[
{
"node": "223f4ef1-2ed0-48e3-a7b6-e2ecb762756f",
"type": "main",
"index": 0
}
]
]
},
"b0ae5f34-dcd3-424e-b85b-6a339f701857": {
"main": [
[
{
"node": "3fe4b2e8-4cc6-4e23-a2da-c8c668537036",
"type": "main",
"index": 0
}
]
]
},
"72326f8d-d381-4620-a3a7-1bed7389a146": {
"main": [
[
{
"node": "ba5770f0-db44-4032-bd45-1939b5f2740b",
"type": "main",
"index": 0
}
]
]
},
"3fe4b2e8-4cc6-4e23-a2da-c8c668537036": {
"main": [
[
{
"node": "4b5aa6d7-9328-46fa-b333-6b068c5ffa79",
"type": "main",
"index": 0
}
],
[
{
"node": "d2f963d7-4bb9-41d6-b698-028d76e08bd5",
"type": "main",
"index": 0
}
]
]
},
"665656d5-78e4-480c-a472-ade64f43609c": {
"main": [
[
{
"node": "fe2adace-a369-44ef-b048-eb90f309ee92",
"type": "main",
"index": 0
}
]
]
},
"d05c6134-02ba-4e75-b062-0994c1802ba1": {
"main": [
[
{
"node": "72326f8d-d381-4620-a3a7-1bed7389a146",
"type": "main",
"index": 0
}
],
[
{
"node": "d26a1cf1-c131-4a78-b968-4d2280c7dd7d",
"type": "main",
"index": 0
}
]
]
},
"9cc99302-3a97-471b-8260-b2d0dda37be5": {
"main": [
[
{
"node": "f346f9b0-f5f0-452e-932f-b27d956e3383",
"type": "main",
"index": 0
}
]
]
},
"ae25a27d-4631-4131-ac42-ab39ba423806": {
"ai_languageModel": [
[
{
"node": "daee9dbd-c65a-40cf-a84e-b8b9eec4e108",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"dca04cd0-4519-41ae-9b0f-3c202a72cac3": {
"ai_outputParser": [
[
{
"node": "daee9dbd-c65a-40cf-a84e-b8b9eec4e108",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"89d9a5af-f79a-44ad-87c3-99a410fe52eb": {
"main": [
[
{
"node": "9cc99302-3a97-471b-8260-b2d0dda37be5",
"type": "main",
"index": 0
}
]
]
},
"34dfe012-f2b0-4921-aff7-2c97eafc206e": {
"ai_languageModel": [
[
{
"node": "abc5d30c-2d5c-4186-ac62-32129f33618e",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"ba5770f0-db44-4032-bd45-1939b5f2740b": {
"main": [
[
{
"node": "665656d5-78e4-480c-a472-ade64f43609c",
"type": "main",
"index": 0
}
]
]
},
"3f37efb9-0ba6-474a-b5df-d453bb79d8e6": {
"main": [
[
{
"node": "daee9dbd-c65a-40cf-a84e-b8b9eec4e108",
"type": "main",
"index": 0
}
]
]
},
"4b5aa6d7-9328-46fa-b333-6b068c5ffa79": {
"main": [
[
{
"node": "b0ae5f34-dcd3-424e-b85b-6a339f701857",
"type": "main",
"index": 0
}
]
]
},
"fe2adace-a369-44ef-b048-eb90f309ee92": {
"main": [
[
{
"node": "b0ae5f34-dcd3-424e-b85b-6a339f701857",
"type": "main",
"index": 0
}
],
[
{
"node": "ba5770f0-db44-4032-bd45-1939b5f2740b",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級 - 人工知能, マーケティング
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
コンペティタ価格照会・レポートジェネレーター
Bright Dataを基にコンペティタ価格照会とレポートジェネレーター
If
Set
Code
+
If
Set
Code
19 ノードGleb D
人工知能
Bright Data、Gemini AI、Google Sheetsを使用したキーワード別Crunchbaseスタートアップ分析
Bright Data、Gemini AI、Google Sheetsを使ってキーワード別にCrunchbaseのスタートアップ企業を分析
If
Code
Wait
+
If
Code
Wait
13 ノードGleb D
人工知能
Bright Data キーワードメールニュースレターとAI要約
Bright DataキーワードメールニュースレターとAI要約
If
Code
Wait
+
If
Code
Wait
13 ノードGleb D
人工知能
TikTok投稿自動化エージェント V3.1
🚀 Gemini AIと自動投稿でポッドキャストをバイラルTikTokクリップに変換 ✅
If
Set
Code
+
If
Set
Code
54 ノードMateo Fiorito Rocha
デザイン
ウイルスのなタイトル/サムネイル生成
感染拡散型YouTubeタイトルとサム네イル作成の自動化(FLUX.1 + Apify)
If
Set
Code
+
If
Set
Code
41 ノードNasser
人工知能
n8nノードの探索(可視化リファレンスライブラリ内)
n8nノードを可視化リファレンスライブラリで探索
If
Ftp
Set
+
If
Ftp
Set
113 ノードI versus AI
その他