> ## Content Index
> Fetch the complete content index at: https://buildwire.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# 🎯 Reddit Content Idea Generator Advanced - Setup Guide
- URL: https://buildwire.ai/blog/reddit-content-idea-generator-advanced-setup-guide/
- Published: 2026-02-12T16:06:40.000Z
- Updated: 2026-06-14T07:31:10.000Z
- Author: Rananjay Raj
- Tags: #beehiiv, #Migrated-1781422191461, #Import 2026-06-14 13:00

## 📌 What This Workflow Does

This n8n workflow mines **real Reddit conversations** to generate **15 structured, AI-powered content ideas** tailored to your niche, content format, and audience pain points — with built-in deduplication against your previously generated ideas.

> 💡 **No Reddit API needed.** The workflow uses Perplexity AI's web search to find Reddit posts directly.

---

## 🏗️ Architecture

```
                                                                                               +--> Display Results (form response)
                                                                                               |
Form --> Find Subreddits --> Prepare Queries --> Search Posts --> Score --> Build Prompt --> Generate --> Parse --> Save --+
  |                                                                           ^                                         |
  +--> Fetch Previous Ideas --------------------------------------------------+                                         +--> Build Email Summary --> Send Email

```

Two parallel branches run from the form trigger:

| Branch    | Purpose                                                                |
| --------- | ---------------------------------------------------------------------- |
| **Main**  | Subreddit discovery → Reddit research → AI content generation          |
| **Dedup** | Fetches previously generated ideas from Google Sheets to avoid repeats |

---

## 🧩 Node-by-Node Overview

| \# | Node                   | Type          | Purpose                                                                          |
| -- | ---------------------- | ------------- | -------------------------------------------------------------------------------- |
| 1  | Content Idea Form      | Form Trigger  | Web form collecting niche, subreddits, search phrase, time range, content format |
| 2  | Find Subreddits        | Perplexity    | Discovers 5 relevant subreddits via AI (skipped if user provides their own)      |
| 3  | Fetch Previous Ideas   | Google Sheets | Reads existing ideas for deduplication                                           |
| 4  | Prepare Search Queries | Code          | Parses subreddits with 4-strategy fallback parser, builds search parameters      |
| 5  | Search Reddit Posts    | Perplexity    | Searches each subreddit for pain-point posts with time range filtering           |
| 6  | Score & Filter Posts   | Code          | Aggregates and labels results by subreddit                                       |
| 7  | Build Prompt           | Code          | Constructs generation prompt with dedup list + format-specific instructions      |
| 8  | Generate Article Ideas | OpenAI        | Generates exactly 15 structured content ideas                                    |
| 9  | Parse & Split Ideas    | Code          | Parses JSON response into individual row items                                   |
| 10 | Save to Google Sheets  | Google Sheets | Appends each idea as a row                                                       |
| 11 | Display Results        | Code          | Formats results for form completion page                                         |
| 12 | Build Email Summary    | Code          | Aggregates all ideas into a single email body                                    |
| 13 | Send a message         | Gmail         | Sends summary notification email                                                 |

---

## 🔑 Credentials Required

