ウイルスのなタイトル/サムネイル生成

上級

これはAI, Marketing分野の自動化ワークフローで、41個のノードを含みます。主にIf, Set, Code, Html, Waitなどのノードを使用、AI技術を活用したスマート自動化を実現。 感染拡散型YouTubeタイトルとサム네イル作成の自動化(FLUX.1 + Apify)

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "",
  "meta": {
    "instanceId": "",
    "templateCredsSetupCompleted": true
  },
  "name": "Viral Title/Thumbnail Generation",
  "tags": [],
  "nodes": [
    {
      "id": "--0",
      "name": "ワークフローをクリックしてテスト",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -680,
        20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "--1",
      "name": "待機",
      "type": "n8n-nodes-base.wait",
      "position": [
        2940,
        -240
      ],
      "webhookId": "",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "-1-2",
      "name": "待機1",
      "type": "n8n-nodes-base.wait",
      "position": [
        120,
        20
      ],
      "webhookId": "",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "--3",
      "name": "構造化出力パーサー",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -40,
        220
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"Keyword1\": \"string\",\n\t\"Keyword2\": \"string\",\n    \"Keyword3\": \"string\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "--4",
      "name": "キーワード作成",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -240,
        20
      ],
      "parameters": {
        "text": "=You are a YouTube content strategist. The input of the request is the following content idea :  {{ $json.query }}",
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "message": "=Given a content idea, extract **three keyword phrases** (1–5 words each) that are: \n- Highly relevant for a YouTube search \n- Based on what people would realistically search for \n- Focused on *actions*, *techniques*, or *tools* not just literal parts of the content idea \n- Avoid abstract or vague terms that would not return good search results  \n\nExample:  \nContent Idea: \"Turn a Zoom call into a viral TikTok\" \nOutput: \n1. \"zoom to tiktok edit\" \n2. \"short form video from meetings\"  \n\nReturn ONLY the three keyword phrases, no explanation."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "YTB--5",
      "name": "YTB検索スクレイピング",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        340,
        20
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/streamers~youtube-scraper/runs?token=[YOUR_API_TOKEN]",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"dateFilter\": \"year\",\n    \"lengthFilter\": \"between420\",\n    \"maxResults\": 10,\n    \"searchQueries\": [\n        \"{{ $json.output.Keyword1 }}\",\n        \"{{ $json.output.Keyword2 }}\",\n        \"{{ $json.output.Keyword3 }}\"\n    ],\n    \"sortingOrder\": \"relevance\"\n} ",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "--6",
      "name": "データセット取得",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1320,
        0
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/streamers~youtube-scraper/runs/last/dataset/items?token=[YOUR_API_TOKEN]",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "Mistral-Cloud-Chat-Model-7",
      "name": "Mistral Cloud Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        -240,
        220
      ],
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "credentials": {
        "mistralCloudApi": {
          "id": "",
          "name": "Mistral Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "--8",
      "name": "条件分岐",
      "type": "n8n-nodes-base.if",
      "position": [
        900,
        20
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "SUCCEEDED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "--9",
      "name": "完了確認",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        680,
        20
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/streamers~youtube-scraper/runs/last?token=[YOUR_API_TOKEN]",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "-2-10",
      "name": "待機2",
      "type": "n8n-nodes-base.wait",
      "position": [
        1060,
        200
      ],
      "webhookId": "",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "Mistral-Cloud-Chat-Model1-11",
      "name": "Mistral Cloud Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        2520,
        0
      ],
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "credentials": {
        "mistralCloudApi": {
          "id": "",
          "name": "Mistral Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "CTR--12",
      "name": "CTR計算",
      "type": "n8n-nodes-base.code",
      "position": [
        1520,
        200
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const views = $json.viewCount;\nconst subscribers = $json.numberOfSubscribers;\nconst likes = $json.likes;\nconst comments = $json.commentsCount;\nconst publishedAt = $json.date;// ISO string, e.g. \"2024-05-01T12:00:00Z\"\n\n// Defensive check for missing values\nif (!views || !subscribers || !publishedAt) {\n  return { error: \"Missing required data\" };\n}\n\n// Parse dates\nconst publishedDate = new Date(publishedAt);\nconst now = new Date();\n\n// Validate dates\nif (isNaN(publishedDate.getTime())) {\n  return { error: \"Invalid publishedAt date\" };\n}\n\n// Calculate days since upload\nconst msPerDay = 1000 * 60 * 60 * 24;\nconst timeDiff = now.getTime() - publishedDate.getTime();\nconst daysSinceUpload = Math.floor(timeDiff / msPerDay);\n\n// Compute RPI\nconst rpi = (views / subscribers) * ((likes + comments) / views / 10);\n\n// Apply temporal decay factor\nconst decayFactor = Math.exp(-0.015 * daysSinceUpload);\nconst rpiAdjusted = rpi * decayFactor;\n\n// Calculate Pseudo CTR\nconst ctrScore = rpiAdjusted * 100;\n\nreturn {\n   ctrPercent: parseFloat(ctrScore.toFixed(3)), // ← Your CTR-style %\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "--13",
      "name": "データ統合",
      "type": "n8n-nodes-base.merge",
      "position": [
        1700,
        20
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3
    },
    {
      "id": "--14",
      "name": "タイトル作成",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        3140,
        -240
      ],
      "parameters": {
        "text": "=You are an expert in YouTube video title optimization.",
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "message": "={{ $json.text }}"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "Mistral-Cloud-Chat-Model2-15",
      "name": "Mistral Cloud Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        3060,
        20
      ],
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "credentials": {
        "mistralCloudApi": {
          "id": "",
          "name": "Mistral Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "-1-16",
      "name": "構造化出力パーサー1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3340,
        20
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"title1\": \"string\",\n  \"title2\": \"string\",\n  \"title3\": \"string\",\n  \"title4\": \"string\",\n  \"title5\": \"string\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "--17",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        -980
      ],
      "parameters": {
        "color": 7,
        "width": 780,
        "height": 320,
        "content": "## How this is Working ?\n**1 -** Enter your content idea in the Edit Fields node in a \"raw\" format. Ex : Boil Eggs Perfectly\n**2 -** LLM create 3 keywords request based on the idea and Apify scrape the YTB Search\n**3 -** Wait until the dataset is completed in Apify\n**4 -** Retrieve Dataset from Apify, calculate approximation of CTR and filter top performing videos\n**5 -** LLM analyze patterns of best performing titles and create a prompt based on it. Another LLM create 5 titles based on these criteria\n**6 -** LLM analyze patterns of best performing thumbnails and create a prompt based on it. Another LLM create 1 thumbnail based on these criteria\n**7 -** Return titles and thumbnail in a HTML Page\n\n\n**📺 Youtube Video Tutorial : https://youtu.be/Upuj9Pi94g0**\n**🛠️ Need Help with Your Workflows ? https://tally.so/r/wayeqB**\n**👨‍💻 More Workflows : https://n8n.io/creators/nasser/**"
      },
      "typeVersion": 1
    },
    {
      "id": "-2-18",
      "name": "付箋2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        -640
      ],
      "parameters": {
        "color": 7,
        "width": 780,
        "height": 520,
        "content": "## SETUP\n\n**Setup Input Content Idea :** Enter Keyword Related to the niche you want. Trigger can be replaced with anything as long as you retrieve a content idea. For example : Form submission, Database entry, etc ...\n\nIf you want to change the number of keywords, update the data accordingly in the \"Create Keywords\" LLM Chain node ➡️ Structured Output Parser AND in the \"YTB Search Scrape\" HTTP Request Node in Body ➡️ JSON ➡️ searchQueries.\nIf you want to change the number of scraped videos for each keyword, update the data accordingly in the \"Create Videos Dataset\" HTTP Request Node in Body ➡️ JSON ➡️ maxResults.\nIf you want to adjust the CTR Calculation feel free to update it in the Code Node ➡️ Follow the Comments (after \"//\") to find what you're looking for.\nIf you want to adjust the level of virality of the videos kept for analaysis go to Filter Node ➡️ Value.\n\n**Setup Output HTML Page :** You can also replace this part with any type of storage. For example : Airtable Database, Google Drive/Google Sheet, Send to an email, etc ...\n\n**APIs :** For the following third-party integrations, replace [YOUR_API_TOKEN] with your API Token or connect your account via Client ID / Secret to your n8n instance :\n- Apify : https://docs.apify.com/api/v2/getting-started \n- OpenAI : https://platform.openai.com/docs/overview (base URL : https://api.openai.com/v1) OR OpenRouter : https://openrouter.ai/docs/quickstart (base URL : https://openrouter.ai/api/v1)\n- HuggingFace (FLUX.1) : https://huggingface.co/docs"
      },
      "typeVersion": 1
    },
    {
      "id": "--19",
      "name": "コンテンツアイデア",
      "type": "n8n-nodes-base.set",
      "position": [
        -460,
        20
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "{\n  \"query\": \"create viral title and thumbnail in n8n\"\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "--20",
      "name": "タイトルリスト作成",
      "type": "n8n-nodes-base.code",
      "position": [
        2380,
        -240
      ],
      "parameters": {
        "jsCode": "const titles = items.map(item => item.json.title);\nreturn [{ json: { titles } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "HTML-21",
      "name": "HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        3800,
        40
      ],
      "parameters": {
        "html": "<!DOCTYPE html>\n\n<html>\n<head>\n  <meta charset=\"UTF-8\" />\n  <title>My HTML document</title>\n</head>\n<body>\n  <div class=\"container\">\n    <h1>Thumbnail</h1>\n    <img src=\"data:image/png;base64,{{ $('Convert to Base64').first().json.data }}\" />\n    <h3>Titles</h3>\n    <p>1. {{ $json.output.title1 }}<br>2. {{ $json.output.title2 }}<br>3. {{ $json.output.title3 }}<br>4. {{ $json.output.title4 }}<br>5. {{ $json.output.title5 }}</p>\n  </div>\n</body>\n</html>\n\n<style>\n.container {\n  background-color: #ffffff;\n  text-align: center;\n  padding: 16px;\n  border-radius: 8px;\n}\n\nh1 {\n  color: #ff6d5a;\n  font-size: 24px;\n  font-weight: bold;\n  padding: 8px;\n}\n\nh2 {\n  color: #909399;\n  font-size: 18px;\n  font-weight: bold;\n  padding: 8px;\n}\n</style>\n\n<script>\nconsole.log(\"Hello World!\");\n</script>"
      },
      "typeVersion": 1.2
    },
    {
      "id": "--22",
      "name": "アイテムループ処理",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2260,
        520
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "--23",
      "name": "画像分析",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2500,
        540
      ],
      "parameters": {
        "text": "=You are an expert in YouTube thumbnail performance. Your job is to analyze why a thumbnail might be performing well and describe it precisely so a designer or AI can later recreate its essence.\n\nYou will receive:\n- The subject of the video : {{ $('Content Idea').first().json.query }}\n- The URL of the thumbnail image : {{ $json.thumbnailUrl }}\n\nYour goal:\n1. Analyze the thumbnail's visual elements (faces, text, colors, emotions, layout, contrast, focus, etc.)\n2. Identify what makes it visually compelling or attention-grabbing\n3. Relate your analysis back to the video’s subject\n4. Return a structured and precise description of the thumbnail that could be reused to generate a similar performing image.\n\nRespond only with the description. Do not add anything else.",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "meta-llama/llama-3.2-11b-vision-instruct:free",
          "cachedResultName": "META-LLAMA/LLAMA-3.2-11B-VISION-INSTRUCT:FREE"
        },
        "options": {},
        "resource": "image",
        "simplify": false,
        "imageUrls": "={{ $json.thumbnailUrl }}",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "id": "",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "-3-24",
      "name": "待機3",
      "type": "n8n-nodes-base.wait",
      "position": [
        2780,
        720
      ],
      "webhookId": "",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "--25",
      "name": "統合",
      "type": "n8n-nodes-base.merge",
      "position": [
        3580,
        40
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "Mistral-Cloud-Chat-Model3-26",
      "name": "Mistral Cloud Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        2680,
        460
      ],
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "credentials": {
        "mistralCloudApi": {
          "id": "",
          "name": "Mistral Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "--27",
      "name": "プロンプト作成",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2620,
        280
      ],
      "parameters": {
        "text": "You are an expert visual prompt engineer.",
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "message": "=You are an expert visual prompt engineer.\n\nYou are given several thumbnail analysis texts, each describing what made a YouTube thumbnail visually engaging and effective. \n\nData for you : \n- The Content Idea : {{ $('Content Idea').first().json.query }}\n- The Analysis of performing Thumbnails for this idea : {{ $json.analysis}}\n\n\nYour job is to:\n1. **Summarize the most common and impactful visual elements** across all analyses.\n2. **Generate one precise image prompt** that captures the best-performing elements, ready to be used with an image generation model (like DALL·E, Midjourney, or Stable Diffusion).\nMandatory : \n- Maximum 400 characters (including spaces and punctuations) !\n- When generating the prompt text, make sure that any double quotes within the string are escaped using a backslash (\\\") so that the final output can be safely included in a JSON object.\n\n📥 Input: A list of thumbnail descriptions and visual analyses.\n🎯 Goal: One image prompt that includes clear guidance on:\n- Subject placement and expression\n- Colors and contrast\n- Text style or layout (if any)\n- Graphic or visual elements\n- Overall layout or composition\n- Mood or tone (e.g. excitement, curiosity, professionalism)\n\n⚠️ Don't describe what you’re doing. Just output the final image prompt.\n\n📌 Example output format:\nA high-contrast YouTube thumbnail with a confident man on the right side, bold yellow text on the left saying \"AI SECRETS\", a dark tech-themed background, and digital data stream effects in the back — cinematic lighting, 16:9 composition."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "--28",
      "name": "分析リスト作成",
      "type": "n8n-nodes-base.code",
      "position": [
        2440,
        280
      ],
      "parameters": {
        "jsCode": "const analysis = items.map(item => item.json.choices[0].message.content);\n\nreturn [\n  {\n    json: {\n      analysis\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "--29",
      "name": "画像生成",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3120,
        280
      ],
      "parameters": {
        "url": "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-dev",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "jsonBody": "={\n  \"inputs\":\"{{ $json.text }}\",\n  \"parameters\": {\n    \"height\": 720,\n    \"width\": 1280,\n    \"num_inference_steps\": 30,\n    \"guidance_scale\": 8.0\n  }\n}\n",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer [YOUR_API_TOKEN]"
            },
            {
              "name": "Accept",
              "value": "image/png"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "Base64--30",
      "name": "Base64変換",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        3320,
        280
      ],
      "parameters": {
        "options": {
          "encoding": "base64"
        },
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "-3-31",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        -100
      ],
      "parameters": {
        "color": 7,
        "width": 460,
        "height": 360,
        "content": "## 1- Input\nEnter your content idea in the Edit Fields node in a \"raw\" format. Ex : Boil Eggs Perfectly"
      },
      "typeVersion": 1
    },
    {
      "id": "-4-32",
      "name": "付箋4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -100
      ],
      "parameters": {
        "color": 7,
        "width": 820,
        "height": 480,
        "content": "## 2- Create DataSet\nLLM create 3 keywords request based on the idea and Apify scrape the YTB Search"
      },
      "typeVersion": 1
    },
    {
      "id": "-5-33",
      "name": "付箋5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -100
      ],
      "parameters": {
        "color": 7,
        "width": 680,
        "height": 520,
        "content": "## 3 - Wait for DataSet Completion\nWait until the dataset is completed in Apify"
      },
      "typeVersion": 1
    },
    {
      "id": "-6-34",
      "name": "付箋6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        -100
      ],
      "parameters": {
        "color": 7,
        "width": 860,
        "height": 460,
        "content": "## 4- Filter Performing Videos\nRetrieve Dataset from Apify, calculate approximation of CTR and filter top performing videos"
      },
      "typeVersion": 1
    },
    {
      "id": "-7-35",
      "name": "付箋7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2140,
        -340
      ],
      "parameters": {
        "color": 7,
        "width": 1340,
        "height": 500,
        "content": "## 5- Generate Titles\nLLM analyze patterns of best performing titles and create a prompt based on it. Another LLM create 5 titles based on these criteria"
      },
      "typeVersion": 1
    },
    {
      "id": "-8-36",
      "name": "付箋8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2140,
        180
      ],
      "parameters": {
        "color": 7,
        "width": 1340,
        "height": 760,
        "content": "## 6- Generate Thumbnail\nLLM analyze patterns of best performing thumbnails and create a prompt based on it. Another LLM create 1 thumbnail based on these criteria"
      },
      "typeVersion": 1
    },
    {
      "id": "-9-37",
      "name": "付箋9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3500,
        -100
      ],
      "parameters": {
        "color": 7,
        "width": 520,
        "height": 360,
        "content": "## 7- Output\nReturn titles and thumbnail in a HTML Page"
      },
      "typeVersion": 1
    },
    {
      "id": "--38",
      "name": "高パフォーマンス動画の選別",
      "type": "n8n-nodes-base.filter",
      "position": [
        1900,
        20
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.ctrPercent }}",
              "rightValue": 0.1
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "--39",
      "name": "パターン分析とプロンプト作成",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2600,
        -240
      ],
      "parameters": {
        "text": "=You are an expert in YouTube video title optimization. Here is your input : \n{{ $json.titles.join('\\n') }}",
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "message": "=You will be given a list of YouTube video titles that ranked highly for a specific keyword or topic. For information the topic of the video is : {{ $('Content Idea').first().json.query }}\nYour task is to:  \n1. Analyze the title list for patterns, such as:  \n- Repeating structures or formats (e.g., “How to…”, “Top X…”, “This Changed Everything”)  \n- Use of numbers, brackets, capital letters, emotional hooks, urgency, etc.  \n- Word combinations or topic angles (e.g., “AI Automation for Creators” vs. “Build AI Tools with No Code”)  \n2. Summarize what makes these titles effective (mandatory : be as precise as possible in 5-15 points). \n3. Based on your analysis, generate a prompt for another AI language model. This prompt will instruct the second model to generate new YouTube titles for the same keyword/topic, using the same high-performing structure, tone, and techniques.  \n\n⚠️ Make sure the new prompt:  \n- Clearly instructs the LLM to follow identified title patterns.  - Tells it to generate clickable, short, high-performing YouTube titles. \n- Avoids common spammy phrasing or clickbait that doesn’t match the original tone.  \n\n✅ Format your response like this:\nPATTERN SUMMARY:\n- Point 1\n- Point 2\n- Point 3\n\nPROMPT:\n\"Create 5 YouTube video titles about [TOPIC] using the following format:\n- [Insert pattern or tone summary]\n- Each title should be under 60 characters, engaging, and based on the provided structure.\"\n\n📥 Example Input (titles):\n- 5 AI Tools That Will Replace Your Job in 2025\n- The Best No-Code AI Tool You’re Not Using Yet\n- I Built an AI Business with $0 (Full Tutorial)\n- How to Automate Everything with AI Agents\n- This Free AI Tool Blew My Mind\n\n🧠 Expected Output:\nPATTERN SUMMARY:\n- Uses emotional triggers like fear or curiosity (“Replace Your Job”, “Blew My Mind”)\n- Often includes numbers or power words (“5 Tools”, “Best”, “Free”)\n- Many titles promise results or value (“Full Tutorial”, “Automate Everything”)\n\nPROMPT:\n\"Create 5 YouTube video titles about AI automation tools for solo creators using this format:\n- Include emotional or curiosity-based phrases\n- Use numbers or power words when relevant\n- Promise a clear value or benefit in the title\nEach title should be under 60 characters and match the tone of the top-ranking videos.\"\n"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "-4-40",
      "name": "待機4",
      "type": "n8n-nodes-base.wait",
      "position": [
        2940,
        280
      ],
      "webhookId": "",
      "parameters": {},
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "--8": {
      "main": [
        [
          {
            "node": "--6",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "-2-10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--1": {
      "main": [
        [
          {
            "node": "--14",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--25": {
      "main": [
        [
          {
            "node": "HTML-21",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "-1-2": {
      "main": [
        [
          {
            "node": "YTB--5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "-2-10": {
      "main": [
        [
          {
            "node": "--9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "-3-24": {
      "main": [
        [
          {
            "node": "--22",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "-4-40": {
      "main": [
        [
          {
            "node": "--29",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--13": {
      "main": [
        [
          {
            "node": "--38",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--6": {
      "main": [
        [
          {
            "node": "CTR--12",
            "type": "main",
            "index": 0
          },
          {
            "node": "--13",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--19": {
      "main": [
        [
          {
            "node": "--4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--23": {
      "main": [
        [
          {
            "node": "-3-24",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CTR--12": {
      "main": [
        [
          {
            "node": "--13",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "--27": {
      "main": [
        [
          {
            "node": "-4-40",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--14": {
      "main": [
        [
          {
            "node": "--25",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--29": {
      "main": [
        [
          {
            "node": "Base64--30",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--4": {
      "main": [
        [
          {
            "node": "-1-2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--22": {
      "main": [
        [
          {
            "node": "--28",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "--23",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--9": {
      "main": [
        [
          {
            "node": "--8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Base64--30": {
      "main": [
        [
          {
            "node": "--25",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "YTB--5": {
      "main": [
        [
          {
            "node": "--9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--20": {
      "main": [
        [
          {
            "node": "--39",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--28": {
      "main": [
        [
          {
            "node": "--27",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral-Cloud-Chat-Model-7": {
      "ai_languageModel": [
        [
          {
            "node": "--4",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "--3": {
      "ai_outputParser": [
        [
          {
            "node": "--4",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Mistral-Cloud-Chat-Model1-11": {
      "ai_languageModel": [
        [
          {
            "node": "--39",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Mistral-Cloud-Chat-Model2-15": {
      "ai_languageModel": [
        [
          {
            "node": "--14",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Mistral-Cloud-Chat-Model3-26": {
      "ai_languageModel": [
        [
          {
            "node": "--27",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "-1-16": {
      "ai_outputParser": [
        [
          {
            "node": "--14",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "--38": {
      "main": [
        [
          {
            "node": "--22",
            "type": "main",
            "index": 0
          },
          {
            "node": "--20",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--39": {
      "main": [
        [
          {
            "node": "--1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--0": {
      "main": [
        [
          {
            "node": "--19",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

上級 - 人工知能, マーケティング

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
上級
ノード数41
カテゴリー2
ノードタイプ16
難易度説明

上級者向け、16ノード以上の複雑なワークフロー

作成者
Nasser

Nasser

@nasser

Data Engineer, now automating processes mostly with n8n, Make and code

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34