FindPrompts
n8nSocial MediaIntermediate5 steps

YouTube Video to Twitter Thread

When you publish a new YouTube video, this workflow grabs the transcript, asks GPT to write a punchy 6-tweet thread, and drafts it for review. Repurpose long-form content into social in seconds.

YouTubeOpenAITwitter

How it works

  1. 1Trigger: RSS of your YouTube channel detects a new video
  2. 2Fetch the video transcript via HTTP
  3. 3Generate a 6-tweet thread with GPT
  4. 4Split the thread into individual tweets
  5. 5Post the thread to X / Twitter

Setup

  • Set your YouTube channel_id in the RSS feed url.
  • Point Get Transcript at your transcript provider of choice.
  • Add Twitter/X OAuth2 credentials.
  • Consider routing to a review channel before auto-posting.

Workflow JSON

{
  "name": "YouTube Video to Twitter Thread",
  "nodes": [
    {
      "id": "yt01aa",
      "name": "New YouTube Video",
      "type": "n8n-nodes-base.rssFeedReadTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ],
      "parameters": {
        "feedUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=YOUR_CHANNEL_ID",
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      }
    },
    {
      "id": "yt02bb",
      "name": "Get Transcript",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        300
      ],
      "parameters": {
        "url": "=https://transcript.example.com/api?videoId={{ $json.id }}",
        "method": "GET"
      }
    },
    {
      "id": "yt03cc",
      "name": "Write Thread",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.4,
      "position": [
        680,
        300
      ],
      "parameters": {
        "modelId": "gpt-4o",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "Write an engaging 6-tweet thread. Return JSON: { tweets: string[] }."
            },
            {
              "role": "user",
              "content": "Video title: {{ $json.title }}\nTranscript: {{ $json.transcript }}"
            }
          ]
        },
        "jsonOutput": true
      }
    },
    {
      "id": "yt04dd",
      "name": "Split Tweets",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        900,
        300
      ],
      "parameters": {
        "fieldToSplitOut": "message.content.tweets"
      }
    },
    {
      "id": "yt05ee",
      "name": "Post Tweet",
      "type": "n8n-nodes-base.twitter",
      "typeVersion": 2,
      "position": [
        1120,
        300
      ],
      "parameters": {
        "resource": "tweet",
        "operation": "create",
        "text": "={{ $json['message.content.tweets'] }}"
      }
    }
  ],
  "connections": {
    "New YouTube Video": {
      "main": [
        [
          {
            "node": "Get Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Transcript": {
      "main": [
        [
          {
            "node": "Write Thread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Thread": {
      "main": [
        [
          {
            "node": "Split Tweets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Tweets": {
      "main": [
        [
          {
            "node": "Post Tweet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "meta": {}
}

Command Palette

Search for a command to run...