同步 YouTube 视频链接与 Google Sheets
中级
这是一个AI, IT Ops领域的自动化工作流,包含 8 个节点。主要使用 Set, SplitOut, HttpRequest, GoogleSheets, ManualTrigger 等节点,结合人工智能技术实现智能自动化。 将 YouTube 视频链接与 Google Sheets 同步
前置要求
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "rJNvM4vU6SLUeC1d",
"meta": {
"instanceId": "10f6e8a86649316fe7041c503c24e6d77b68a961a9f4f1f76d0100c435446092",
"templateCredsSetupCompleted": true
},
"name": "同步 YouTube 视频链接与 Google Sheets",
"tags": [],
"nodes": [
{
"id": "f1cd1374-2214-41c1-af32-9e31e72aab88",
"name": "拆分输出",
"type": "n8n-nodes-base.splitOut",
"position": [
1720,
0
],
"parameters": {
"options": {},
"fieldToSplitOut": "items"
},
"typeVersion": 1
},
{
"id": "e59d5ac8-5386-4fa4-a18c-39cd84779eae",
"name": "手动触发器(点击\"测试工作流\"时)",
"type": "n8n-nodes-base.manualTrigger",
"position": [
1100,
0
],
"parameters": {},
"typeVersion": 1
},
{
"id": "46897f6d-5e64-4a85-92b5-d8e596d02702",
"name": "从 Google Sheets 获取 YouTube 频道 ID",
"type": "n8n-nodes-base.googleSheets",
"position": [
1300,
0
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1592454760,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xoCVr_mlwn4jFcnJENtrU-_K5nkIytZ8qBXzxMq55n4/edit#gid=1592454760",
"cachedResultName": "Sheet3"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1xoCVr_mlwn4jFcnJENtrU-_K5nkIytZ8qBXzxMq55n4",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xoCVr_mlwn4jFcnJENtrU-_K5nkIytZ8qBXzxMq55n4/edit?usp=drivesdk",
"cachedResultName": "Youtube Videos Comments"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "jPoTdPxgVL0vr9SQ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "adb73854-a110-4c1e-9228-221b844a15f5",
"name": "从特定频道获取 YouTube 视频链接",
"type": "n8n-nodes-base.httpRequest",
"position": [
1540,
0
],
"parameters": {
"url": "https://www.googleapis.com/youtube/v3/search",
"options": {
"pagination": {
"pagination": {
"parameters": {
"parameters": [
{
"name": "pageToken",
"value": "={{ $response.body.nextPageToken }}"
}
]
},
"completeExpression": "={{ !$response.body.nextPageToken}}",
"paginationCompleteWhen": "other"
}
}
},
"sendQuery": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"queryParameters": {
"parameters": [
{
"name": "channelId",
"value": "={{ $json.channelId }}"
},
{
"name": "part",
"value": "snippet"
},
{
"name": "order",
"value": "date"
},
{
"name": "maxResults",
"value": "50"
}
]
}
},
"credentials": {
"httpQueryAuth": {
"id": "2lgO4p3deoSAoU9d",
"name": "Query Auth account 3"
}
},
"typeVersion": 4.2
},
{
"id": "d5926bd7-f1d6-4441-87de-454d16aa6928",
"name": "按要求格式化字段以保存到Google表格",
"type": "n8n-nodes-base.set",
"position": [
1900,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "21a7a279-8a86-494c-a32f-ebcf956e2f69",
"name": "Title",
"type": "string",
"value": "={{ $json.snippet.title }}"
},
{
"id": "0f7084f4-9180-4eee-ab59-8e0ce75b163f",
"name": "video_urls",
"type": "string",
"value": "=https://www.youtube.com/watch?v={{ $json.id.videoId }}"
},
{
"id": "40b96174-109e-4ddf-b1c2-c3f0b93a2769",
"name": "published_at",
"type": "string",
"value": "={{ $json.snippet.publishedAt }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "e23503cd-40ae-488f-9918-83b1e3dc7b28",
"name": "在 Google Sheets 中插入和更新 YouTube 链接",
"type": "n8n-nodes-base.googleSheets",
"position": [
2100,
0
],
"parameters": {
"columns": {
"value": {
"Title": "={{ $json.Title }}",
"video_urls": "={{ $json.video_urls }}",
"published_at": "={{ $json.published_at }}"
},
"schema": [
{
"id": "Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "video_urls",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "video_urls",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "last_fetched_time",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "last_fetched_time",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "next_fetch_time",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "next_fetch_time",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "published_at",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "published_at",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"video_urls"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 760258523,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xoCVr_mlwn4jFcnJENtrU-_K5nkIytZ8qBXzxMq55n4/edit#gid=760258523",
"cachedResultName": "Sheet2"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1xoCVr_mlwn4jFcnJENtrU-_K5nkIytZ8qBXzxMq55n4",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xoCVr_mlwn4jFcnJENtrU-_K5nkIytZ8qBXzxMq55n4/edit?usp=drivesdk",
"cachedResultName": "Youtube Videos Comments"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "jPoTdPxgVL0vr9SQ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "428bf48c-1721-4215-9ad4-f5b85f12d6dc",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
1020,
-100
],
"parameters": {
"width": 1320,
"height": 320,
"content": "## 同步 YouTube 视频链接与 Google Sheets"
},
"typeVersion": 1
},
{
"id": "3aaf62a9-e97e-48dd-8716-c5440759a03e",
"name": "便签 1",
"type": "n8n-nodes-base.stickyNote",
"position": [
720,
-100
],
"parameters": {
"color": 5,
"width": 280,
"height": 220,
"content": "## 我是说明注释"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "f874513c-62c9-430d-8c33-c6d48bacb74d",
"connections": {
"Split Out": {
"main": [
[
{
"node": "Format fields as required to save in google sheet",
"type": "main",
"index": 0
}
]
]
},
"Get Youtube Channel Ids from Google Sheet": {
"main": [
[
{
"node": "Get Youtube Video Urls form specific channel",
"type": "main",
"index": 0
}
]
]
},
"Get Youtube Video Urls form specific channel": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Manual Trigger (When Clicking 'Test workflow'": {
"main": [
[
{
"node": "Get Youtube Channel Ids from Google Sheet",
"type": "main",
"index": 0
}
]
]
},
"Format fields as required to save in google sheet": {
"main": [
[
{
"node": "Insert & Update Youtube Urls in Google Sheet",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 人工智能, IT 运维
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
YouTube评论情感分析器
🚀 YouTube评论情感分析器(使用Google Sheets和OpenAI)
If
Set
Split Out
+7
16 节点Aayushman Sharma
人工智能
CSV到HubSpot上传器(动态字段映射与Google Sheets集成)
具有动态字段映射和Google Sheets集成的CSV到HubSpot上传器
If
Set
Code
+10
36 节点PollupAI
人工智能
模板演示-chatgpt-图片-1-带-drive-和-sheet副本
使用GPT-image-1生成图像并存储到Google Drive,包含成本跟踪
Set
Split Out
Aggregate
+8
16 节点darrell_tw
设计
会议已预订 - 发送至新闻简报和CRM
使用Google Sheets、Beehiiv和Telegram自动化Cal.com会议参与者管理
Set
Split Out
Telegram
+4
9 节点Aitor | 1node.ai
人工智能
OCR Telegram - SAP
基于Telegram、GPT-4o、OCR和SAP集成的自动化发票处理
Set
Code
Wait
+12
29 节点Raquel Giugliano
人工智能
n8napi-检查使用哪个模型的工作流
检查工作流中使用的AI模型
N8n
Set
Filter
+5
12 节点darrell_tw
人工智能