8
n8n 中文网amn8n.com

使用Google Drive、AI标题和Facebook API自动化Instagram帖子

中级

这是一个Design, AI, Marketing领域的自动化工作流,包含 13 个节点。主要使用 GoogleDrive, GoogleSheets, OpenAi, FacebookGraphApi, GoogleDriveTrigger 等节点,结合人工智能技术实现智能自动化。 使用Google Drive、AI标题和Facebook API自动化Instagram帖子

前置要求
  • Google Drive API 凭证
  • Google Sheets API 凭证
  • OpenAI API Key
  • Facebook Graph API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "160aba527cc3058f06f5c3afbfdaa77f24ad6a273269f4a7e247245d0eb0c124",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "0c46db99-4216-4132-a705-62560e8ebff0",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -100
      ],
      "parameters": {
        "color": 4,
        "width": 275,
        "height": 239,
        "content": "👈"
      },
      "typeVersion": 1
    },
    {
      "id": "bea7e9cb-c125-4469-a902-71f949d82858",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -480
      ],
      "parameters": {
        "color": 4,
        "width": 492,
        "height": 100,
        "content": "### 使用 Google Drive、AI 字幕和 Facebook Graph API Agent 自动化 Instagram 发布 (易于设置)"
      },
      "typeVersion": 1
    },
    {
      "id": "b56d4729-cc93-41d9-be09-27547d0d8204",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -100
      ],
      "parameters": {
        "color": 3,
        "width": 275,
        "height": 239,
        "content": "👈"
      },
      "typeVersion": 1
    },
    {
      "id": "f70fd011-9eab-46b4-a861-148ddd90bca1",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -100
      ],
      "parameters": {
        "color": 5,
        "width": 275,
        "height": 239,
        "content": "👈"
      },
      "typeVersion": 1
    },
    {
      "id": "4a85fd3c-66a8-40cf-be58-030568b953cf",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -100
      ],
      "parameters": {
        "width": 275,
        "height": 399,
        "content": "👈"
      },
      "typeVersion": 1
    },
    {
      "id": "5e855a8f-3a45-43bc-a8e6-9c590fb77c3d",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1320,
        -100
      ],
      "parameters": {
        "color": 3,
        "width": 275,
        "height": 379,
        "content": "👈 最难步骤 (Facebook Graph API):"
      },
      "typeVersion": 1
    },
    {
      "id": "515cef5a-52fd-49af-831c-50957e58564a",
      "name": "最终发布到 Instagram",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        1560,
        -280
      ],
      "parameters": {
        "edge": "media_publish",
        "node": "17841465053058137",
        "hostUrl": "graph-video.facebook.com",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "creation_id",
                "value": "={{ $json.id }}"
              }
            ]
          }
        },
        "graphApiVersion": "v22.0",
        "httpRequestMethod": "POST"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "vDjaXB1lRcGeYQV3",
          "name": "Facebook Graph account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b3114251-0799-44a2-a838-0231103d8f87",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -100
      ],
      "parameters": {
        "color": 4,
        "width": 275,
        "height": 299,
        "content": "👈"
      },
      "typeVersion": 1
    },
    {
      "id": "6c3f1ec2-8765-4445-b93b-253e43c102d2",
      "name": "发布文件上传到 Google Drive 文件夹触发器",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        300,
        -280
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1VfkhYImlmEXw70IrJvvZKO6mM164zMD6",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1VfkhYImlmEXw70IrJvvZKO6mM164zMD6",
          "cachedResultName": "n8n reels automation on instagram"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "bugAjkJYMXx2rSaD",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1c5d5251-f55e-4f1a-b0c3-103e34ac2128",
      "name": "在 N8N 中下载发布文件 (Google Drive 节点)",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        520,
        -280
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "bugAjkJYMXx2rSaD",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "e5e336e2-2a07-4611-9700-8c973aefd0f8",
      "name": "由 OpenAI 生成的 AI 字幕",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        740,
        -280
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Generate an engaging Instagram caption for a {{ $('Post File Upload in Google Drive Folder  Trigger').item.json.name }}  about [Description]. Include:\t\n2-3 sentences with emojis\n\n3-5 relevant hashtags\n\nA call-to-action\n\nKeep it under 150 characters as you are skilled at writing detailed captions based on a file name. write a clear, engaging caption that helps viewers understand and appreciate the post withoutj using too many whimsical words or using too many adjectives. make it relatable and suitable for an instagram audience, encouraging people to connect with the post and respond in the comments. "
            },
            {}
          ]
        },
        "simplify": false
      },
      "credentials": {
        "openAiApi": {
          "id": "BiRkxZ4Wi3R6gMpn",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "19054395-234d-4fae-a0e9-2976df11919d",
      "name": "发布文件保存到 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1120,
        -280
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $('Post File Download in N8N (Google Drive Node)').item.json.name }}",
            "Captions": "={{ $json.choices[0].message.content }}",
            "Reel Urls ": "={{ $('Post File Download in N8N (Google Drive Node)').item.json.webViewLink }}",
            "Reel Thumbnail": "={{ $('Post File Download in N8N (Google Drive Node)').item.json.thumbnailLink }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Captions",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Captions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reel Urls ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Reel Urls ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reel Thumbnail",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Reel Thumbnail",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "fb token for api",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "fb token for api",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S-7cZM6W4EpbNH-DRAt1L3zXUt9JTmQEs8EZ_Csq_Fg/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1S-7cZM6W4EpbNH-DRAt1L3zXUt9JTmQEs8EZ_Csq_Fg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1S-7cZM6W4EpbNH-DRAt1L3zXUt9JTmQEs8EZ_Csq_Fg/edit?usp=drivesdk",
          "cachedResultName": "IG Reel Pass to Meta API  "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "aQLnLORao3LXvlT1",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "d331ddfb-9131-4776-a610-feb830b736b6",
      "name": "连接 Facebook API 使用 N8N 发布 Instagram 帖子",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        1340,
        -280
      ],
      "parameters": {
        "edge": "media",
        "node": "17841465053058137",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "video_url",
                "value": "={{ $json['Reel Urls '] }}"
              },
              {
                "name": "media-type",
                "value": "REELS"
              },
              {
                "name": "caption",
                "value": "={{ $json.Captions }}"
              },
              {
                "name": "image_url",
                "value": "={{ $json['Reel Thumbnail'] }}"
              }
            ]
          }
        },
        "graphApiVersion": "v22.0",
        "httpRequestMethod": "POST"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "vDjaXB1lRcGeYQV3",
          "name": "Facebook Graph account"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "AI Caption generated by OpenAI": {
      "main": [
        [
          {
            "node": "Post File Save in Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post File Save in Google Sheets": {
      "main": [
        [
          {
            "node": "Connect Facebook API for Publishing Instagram Post using N8N",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post File Download in N8N (Google Drive Node)": {
      "main": [
        [
          {
            "node": "AI Caption generated by OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post File Upload in Google Drive Folder  Trigger": {
      "main": [
        [
          {
            "node": "Post File Download in N8N (Google Drive Node)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Connect Facebook API for Publishing Instagram Post using N8N": {
      "main": [
        [
          {
            "node": "Finally Post to Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 设计, 人工智能, 营销

需要付费吗?

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

工作流信息
难度等级
中级
节点数量13
分类3
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者

AI Automations Expert | Gen AI Filmmaker | AI Product Builder 🔹 Built 25+ AI Automation Systems Designed and deployed AI workflows using OpenAI, Make.com, Zapier, and AdminitM to automate business processes, save time, and boost productivity.

外部链接
在 n8n.io 查看

分享此工作流