Unterprozess - YouTube-Suche
Dies ist ein AI-Bereich Automatisierungsworkflow mit 10 Nodes. Hauptsächlich werden If, Set, Code, YouTube, HttpRequest und andere Nodes verwendet, kombiniert mit KI-Technologie für intelligente Automatisierung. AI YouTube-Trend-Explorer - Ein n8n-Automatisierungs-Workflow basierend auf Gemini/ChatGPT
- •Möglicherweise sind Ziel-API-Anmeldedaten erforderlich
Verwendete Nodes (10)
Kategorie
{
"id": "IktojxaOHrdHkURm",
"meta": {
"instanceId": "ed6d846a2fce1f660ede2e7da800724cca01dc3d0685524a3c917881b7cfcfe9",
"templateCredsSetupCompleted": true
},
"name": "Sub - Youtube Search",
"tags": [
{
"id": "CEVEeZJa4qgPvdpK",
"name": "youtube",
"createdAt": "2025-05-27T02:29:43.874Z",
"updatedAt": "2025-05-27T02:29:43.874Z"
}
],
"nodes": [
{
"id": "5d4d8d36-8f39-4e3c-9527-9d5604e58adc",
"name": "Bei Ausführung durch anderen Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
-660,
280
],
"parameters": {
"inputSource": "passthrough"
},
"typeVersion": 1.1
},
{
"id": "09b1a19d-4fb3-4d78-a41b-90da9ab49409",
"name": "Youtube - Video abrufen",
"type": "n8n-nodes-base.youTube",
"position": [
-440,
280
],
"parameters": {
"limit": 3,
"filters": {
"q": "={{ $json.query.search_term }}",
"regionCode": "US",
"publishedAfter": "={{ new Date(Date.now() - 2 * 24 * 60 * 60 * 1000).toISOString() }}"
},
"options": {
"order": "relevance",
"safeSearch": "moderate"
},
"resource": "video"
},
"credentials": {
"youTubeOAuth2Api": {
"id": "KhD0GLQGWl8MtqCs",
"name": "YouTube - toan.ngo"
}
},
"typeVersion": 1
},
{
"id": "d166a037-d601-438d-b493-c443ab552b40",
"name": "Über Elemente iterieren",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-220,
280
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "803e7b42-8dd4-48f6-a3c6-247d8235faa7",
"name": "HTTP - Videodaten finden",
"type": "n8n-nodes-base.httpRequest",
"position": [
0,
200
],
"parameters": {
"url": "https://www.googleapis.com/youtube/v3/videos?",
"options": {},
"sendQuery": true,
"authentication": "predefinedCredentialType",
"queryParameters": {
"parameters": [
{
"name": "id",
"value": "={{ $json.id.videoId }}"
},
{
"name": "part",
"value": "contentDetails,snippet,statistics"
}
]
},
"nodeCredentialType": "youTubeOAuth2Api"
},
"credentials": {
"youTubeOAuth2Api": {
"id": "KhD0GLQGWl8MtqCs",
"name": "YouTube - toan.ngo"
}
},
"typeVersion": 4.2
},
{
"id": "771aebee-d468-4352-ad25-7d13b09836b8",
"name": "Code - Daten aus Speicher abrufen",
"type": "n8n-nodes-base.code",
"position": [
0,
0
],
"parameters": {
"jsCode": "const workflowStaticData = $getWorkflowStaticData('global');\n\nconst lastExecution = workflowStaticData.lastExecution;\n\nreturn lastExecution;"
},
"typeVersion": 2,
"alwaysOutputData": false
},
{
"id": "c1afc8ff-6c26-433b-8b2c-6debda964ae1",
"name": "Feld - Antwort",
"type": "n8n-nodes-base.set",
"position": [
220,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b9b9117b-ea14-482e-a13b-e68b8e6b441d",
"name": "response",
"type": "string",
"value": "={{ $input.all() }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "fd80746e-6a72-46e3-aefc-d7404cd3b50a",
"name": "Wenn - Länger als 3",
"type": "n8n-nodes-base.if",
"position": [
220,
280
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "08ba3db9-6bcf-47f8-a74d-9e26f28cb08f",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ \n (() => {\n const duration = $json.items[0].contentDetails.duration;\n\n // Helper function to convert ISO 8601 duration to seconds\n const iso8601ToSeconds = iso8601 => {\n const match = iso8601.match(/PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?/);\n const hours = parseInt(match[1] || 0, 10);\n const minutes = parseInt(match[2] || 0, 10);\n const seconds = parseInt(match[3] || 0, 10);\n return hours * 3600 + minutes * 60 + seconds;\n };\n\n // Convert duration to seconds\n const durationInSeconds = iso8601ToSeconds(duration);\n\n // Check if greater than 210 seconds (3 minutes 30 seconds)\n return durationInSeconds > 210;\n })() \n}}",
"rightValue": ""
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "bd86dca7-fdcc-4722-9247-1d5d5f16bb86",
"name": "Feld - Gruppendaten",
"type": "n8n-nodes-base.set",
"position": [
440,
280
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "47c172ad-90c8-4cf6-a9f5-50607e04cc90",
"name": "id",
"type": "string",
"value": "={{ $json.items[0].id }}"
},
{
"id": "9e639efa-0714-4b06-9847-f7b4b2fbef59",
"name": "viewCount",
"type": "string",
"value": "={{ $json.items[0].statistics.viewCount }}"
},
{
"id": "93328f00-91b8-425b-ad0f-a330b2f95242",
"name": "likeCount",
"type": "string",
"value": "={{ $json.items[0].statistics.likeCount }}"
},
{
"id": "015b0fb2-2a98-464c-a21b-51100616f26a",
"name": "commentCount",
"type": "string",
"value": "={{ $json.items[0].statistics.commentCount }}"
},
{
"id": "cf1e1ec3-a138-42b8-8747-d249afa58dd3",
"name": "description",
"type": "string",
"value": "={{ $json.items[0].snippet.description }}"
},
{
"id": "c5c9a3a2-b820-4932-a38a-e21102992215",
"name": "title",
"type": "string",
"value": "={{ $json.items[0].snippet.title }}"
},
{
"id": "38216ead-1f8d-4f93-b6ad-5ef709a1ad2a",
"name": "channelTitle",
"type": "string",
"value": "={{ $json.items[0].snippet.channelTitle }}"
},
{
"id": "ff34194d-3d46-43a8-9127-84708987f536",
"name": "tags",
"type": "string",
"value": "={{ $json.items[0].snippet.tags.join(', ') }}"
},
{
"id": "e50b0f7b-3e37-4557-8863-d68d4fa505c8",
"name": "channelId",
"type": "string",
"value": "={{ $json.items[0].snippet.channelId }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "f9326f4d-16e5-4078-9273-7ee3fb1c70a3",
"name": "Code - Daten im Speicher speichern",
"type": "n8n-nodes-base.code",
"position": [
660,
360
],
"parameters": {
"mode": "runOnceForEachItem",
"jsCode": "const workflowStaticData = $getWorkflowStaticData('global');\n\nif (!workflowStaticData.lastExecution || typeof workflowStaticData.lastExecution.response !== 'string') {\n workflowStaticData.lastExecution = { response: '' };\n}\n\nconst regexes = [\n { pattern: /https?:\\/\\/\\S+|www\\.\\S+/g, replace: '' },\n { pattern: /[\\u{1F600}-\\u{1F64F}\\u{1F300}-\\u{1F5FF}\\u{1F680}-\\u{1F6FF}\\u{2600}-\\u{26FF}\\u{2700}-\\u{27BF}]/gu, replace: '' },\n { pattern: /[\\r\\n\\\\]+/g, replace: ' ' },\n { pattern: / {2,}/g, replace: ' ' } \n];\n\nfunction sanitize(text) {\n return regexes.reduce((str, { pattern, replace }) => str.replace(pattern, replace), text).trim();\n}\n\nconst item = { ...$input.item };\nif (item.description) {\n item.description = sanitize(item.description);\n}\n\nconst sanitizedItem = sanitize(JSON.stringify(item));\n\nif (workflowStaticData.lastExecution.response) {\n workflowStaticData.lastExecution.response += ' ### NEXT VIDEO FOUND: ### ';\n}\nworkflowStaticData.lastExecution.response += sanitizedItem;\n\nreturn workflowStaticData.lastExecution;"
},
"typeVersion": 2
},
{
"id": "49187d4e-5258-48a2-ae9a-fe82a82b75b9",
"name": "Haftnotiz",
"type": "n8n-nodes-base.stickyNote",
"position": [
-900,
-140
],
"parameters": {
"width": 580,
"height": 260,
"content": "## Sub - Youtube Search\nWebsite\thttps://www.agentcircle.ai/\nDiscord Global\thttps://discord.com/invite/jySQ2PNm\nFB Page Global\thttps://www.facebook.com/agentcircle/\nFB Group Global\thttps://www.facebook.com/groups/aiagentcircle/\nGumroad\thttp://agentcircle.gumroad.com/\nX\thttps://x.com/agent_circle\nYouTube\thttps://www.youtube.com/@agentcircle\nLinkedin\thttps://www.linkedin.com/company/agentcircle"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {
"When Executed by Another Workflow": [
{
"json": {
"query": {
"search_term": "cat games gameplay"
}
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "252a4d1e-eb32-4f40-b61a-c80ba62d1d57",
"connections": {
"d166a037-d601-438d-b493-c443ab552b40": {
"main": [
[
{
"node": "771aebee-d468-4352-ad25-7d13b09836b8",
"type": "main",
"index": 0
}
],
[
{
"node": "803e7b42-8dd4-48f6-a3c6-247d8235faa7",
"type": "main",
"index": 0
}
]
]
},
"bd86dca7-fdcc-4722-9247-1d5d5f16bb86": {
"main": [
[
{
"node": "f9326f4d-16e5-4078-9273-7ee3fb1c70a3",
"type": "main",
"index": 0
}
]
]
},
"fd80746e-6a72-46e3-aefc-d7404cd3b50a": {
"main": [
[
{
"node": "bd86dca7-fdcc-4722-9247-1d5d5f16bb86",
"type": "main",
"index": 0
}
],
[
{
"node": "d166a037-d601-438d-b493-c443ab552b40",
"type": "main",
"index": 0
}
]
]
},
"09b1a19d-4fb3-4d78-a41b-90da9ab49409": {
"main": [
[
{
"node": "d166a037-d601-438d-b493-c443ab552b40",
"type": "main",
"index": 0
}
]
]
},
"803e7b42-8dd4-48f6-a3c6-247d8235faa7": {
"main": [
[
{
"node": "fd80746e-6a72-46e3-aefc-d7404cd3b50a",
"type": "main",
"index": 0
}
]
]
},
"f9326f4d-16e5-4078-9273-7ee3fb1c70a3": {
"main": [
[
{
"node": "d166a037-d601-438d-b493-c443ab552b40",
"type": "main",
"index": 0
}
]
]
},
"771aebee-d468-4352-ad25-7d13b09836b8": {
"main": [
[
{
"node": "c1afc8ff-6c26-433b-8b2c-6debda964ae1",
"type": "main",
"index": 0
}
]
]
},
"5d4d8d36-8f39-4e3c-9527-9d5604e58adc": {
"main": [
[
{
"node": "09b1a19d-4fb3-4d78-a41b-90da9ab49409",
"type": "main",
"index": 0
}
]
]
}
}
}Wie verwende ich diesen Workflow?
Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.
Für welche Szenarien ist dieser Workflow geeignet?
Fortgeschritten - Künstliche Intelligenz
Ist es kostenpflichtig?
Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.
Verwandte Workflows
Agent Circle
@agentcircleDiesen Workflow teilen