AutomationFlowsAI & RAG › Reddit Approved to Drafts

Reddit Approved to Drafts

Reddit Approved to Drafts. Uses googleSheets, httpRequest, openAi. Scheduled trigger; 10 nodes.

Cron / scheduled trigger★★★★☆ complexityAI-powered10 nodesGoogle SheetsHTTP RequestOpenAI
AI & RAG Trigger: Cron / scheduled Nodes: 10 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Google Sheets → HTTP Request 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
{
  "name": "Reddit Approved to Drafts",
  "nodes": [
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyX",
              "value": 10,
              "unit": "minutes"
            }
          ]
        }
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": "1n8TfxlswtIVqHgRg7JOkUri6BQa9NYrTTGqDZXOmGxY",
        "sheetName": "Reddit_Inbox"
      },
      "name": "Read Inbox",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        440,
        300
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "functionCode": "const rows = $json.data || [];\nconst approved = rows.filter(r => (r.status || '').toLowerCase() === 'approved');\nreturn approved.map(r => ({ json: r }));"
      },
      "name": "Filter Approved",
      "type": "n8n-nodes-base.function",
      "typeVersion": 2,
      "position": [
        640,
        300
      ]
    },
    {
      "parameters": {
        "operation": "lookup",
        "documentId": "1n8TfxlswtIVqHgRg7JOkUri6BQa9NYrTTGqDZXOmGxY",
        "sheetName": "Comment_Drafts",
        "lookupColumn": "post_id",
        "lookupValue": "={{$json.post_id}}"
      },
      "name": "Drafts Dedup Lookup",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        840,
        300
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "functionCode": "const found = $json?.matchedRow || $json?.data || null;\nif (found && Array.isArray(found) && found.length > 0) return [];\nreturn [{ json: $input.first().json }];"
      },
      "name": "If Not Already Drafted",
      "type": "n8n-nodes-base.function",
      "typeVersion": 2,
      "position": [
        1040,
        300
      ]
    },
    {
      "parameters": {
        "url": "={{$json.post_url.endsWith('/') ? $json.post_url + '.json' : $json.post_url + '/.json'}}",
        "options": {
          "responseFormat": "json"
        }
      },
      "name": "Fetch Thread JSON",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1240,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "const body = $json;\nconst post = body?.[0]?.data?.children?.[0]?.data || {};\nconst comments = body?.[1]?.data?.children || [];\n\nconst topComments = comments\n  .map(c => c?.data)\n  .filter(d => d && d.body)\n  .slice(0, 5)\n  .map(d => d.body);\n\nreturn [{\n  json: {\n    post_id: post.id || $input.first().json.post_id,\n    post_url: post.permalink ? 'https://www.reddit.com' + post.permalink : $input.first().json.post_url,\n    title: post.title || $input.first().json.title,\n    postText: post.selftext || '',\n    topComments\n  }\n}];"
      },
      "name": "Extract Post + Comments",
      "type": "n8n-nodes-base.function",
      "typeVersion": 2,
      "position": [
        1440,
        300
      ]
    },
    {
      "parameters": {
        "model": "gpt-4o-mini",
        "messages": [
          {
            "role": "system",
            "content": "You are writing a Reddit comment. Be helpful. Plain language. No links. No selling. Do not say DM me. No hype. No emojis. End with a question. If uncertain, ask a clarifying question instead of guessing."
          },
          {
            "role": "user",
            "content": "Post title: {{$json.title}}\n\nPost text: {{$json.postText}}\n\nTop comments:\n- {{($json.topComments || []).join('\\n- ')}}\n\nWrite:\n1) A one-sentence summary of what the OP is really asking.\n2) 3 bullet points a local would mention.\n3) A 6-10 sentence draft reply. End with a question."
          }
        ]
      },
      "name": "OpenAI Draft",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 4,
      "position": [
        1640,
        300
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "functionCode": "const text = $json?.choices?.[0]?.message?.content || '';\nconst parts = text.split(/\\n\\n+/);\nconst summary = parts[0] || '';\nconst bullets = parts.find(p => p.trim().startsWith('-')) || '';\nconst draft = parts.slice(1).join('\\n\\n');\n\nconst cleaned = draft\n  .replace(/https?:\\/\\/\\S+/g, '')\n  .replace(/\\bDM me\\b/gi, '')\n  .trim();\n\nreturn [{\n  json: {\n    post_id: $input.first().json.post_id,\n    post_url: $input.first().json.post_url,\n    summary_of_question: summary.trim(),\n    key_points_to_address: bullets.trim(),\n    draft_comment: cleaned,\n    needs_edit: 'yes',\n    posted: 'no',\n    created_at: new Date().toISOString()\n  }\n}];"
      },
      "name": "Parse + Clean",
      "type": "n8n-nodes-base.function",
      "typeVersion": 2,
      "position": [
        1840,
        300
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": "1n8TfxlswtIVqHgRg7JOkUri6BQa9NYrTTGqDZXOmGxY",
        "sheetName": "Comment_Drafts",
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "post_id": "={{$json.post_id}}",
            "post_url": "={{$json.post_url}}",
            "summary_of_question": "={{$json.summary_of_question}}",
            "key_points_to_address": "={{$json.key_points_to_address}}",
            "draft_comment": "={{$json.draft_comment}}",
            "needs_edit": "={{$json.needs_edit}}",
            "posted": "={{$json.posted}}",
            "created_at": "={{$json.created_at}}"
          }
        }
      },
      "name": "Append to Comment_Drafts",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        2040,
        300
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "Read Inbox",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Inbox": {
      "main": [
        [
          {
            "node": "Filter Approved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Approved": {
      "main": [
        [
          {
            "node": "Drafts Dedup Lookup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Drafts Dedup Lookup": {
      "main": [
        [
          {
            "node": "If Not Already Drafted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Not Already Drafted": {
      "main": [
        [
          {
            "node": "Fetch Thread JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Thread JSON": {
      "main": [
        [
          {
            "node": "Extract Post + Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Post + Comments": {
      "main": [
        [
          {
            "node": "OpenAI Draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Draft": {
      "main": [
        [
          {
            "node": "Parse + Clean",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse + Clean": {
      "main": [
        [
          {
            "node": "Append to Comment_Drafts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}

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

Reddit Approved to Drafts. Uses googleSheets, httpRequest, openAi. Scheduled trigger; 10 nodes.

Source: https://gist.github.com/aamandel91/7d2d77286e2cf8aea0a041290fac8a10 — 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

AI Institutional Stock Valuation Engine with Risk Scoring & Scenario Targets

Google Sheets, XML, HTTP Request +3
AI & RAG

Overview This is a production-grade, fully automated stock analysis system built entirely in n8n. It combines institutional-level financial analysis, dual AI model consensus, and a self-improving back

Google Sheets, XML, HTTP Request +3
AI & RAG

This automation is a complete end-to-end system designed to find, qualify, and contact B2B leads — fully automated and powered by AI. Searches for target companies on LinkedIn via Ghost Genius API, us

Google Sheets, HTTP Request, OpenAI +1
AI & RAG

This comprehensive n8n automation template orchestrates a complete end-to-end workflow for generating engaging short-form Point-of-View (POV) style videos using multiple AI services and automatically

HTTP Request, OpenAI, Google Drive +4
AI & RAG

A professional AI equity analysis automation built on n8n that transforms structured financial data and real-time news into disciplined, risk-adjusted price targets and actionable BUY/HOLD/SELL signal

Google Sheets, OpenAI, XML +3