πŸ“Œ 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

2

OpenAI API

API Key

Generate Article Ideas

platform.openai.com/api-keys

3

Google Sheets OAuth2

OAuth2

Fetch Previous Ideas, Save to Google Sheets

console.cloud.google.com β†’ Enable Sheets API β†’ Create OAuth2 credentials

4

Gmail OAuth2

OAuth2

Send a message

console.cloud.google.com β†’ 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
  3. Save

OpenAI API

  1. Search for "OpenAI" in credential types
  2. Paste your API key from platform.openai.com/api-keys
  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

Reddit Content Idea Generator Advanced_Sanitized.json27.42 KB β€’ JSON File

Made with ❀️ using n8n + Perplexity AI + OpenAI