AutomationFlowsAI & RAG › Reddit Content Q&a Chatbot with Gpt-4o and Reddit API

Reddit Content Q&a Chatbot with Gpt-4o and Reddit API

ByRobert Breen @rbreen on n8n.io

This workflow lets you chat with Reddit using OpenAI and the Reddit API. The chatbot pulls posts from a subreddit and uses GPT to answer your questions. Go to OpenAI Platform Navigate to OpenAI Billing Add funds to your billing account Copy your API key into the OpenAI…

Chat trigger trigger★★★☆☆ complexityAI-powered8 nodesChat TriggerOpenAI ChatReddit ToolAgent
AI & RAG Trigger: Chat trigger Nodes: 8 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #7798 — we link there as the canonical source.

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "f966f105-0988-437e-bebe-84121c89dfe9",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -976,
        2560
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "294fd612-26cd-4383-9581-4f6e669eaac6",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -784,
        2960
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "044ac4e0-5e78-41af-a732-3f584c2779a6",
      "name": "Get many posts in Reddit",
      "type": "n8n-nodes-base.redditTool",
      "position": [
        -224,
        2976
      ],
      "parameters": {
        "limit": 10,
        "filters": {},
        "operation": "getAll",
        "subreddit": "n8n"
      },
      "credentials": {
        "redditOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "df6bb5d2-ac16-4efc-bdba-2be080ee9278",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        2304
      ],
      "parameters": {
        "color": 7,
        "width": 1216,
        "height": 928,
        "content": "# \ud83d\udccb Chat with Reddit (AI + Reddit API)\n\nThis workflow lets you **chat with Reddit** using OpenAI and the Reddit API.  \nThe chatbot pulls posts from a subreddit and uses GPT to answer your questions.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e22689e8-1ff1-4316-aea2-b1a27a870399",
      "name": "Sticky Note25",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        2304
      ],
      "parameters": {
        "width": 400,
        "height": 928,
        "content": "\n## \u2699\ufe0f Setup Instructions\n\n### 2\ufe0f\u20e3 Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n  \n\n---\n\n### 2\ufe0f\u20e3 Set Up Reddit API\n1. Go to [Reddit Apps](https://www.reddit.com/prefs/apps)  \n2. Click **Create App** \u2192 Choose **script** type  \n3. Fill in:  \n   - **Name**: (your choice)  \n   - **Redirect URI**: `http://localhost:8080` (or your n8n URL)  \n   - Save \u2192 copy **Client ID** and **Secret**  \n4. In **n8n \u2192 Credentials \u2192 New \u2192 Reddit OAuth2 API**  \n   - Enter **Client ID** + **Client Secret**  \n   - Log in with your Reddit account and approve access  \n5. Attach this credential to the **Reddit Tool** node  \n\n\n\n## \ud83d\udcec Contact\nNeed help customizing this (e.g., targeting multiple subreddits or filtering posts)?  \n\n- \ud83d\udce7 **robert@ynteractive.com**  \n- \ud83d\udd17 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)**  \n- \ud83c\udf10 **[ynteractive.com](https://ynteractive.com)**\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3b3755cb-eb84-4f10-8419-a18496290b6c",
      "name": "Reddit Chatbot",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -736,
        2512
      ],
      "parameters": {
        "options": {
          "systemMessage": "use the reddit tool to answer user questions. "
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ce415562-f1df-4f57-83ab-56de33c5723c",
      "name": "Sticky Note56",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        2784
      ],
      "parameters": {
        "color": 3,
        "width": 288,
        "height": 304,
        "content": "### 2\ufe0f\u20e3 Set Up OpenAI Connection\n1. Go to [OpenAI Platform](https://platform.openai.com/api-keys)  \n2. Navigate to [OpenAI Billing](https://platform.openai.com/settings/organization/billing/overview)  \n3. Add funds to your billing account  \n4. Copy your API key into the **OpenAI credentials** in n8n  "
      },
      "typeVersion": 1
    },
    {
      "id": "52718d5c-52a0-466f-9603-c586b9c6cb4d",
      "name": "Sticky Note26",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        2528
      ],
      "parameters": {
        "color": 3,
        "width": 288,
        "height": 624,
        "content": "### 2\ufe0f\u20e3 Set Up Reddit API\n1. Go to [Reddit Apps](https://www.reddit.com/prefs/apps)  \n2. Click **Create App** \u2192 Choose **script** type  \n3. Fill in:  \n   - **Name**: (your choice)  \n   - **Redirect URI**: `http://localhost:8080` (or your n8n URL)  \n   - Save \u2192 copy **Client ID** and **Secret**  \n4. In **n8n \u2192 Credentials \u2192 New \u2192 Reddit OAuth2 API**  \n   - Enter **Client ID** + **Client Secret**  \n   - Log in with your Reddit account and approve access  \n5. Attach this credential to the **Reddit Tool** node  \n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Reddit Chatbot",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get many posts in Reddit": {
      "ai_tool": [
        [
          {
            "node": "Reddit Chatbot",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Reddit Chatbot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow lets you chat with Reddit using OpenAI and the Reddit API. The chatbot pulls posts from a subreddit and uses GPT to answer your questions. Go to OpenAI Platform Navigate to OpenAI Billing Add funds to your billing account Copy your API key into the OpenAI…

Source: https://n8n.io/workflows/7798/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Generate Sql Queries From Schema Only Ai Powered. Uses lmChatOpenAi, memoryBufferWindow, noOp, mySql. Chat trigger; 29 nodes.

OpenAI Chat, Memory Buffer Window, MySQL +3
AI & RAG

Generate SQL queries from schema only - AI-powered. Uses lmChatOpenAi, memoryBufferWindow, noOp, mySql. Chat trigger; 29 nodes.

OpenAI Chat, Memory Buffer Window, MySQL +3
AI & RAG

Extract Insights & Analyse Youtube Comments Via Ai Agent Chat. Uses stickyNote, lmChatOpenAi, toolWorkflow, memoryPostgresChat. Chat trigger; 29 nodes.

OpenAI Chat, Tool Workflow, Memory Postgres Chat +5
AI & RAG

Generate SQL queries from schema only - AI-powered. Uses lmChatOpenAi, memoryBufferWindow, noOp, mySql. Chat trigger; 29 nodes.

OpenAI Chat, Memory Buffer Window, MySQL +3
AI & RAG

This workflow is a modification of the previous template on how to create an SQL agent with LangChain and SQLite.

OpenAI Chat, Memory Buffer Window, MySQL +3