Automate Reddit Trend Analysis and PR Reports with n8n

Discover how this n8n automation identifies hot Reddit trends, filters top posts by upvotes, analyzes comments for sentiment, and generates comprehensive PR reports automatically. Save hours weekly by transforming social data into actionable PR insights with ease.
reddit
code
if
+9
Workflow Identifier: 1267
NODES in Use: Code, Reddit, If, Set, SplitInBatches, HTTP Request, Google Drive, Compression, ConvertToFile, Aggregate, StickyNote, Anthropic Chat Model
Automate Reddit analysis with n8n and Reddit

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow finds popular Reddit posts about specific topics and reads the top 30 comments. It checks if posts have more than 100 upvotes and removes duplicates. Then, it uses AI to analyze comment sentiment and gets detailed news content linked in the posts. Finally, it creates a report with all this information, packs it into a zip file, uploads it to Google Drive, and notifies the team on Mattermost with the download link.

This helps save 3-4 hours every week by doing what someone would normally do by hand, making PR work faster and smarter.


Who Should Use This Workflow

People who run weekly PR campaigns and need quick insight on trending political stories on Reddit. Also useful for digital teams that want to track comments’ moods and get full news article context quickly.

This workflow is good for PR strategists who want to save time and avoid missing viral stories.


Tools and Services Used

  • Reddit API (OAuth2): Searches posts and gets comments.
  • Anthropic AI: Analyzes sentiment and story ideas.
  • Jina.ai API: Gets full news articles from URLs.
  • Google Drive API (OAuth2): Uploads and shares reports.
  • Mattermost Webhook: Sends report links to team chat.

Inputs, Processing Steps, and Outputs

Inputs

  • List of topics to search on Reddit (for example, “Donald Trump”, “Politics”).
  • API keys for Reddit, Anthropic, Jina.ai, Google Drive.
  • Mattermost webhook URL and channel info.

Processing Steps

  • Split topics into single searches.
  • Search Reddit for each topic; filter posts with at least 100 upvotes.
  • Remove duplicate URLs, keeping posts with highest upvotes.
  • For each post, get all comments, keep top 30 by score, remove deleted.
  • Format comments to Markdown with author and score.
  • Send comments text to Anthropic AI for sentiment and engagement analysis.
  • Fetch full news article text from Jina.ai using post URL.
  • Analyze news and Reddit data with Anthropic AI for PR story ideas.
  • Generate a final report combining all data and analysis.
  • Convert report to text files, compress as zip.
  • Upload zip to Google Drive and share publicly.
  • Send notification with download link to Mattermost channel.

Output

A zipped file containing a detailed PR report for trending Reddit stories is stored in Google Drive and a link is shared with the team on Mattermost.


Beginner Step-by-Step: How to Use This Workflow in n8n

1. Download and Import Workflow

  1. Click the Download button on the page to get the workflow file.
  2. In the n8n editor, select “Import from File” and upload the workflow file.

2. Configure Credentials and Settings

  1. Open the Set node named “Set Data” and enter the list of topics you want (each topic on a new line).
  2. Enter API keys for Reddit OAuth2, Anthropic, Jina.ai, and Google Drive OAuth2 in their respective credentials sections.
  3. Update any folder IDs for Google Drive upload, and set the Mattermost webhook URL and channel in the notification HTTP Request node.

3. Test and Activate Workflow

  1. Run the workflow once manually to check for errors and correct outputs.
  2. If everything works, toggle the Schedule Trigger on; it will run every Monday at 6 AM automatically.
  3. Monitor workflow runs in the n8n dashboard for failures or command retries.

If using self hosting n8n, consider this self-host n8n resource for setup help.


Edge Cases and Common Failures

  • Reddit API 401 Unauthorized: Check that OAuth2 credentials for Reddit are valid and assigned.
  • Jina.ai HTTP Request fails: Verify Jina API key entry and network connection.
  • Google Drive permission denied: Reauthorize Google Drive OAuth2 and confirm folder access rights.
  • Duplicate posts not removed: Check the code in the “Remove Duplicates” Code node for correct URL filtering.
  • No reports generated: Confirm Reddit search topics and upvote filters yield results.

Customization Ideas

  • Change topics by editing the multi-line string in “Set Data” node.
  • Adjust the 100 upvotes filter in the “Upvotes Requirement Filtering” node for more or less strictness.
  • Alter the number of comments analyzed (default 30) in “Extract Top Comments” Code node.
  • Change report file naming format in “Convert to File” node using expressions.
  • Switch Mattermost webhook URL to notify different team channels.

Summary of Results

✓ The workflow finds the best Reddit posts on chosen topics with strong engagement.

✓ It analyzes top comments and news content for sentiment and story ideas using AI.

✓ Creates a clear, rich PR report and shares it automatically with the team.

→ Saves 3-4 hours weekly on manual research and analysis.

→ Helps PR teams react faster and pitch timely stories to clients.


Automate Reddit analysis with n8n and Reddit

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Update the multi-line string in the ‘Set Data’ node with new topics. Each topic should be on a new line.
Check that the Reddit OAuth2 credentials are correctly added and valid in n8n and assigned to Reddit nodes.
Yes, change the number in the ‘Extract Top Comments’ Code node to a different count for comment analysis.
The reports are compressed into a zip file, uploaded to Google Drive, and a public download link is sent to the Mattermost channel.
Author
Written By
Ritu Sanjali

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.