Skip to main content

Extract & filter Reddit posts & comments with keyword search & markdown formatting

Workflow preview

Workflow preview
100%
Extract & filter Reddit posts & comments with keyword search & markdown formatting preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Reddit Posts & Comments Scraper A powerful workflow to scrape Reddit posts and comments by keywords and/or subreddit, with intelligent filtering and formatting. How it works 1. Search Reddit Accept...

Best for

  • Market Research automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.splitinbatches, n8n-nodes-base.set, n8n-nodes-base.limit, n8n-nodes-base.stickynote, n8n-nodes-base.httprequesttool, n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.if

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Muhammad Asadullah.

Original n8n.io source

1.1 Workflow description

Title
Extract & filter Reddit posts & comments with keyword search & markdown formatting
Workflow name
Extract & filter Reddit posts & comments with keyword search & markdown formatting

Reddit Posts & Comments Scraper

A powerful workflow to scrape Reddit posts and comments by keywords and/or subreddit, with intelligent filtering and formatting.

How it works

  1. Search Reddit - Accepts keywords and/or subreddit parameters via webhook to search for relevant posts
  2. Filter & Sort - Filters posts by date (last 60 days), minimum upvotes (20+), removes duplicates, and sorts by popularity
  3. Extract Comments - For each post, retrieves and extracts the top 20 most upvoted comments with their reply threads
  4. Format Results - Structures all posts and comments into a clean, readable markdown report
  5. Return Data - Sends the formatted report back as a webhook response, ready for use in AI tools or other applications

Set up steps

Time to set up: ~10 minutes

1. Create Reddit App (5 minutes)

  • Go to https://www.reddit.com/prefs/apps and create a new app
  • Add your n8n URL and callback URL in the "redirect uri" field (you'll find this in the Reddit OAuth2 credentials setup in n8n)
  • Copy your app's Client ID and Client Secret

2. Configure Reddit Credentials in n8n (2 minutes)

  • In n8n, create new Reddit OAuth2 API credentials
  • Paste your Client ID and Client Secret from step 1
  • Complete the OAuth2 authentication flow

3. Update Webhook URLs (2 minutes)

  • Update the webhook URLs in the example HTTP request nodes to match your n8n instance URL
  • The workflow has two webhooks:
    • /webhook/reddit-search-keyword - for searching by keywords only
    • /webhook/reddit-search-subreddit - for searching within a specific subreddit

4. Customize Filters (1 minute - optional)

  • Date filter: Line 6 in "Posted in Last x days" node (default: 60 days)
  • Upvote filter: "Upvotes Requirement Filtering" node (default: 20+ upvotes)
  • Post limit: "Limit" node (default: 10 posts)

5. Test the Workflow

  • Use the example HTTP request nodes to test both search methods:
    • Keywords only: ?keywords=your,keywords,here
    • Subreddit search: ?keywords=your,keywords&subreddit=SubredditName

Usage Examples

Search by keywords:

GET https://your-n8n.com/webhook/reddit-search-keyword?keywords=AI,machine learning

Search within subreddit:

GET https://your-n8n.com/webhook/reddit-search-subreddit?keywords=ChatGPT,GPT-4&subreddit=OpenAI

The workflow returns a formatted text report with all posts, their metadata, and top comments ready for analysis or AI processing.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Loop Over Items1

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 2 - Set Reddit Posts

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Limit

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 4 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - reddit tool

Type / Role
n8n-nodes-base.httpRequestTool - httpRequestTool
Config choices
Version 4.2

Block 6 - reddit tool webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 7 - Set keywords

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Posted in Last x days

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Upvotes Requirement Filtering

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 12 - Remove Duplicates

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sort by upvotes (descending)

Type / Role
n8n-nodes-base.sort - sort
Config choices
Version 1

Block 15 - Set post for Loop

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - Get Comments

Type / Role
n8n-nodes-base.reddit - reddit
Config choices
Version 1

Block 17 - Format Comments

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 19 - Set Final Report

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - Combine Posts

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 21 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 22 - reddit tool webhook subreddit

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 23 - Set subreddit

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 24 - Get posts from subreddit

Type / Role
n8n-nodes-base.reddit - reddit
Config choices
Version 1

Showing the first 24 of 28 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Extract & filter Reddit posts & comments with keyword search & markdown formatting
Complexity advanced
Nodes 28
Categories Market Research, AI RAG
Author Muhammad Asadullah
Published 02 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9201/9201.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract & filter Reddit posts & comments with keyword search & markdown formatting do?

Reddit Posts & Comments Scraper A powerful workflow to scrape Reddit posts and comments by keywords and/or subreddit, with intelligent filtering and formatting. How it works 1. Search Reddit Accept...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research, AI RAG use case.