8
n8n 中文网amn8n.com

Facebook广告报告自动化

高级

这是一个Market Research领域的自动化工作流,包含 17 个节点。主要使用 If, Code, Merge, Aggregate, HttpRequest 等节点。 使用Facebook Graph API和Google Sheets实现Facebook广告报告自动化

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Facebook Graph API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "nzmEkWPbBiHNGEHY",
  "meta": {
    "instanceId": "cd438fd1eca1b4215129611b59e2a783bbecd4a7fc04e24e9ac21de3d46ce6cc"
  },
  "name": "Facebook广告报告自动化",
  "tags": [],
  "nodes": [
    {
      "id": "13b4b7b4-bb8f-4e7b-b86a-91aaa7d8e4de",
      "name": "代码1",
      "type": "n8n-nodes-base.code",
      "position": [
        272,
        -48
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "ec2581f8-5dd9-47ab-98b5-5c61228a0858",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        944,
        400
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "18117c12-c21d-47f1-8280-a1554c3dcbef",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1104,
        400
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0034041e-1ee3-41de-a17e-afc2546ea742",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -224
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "5a3eb79b-335f-4b80-95f7-8924060a91d1",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        224
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "2dd91c7b-f4ed-474a-98f7-c5a6729146ac",
      "name": "更新表格行4",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        576,
        304
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "7c03d461-7275-44c9-a59b-7c6546714d5a",
      "name": "仅获取活跃广告系列",
      "type": "n8n-nodes-base.if",
      "position": [
        416,
        -48
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "e4927546-0316-4634-825e-347e3187bd0d",
      "name": "从广告账户获取广告系列",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        112,
        -48
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "1a7a9b7d-c769-4d4c-a7ee-eb681f878251",
      "name": "检查广告系列是否有数据",
      "type": "n8n-nodes-base.if",
      "position": [
        400,
        384
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "8416ea84-e302-4fdc-a181-80199e7fe4cb",
      "name": "更新广告系列统计信息",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1264,
        400
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "ac39c093-b614-4051-9586-2116c998f0e4",
      "name": "获取广告系列统计信息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        208,
        384
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "a23906cb-9511-4fd9-b097-5e488f00015b",
      "name": "检查转化",
      "type": "n8n-nodes-base.code",
      "position": [
        784,
        400
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "5dbfde3b-41b4-4e7c-bdb1-e92855e958af",
      "name": "获取广告系列ID",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        0,
        400
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "3e6c0fb2-e88c-4000-b750-90627c011c29",
      "name": "添加凭据到Facebook Graph API",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -80,
        -48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a17542a1-74c9-422f-849c-9d56e8bd727e",
      "name": "将您的广告系列添加到文件",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        608,
        -48
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "68a07250-2181-4fe3-b203-43af62c739cc",
      "name": "设置计划",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -256,
        -48
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "93d18b11-1994-4070-859a-6d8a087a6b32",
      "name": "设置计划1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -256,
        400
      ],
      "parameters": {},
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8593801c-c727-42b7-a660-6f6302379da7",
  "connections": {
    "Code1": {
      "main": [
        [
          {
            "node": "Get Only Active Campaign",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Update Campaign statistics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Schedule": {
      "main": [
        [
          {
            "node": "Add credentials to the Facebook Graph API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Schedule1": {
      "main": [
        [
          {
            "node": "Get Campaign ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Campaign ID": {
      "main": [
        [
          {
            "node": "Get Campaign statistics",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Checking Conversion": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet4": {
      "main": [
        [
          {
            "node": "Get Campaign ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Campaign statistics": {
      "main": [
        [
          {
            "node": "Checking if Campaign have data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Only Active Campaign": {
      "main": [
        [
          {
            "node": "Add your campaign to file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Campaign statistics": {
      "main": [
        [
          {
            "node": "Get Campaign ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Campaign from AD Account": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Checking if Campaign have data": {
      "main": [
        [
          {
            "node": "Update row in sheet4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Checking Conversion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add credentials to the Facebook Graph API": {
      "main": [
        [
          {
            "node": "Get Campaign from AD Account",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 市场调研

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流