{
  "name": "Project: Twitter Bot",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "7615458b-4f66-45d5-92d7-81be294b7abf",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "url": "https://news.google.com/rss/search?q=AI+tools",
        "options": {}
      },
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.2,
      "position": [
        208,
        0
      ],
      "id": "4460cd96-3b7f-43a7-9231-889bd39c40f5",
      "name": "RSS Read"
    },
    {
      "parameters": {
        "maxItems": 10
      },
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        416,
        0
      ],
      "id": "6594cfa0-0988-4a22-8b64-9629f0f70d4a",
      "name": "Limit"
    },
    {
      "parameters": {
        "jsCode": "const articles = items.map(item => {\n  return `• ${item.json.title} — ${item.json.link}`;\n});\n\nconst prompt = articles.join('\\n');\n\nreturn [\n  {\n    json: {\n      rss_summary_prompt: prompt\n    }\n  }\n];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        624,
        0
      ],
      "id": "5ae4f9d9-add4-422f-b5f6-c4bf689082dc",
      "name": "Code"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.rss_summary_prompt }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=You will receive a number of AI news articles\n\nPick the most impactful or insightful one.\n\nGenerate a tweet from it.\nThe hard character limit for the tweet is 250 characters. Don't go over that.\n\n\nAlso extract the article link and place it in the correct variable in the output. Do not include the link in the tweet, only in the output JSON.\nGenerate 2-4 relevant hashtags and add them to the JSON.\nSame for hashtags, not in the tweet, only in the JSON. When adding hashtags to the output, include the hash for each.\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        832,
        0
      ],
      "id": "e0ece3c9-c053-40da-9e44-cc6dcc746abb",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        704,
        208
      ],
      "id": "2cf67dce-ecbd-4985-9bda-68118342e16c",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "xHWDVrLvQFklSodD",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n\t\"tweet\": \"Tweet\",\n    \"hashtags\": \"Hashtags separated by commas\",\n    \"link\": \"Article link\"\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1008,
        208
      ],
      "id": "12aea612-c0f6-4610-8cd3-ddc415413bd7",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "text": "={{ $json.output.tweet }}\n",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 2,
      "position": [
        1184,
        0
      ],
      "id": "86120b00-6eb4-4e54-a752-cd7c0442db74",
      "name": "Create Tweet",
      "credentials": {
        "twitterOAuth2Api": {
          "id": "NpZ6ILtjirUFwgFG",
          "name": "X account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "RSS Read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RSS Read": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Create Tweet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f623b0b2-f505-40a0-a7c1-671e48112b6d",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "281c34c03b9c41f054c536eeb966e9e503918cf7f00e3bc32a5ff9cca85ca255"
  },
  "id": "yIvSV2q4n1xw8FyS",
  "tags": []
}