Reddit Community Data Gathering
Using this workflow to gather data from top posts on different communities
Shared 11/29/2025
9 views
Visual Workflow
JSON Code
{
"meta": {},
"nodes": [
{
"id": "228f9ccc-0f78-4fb6-aab8-e9f3c2ff54d2",
"name": "Subreddit list",
"type": "n8n-nodes-base.code",
"position": [
-1312,
304
],
"parameters": {
"jsCode": "return [\n { json: { subreddit: \"Hosting\" } },\n { json: { subreddit: \"cloud\" } },\n { json: { subreddit: \"webhosting\" } },\n { json: { subreddit: \"selfhosted\" } },\n { json: { subreddit: \"VPS\" } },\n { json: { subreddit: \"sysadmin\" } }\n];\n"
},
"typeVersion": 1
},
{
"id": "ed188275-5b98-4932-9446-0f19affdf119",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
-912,
304
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ccfd29d0-7645-4a6c-b46d-a36ba405c8f1",
"name": "currentDate",
"type": "string",
"value": "={{ $now }}"
},
{
"id": "1d50372c-fe91-4967-9a35-2575fb370c2d",
"name": "subreddit",
"type": "string",
"value": "={{ $json.subreddit }}"
},
{
"id": "87c9d8b6-a506-4880-b795-fda16d527315",
"name": "selftext",
"type": "string",
"value": "={{ $json.selftext }}"
},
{
"id": "85e66f17-d730-4340-a591-ca2e7ee9a779",
"name": "title",
"type": "string",
"value": "={{ $json.title }}"
},
{
"id": "b4e70215-330e-4e18-85bc-9e0e59bd5825",
"name": "ups",
"type": "string",
"value": "={{ $json.ups }}"
},
{
"id": "914d15e2-0a56-4cb6-869a-2b72eab34384",
"name": "url",
"type": "string",
"value": "={{ $json.url }}"
},
{
"id": "2f2cf0bc-c134-4f03-ac42-409bd6472f2e",
"name": "num_comments",
"type": "string",
"value": "={{ $json.num_comments }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "d3bff321-a6b8-4edd-8034-19b65f94ada3",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
384,
496
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "e173888b-7d73-4b66-8711-98d596d74c79",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-1760,
304
],
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"typeVersion": 1.2
},
{
"id": "4f838154-fa65-4c18-8e87-a9aaad7a5fd3",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1568,
240
],
"parameters": {
"color": 3,
"width": 3072,
"height": 480,
"content": "Top Posts"
},
"typeVersion": 1
},
{
"id": "eae2dcf1-9800-46fa-8262-e7fc4e4078df",
"name": "Send a text message1",
"type": "n8n-nodes-base.telegram",
"position": [
1552,
624
],
"parameters": {
"text": "={{ $json.telegramMessage }}",
"chatId": "YOUR_TELEGRAM_CHAT_ID",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "",
"name": "Jup"
}
},
"typeVersion": 1.2
},
{
"id": "b7933fd5-eb82-4755-947a-85dd61b7d01b",
"name": "Workflow Completion1",
"type": "n8n-nodes-base.code",
"position": [
832,
624
],
"parameters": {
"jsCode": "const processedRows = $input.all().length;\n\n// Create a more detailed message for Telegram\nconst message = `✅ *Keyword Extraction Completed*\n\n📊 *Results:*\n• Processed: ${processedRows} rows\n• Keywords added to Google Sheet #Reddit_Top_Posts\n• Time: ${new Date().toLocaleString()}\n\n🎯 *Workflow Status:* SUCCESS`;\n\nreturn [{\n json: {\nmessage: `Workflow completed successfully on these subreddits: Hosting, cloud, webhosting, selfhosted, VPS, sysadmin. Processed ${processedRows} rows.`,\n processedRows: processedRows,\n timestamp: new Date().toISOString(),\n telegramMessage: message\n }\n}];"
},
"typeVersion": 2
},
{
"id": "9c1b9fdf-14d2-4149-81c4-4b65d92b3c33",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1568,
736
],
"parameters": {
"color": 4,
"width": 3072,
"height": 464,
"content": "Hot Posts\n"
},
"typeVersion": 1
},
{
"id": "1944d761-2eaf-4f12-8c6b-6fef5a32bf63",
"name": "Edit Fields1",
"type": "n8n-nodes-base.set",
"position": [
-912,
832
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "27a9c57c-5698-41f4-a721-ee88b4b27552",
"name": "=currentDate",
"type": "string",
"value": "={{ $now }}"
},
{
"id": "f53c0eb9-eb90-4462-88df-579073d10178",
"name": "subreddit",
"type": "string",
"value": "={{ $json.subreddit }}"
},
{
"id": "24519eff-1ef2-43e9-9e66-1c072e541271",
"name": "title",
"type": "string",
"value": "={{ $json.title }}"
},
{
"id": "a7764f06-c218-454d-9836-a9d7a751c658",
"name": "selftext",
"type": "string",
"value": "={{ $json.selftext }}"
},
{
"id": "0217bd07-1e2a-43d0-a8ad-81a1158e6767",
"name": "ups",
"type": "number",
"value": "={{ $json.ups }}"
},
{
"id": "b385f530-0ed4-4a4a-895b-f12284a72326",
"name": "num_comments",
"type": "number",
"value": "={{ $json.num_comments }}"
},
{
"id": "6e00d844-b5c4-4f00-96b5-f2f178215f8c",
"name": "url",
"type": "string",
"value": "={{ $json.url }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "8b21a912-d549-4b0f-85a9-1cb5432e5bd0",
"name": "Append row in sheet2",
"type": "n8n-nodes-base.googleSheets",
"position": [
-512,
832
],
"parameters": {
"columns": {
"value": {
"ups": "={{ $json.ups }}",
"url": "={{ $json.url }}",
"title": "={{ $json.title }}",
"selftext": "={{ $json.selftext }}",
"subreddit": "={{ $json.subreddit }}",
"currentDate": "={{ $json.currentDate }}",
"num_comments": "={{ $json.num_comments }}"
},
"schema": [
{
"id": "subreddit",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "subreddit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selftext",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "selftext",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ups",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ups",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "num_comments",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "num_comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keywords",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "currentDate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "currentDate",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"merge"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 768052301,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=768052301",
"cachedResultName": "Reddit 2nd"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "356a8433-b050-4b0d-8ed7-173160cab77b",
"name": "Get many posts1",
"type": "n8n-nodes-base.reddit",
"position": [
-1088,
832
],
"parameters": {
"limit": 5,
"filters": {
"category": "top"
},
"operation": "getAll",
"subreddit": "={{ $json.subreddit }}"
},
"credentials": {
"redditOAuth2Api": {
"id": "",
"name": "Reddit account"
}
},
"typeVersion": 1
},
{
"id": "67cd4456-b82c-4bf4-ac2f-3eee4f9a56f4",
"name": "Wait3",
"type": "n8n-nodes-base.wait",
"position": [
-1504,
832
],
"parameters": {
"unit": "minutes",
"amount": 30
},
"typeVersion": 1.1
},
{
"id": "9efd9fef-cc99-4f00-8dfc-1a0a67377271",
"name": "Append row in sheet1",
"type": "n8n-nodes-base.googleSheets",
"position": [
-512,
304
],
"parameters": {
"columns": {
"value": {
"ups": "={{ $json.ups }}",
"url": "={{ $json.url }}",
"title": "={{ $json.title }}",
"selftext": "={{ $json.selftext }}",
"subreddit": "={{ $json.subreddit }}",
"currentDate": "={{ $json.currentDate }}",
"num_comments": "={{ $json.num_comments }}"
},
"schema": [
{
"id": "subreddit",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "subreddit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selftext",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "selftext",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ups",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ups",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "num_comments",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "num_comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keywords",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "currentDate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "currentDate",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"merge"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1969805435,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1969805435",
"cachedResultName": "Reddit 1st"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "b1dad12e-8d35-4065-8a5d-7529c5d21e1c",
"name": "Get many posts",
"type": "n8n-nodes-base.reddit",
"position": [
-1088,
304
],
"parameters": {
"limit": 5,
"filters": {
"category": "top"
},
"operation": "getAll",
"subreddit": "={{ $json.subreddit }}"
},
"credentials": {
"redditOAuth2Api": {
"id": "",
"name": "Reddit account"
}
},
"typeVersion": 1
},
{
"id": "a767e49f-74d4-4e8e-95df-8d71d66c8272",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-272,
304
],
"parameters": {
"width": 560,
"height": 400,
"content": "Deduplication"
},
"typeVersion": 1
},
{
"id": "16dd3b02-0276-4c85-a139-4a8551f37ec4",
"name": "Code in Python (Beta)1",
"type": "n8n-nodes-base.code",
"position": [
-704,
304
],
"parameters": {
"language": "python",
"pythonCode": "from datetime import datetime\n\nfor item in items:\n item[\"json\"][\"date\"] = datetime.utcnow().isoformat()\n\nreturn items"
},
"typeVersion": 2
},
{
"id": "b25c9a71-6d5c-4c24-8c70-36799d8d9a85",
"name": "Wait1",
"type": "n8n-nodes-base.wait",
"position": [
384,
976
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "8f1310af-4230-468b-af70-6b3f304fc743",
"name": "Workflow Completion",
"type": "n8n-nodes-base.code",
"position": [
832,
1072
],
"parameters": {
"jsCode": "const processedRows = $input.all().length;\n\n// Create a more detailed message for Telegram\nconst message = `✅ *Keyword Extraction Completed*\n\n📊 *Results:*\n• Processed: ${processedRows} rows\n• Keywords added to Google Sheet #Reddit_Hot_Posts\n• Time: ${new Date().toLocaleString()}\n\n🎯 *Workflow Status:* SUCCESS`;\n\nreturn [{\n json: {\n message: `Workflow completed successfully on these subreddits: kubernetes, docker, homelab, linuxadmin, terraform, n8n. Processed ${processedRows} rows.`,\n processedRows: processedRows,\n timestamp: new Date().toISOString(),\n telegramMessage: message\n }\n}];"
},
"typeVersion": 2
},
{
"id": "ebc2fa36-643c-4586-ac4e-c4f06e885e66",
"name": "Send a text message",
"type": "n8n-nodes-base.telegram",
"position": [
1552,
1072
],
"parameters": {
"text": "={{ $json.telegramMessage }}",
"chatId": "YOUR_TELEGRAM_CHAT_ID",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "",
"name": "Jup"
}
},
"typeVersion": 1.2
},
{
"id": "41d55b38-11ed-4387-bb29-14ffa68f9efa",
"name": "Code in Python (Beta)2",
"type": "n8n-nodes-base.code",
"position": [
-704,
832
],
"parameters": {
"language": "python",
"pythonCode": "from datetime import datetime\n\nfor item in items:\n item[\"json\"][\"date\"] = datetime.utcnow().isoformat()\n\nreturn items"
},
"typeVersion": 2
},
{
"id": "fc4aecc0-2fe4-4045-9140-2ee21b1cef18",
"name": "Append row in sheet3",
"type": "n8n-nodes-base.googleSheets",
"position": [
144,
976
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "subreddit",
"type": "string",
"display": true,
"required": false,
"displayName": "subreddit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selftext",
"type": "string",
"display": true,
"required": false,
"displayName": "selftext",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ups",
"type": "string",
"display": true,
"required": false,
"displayName": "ups",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "num_comments",
"type": "string",
"display": true,
"required": false,
"displayName": "num_comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keywords",
"type": "string",
"display": true,
"required": false,
"displayName": "Keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "currentDate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "currentDate",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 768052301,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=768052301",
"cachedResultName": "Reddit 2nd"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "e0aee16b-f76b-40fc-b2a5-b447cc985485",
"name": "Clear sheet1",
"type": "n8n-nodes-base.googleSheets",
"position": [
144,
832
],
"parameters": {
"operation": "clear",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 768052301,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=768052301",
"cachedResultName": "Reddit 2nd"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "1592598b-6304-4eea-96b6-b52ba948b7a2",
"name": "Code in Python (Beta)3",
"type": "n8n-nodes-base.code",
"position": [
-32,
976
],
"parameters": {
"language": "python",
"pythonCode": "# n8n Python Code node\n# Removes duplicate rows based on 'url' column\n\nseen_urls = set()\nunique_rows = []\n\nfor item in items:\n row = item[\"json\"]\n url = str(row.get(\"url\", \"\")).strip().lower()\n \n if url and url not in seen_urls:\n seen_urls.add(url)\n unique_rows.append({\"json\": row})\n\nreturn unique_rows"
},
"typeVersion": 2
},
{
"id": "1b7600c2-cfd3-4352-88a3-2c82c525aff3",
"name": "Get row(s) in sheet3",
"type": "n8n-nodes-base.googleSheets",
"position": [
-208,
976
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 768052301,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=768052301",
"cachedResultName": "Reddit 2nd"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "6880702d-9bb0-4a67-ae9f-6fa00e0eddb7",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-272,
784
],
"parameters": {
"width": 560,
"height": 400,
"content": "Deduplication"
},
"typeVersion": 1
},
{
"id": "cf3f2711-449a-4465-a043-ecb11632887d",
"name": "Edit Fields2",
"type": "n8n-nodes-base.set",
"position": [
-912,
1296
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ccfd29d0-7645-4a6c-b46d-a36ba405c8f1",
"name": "currentDate",
"type": "string",
"value": "={{ $now }}"
},
{
"id": "1d50372c-fe91-4967-9a35-2575fb370c2d",
"name": "subreddit",
"type": "string",
"value": "={{ $json.subreddit }}"
},
{
"id": "87c9d8b6-a506-4880-b795-fda16d527315",
"name": "selftext",
"type": "string",
"value": "={{ $json.selftext }}"
},
{
"id": "85e66f17-d730-4340-a591-ca2e7ee9a779",
"name": "title",
"type": "string",
"value": "={{ $json.title }}"
},
{
"id": "b4e70215-330e-4e18-85bc-9e0e59bd5825",
"name": "ups",
"type": "string",
"value": "={{ $json.ups }}"
},
{
"id": "914d15e2-0a56-4cb6-869a-2b72eab34384",
"name": "url",
"type": "string",
"value": "={{ $json.url }}"
},
{
"id": "2f2cf0bc-c134-4f03-ac42-409bd6472f2e",
"name": "num_comments",
"type": "string",
"value": "={{ $json.num_comments }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "2dd3d263-0688-431e-879c-f687aaa51ebe",
"name": "Wait2",
"type": "n8n-nodes-base.wait",
"position": [
384,
1488
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "a59a38ac-9584-49d1-bdf5-3fd870697683",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1568,
1232
],
"parameters": {
"color": 3,
"width": 3072,
"height": 496,
"content": "Top Posts"
},
"typeVersion": 1
},
{
"id": "98fc118a-ba5a-4224-b657-ba29dea928b1",
"name": "Send a text message2",
"type": "n8n-nodes-base.telegram",
"position": [
1552,
1600
],
"parameters": {
"text": "={{ $json.telegramMessage }}",
"chatId": "YOUR_TELEGRAM_CHAT_ID",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "",
"name": "Jup"
}
},
"typeVersion": 1.2
},
{
"id": "e45c0507-24a4-4dca-8a2c-4ff670e33612",
"name": "Workflow Completion2",
"type": "n8n-nodes-base.code",
"position": [
832,
1600
],
"parameters": {
"jsCode": "const processedRows = $input.all().length;\n\n// Create a more detailed message for Telegram\nconst message = `✅ *Keyword Extraction Completed*\n\n📊 *Results:*\n• Processed: ${processedRows} rows\n• Keywords on topics: azure, aws, hetzner, datacenter, devops, datascience. #Reddit_Top_Posts\n• Time: ${new Date().toLocaleString()}\n\n🎯 *Workflow Status:* SUCCESS`;\n\nreturn [{\n json: {\nmessage: `Workflow completed successfully. Processed ${processedRows} rows.`,\n processedRows: processedRows,\n timestamp: new Date().toISOString(),\n telegramMessage: message\n }\n}];"
},
"typeVersion": 2
},
{
"id": "fbb4484a-83a0-4fa1-a7f1-d0c03cd3cefa",
"name": "Append row in sheet4",
"type": "n8n-nodes-base.googleSheets",
"position": [
-512,
1296
],
"parameters": {
"columns": {
"value": {
"ups": "={{ $json.ups }}",
"url": "={{ $json.url }}",
"title": "={{ $json.title }}",
"selftext": "={{ $json.selftext }}",
"subreddit": "={{ $json.subreddit }}",
"currentDate": "={{ $json.currentDate }}",
"num_comments": "={{ $json.num_comments }}"
},
"schema": [
{
"id": "subreddit",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "subreddit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selftext",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "selftext",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ups",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ups",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "num_comments",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "num_comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keywords",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "currentDate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "currentDate",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"merge"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1209014008,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1209014008",
"cachedResultName": "Reddit 3th"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "140ec710-f669-42de-9721-8e66809216ae",
"name": "Append row in sheet5",
"type": "n8n-nodes-base.googleSheets",
"position": [
160,
1488
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "subreddit",
"type": "string",
"display": true,
"required": false,
"displayName": "subreddit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selftext",
"type": "string",
"display": true,
"required": false,
"displayName": "selftext",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ups",
"type": "string",
"display": true,
"required": false,
"displayName": "ups",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "num_comments",
"type": "string",
"display": true,
"required": false,
"displayName": "num_comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keywords",
"type": "string",
"display": true,
"required": false,
"displayName": "Keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "currentDate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "currentDate",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1209014008,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1209014008",
"cachedResultName": "Reddit 3th"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "092a9093-d637-4425-a8e3-96106493c6ed",
"name": "Clear sheet2",
"type": "n8n-nodes-base.googleSheets",
"position": [
160,
1344
],
"parameters": {
"operation": "clear",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1209014008,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1209014008",
"cachedResultName": "Reddit 3th"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "7f4b242c-f394-4ee5-a587-15c5e131ff87",
"name": "Code in Python (Beta)4",
"type": "n8n-nodes-base.code",
"position": [
-16,
1488
],
"parameters": {
"language": "python",
"pythonCode": "# n8n Python Code node\n# Removes duplicate rows based on 'url' column\n\nseen_urls = set()\nunique_rows = []\n\nfor item in items:\n row = item[\"json\"]\n url = str(row.get(\"url\", \"\")).strip().lower()\n \n if url and url not in seen_urls:\n seen_urls.add(url)\n unique_rows.append({\"json\": row})\n\nreturn unique_rows"
},
"typeVersion": 2
},
{
"id": "e30813d0-cb9d-4fcb-b315-19adc5bc9ecd",
"name": "Get row(s) in sheet5",
"type": "n8n-nodes-base.googleSheets",
"position": [
-208,
1488
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1209014008,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1209014008",
"cachedResultName": "Reddit 3th"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "568a0f43-e5ca-4b17-8c90-4b60fadfe3e3",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-272,
1296
],
"parameters": {
"width": 560,
"height": 400,
"content": "Deduplication"
},
"typeVersion": 1
},
{
"id": "1cfd47e6-02e3-4786-ab7c-b8ec9f4fb8ce",
"name": "Code in Python (Beta)5",
"type": "n8n-nodes-base.code",
"position": [
-704,
1296
],
"parameters": {
"language": "python",
"pythonCode": "from datetime import datetime\n\nfor item in items:\n item[\"json\"][\"date\"] = datetime.utcnow().isoformat()\n\nreturn items"
},
"typeVersion": 2
},
{
"id": "3f1ad039-b844-47e2-865d-bdc82f2cc639",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-944,
1248
],
"parameters": {
"color": 6,
"width": 576,
"height": 240,
"content": "Add Time"
},
"typeVersion": 1
},
{
"id": "41be338c-bdf1-4bdb-b69b-7ba32b2fc474",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-944,
784
],
"parameters": {
"color": 6,
"width": 576,
"height": 240,
"content": "Add Time"
},
"typeVersion": 1
},
{
"id": "44d474b0-0734-4aa0-ad08-6e15a758f371",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
-944,
256
],
"parameters": {
"color": 6,
"width": 576,
"height": 240,
"content": "Add Time"
},
"typeVersion": 1
},
{
"id": "8e2c8d4e-5ca2-487b-b0e9-fed2e23a9ecb",
"name": "Subreddit list2",
"type": "n8n-nodes-base.code",
"position": [
-1312,
1296
],
"parameters": {
"jsCode": "return [\n { json: { subreddit: \"azure\" } },\n { json: { subreddit: \"aws\" } },\n { json: { subreddit: \"hetzner\" } },\n { json: { subreddit: \"datacenter\" } },\n { json: { subreddit: \"devops\" } },\n { json: { subreddit: \"datascience\" } }\n];\n"
},
"typeVersion": 1
},
{
"id": "b4d33670-7037-4d05-8da0-37dbdc5a7aaf",
"name": "Get many posts3",
"type": "n8n-nodes-base.reddit",
"position": [
-1088,
1296
],
"parameters": {
"limit": 5,
"filters": {
"category": "top"
},
"operation": "getAll",
"subreddit": "={{ $json.subreddit }}"
},
"credentials": {
"redditOAuth2Api": {
"id": "",
"name": "Reddit account"
}
},
"typeVersion": 1
},
{
"id": "0bd34c83-3626-4298-947e-bae08a339210",
"name": "Wait4",
"type": "n8n-nodes-base.wait",
"position": [
-1504,
1296
],
"parameters": {
"unit": "minutes",
"amount": 30
},
"typeVersion": 1.1
},
{
"id": "b79c2bb9-88cb-447a-a8ec-454b457cbf95",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1840,
240
],
"parameters": {
"color": 2,
"height": 240,
"content": "Start"
},
"typeVersion": 1
},
{
"id": "c518b3e7-8ea4-4483-8b02-edc9522533e4",
"name": "Subreddit list1",
"type": "n8n-nodes-base.code",
"position": [
-1312,
832
],
"parameters": {
"jsCode": "return [\n { json: { subreddit: \"kubernetes\" } },\n { json: { subreddit: \"docker\" } },\n { json: { subreddit: \"homelab\" } },\n { json: { subreddit: \"linuxadmin\" } },\n { json: { subreddit: \"terraform\" } },\n { json: { subreddit: \"n8n\" } }\n];"
},
"typeVersion": 1
},
{
"id": "01140e0b-588c-4c7a-adf8-077f278cd420",
"name": "Get row(s) in sheet2",
"type": "n8n-nodes-base.googleSheets",
"position": [
-208,
496
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1969805435,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1969805435",
"cachedResultName": "Reddit 1st"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "ec1b6732-9e0e-4aa3-9bd1-e3c4b8c43510",
"name": "Code in Python (Beta)",
"type": "n8n-nodes-base.code",
"position": [
-32,
496
],
"parameters": {
"language": "python",
"pythonCode": "# n8n Python Code node\n# Removes duplicate rows based on 'url' column\n\nseen_urls = set()\nunique_rows = []\n\nfor item in items:\n row = item[\"json\"]\n url = str(row.get(\"url\", \"\")).strip().lower()\n \n if url and url not in seen_urls:\n seen_urls.add(url)\n unique_rows.append({\"json\": row})\n\nreturn unique_rows"
},
"typeVersion": 2
},
{
"id": "0eca2ec3-1c7b-419e-9701-a74fcf368ab8",
"name": "Clear sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
144,
352
],
"parameters": {
"operation": "clear",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1969805435,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1969805435",
"cachedResultName": "Reddit 1st"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "569045e9-143f-412f-8e94-a09fbe246f52",
"name": "Append row in sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
144,
496
],
"parameters": {
"columns": {
"value": {},
"schema": [
{
"id": "subreddit",
"type": "string",
"display": true,
"required": false,
"displayName": "subreddit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selftext",
"type": "string",
"display": true,
"required": false,
"displayName": "selftext",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ups",
"type": "string",
"display": true,
"required": false,
"displayName": "ups",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "num_comments",
"type": "string",
"display": true,
"required": false,
"displayName": "num_comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keywords",
"type": "string",
"display": true,
"required": false,
"displayName": "Keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "currentDate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "currentDate",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1969805435,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1969805435",
"cachedResultName": "Reddit 1st"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit?usp=drivesdk",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "6c6284e1-61e1-4dae-99fd-fcc784da3631",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
752,
352
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "fef5776d-8a5e-4502-9c6d-ecfbc51c7a80",
"name": "AI Agent Process Keywords",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
944,
368
],
"parameters": {
"text": "={\n \"model\": \"gpt-4o-mini\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Extract the 5 most important keywords from the input text. Rules: only single words, all lowercase, no duplicates. Output format: word1,word2,word3,word4,word5. Output nothing else.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Title: {{ $('Filter Rows Needing Keywords3').item.json.title }}\\nArticle: {{ $('Filter Rows Needing Keywords3').item.json.selftext }}\"\n }\n ]\n}",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "951f7733-1991-4755-9427-110484f42f0d",
"name": "Update Row in Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
1360,
368
],
"parameters": {
"columns": {
"value": {
"Keywords": "={{ $json.output }}",
"row_number": "={{ $('Filter Rows Needing Keywords3').item.json.row_number }}"
},
"schema": [
{
"id": "subreddit",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "subreddit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selftext",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "selftext",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ups",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "ups",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "num_comments",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "num_comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keywords",
"type": "string",
"display": true,
"required": false,
"displayName": "Keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "currentDate",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "currentDate",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"row_number"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1969805435,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1969805435",
"cachedResultName": "Reddit 1st"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "c4b0e2c3-aeb7-455f-ab8c-40f3db84303b",
"name": "OpenRouter Chat Model3",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
976,
528
],
"parameters": {
"model": "openai/gpt-4o-mini",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "c3dfe2f1-3145-4798-a801-da95f04f477c",
"name": "Get row(s) in sheet6",
"type": "n8n-nodes-base.googleSheets",
"position": [
480,
352
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1969805435,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1969805435",
"cachedResultName": "Reddit 1st"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"executeOnce": true,
"typeVersion": 4.7
},
{
"id": "c3ad0629-8bdd-49f2-917c-8aee3bd2765a",
"name": "Filter Rows Needing Keywords3",
"type": "n8n-nodes-base.code",
"position": [
592,
352
],
"parameters": {
"jsCode": "const inputData = $input.all();\nconst results = [];\n\nfor (const item of inputData) {\n const row = item.json;\n const selftext = (row.selftext || '').toString().trim();\n const keywords = (row.Keywords || row.keywords || '').toString().trim();\n\n if (selftext && !keywords) {\n results.push({\n json: {\n row_number: row.row_number,\n title: row.title ? row.title.toString().trim() : '',\n selftext: selftext\n }\n });\n }\n}\n\nreturn results;"
},
"executeOnce": true,
"typeVersion": 2
},
{
"id": "0c72a5d4-a64c-431c-a9e5-5ef800a9b297",
"name": "Wait5",
"type": "n8n-nodes-base.wait",
"position": [
1216,
368
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "3301525c-671a-4000-8837-56fba34e737f",
"name": "Loop Over Items1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
752,
832
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "cd1571c9-35fe-4785-924b-b8905b5c30e1",
"name": "AI Agent Process Keywords1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
944,
848
],
"parameters": {
"text": "={\n \"model\": \"gpt-4o-mini\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Extract the 5 most important keywords from the input text. Rules: only single words, all lowercase, no duplicates. Output format: word1,word2,word3,word4,word5. Output nothing else.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Title: {{ $('Filter Rows Needing Keywords').item.json.title }}\\nArticle: {{ $('Filter Rows Needing Keywords').item.json.selftext }}\"\n }\n ]\n}",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "2794b98f-7136-47d5-9a39-12fe38546895",
"name": "Update Row in Sheet1",
"type": "n8n-nodes-base.googleSheets",
"position": [
1360,
848
],
"parameters": {
"columns": {
"value": {
"Keywords": "={{ $json.output }}",
"row_number": "={{ $('Filter Rows Needing Keywords').item.json.row_number }}"
},
"schema": [
{
"id": "subreddit",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "subreddit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selftext",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "selftext",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ups",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ups",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "num_comments",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "num_comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keywords",
"type": "string",
"display": true,
"required": false,
"displayName": "Keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "currentDate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "currentDate",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"row_number"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 768052301,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=768052301",
"cachedResultName": "Reddit 2nd"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "4e1f6484-52a0-4c34-ab5b-1151e849024d",
"name": "OpenRouter Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
976,
1008
],
"parameters": {
"model": "openai/gpt-4o-mini",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "272ec2e4-bd0c-4a09-a608-933df1ee7b3f",
"name": "Get row(s) in sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
480,
832
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 768052301,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=768052301",
"cachedResultName": "Reddit 2nd"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"executeOnce": true,
"typeVersion": 4.7
},
{
"id": "9b81d43f-b24b-4269-af65-5a09e5732484",
"name": "Filter Rows Needing Keywords",
"type": "n8n-nodes-base.code",
"position": [
592,
832
],
"parameters": {
"jsCode": "const inputData = $input.all();\nconst results = [];\n\nfor (const item of inputData) {\n const row = item.json;\n const selftext = (row.selftext || '').toString().trim();\n const keywords = (row.Keywords || row.keywords || '').toString().trim();\n\n if (selftext && !keywords) {\n results.push({\n json: {\n row_number: row.row_number,\n title: row.title ? row.title.toString().trim() : '',\n selftext: selftext\n }\n });\n }\n}\n\nreturn results;"
},
"executeOnce": true,
"typeVersion": 2
},
{
"id": "c7d76213-6ddb-465e-a67e-1ed237b7d8b4",
"name": "Wait6",
"type": "n8n-nodes-base.wait",
"position": [
1216,
848
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "d2a41faa-fd3f-411f-a887-a4f7f537d5a8",
"name": "Loop Over Items2",
"type": "n8n-nodes-base.splitInBatches",
"position": [
752,
1344
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "6bc64c07-5ea4-45e5-be75-96d95c13bb89",
"name": "AI Agent Process Keywords2",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
944,
1360
],
"parameters": {
"text": "={\n \"model\": \"gpt-4o-mini\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Extract the 5 most important keywords from the input text. Rules: only single words, all lowercase, no duplicates. Output format: word1,word2,word3,word4,word5. Output nothing else.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Title: {{ $('Filter Rows Needing Keywords4').item.json.title }}\\nArticle: {{ $('Filter Rows Needing Keywords4').item.json.selftext }}\"\n }\n ]\n}",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "13669a58-f717-4b44-b05a-77493f66c3fe",
"name": "Update Row in Sheet2",
"type": "n8n-nodes-base.googleSheets",
"position": [
1360,
1360
],
"parameters": {
"columns": {
"value": {
"Keywords": "={{ $json.output }}",
"row_number": "={{ $('Filter Rows Needing Keywords4').item.json.row_number }}"
},
"schema": [
{
"id": "subreddit",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "subreddit",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "selftext",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "selftext",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ups",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ups",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "num_comments",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "num_comments",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "url",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Keywords",
"type": "string",
"display": true,
"required": false,
"displayName": "Keywords",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Date",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "currentDate",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "currentDate",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"row_number"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1209014008,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1209014008",
"cachedResultName": "Reddit 3th"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"typeVersion": 4.7
},
{
"id": "5dba8050-f329-46fa-a5a1-058c6a4eef61",
"name": "OpenRouter Chat Model4",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
976,
1520
],
"parameters": {
"model": "openai/gpt-4o-mini",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "70ed837b-845d-45e3-b101-d8e43e29ffd8",
"name": "Get row(s) in sheet7",
"type": "n8n-nodes-base.googleSheets",
"position": [
480,
1344
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1209014008,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nLGFtYpFNTqdGTocTx9EApKL5mEAPOvSP83oX-RIw64/edit#gid=1209014008",
"cachedResultName": "Reddit 3th"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultName": "Keyword Research"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "",
"name": "Google Sheets Main"
}
},
"executeOnce": true,
"typeVersion": 4.7
},
{
"id": "34d665e6-7ec5-4ae2-b7db-6deea1a0bfe6",
"name": "Filter Rows Needing Keywords4",
"type": "n8n-nodes-base.code",
"position": [
592,
1344
],
"parameters": {
"jsCode": "const inputData = $input.all();\nconst results = [];\n\nfor (const item of inputData) {\n const row = item.json;\n const selftext = (row.selftext || '').toString().trim();\n const keywords = (row.Keywords || row.keywords || '').toString().trim();\n\n if (selftext && !keywords) {\n results.push({\n json: {\n row_number: row.row_number,\n title: row.title ? row.title.toString().trim() : '',\n selftext: selftext\n }\n });\n }\n}\n\nreturn results;"
},
"executeOnce": true,
"typeVersion": 2
},
{
"id": "03b45a03-7192-46d2-9ff9-c7002e1e7519",
"name": "Wait7",
"type": "n8n-nodes-base.wait",
"position": [
1216,
1360
],
"parameters": {},
"typeVersion": 1.1
}
],
"pinData": {},
"connections": {
"Wait": {
"main": [
[
{
"node": "Get row(s) in sheet6",
"type": "main",
"index": 0
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "Get row(s) in sheet",
"type": "main",
"index": 0
}
]
]
},
"Wait2": {
"main": [
[
{
"node": "Get row(s) in sheet7",
"type": "main",
"index": 0
}
]
]
},
"Wait3": {
"main": [
[
{
"node": "Subreddit list1",
"type": "main",
"index": 0
}
]
]
},
"Wait4": {
"main": [
[
{
"node": "Subreddit list2",
"type": "main",
"index": 0
}
]
]
},
"Wait5": {
"main": [
[
{
"node": "Update Row in Sheet",
"type": "main",
"index": 0
}
]
]
},
"Wait6": {
"main": [
[
{
"node": "Update Row in Sheet1",
"type": "main",
"index": 0
}
]
]
},
"Wait7": {
"main": [
[
{
"node": "Update Row in Sheet2",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Code in Python (Beta)1",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "Code in Python (Beta)2",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields2": {
"main": [
[
{
"node": "Code in Python (Beta)5",
"type": "main",
"index": 0
}
]
]
},
"Get many posts": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Subreddit list": {
"main": [
[
{
"node": "Get many posts",
"type": "main",
"index": 0
}
]
]
},
"Get many posts1": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"Get many posts3": {
"main": [
[
{
"node": "Edit Fields2",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[
{
"node": "Workflow Completion1",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Agent Process Keywords",
"type": "main",
"index": 0
}
]
]
},
"Subreddit list1": {
"main": [
[
{
"node": "Get many posts1",
"type": "main",
"index": 0
}
]
]
},
"Subreddit list2": {
"main": [
[
{
"node": "Get many posts3",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items1": {
"main": [
[
{
"node": "Workflow Completion",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Agent Process Keywords1",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items2": {
"main": [
[
{
"node": "Workflow Completion2",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Agent Process Keywords2",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Subreddit list",
"type": "main",
"index": 0
}
]
]
},
"Append row in sheet": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet": {
"main": [
[
{
"node": "Filter Rows Needing Keywords",
"type": "main",
"index": 0
}
]
]
},
"Send a text message": {
"main": [
[]
]
},
"Update Row in Sheet": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Workflow Completion": {
"main": [
[
{
"node": "Send a text message",
"type": "main",
"index": 0
},
{
"node": "Wait4",
"type": "main",
"index": 0
}
]
]
},
"Append row in sheet1": {
"main": [
[
{
"node": "Get row(s) in sheet2",
"type": "main",
"index": 0
}
]
]
},
"Append row in sheet2": {
"main": [
[
{
"node": "Get row(s) in sheet3",
"type": "main",
"index": 0
}
]
]
},
"Append row in sheet3": {
"main": [
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"Append row in sheet4": {
"main": [
[
{
"node": "Get row(s) in sheet5",
"type": "main",
"index": 0
}
]
]
},
"Append row in sheet5": {
"main": [
[
{
"node": "Wait2",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet2": {
"main": [
[
{
"node": "Code in Python (Beta)",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet3": {
"main": [
[
{
"node": "Code in Python (Beta)3",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet5": {
"main": [
[
{
"node": "Code in Python (Beta)4",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet6": {
"main": [
[
{
"node": "Filter Rows Needing Keywords3",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet7": {
"main": [
[
{
"node": "Filter Rows Needing Keywords4",
"type": "main",
"index": 0
}
]
]
},
"Update Row in Sheet1": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Update Row in Sheet2": {
"main": [
[
{
"node": "Loop Over Items2",
"type": "main",
"index": 0
}
]
]
},
"Workflow Completion1": {
"main": [
[
{
"node": "Send a text message1",
"type": "main",
"index": 0
},
{
"node": "Wait3",
"type": "main",
"index": 0
}
]
]
},
"Workflow Completion2": {
"main": [
[
{
"node": "Send a text message2",
"type": "main",
"index": 0
}
]
]
},
"Code in Python (Beta)": {
"main": [
[
{
"node": "Clear sheet",
"type": "main",
"index": 0
},
{
"node": "Append row in sheet",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent Process Keywords1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Code in Python (Beta)1": {
"main": [
[
{
"node": "Append row in sheet1",
"type": "main",
"index": 0
}
]
]
},
"Code in Python (Beta)2": {
"main": [
[
{
"node": "Append row in sheet2",
"type": "main",
"index": 0
}
]
]
},
"Code in Python (Beta)3": {
"main": [
[
{
"node": "Append row in sheet3",
"type": "main",
"index": 0
},
{
"node": "Clear sheet1",
"type": "main",
"index": 0
}
]
]
},
"Code in Python (Beta)4": {
"main": [
[
{
"node": "Append row in sheet5",
"type": "main",
"index": 0
},
{
"node": "Clear sheet2",
"type": "main",
"index": 0
}
]
]
},
"Code in Python (Beta)5": {
"main": [
[
{
"node": "Append row in sheet4",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model3": {
"ai_languageModel": [
[
{
"node": "AI Agent Process Keywords",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model4": {
"ai_languageModel": [
[
{
"node": "AI Agent Process Keywords2",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"AI Agent Process Keywords": {
"main": [
[
{
"node": "Wait5",
"type": "main",
"index": 0
}
]
]
},
"AI Agent Process Keywords1": {
"main": [
[
{
"node": "Wait6",
"type": "main",
"index": 0
}
]
]
},
"AI Agent Process Keywords2": {
"main": [
[
{
"node": "Wait7",
"type": "main",
"index": 0
}
]
]
},
"Filter Rows Needing Keywords": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Filter Rows Needing Keywords3": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Filter Rows Needing Keywords4": {
"main": [
[
{
"node": "Loop Over Items2",
"type": "main",
"index": 0
}
]
]
}
}
}