使用 Google Sheets、Drive、Cloudinary 和 Graph API 自动发布 Instagram 轮播
中级
这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 Set, Aggregate, GoogleDrive, HttpRequest, GoogleSheets 等节点。 使用 Google Sheets、Drive、Cloudinary 和 Graph API 自动发布 Instagram 轮播
前置要求
- •Google Drive API 凭证
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "0a25db4fd0692af64b58f35e01611f2ef0b5bb9d6654c57ef3741021e7d8cc11",
"templateId": "5833"
},
"nodes": [
{
"id": "f0c8b3af-13db-4fdd-8cbc-46986ca7dd18",
"name": "从Google Drive文件夹获取图片列表",
"type": "n8n-nodes-base.googleDrive",
"position": [
1824,
560
],
"parameters": {
"filter": {
"folderId": {
"__rl": true,
"mode": "url",
"value": "={{ $('Get Execution for Carousel').item.json.Folder }}"
}
},
"options": {
"fields": [
"id",
"name",
"thumbnailLink",
"webViewLink"
]
},
"resource": "fileFolder",
"returnAll": true,
"queryString": "="
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "01wemhcagGbSGx8L",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "51f669e2-d933-47ce-9892-ba18bfaf92de",
"name": "获取轮播图执行",
"type": "n8n-nodes-base.googleSheets",
"position": [
1600,
560
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "ToDo",
"lookupColumn": "Status"
},
{
"lookupValue": "Carousel",
"lookupColumn": "Type"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1315784118,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WEUHeQXFMYsWVAW3DykWwpANxxD3DxH-S6c0i06dW1g/edit#gid=1315784118",
"cachedResultName": "Execute "
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1WEUHeQXFMYsWVAW3DykWwpANxxD3DxH-S6c0i06dW1g",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WEUHeQXFMYsWVAW3DykWwpANxxD3DxH-S6c0i06dW1g/edit?usp=drivesdk",
"cachedResultName": "0004_Master"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "cjPjcwa3RdiMAu79",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "8c2b669d-9185-469f-9084-7075ffce5a90",
"name": "计划触发器",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
1376,
560
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "00027ef7-ece6-4b31-ad04-6508684b33ac",
"name": "将图片上传到Cloudinary",
"type": "n8n-nodes-base.httpRequest",
"position": [
2272,
560
],
"parameters": {
"url": "https://api.cloudinary.com/v1_1/<your-cloud-name>/image/upload",
"method": "POST",
"options": {
"response": {
"response": {
"responseFormat": "json"
}
}
},
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"name": "file",
"parameterType": "formBinaryData",
"inputDataFieldName": "data"
},
{
"name": "upload_preset",
"value": "<your_upload_preset>"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "7b22ae20-73c9-44f0-8f87-673836a47a25",
"name": "Instagram 设置(访问令牌, ig_business_id)",
"type": "n8n-nodes-base.set",
"position": [
1248,
832
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "5b2dad43-2ec9-4bc0-8427-c9bab6a5fc2c",
"name": "access_token",
"type": "string",
"value": "<your-instagram-access-token>"
},
{
"id": "55b08009-fd62-44b8-b21e-6dde6aa9594f",
"name": "ig_user_id",
"type": "string",
"value": "<your-ig_user_id>"
},
{
"id": "53127a63-5583-4a5b-84bf-d2efd439af2b",
"name": "image_url",
"type": "string",
"value": "={{ $json.url }}"
},
{
"id": "90a680ca-49c2-4b83-bbf4-45614e882c01",
"name": "caption",
"type": "string",
"value": "={{ $('Get Execution for Carousel').item.json['Expected content'] }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "8f7f2ba9-4157-40a2-8561-17e77c74baef",
"name": "从Google Drive下载图片(轮播图)",
"type": "n8n-nodes-base.httpRequest",
"position": [
2048,
560
],
"parameters": {
"url": "=https://drive.google.com/uc?export=download&id={{ $json.id }}",
"options": {
"response": {
"response": {
"fullResponse": true,
"responseFormat": "file"
}
}
}
},
"typeVersion": 4.2
},
{
"id": "09cb809c-9997-413c-b94f-9203e80eaa1d",
"name": "创建媒体容器(图片)",
"type": "n8n-nodes-base.httpRequest",
"position": [
1472,
832
],
"parameters": {
"url": "=https://graph.instagram.com/v23.0/{{ $json.ig_user_id }}/media",
"method": "POST",
"options": {
"response": {
"response": {
"fullResponse": true
}
}
},
"sendBody": true,
"contentType": "form-urlencoded",
"bodyParameters": {
"parameters": [
{
"name": "image_url",
"value": "={{ $json.image_url }}"
},
{
"name": "caption",
"value": "={{ $json.caption }}"
},
{
"name": "access_token",
"value": "={{ $json.access_token }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "d0453b3b-5c36-4a27-a808-65893674d451",
"name": "合并Instagram媒体容器",
"type": "n8n-nodes-base.aggregate",
"position": [
1696,
832
],
"parameters": {
"options": {
"mergeLists": true
},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "body.id"
}
]
}
},
"typeVersion": 1
},
{
"id": "04b3998b-3fb1-4128-a77c-7ea8029235a0",
"name": "创建媒体容器(轮播图)",
"type": "n8n-nodes-base.httpRequest",
"position": [
1920,
832
],
"parameters": {
"url": "=https://graph.instagram.com/v23.0/{{ $('Setup for Instagram (access token, ig_business_id)').first().json.ig_user_id }}/media",
"method": "POST",
"options": {
"response": {
"response": {
"fullResponse": true
}
}
},
"sendBody": true,
"contentType": "form-urlencoded",
"bodyParameters": {
"parameters": [
{
"name": "caption",
"value": "={{ $('Get Execution for Carousel').item.json['Expected content'] }}"
},
{
"name": "media_type",
"value": "=CAROUSEL"
},
{
"name": "children",
"value": "={{ $json.id }}"
},
{
"name": "access_token",
"value": "={{ $('Setup for Instagram (access token, ig_business_id)').first().json.access_token }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "662e0de0-26b0-4045-ae9e-e2f5b630419f",
"name": "发布Instagram轮播图",
"type": "n8n-nodes-base.httpRequest",
"position": [
2144,
832
],
"parameters": {
"url": "=https://graph.instagram.com/v23.0/{{ $('Setup for Instagram (access token, ig_business_id)').first().json.ig_user_id }}/media_publish",
"method": "POST",
"options": {
"response": {
"response": {
"responseFormat": "json"
}
}
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "creation_id",
"value": "={{ $json.body.id }}"
},
{
"name": "access_token",
"value": "={{ $('Setup for Instagram (access token, ig_business_id)').first().json.access_token }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "8f4ad80f-53e2-4c86-be4a-02f4f8bb630e",
"name": "将执行状态更新为 \"已处理\"",
"type": "n8n-nodes-base.googleSheets",
"position": [
2368,
832
],
"parameters": {
"columns": {
"value": {
"Status": "Processed",
"ExecuteId": "={{ $('Get Execution for Carousel').item.json.ExecuteId }}"
},
"schema": [
{
"id": "ExecuteId",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "ExecuteId",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Folder",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Folder",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Expected content",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Expected content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Language",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Language",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Type",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Type",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Schedule_at",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Schedule_at",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"ExecuteId"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1315784118,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WEUHeQXFMYsWVAW3DykWwpANxxD3DxH-S6c0i06dW1g/edit#gid=1315784118",
"cachedResultName": "Execute "
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1WEUHeQXFMYsWVAW3DykWwpANxxD3DxH-S6c0i06dW1g",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WEUHeQXFMYsWVAW3DykWwpANxxD3DxH-S6c0i06dW1g/edit?usp=drivesdk",
"cachedResultName": "0004_Master"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "cjPjcwa3RdiMAu79",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "32b01069-b985-4647-abaa-ac667c38e79b",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
1184,
368
],
"parameters": {
"color": 4,
"width": 368,
"height": 144,
"content": "## 步骤1 · 计划与选取任务"
},
"typeVersion": 1
},
{
"id": "13b43b13-794e-4599-a6ab-e341970bdeb9",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1728,
368
],
"parameters": {
"color": 5,
"width": 336,
"content": "## 步骤2 · 收集素材"
},
"typeVersion": 1
},
{
"id": "31ef9def-afe5-4a94-94e9-f3f487804021",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
2176,
400
],
"parameters": {
"color": 6,
"width": 384,
"height": 128,
"content": "## 步骤3 · 托管图片"
},
"typeVersion": 1
},
{
"id": "ffb028a5-4b45-4e0b-ba99-0f48cd17ad31",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
2496,
592
],
"parameters": {
"color": 7,
"height": 256,
"content": "## 步骤4 · IG轮播图与日志"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Get Execution for Carousel",
"type": "main",
"index": 0
}
]
]
},
"Get Execution for Carousel": {
"main": [
[
{
"node": "Get image list from a Google Drive folder1",
"type": "main",
"index": 0
}
]
]
},
"Publish Instagram Carousel": {
"main": [
[
{
"node": "Update Execute to \"Processed\"",
"type": "main",
"index": 0
}
]
]
},
"Upload images to Cloudinary": {
"main": [
[
{
"node": "Setup for Instagram (access token, ig_business_id)",
"type": "main",
"index": 0
}
]
]
},
"Create Media Container (Image)": {
"main": [
[
{
"node": "Combine Instagram media containers",
"type": "main",
"index": 0
}
]
]
},
"Create Media Container (Carousel)": {
"main": [
[
{
"node": "Publish Instagram Carousel",
"type": "main",
"index": 0
}
]
]
},
"Combine Instagram media containers": {
"main": [
[
{
"node": "Create Media Container (Carousel)",
"type": "main",
"index": 0
}
]
]
},
"Get image list from a Google Drive folder1": {
"main": [
[
{
"node": "Download Image from Google Drive (Carousel)",
"type": "main",
"index": 0
}
]
]
},
"Download Image from Google Drive (Carousel)": {
"main": [
[
{
"node": "Upload images to Cloudinary",
"type": "main",
"index": 0
}
]
]
},
"Setup for Instagram (access token, ig_business_id)": {
"main": [
[
{
"node": "Create Media Container (Image)",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 内容创作, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
工作流目的与关键工具
工作流目的与关键工具:Claude 3.7模型规格
If
Set
Gmail
+10
23 节点Meak
内容创作
WordPress博客自动化专业版(深度研究)v2.1市场
使用GPT-4o、Perplexity AI和多语言支持自动化SEO优化的博客创建
If
Set
Xml
+27
125 节点Daniel Ng
内容创作
LinkedIn和X病毒内容自动引擎
使用AI生成和发布自动创建LinkedIn和X的病毒内容
If
Set
Wait
+26
156 节点Diptamoy Barman
内容创作
1. 播放列表详情设置机器人副本
使用 Suno、GPT-4、Runway 和 Creatomate 创建 AI 生成的 YouTube 音乐播放列表
If
Set
Code
+22
203 节点Joseph
内容创作
合并
使用Suno API、Claude和Telegram机器人创建完整的20首YouTube播放列表
If
Set
Code
+17
150 节点Joseph
内容创作
使用 GPT-4、FAL AI 和 ElevenLabs 为社交媒体生成品牌营销短视频
使用 GPT-4、FAL AI 和 ElevenLabs 为社交媒体生成品牌营销短视频
If
Set
Wait
+10
43 节点Aashit Sharma
内容创作