{
  "id": "TA6dqryAbKV1yAxr",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Twitterbot",
  "tags": [],
  "nodes": [
    {
      "id": "8d163c95-cdfc-4f46-b845-75e07050873d",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4bd9e56d-eff2-4a32-9daa-2ce4925a0bc9",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        220,
        0
      ],
      "parameters": {
        "url": "https://api.perplexity.ai/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n  \"model\": \"sonar-pro\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What are the most important or interesting developments from the last 24\u201348 hours in the [ENTER YOUR TOPIC OR INDUSTRY] space? Include key names, links, and short, high-signal summaries. Prioritize novelty, usefulness, and recency. Keep it concise and skip the fluff.\"\n    }\n  ]\n}\n\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer "
            },
            {
              "name": "Content-type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c76949c3-cef2-4c69-88f4-19d4e25408f9",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        440,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a sharp, human-sounding ghostwriter for high-signal Twitter thought leaders. Your job is to turn raw summaries into compelling tweets that *do not sound AI-generated*. Each tweet should feel like it came from a real person interpreting the data \u2014 with original insight, tone, and rhythm.\n\nAvoid generic phrases and obvious AI patterns. Vary sentence structure, include your own perspective or commentary, and add a touch of edge, humor, or curiosity when appropriate.\n\nUse human rhetorical devices like:\n- Open-ended questions\n- Unfinished thoughts\n- Bold claims\n- Contrarian takes\n- \u201cHere\u2019s the twist\u2026\u201d setups\n\nEach tweet should be designed to spark conversation** \u2014 end with a question, bold statement, or call for opinion.\n"
            },
            {
              "content": "=Here\u2019s a summary of recent developments in [ENTER YOUR TOPIC OR INDUSTRY] industry. Rewrite it as 1 tweet in my voice: intelligent, confident, and human. Don\u2019t just summarize \u2014 interpret.\n\nEach tweet should:\n- Be under 280 characters\n- Avoid sounding like ChatGPT wrote it\n- Include original commentary or interpretation\n- End the thread with a rhetorical hook, question, or challenge to invite replies\n\n{{ $json.choices[0].message.content }}\n"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "20bcd15f-da5a-448e-9ee4-d879bc65bd58",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        816,
        0
      ],
      "parameters": {
        "url": "https://api.twitter.com/2/tweets",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"text\": \"{{ $json.message.content.tweet }}\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "twitterOAuth2Api"
      },
      "credentials": {
        "twitterOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "71509553-6eca-4d9b-92f4-3b1d1ec2b49b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -260
      ],
      "parameters": {
        "color": 4,
        "width": 620,
        "height": 240,
        "content": "\u2705 Automated Daily Tweet Bot\nThis workflow pulls trending insights from Perplexity, summarizes them using OpenAI, and tweets the result.\n\n\ud83e\udde0 Workflow Steps:\nSchedule Trigger \u2013 Runs once per day.\n\nHTTP Request (Perplexity) \u2013 Pulls real-time insights from the web.\n\nOpenAI (GPT) \u2013 Summarizes & formats the insight as a tweet.\n\nHTTP Request (Twitter API) \u2013 Posts the tweet to X/Twitter."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6b632944-7366-4ea2-a260-7d2f5962c60e",
  "connections": {
    "OpenAI": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}