| \# | Credential               | Type    | Used By                                     | How to Get                                                                                                                                                                                                                                         |
| -- | ------------------------ | ------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1  | **Perplexity API**       | API Key | Find Subreddits, Search Reddit Posts        | [perplexity.ai/settings/api](https://www.perplexity.ai/settings/api?utm%5Fsource=theaidrivenmarketer.beehiiv.com&utm%5Fmedium=referral&utm%5Fcampaign=reddit-content-idea-generator-advanced-setup-guide)                                          |
| 2  | **OpenAI API**           | API Key | Generate Article Ideas                      | [platform.openai.com/api-keys](https://platform.openai.com/api-keys?utm%5Fsource=theaidrivenmarketer.beehiiv.com&utm%5Fmedium=referral&utm%5Fcampaign=reddit-content-idea-generator-advanced-setup-guide)                                          |
| 3  | **Google Sheets OAuth2** | OAuth2  | Fetch Previous Ideas, Save to Google Sheets | [console.cloud.google.com](https://console.cloud.google.com/?utm%5Fsource=theaidrivenmarketer.beehiiv.com&utm%5Fmedium=referral&utm%5Fcampaign=reddit-content-idea-generator-advanced-setup-guide) → Enable Sheets API → Create OAuth2 credentials |
| 4  | **Gmail OAuth2**         | OAuth2  | Send a message                              | [console.cloud.google.com](https://console.cloud.google.com/?utm%5Fsource=theaidrivenmarketer.beehiiv.com&utm%5Fmedium=referral&utm%5Fcampaign=reddit-content-idea-generator-advanced-setup-guide) → Enable Gmail API → Create OAuth2 credentials  |

> ⚠️ **Important:** Create all credentials through n8n's Credentials Manager (Settings → Credentials → Add). Never paste keys into code nodes.

---

## 🚀 Step-by-Step Setup

### Step 1: Import the Workflow

1. Open your n8n instance
2. Go to **Workflows** → **Import from File**
3. Select `workflow.json`
4. The workflow appears in your workspace (inactive)

### Step 2: Create Credentials in n8n

Open **Settings → Credentials → Add Credential** for each:

#### Perplexity API

1. Search for "Perplexity" in credential types
2. Paste your API key from [perplexity.ai/settings/api](https://www.perplexity.ai/settings/api?utm%5Fsource=theaidrivenmarketer.beehiiv.com&utm%5Fmedium=referral&utm%5Fcampaign=reddit-content-idea-generator-advanced-setup-guide)
3. Save

#### OpenAI API

1. Search for "OpenAI" in credential types
2. Paste your API key from [platform.openai.com/api-keys](https://platform.openai.com/api-keys?utm%5Fsource=theaidrivenmarketer.beehiiv.com&utm%5Fmedium=referral&utm%5Fcampaign=reddit-content-idea-generator-advanced-setup-guide)
3. Save

#### Google Sheets OAuth2

1. Search for "Google Sheets OAuth2" in credential types
2. Follow the OAuth2 flow to connect your Google account
3. Ensure the Google Sheets API is enabled in your Google Cloud Console
4. Save

#### Gmail OAuth2

1. Search for "Gmail OAuth2" in credential types
2. Follow the OAuth2 flow to connect your Gmail account
3. Ensure the Gmail API is enabled in your Google Cloud Console
4. Save

### Step 3: Attach Credentials to Nodes

Open each node and select your saved credential:

| Node                       | Credential to Attach |
| -------------------------- | -------------------- |
| **Find Subreddits**        | Perplexity API       |
| **Search Reddit Posts**    | Perplexity API       |
| **Generate Article Ideas** | OpenAI API           |
| **Fetch Previous Ideas**   | Google Sheets OAuth2 |
| **Save to Google Sheets**  | Google Sheets OAuth2 |
| **Send a message**         | Gmail OAuth2         |

### Step 4: Set Up Google Sheets

1. Create a new Google Spreadsheet
2. Add these column headers in **Row 1**:

| A         | B     | C              | D        | E     | F           | G         | H            | I                 |
| --------- | ----- | -------------- | -------- | ----- | ----------- | --------- | ------------ | ----------------- |
| Timestamp | Niche | Content Format | Category | Title | Description | Addresses | Unique Angle | Source Subreddits |

1. Copy the spreadsheet ID from the URL:
2. Update the document ID in **both** Google Sheets nodes:
  - **Fetch Previous Ideas** → Document ID
  - **Save to Google Sheets** → Document ID

### Step 5: Configure Email Recipient

1. Open the **"Send a message"** (Gmail) node
2. Update `sendTo` with your email address

### Step 6: Verify the AI Model

1. Open the **"Generate Article Ideas"** node
2. Confirm the model is set to a valid OpenAI model (e.g., `gpt-4o-mini` or `gpt-4o`)

> ⚠️ The workflow JSON may reference `gpt-5-mini` — this is not a publicly available model. Change it to `gpt-4o-mini` for reliable results.

### Step 7: Activate & Test

1. Toggle the workflow to **Active**
2. Copy the form URL shown in the "Content Idea Form" trigger node
3. Open the URL in your browser
4. Submit a test with your niche → ideas appear on the form page + email + Google Sheets

---

## 📋 Form Fields

| Field                     | Type     | Required | Description                                                            |
| ------------------------- | -------- | -------- | ---------------------------------------------------------------------- |
| **Niche**                 | Text     | ✅        | Your content niche (e.g., "productivity for creative professionals")   |
| **Subreddits (Optional)** | Text     | ❌        | Comma-separated subreddit names. Leave empty for AI discovery          |
| **Search Phrase**         | Dropdown | ✅        | Single phrase or "All (Top 5 Phrases - Recommended)"                   |
| **Time Range**            | Dropdown | ✅        | Past Month, Past Week, or Past Day                                     |
| **Content Format**        | Dropdown | ✅        | Blog Articles, YouTube Videos, Twitter/X Threads, or Newsletter Topics |

---

## 📊 Content Idea Categories

Each run generates exactly **15 ideas**:

| Category      | Count | Description                                      |
| ------------- | ----- | ------------------------------------------------ |
| **How-to**    | 5     | Step-by-step guides addressing specific problems |
| **List**      | 5     | Curated collections and roundups                 |
| **Deep Dive** | 3     | In-depth analysis of complex topics              |
| **Framework** | 2     | Actionable systems and mental models             |

---

## 🔍 Available Search Phrases

| Phrase                            | Best For                                            |
| --------------------------------- | --------------------------------------------------- |
| All (Top 5 Phrases - Recommended) | Comprehensive search using 5 phrases simultaneously |
| How can I                         | Direct problem-solving questions                    |
| How do you                        | Seeking peer advice                                 |
| I'm struggling with               | Expressed frustrations                              |
| I can't stand                     | Strong pain points                                  |
| Tips                              | Advice-seeking posts                                |
| Suggestions                       | Open-ended recommendations                          |
| Biggest challenge                 | Core struggles                                      |
| Biggest struggle                  | Deep frustrations                                   |
| Help me                           | Urgent needs                                        |
| Hardest part                      | Difficulty spots                                    |
| Can someone help                  | Community support                                   |
| Figure out                        | Problem-solving attempts                            |
| Suggest                           | Recommendations                                     |
| Biggest challenges                | Broad pain points                                   |
| Struggle with                     | Ongoing difficulties                                |

---

## 🎨 Content Format Adaptations

The AI prompt adapts based on your selected format:

| Format                | Adaptation                                                   |
| --------------------- | ------------------------------------------------------------ |
| **Blog Articles**     | SEO-friendly headlines, long-form structure                  |
| **YouTube Videos**    | Click-worthy titles, suggested 30-second hook in description |
| **Twitter/X Threads** | Punchy titles under 100 chars, suggested opening tweet       |
| **Newsletter Topics** | Email subject line–style titles, key takeaway angles         |

---

## ✨ Key Features

| Feature                          | Description                                                             |
| -------------------------------- | ----------------------------------------------------------------------- |
| 🤖 **Auto Subreddit Discovery**  | AI finds 5 relevant subreddits when none are provided                   |
| 🔄 **Multi-Phrase Search**       | "All Top 5 Phrases" option searches 5 pain-point phrases simultaneously |
| ⏱️ **Time Range Control**        | Filter Reddit posts by Past Day, Past Week, or Past Month               |
| 🎯 **Content Format Adaptation** | Tailored prompts for 4 different content formats                        |
| 🚫 **Deduplication**             | Reads existing ideas from Google Sheets to prevent repeats              |
| 📧 **Email Notification**        | Single aggregated summary email with all ideas grouped by category      |
| 🛡️ **Error Resilience**         | Graceful error handling on all external API nodes                       |
| 🔧 **Robust Parsing**            | 4-strategy subreddit parser handles various AI response formats         |

---

## 🔧 Customization Options

### Change the Number of Ideas

Edit the prompt in the **"Build Prompt"** Code node. Modify:

```
Generate exactly 15 content ideas:
- 5 "How-to" pieces
- 5 "List" pieces
- 3 "Deep Dive" pieces
- 2 "Framework" pieces

```

### Add More Search Phrases

1. Edit the form dropdown options in the **"Content Idea Form"** trigger
2. Update the phrase array in the **"Prepare Search Queries"** Code node

### Change the AI Model

Update the `modelId` in the **"Generate Article Ideas"** node.

### Disable Email Notifications

Disable the **"Send a message"** node in the n8n UI. The workflow will still save to Sheets and display results.

---

## 🐛 Troubleshooting

| Problem                            | Solution                                                                                                  |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------- |
| **No subreddits found**            | Workflow falls back to r/AskReddit. Try a more specific niche or provide subreddits manually.             |
| **JSON parse errors in ideas**     | The Parse & Split Ideas node has fallback handling. Check the OpenAI model is responding with valid JSON. |
| **Google Sheets permission error** | Re-authorize Google Sheets OAuth2 in n8n Credentials. Ensure the Sheets API is enabled.                   |
| **Email not sending**              | Re-authorize Gmail OAuth2\. Check the sendTo address is correct.                                          |
| **Model not found error**          | Change gpt-5-mini to gpt-4o-mini in the Generate Article Ideas node.                                      |
| **Deduplication not working**      | Ensure the "Fetch Previous Ideas" node points to the correct sheet and has the right column headers.      |
| **Form URL not showing**           | Make sure the workflow is **Active** before copying the form URL.                                         |

---

## 💡 Pro Tips

1. **Start with "All (Top 5 Phrases)"** — gives the broadest coverage of audience pain points
2. **Use "Past Month"** for established niches, **"Past Week"** for trending topics
3. **Run weekly** to build a content calendar — deduplication prevents repeats automatically
4. **Try different content formats** for the same niche — you'll get different angles each time
5. **Provide specific subreddits** if you already know your audience's communities for more targeted results

---

## 📄 Output Structure

Each idea saved to Google Sheets includes:

| Column            | Description                             |
| ----------------- | --------------------------------------- |
| Timestamp         | ISO 8601 generation timestamp           |
| Niche             | The niche submitted in the form         |
| Content Format    | Selected content format                 |
| Category          | How-to, List, Deep Dive, or Framework   |
| Title             | Content headline/title                  |
| Description       | One-line overview of the content piece  |
| Addresses         | Specific problem or pain point solved   |
| Unique Angle      | What makes this idea different          |
| Source Subreddits | Comma-separated list of subreddits used |

---

## FULL JSON Code

| ![](https://buildwire.ai/content/images/2026/06/file_attachment-29.png)Reddit Content Idea Generator Advanced\_Sanitized.json27.42 KB • JSON File[Download](https://beehiiv-publication-files.s3.amazonaws.com/uploads/downloadables/a786a17c-8111-4762-9186-87896e7649de/8dcc889b-6407-42fc-8bcb-92c852d918cb/Reddit%20Content%20Idea%20Generator%20Advanced%5FSanitized.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQCMHTQSE2JGAGXHJ%2F20260614%2Fus-east-1%2Fs3%2Faws4%5Frequest&X-Amz-Date=20260614T072959Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=2de8ae451268199aee8a9dfa4b690210f27d3b5dbbeb86b3155b5c6edc1acb41&ref=buildwire.ai) |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

---

*Made with ❤️ using n8n + Perplexity AI + OpenAI*