Générateur de métadonnées YTB

Avancé

Ceci est unAI, Marketingworkflow d'automatisation du domainecontenant 22 nœuds.Utilise principalement des nœuds comme If, Code, Wait, YouTube, HttpRequest, combinant la technologie d'intelligence artificielle pour une automatisation intelligente. Générer des métadonnées de vidéo YouTube (horodatages, étiquettes, descriptions, etc.)

Prérequis
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "",
  "meta": {
    "instanceId": "",
    "templateCredsSetupCompleted": true
  },
  "name": "YTB Metadata Generator",
  "tags": [],
  "nodes": [
    {
      "id": "Mistral-Cloud-Chat-Model-0",
      "name": "Mistral Cloud Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        700,
        -40
      ],
      "parameters": {
        "model": "mistral-large-latest",
        "options": {}
      },
      "credentials": {
        "mistralCloudApi": {
          "id": "",
          "name": "Mistral Cloud account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "Aucune-op-ration-do-nothing-1",
      "name": "Aucune opération, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -440,
        120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "Structured-Output-Parser-2",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        860,
        -40
      ],
      "parameters": {
        "jsonSchemaExample": "[\n  {\n    \"name\": \"preview\",\n    \"type\": \"string\",\n    \"description\": \"Short preview (100–200 characters, no hashtags)\"\n  },\n  {\n    \"name\": \"timestamps\",\n    \"type\": \"string\",\n    \"description\": \"YouTube-style timestamps, each on a new line, starts with 00:00\"\n  },\n  {\n    \"name\": \"tags\",\n    \"type\": \"string\",\n    \"description\": \"Comma-separated keywords (no hashtags)\"\n  }\n]\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "Aucune-op-ration-do-nothing1-3",
      "name": "Aucune opération, do nothing1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        700,
        100
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "Check-Si-Finished-4",
      "name": "Check Si Finished",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -160,
        -80
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/streamers~youtube-scraper/runs/last?token=[YOUR_API_TOKEN]",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "Get-DataD-finir-5",
      "name": "Get DataDéfinir",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        -100
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/streamers~youtube-scraper/runs/last/dataset/items?token=[YOUR_API_TOKEN]",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "Scrape-Video-6",
      "name": "Scrape Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -440,
        -80
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/streamers~youtube-scraper/runs?token=[YOUR_API_TOKEN]",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"downloadSubtitles\": true,\n    \"preferAutoGeneratedSubtitles\": false,\n    \"startUrls\": [\n        {\n            \"url\": \"{{ $('Trigger New Video Posted').item.json.link }}\",\n            \"method\": \"GET\"\n        }\n    ],\n    \"subtitlesLanguage\": \"en\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "If-Finished-7",
      "name": "If Finished",
      "type": "n8n-nodes-base.if",
      "position": [
        20,
        -80
      ],
      "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": "Attendre-8",
      "name": "Attendre",
      "type": "n8n-nodes-base.wait",
      "position": [
        180,
        120
      ],
      "webhookId": "",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "If-Recent-9",
      "name": "If Recent",
      "type": "n8n-nodes-base.if",
      "position": [
        -660,
        20
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ new Date($json[\"pubDate\"]).getTime() }}",
              "rightValue": "={{ new Date().getTime() - 10 * 60 * 1000 }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "If-Not-Generated-10",
      "name": "If Not Generated",
      "type": "n8n-nodes-base.if",
      "position": [
        460,
        -100
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.text }}",
              "rightValue": "00:00"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "Generate-Description-11",
      "name": "Generate Description",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        700,
        -200
      ],
      "parameters": {
        "text": "You are given the full script of a YouTube video. Your task is to extract metadata in a structured format to be used in a YouTube upload.",
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "message": "=Script Input:\n{{ $json.subtitles[0].srt }}\n\nFinal Output Format:\n\nPreview:\n[short preview description]\n\nTimestamps:\n00:00 [Title]\n00:30 [Title]\n...\n\nTags:\ntag1,tag2,tag3,...\n\nFollow these instructions strictly:\n\n1. Short Preview Description\nWrite a short preview (100–200 characters max) of the video.\nUse engaging language, and include relevant keywords from the topic of the video.\nThis should be a single sentence or two, no hashtags, no line breaks.\n\n2. Timestamps\nFormat: MM:SS Timestamp Title (each on a new line)\nMust start with 00:00\nEach timestamp section must be at least 30 seconds apart\nOnly 3 to 7 total timestamps\nEach timestamp title should be maximum 3 words, summarize the section clearly\nExample format:\n\"00:00 Intro  \n00:47 Key Concept  \n02:12 Real Example\"\n\n3. Tags\nProvide 5 to 10 relevant SEO-friendly keywords separated by commas\nNo hashtags\nFormat like this:\n\"automation,n8n,ai workflows,youtube growth,openai\"\n"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "Format-12",
      "name": "Format",
      "type": "n8n-nodes-base.code",
      "position": [
        1100,
        -200
      ],
      "parameters": {
        "jsCode": "// Assuming input data contains preview, timestamps, tags\nconst preview = $input.first().json.output[0].description;\nconst timestamps = $input.first().json.output[1].description;\n\n// Hardcoded links section (edit as needed)\nconst links = `\nLinks:\n- Website: https://example.com\n- Twitter: https://twitter.com/example\n- GitHub: https://github.com/example\n`;\n\n// Format description string\nconst description = preview + \"\\n\" +links + \"\\n\" +timestamps \n\n// Return the formatted description\nreturn [\n  {\n    json: {\n      description: description.trim(),\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "Note-adh-sive3-13",
      "name": "Note adhésive3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        -100
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 340,
        "content": "## 1- Input\nEnter the ID of the YTB channel to trigger the workflow when a new video is posted"
      },
      "typeVersion": 1
    },
    {
      "id": "Note-adh-sive-14",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        -180
      ],
      "parameters": {
        "color": 7,
        "height": 480,
        "content": "## 2- Create DataSet\nApify scrape the last YTB video of the channel"
      },
      "typeVersion": 1
    },
    {
      "id": "Note-adh-sive1-15",
      "name": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        -280
      ],
      "parameters": {
        "color": 7,
        "width": 600,
        "height": 580,
        "content": "## 4- Check and Generate Metadata\nVerify if Metadata are not already generated and generate them with LLM\n"
      },
      "typeVersion": 1
    },
    {
      "id": "Note-adh-sive2-16",
      "name": "Note adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -280
      ],
      "parameters": {
        "color": 7,
        "width": 460,
        "height": 240,
        "content": "## 5- Output\nFormat all the data created and update YTB Video"
      },
      "typeVersion": 1
    },
    {
      "id": "Note-adh-sive4-17",
      "name": "Note adhésive4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -180
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 500,
        "content": "## 3- Wait for Completion & Get DataSet\nWait until the dataset is completed in Apify and get it"
      },
      "typeVersion": 1
    },
    {
      "id": "Note-adh-sive5-18",
      "name": "Note adhésive5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        -800
      ],
      "parameters": {
        "color": 7,
        "width": 780,
        "height": 240,
        "content": "## How it works?\n**1 -** Enter the ID of the YTB channel to trigger the workflow when a new video is posted\n**2 -** Apify scrape the last YTB video of the channel\n**3 -** Wait until the dataset is completed in Apify and get it\n**4 -** Verify if Metadata are not already generated and generate them with LLM\n**5 -** Format all the data created and update YTB Video\n\n**📺 Youtube Video Tutorial : https://youtu.be/HaQPAa6l5bU**\n**🛠️ Need Help with Your Workflows ? https://tally.so/r/wayeqB**\n**👨‍💻 More Workflows : https://n8n.io/creators/nasser/**"
      },
      "typeVersion": 1
    },
    {
      "id": "Note-adh-sive6-19",
      "name": "Note adhésive6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        -540
      ],
      "parameters": {
        "color": 7,
        "width": 780,
        "height": 340,
        "content": "## SETUP\n\n**Setup Input YTB Chanel :** Go to the channel's page on YouTube, and look at the URL of the page. The channel ID is the value that comes after channel/ in the URL. Add it after \"?channel_id=\" You can also use free tools available to retrieve channel ID.\n\n**Setup Output YTB Video Update :** Connect your YTB account to your n8n instance thanks to the Google Cloud Console. You can find tutorials by typing \"youtube api Oauth\" on Google.\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- Youtube : https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.youtube/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.youTube#templates-and-examples"
      },
      "typeVersion": 1
    },
    {
      "id": "Trigger-New-Video-Posted-20",
      "name": "Trigger New Video Posted",
      "type": "n8n-nodes-base.rssFeedReadTrigger",
      "position": [
        -880,
        20
      ],
      "parameters": {
        "feedUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=[YOUR_CHANNEL_ID]",
        "pollTimes": {
          "item": [
            {
              "mode": "everyX",
              "unit": "minutes",
              "value": 10
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "Update-YTB-Video-21",
      "name": "Update YTB Video",
      "type": "n8n-nodes-base.youTube",
      "position": [
        1280,
        -200
      ],
      "parameters": {
        "title": "={{ $('Get DataSet').item.json.title }}",
        "videoId": "={{ $('Get DataSet').item.json.id }}",
        "resource": "video",
        "operation": "update",
        "regionCode": "US",
        "updateFields": {
          "tags": "={{ $('Generate Description').item.json.output[2].description }}",
          "description": "={{ $json.description }}"
        }
      },
      "credentials": {
        "youTubeOAuth2Api": {
          "id": "",
          "name": "YouTube account"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Check IF Finished",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format-12": {
      "main": [
        [
          {
            "node": "Update-YTB-Video-21",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If-Recent-9": {
      "main": [
        [
          {
            "node": "Scrape-Video-6",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get DataSet": {
      "main": [
        [
          {
            "node": "If-Not-Generated-10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If-Finished-7": {
      "main": [
        [
          {
            "node": "Get DataSet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape-Video-6": {
      "main": [
        [
          {
            "node": "Check IF Finished",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If-Not-Generated-10": {
      "main": [
        [
          {
            "node": "Generate-Description-11",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check IF Finished": {
      "main": [
        [
          {
            "node": "If-Finished-7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate-Description-11": {
      "main": [
        [
          {
            "node": "Format-12",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mistral-Cloud-Chat-Model-0": {
      "ai_languageModel": [
        [
          {
            "node": "Generate-Description-11",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured-Output-Parser-2": {
      "ai_outputParser": [
        [
          {
            "node": "Generate-Description-11",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Trigger-New-Video-Posted-20": {
      "main": [
        [
          {
            "node": "If-Recent-9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Intelligence Artificielle, Marketing

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds22
Catégorie2
Types de nœuds11
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Auteur
Nasser

Nasser

@nasser

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

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34