{"id":"Xx4zOjRFLI8W9PiC","meta":{"instanceId":"workflow-ff65467f","versionId":"1.0.0","createdAt":"2025-09-29T07:07:50.138097","updatedAt":"2025-09-29T07:07:50.138172","owner":"n8n-user","license":"MIT","category":"automation","status":"active","priority":"high","environment":"production"},"name":"Analyze Reddit Posts with AI to Identify Business Opportunities","nodes":[{"id":"52bdf7eb-ee1a-43c5-a0ad-199283003892","name":"When clicking ‘Test workflow’","type":"n8n-nodes-base.manualTrigger","position":[-1400,-640],"parameters":{},"typeVersion":1,"notes":"This manualTrigger node performs automated tasks as part of the workflow."},{"id":"e9a000b6-2f35-4928-a8d8-aa2d8cc27513","name":"OpenAI Chat Model","type":"n8n-nodes-base.noOp","position":[-360,-760],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini","cachedResultName":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"SOgg2BJ10kvhpBbS","name":"OpenAi account"}},"typeVersion":1,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"id":"cd38a8b6-1369-4209-a80e-9e9949df49c0","name":"OpenAI Chat Model1","type":"n8n-nodes-base.noOp","position":[680,-1080],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"SOgg2BJ10kvhpBbS","name":"OpenAi account"}},"typeVersion":1,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"id":"4749ca62-6061-4dc0-8f1a-b0e995bb3d0f","name":"OpenAI Chat Model2","type":"n8n-nodes-base.noOp","position":[640,-220],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"SOgg2BJ10kvhpBbS","name":"OpenAi account"}},"typeVersion":1,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"id":"ed68c267-9716-4930-b210-d1f1ae89d8c8","name":"Post Sentiment Analysis","type":"n8n-nodes-base.noOp","position":[740,-400],"parameters":{"options":{},"inputText":"={{ $json.postcontent }}"},"typeVersion":1,"notes":"This sentimentAnalysis node performs automated tasks as part of the workflow."},{"id":"2e651e62-00dd-4f0d-a8bc-ce4d8b9fa1d7","name":"Positive Posts Draft","type":"n8n-nodes-base.gmail","position":[1260,-560],"webhookId":"f9dabe4c-9c74-4486-932a-606ea4bb830f","parameters":{"message":"={{ $json.postcontent }}","options":{},"subject":"Positive Post","resource":"draft"},"credentials":{"gmailOAuth2":{"id":"jUQtZvR5i5glEufn","name":"Gmail account"}},"typeVersion":2.1,"notes":"This gmail node performs automated tasks as part of the workflow."},{"id":"29d478d2-43d4-467a-89c2-8c97ea6e245c","name":"Neutral  Posts Draft","type":"n8n-nodes-base.gmail","position":[1280,-380],"webhookId":"f9dabe4c-9c74-4486-932a-606ea4bb830f","parameters":{"message":"={{ $json.postcontent }}","options":{},"subject":"Neutral Post","resource":"draft"},"credentials":{"gmailOAuth2":{"id":"jUQtZvR5i5glEufn","name":"Gmail account"}},"typeVersion":2.1,"notes":"This gmail node performs automated tasks as part of the workflow."},{"id":"c289805f-5246-4f3a-9052-48c426da8ce0","name":"Negative  Posts Draft","type":"n8n-nodes-base.gmail","position":[1280,-160],"webhookId":"f9dabe4c-9c74-4486-932a-606ea4bb830f","parameters":{"message":"={{ $json.postcontent }}","options":{},"subject":"Negative Post","resource":"draft"},"credentials":{"gmailOAuth2":{"id":"jUQtZvR5i5glEufn","name":"Gmail account"}},"typeVersion":2.1,"notes":"This gmail node performs automated tasks as part of the workflow."},{"id":"00d17970-3195-4290-bb02-9956f31ecc8f","name":"Find Proper Solutions","type":"n8n-nodes-base.noOp","position":[840,-1040],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"gpt-4o-mini","cachedResultName":"GPT-4O-MINI"},"options":{},"messages":{"values":[{"content":"=Based on the following Reddit post, suggest a business idea or service that I could create to help this problem for this business and other with similar needs.\n\nReddit post:  \"{{ $json.postcontent }}\"\n\nProvide a concise description of a business idea or service that would adress this issue effectively for mutiple businesses facing similar challenges.\n"}]}},"credentials":{"openAiApi":{"id":"SOgg2BJ10kvhpBbS","name":"OpenAi account"}},"typeVersion":1,"notes":"This openAi node performs automated tasks as part of the workflow."},{"id":"9bcbd874-5eed-47ce-9714-1aec71537fe2","name":"Post Summarization","type":"n8n-nodes-base.noOp","position":[760,-1280],"parameters":{"options":{}},"typeVersion":1,"notes":"This chainSummarization node performs automated tasks as part of the workflow."},{"id":"60991de9-ad29-484c-9233-966cc1980a03","name":"Merge Input","type":"n8n-nodes-base.merge","position":[-80,-700],"parameters":{"mode":"combine","options":{},"combineBy":"combineByPosition"},"typeVersion":3,"notes":"This merge node performs automated tasks as part of the workflow."},{"id":"f78fbea9-5f7f-4a88-bde1-7c3f01613892","name":"Output The Results","type":"n8n-nodes-base.googleSheets","position":[1520,-1260],"parameters":{"columns":{"value":{"Upvotes":"={{ $json.upvotes }}","Post_url":"{{ $env.BASE_URL }}","Post_date":"={{ $json.date }}","Post_summary":"={{ $json.response.text }}","Post_solution":"={{ $json.message.content }}","Subreddit_size":"={{ $json.subreddit_subscribers }}"},"schema":[{"id":"Subreddit","type":"string","display":true,"removed":true,"required":false,"displayName":"Subreddit","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Subreddit_size","type":"string","display":true,"removed":false,"required":false,"displayName":"Subreddit_size","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Post_date","type":"string","display":true,"removed":false,"required":false,"displayName":"Post_date","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Upvotes","type":"string","display":true,"removed":false,"required":false,"displayName":"Upvotes","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Post_url","type":"string","display":true,"removed":false,"required":false,"displayName":"Post_url","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Post_summary","type":"string","display":true,"removed":false,"required":false,"displayName":"Post_summary","defaultMatch":false,"canBeUsedToMatch":true},{"id":"Post_solution","type":"string","display":true,"removed":false,"required":false,"displayName":"Post_solution","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":["test"],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"{{ $env.WEBHOOK_URL }}","cachedResultName":"sheet1"},"documentId":{"__rl":true,"mode":"id","value":"1C8grVByPo3osYiV5X1pWhEUR9NhBXJGXBE75wC5o6rE"}},"credentials":{"googleSheetsOAuth2Api":{"id":"WMi7PlGTPumH5bHV","name":"Google Sheets account"}},"typeVersion":4.5,"notes":"This googleSheets node performs automated tasks as part of the workflow."},{"id":"a0259ed2-0615-4e92-9e7e-cbff8c5bc0ce","name":"Merge 3 Inputs","type":"n8n-nodes-base.merge","position":[1340,-1040],"parameters":{"mode":"combine","options":{},"combineBy":"combineByPosition","numberInputs":3},"typeVersion":3,"notes":"This merge node performs automated tasks as part of the workflow."},{"id":"b7326fd0-5379-42ac-b355-ef6c3c1790f9","name":"Filter Posts By Features","type":"n8n-nodes-base.if","position":[-980,-640],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"0823d10a-ad54-4d82-bcea-9dd236e97857","operator":{"type":"number","operation":"gt"},"leftValue":"={{ $json.ups }}","rightValue":2},{"id":"bb8187aa-f0f1-4999-8d4b-bdc9abba0618","operator":{"type":"string","operation":"notEmpty","singleValue":true},"leftValue":"={{ $json.selftext }}","rightValue":""},{"id":"539f0f5c-025a-4f82-9b3a-2ef1ad3a2d96","operator":{"type":"dateTime","operation":"after"},"leftValue":"={{ DateTime.fromSeconds($json.created).toISO() }}","rightValue":"={{ $today.minus(180,'days').toISO() }}"}]}},"typeVersion":2.2,"notes":"This if node performs automated tasks as part of the workflow."},{"id":"11c45f28-97c0-4087-975c-651f27438956","name":"Filter Posts By Content","type":"n8n-nodes-base.if","position":[180,-680],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"d5d38c01-3a88-4767-b488-d9c04145bb8f","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.output }}","rightValue":"yes"}]}},"typeVersion":2.2,"notes":"This if node performs automated tasks as part of the workflow."},{"id":"efede239-eff5-4e38-b40d-3cefea040644","name":"Select Key Fields","type":"n8n-nodes-base.set","position":[-740,-660],"parameters":{"options":{},"assignments":{"assignments":[{"id":"e5082ecc-3add-474e-bdb5-b8ad64729930","name":"upvotes","type":"string","value":"={{ $json.ups }}"},{"id":"a92b5859-fbcc-40c2-95e0-452b12530d98","name":"subreddit_subscribers","type":"number","value":"={{ $json.subreddit_subscribers }}"},{"id":"a846e21c-6cff-4521-9e0c-a32fa1305376","name":"postcontent","type":"string","value":"={{ $json.selftext }}"},{"id":"b8045389-684d-4872-9e32-9a6b5511eb2b","name":"url","type":"string","value":"={{ $json.url }}"},{"id":"f182fedc-1b09-40fe-aeb5-2473263da442","name":"date","type":"string","value":"={{ DateTime.fromSeconds($json.created).toISO() }}"}]}},"typeVersion":3.4,"notes":"This set node performs automated tasks as part of the workflow."},{"id":"1a99fdaa-6857-4210-a695-71ce531c1fa0","name":"Analysis Content  By AI","type":"n8n-nodes-base.noOp","position":[-460,-940],"parameters":{"text":"Decide whether this reddit post is describing a business-related problem or a need for a solution. The post  should mention a specific challenge \n or requirement that a business is trying to address.\nReddit post:  {{ $json.postcontent }}\nIs this post about a business problem or need for a solution ? Output only yes or no","agent":"conversationalAgent","options":{},"promptType":"define"},"typeVersion":1,"notes":"This agent node performs automated tasks as part of the workflow."},{"id":"72b30080-e1f2-48b4-b816-ff43542cc6f1","name":"Get Posts","type":"n8n-nodes-base.reddit","position":[-1180,-640],"parameters":{"limit":20,"keyword":"YOUR_CREDENTIAL_HERE","operation":"search","subreddit":"=smallbusiness","additionalFields":{"sort":"hot"}},"credentials":{"redditOAuth2Api":{"id":"iX4P4iMPDji7tHjP","name":"Reddit account "}},"typeVersion":1,"notes":"This reddit node performs automated tasks as part of the workflow."},{"id":"c4ecb9ec-4895-4b41-ba7e-185e3769ce41","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-1500,-880],"parameters":{"width":880,"height":440,"content":"# Data Collection\n## Retrieves recent popular posts from specified Reddit communities\n## Filters content by engagement metrics and keywords"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"49735ff9-7f15-4050-9c46-6c13666479bd","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[560,-620],"parameters":{"width":1020,"height":660,"content":"# Post Sentiment Analysis\n## "},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"17048a9e-6080-406e-a4e7-5d57406576e1","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-500,-1160],"parameters":{"color":4,"width":820,"height":680,"content":"# Analysis Content\n## Emerging market needs\n## Underserved customer demands"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"5a412abc-3866-44ba-9ab0-8cc0a3e012f2","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[520,-1480],"parameters":{"color":6,"width":1220,"height":640,"content":"# Insight Generation And Output \n## Generates executive summaries of key opportunities\n## Consolidates findings in Google Sheets"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"error-e4d0ba8f","name":"Error Handler","type":"n8n-nodes-base.stopAndError","typeVersion":1,"position":[1000,400],"parameters":{"message":"Workflow execution error","options":{}}}],"active":false,"settings":{"executionOrder":"v1","saveManualExecutions":true,"callerPolicy":"workflowsFromSameOwner","errorWorkflow":null,"timezone":"UTC","executionTimeout":3600,"maxExecutions":1000,"retryOnFail":true,"retryCount":3,"retryDelay":1000},"versionId":"c78fd7b7-d3e4-48f2-9f82-81ff71ef49a7","connections":{"OpenAI Chat Model":{"main":[[]]},"OpenAI Chat Model1":{"main":[[]]},"OpenAI Chat Model2":{"main":[[]]},"Find Proper Solutions":{"main":[[]]},"Output The Results":{"main":[[]]}},"description":"Automated workflow: Analyze Reddit Posts with AI to Identify Business Opportunities. This workflow integrates 14 different services: stickyNote, agent, merge, reddit, set. It contains 27 nodes and follows best practices for error handling and security.","notes":"Excellent quality workflow: Analyze Reddit Posts with AI to Identify Business Opportunities. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}