8
n8n 中文网amn8n.com

创意自动测试_v4(最终版)

高级

这是一个Social Media领域的自动化工作流,包含 25 个节点。主要使用 If, Set, Merge, Function, GoogleDrive 等节点。 Meta 广告创意测试和活动发布的自动化

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "LJCKFHgFJQhaPgcA",
  "meta": {
    "instanceId": "d5e1aee00419f7d76c99b6815681c983a5e0b4d87bfcf461d2e125e2786ef532",
    "templateCredsSetupCompleted": true
  },
  "name": "创意自动测试_v4(最终版)",
  "tags": [
    {
      "id": "8ZOxg8cY0fPL8g0s",
      "name": "ReadyToUse",
      "createdAt": "2025-07-10T04:08:19.089Z",
      "updatedAt": "2025-07-10T04:08:19.089Z"
    },
    {
      "id": "tITAFvUSOpVVIBvI",
      "name": "MetaAds",
      "createdAt": "2025-07-05T02:24:26.705Z",
      "updatedAt": "2025-07-05T02:24:26.705Z"
    }
  ],
  "nodes": [
    {
      "id": "73f024b5-8d66-4d8f-8793-defb6639b0f9",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -624,
        112
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 15
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b1f789fc-f8a1-4e54-bdc7-094d81f440a5",
      "name": "文件搜索",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -176,
        112
      ],
      "parameters": {
        "filter": {},
        "options": {
          "fields": [
            "id",
            "name",
            "mimeType",
            "webViewLink",
            "thumbnailLink"
          ]
        },
        "resource": "fileFolder",
        "returnAll": true,
        "queryString": "(mimeType='image/jpeg' or mimeType='image/png' or mimeType='video/mp4') and '13WeDNsMdihc79WNZYOGxZvXU9ea7N4X_' in parents and trashed=false",
        "searchMethod": "query"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "CnU44UbBjK0GdP6C",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3,
      "alwaysOutputData": true
    },
    {
      "id": "241c082a-a8b8-429c-9c51-5bfc02bad341",
      "name": "下载文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        48,
        112
      ],
      "parameters": {
        "fileId": "={{ $json.id }}",
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "CnU44UbBjK0GdP6C",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "f85f1e8c-26f7-4d5f-98f3-4e803281f13b",
      "name": "上传视频到FB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        0
      ],
      "parameters": {
        "url": "=https://graph-video.facebook.com/v23.0/act_{{ $('Configuration Meta Ads').item.json.ad_account_id }}/advideos",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "source",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "jF7Lc9HyK76Jr9Xm",
          "name": "KH | Facebook Graph"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "f3cc6195-0fc6-46da-af83-fa951d03f307",
      "name": "创建视频创意",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        928,
        0
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/act_{{ $('Configuration Meta Ads').item.json.ad_account_id }}/adcreatives",
        "method": "POST",
        "options": {},
        "jsonBody": "= {\n    \"name\": \"{{ $json.original_file_name }}\",\n    \"object_story_spec\": {\n      \"page_id\": \"{{ $('Configuration Meta Ads').item.json.facebook_page_id }}\",\n      \"video_data\": {\n        \"video_id\": {{ $json.id }},\n        \"image_url\": \"{{ $json.gdrive_thumbnail }}\",\n        \"call_to_action\": {\n          \"type\": \"LEARN_MORE\",\n          \"value\": {\n            \"link\": \"{{ $('Configuration Meta Ads').item.json.website_link }}\" \n          }\n        }\n      }\n    }\n  }",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "jF7Lc9HyK76Jr9Xm",
          "name": "KH | Facebook Graph"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "78fef52e-7594-4c85-8819-d61d59a578f3",
      "name": "是否为视频?",
      "type": "n8n-nodes-base.if",
      "onError": "continueRegularOutput",
      "position": [
        272,
        112
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json.mimeType}}",
              "value2": "video",
              "operation": "contains"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0012adce-7bf4-4464-9316-29cbcddaa945",
      "name": "上传图片到FB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        208
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/act_{{ $('Configuration Meta Ads').item.json.ad_account_id }}/adimages",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "source",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "jF7Lc9HyK76Jr9Xm",
          "name": "KH | Facebook Graph"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "9794be74-adb3-4d40-931a-bedf332c8894",
      "name": "创建图片创意",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        928,
        208
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/act_{{ $('Configuration Meta Ads').item.json.ad_account_id }}/adcreatives",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"name\": \"{{ $json.original_file_name }}\",\n  \"object_story_spec\": {\n    \"page_id\": \"{{ $('Configuration Meta Ads').item.json.facebook_page_id }}\",\n    \"link_data\": {\n      \"image_hash\": \"{{ $json.image_hash }}\",\n      \"link\": \"{{ $('Configuration Meta Ads').item.json.website_link }}\",\n      \"message\": \"{{ $('Configuration Meta Ads').item.json.primary_text }}\"\n    }\n  }\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "jF7Lc9HyK76Jr9Xm",
          "name": "KH | Facebook Graph"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "0a11fc61-53af-4612-9036-600cc2813742",
      "name": "合并创意",
      "type": "n8n-nodes-base.merge",
      "position": [
        1360,
        112
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8b9532ca-a10a-4058-bc8c-1558adf2e648",
      "name": "创建广告系列",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2000,
        192
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/act_{{ $('Configuration Meta Ads').item.json.ad_account_id }}/campaigns",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"name\": \"{{ $('Configuration Meta Ads').item.json.campaign_name }}_{{ $now.toFormat('ddMMyyyy') }} \",\n  \"objective\": \"OUTCOME_SALES\",\n  \"status\": \"PAUSED\",\n  \"special_ad_categories\": [\"NONE\"]\n} ",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "jF7Lc9HyK76Jr9Xm",
          "name": "KH | Facebook Graph"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "9dc72e2c-f55a-48fb-a55e-d6f03df771dd",
      "name": "运行一次",
      "type": "n8n-nodes-base.function",
      "position": [
        1808,
        192
      ],
      "parameters": {
        "functionCode": "return [items[0]];"
      },
      "typeVersion": 1
    },
    {
      "id": "ed721aee-16d1-4be2-9d28-dd481a483cb9",
      "name": "创建广告组",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2240,
        192
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/act_{{ $('Configuration Meta Ads').item.json.ad_account_id }}/adsets",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"name\": \"{{ $('Configuration Meta Ads').item.json.campaign_name }}_{{ $now.toFormat('ddMMyyyy') }}\",\n    \"campaign_id\": \"{{ $('Create Campaign').item.json.id }}\",\n    \"status\": \"PAUSED\",\n    \"daily_budget\": \"500\",\n    \"billing_event\": \"IMPRESSIONS\",\n    \"optimization_goal\": \"OFFSITE_CONVERSIONS\",\n    \"bid_strategy\": \"LOWEST_COST_WITHOUT_CAP\",\n    \"promoted_object\": {\n      \"pixel_id\": \"{{ $('Configuration Meta Ads').item.json.pixel_id }}\",\n      \"custom_event_type\": \"{{ $('Configuration Meta Ads').item.json.custom_event_type }}\"\n    },\n    \"targeting\": {\n      \"geo_locations\": {\n        \"countries\": [\"US\"]\n      }\n    }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "jF7Lc9HyK76Jr9Xm",
          "name": "KH | Facebook Graph"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "dcb3cef6-8199-485e-afe4-2985c60edbea",
      "name": "创建广告",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2912,
        128
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v23.0/act_{{ $('Configuration Meta Ads').item.json.ad_account_id }}/ads",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"name\": \"{{ $json.original_file_name }}\",\n  \"adset_id\": \"{{ $json.adset_id }}\",\n  \"creative\": {\n    \"creative_id\": \"{{ $json.creative_id }}\"\n  },\n  \"status\": \"PAUSED\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "facebookGraphApi"
      },
      "credentials": {
        "facebookGraphApi": {
          "id": "jF7Lc9HyK76Jr9Xm",
          "name": "KH | Facebook Graph"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "5e5996f9-963e-4d7f-aee3-22c176330f88",
      "name": "设置视频ID",
      "type": "n8n-nodes-base.set",
      "position": [
        704,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b01f8524-afad-4883-9cbe-f06a93fa4426",
              "name": "video_id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "baf0386f-2b61-48fd-b56c-038da1863dcb",
              "name": "original_file_name",
              "type": "string",
              "value": "={{ $('Download Files').item.json.name }}"
            },
            {
              "id": "3601abec-94a1-41c1-960f-0b82bbd412c0",
              "name": "gdrive_thumbnail",
              "type": "string",
              "value": "={{ $('Files search').item.json.thumbnailLink }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "faaf5a39-e216-49d4-9acd-6549a2689574",
      "name": "设置图片哈希",
      "type": "n8n-nodes-base.set",
      "position": [
        704,
        208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ffa240cc-562b-42ce-9d98-5416dc2a0837",
              "name": "image_hash",
              "type": "string",
              "value": "={{ $json.images[Object.keys($json.images)[0]].hash }}"
            },
            {
              "id": "66fb209f-2ed1-457a-b47c-d4d4121a7fed",
              "name": "original_file_name",
              "type": "string",
              "value": "={{ $('Download Files').item.json.name }}"
            },
            {
              "id": "2b926bc5-8b21-405d-95ad-d11055085bac",
              "name": "mimeType",
              "type": "string",
              "value": "={{ $('Download Files').item.json.mimeType }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "666a6d2b-2235-4bbb-9638-f797890aeceb",
      "name": "设置图片包",
      "type": "n8n-nodes-base.set",
      "position": [
        1152,
        208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8c58c05d-2567-468e-a779-6ce3c66cc86b",
              "name": "creative_id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "51a5471a-ff13-43b9-b4e7-99602127e409",
              "name": "original_file_name",
              "type": "string",
              "value": "={{ $('Download Files').item.json.name }}"
            },
            {
              "id": "6f14e0f0-39a0-41d3-b680-13c03e0db4f8",
              "name": "mimeType",
              "type": "string",
              "value": "={{ $('Download Files').item.json.mimeType }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "f23f450b-5cb3-4810-a868-e1927062bf73",
      "name": "设置视频包",
      "type": "n8n-nodes-base.set",
      "position": [
        1152,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3cdcfd45-591e-40ec-8ebd-85c31ea304ff",
              "name": "creative_id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "c89d9f80-4456-4ab8-817b-029eafba4c0c",
              "name": "original_file_name",
              "type": "string",
              "value": "={{ $('Download Files').item.json.name }}"
            },
            {
              "id": "ea613906-b112-4af9-b403-7e0384e5b6af",
              "name": "mimeType",
              "type": "string",
              "value": "={{ $('Download Files').item.json.mimeType }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "0d3d9123-6d41-4008-9ef0-71f579b67d47",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        2688,
        128
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.1
    },
    {
      "id": "50346204-5f36-46b2-8a02-2b891b87732a",
      "name": "保存广告组ID",
      "type": "n8n-nodes-base.set",
      "position": [
        2464,
        192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9f5890a8-862c-4c14-8f9b-2aba99564cb3",
              "name": "adset_id",
              "type": "string",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a9ae4171-32f9-4c18-8500-966fa0874a2b",
      "name": "保存完整报告到表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3120,
        128
      ],
      "parameters": {
        "columns": {
          "value": {
            "AdID": "={{ $json.id }}",
            "Type": "={{ $('Merge').item.json.mimeType }}",
            "AdsetID": "={{ $('Create Ad Set').item.json.id }}",
            "FileName": "={{ $('Merge').item.json.original_file_name }}",
            "Timestamp": "={{$now.toFormat('ddMMyyyy')}}",
            "CampaignID": "={{ $('Create Campaign').item.json.id }}",
            "CreativeID": "={{ $('Merge').item.json.creative_id }}"
          },
          "schema": [
            {
              "id": "FileName",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "FileName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CreativeID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "CreativeID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CampaignID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "CampaignID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AdsetID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "AdsetID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AdID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "AdID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "CreativeID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gwBOLHpez5fFX9C2m6PoZcsw5LLcjjbR7448jn6cimw/edit#gid=0",
          "cachedResultName": "Creatives"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1gwBOLHpez5fFX9C2m6PoZcsw5LLcjjbR7448jn6cimw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gwBOLHpez5fFX9C2m6PoZcsw5LLcjjbR7448jn6cimw/edit?usp=drivesdk",
          "cachedResultName": "AutoTest_of_Creatives_v2"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "0drwHzGo1eKmiTc6",
          "name": "KH | Google Sheets "
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "ce0b1a97-e852-40fe-a97e-9eac57d1f450",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1088,
        -144
      ],
      "parameters": {
        "width": 820,
        "height": 460,
        "content": "## 每周 CPA 创意测试"
      },
      "typeVersion": 1
    },
    {
      "id": "1537fd95-1641-4864-815c-51aadea2f013",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -368
      ],
      "parameters": {
        "color": 5,
        "width": 780,
        "height": 400,
        "content": "## 模块 2:创意处理流水线"
      },
      "typeVersion": 1
    },
    {
      "id": "541bfe94-ce33-4a3f-bc50-a5b9ca3c5ca5",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        368
      ],
      "parameters": {
        "color": 4,
        "width": 900,
        "height": 340,
        "content": "## 模块 3:广告系列组装"
      },
      "typeVersion": 1
    },
    {
      "id": "025d1611-a810-4d63-b990-f5ee62ed1844",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2800,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 660,
        "height": 280,
        "content": "## 模块 4:广告创建与报告"
      },
      "typeVersion": 1
    },
    {
      "id": "544b278e-5d42-4581-81ad-778c018072fb",
      "name": "Meta广告配置",
      "type": "n8n-nodes-base.set",
      "position": [
        -400,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4311f042-4f51-4fc7-a8b8-59b9d9f59c0a",
              "name": "ad_account_id",
              "type": "string",
              "value": "put_your_ad_account_id_here"
            },
            {
              "id": "a25a0304-d4eb-45e9-9d7e-aaaa36a352c4",
              "name": "facebook_page_id",
              "type": "string",
              "value": "put_your_facebook_page_id_here"
            },
            {
              "id": "2537665f-2942-4c1f-8352-12252e571903",
              "name": "campaign_name",
              "type": "string",
              "value": "put_your_campaign_name_here"
            },
            {
              "id": "b7053a2f-b4c4-4acf-b21d-ac580c119154",
              "name": "custom_event_type",
              "type": "string",
              "value": "ADD_TO_CART"
            },
            {
              "id": "2d6813cd-0169-4868-bd26-ae2d830538e5",
              "name": "website_link",
              "type": "string",
              "value": "https://www.put_your__websitelink_here.com"
            },
            {
              "id": "08b4fb19-11fe-49e4-8c70-96b498c83f80",
              "name": "pixel_id",
              "type": "string",
              "value": "put_your_pixel_id_here"
            },
            {
              "id": "76f5d7bd-b5fc-49d0-8964-673474b40478",
              "name": "primary_text",
              "type": "string",
              "value": "put your primary text here"
            },
            {
              "id": "8abc5b0c-c232-4a8a-9fa5-a8791414c480",
              "name": "headline",
              "type": "string",
              "value": "put your headline here"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5f066785-00fc-4416-9df2-23f9ec6a3a9a",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Create Ad",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Once": {
      "main": [
        [
          {
            "node": "Create Campaign",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Ad": {
      "main": [
        [
          {
            "node": "Save Full Report to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Files search": {
      "main": [
        [
          {
            "node": "Download Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Video ID": {
      "main": [
        [
          {
            "node": "Create Video Creative",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Ad Set": {
      "main": [
        [
          {
            "node": "Save Adset Id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Adset Id": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Download Files": {
      "main": [
        [
          {
            "node": "Is it a Video?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is it a Video?": {
      "main": [
        [
          {
            "node": "Upload Video to FB",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload Image to FB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Image Hash": {
      "main": [
        [
          {
            "node": "Create Image Creative",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Campaign": {
      "main": [
        [
          {
            "node": "Create Ad Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Creatives": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          },
          {
            "node": "Run Once",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Configuration Meta Ads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Image Packet": {
      "main": [
        [
          {
            "node": "Merge Creatives",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Set Video Packet": {
      "main": [
        [
          {
            "node": "Merge Creatives",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image to FB": {
      "main": [
        [
          {
            "node": "Set Image Hash",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video to FB": {
      "main": [
        [
          {
            "node": "Set Video ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Image Creative": {
      "main": [
        [
          {
            "node": "Set Image Packet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Video Creative": {
      "main": [
        [
          {
            "node": "Set Video Packet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration Meta Ads": {
      "main": [
        [
          {
            "node": "Files search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 社交媒体

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流