Of all the n8n workflow automation examples you could build first, this one removes a chore that most teams do badly. Somebody on your team (a founder, a product marketer, a support lead) opens Reddit every week, scrolls the subreddits where customers hang out, copies interesting threads into a doc, tries to guess which complaints keep repeating, and then pastes a summary into Slack. Done by hand, it's slow and uneven. Threads get missed, the same post gets counted twice, and the "summary" depends on whoever had time that week. This guide shows you how to build an n8n workflow that pulls trending Reddit threads through the API, has an OpenAI model sort the pain points into categories, and posts a clean, linked summary to a Slack channel on a schedule.
Workflow at a glance
| Item | Details |
|---|---|
| Problem it solves | Nobody has a consistent, repeatable view of what people in your niche are complaining about on Reddit. |
| Manual steps it replaces | Opening each subreddit, sorting by hot, reading titles and bodies, copying links into a doc, deduplicating threads you already saw, grouping complaints by theme, writing a summary, posting it to Slack. |
| Trigger | n8n Schedule Trigger (for example, every Monday morning). A Manual Trigger is used while you build. |
| Output | One Slack message per run with pain-point categories, a short description of each, and links back to the source threads. |
| Tools | n8n (cloud or self-hosted), Reddit Data API through the n8n Reddit node, OpenAI API through the n8n OpenAI node, Slack through the n8n Slack node. |
| Skill level needed | Comfortable with n8n's editor and willing to paste a small JavaScript snippet into a Code node. No other programming needed. |
| Complexity | Medium. The node chain is short, but Reddit app approval, API limits and validating the model's JSON output all need care. |
What you need before you start
Get the accounts sorted first. One of them can take a while.
- An n8n instance. n8n Cloud or a self-hosted install both work. Check the n8n changelog if a node setting described here looks different in your version.
- Reddit API access (your go/no-go check). n8n's Reddit credential documentation says Reddit requires manual pre-approval before new apps can be created. Start that request today, because nothing else in this build works without it. Also read Reddit's Data API Terms: Reddit says it may set and enforce limits at its discretion, and that commercial use or research beyond rate limits requires a separate agreement.
- Reddit OAuth2 credentials. The n8n Reddit credential uses OAuth2 and requires a Client ID and Client Secret. OAuth2 is the sign-in standard where you approve n8n once and Reddit hands it a token, so your password never sits in the workflow. When you create the Reddit app, paste the OAuth Redirect URL shown in n8n's credential window into the app's redirect field.
- An OpenAI API key. Create it in your OpenAI platform account, then add it in n8n as an OpenAI credential. Set a spend limit in your OpenAI billing settings; OpenAI's usage and spend limits help article explains how those limits behave.
- A Slack app with a bot token. In Slack's app settings, create an app for your workspace, add the
chat:writebot scope (the permission to post messages), install it, and copy the Bot User OAuth Token (it starts withxoxb-). Add it in n8n as a Slack API credential. Then invite the bot into the target channel with/invite @YourBotName. - A test channel. Something like
#reddit-pain-points-test, so test runs don't spam the real team channel. - Sample data. Pick two or three subreddits where your customers talk. Choose at least one busy one and one quiet one, so you can test both a full run and a nearly empty run.
How the workflow runs
- Schedule Trigger fires at the time you set and outputs a timestamp.
- Set node ("Config") outputs the settings for this run:
subreddits(a list),postLimit, andslackChannel. - Split Out node turns the
subredditslist into one item per subreddit, each with asubredditfield. - Reddit node (Post, Get Many) runs once per subreddit and returns hot posts. Fields used downstream:
id,title,selftext,permalink,subreddit,ups,num_comments,created_utc,stickied. - Code node ("Clean posts") drops stickied posts and posts with no text, trims long bodies, and outputs a slim item per post:
id,subreddit,title,body,url,score,comments. - Remove Duplicates node drops posts whose
idwas already processed in an earlier run. - Decision: any posts left? An If node checks whether items exist. If none, the workflow posts a short "no new threads" note (or stops). If yes, it continues.
- Code node ("Build batch") packs all posts into one text block,
postsText, plus apostCount. - OpenAI node (Message a Model) receives
postsTextand returns JSON withcategories, each holdingname,summary,severityandpost_ids. - Code node ("Validate and format") parses the JSON, checks every category against an allowed list, maps
post_idsback to real URLs, and buildsslackText. Decision: if parsing fails, it outputs anerrorfield instead. - If node ("Valid?") sends good output to Slack and bad output to an error message.
- Slack node (Message, Send) posts
slackTextto the channel. Output: the posted message's timestamp and channel.
Build it step by step
Build with a Manual Trigger first. You'll swap in the schedule at the end.
Step 1: Create the workflow and add the Config node
In n8n, click Create Workflow, add a Manual Trigger, then add an Edit Fields (Set) node and rename it Config. Switch it to JSON mode and paste the settings below. Keeping settings in one node means you change subreddits later without touching the logic.
{
"subreddits": ["smallbusiness", "Entrepreneur", "SaaS"],
"postLimit": 25,
"slackChannel": "#reddit-pain-points-test"
}
Replace the subreddit names with your own. Leave off the r/ prefix.
Check: Execute the node. The output panel shows one item with the three fields, and subreddits displays as an array.
Step 2: Split the subreddit list
Add a Split Out node after Config. Set Fields To Split Out to subreddits. Under options, set the destination field name to subreddit if your version offers it; otherwise the field keeps the name subreddits and you reference that instead in Step 3.
Check: You see one item per subreddit, each holding a single name.
Step 3: Pull hot posts with the Reddit node
The n8n Reddit node supports retrieving subreddit information and posts, and submitting, getting, and deleting posts. Add it after Split Out and set:
- Credential: your Reddit OAuth2 credential. Click Connect and approve in the Reddit window.
- Resource: Post
- Operation: Get Many
- Subreddit: an expression, shown below
- Return All: off. Set Limit from Config (expression below).
- Filters, Category: Hot. (Top or Rising also work; hot is the closest match to "trending right now".)
Subreddit: {{ $json.subreddit }}
Limit: {{ $('Config').item.json.postLimit }}
Need something the node doesn't offer, like pulling comment trees? n8n's Reddit node page says unsupported operations can be called with the HTTP Request node, using the same Reddit credential.
Check: The output shows posts with title, selftext and permalink. If you see an auth error instead, reconnect the credential before going further.
Step 4: Clean and slim the posts
Raw Reddit items carry dozens of fields you don't need. Sending them to the model just burns tokens. Add a Code node, rename it Clean posts, set mode to Run Once for All Items, language JavaScript, and paste:
const MAX_BODY = 1200;
const out = [];
for (const item of $input.all()) {
const p = item.json;
if (!p || !p.id || !p.title) continue; // malformed item
if (p.stickied) continue; // mod announcements
const body = (p.selftext || '').replace(/s+/g, ' ').trim();
if (body === '[removed]' || body === '[deleted]') continue;
out.push({
json: {
id: p.id,
subreddit: p.subreddit,
title: p.title.trim(),
body: body.slice(0, MAX_BODY),
url: 'https://www.reddit.com' + p.permalink,
score: p.ups || 0,
comments: p.num_comments || 0
}
});
}
return out;
Link posts with no body text stay in, since the title alone often states the complaint.
Check: Every output item has exactly seven fields, url opens the right thread in your browser, and no item has a body longer than your cap.
Step 5: Skip threads you've already summarized
Hot posts stick around for days. Without this step, next week's summary repeats this week's threads. Add a Remove Duplicates node and set:
- Operation: Remove Items Processed in Previous Executions
- Keep Items Where: Value Is New
- Value to Dedupe On:
{{ $json.id }}
If your n8n version doesn't show that operation, use a Code node with workflow static data instead. Note that static data only saves during production (activated) runs, not manual test runs.
const seen = $getWorkflowStaticData('global');
seen.ids = seen.ids || [];
const fresh = $input.all().filter(i => !seen.ids.includes(i.json.id));
seen.ids = seen.ids.concat(fresh.map(i => i.json.id)).slice(-2000);
return fresh;
Check: Run the workflow twice in a row. The second run outputs zero items (or only brand-new posts).
Step 6: Stop cleanly when nothing is new
Add an If node. Open the node's Settings tab on the Remove Duplicates node and turn on Always Output Data, so an empty result still reaches the If node. In the If node, set the condition:
{{ $json.id }} String is not empty
Connect the false branch to a Slack node that posts "No new Reddit threads this week" (or leave it unconnected to stay silent). Connect the true branch to Step 7.
Check: Run with fresh posts and items leave the true output. Run again right after and the single empty item leaves the false output.
Step 7: Pack the posts into one batch
One model call per run is simpler to validate than one per post. Add a Code node named Build batch, mode Run Once for All Items:
const posts = $input.all().map(i => i.json);
const lines = posts.map(p =>
'ID: ' + p.id +
' | r/' + p.subreddit +
' | score ' + p.score + ', comments ' + p.comments +
'
TITLE: ' + p.title +
'
BODY: ' + (p.body || '(no text)')
);
return [{
json: {
postCount: posts.length,
postsText: lines.join('
---
'),
posts: posts
}
}];
Keep the posts array. Step 9 needs it to turn IDs back into links, so the model never has to reproduce URLs.
Check: One item comes out, postCount matches the number of items that went in, and postsText reads cleanly when you expand it.
Step 8: Analyze pain points with the OpenAI node
Add the OpenAI node and pick the text action Message a Model. Set:
- Credential: your OpenAI credential
- Model: a current model from the list that supports JSON output
- Messages: two entries. First, role System, with the system prompt from the templates section. Second, role User, with the user prompt template, where
{postsText}becomes{{ $json.postsText }} - Output Content as JSON: on, if your node version shows it
- Options, Sampling Temperature: low, so categories stay consistent run to run
One published n8n trend-tracking workflow uses Reddit "hot" posts, an AI Agent with GPT-4o, and JSON output, and lists Reddit OAuth2 and an OpenAI account as requirements. You don't need an agent here. A single Message a Model call is easier to debug.
Check: The output contains a categories array. Every post_ids entry is an ID that appears in postsText.
Step 9: Validate the model output and format the Slack message
Never post raw model output. Models occasionally wrap JSON in prose, invent a category, or cite an ID that doesn't exist. Add a Code node named Validate and format:
const ALLOWED = ['Pricing', 'Onboarding', 'Bugs and reliability',
'Missing features', 'Support', 'Integrations', 'Other'];
const raw = $json.message ? $json.message.content : $json;
let data;
try {
data = typeof raw === 'string'
? JSON.parse(raw.replace(/^[^{]*/, '').replace(/[^}]*$/, ''))
: raw;
} catch (e) {
return [{ json: { valid: false, error: 'JSON parse failed: ' + e.message } }];
}
if (!data || !Array.isArray(data.categories)) {
return [{ json: { valid: false, error: 'Missing categories array' } }];
}
const posts = $('Build batch').first().json.posts;
const byId = {};
posts.forEach(p => { byId[p.id] = p; });
const blocks = [];
for (const c of data.categories) {
const name = ALLOWED.includes(c.name) ? c.name : 'Other';
const links = (c.post_ids || [])
.filter(id => byId[id])
.slice(0, 5)
.map(id => '<' + byId[id].url + '|' + byId[id].title.slice(0, 80) + '>');
if (links.length === 0) continue; // drop categories with no real evidence
blocks.push('*' + name + '* (' + (c.severity || 'unrated') + ')
' +
(c.summary || '') + '
' + links.map(l => '- ' + l).join('
'));
}
if (blocks.length === 0) {
return [{ json: { valid: false, error: 'No category matched a real post' } }];
}
const header = '*Reddit pain points: ' + posts.length + ' new threads*';
return [{ json: { valid: true, slackText: header + '
' + blocks.join('
') } }];
The <url|text> pattern is Slack's link format, so each thread title becomes clickable.
Check: With a good response, valid is true and slackText reads like a finished message. To test the failure path, pin a fake output on the OpenAI node containing plain text; you should get valid: false and a clear error.
Step 10: Post to Slack
Add an If node checking {{ $json.valid }} is true. On the true branch, add the Slack node:
- Credential: your Slack bot token credential
- Resource: Message
- Operation: Send
- Send Message To: Channel, then pick your test channel (or use the Config value)
- Message Type: Simple Text Message
- Message Text:
{{ $json.slackText }}
On the false branch, add a second Slack node posting to the same channel (or a private ops channel):
Reddit pain-point run failed: {{ $json.error }}. Check the latest execution in n8n.
Don't confuse posting with search. n8n's Slack node documentation says its Slack AI search endpoint returns 20 results per request and is rate-limited at around 10 requests per minute per user, and that limit applies to the search operation, not to posting. That same Slack node page says AI search requires a user token rather than a bot token, which this workflow doesn't need.
Check: The message lands in the test channel, categories are bold, and every link opens the right Reddit thread.
Step 11: Switch to a schedule and activate
Replace the Manual Trigger with a Schedule Trigger. Set Trigger Interval to Weeks, pick the day and hour, and confirm the workflow's timezone under Workflow Settings. Change slackChannel in Config to the real channel. Then toggle the workflow to Active.
Check: After the first scheduled time passes, the Executions list shows a successful production run and the message appears in Slack.
Prompts and templates
Copy these into the OpenAI node. The category list must match the ALLOWED array in Step 9 exactly.
System prompt
You analyze Reddit threads to find customer pain points for a product team.
Rules:
- Use only the threads provided. Do not invent problems, quotes or numbers.
- A pain point is a frustration, blocker, unmet need or complaint stated by the poster.
- Ignore jokes, self-promotion, memes and posts with no clear problem.
- Assign each relevant thread to exactly one category from this list:
Pricing, Onboarding, Bugs and reliability, Missing features, Support, Integrations, Other.
- Reference threads only by the ID given in the input.
- severity is "high" if several threads share the problem or posters say it blocks their work,
"medium" if it is a clear but isolated frustration, "low" otherwise.
- Write each summary in one or two plain sentences, no marketing language.
- Return valid JSON only, matching the schema. No text before or after the JSON.
User prompt template
Here are {postCount} Reddit threads collected this week, separated by ---.
Group the pain points into categories and return JSON in the required schema.
Skip any thread with no real pain point.
{postsText}
In n8n, write the variables as {{ $json.postCount }} and {{ $json.postsText }}.
Expected output schema
{
"categories": [
{
"name": "Pricing",
"summary": "Posters say the jump from the free tier to the first paid tier is too steep for solo users.",
"severity": "high",
"post_ids": ["abc123", "def456"]
}
],
"skipped_ids": ["ghi789"]
}
Example: the summary above is placeholder text to show the shape, not a real finding.
Test it before you trust it
Use pinned data (the pin icon on a node's output) to fake inputs without calling Reddit again.
| Test input | Expected output |
|---|---|
| Normal run against your busy subreddit | One Slack message, several categories, every link opens a real thread. |
| Empty input: a quiet subreddit, or a second run straight after the first | Remove Duplicates returns nothing, the If node takes the false branch, no OpenAI call is made. |
| Duplicates: pin the same post twice in the Reddit output | Only one copy reaches Build batch. |
Malformed data: a pinned item with no id or title | Clean posts skips it, the rest of the run continues. |
Removed posts with body [removed] | Dropped in Clean posts. |
| Model returns prose instead of JSON (pin fake output) | Validate and format returns valid: false, the error message posts to Slack, no broken summary goes out. |
| Model invents a post ID | That ID is ignored; a category with no real IDs is dropped. |
| Model invents a category name | It's relabelled as Other. |
Very large input: raise postLimit and add more subreddits | Run completes; if the model errors on size or rate limits, apply the batching fix below. |
| Wrong channel name in Config | Slack node errors with a channel error; fix the name or invite the bot. |
Where it breaks and how to fix it
Most failures fall into five buckets. Here's how each one shows up.
- Auth expiry. Symptom: the Reddit node fails with an unauthorized or token error, or Slack returns
invalid_auth. Fix: open the credential and click Reconnect for Reddit; for Slack, reinstall the app and paste the new bot token. Confirm your Reddit app is still approved, since n8n's Reddit credentials page notes Reddit pre-approves new apps manually. - Reddit rate limits. Symptom: a 429 "too many requests" error on the Reddit node. Reddit's API update states free Data API limits of 100 queries per minute per OAuth client ID with OAuth authentication. The same Reddit page states ten queries per minute without OAuth authentication, which is one more reason to always use the OAuth2 credential. Fix: cut the subreddit list, lower the post limit, or add a Wait node between subreddits. Remember Reddit's Data API Terms say limits can be set and enforced at Reddit's discretion.
- OpenAI rate limits. Symptom: the OpenAI node fails with a rate-limit error on big runs. n8n's OpenAI common-issues page recommends splitting data into smaller chunks and adding a Wait node when OpenAI rate limits are exceeded. Fix: put a Loop Over Items node before Build batch with a batch size you choose, add a Wait node inside the loop, and merge the category results at the end. Also turn on Retry On Fail in the node's Settings tab.
- Schema drift. Symptom: Clean posts outputs nothing, or fields come out empty. Reddit or the node may have renamed a field. Fix: open the Reddit node output, compare field names with the Code node, and update them.
- LLM output errors. Symptom: the error branch fires with "JSON parse failed". Fix: turn on JSON output in the OpenAI node, lower the temperature, and keep the "Return valid JSON only" rule in the system prompt.
- Duplicate runs. Symptom: two identical messages in Slack. Usually two copies of the workflow are active, or the schedule was edited while a run was in progress. Fix: deactivate the extra copy and rely on the Remove Duplicates step, which also blocks repeats from a second run.
Set an Error Workflow under Workflow Settings so crashes outside your error branch still alert you.
Running costs and limits
Costs come from four places. The sources here don't include current pricing pages for n8n, OpenAI or Slack, so check each tool's own billing page before you commit.
- n8n executions. Each scheduled run counts as one execution on n8n Cloud. Self-hosting moves the cost to your server.
- Reddit API calls. One call per subreddit per run in the basic build, more if you page through results or fetch comments. Reddit's API update Commercial use or research beyond the free limits needs a separate agreement under Reddit's Data API Terms.
- OpenAI tokens. You pay per token in and out, so the body cap in Step 4 and the post limit in Config are your main cost levers. Set a monthly spend limit using OpenAI's spend limits guide.
- Slack. Posting with a bot token doesn't add Slack AI features; the search limits on n8n's Slack node page apply only to the AI search operation.
Variations and extensions
- Email digest for people who don't live in Slack. n8n's Reddit and Slack integration page describes scheduled Reddit monitoring, GPT-4 analysis and Slack summaries, and lists Gmail as an additional distribution option. Add a Gmail node on the true branch with the same text.
- Log every run to a sheet. Send each post and its category to Google Sheets or Airtable, so you can see which complaints grow over weeks.
- Competitor watch. Swap the subreddits for ones where your competitors' users post, and add "Switching reasons" to the category list (and to the
ALLOWEDarray). - Support team triage. Point it at your own product's subreddit, run daily, and route only "high" severity categories to the support channel with a second If node.
- Comment depth. Use an HTTP Request node with your Reddit credential to fetch top comments for the highest-scoring posts, then add them to the batch text.
Hand this to ChatGPT or Claude
You can paste the brief below (or this page's link) into an AI assistant and ask it to adapt the build to your subreddits, categories and Slack setup.
GOAL
Build an n8n workflow that collects hot Reddit posts from chosen subreddits,
uses an OpenAI model to group customer pain points into fixed categories,
and posts a linked summary to a Slack channel on a schedule.
TRIGGER
Schedule Trigger, weekly, fixed day and hour, workflow timezone set.
Manual Trigger during build.
STEPS
1. Set node "Config": subreddits (array), postLimit (number), slackChannel (string).
2. Split Out on subreddits -> one item per subreddit.
3. Reddit node: Resource Post, Operation Get Many, Subreddit from item,
Limit from Config, Filter Category Hot, Reddit OAuth2 credential.
4. Code "Clean posts": drop stickied, missing id/title, [removed]/[deleted];
output id, subreddit, title, body (capped), url, score, comments.
5. Remove Duplicates: Remove Items Processed in Previous Executions, dedupe on id.
Always Output Data on.
6. If: id is not empty. False -> optional Slack "no new threads".
7. Code "Build batch": one item with postCount, postsText, posts array.
8. OpenAI node: Message a Model, system + user prompts below, JSON output, low temperature.
9. Code "Validate and format": parse JSON, map categories to allowed list,
keep only real post_ids, build Slack text with <url|title> links,
output valid true/false and slackText or error.
10. If valid -> Slack node Message Send to channel; else Slack error message.
11. Error Workflow set in Workflow Settings.
DATA FIELDS
id, subreddit, title, body, url, score, comments, postCount, postsText,
categories[].name, categories[].summary, categories[].severity,
categories[].post_ids, valid, slackText, error
PROMPTS
System: analyze only provided threads, no invented content, one category per
thread from: Pricing, Onboarding, Bugs and reliability, Missing features,
Support, Integrations, Other; reference by ID; severity high/medium/low;
return JSON only.
User: "Here are {postCount} Reddit threads ... {postsText}"
Schema: {"categories":[{"name","summary","severity","post_ids"}],"skipped_ids":[]}
ACCEPTANCE TESTS
- Normal run posts one message with working links.
- Second run immediately after posts nothing new.
- Duplicate and malformed items are dropped.
- Non-JSON model output triggers the error message, not a broken summary.
- Invented IDs and categories are removed or relabelled Other.
CONSTRAINTS
- Reddit app must be approved; use OAuth2; respect Reddit Data API Terms.
- Add Wait nodes and batching if Reddit or OpenAI rate limits are hit.
- Slack bot token with chat:write; bot invited to channel.
- Never post raw model output.
Frequently Asked Questions
Can I build this without Reddit API approval?
Not with the Reddit node. n8n's Reddit credentials page says Reddit requires manual pre-approval before new apps can be created, so treat approval as the first milestone and build the rest with pinned sample data while you wait.
Why does the workflow skip my manual test runs when deduplicating?
Remove Duplicates and workflow static data track history across executions, and the static-data approach only saves during production runs. Test the dedup step on an activated workflow, or clear the stored history in the node's options before re-testing.
Should I use the AI Agent node instead of Message a Model?
For a fixed job like this, no. An agent adds tool calls and more ways to fail. A single Message a Model call with strict JSON is easier to validate and cheaper to run.
Why does the model sometimes put threads in the wrong category?
Category names that overlap confuse it. Write one-line definitions for each category in the system prompt, keep temperature low, and keep the allowed list short.
Can I post to more than one Slack channel?
Yes. Add a channel field per category in the validation code, or duplicate the Slack node and filter which categories each one receives with an If or Switch node.
How do I include comments, not just post titles?
The built-in node focuses on posts. Use an HTTP Request node with your Reddit OAuth2 credential for comment endpoints, as n8n's Reddit node docs suggest for operations the node doesn't cover.
Your first step
Request Reddit API access today, using the steps in n8n's Reddit credentials page, since approval is the one part you can't speed up. While you wait, build Steps 1, 2, 4 and 7 to 10 with pinned sample posts, so the workflow is ready to switch on the moment your credentials arrive.