{
  "id": "O9FXr8iXzhSgYKaL",
  "meta": {
    "instanceId": "workflow-c0831c49",
    "versionId": "1.0.0",
    "createdAt": "2025-09-29T07:07:52.069403",
    "updatedAt": "2025-09-29T07:07:52.069427",
    "owner": "n8n-user",
    "license": "MIT",
    "category": "automation",
    "status": "active",
    "priority": "high",
    "environment": "production"
  },
  "name": "Post New YouTube Videos to X",
  "tags": [
    "automation",
    "n8n",
    "production-ready",
    "excellent",
    "optimized"
  ],
  "nodes": [
    {
      "id": "576be5c4-1ed0-4d01-a980-cb2fc31e2223",
      "name": "Post to X",
      "type": "n8n-nodes-base.twitter",
      "position": [
        1280,
        380
      ],
      "parameters": {
        "text": "={{ $json.message.content }}",
        "additionalFields": {}
      },
      "credentials": {
        "twitterOAuth2Api": {
          "id": "FjHOuF0APzoMqIjG",
          "name": "X account"
        }
      },
      "typeVersion": 2,
      "notes": "This twitter node performs automated tasks as part of the workflow."
    },
    {
      "id": "3b87cf2a-51d5-4589-9729-bb1fe3cfceca",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        254.76543209876536
      ],
      "parameters": {
        "color": 3,
        "width": 221.82716049382665,
        "height": 308.7901234567902,
        "content": "🆔 Ensure you enter your YouTube Channel ID in the \"Channel ID\" field of this node. You can find your [Channel ID here]({{ $env.WEBHOOK_URL }}"
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "912e631c-aa43-4e02-9816-b35fe6e62dd8",
      "name": "Generate Post for X with ChatGPT",
      "type": "n8n-nodes-base.noOp",
      "position": [
        900,
        380
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Write an engaging post about my latest YouTube video for X (Twitter) of no more than 140 characters in length. Link to the video at {{ $env.WEBHOOK_URL }}{{ $json.id.videoId }} use this title and description:  {{ $json.snippet.title }}  {{ $json.snippet.description }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "UpdYKqoR9wsGBnaA",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.3,
      "notes": "This openAi node performs automated tasks as part of the workflow."
    },
    {
      "id": "841ee140-7e37-4e9c-8ab2-2a3ee941d255",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        254.5679012345679
      ],
      "parameters": {
        "width": 244.34567901234558,
        "height": 102.81481481481477,
        "content": "**Use AI to Promote Your New YouTube Videos on X**\n\n🎬 Watch the [Setup Video Here]({{ $env.WEBHOOK_URL }}"
      },
      "typeVersion": 1,
      "notes": "This stickyNote node performs automated tasks as part of the workflow."
    },
    {
      "id": "583b7d5d-e5dc-4183-92ee-8135ce6095a8",
      "name": "Fetch Latest Videos",
      "type": "n8n-nodes-base.youTube",
      "position": [
        680,
        380
      ],
      "parameters": {
        "limit": 1,
        "filters": {
          "channelId": "UC08Fah8EIryeOZRkjBRohcQ",
          "publishedAfter": "={{ new Date(new Date().getTime() - 30 * 60000).toISOString() }}"
        },
        "options": {},
        "resource": "video"
      },
      "credentials": {
        "youTubeOAuth2Api": {
          "id": "cVI5wEqeFEeJ81nk",
          "name": "YouTube account"
        }
      },
      "typeVersion": 1,
      "notes": "This youTube node performs automated tasks as part of the workflow."
    },
    {
      "id": "6e391007-10e2-4e67-9db6-e13d5d2bef11",
      "name": "Check Every 30 Min",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        460,
        380
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 30
            }
          ]
        }
      },
      "typeVersion": 1.2,
      "notes": "This scheduleTrigger node performs automated tasks as part of the workflow."
    },
    {
      "id": "error-7f4f2e6f",
      "name": "Error Handler",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        1000,
        400
      ],
      "parameters": {
        "message": "Workflow execution error",
        "options": {}
      }
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": null,
    "timezone": "UTC",
    "executionTimeout": 3600,
    "maxExecutions": 1000,
    "retryOnFail": true,
    "retryCount": 3,
    "retryDelay": 1000
  },
  "versionId": "a321d863-1a58-4100-bf8f-d2af08f11382",
  "connections": {
    "912e631c-aa43-4e02-9816-b35fe6e62dd8": {
      "main": [
        [
          {
            "node": "error-handler-912e631c-aa43-4e02-9816-b35fe6e62dd8-393b82b7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "description": "Automated workflow: Post New YouTube Videos to X. This workflow integrates 6 different services: stickyNote, youTube, scheduleTrigger, stopAndError, twitter. It contains 7 nodes and follows best practices for error handling and security.",
  "notes": "Excellent quality workflow: Post New YouTube Videos to X. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."
}