AutomationFlowsSocial Media › Sub 005 Reddit Ingestion

Sub 005 Reddit Ingestion

SUB-005-reddit-ingestion. Uses executeWorkflowTrigger, rssFeedRead, postgres. Event-driven trigger; 7 nodes.

Event trigger★★★★☆ complexity7 nodesExecute Workflow TriggerRSS Feed ReadPostgres
Social Media Trigger: Event Nodes: 7 Complexity: ★★★★☆ Added:

This workflow follows the Execute Workflow Trigger → Postgres 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
{
  "id": "sub005-reddit-ingestion-0000000",
  "name": "SUB-005-reddit-ingestion",
  "nodes": [
    {
      "parameters": {
        "inputSource": "passthrough"
      },
      "id": "c1000000-0005-0005-0005-000000000001",
      "name": "Trigger",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        240,
        500
      ]
    },
    {
      "parameters": {
        "url": "={{ `https://www.reddit.com/r/${$json.subreddit}/top.rss?limit=25&t=week` }}",
        "options": {}
      },
      "id": "c1000000-0005-0005-0005-000000000002",
      "name": "Fetch Reddit RSS",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [
        460,
        500
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "={{ `SELECT COALESCE((SELECT id FROM raw_research WHERE source_url = '${($json.link||'').replace(/'/g,\"''\")}' LIMIT 1), 0) AS existing_id, '${($json.link||'').replace(/'/g,\"''\")}' AS post_url, '${($json.title||'').replace(/'/g,\"''\")}' AS title, '${($json.contentSnippet||$json.content||$json.title||'').replace(/'/g,\"''\")}' AS content_text` }}",
        "options": {}
      },
      "id": "c1000000-0005-0005-0005-000000000003",
      "name": "Check Duplicate",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.5,
      "position": [
        680,
        500
      ],
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "c1000000-0005-0005-0005-000000000030",
              "leftValue": "={{ $json.existing_id }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "c1000000-0005-0005-0005-000000000004",
      "name": "Is New?",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        900,
        500
      ]
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "={{ `INSERT INTO raw_research (channel_id, source_type, source_url, source_name, content_title, content_text, status, created_at) VALUES (${$('Trigger').item.json.channel_id}, 'reddit', '${($json.post_url||'').replace(/'/g,\"''\")}', 'r/${($('Trigger').item.json.subreddit||'').replace(/'/g,\"''\")}', '${($json.title||'').replace(/'/g,\"''\")}', '${($json.content_text||'').replace(/'/g,\"''\")}', 'ingested', NOW()) RETURNING id` }}",
        "options": {}
      },
      "id": "c1000000-0005-0005-0005-000000000005",
      "name": "Insert Raw Research",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.5,
      "position": [
        1120,
        500
      ],
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "inserted_items",
        "options": {}
      },
      "id": "c1000000-0005-0005-0005-000000000006",
      "name": "Aggregate Results",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        1340,
        500
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "c1000000-0005-0005-0005-000000000040",
              "name": "items_inserted",
              "value": "={{ $json.inserted_items.length }}",
              "type": "number"
            },
            {
              "id": "c1000000-0005-0005-0005-000000000041",
              "name": "subreddit",
              "value": "={{ $('Trigger').item.json.subreddit }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "c1000000-0005-0005-0005-000000000007",
      "name": "Return",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1560,
        500
      ]
    }
  ],
  "connections": {
    "Trigger": {
      "main": [
        [
          {
            "node": "Fetch Reddit RSS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Reddit RSS": {
      "main": [
        [
          {
            "node": "Check Duplicate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Duplicate": {
      "main": [
        [
          {
            "node": "Is New?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is New?": {
      "main": [
        [
          {
            "node": "Insert Raw Research",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Raw Research": {
      "main": [
        [
          {
            "node": "Aggregate Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Results": {
      "main": [
        [
          {
            "node": "Return",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}

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

SUB-005-reddit-ingestion. Uses executeWorkflowTrigger, rssFeedRead, postgres. Event-driven trigger; 7 nodes.

Source: https://github.com/navin-labs/content-factory-os/blob/main/n8n/workflows/subworkflows/SUB-005-reddit-ingestion.json — original creator credit. Request a take-down →

More Social Media workflows → · Browse all categories →

Related workflows

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

Social Media

This workflow is for content creators, marketers, researchers, and anyone who needs to quickly get text transcripts from YouTube videos. If you analyze video content, repurpose it for blogs or social

Stop And Error, RSS Feed Read, HTTP Request +1
Social Media

Automação Tiktok - Full Pipeline. Uses rssFeedRead, httpRequest, writeBinaryFile, executeCommand. Event-driven trigger; 13 nodes.

RSS Feed Read, HTTP Request, Write Binary File +3
Social Media

This template is for advanced users, content teams, and data analysts who need a robust, automated system for capturing YouTube transcripts. It’s ideal for those who monitor multiple channels and want

Supabase, Stop And Error, RSS Feed Read +1
Social Media

Video explanation

HTTP Request, Execute Workflow Trigger, Postgres +1
Social Media

[](https://youtu.be/EtzJmrmCiUY)

Form Trigger, HTTP Request