{
  "id": "UJIv6WwOVDCJc71Z",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Repurpose blog posts into social media posts with Gemini and log to Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "7d05f974-81af-4b77-aa1e-61d1ba3d8a11",
      "name": "Schedule Daily Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        48,
        48
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "8fcd8cac-961a-4c4a-bda7-a734bd9d07f3",
      "name": "Read Blog Feed",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        304,
        48
      ],
      "parameters": {
        "url": "<__PLACEHOLDER_VALUE__Your blog RSS feed URL (e.g. https://blog.example.com/rss)__>",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "4e1cc358-135d-4661-b263-dde503f02f61",
      "name": "Keep Latest 3 Posts",
      "type": "n8n-nodes-base.code",
      "position": [
        544,
        48
      ],
      "parameters": {
        "jsCode": "return $input.all().slice(0, 3);"
      },
      "typeVersion": 2
    },
    {
      "id": "b302e4c0-fff0-4e5e-a2bc-c22da02389b5",
      "name": "Set Brand Voice",
      "type": "n8n-nodes-base.set",
      "position": [
        848,
        48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "voice",
              "name": "brandVoice",
              "type": "string",
              "value": "Helpful, upbeat and practical. No hype."
            },
            {
              "id": "tags",
              "name": "hashtags",
              "type": "string",
              "value": "#automation #nocode"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "21106709-57df-4bcf-97f7-e74da5c15f60",
      "name": "Build Content Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        1072,
        48
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const cfg = $('Set Brand Voice').item.json;\nconst p = $json;\nconst title = p.title || '';\nconst link = p.link || p.guid || '';\nconst content = p.contentSnippet || p.content || '';\nconst prompt = [\n  'You are a social media manager. Repurpose the blog post into social posts and respond ONLY with minified JSON:',\n  '{\"twitter\": string, \"linkedin\": string}',\n  'Brand voice: ' + (cfg.brandVoice || ''),\n  'Keep the tweet under 280 characters. Add these hashtags where natural: ' + (cfg.hashtags || ''),\n  '',\n  'Title: ' + title,\n  'URL: ' + link,\n  'Excerpt:',\n  content\n].join('\\n');\nreturn { prompt, title, link };"
      },
      "typeVersion": 2
    },
    {
      "id": "1c465627-5f50-44a9-bd4f-cac6e05d3c71",
      "name": "Generate Social Posts with Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1280,
        48
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"contents\": [ { \"parts\": [ { \"text\": $json.prompt } ] } ], \"generationConfig\": { \"temperature\": 0.7, \"responseMimeType\": \"application/json\" } } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googlePalmApi"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "af943a52-16ee-4f43-beb9-a80d051a5e02",
      "name": "Parse Social Posts",
      "type": "n8n-nodes-base.code",
      "position": [
        1504,
        48
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const meta = $('Build Content Prompt').item.json;\nlet text = '';\ntry { text = $json.candidates[0].content.parts[0].text; } catch (e) { text = ''; }\nlet d = {};\ntry { d = JSON.parse(text); } catch (e) { d = { twitter: (text || '').slice(0, 280), linkedin: text || '' }; }\nreturn { title: meta.title, link: meta.link, twitter: d.twitter || '', linkedin: d.linkedin || '' };"
      },
      "typeVersion": 2
    },
    {
      "id": "af6c00a8-5d64-45be-a67f-d9eae4d7be86",
      "name": "Save Drafts to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1792,
        48
      ],
      "parameters": {
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Social Drafts"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Select your spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "a3995b17-17d0-4833-bee8-9c0bc7831e56",
      "name": "Share Drafts for Review",
      "type": "n8n-nodes-base.slack",
      "position": [
        2016,
        48
      ],
      "parameters": {
        "text": "=*:pencil: New social drafts ready for review*\n*Post:* {{ $(\"Parse Social Posts\").item.json.title }}\n*Source:* {{ $(\"Parse Social Posts\").item.json.link }}\n\n*Twitter/X:*\n{{ $(\"Parse Social Posts\").item.json.twitter }}\n\n*LinkedIn:*\n{{ $(\"Parse Social Posts\").item.json.linkedin }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "#social-content"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.5
    },
    {
      "id": "2f83e5da-7043-402f-a7f4-f0acee508aba",
      "name": "Sticky Note d2867cfa",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        -160
      ],
      "parameters": {
        "width": 420,
        "height": 684,
        "content": "## Repurpose blog posts into social media posts with Gemini and log to Sheets\n\n### How it works\nOn a schedule, this template reads your blog RSS feed, takes the latest posts, and asks Google Gemini to rewrite each one into a Twitter/X post and a LinkedIn post in your brand voice. Every draft is saved to a Google Sheet for tracking and shared in Slack so your team can review, tweak and publish.\n\n### Setup\n1. Connect Google Gemini (PaLM) API, Google Sheets and Slack credentials.\n2. In **Read Blog Feed**, paste your blog RSS URL.\n3. In **Set Brand Voice**, describe your tone and default hashtags.\n4. Point **Save Drafts to Sheet** at your spreadsheet and choose a Slack channel.\n\n### Customization tips\nChange how many posts are processed, add more networks to the prompt, or connect an X/LinkedIn node to publish approved drafts automatically."
      },
      "typeVersion": 1
    },
    {
      "id": "7b1c428b-2394-4bbe-8a67-3007b37c1598",
      "name": "Sticky Note c32a3a8a",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 720,
        "height": 364,
        "content": "## 1. Schedule & fetch posts\nRun daily, read the blog RSS feed and keep the latest posts."
      },
      "typeVersion": 1
    },
    {
      "id": "27be41a4-6473-43ff-93ff-9cd96768372c",
      "name": "Sticky Note a5bd5d9b",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 940,
        "height": 380,
        "content": "## 2. AI repurposing\nSet the brand voice, then Gemini writes Twitter/X and LinkedIn posts as JSON."
      },
      "typeVersion": 1
    },
    {
      "id": "f9c14c76-4b3a-493c-8d0a-7a0103c959de",
      "name": "Sticky Note 8f7c4b72",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        -160
      ],
      "parameters": {
        "color": 7,
        "width": 500,
        "height": 380,
        "content": "## 3. Save & share\nSave drafts to Sheets and share them in Slack for review."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "57c60c6b-6022-4f34-bfa5-1811d2c54fb6",
  "nodeGroups": [],
  "connections": {
    "Read Blog Feed": {
      "main": [
        [
          {
            "node": "Keep Latest 3 Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Brand Voice": {
      "main": [
        [
          {
            "node": "Build Content Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Social Posts": {
      "main": [
        [
          {
            "node": "Save Drafts to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Latest 3 Posts": {
      "main": [
        [
          {
            "node": "Set Brand Voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Content Prompt": {
      "main": [
        [
          {
            "node": "Generate Social Posts with Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Drafts to Sheet": {
      "main": [
        [
          {
            "node": "Share Drafts for Review",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Daily Check": {
      "main": [
        [
          {
            "node": "Read Blog Feed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Social Posts with Gemini": {
      "main": [
        [
          {
            "node": "Parse Social Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}