This workflow corresponds to n8n.io template #14854 — we link there as the canonical source.
This workflow follows the Googlegemini → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"nodes": [
{
"id": "9679e18f-86f3-4dae-932b-b387385edaf1",
"name": "Send to WebApp",
"type": "n8n-nodes-base.httpRequest",
"position": [
816,
432
],
"parameters": {
"url": "YOUR URL",
"method": "POST",
"options": {},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "title",
"value": "={{ $json.headline }}"
},
{
"name": "content",
"value": "={{ $json.article_body }}"
}
]
}
},
"typeVersion": 4.1
},
{
"id": "ac119545-b70a-4349-995b-665da6f86c21",
"name": "Schedule Trigger1",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-960,
464
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.1
},
{
"id": "3428cc91-0af8-4d18-ac46-312ee2a8c96a",
"name": "List of Subreddits1",
"type": "n8n-nodes-base.code",
"position": [
-752,
464
],
"parameters": {
"jsCode": "return [\n { json: { name: \"PokemonChampions\" } },\n { json: { name: \"PokemonWindsWaves\" } },\n { json: { name: \"gamingnews\" } }\n];"
},
"typeVersion": 2
},
{
"id": "17b364d4-1819-4794-8592-76ab3ec66931",
"name": "Get Reddit JSON1",
"type": "n8n-nodes-base.httpRequest",
"position": [
-256,
480
],
"parameters": {
"url": "=https://www.reddit.com/r/{{ $json.name }}/hot.rss?limit=10",
"options": {}
},
"typeVersion": 4.1
},
{
"id": "66336b18-319b-4364-bd51-23f7102769ec",
"name": "Code in JavaScript",
"type": "n8n-nodes-base.code",
"position": [
-80,
432
],
"parameters": {
"mode": "runOnceForEachItem",
"jsCode": "// 1. Grab the raw XML string exactly for this specific item\nconst rawXml = $input.item.json.data;\n\nif (!rawXml || typeof rawXml !== 'string') {\n return { json: { trending_posts: [], error: \"XML string missing.\" } };\n}\n\nconst cleanData = [];\n\n// 2. Split the massive text block into individual posts using the <entry> tag\nconst entries = rawXml.split('<entry>'); \nentries.shift(); // Remove the subreddit header text\n\nfor (const entry of entries) {\n \n // THE ABSOLUTE SAFEST EXTRACTOR: Uses character positions instead of splitting arrays\n const getTag = (startTag, endTag) => {\n const startIndex = entry.indexOf(startTag);\n if (startIndex === -1) return \"\"; // Start tag not found\n \n const contentStartIndex = startIndex + startTag.length;\n const endIndex = entry.indexOf(endTag, contentStartIndex);\n \n if (endIndex === -1) return \"\"; // End tag not found\n \n return entry.substring(contentStartIndex, endIndex).trim();\n };\n\n const title = getTag('<title>', '</title>') || \"Untitled Post\";\n const author = getTag('<name>', '</name>') || \"Unknown User\";\n \n // Link extraction\n let link = getTag('<link href=\"', '\"');\n if (!link) link = getTag('href=\"', '\"'); // Fallback if Reddit shifts the XML attributes around\n\n // Content extraction\n let content = getTag('<content type=\"html\">', '</content>') || \"\";\n\n // 3. Scrub the Reddit HTML formatting clean\n content = content\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n .replace(/&/g, '&')\n .replace(/<[^>]*>?/gm, ' ') // Deletes all HTML tags like <table>, <tr>\n .replace(/\\s+/g, ' ') // Condenses weird spacing\n .trim();\n\n if (!content) {\n content = \"Image/Video only or no text body provided.\";\n }\n\n // 4. Push the clean, structured data into our array\n cleanData.push({\n title: title,\n author: author,\n link: link,\n content_snippet: content.substring(0, 600) // Max 600 chars!\n });\n}\n\n// 5. Output perfectly structured JSON\nreturn { \n json: { \n trending_posts: cleanData \n } \n};"
},
"typeVersion": 2
},
{
"id": "85be0495-6630-47a6-a007-64377cc23f04",
"name": "Loop Over Items1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-560,
464
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "ab270644-31b9-4cf3-bb49-75a9cd38f78c",
"name": "Wait1",
"type": "n8n-nodes-base.wait",
"position": [
960,
704
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "8c75da41-b1e3-4f29-8065-151195696be3",
"name": "Message a model",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"position": [
160,
432
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemini-3-flash-preview",
"cachedResultName": "models/gemini-3-flash-preview"
},
"options": {},
"messages": {
"values": [
{
"content": "=System Identity: You are a world-class Gaming Journalist and Pro-Gamer writing for a top-tier gaming blog.\n\nThe Task: > Below is a JSON array of the top 10 trending posts from a gaming subreddit right now.\n\nScan these posts and pick the SINGLE best post that is asking a question, struggling with a quest, or discussing a new game mechanic. Ignore memes, rants, and fan art.\n\nWrite a comprehensive, highly detailed, SEO-optimized gaming guide that answers or expands upon that specific post.\n\nContent & Formatting Requirements (Use Markdown):\n\nIntroduction: Hook the reader, validate the struggle mentioned in the Reddit post, and explain what they will learn.\n\nRequirements/Preparation: A bulleted list of what the player needs before starting.\n\nStep-by-Step Walkthrough: Numbered steps that are easy to follow.\n\nData Table: You MUST include at least one Markdown table (e.g., Item Stats, Location Coordinates, Loot Drop Chances, or Pros/Cons).\n\nPro-Tips/Common Mistakes: A section at the end with insider advice.\n\nTone: Witty, authoritative, helpful, and free of typical \"AI sounding\" robotic fluff.\n\nOutput Format:\nYou must return your response as a strict, valid JSON object with exactly two keys. Do not wrap the JSON in markdown code blocks:\n{\n\"headline\": \"A highly clickable SEO title\",\n\"article_body\": \"The full rich Markdown text of your guide goes here.\"\n}\n\nDATA TO ANALYZE: > {{ JSON.stringify($json.trending_posts) }}"
}
]
},
"simplify": false,
"jsonOutput": true,
"builtInTools": {}
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.1
},
{
"id": "697804ba-2266-4e30-92e4-c09623fadb55",
"name": "Code in JavaScript1",
"type": "n8n-nodes-base.code",
"position": [
512,
432
],
"parameters": {
"jsCode": "// 1. Grab all incoming items\nconst items = $input.all();\n\nif (items.length === 0) {\n return [{ json: { error: \"No data received.\" } }];\n}\n\nconst item = items[0].json;\n\n// 2. Navigate to the raw text from Gemini\nconst rawText = item.candidates[0].content.parts[0].text;\n\n// 3. Parse the JSON string inside the text field\nconst parsed = JSON.parse(rawText);\n\n// 4. Return headline and article_body as separate mappable fields\nreturn [{\n json: {\n headline: parsed.headline,\n article_body: parsed.article_body\n }\n}];"
},
"typeVersion": 2
},
{
"id": "c7c09b5e-0a3e-49b3-b75f-c0c8ccd0d1b8",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1440,
128
],
"parameters": {
"width": 464,
"height": 496,
"content": "## \ud83c\udfae Reddit \u2192 AI Gaming Guide Publisher\n\n**What this workflow \ndoes:**\nEvery day at 08:00 it loops through 3(you can choose how many you like) gaming subreddits, fetches the top 10 hot posts, picks the best discussion-worthy post using Gemini AI, writes a full SEO gaming guide in Markdown, and publishes it to your web app.\n\n**Subreddits monitored:**\nChoose as many as you would like exp.\n-/r/gaming\n-/r/pcgames\n\n**Tech stack:** n8n \u00b7 Reddit RSS \u00b7 Gemini AI \u00b7 Supabase Edge Functions\n\n**Schedule:** Daily at 08:00 (local server time)\n**Loop control:** Wait node re-enters the loop after each subreddit is processed."
},
"typeVersion": 1
},
{
"id": "15cfa416-017b-47c0-ae1f-92d96110ec4b",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-960,
192
],
"parameters": {
"color": 7,
"width": 336,
"height": 432,
"content": "**Nodes:** Schedule Trigger \u2192 List of Subreddits\n\n\u23f0 Fires once per day at 08:00.\n\nThe Code node returns a static array of subreddit names.\nEach item will be processed one at a time by the Loop node.\n\nTo add/remove subreddits, edit the Code node array:\n { json: { name: \"YourSubreddit\" } }"
},
"typeVersion": 1
},
{
"id": "9044c9cb-94d4-43f9-a000-990eea250c58",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
192
],
"parameters": {
"color": 7,
"width": 480,
"height": 432,
"content": "**Nodes:** Loop Over Items \u2192 Get Reddit JSON\n\n\ud83d\udd01 Processes ONE subreddit per iteration.\n\nThe HTTP Request node fetches the Reddit RSS feed:\n https://www.reddit.com/r/{name}/hot.rss?limit=10\n\nOutput: raw XML string in $json.data\nNo auth needed \u2014 Reddit RSS is public.\n\n\u26a0\ufe0f Reddit rate-limits aggressive polling.\n The Wait node at the end gives it breathing room."
},
"typeVersion": 1
},
{
"id": "499ca20b-1788-4505-9411-c0d5a42df8f5",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-112,
96
],
"parameters": {
"color": 7,
"width": 768,
"height": 528,
"content": "**Nodes:** Code in JavaScript \u2192 Message a Model \u2192 Code in JavaScript1\n\n**Step 1 \u2014 XML Parser:**\nSplits raw RSS by <entry> tags and extracts:\n title, author, link, content_snippet (max 600 chars)\nStrips all HTML entities and tags. Outputs $json.trending_posts[]\n\n**Step 2 \u2014 Gemini AI (gemini-3-flash-preview):**\nReceives the trending_posts array.\nPicks the BEST discussion post (ignores memes/rants/fan art).\nWrites a full Markdown gaming guide.\nReturns strict JSON: { headline, article_body }\n\n**Step 3 \u2014 Response Parser:**\nExtracts candidates[0].content.parts[0].text\nParses the JSON string \u2192 outputs $json.headline + $json.article_body\n\n\ud83d\udd11 Requires: Google Gemini (PaLM) API credential"
},
"typeVersion": 1
},
{
"id": "6c0901d2-ee55-472c-bc6e-424ef35dc229",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
656,
176
],
"parameters": {
"color": 3,
"width": 656,
"height": 448,
"content": "**Node:** Send to WebApp\n\n\ud83d\udce4 POSTs the generated guide to your Supabase Edge Function.\n\nEndpoint: YOUR_WEBAPP_ENDPOINT\n\nBody params sent:\n title \u2192 {{ $json.headline }}\n content \u2192 {{ $json.article_body }}\n\n\u26a0\ufe0f No auth header is configured here by default.\n Add a Supabase anon/service key header if your function requires it:\n Authorization: Bearer YOUR_SUPABASE_KEY"
},
"typeVersion": 1
},
{
"id": "244bc164-24be-4546-b79b-3d69089a85aa",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
944,
544
],
"parameters": {
"color": 7,
"width": 448,
"height": 416,
"content": "**Node:** Wait\n\n\u23f3 Pauses execution before returning to the Loop node.\n\nDefault: resumes immediately (resume mode: immediately).\nThis ensures the loop processes the next subreddit cleanly.\n\n\ud83d\udca1 Tip: Change the Wait duration to 5\u201310 seconds\n if you hit Reddit RSS rate limits during testing."
},
"typeVersion": 1
}
],
"connections": {
"Wait1": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Send to WebApp": {
"main": [
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"Message a model": {
"main": [
[
{
"node": "Code in JavaScript1",
"type": "main",
"index": 0
}
]
]
},
"Get Reddit JSON1": {
"main": [
[
{
"node": "Code in JavaScript",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items1": {
"main": [
[],
[
{
"node": "Get Reddit JSON1",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger1": {
"main": [
[
{
"node": "List of Subreddits1",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript": {
"main": [
[
{
"node": "Message a model",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript1": {
"main": [
[
{
"node": "Send to WebApp",
"type": "main",
"index": 0
}
]
]
},
"List of Subreddits1": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googlePalmApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automatically monitors a set of subreddits on a daily schedule, fetches the top trending posts via RSS, and uses a Google Gemini AI model to identify the most discussion-worthy post. It then generates a full, SEO-optimized guide in Markdown — complete with…
Source: https://n8n.io/workflows/14854/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
AI Institutional Stock Valuation Engine with Risk Scoring & Scenario Targets
Overview This is a production-grade, fully automated stock analysis system built entirely in n8n. It combines institutional-level financial analysis, dual AI model consensus, and a self-improving back
This workflow is a complete outbound automation system that discovers local businesses, extracts contact emails, generates personalized cold emails using AI, and runs a multi-step follow-up sequence —
A professional AI equity analysis automation built on n8n that transforms structured financial data and real-time news into disciplined, risk-adjusted price targets and actionable BUY/HOLD/SELL signal
N8Nflow Zhtw. Uses executeCommand, readBinaryFiles, httpRequest, googleGemini. Scheduled trigger; 28 nodes.