{
  "id": "vdPYhuej0NsrNCt2",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Summarize Bitcoin news and post to X with Gemini AI",
  "tags": [],
  "nodes": [
    {
      "id": "f3ab653b-eafd-474b-ae0d-2b4f6e08dd06",
      "name": "Run every 6 hours",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        32,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "af43f10b-dc2d-414d-9cf1-cad94035bd9d",
      "name": "Fetch Bitcoin RSS feed",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        480,
        0
      ],
      "parameters": {
        "url": "https://feeds.feedburner.com/CoinDesk",
        "options": {
          "ignoreSSL": false
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "6d8c576c-f2a6-46b2-bcf9-4c396379f969",
      "name": "Get latest 3 articles",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        704,
        0
      ],
      "parameters": {
        "maxItems": 3,
        "operation": "limit"
      },
      "typeVersion": 3.1
    },
    {
      "id": "f5649e27-95bd-4ff9-b881-b9095e7e72f3",
      "name": "Set config values",
      "type": "n8n-nodes-base.set",
      "position": [
        256,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg-rss-url",
              "name": "config_rss_url",
              "type": "string",
              "value": "https://feeds.feedburner.com/CoinDesk"
            },
            {
              "id": "cfg-post-count",
              "name": "config_articles_to_fetch",
              "type": "number",
              "value": 3
            },
            {
              "id": "cfg-lang",
              "name": "config_tweet_language",
              "type": "string",
              "value": "Japanese"
            },
            {
              "id": "cfg-hashtags",
              "name": "config_hashtags",
              "type": "string",
              "value": "#Bitcoin #BTC #\u4eee\u60f3\u901a\u8ca8"
            },
            {
              "id": "cfg-sheets-id",
              "name": "config_google_sheet_id",
              "type": "string",
              "value": "YOUR_GOOGLE_SHEET_ID_HERE "
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8af9e826-5eee-40cc-a55b-f78d5c3ba49a",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1504,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "URL": "={{ $('Basic LLM Chain').item.json.output.url }}",
            "\u8981\u7d04": "={{ $('Basic LLM Chain').item.json.output.summary }}",
            "\u6295\u7a3f\u65e5\u6642": "={{ $now.toISO() }}",
            "AI\u30b3\u30e1\u30f3\u30c8": "={{ $('Basic LLM Chain').item.json.output.comment }}",
            "\u30cf\u30c3\u30b7\u30e5\u30bf\u30b0": "={{ $('Basic LLM Chain').item.json.output.hashtags }}"
          },
          "schema": [
            {
              "id": "\u6295\u7a3f\u65e5\u6642",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "\u6295\u7a3f\u65e5\u6642",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "\u8981\u7d04",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "\u8981\u7d04",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AI\u30b3\u30e1\u30f3\u30c8",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "AI\u30b3\u30e1\u30f3\u30c8",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "\u30cf\u30c3\u30b7\u30e5\u30bf\u30b0",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "\u30cf\u30c3\u30b7\u30e5\u30bf\u30b0",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "\u30b7\u30fc\u30c81"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "=1-lutnZ0FYNeDwHgf6SrNNLIeqtVkIVnn3rZ4D6JEyQE"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "760e8062-d34b-4de0-ab37-b8ae61e2d1a0",
      "name": "Notify Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1728,
        0
      ],
      "parameters": {
        "text": "=\u2705 Bitcoin news posted to Discord!\n\n\ud83d\udcf0 *{{ $('Get latest 3 articles').item.json.title }}*\n",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#all-\u30de\u30ca\u30d3\u30c8\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "617c907b-7971-495c-852d-6001b8994a56",
      "name": "Sticky Note - Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        -272
      ],
      "parameters": {
        "width": 532,
        "height": 824,
        "content": "## Overview\n\n### How it works\nThis workflow runs every 6 hours and turns Bitcoin news into structured Japanese posts for Discord.\n\n1. Schedule trigger fires every 6 hours\n2. Set config values holds all settings in one place\n3. RSS node fetches the latest 3 CoinDesk articles\n4. Basic LLM Chain sends each article to Gemini 2.5 Flash\n5. Structured Output Parser extracts 4 fields \u2014 summary, comment, URL, hashtags\n6. Post is delivered to Discord via webhook\n7. Each post is logged to Google Sheets\n8. Slack notification confirms every run\n\n### Setup steps\n1. Open Set config values \u2014 fill in your Google Sheet ID, Discord Webhook URL, and hashtags\n2. Add your Google Gemini API credential to the Gemini 2.5 Flash node (free tier works)\n3. Connect your Google Sheets OAuth2 credential\n4. Add your Slack credential and channel ID to the Notify Slack node\n5. Activate the workflow\n\n### Customization\n- Swap the RSS URL in Set config values for a different crypto feed\n- Edit the prompt in Basic LLM Chain to change language or post style\n- Adjust the schedule interval in the trigger node"
      },
      "typeVersion": 1
    },
    {
      "id": "44a3426f-a395-4c00-9fd0-09b9009001bc",
      "name": "Sticky Note - Config",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        304
      ],
      "parameters": {
        "color": 7,
        "width": 232,
        "height": 176,
        "content": "## \u2699\ufe0f Config\n\nAll user settings live here.\nEdit RSS URL, Sheet ID,\nDiscord URL, and hashtags."
      },
      "typeVersion": 1
    },
    {
      "id": "08340013-bf4f-4143-88a0-f030ecb6ebcd",
      "name": "Sticky Note - Ingestion",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        352
      ],
      "parameters": {
        "color": 7,
        "width": 280,
        "content": "## \ud83d\udce1 Data ingestion\n\nFetches RSS and limits output\nto the 3 newest articles to\navoid flooding Discord."
      },
      "typeVersion": 1
    },
    {
      "id": "3d64bc86-9d6a-4a5c-a3f8-487b9fa013b6",
      "name": "Sticky Note - AI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        352
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 192,
        "content": "## \ud83e\udd16 AI processing\n\nGemini 2.5 Flash summarizes\neach article. Structured Output\nParser extracts 4 clean fields."
      },
      "typeVersion": 1
    },
    {
      "id": "8447b13f-e00b-424e-b1e8-0d046457252b",
      "name": "Sticky Note - Distribution",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1312,
        352
      ],
      "parameters": {
        "color": 7,
        "width": 360,
        "content": "## \ud83d\udce4 Distribution & logging\n\nPosts to Discord, logs each\nrecord to Sheets, and pings\nSlack to confirm every run."
      },
      "typeVersion": 1
    },
    {
      "id": "ab7c2139-3e2d-435e-a176-dcfbb114d8c4",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        928,
        0
      ],
      "parameters": {
        "text": "=You are a Bitcoin news analyst and social media expert.\n\nHere is a Bitcoin news article:\nTitle: {{ $json.title }}\nSummary: {{ $json.contentSnippet }}\nURL: {{ $json.link }}\n\nReturn a JSON object with exactly these 4 fields:\n- \"summary\": one-line news summary in Japanese (max 60 chars)\n- \"comment\": your brief AI commentary in Japanese (max 60 chars)\n- \"url\": the article URL as-is\n- \"hashtags\": \"#Bitcoin #BTC #\u4eee\u60f3\u901a\u8ca8\"\n\nRespond ONLY with the JSON object. No explanation, no markdown, no code blocks.",
        "batching": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.9
    },
    {
      "id": "ca104366-9569-4d3b-85ab-623cc2054230",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        936,
        224
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9e364153-4cf0-46ee-ba13-22f25f356a6d",
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        1280,
        0
      ],
      "parameters": {
        "content": "={{ $json.output.summary }}\n{{ $json.output.comment }}\n{{ $json.output.url }}\n{{ $json.output.hashtags }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "c60b84a3-6d62-49e8-9fc8-5976c90685c4",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1064,
        224
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"summary\": \"SBF\u306e\u904e\u53bb\u306e\u653f\u6cbb\u732e\u91d1\u304cNY\u5019\u88dc\u653b\u6483\u306b\u5229\u7528\u3055\u308c\u308b\u4ef6\",\n  \"comment\": \"\u30af\u30ea\u30d7\u30c8\u306e\u8ca0\u306e\u907a\u7523\u304cAI\u653f\u6cbb\u306b\u3082\u5f71\u97ff\u3001\u9577\u671f\u7684\u306a\u6559\u8a13\u306b\u3002\",\n  \"url\": \"https://www.coindesk.com/policy/2026/03/20/sample\",\n  \"hashtags\": \"#Bitcoin #BTC #\u4eee\u60f3\u901a\u8ca8\"\n}"
      },
      "typeVersion": 1.3
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "d47032ca-4408-45d3-a534-3d66fcc220a9",
  "connections": {
    "Discord": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run every 6 hours": {
      "main": [
        [
          {
            "node": "Set config values",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set config values": {
      "main": [
        [
          {
            "node": "Fetch Bitcoin RSS feed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheets": {
      "main": [
        [
          {
            "node": "Notify Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get latest 3 articles": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Bitcoin RSS feed": {
      "main": [
        [
          {
            "node": "Get latest 3 articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}