{
  "name": "YouTube to AI Blog Post",
  "nodes": [
    {
      "id": "7a1b4c22-1111-4aaa-9bbb-000000000001",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "formTitle": "YouTube \u2192 AI Blog Post",
        "formDescription": "Paste a YouTube URL and the video's transcript. The AI will rewrite it as a publish-ready blog post.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "YouTube URL",
              "fieldType": "text",
              "requiredField": true,
              "placeholder": "https://www.youtube.com/watch?v=..."
            },
            {
              "fieldLabel": "Transcript",
              "fieldType": "textarea",
              "requiredField": true,
              "placeholder": "Paste the transcript from YouTube's 'Show transcript' panel"
            },
            {
              "fieldLabel": "Blog Style",
              "fieldType": "dropdown",
              "requiredField": true,
              "fieldOptions": {
                "values": [
                  {
                    "option": "Technical tutorial"
                  },
                  {
                    "option": "Casual explainer"
                  },
                  {
                    "option": "SEO-optimized listicle"
                  },
                  {
                    "option": "Thought-leadership"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "webhookId": "yt-to-blog-form"
    },
    {
      "id": "7a1b4c22-2222-4aaa-9bbb-000000000002",
      "name": "Fetch Video Metadata",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        232,
        0
      ],
      "parameters": {
        "url": "=https://www.youtube.com/oembed?url={{ encodeURIComponent($json['YouTube URL']) }}&format=json",
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      }
    },
    {
      "id": "7a1b4c22-3333-4aaa-9bbb-000000000003",
      "name": "Build Context",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        472,
        0
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "name": "title",
              "value": "={{ $json.title || 'Untitled video' }}",
              "type": "string"
            },
            {
              "name": "channel",
              "value": "={{ $json.author_name || 'Unknown channel' }}",
              "type": "string"
            },
            {
              "name": "url",
              "value": "={{ $('On form submission').item.json['YouTube URL'] }}",
              "type": "string"
            },
            {
              "name": "transcript",
              "value": "={{ $('On form submission').item.json['Transcript'] }}",
              "type": "string"
            },
            {
              "name": "style",
              "value": "={{ $('On form submission').item.json['Blog Style'] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "7a1b4c22-4444-4aaa-9bbb-000000000004",
      "name": "Blog Post Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.5,
      "position": [
        712,
        0
      ],
      "parameters": {
        "promptType": "define",
        "text": "=You are a senior tech editor. Convert the raw YouTube video transcript below into a publish-ready blog post in the style: {{ $json.style }}.\n\nVIDEO METADATA:\n- Title: {{ $json.title }}\n- Channel: {{ $json.channel }}\n- URL: {{ $json.url }}\n\nTRANSCRIPT:\n\"\"\"\n{{ $json.transcript }}\n\"\"\"\n\nOUTPUT REQUIREMENTS (strict):\n1. Return pure Markdown only \u2014 no preamble, no code fences around the whole document.\n2. First line: # <SEO-friendly H1 title under 60 chars>\n3. Second block: > <One-sentence TL;DR (< 160 chars, a direct answer optimized for AI overviews)>\n4. Third block: a 2-sentence intro that hooks the reader and names the video's author.\n5. Body: 3-5 ## H2 sections with meaningful subheadings (not \"Introduction/Conclusion\"). Use short paragraphs, occasional bullets, and at least one table or numbered list where it adds value.\n6. Preserve technical accuracy \u2014 do not invent facts not present in the transcript.\n7. Include an inline linked credit to the original video near the top: [Watch the original on YouTube]({{ $json.url }}).\n8. End with a 3-item \"Takeaways\" bullet list.\n9. No emojis unless the Blog Style is Casual explainer.",
        "messages": {
          "messageValues": []
        },
        "batching": {}
      }
    },
    {
      "id": "7a1b4c22-5555-4aaa-9bbb-000000000005",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        648,
        224
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "options": {}
      }
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "Fetch Video Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Video Metadata": {
      "main": [
        [
          {
            "node": "Build Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Context": {
      "main": [
        [
          {
            "node": "Blog Post Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Blog Post Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null
}