{
  "name": "Create X and LinkedIn posts from Reddit threads with Gemini and human review",
  "nodes": [
    {
      "id": "49e47b33-6ce0-4868-b2ac-46d58de66710",
      "name": "Reddit URL Input",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -336,
        32
      ]
    },
    {
      "id": "685f7307-665f-4fd5-aeb6-b9f107b73279",
      "name": "Parse Reddit URL",
      "type": "n8n-nodes-base.code",
      "position": [
        -48,
        32
      ]
    },
    {
      "id": "e8af925a-9bc6-4538-83dc-6e15cbe98386",
      "name": "Fetch Reddit Thread",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        256,
        32
      ]
    },
    {
      "id": "27751aa7-a183-4791-890a-b0f55352cf87",
      "name": "Extract Thread Content",
      "type": "n8n-nodes-base.code",
      "position": [
        544,
        32
      ]
    },
    {
      "id": "45a3cf91-1a16-4ff9-a17d-017058aa3de5",
      "name": "Summarize Thread",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        816,
        32
      ]
    },
    {
      "id": "d2088a1a-1047-4936-880e-dd5dae44286c",
      "name": "Generate Social Posts",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1200,
        32
      ]
    },
    {
      "id": "ce5e6e7c-41e3-405b-b771-28039757835e",
      "name": "Parse Social Posts",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        32
      ]
    },
    {
      "id": "91133954-3028-45b8-a5a6-e07aab3db8ae",
      "name": "Resolve Final Posts",
      "type": "n8n-nodes-base.code",
      "position": [
        2192,
        32
      ]
    },
    {
      "id": "a536ab57-8cef-4125-8cef-8b0143fbb9ea",
      "name": "Approved?",
      "type": "n8n-nodes-base.if",
      "position": [
        2480,
        32
      ]
    },
    {
      "id": "bdf05261-fac9-476c-89cf-336396b2aaad",
      "name": "Post to Linkedin",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        2672,
        16
      ]
    },
    {
      "id": "eb847f8f-8c5d-4a8b-b12a-77abdc5f4f43",
      "name": "Rejected – End",
      "type": "n8n-nodes-base.set",
      "position": [
        2672,
        208
      ]
    },
    {
      "id": "9f9afd49-2441-469b-b6de-2c6dce5f12ff",
      "name": "Post to X",
      "type": "n8n-nodes-base.twitter",
      "position": [
        2672,
        -176
      ]
    },
    {
      "id": "d1a31113-4edd-46e0-8461-22df915e712a",
      "name": "🗒️ Workflow Summary",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -256
      ],
      "parameters": {
        "width": 604,
        "height": 532,
        "content": "## 🔁 Reddit → Social Media Automation\n\nConverts any Reddit thread into ready-to-publish posts for **X (Twitter)** and **LinkedIn** — with a human review gate before anything goes live.\n\n\n---\n\n\n**📌 Dat"
      }
    },
    {
      "id": "ce07e2c1-3244-40fb-8313-5cd50760b059",
      "name": "🌐 Node: Fetch Reddit Thread",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -256
      ],
      "parameters": {
        "width": 284,
        "height": 528,
        "content": "## 🌐 Fetch Reddit Thread\n**Type:** HTTP Request\n\n**Purpose:** Retrieves the full thread via Reddit's public JSON API.\n\n**Input:** `apiUrl` (e.g. `reddit.com/r/sub/comments/id.json`)\n\n**Function:** GET"
      }
    },
    {
      "id": "fb8c1a4a-84ca-4fc6-9201-7c4e97cb547d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -256
      ],
      "parameters": {
        "width": 256,
        "height": 528,
        "content": "## 📥 Reddit URL Input\n**Type:** Form Trigger\n\n**Purpose:** Entry point — presents a web form to collect a Reddit thread URL from the user.\n\n**Input:** User submits a Reddit thread URL via the form.\n\n\n"
      }
    },
    {
      "id": "8c65fe79-b1a0-4541-a1e8-ee780dcbe283",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -256
      ],
      "parameters": {
        "width": 288,
        "height": 528,
        "content": "## ⚙️ Extract Content\n**Type:** Code (JavaScript)\n\n**Purpose:** Parses raw Reddit JSON into structured, AI-ready content.\n\n**Input:** Raw Reddit API response\n\n**Function:** Extracts post metadata; rec"
      }
    },
    {
      "id": "55e37b0d-7ae1-435e-9dfa-2ef05f1d5af1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -256
      ],
      "parameters": {
        "width": 352,
        "height": 528,
        "content": "## 🧠 Summarize Thread\n**Type:** Google Gemini AI\n\n**Purpose:** Produces a comprehensive markdown summary of the Reddit thread.\n\n**Input:** `threadContent` from Extract node\n\n**Function:** Gemini 3.1 F"
      }
    },
    {
      "id": "3bce0319-33eb-4efb-b421-efe355e3ccdd",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -256
      ],
      "parameters": {
        "width": 368,
        "height": 528,
        "content": "## ✍️ Generate Social Posts\n**Type:** Google Gemini AI\n\n**Purpose:** Creates platform-optimized posts for X and LinkedIn.\n\n**Input:** Thread summary from Summarize node\n\n**Function:** Gemini generates"
      }
    },
    {
      "id": "b3beeef6-1f35-4f8c-bd03-4c13b5cabf8c",
      "name": "Human Approval",
      "type": "n8n-nodes-base.wait",
      "position": [
        1904,
        32
      ]
    },
    {
      "id": "067b6314-8cd7-4b22-aeea-9ac90332c687",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        -256
      ],
      "parameters": {
        "width": 288,
        "height": 528,
        "content": "## 🧹 Parse Social Posts\n**Type:** Code (JavaScript)\n\n**Purpose:** Safely extracts and validates Gemini's JSON response.\n\n**Input:** Raw Gemini API response\n\n**Function:** Strips markdown fences, parse"
      }
    },
    {
      "id": "4fe0405c-4b1d-4fde-9a35-4fd611d07095",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1808,
        -256
      ],
      "parameters": {
        "width": 272,
        "height": 528,
        "content": "## 👤 Human Approval\n**Type:** Wait (Form)\n\n**Purpose:** Pauses the workflow so a human can review posts.\n\n**Input:** `x_post`, `linkedin_post`, `x_char_count`\n\n**Function:** Displays posts in a form. "
      }
    },
    {
      "id": "d36354a5-bd50-4ed3-90bd-55e0a767d9d2",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2096,
        -256
      ],
      "parameters": {
        "width": 288,
        "height": 528,
        "content": "## ✅ Resolve Final Posts\n**Type:** Code (JavaScript)\n\n**Purpose:** Merges human overrides with AI-generated posts.\n\n**Input:** Form data + AI posts (referenced from Parse Social Posts node)\n\n**Functio"
      }
    },
    {
      "id": "b3874ed4-93f9-4dee-af61-67b014f87a3d",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        -256
      ],
      "parameters": {
        "width": 256,
        "height": 528,
        "content": "## 🔀 Approved?\n**Type:** IF Condition\n\n**Purpose:** Routes the workflow based on the human's decision.\n\n**Input:** `Decision` field from Human Approval form\n\n**True →** Post to X + Post to LinkedIn\n\n\n"
      }
    },
    {
      "id": "caf3cccc-4cf9-48af-ab39-b97f61fe9ab3",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2784,
        -256
      ],
      "parameters": {
        "width": 384,
        "height": 208,
        "content": "## 🐦 Post to X\n**Type:** X (Twitter)\n\n**Purpose:** Publishes the final post to X (Twitter).\n\n\n**Input:** `X Post` (≤280 chars) from Resolve Final Posts\n\n**Output:** Live tweet on the connected X accou"
      }
    },
    {
      "id": "551598a4-3eb2-44a7-b14c-5ac1ab8e097e",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2784,
        -32
      ],
      "parameters": {
        "width": 384,
        "height": 192,
        "content": "## 💼 Post to LinkedIn\n**Type:** LinkedIn\n\n**Purpose:** Publishes the final post to LinkedIn.\n\n**Input:** `LinkedIn Post` from Resolve Final Posts\n\n**Output:** Live post on the connected LinkedIn accou"
      }
    },
    {
      "id": "19a0bf37-09c1-4a61-b1c8-b6bd41e6d166",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2784,
        176
      ],
      "parameters": {
        "width": 384,
        "height": 176,
        "content": "## 🚫 Rejected – End\n**Type:** Set\n\n**Purpose:** Graceful termination — nothing is published.\n\n**Input:** Rejection path from Approved? node\n\n**Function:** Sets `status: 'rejected'` and a descriptive m"
      }
    },
    {
      "id": "87f9573d-43dd-4bee-b744-efd26711ffd5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -256
      ],
      "parameters": {
        "width": 288,
        "height": 528,
        "content": "## 🔍 Parse Reddit URL\n**Type:** Code (JavaScript)\n\n**Purpose:** Validates and deconstructs the submitted Reddit URL.\n\n**Input:** Raw URL string\n\n**Function:** Regex extraction of subreddit + post ID. "
      }
    }
  ],
  "connections": {
    "Approved?": {
      "main": [
        [
          {
            "node": "Post to X",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post to Linkedin",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Rejected – End",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Human Approval": {
      "main": [
        [
          {
            "node": "Resolve Final Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Reddit URL": {
      "main": [
        [
          {
            "node": "Fetch Reddit Thread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reddit URL Input": {
      "main": [
        [
          {
            "node": "Parse Reddit URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Thread": {
      "main": [
        [
          {
            "node": "Generate Social Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Social Posts": {
      "main": [
        [
          {
            "node": "Human Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Reddit Thread": {
      "main": [
        [
          {
            "node": "Extract Thread Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Resolve Final Posts": {
      "main": [
        [
          {
            "node": "Approved?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Social Posts": {
      "main": [
        [
          {
            "node": "Parse Social Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Thread Content": {
      "main": [
        [
          {
            "node": "Summarize Thread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}