{
  "name": "Automatically promote your YouTube video on X",
  "nodes": [
    {
      "id": "6aef04f2-b744-4749-99bd-4ad8aa21ad09",
      "name": "Post to X",
      "type": "n8n-nodes-base.twitter",
      "position": [
        1400,
        100
      ]
    },
    {
      "id": "827ab988-786a-490e-8831-cfee3851a9ac",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -100
      ],
      "parameters": {
        "width": 450,
        "height": 970,
        "content": "## Fetch the latest YouTube video and dedupe\n\nEnter your YouTube Channel ID in the \"Channel ID\" field of this node. You can find your [Channel ID here](https://youtube.com/account_advanced)."
      }
    },
    {
      "id": "8e99c377-7d14-473b-a6e4-a190702ad8a9",
      "name": "Fetch Latest Videos",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -500,
        100
      ]
    },
    {
      "id": "c9ea0b72-2293-4aab-84b4-5e6599f5e04d",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        0,
        300
      ]
    },
    {
      "id": "e81decde-6a60-4ea0-a3ff-64cbdccc1f88",
      "name": "Wikipedia",
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "position": [
        120,
        300
      ]
    },
    {
      "id": "870a58ba-6d0f-42e5-ad07-040b8d81e780",
      "name": "Check Every 2 Hours",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -900,
        100
      ]
    },
    {
      "id": "4af4e893-7c94-4a73-9d88-1426be8725f7",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -100
      ],
      "parameters": {
        "width": 637,
        "height": 969,
        "content": "## Validate: Is Post under 240 characters?\nIf the generated tweet does not meet length constraints, regenerate it."
      }
    },
    {
      "id": "8c4f51cd-3e25-4d45-a677-1bf27277c2f8",
      "name": "Calculator2",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        680,
        240
      ]
    },
    {
      "id": "2eff94c8-5ab8-4fba-8480-39d34077784c",
      "name": "GS - Add Tweet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1120,
        100
      ]
    },
    {
      "id": "21f25b2d-e9d3-46df-a2c9-53f3a8c14b8b",
      "name": "GS - Update Tweet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1400,
        300
      ]
    },
    {
      "id": "8ce4484b-a7fd-4988-8240-e9c09a4a00be",
      "name": "When clicking \"Test workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -900,
        300
      ]
    },
    {
      "id": "24f9bc85-8892-4418-8ab6-ef73986adc79",
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        1680,
        100
      ]
    },
    {
      "id": "3526581f-7b71-4396-a3a3-4c676cf1c69b",
      "name": "Remove Duplicates",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        -500,
        300
      ]
    },
    {
      "id": "c152651f-12d3-4766-8b4b-43f93b7b06ee",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -100
      ],
      "parameters": {
        "width": 390,
        "height": 970,
        "content": "## Generate X Post"
      }
    },
    {
      "id": "af1dd938-81f9-464a-865a-2a89882bae90",
      "name": "Generate X Post",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        0,
        100
      ]
    },
    {
      "id": "a522b20c-9cb1-47ec-ab26-d7a444154a51",
      "name": "Set Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -300,
        100
      ]
    },
    {
      "id": "82139047-3ed5-4cc3-9e7e-9567e2f51c20",
      "name": "Wikipedia1",
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "position": [
        800,
        240
      ]
    },
    {
      "id": "6ad77986-f18f-44f0-aff6-fe77282bf55a",
      "name": "Rewrite X Post to 220 Characters",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        680,
        40
      ]
    },
    {
      "id": "e55adf1f-8d1d-4bb6-aa6a-89459fd81773",
      "name": "Verify character limit constraints",
      "type": "n8n-nodes-base.if",
      "position": [
        440,
        100
      ]
    },
    {
      "id": "00beb197-aed5-472d-9515-9f0002cc22ae",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1060,
        -100
      ],
      "parameters": {
        "width": 230,
        "height": 970,
        "content": "## Add to Google Sheet"
      }
    },
    {
      "id": "f871304f-b39f-46ee-8b22-5f0050eb2b8e",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1340,
        -100
      ],
      "parameters": {
        "width": 230,
        "height": 970,
        "content": "## Post to X and update Google Sheet with Post Link"
      }
    },
    {
      "id": "c4d0c37b-658d-4208-9d94-39d27c7d7f36",
      "name": "Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1680,
        300
      ]
    },
    {
      "id": "6caf1d2d-49d2-4b28-9f23-04389bdaa079",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        -100
      ],
      "parameters": {
        "width": 230,
        "height": 970,
        "content": "## Optional functions"
      }
    },
    {
      "id": "c5528fc1-0416-4295-bdaa-12441099f037",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1680,
        500
      ]
    },
    {
      "id": "e9ac1049-9b87-47a5-8fd1-333cc8c77664",
      "name": "Set Final Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        680,
        440
      ]
    },
    {
      "id": "955d51f0-3de9-41f7-a92f-8e7bf9e4d53c",
      "name": "If Array is empty?",
      "type": "n8n-nodes-base.if",
      "position": [
        -300,
        300
      ]
    },
    {
      "id": "c088bbe1-2008-4473-9874-dc5595f082b7",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1000,
        -100
      ],
      "parameters": {
        "width": 390,
        "height": 970,
        "content": "# Use AI to Promote Your Latest YouTube Video on X"
      }
    },
    {
      "id": "03adde36-d864-486a-9190-2e7d27b9f3f2",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1300,
        -100
      ],
      "parameters": {
        "width": 250,
        "height": 970,
        "content": "# AlexK1919 \n![Alex Kim](https://media.licdn.com/dms/image/v2/D5603AQFOYMkqCPl6Sw/profile-displayphoto-shrink_400_400/profile-displayphoto-shrink_400_400/0/1718309808352?e=1736985600&v=beta&t=pQKm7lQf"
      }
    }
  ],
  "connections": {
    "Post to X": {
      "main": [
        [
          {
            "node": "GS - Update Tweet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wikipedia": {
      "ai_tool": [
        [
          {
            "node": "Generate X Post",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "Generate X Post",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Set Fields": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wikipedia1": {
      "ai_tool": [
        [
          {
            "node": "Rewrite X Post to 220 Characters",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator2": {
      "ai_tool": [
        [
          {
            "node": "Rewrite X Post to 220 Characters",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "GS - Add Tweet": {
      "main": [
        [
          {
            "node": "Post to X",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate X Post": {
      "main": [
        [
          {
            "node": "Verify character limit constraints",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Final Fields": {
      "main": [
        [
          {
            "node": "GS - Add Tweet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GS - Update Tweet": {
      "main": [
        []
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "If Array is empty?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Array is empty?": {
      "main": [
        [],
        [
          {
            "node": "Generate X Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Every 2 Hours": {
      "main": [
        []
      ]
    },
    "Fetch Latest Videos": {
      "main": [
        [
          {
            "node": "Set Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Test workflow\"": {
      "main": [
        [
          {
            "node": "Fetch Latest Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rewrite X Post to 220 Characters": {
      "main": [
        [
          {
            "node": "Verify character limit constraints",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify character limit constraints": {
      "main": [
        [
          {
            "node": "Rewrite X Post to 220 Characters",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Final Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}