{
  "name": "Project: Reddit Comment Bot",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "c04166bf-f085-4268-b728-724e63aa3e86",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "operation": "getAll",
        "subreddit": "automation",
        "limit": 50,
        "filters": {}
      },
      "type": "n8n-nodes-base.reddit",
      "typeVersion": 1,
      "position": [
        224,
        0
      ],
      "id": "46d0a6b7-7b89-4b77-9534-f75cc5450094",
      "name": "Get many posts",
      "credentials": {
        "redditOAuth2Api": {
          "id": "Uy4UgYpeaEzF2A4u",
          "name": "Reddit account 2"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "6f4d5ac1-3c75-4a52-9134-7015ee369966",
              "leftValue": "={{ $json.num_comments }}",
              "rightValue": 10,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        448,
        0
      ],
      "id": "7c114a53-7409-41a3-a9dd-5af520f2e634",
      "name": "Filter"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        672,
        0
      ],
      "id": "aac3805d-bea7-4d29-8cd9-acad6286c9e4",
      "name": "Limit"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.selftext }}",
        "options": {
          "systemMessage": "=You are a smart and insightful reddit poster. You are also a bit sarcastic and slightly abrasive, but always nice and positive.\n\nThe user prompt represents the text of a reddit post that you want to comment on. \n\nCreate a comment that is highly relevant to the post, and adds a different perspective. Imagine a new experience or a new way of looking at the topic discussed and come up with a comment.\n\nOutput only the comment text, and nothing else.\nDon't use any emojis or horizontal lines in the text."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        896,
        0
      ],
      "id": "08af1593-6dd9-47ce-add7-0b20a2f6e3f8",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        968,
        224
      ],
      "id": "c488d96b-f8dc-4758-8fbf-2e54c980bf55",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "xHWDVrLvQFklSodD",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "resource": "postComment",
        "postId": "={{ $('Limit').item.json.id }}",
        "commentText": "={{ $json.output }}"
      },
      "type": "n8n-nodes-base.reddit",
      "typeVersion": 1,
      "position": [
        1248,
        0
      ],
      "id": "a1a954fe-4abf-4b80-8a76-328d6fc992f1",
      "name": "Create a comment in a post",
      "credentials": {
        "redditOAuth2Api": {
          "id": "Uy4UgYpeaEzF2A4u",
          "name": "Reddit account 2"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get many posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many posts": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Create a comment in a post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "25646be1-0b37-4941-90ec-3377d498a01f",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "281c34c03b9c41f054c536eeb966e9e503918cf7f00e3bc32a5ff9cca85ca255"
  },
  "id": "oFbOsicbaaJUMqIB",
  "tags": []
}