8
n8n 中文网amn8n.com

Google Drive 至 Instagram 轮播帖(通过 Cloudinary 和 Telegram 提醒)

高级

这是一个Social Media, Multimodal AI领域的自动化工作流,包含 17 个节点。主要使用 Set, Code, Wait, Telegram, GoogleDrive 等节点。 通过 Cloudinary 从 Google Drive 创建 Instagram 轮播帖,并发送 Telegram 提醒

前置要求
  • Telegram Bot Token
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • Facebook Graph API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "9e721f64f4f5b8df656a4e0e1b663225a53ad0de7655a0878df9764d30956485",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "c390b5ce-28f0-4371-af0a-50e9f3ba7f7b",
      "name": "收集媒体ID",
      "type": "n8n-nodes-base.code",
      "position": [
        -4080,
        2816
      ],
      "parameters": {
        "jsCode": "// Collect all media IDs from the loop\nconst items = $input.all();\n\n// Extract media IDs and other data\nconst mediaIds = [];\nlet commonData = {};\n\nfor (const item of items) {\n if (item.json.media_id) {\n   mediaIds.push(item.json.media_id);\n }\n \n // Store common data from first item\n if (Object.keys(commonData).length === 0) {\n   commonData = {\n     model: item.json.model,\n     instagram_content: item.json.instagram_content,\n     \"Instagram Account ID\": item.json[\"Instagram Account ID\"],\n     \"Facebook Graph\": item.json[\"Facebook Graph\"],\n     \"airtable id\": item.json[\"airtable id\"]\n   };\n }\n}\n\n// Return collected data\nreturn [{\n json: {\n   ...commonData,\n   media_ids: mediaIds,\n   total_media_count: mediaIds.length\n }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "b525ffe9-f92d-42ec-8e61-edea35ac01a0",
      "name": "下载文件1",
      "type": "n8n-nodes-base.googleDrive",
      "onError": "continueRegularOutput",
      "position": [
        -4016,
        3136
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $json.item_url }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "AKldzSoqKzegF8kI",
          "name": "Vertical Google Drive account"
        }
      },
      "typeVersion": 3,
      "alwaysOutputData": false
    },
    {
      "id": "192bcaf1-dc0c-477f-9c10-66e53172b9f8",
      "name": "上传图片到Cloudinary",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        -3680,
        3136
      ],
      "parameters": {
        "url": "https://api.cloudinary.com/v1_1/dd4rbdyco/image/upload",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "upload_preset",
              "value": "N8N Upload"
            }
          ]
        },
        "genericAuthType": "httpBasicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "OX0bq0sRfzSyJ6xn",
          "name": "Cloudinary"
        },
        "httpBearerAuth": {
          "id": "2xv6l43QR2fRinor",
          "name": "RunComfyUI API Bearer Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "bd8b16ef-6730-4ac8-9161-d6e5ca524b22",
      "name": "编辑字段 1",
      "type": "n8n-nodes-base.set",
      "onError": "continueRegularOutput",
      "position": [
        -3248,
        3216
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a699442d-a08f-48e3-8125-ff9550cef688",
              "name": "media_id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "b7aa553e-b09f-49f4-9236-006661def799",
              "name": "pose_number",
              "type": "number",
              "value": "={{ $('Download file1').item.json.pose_number }}"
            },
            {
              "id": "d9cc775g-d2b1-6bg6-b458-228883fgg9bb",
              "name": "instagram_content",
              "type": "string",
              "value": "={{ $('Download file1').item.json.instagram_content }}"
            },
            {
              "id": "eadd886h-e3c2-7ch7-c569-339994ghhacc",
              "name": "Instagram Account ID",
              "type": "string",
              "value": "={{ $('Download file1').item.json['node (Instagram Account ID)'] }}"
            },
            {
              "id": "d3e0804b-fe7a-4e1b-a7b0-4127a59e81db",
              "name": "airtable id",
              "type": "string",
              "value": "={{ $('Download file1').item.json['airtable id'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "00815309-85ec-4b32-a589-19255c5b5a3f",
      "name": "循环遍历项目1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -4304,
        3136
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "3607eedf-8d83-429b-b02a-f8ce2bec7045",
      "name": "发送更新消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2960,
        2816
      ],
      "webhookId": "6c4391f0-fabb-45a5-82a8-e3c313195a52",
      "parameters": {
        "text": "=The Carousel post {{ $json.instagram_content }} has been successfully uploaded to Instagram.",
        "chatId": "7754721939",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "gXpWHGCXaSG6m46Q",
          "name": "Telegram Personalisierungsassistenz"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9775cd2a-5048-4ed6-a120-252bbd95a61f",
      "name": "编辑轮播图",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -3632,
        2816
      ],
      "parameters": {
        "edge": "=media",
        "node": "={{ $json['Instagram Account ID'] }}",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "media_type",
                "value": "CAROUSEL"
              },
              {
                "name": "children",
                "value": "={{ $json.media_ids }}"
              },
              {
                "name": "caption",
                "value": "={{ $json.instagram_content }}"
              }
            ]
          }
        },
        "graphApiVersion": "v22.0",
        "httpRequestMethod": "POST"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "BGWIHHXvLslyUrjk",
          "name": "Facebook Graph account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1205b4bd-ac30-4559-b2ae-23ce5fd85db4",
      "name": "创建每个轮播图片",
      "type": "n8n-nodes-base.facebookGraphApi",
      "onError": "continueRegularOutput",
      "position": [
        -3488,
        3168
      ],
      "parameters": {
        "edge": "media",
        "node": "={{ $('Download file1').item.json['node (Instagram Account ID)'] }}",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "=image_url",
                "value": "={{ $json.url }}"
              },
              {
                "name": "is_carousel_item",
                "value": "true"
              }
            ]
          }
        },
        "graphApiVersion": "v22.0",
        "httpRequestMethod": "POST"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "BGWIHHXvLslyUrjk",
          "name": "Facebook Graph account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e63172b8-812c-4489-9c51-447346c6b751",
      "name": "点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -4752,
        3136
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1ec7461c-8d0b-4f4d-8e84-872b8ebff0cc",
      "name": "准备数据",
      "type": "n8n-nodes-base.set",
      "position": [
        -4528,
        3136
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8b6339f9-f5a5-4f77-ba88-9c5e7a0e9421",
              "name": "instagram_content",
              "type": "string",
              "value": "="
            },
            {
              "id": "d811f293-3ec5-494f-97c4-c76b457029e1",
              "name": "node (Instagram Account ID)",
              "type": "string",
              "value": "="
            },
            {
              "id": "daca9119-e5a8-454c-9180-65558a7a32c7",
              "name": "pose_1_drive_fotolink",
              "type": "string",
              "value": "="
            },
            {
              "id": "616f8862-92fd-4aa1-98e0-a38981fa83d8",
              "name": "pose_2_drive_fotolink",
              "type": "string",
              "value": "="
            },
            {
              "id": "f9c57f27-3f6b-4f4d-91fc-9c331b04c29f",
              "name": "pose_3_drive_fotolink",
              "type": "string",
              "value": "="
            },
            {
              "id": "f8ce5994-d0c5-4546-b51c-21c06c72ec07",
              "name": "Facebook Graph",
              "type": "string",
              "value": "="
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1017bf09-2e5f-4bcd-9df6-68e96f970b39",
      "name": "轮播前等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        -3856,
        2816
      ],
      "webhookId": "68ab55f7-aa26-47a0-bc06-9e7c0e490b9c",
      "parameters": {
        "amount": 20
      },
      "typeVersion": 1.1
    },
    {
      "id": "d15cc5bc-9010-45cc-9749-ba01b372f5ae",
      "name": "上传到Instagram前等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        -3408,
        2816
      ],
      "webhookId": "62e7bfed-ea6f-4969-8edb-70b29e7a859c",
      "parameters": {
        "amount": 15
      },
      "typeVersion": 1.1
    },
    {
      "id": "b4047815-5361-4b75-b5a4-63d9036f2f0d",
      "name": "发布轮播图到Instagram",
      "type": "n8n-nodes-base.facebookGraphApi",
      "onError": "continueRegularOutput",
      "position": [
        -3184,
        2816
      ],
      "parameters": {
        "edge": "media_publish",
        "node": "={{ $('Collect Media IDs').item.json['Instagram Account ID'] }}",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "creation_id",
                "value": "={{ $json.id }}"
              }
            ]
          }
        },
        "graphApiVersion": "v22.0",
        "httpRequestMethod": "POST"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "BGWIHHXvLslyUrjk",
          "name": "Facebook Graph account"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "2564f356-047c-4395-a622-f3143a1d3b5c",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4592,
        2928
      ],
      "parameters": {
        "height": 496,
        "content": "## 准备数据"
      },
      "typeVersion": 1
    },
    {
      "id": "8fb94935-bc6f-4426-8ccd-33bc51d33d31",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3760,
        3056
      ],
      "parameters": {
        "height": 256,
        "content": "## 添加Cloudinary账户"
      },
      "typeVersion": 1
    },
    {
      "id": "5d6dec77-7874-432d-aeac-003debd712bc",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4096,
        3056
      ],
      "parameters": {
        "height": 256,
        "content": "## 添加Google Drive账户"
      },
      "typeVersion": 1
    },
    {
      "id": "b915d053-703a-412f-954e-d603ef61d9da",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3024,
        2736
      ],
      "parameters": {
        "height": 256,
        "content": "## 添加Telegram机器人ID"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Data": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Carousel": {
      "main": [
        [
          {
            "node": "Wait before Upload to Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file1": {
      "main": [
        [
          {
            "node": "Upload images to Cloudinary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Collect Media IDs",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect Media IDs": {
      "main": [
        [
          {
            "node": "Wait before Carousel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait before Carousel": {
      "main": [
        [
          {
            "node": "Edit Carousel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload images to Cloudinary": {
      "main": [
        [
          {
            "node": "Create each Carousel Picture",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create each Carousel Picture": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish Carousel to Instagram": {
      "main": [
        [
          {
            "node": "Send Update Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait before Upload to Instagram": {
      "main": [
        [
          {
            "node": "Publish Carousel to Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Prepare Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 社交媒体, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量17
分类2
节点类型10
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Robert Schröder

Robert Schröder

@saits

I'm a self-taught n8n automation specialist from Zürich with 2 years of intensive experience building complex workflows. My focus lies in creating practical, production-ready workflows that solve real business challenges - from AI-powered content generation to data management and process automation. Each workflow I share reflects tested, optimized solutions that deliver measurable results.

外部链接
在 n8n.io 查看

分享此工作流